@trippler/tr_lib 2.8.0 → 2.9.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/dom/index.d.ts +2 -0
- package/client/dom/index.js +17 -0
- package/client/index.d.ts +2 -0
- package/client/index.js +2 -0
- package/client/nuiFocus/index.js +1 -1
- package/package.json +1 -1
- package/web/dom/index.d.ts +1 -0
- package/web/dom/index.js +4 -0
- package/web/index.d.ts +2 -0
- package/web/index.js +2 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import onNuiCallback from "../nuiCallback/onNuiCallback";
|
|
2
|
+
let domLoaded = false;
|
|
3
|
+
onNuiCallback('__DOMLoaded', () => domLoaded = true);
|
|
4
|
+
export default (Function) => {
|
|
5
|
+
return new Promise(resolve => {
|
|
6
|
+
if (domLoaded) {
|
|
7
|
+
Function();
|
|
8
|
+
resolve(true);
|
|
9
|
+
}
|
|
10
|
+
else {
|
|
11
|
+
onNuiCallback('__DOMLoaded', () => {
|
|
12
|
+
Function();
|
|
13
|
+
resolve(true);
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
};
|
package/client/index.d.ts
CHANGED
|
@@ -4,4 +4,6 @@ export { default as onPromise } from './promise/onPromise';
|
|
|
4
4
|
export { default as requestModel } from './request';
|
|
5
5
|
export { default as awaitInstanceExisting } from './existing';
|
|
6
6
|
export { default as control } from './control';
|
|
7
|
+
export { default as onDOMLoaded } from './dom';
|
|
7
8
|
export * from './promise/triggerPromise';
|
|
9
|
+
import './nuiFocus';
|
package/client/index.js
CHANGED
|
@@ -4,4 +4,6 @@ export { default as onPromise } from './promise/onPromise';
|
|
|
4
4
|
export { default as requestModel } from './request';
|
|
5
5
|
export { default as awaitInstanceExisting } from './existing';
|
|
6
6
|
export { default as control } from './control';
|
|
7
|
+
export { default as onDOMLoaded } from './dom';
|
|
7
8
|
export * from './promise/triggerPromise';
|
|
9
|
+
import './nuiFocus';
|
package/client/nuiFocus/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trippler/tr_lib",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.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",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/web/dom/index.js
ADDED
package/web/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare global {
|
|
2
2
|
const GetParentResourceName: () => string;
|
|
3
3
|
}
|
|
4
|
+
import './dom';
|
|
4
5
|
export { default as onNuiCallback } from './onNuiCallback';
|
|
5
6
|
export { default as triggerNuiCallback } from './triggerNuiCallback';
|
|
7
|
+
export { default as nuiFocus } from './nuiFocus';
|
package/web/index.js
CHANGED