@trippler/tr_lib 2.10.1 → 2.10.3

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/Readme.md CHANGED
@@ -23,10 +23,12 @@ https://docs.trippler.store/tr_lib
23
23
  [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/TripplerScripts/tr_lib)
24
24
 
25
25
  ## 🗺️ Roadmap
26
- - [ ] add modules that serverify and clientify (asServer asClient)
27
- - [ ] add client and server metadata communication module instead of heating events
28
- - [ ] add controlled commands
26
+ - [ ] add modules that serverify and clientify (asServer asClient)
27
+ - [ ] add client and server metadata communication module instead of heating events
28
+ - [ ] add controlled commands
29
29
  - [ ] fix keybinds indexes
30
+ - [ ] ADD A DIRECT SAFE CONNECTION BETWEEN NUI AND THE SERVER
31
+ - [ ] a solution for the coords from the lua vectors
30
32
 
31
33
  ## 🧾License
32
34
  ![](https://img.shields.io/npm/l/%40trippler%2Ftr_lib)
@@ -1 +1 @@
1
- export declare const triggerPromise: <T = unknown>(options: [number, boolean] | number | boolean | string, endpoint?: string | any, ...parameters: any[]) => Promise<T | null>;
1
+ export declare const triggerPromise: <T = unknown>(options: [number, boolean] | number | boolean | string, endpoint?: string | any, ...parameters: any[]) => Promise<T | []>;
@@ -51,5 +51,5 @@ export const triggerPromise = async (options, endpoint, ...parameters) => {
51
51
  trace(`server promise ${endpoint} timed out after ${timeout}ms, possible slow respose or promise does not exist`);
52
52
  }
53
53
  }
54
- return null;
54
+ return [];
55
55
  };
@@ -1,2 +1,2 @@
1
- declare const _default: (keyboard: boolean, cursor: boolean) => Promise<unknown>;
1
+ declare const _default: (keyboard?: boolean, cursor?: boolean) => Promise<unknown>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
1
  import triggerNuiCallback from "../triggerNuiCallback";
2
- export default (keyboard, cursor) => triggerNuiCallback('__nuiFocus', [keyboard, cursor]);
2
+ export default (keyboard = true, cursor = true) => triggerNuiCallback('__nuiFocus', [keyboard, cursor]);
@@ -1,12 +1,12 @@
1
1
  export default async (endpoint, parameters) => {
2
- const response = await fetch(`https://${GetParentResourceName()}/${endpoint}`, {
3
- method: 'POST',
4
- headers: {
5
- 'Content-Type': 'application/json; charset=UTF-8',
6
- },
7
- body: JSON.stringify(parameters || {}),
8
- });
9
2
  try {
3
+ const response = await fetch(`https://${GetParentResourceName()}/${endpoint}`, {
4
+ method: 'POST',
5
+ headers: {
6
+ 'Content-Type': 'application/json; charset=UTF-8',
7
+ },
8
+ body: JSON.stringify(parameters || {}),
9
+ });
10
10
  return await response.json();
11
11
  }
12
12
  catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trippler/tr_lib",
3
- "version": "2.10.1",
3
+ "version": "2.10.3",
4
4
  "description": "A lightweight utility & helper library for FiveM developers. Designed to improve code reusability, consistency, and performance across and outcross Trippler resources.",
5
5
  "author": "Trippler",
6
6
  "license": "GPL-3.0",
@@ -1 +1 @@
1
- export declare const triggerPromise: <T = unknown>(options: [number, boolean] | number | boolean | string, endpoint: string | number, source?: number, ...parameters: any[]) => Promise<T | null>;
1
+ export declare const triggerPromise: <T = unknown>(options: [number, boolean] | number | boolean | string, endpoint: string | number, source?: number, ...parameters: any[]) => Promise<T | []>;
@@ -52,5 +52,5 @@ export const triggerPromise = async (options, endpoint, source, ...parameters) =
52
52
  trace(`client #${source} promise ${endpoint} timed out after ${timeout}ms`);
53
53
  }
54
54
  }
55
- return null;
55
+ return [];
56
56
  };