chore: types

mostly types anyway.
This commit is contained in:
Linden
2023-07-31 16:29:27 +10:00
parent f11668b95c
commit 9d98b9aada
6 changed files with 59 additions and 51 deletions

View File

@@ -1,5 +1,5 @@
---@alias NotificationPosition 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left' | 'center-right' | 'center-left'
---@alias NotificationType 'inform' | 'warning' | 'success' | 'error'
---@alias NotificationType 'info' | 'warning' | 'success' | 'error'
---@class NotifyProps
---@field id? string
@@ -12,7 +12,9 @@
---@field icon? string | {[1]: IconProp, [2]: string};
---@field iconColor? string;
---`client`
---@param data NotifyProps
---@diagnostic disable-next-line: duplicate-set-field
function lib.notify(data)
SendNUIMessage({
action = 'notify',
@@ -33,7 +35,7 @@ function lib.defaultNotify(data)
-- Backwards compat for v3
data.type = data.status
if data.type == 'inform' then data.type = 'info' end
return lib.notify(data)
return lib.notify(data --[[@as NotifyProps]])
end
RegisterNetEvent('ox_lib:notify', lib.notify)