2022-04-11 03:52:18 +00:00
|
|
|
--[[```lua
|
|
|
|
|
{
|
|
|
|
|
id?: string
|
|
|
|
|
title?: string
|
|
|
|
|
description: string
|
|
|
|
|
duration?: number
|
|
|
|
|
position?: 'top' | 'top-right' | 'top-left' | 'bottom' | 'bottom-right' | 'bottom-left'
|
|
|
|
|
style?: table
|
|
|
|
|
icon?: string
|
|
|
|
|
iconColor?: string
|
|
|
|
|
}
|
|
|
|
|
```]]
|
2022-04-16 12:03:50 +02:00
|
|
|
|
|
|
|
|
-- Custom notifications with a lot of allowed styling
|
2022-04-11 03:52:18 +00:00
|
|
|
---@param data table
|
|
|
|
|
function lib.notify(data)
|
|
|
|
|
SendNUIMessage({
|
|
|
|
|
action = 'customNotify',
|
|
|
|
|
data = data
|
|
|
|
|
})
|
|
|
|
|
end
|
2022-04-11 04:59:21 +00:00
|
|
|
|
2022-04-16 12:03:50 +02:00
|
|
|
-- Default Chakra UI notifications
|
|
|
|
|
function lib.defaultNotify(data)
|
|
|
|
|
SendNUIMessage({
|
|
|
|
|
action = 'notify',
|
|
|
|
|
data = data
|
|
|
|
|
})
|
|
|
|
|
end
|
|
|
|
|
|
2022-04-11 04:59:21 +00:00
|
|
|
RegisterNetEvent('ox_lib:notify', lib.notify)
|
2022-05-03 21:57:41 +02:00
|
|
|
RegisterNetEvent('ox_lib:defaultNotify', lib.defaultNotify)
|