refactor(resource/interface): formatting and type definitions

This commit is contained in:
Linden
2022-09-18 09:06:32 +10:00
parent cb645ae345
commit 6254ba9ba2
8 changed files with 388 additions and 265 deletions

View File

@@ -1,5 +1,13 @@
local alert = nil
---@class AlertDialogProps
---@field header string;
---@field content string;
---@field centered? boolean?;
---@field cancel? boolean?;
---@param data AlertDialogProps
---@return 'cancel' | 'confirm' | nil
function lib.alertDialog(data)
if alert then return end
alert = promise.new()
@@ -21,4 +29,4 @@ RegisterNUICallback('closeAlert', function(data, cb)
promise:resolve(data)
end)
RegisterNetEvent('ox_lib:alertDialog', lib.alertDialog)
RegisterNetEvent('ox_lib:alertDialog', lib.alertDialog)