@cybermp-community/client-types 2.5.6 โ†’ 2.6.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/README.md CHANGED
@@ -1,41 +1,66 @@
1
1
  # CyberMP Client Types
2
2
 
3
- This repository contains the TypeScript type definitions for the **[CyberMP](https://cyber.mp) multiplayer client**, providing comprehensive type safety and IntelliSense support for client-side development within the Cyberpunk 2077 game environment.
3
+ `@cybermp-community/client-types` types the global `mp` inside the player's game. `mp.game` covers Cyberpunk 2077 2.5 classes, enums, and bitfields, plus the libraries shipped with the client:
4
4
 
5
- These types cover the `mp` object, the game's internal classes, enums, and bitfields.
5
+ - [Codeware](https://github.com/psiberx/cp2077-codeware) 1.21.1
6
+ - [ArchiveXL](https://github.com/psiberx/cp2077-archive-xl) 1.28.0
7
+ - [TweakXL](https://github.com/psiberx/cp2077-tweak-xl) 1.12.0
6
8
 
7
- ### ๐Ÿ–ฅ๏ธ Integrated Libraries (which supports CyberMP)
8
- This package includes built-in types for the following essential modding libraries, providing full type safety and IntelliSense for their respective classes and functions:
9
+ ## Installation
9
10
 
10
- - **Cyberpunk 2077 2.31**
11
- - **[Codeware](https://github.com/psiberx/cp2077-codeware) v1.18.0**
12
- - **[ArchiveXL](https://github.com/psiberx/cp2077-archive-xl) v1.26.0**
13
- - **[TweakXL](https://github.com/psiberx/cp2077-tweak-xl) v1.11.0**
11
+ ```bash
12
+ # npm
13
+ npm install -D @cybermp-community/client-types
14
+
15
+ # pnpm
16
+ pnpm add -D @cybermp-community/client-types
17
+
18
+ # bun
19
+ bun add -d @cybermp-community/client-types
20
+ ```
14
21
 
15
- ## ๐Ÿ“ฆ Installation
22
+ ## Usage
16
23
 
17
- Using NPM:
24
+ `client/global.d.ts`:
18
25
 
19
- ```bash
20
- npm install -D @cybermp-community/client-types
26
+ ```ts
27
+ import type { MpClient } from "@cybermp-community/client-types";
28
+
29
+ declare global {
30
+ const mp: MpClient;
31
+ }
21
32
  ```
22
33
 
23
- Using PNPM:
34
+ `client/index.ts` runs inside Cyberpunk 2077 after the server delivers the compiled script:
24
35
 
25
- ```bash
26
- pnpm install -D @cybermp-community/client-types
36
+ ```ts
37
+ mp.game.onInit(() => {
38
+ mp.cef.setUrl("http://localhost:5173");
39
+ });
40
+
41
+ mp.events.emitServer("requestItem", "Items.Preset_Silverhand_3516");
42
+
43
+ mp.events.onServer("giveItem", (itemName: string) => {
44
+ mp.game.AddToInventory(itemName, 1);
45
+ });
46
+
47
+ mp.events.onCef("ui:ready", () => {
48
+ mp.cef.setFocus(true, true);
49
+ });
27
50
  ```
28
51
 
29
- Using Bun:
52
+ Enums and bitfields are imported as values. `mp` stays the runtime global.
30
53
 
31
- ```bash
32
- bun add -d @cybermp-community/client-types
54
+ ```ts
55
+ import { AICoverExposureMethod } from "@cybermp-community/client-types";
33
56
  ```
34
57
 
35
- ## ๐Ÿ“œ Disclaimer
58
+ Put `global.d.ts` next to the client scripts so `include` in `tsconfig.json` picks it up.
59
+
60
+ ## Disclaimer
36
61
 
37
- This repository is developed by [CyberMP Community Developers](https://gitlab.com/cybermp) and is not directly related to CyberMP (cyber.mp).
62
+ This repository is developed by [CyberMP Community Developers](https://gitlab.com/cybermp) and is separate from CyberMP (cyber.mp).
38
63
 
39
- ## โš–๏ธ License
64
+ ## License
40
65
 
41
- This project is licensed under the ะกะก BY-SA 4.0 License - see the [LICENSE](LICENSE) file for details.
66
+ CC BY-SA 4.0. See the [LICENSE](LICENSE) file for details.