@trippler/tr_lib 2.1.0 → 2.2.0

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/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as onNuiCallback } from './nuiCallback/onNuiCallback';
1
2
  export { default as onPromise } from './promise/onPromise';
2
3
  export * from './promise/triggerPromise';
3
4
  export * from '../shared/console';
package/client/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { default as onNuiCallback } from './nuiCallback/onNuiCallback';
1
2
  export { default as onPromise } from './promise/onPromise';
2
3
  export * from './promise/triggerPromise';
3
4
  export * from '../shared/console';
@@ -1,2 +1,2 @@
1
- declare function RegisterNuiCallback<T = any>(callbackType: string, callback: (data: T, callback: Function) => void): void;
2
- declare const GetParentResourceName: () => string;
1
+ declare const _default: <T = unknown>(callbackType: string, Function: (data: T, callback: Function) => void) => void;
2
+ export default _default;
@@ -1 +1 @@
1
- "use strict";
1
+ export default (callbackType, Function) => RegisterNuiCallback(callbackType, Function);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trippler/tr_lib",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
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",
@@ -17,20 +17,23 @@
17
17
  "exports": {
18
18
  "./client": "./client/index.js",
19
19
  "./server": "./server/index.js",
20
- "./shared": "./shared/index.js"
20
+ "./shared": "./shared/index.js",
21
+ "./web": "./web/index.js"
21
22
  },
22
23
  "files": [
23
24
  "client",
24
25
  "server",
25
26
  "shared",
27
+ "web",
26
28
  "README.md"
27
29
  ],
28
30
  "scripts": {
29
31
  "patch": "npm version patch && npm publish",
30
- "build": "npm run build:shared && npm run build:client && npm run build:server",
32
+ "build": "npm run build:shared && npm run build:client && npm run build:server && npm run build:web",
31
33
  "build:client": "npx tsc -p src/client/tsconfig.json",
32
34
  "build:server": "npx tsc -p src/server/tsconfig.json",
33
- "build:shared": "npx tsc -p src/shared/tsconfig.json"
35
+ "build:shared": "npx tsc -p src/shared/tsconfig.json",
36
+ "build:web": "npx tsc -p src/web/tsconfig.json"
34
37
  },
35
38
  "devDependencies": {
36
39
  "@citizenfx/client": "^2.0.23683-1",
package/web/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ declare global {
2
+ const GetParentResourceName: () => string;
3
+ }
4
+ export { default as triggerNuiCallback } from './triggerNuiCallback';
package/web/index.js ADDED
@@ -0,0 +1 @@
1
+ export { default as triggerNuiCallback } from './triggerNuiCallback';
@@ -0,0 +1,2 @@
1
+ declare const _default: <T = unknown>(callbackEnpoint: string, dataObject?: object) => Promise<T>;
2
+ export default _default;
@@ -1,4 +1,4 @@
1
- export const triggerNuiCallback = async (callbackEnpoint, dataObject) => {
1
+ export default async (callbackEnpoint, dataObject) => {
2
2
  const response = await fetch(`https://${GetParentResourceName()}/${callbackEnpoint}`, {
3
3
  method: 'POST',
4
4
  headers: {
@@ -1 +0,0 @@
1
- export declare const triggerNuiCallback: <T = unknown>(callbackEnpoint: string, dataObject?: object) => Promise<T>;