@cybermp-community/server-types 1.0.4 → 1.0.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cybermp-community/server-types",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "TypeScript type definitions for the CyberMP server-side environment.",
5
5
  "license": "MIT",
6
6
  "author": {
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
  }
@@ -32,7 +32,7 @@ export interface MpServer {
32
32
  */
33
33
  isServer(): boolean;
34
34
 
35
- config: MpServ.ServerConfig;
35
+ config: MpServ.ServerConfig & Record<string, string>;
36
36
  }
37
37
 
38
38
  export const mp: MpServer;
@@ -18,6 +18,10 @@ export interface MpResources {
18
18
  */
19
19
  stop(resourceName: string): void;
20
20
 
21
+ /**
22
+ * Restarts a specific resource by name.
23
+ * @param resourceName Name of the resource to restart.
24
+ */
21
25
  restart(resourceName: string): void;
22
26
 
23
27
  /**
@@ -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
- mutePlayer(player: MpPlayer | number): void;
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
  }