@rpgjs/server 5.0.0-alpha.5 → 5.0.0-alpha.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.
@@ -0,0 +1,30 @@
1
+ import { PlayerCtor } from '@rpgjs/common';
2
+ /**
3
+ * Variable Manager Mixin
4
+ *
5
+ * Provides variable management capabilities to any class. Variables are key-value
6
+ * pairs that can store any type of data associated with the player, such as
7
+ * quest progress, game flags, inventory state, and custom game data.
8
+ *
9
+ * @param Base - The base class to extend with variable management
10
+ * @returns Extended class with variable management methods
11
+ *
12
+ * @example
13
+ * ```ts
14
+ * class MyPlayer extends WithVariableManager(BasePlayer) {
15
+ * constructor() {
16
+ * super();
17
+ * // Variables are automatically initialized
18
+ * }
19
+ * }
20
+ *
21
+ * const player = new MyPlayer();
22
+ * player.setVariable('questCompleted', true);
23
+ * ```
24
+ */
25
+ export declare function WithVariableManager<TBase extends PlayerCtor>(Base: TBase): TBase;
26
+ /**
27
+ * Type helper to extract the interface from the WithVariableManager mixin
28
+ * This provides the type without duplicating method signatures
29
+ */
30
+ export type IVariableManager = InstanceType<ReturnType<typeof WithVariableManager>>;