@nativewrappers/common 0.0.64 → 0.0.75
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/GlobalData.d.ts +1 -0
- package/README.md +45 -0
- package/decors/Events.d.ts +41 -1
- package/index.js +1480 -8
- package/package.json +7 -2
- package/utils/PointF.d.ts +0 -5
- package/Command.js +0 -103
- package/Convar.js +0 -50
- package/GlobalData.js +0 -7
- package/Kvp.js +0 -141
- package/Resource.js +0 -47
- package/decors/Events.js +0 -191
- package/net/NetworkedMap.js +0 -243
- package/types.js +0 -1
- package/utils/ClassTypes.js +0 -12
- package/utils/Color.js +0 -25
- package/utils/Maths.js +0 -10
- package/utils/PointF.js +0 -14
- package/utils/Quaternion.js +0 -27
- package/utils/Vector.js +0 -606
- package/utils/Vector2.js +0 -1
- package/utils/Vector3.js +0 -1
- package/utils/Vector4.js +0 -1
- package/utils/cleanPlayerName.js +0 -27
- package/utils/enumValues.js +0 -14
- package/utils/getStringFromUInt8Array.js +0 -10
- package/utils/getUInt32FromUint8Array.js +0 -8
- package/utils/index.js +0 -12
package/GlobalData.d.ts
CHANGED
package/README.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
<h1 align="center">Monorepo for a FiveM server/client wrapper</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<i>🔥 A Javascript/Typescript package for FiveM resource development 🎮</i>
|
|
5
|
+
<br>
|
|
6
|
+
<small>This project is in no way affiliated with FiveM or the Cfx.re Collective.</small>
|
|
7
|
+
</br></br>
|
|
8
|
+
<a href="https://github.com/nativewrappers/nativewrappers/blob/master/LICENSE">
|
|
9
|
+
<img src="https://img.shields.io/badge/License-MIT-blue.svg?style=flat" alt="License: MIT">
|
|
10
|
+
</a>
|
|
11
|
+
<a href="https://www.npmjs.com/package/@nativewrappers/fivem">
|
|
12
|
+
<img src="https://img.shields.io/npm/v/@nativewrappers/fivem?style=flat" alt="npm version">
|
|
13
|
+
</a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@nativewrappers/fivem">
|
|
15
|
+
<img src="https://img.shields.io/npm/dm/@nativewrappers/fivem?style=flat">
|
|
16
|
+
</a>
|
|
17
|
+
<a href="https://github.com/nativewrappers/nativewrappers/actions/workflows/config.yml">
|
|
18
|
+
<img src="https://github.com/nativewrappers/nativewrappers/actions/workflows/config.yml/badge.svg" alt="Workflow Status">
|
|
19
|
+
</a>
|
|
20
|
+
<a href="https://github.com/nativewrappers/nativewrappers/commits/master">
|
|
21
|
+
<img src="https://img.shields.io/github/last-commit/nativewrappers/fivem.svg?style=flat" alt="Last commit">
|
|
22
|
+
</a>
|
|
23
|
+
</p>
|
|
24
|
+
|
|
25
|
+
<h3 align="center">This project is currently iterating rapidly, there will be breaking changes.</h3>
|
|
26
|
+
|
|
27
|
+
<p align="center">
|
|
28
|
+
<h2 align="center"><a href="https://github.com/nativewrappers/nativewrappers/tree/main/docs">Documentation</a></h2>
|
|
29
|
+
<!-- <a href="https://forum.fivem.net/t/fivem-js-v1-3-2-javascript-typescript-wrapper-now-with-menu-class-nativeui/268640">Forum</a> -->
|
|
30
|
+
</p>
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- No runtime dependencies
|
|
35
|
+
- Entity management through class objects (i.e. `Vehicle` and `Ped` entities)
|
|
36
|
+
- Server and Client side variants on wrapper
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## Download & Install
|
|
40
|
+
```
|
|
41
|
+
pnpm add @nativewrappers/redm # for redm,
|
|
42
|
+
pnpm add @nativewrappers/fivem # for fivem
|
|
43
|
+
pnpm add @nativewrappers/common # for any, should be game agnostic, provides Vector3, decors, kvps, helper functions, etc
|
|
44
|
+
pnpm add @nativewrappers/server # for server
|
|
45
|
+
```
|
package/decors/Events.d.ts
CHANGED
|
@@ -4,11 +4,51 @@ export declare enum ConVarType {
|
|
|
4
4
|
Float = 2,
|
|
5
5
|
Boolean = 3
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Disables pretty printing in error messages
|
|
9
|
+
*/
|
|
10
|
+
export declare const DisablePrettyPrint: () => boolean;
|
|
7
11
|
export declare function Exports(exportName: string): (originalMethod: any, context: ClassMethodDecoratorContext) => void;
|
|
12
|
+
/**
|
|
13
|
+
* Registers the Event call for {@link eventName} to this method.
|
|
14
|
+
*
|
|
15
|
+
* This has internal pretty-printing to make errors easier to track, if
|
|
16
|
+
* you want to disable this you will need to call {@link DisablePrettyPrint}, or if you're
|
|
17
|
+
* using esbuild you can add `REMOVE_EVENT_LOG` to your drop label {@link https://esbuild.github.io/api/#drop-labels}
|
|
18
|
+
*
|
|
19
|
+
* @param eventName the event to bind to
|
|
20
|
+
*/
|
|
8
21
|
export declare function Event(eventName: string): (originalMethod: any, context: ClassMethodDecoratorContext) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Registers the Net Event call for {@link eventName} to this method
|
|
24
|
+
*
|
|
25
|
+
*
|
|
26
|
+
* This has internal pretty-printing to make errors easier to track, if
|
|
27
|
+
* you want to disable this you will need to call {@link DisablePrettyPrint}, or if you're
|
|
28
|
+
* using esbuild you can add `REMOVE_EVENT_LOG` to your drop label {@link https://esbuild.github.io/api/#drop-labels}
|
|
29
|
+
*
|
|
30
|
+
* @param eventName the event to bind this net event to
|
|
31
|
+
* @param remoteOnly if the event should only accept remote calls, if set to true it will ignore any local call via `emit`, defaults to true
|
|
32
|
+
*/
|
|
9
33
|
export declare function NetEvent(eventName: string, remoteOnly?: boolean): (originalMethod: any, context: ClassMethodDecoratorContext) => void;
|
|
34
|
+
/**
|
|
35
|
+
* Registers the NUI Event call for {eventName} to this method, the function signature
|
|
36
|
+
* should be (data: unknown, cb: (data?: any) => void) => void
|
|
37
|
+
* You shoud always execute `cb` with 'ok' if you don't want to send data back to
|
|
38
|
+
* the UI, otherwise you'll cause a network error for the `fetch` request
|
|
39
|
+
* @param eventName the event this will listen for
|
|
40
|
+
*/
|
|
10
41
|
export declare function NuiEvent(eventName: string): (originalMethod: any, context: ClassMethodDecoratorContext) => void;
|
|
11
42
|
type DeserializeFn<T> = (data: T) => unknown;
|
|
12
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Gets the specified `ConVar`s value, this will bind to the param.
|
|
45
|
+
* @param name the convar name
|
|
46
|
+
* @param is_floating_point if the convar is floating point, this should be explicitly set to true if your convar will be a float
|
|
47
|
+
*/
|
|
48
|
+
export declare function ConVar<T>(name: string, is_floating_point?: boolean, deserialize?: DeserializeFn<T>): (_initialValue: any, context: ClassFieldDecoratorContext, ..._args: any[]) => void;
|
|
49
|
+
/**
|
|
50
|
+
* Gets called per server/client tick, this is asyncronous though, if you await
|
|
51
|
+
* in it, it will not be called until whatever was being awaited resolves.
|
|
52
|
+
*/
|
|
13
53
|
export declare function SetTick(): (originalMethod: any, context: ClassMethodDecoratorContext) => void;
|
|
14
54
|
export {};
|