mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
chore: types
mostly types anyway.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user