@trippler/tr_lib 2.7.4 → 2.8.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.
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import onNuiCallback from "../nuiCallback/onNuiCallback";
2
+ onNuiCallback('__nuiFocus', (data, callback) => {
3
+ SetNuiFocus(data[0], data[1]);
4
+ callback(true);
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trippler/tr_lib",
3
- "version": "2.7.4",
3
+ "version": "2.8.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",
@@ -28,7 +28,9 @@
28
28
  "README.md"
29
29
  ],
30
30
  "scripts": {
31
- "patch": "rmdir /s /q client server shared web && npm run build && npm version patch && npm publish",
31
+ "patch": "npm run rebuild && npm version patch && npm publish",
32
+ "minor": "npm run rebuild && npm version minor && npm publish",
33
+ "rebuild": "rmdir /s /q client server shared web 2>nul & npm run build",
32
34
  "build": "npm run build:shared && npm run build:client && npm run build:server && npm run build:web",
33
35
  "build:client": "npx tsc -p src/client/tsconfig.json",
34
36
  "build:server": "npx tsc -p src/server/tsconfig.json",
@@ -0,0 +1,2 @@
1
+ declare const _default: (keyboard: boolean, cursor: boolean) => Promise<unknown>;
2
+ export default _default;
@@ -0,0 +1,2 @@
1
+ import triggerNuiCallback from "../triggerNuiCallback";
2
+ export default (keyboard, cursor) => triggerNuiCallback('__nuiFocus', [keyboard, cursor]);
@@ -2,7 +2,7 @@ import { fatal } from "../../shared";
2
2
  export default (name, Function) => {
3
3
  const handler = (event) => {
4
4
  const { __name, params } = event.data;
5
- if (__name === name && Array.isArray(params)) {
5
+ if (__name === name) {
6
6
  try {
7
7
  Function(...params);
8
8
  }
@@ -10,9 +10,6 @@ export default (name, Function) => {
10
10
  fatal(`Error in '${name}' callback: ${error}`);
11
11
  }
12
12
  }
13
- else {
14
- fatal(`Received invalid message in '${name}' callback: ${JSON.stringify(event.data)}`);
15
- }
16
13
  };
17
14
  window.addEventListener('message', handler);
18
15
  return () => window.removeEventListener('message', handler);