feat(interface/alert): support dialog timeout

closeAlertDialog will now error if a reason is passed.
Added timeout param to alertDialog.
Resolves #522.
This commit is contained in:
Linden
2024-05-08 05:23:27 +10:00
parent b1cb2142f0
commit 43905bdd62
2 changed files with 21 additions and 7 deletions

View File

@@ -13,6 +13,7 @@ interface AlertDialogProps {
type alertDialog = (data: AlertDialogProps) => Promise<'cancel' | 'confirm'>;
export const alertDialog: alertDialog = async (data) => await exports.ox_lib.alertDialog(data);
export const alertDialog: alertDialog = async (data, timeout?: number) =>
await exports.ox_lib.alertDialog(data, timeout);
export const closeAlertDialog = () => exports.ox_lib.closeAlertDialog();
export const closeAlertDialog = (reason?: string) => exports.ox_lib.closeAlertDialog(reason);