Files
ox_lib/package/client/resource/interface/alert.ts
Linden 43905bdd62 feat(interface/alert): support dialog timeout
closeAlertDialog will now error if a reason is passed.
Added timeout param to alertDialog.
Resolves #522.
2024-05-08 05:23:27 +10:00

20 lines
536 B
TypeScript

interface AlertDialogProps {
header: string;
content: string;
centered?: boolean;
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
overflow?: boolean;
cancel?: boolean;
labels?: {
cancel?: string;
confirm?: string;
};
}
type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm'>;
export const alertDialog: alertDialog = async (data, timeout?: number) =>
await exports.ox_lib.alertDialog(data, timeout);
export const closeAlertDialog = (reason?: string) => exports.ox_lib.closeAlertDialog(reason);