@cybermp-community/server-types 1.0.4 → 1.0.6
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 +0 -14
- package/package.json +5 -4
- package/src/hashes.d.ts +20 -0
- package/src/index.ts +13 -0
- package/src/mp/multiplayer.d.ts +1 -1
- package/src/resources.d.ts +4 -0
- package/src/voice-chat.d.ts +18 -1
- package/src/index.d.ts +0 -13
package/README.md
CHANGED
|
@@ -6,8 +6,6 @@ These types are designed to work seamlessly with the CyberMP server environment,
|
|
|
6
6
|
|
|
7
7
|
## 📦 Installation
|
|
8
8
|
|
|
9
|
-
### 1. Install Package
|
|
10
|
-
|
|
11
9
|
Using NPM:
|
|
12
10
|
|
|
13
11
|
```bash
|
|
@@ -26,18 +24,6 @@ Using Bun:
|
|
|
26
24
|
bun add -d @cybermp-community/server-types
|
|
27
25
|
```
|
|
28
26
|
|
|
29
|
-
### 2. Set types in tsconfig.json
|
|
30
|
-
|
|
31
|
-
```json
|
|
32
|
-
{
|
|
33
|
-
"compilerOptions": {
|
|
34
|
-
"types": [
|
|
35
|
-
"@cybermp-community/server-types"
|
|
36
|
-
]
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
27
|
## 📜 Disclaimer
|
|
42
28
|
|
|
43
29
|
This repository is developed by [CyberMP Community Developers](https://gitlab.com/cybermp) and is not directly related to CyberMP (cyber.mp).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cybermp-community/server-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.6",
|
|
4
4
|
"description": "TypeScript type definitions for the CyberMP server-side environment.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": {
|
|
@@ -17,11 +17,12 @@
|
|
|
17
17
|
"publishConfig": {
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
|
-
"
|
|
20
|
+
"main": "./src/index.ts",
|
|
21
|
+
"types": "./src/index.ts",
|
|
21
22
|
"exports": {
|
|
22
23
|
".": {
|
|
23
|
-
"import": "./src/index.
|
|
24
|
-
"types": "./src/index.
|
|
24
|
+
"import": "./src/index.ts",
|
|
25
|
+
"types": "./src/index.ts"
|
|
25
26
|
}
|
|
26
27
|
},
|
|
27
28
|
"files": [
|
package/src/hashes.d.ts
CHANGED
|
@@ -1,7 +1,27 @@
|
|
|
1
1
|
import type { CName, ResRef, TweakDBID } from './shared';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Interface providing utility methods to hash object paths into internal types.
|
|
5
|
+
*/
|
|
3
6
|
export interface MpHashes {
|
|
7
|
+
/**
|
|
8
|
+
* Converts a string path into a TweakDBID hash.
|
|
9
|
+
* @param path - The string path of entry.
|
|
10
|
+
* @returns The corresponding TweakDBID.
|
|
11
|
+
*/
|
|
4
12
|
tweakdbid(path: string): TweakDBID;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Converts a string path into a CName hash.
|
|
16
|
+
* @param path - The string path of entry.
|
|
17
|
+
* @returns The corresponding CName.
|
|
18
|
+
*/
|
|
5
19
|
cname(path: string): CName;
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Converts a string path into a ResRef hash.
|
|
23
|
+
* @param path - The string path of entry.
|
|
24
|
+
* @returns The corresponding ResRef.
|
|
25
|
+
*/
|
|
6
26
|
resref(path: string): ResRef;
|
|
7
27
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export type * from './commands';
|
|
2
|
+
export type * from './entities';
|
|
3
|
+
export type * from './events';
|
|
4
|
+
export type * from './hashes';
|
|
5
|
+
export type * from './meta';
|
|
6
|
+
export type * from './mp';
|
|
7
|
+
export type * from './objects';
|
|
8
|
+
export type * from './peds';
|
|
9
|
+
export type * from './pickups';
|
|
10
|
+
export type * from './resources';
|
|
11
|
+
export type * from './shared';
|
|
12
|
+
export type * from './vehicles';
|
|
13
|
+
export type * from './voice-chat';
|
package/src/mp/multiplayer.d.ts
CHANGED
package/src/resources.d.ts
CHANGED
package/src/voice-chat.d.ts
CHANGED
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import type { MpPlayer } from './entities';
|
|
2
2
|
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the voice chat management system on the server.
|
|
5
|
+
*/
|
|
3
6
|
export interface MpVoiceChat {
|
|
4
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Mutes or unmutes a specific player.
|
|
9
|
+
* @param player - The player instance or their unique ID.
|
|
10
|
+
* @param state - Set to `true` to mute, `false` to unmute.
|
|
11
|
+
*/
|
|
12
|
+
mutePlayer(player: MpPlayer | number, state: boolean): void;
|
|
5
13
|
|
|
14
|
+
/**
|
|
15
|
+
* Creates a new voice chat channel.
|
|
16
|
+
* @param voiceId - The unique identifier for the voice channel.
|
|
17
|
+
*/
|
|
6
18
|
createChannel(voiceId: number): void;
|
|
7
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Checks whether a specific player is currently muted in the voice chat.
|
|
22
|
+
* @param player - The player instance or their unique ID.
|
|
23
|
+
* @returns `true` if the player is muted, `false` otherwise.
|
|
24
|
+
*/
|
|
8
25
|
isPlayerMuted(player: MpPlayer | number): boolean;
|
|
9
26
|
}
|
package/src/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export type * from './commands.d.ts';
|
|
2
|
-
export type * from './entities';
|
|
3
|
-
export type * from './events';
|
|
4
|
-
export type * from './hashes.d.ts';
|
|
5
|
-
export type * from './meta.d.ts';
|
|
6
|
-
export type * from './mp';
|
|
7
|
-
export type * from './objects.d.ts';
|
|
8
|
-
export type * from './peds.d.ts';
|
|
9
|
-
export type * from './pickups.d.ts';
|
|
10
|
-
export type * from './resources.d.ts';
|
|
11
|
-
export type * from './shared';
|
|
12
|
-
export type * from './vehicles.d.ts';
|
|
13
|
-
export type * from './voice-chat.d.ts';
|