lenix 1.7.16 → 1.7.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/client/nui.ts CHANGED
@@ -21,7 +21,12 @@ export const emitEvent = <T extends [string, unknown[]]>(id: T[0], ...params: T[
21
21
  */
22
22
  export const onNui = <T extends Request<unknown, string, object>>(
23
23
  id: T[1],
24
- cb: (data: T[2]) => T[0]
24
+ cb: (data: T[2]) => T[0] | Promise<T[0]>
25
25
  ): void => {
26
- RegisterNuiCallback(id, (data: T[2], reply: (_: unknown) => void) => reply(cb(data)))
26
+ RegisterNuiCallback(id, (
27
+ data: T[2],
28
+ reply: (_: unknown) => void
29
+ ) => {
30
+ reply(cb(data))
31
+ })
27
32
  }
package/nui/trigger.ts CHANGED
@@ -7,7 +7,7 @@ declare function GetParentResourceName(): string
7
7
  */
8
8
  export const triggerNui = async <T extends Request<unknown, string, object>>(
9
9
  id: T[1],
10
- data?: T[2]
10
+ data: T[2]
11
11
  ): Promise<T[0]> => {
12
12
  try {
13
13
  const response = await fetch(`https://${GetParentResourceName()}/${id}`, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lenix",
3
- "version": "1.7.16",
3
+ "version": "1.7.18",
4
4
  "description": "Typed FiveM utilities for client, server, shared, and NUI scripts",
5
5
  "author": "Lenix",
6
6
  "license": "MIT",