steamsheep-ts-game-engine 1.0.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.
@@ -0,0 +1,327 @@
1
+ import * as zustand_middleware from 'zustand/middleware';
2
+ import * as zustand from 'zustand';
3
+ import { L as LogEntry, G as GameState } from './types-CZueoTHl.js';
4
+
5
+ /**
6
+ * 游戏Store操作方法接口 - 定义所有可用的状态操作
7
+ *
8
+ * 这个接口定义了修改游戏状态的所有方法。所有方法都是原子操作,
9
+ * 确保状态更新的一致性和可预测性。
10
+ *
11
+ * @template S - 数值属性键的联合类型
12
+ * @template I - 物品ID的联合类型
13
+ * @template F - 标记键的联合类型
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const useStore = createGameEngineStore(initialState);
18
+ *
19
+ * // 在组件中使用
20
+ * function GameComponent() {
21
+ * const updateStat = useStore(state => state.updateStat);
22
+ * const addItem = useStore(state => state.addItem);
23
+ *
24
+ * const handleAction = () => {
25
+ * updateStat('hp', -10); // 减少10点生命值
26
+ * addItem('potion'); // 获得药水
27
+ * };
28
+ * }
29
+ * ```
30
+ */
31
+ interface GameStoreActions<S extends string, I extends string, F extends string, X = Record<string, unknown>> {
32
+ /**
33
+ * 更新单个数值属性
34
+ *
35
+ * 对指定属性进行增量更新(正数增加,负数减少)。
36
+ * 这是最常用的属性修改方法。
37
+ *
38
+ * @param stat - 要更新的属性键
39
+ * @param delta - 变化量(正数增加,负数减少)
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * updateStat('hp', 20); // 恢复20点生命值
44
+ * updateStat('gold', -50); // 花费50金币
45
+ * ```
46
+ */
47
+ updateStat: (stat: S, delta: number) => void;
48
+ /**
49
+ * 批量更新多个数值属性
50
+ *
51
+ * 一次性更新多个属性,所有更新在同一个状态变更中完成。
52
+ * 适用于需要同时修改多个属性的场景。
53
+ *
54
+ * @param stats - 属性变化的部分记录
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * setStats({ hp: 10, mp: -5, gold: 100 });
59
+ * // 同时增加10点生命值,减少5点魔法值,增加100金币
60
+ * ```
61
+ */
62
+ setStats: (stats: Partial<Record<S, number>>) => void;
63
+ setExtra: (updater: Partial<X> | ((prev: X) => Partial<X>)) => void;
64
+ /**
65
+ * 添加物品到库存
66
+ *
67
+ * 将指定物品添加到玩家的库存中。
68
+ * 同一物品可以多次添加(如多个药水)。
69
+ *
70
+ * @param item - 要添加的物品ID
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * addItem('health_potion');
75
+ * addItem('health_potion'); // 可以添加多个相同物品
76
+ * ```
77
+ */
78
+ addItem: (item: I) => void;
79
+ /**
80
+ * 从库存移除物品
81
+ *
82
+ * 从玩家库存中移除指定物品的一个实例。
83
+ * 如果有多个相同物品,只移除第一个匹配的。
84
+ *
85
+ * @param item - 要移除的物品ID
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * removeItem('health_potion'); // 移除一个生命药水
90
+ * ```
91
+ */
92
+ removeItem: (item: I) => void;
93
+ /**
94
+ * 设置布尔标记
95
+ *
96
+ * 设置或清除游戏标记,用于追踪任务进度、解锁状态等。
97
+ * 标记是游戏逻辑的重要组成部分。
98
+ *
99
+ * @param flag - 标记键
100
+ * @param value - 标记值(true或false)
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * setFlag('quest_completed', true); // 标记任务完成
105
+ * setFlag('door_locked', false); // 解锁门
106
+ * ```
107
+ */
108
+ setFlag: (flag: F, value: boolean) => void;
109
+ /**
110
+ * 添加日志条目
111
+ *
112
+ * ⚠️ 重要:日志是持久化的历史记录
113
+ *
114
+ * 向游戏日志中添加新的消息,用于记录游戏事件。
115
+ * 日志会:
116
+ * - 被保存到 localStorage
117
+ * - 在页面刷新后重新加载
118
+ * - 永久显示在日志面板中
119
+ * - 自动限制在最近50条
120
+ *
121
+ * @param text - 日志文本内容
122
+ * @param type - 日志类型(默认为'info')
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * addLog('你进入了森林', 'info');
127
+ * addLog('击败了哥布林', 'result');
128
+ * addLog('获得了传说武器', 'success');
129
+ * ```
130
+ */
131
+ addLog: (text: string, type?: LogEntry['type']) => void;
132
+ /**
133
+ * 显示飘字通知
134
+ *
135
+ * ⚠️ 重要:飘字是瞬时通知,不会被持久化
136
+ *
137
+ * 显示一个轻量级的飘字提示,会自动消失。
138
+ * 飘字通知:
139
+ * - 不会被保存到 localStorage
140
+ * - 不会在页面刷新后重新出现
141
+ * - 仅在当前会话中显示
142
+ * - 适用于轻量级反馈
143
+ *
144
+ * @param text - 通知文本
145
+ * @param type - 通知类型(默认为'info')
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * showToast('获得 10 金币', 'success');
150
+ * showToast('体力不足', 'warn');
151
+ * ```
152
+ */
153
+ showToast: (text: string, type?: LogEntry['type']) => void;
154
+ /**
155
+ * 显示弹窗通知
156
+ *
157
+ * ⚠️ 重要:弹窗是瞬时通知,不会被持久化
158
+ *
159
+ * 显示一个模态弹窗,需要用户确认才能关闭。
160
+ * 弹窗通知:
161
+ * - 不会被保存到 localStorage
162
+ * - 不会在页面刷新后重新出现
163
+ * - 仅在当前会话中显示
164
+ * - 适用于重要信息和阻塞式交互
165
+ *
166
+ * @param text - 通知文本
167
+ * @param type - 通知类型(默认为'info')
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * showModal('任务完成!获得传说装备', 'success');
172
+ * showModal('警告:此操作不可撤销', 'warn');
173
+ * ```
174
+ */
175
+ showModal: (text: string, type?: LogEntry['type']) => void;
176
+ /**
177
+ * 推进游戏时间
178
+ *
179
+ * 增加游戏内的天数,用于时间相关的游戏机制。
180
+ *
181
+ * @param amount - 要增加的天数(默认为1)
182
+ *
183
+ * @example
184
+ * ```typescript
185
+ * advanceTime(); // 推进1天
186
+ * advanceTime(7); // 推进7天
187
+ * ```
188
+ */
189
+ advanceTime: (amount?: number) => void;
190
+ /**
191
+ * 传送到指定地点
192
+ *
193
+ * 将玩家传送到指定的地点ID。
194
+ * 这是改变玩家位置的主要方法。
195
+ *
196
+ * @param locationId - 目标地点的ID
197
+ *
198
+ * @example
199
+ * ```typescript
200
+ * teleport('town_square'); // 传送到城镇广场
201
+ * teleport('dungeon_1'); // 传送到地牢
202
+ * ```
203
+ */
204
+ teleport: (locationId: string) => void;
205
+ /**
206
+ * 重置游戏状态
207
+ *
208
+ * 将游戏状态重置为初始状态,清空所有日志。
209
+ * 用于开始新游戏或重置当前进度。
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * reset(); // 开始新游戏
214
+ * ```
215
+ */
216
+ reset: () => void;
217
+ /**
218
+ * 保存当前状态快照
219
+ *
220
+ * 将当前游戏状态保存到历史记录中,用于后续的撤销操作。
221
+ * 快照会自动排除日志数据以节省内存。
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * saveSnapshot(); // 在重要操作前保存快照
226
+ * ```
227
+ */
228
+ saveSnapshot: () => void;
229
+ /**
230
+ * 撤销到上一个状态
231
+ *
232
+ * 恢复到上一个保存的快照状态。
233
+ * 如果没有可用的历史记录,操作失败并返回false。
234
+ *
235
+ * @returns 是否成功撤销
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * if (undo()) {
240
+ * console.log('撤销成功');
241
+ * } else {
242
+ * console.log('没有可撤销的历史记录');
243
+ * }
244
+ * ```
245
+ */
246
+ undo: () => boolean;
247
+ }
248
+ /**
249
+ * 游戏Store类型 - 组合数据和操作方法
250
+ *
251
+ * 这是完整的Store类型,包含游戏状态数据和所有操作方法。
252
+ * 使用交叉类型将GameState和GameStoreActions合并。
253
+ *
254
+ * @template S - 数值属性键的联合类型
255
+ * @template I - 物品ID的联合类型
256
+ * @template F - 标记键的联合类型
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * const useGameStore: GameStore<'hp' | 'mp', 'sword', 'quest_done'>;
261
+ * ```
262
+ */
263
+ type GameStore<S extends string, I extends string, F extends string, X = Record<string, unknown>> = GameState<S, I, F, X> & GameStoreActions<S, I, F, X>;
264
+ /**
265
+ * 创建游戏引擎Store的工厂函数
266
+ *
267
+ * 这是创建游戏状态管理Store的核心函数。它使用Zustand创建一个
268
+ * 带有持久化功能的状态管理器,自动将游戏状态保存到localStorage。
269
+ *
270
+ * 工厂模式的优势:
271
+ * - 可以创建多个独立的游戏实例
272
+ * - 每个实例有自己的初始状态和存档名称
273
+ * - 完全的类型安全和泛型支持
274
+ *
275
+ * @template S - 数值属性键的联合类型
276
+ * @template I - 物品ID的联合类型
277
+ * @template F - 标记键的联合类型
278
+ *
279
+ * @param initialState - 游戏的初始状态
280
+ * @param persistName - localStorage中的存档键名(默认:'generic-rpg-save')
281
+ *
282
+ * @returns Zustand store hook,可在React组件中使用
283
+ *
284
+ * @example
285
+ * ```typescript
286
+ * // 定义游戏类型
287
+ * type Stats = 'hp' | 'mp' | 'gold';
288
+ * type Items = 'sword' | 'potion';
289
+ * type Flags = 'quest_completed';
290
+ *
291
+ * // 创建初始状态
292
+ * const initialState: GameState<Stats, Items, Flags> = {
293
+ * stats: { hp: 100, mp: 50, gold: 0 },
294
+ * inventory: [],
295
+ * flags: { quest_completed: false },
296
+ * world: { currentLocationId: 'start', day: 1, time: 0 },
297
+ * logs: []
298
+ * };
299
+ *
300
+ * // 创建store
301
+ * export const useGameStore = createGameEngineStore(
302
+ * initialState,
303
+ * 'my-rpg-save'
304
+ * );
305
+ *
306
+ * // 在组件中使用
307
+ * function GameUI() {
308
+ * const hp = useGameStore(state => state.stats.hp);
309
+ * const updateStat = useGameStore(state => state.updateStat);
310
+ *
311
+ * return <button onClick={() => updateStat('hp', -10)}>受伤</button>;
312
+ * }
313
+ * ```
314
+ */
315
+ declare const createGameEngineStore: <S extends string, I extends string, F extends string, X = Record<string, unknown>>(initialState: GameState<S, I, F, X>, persistName?: string) => zustand.UseBoundStore<Omit<zustand.StoreApi<GameStore<S, I, F, X>>, "persist"> & {
316
+ persist: {
317
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<GameStore<S, I, F, X>, unknown>>) => void;
318
+ clearStorage: () => void;
319
+ rehydrate: () => Promise<void> | void;
320
+ hasHydrated: () => boolean;
321
+ onHydrate: (fn: (state: GameStore<S, I, F, X>) => void) => () => void;
322
+ onFinishHydration: (fn: (state: GameStore<S, I, F, X>) => void) => () => void;
323
+ getOptions: () => Partial<zustand_middleware.PersistOptions<GameStore<S, I, F, X>, unknown>>;
324
+ };
325
+ }>;
326
+
327
+ export { type GameStoreActions as G, type GameStore as a, createGameEngineStore as c };
@@ -0,0 +1,327 @@
1
+ import * as zustand_middleware from 'zustand/middleware';
2
+ import * as zustand from 'zustand';
3
+ import { L as LogEntry, G as GameState } from './types-CZueoTHl.mjs';
4
+
5
+ /**
6
+ * 游戏Store操作方法接口 - 定义所有可用的状态操作
7
+ *
8
+ * 这个接口定义了修改游戏状态的所有方法。所有方法都是原子操作,
9
+ * 确保状态更新的一致性和可预测性。
10
+ *
11
+ * @template S - 数值属性键的联合类型
12
+ * @template I - 物品ID的联合类型
13
+ * @template F - 标记键的联合类型
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const useStore = createGameEngineStore(initialState);
18
+ *
19
+ * // 在组件中使用
20
+ * function GameComponent() {
21
+ * const updateStat = useStore(state => state.updateStat);
22
+ * const addItem = useStore(state => state.addItem);
23
+ *
24
+ * const handleAction = () => {
25
+ * updateStat('hp', -10); // 减少10点生命值
26
+ * addItem('potion'); // 获得药水
27
+ * };
28
+ * }
29
+ * ```
30
+ */
31
+ interface GameStoreActions<S extends string, I extends string, F extends string, X = Record<string, unknown>> {
32
+ /**
33
+ * 更新单个数值属性
34
+ *
35
+ * 对指定属性进行增量更新(正数增加,负数减少)。
36
+ * 这是最常用的属性修改方法。
37
+ *
38
+ * @param stat - 要更新的属性键
39
+ * @param delta - 变化量(正数增加,负数减少)
40
+ *
41
+ * @example
42
+ * ```typescript
43
+ * updateStat('hp', 20); // 恢复20点生命值
44
+ * updateStat('gold', -50); // 花费50金币
45
+ * ```
46
+ */
47
+ updateStat: (stat: S, delta: number) => void;
48
+ /**
49
+ * 批量更新多个数值属性
50
+ *
51
+ * 一次性更新多个属性,所有更新在同一个状态变更中完成。
52
+ * 适用于需要同时修改多个属性的场景。
53
+ *
54
+ * @param stats - 属性变化的部分记录
55
+ *
56
+ * @example
57
+ * ```typescript
58
+ * setStats({ hp: 10, mp: -5, gold: 100 });
59
+ * // 同时增加10点生命值,减少5点魔法值,增加100金币
60
+ * ```
61
+ */
62
+ setStats: (stats: Partial<Record<S, number>>) => void;
63
+ setExtra: (updater: Partial<X> | ((prev: X) => Partial<X>)) => void;
64
+ /**
65
+ * 添加物品到库存
66
+ *
67
+ * 将指定物品添加到玩家的库存中。
68
+ * 同一物品可以多次添加(如多个药水)。
69
+ *
70
+ * @param item - 要添加的物品ID
71
+ *
72
+ * @example
73
+ * ```typescript
74
+ * addItem('health_potion');
75
+ * addItem('health_potion'); // 可以添加多个相同物品
76
+ * ```
77
+ */
78
+ addItem: (item: I) => void;
79
+ /**
80
+ * 从库存移除物品
81
+ *
82
+ * 从玩家库存中移除指定物品的一个实例。
83
+ * 如果有多个相同物品,只移除第一个匹配的。
84
+ *
85
+ * @param item - 要移除的物品ID
86
+ *
87
+ * @example
88
+ * ```typescript
89
+ * removeItem('health_potion'); // 移除一个生命药水
90
+ * ```
91
+ */
92
+ removeItem: (item: I) => void;
93
+ /**
94
+ * 设置布尔标记
95
+ *
96
+ * 设置或清除游戏标记,用于追踪任务进度、解锁状态等。
97
+ * 标记是游戏逻辑的重要组成部分。
98
+ *
99
+ * @param flag - 标记键
100
+ * @param value - 标记值(true或false)
101
+ *
102
+ * @example
103
+ * ```typescript
104
+ * setFlag('quest_completed', true); // 标记任务完成
105
+ * setFlag('door_locked', false); // 解锁门
106
+ * ```
107
+ */
108
+ setFlag: (flag: F, value: boolean) => void;
109
+ /**
110
+ * 添加日志条目
111
+ *
112
+ * ⚠️ 重要:日志是持久化的历史记录
113
+ *
114
+ * 向游戏日志中添加新的消息,用于记录游戏事件。
115
+ * 日志会:
116
+ * - 被保存到 localStorage
117
+ * - 在页面刷新后重新加载
118
+ * - 永久显示在日志面板中
119
+ * - 自动限制在最近50条
120
+ *
121
+ * @param text - 日志文本内容
122
+ * @param type - 日志类型(默认为'info')
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * addLog('你进入了森林', 'info');
127
+ * addLog('击败了哥布林', 'result');
128
+ * addLog('获得了传说武器', 'success');
129
+ * ```
130
+ */
131
+ addLog: (text: string, type?: LogEntry['type']) => void;
132
+ /**
133
+ * 显示飘字通知
134
+ *
135
+ * ⚠️ 重要:飘字是瞬时通知,不会被持久化
136
+ *
137
+ * 显示一个轻量级的飘字提示,会自动消失。
138
+ * 飘字通知:
139
+ * - 不会被保存到 localStorage
140
+ * - 不会在页面刷新后重新出现
141
+ * - 仅在当前会话中显示
142
+ * - 适用于轻量级反馈
143
+ *
144
+ * @param text - 通知文本
145
+ * @param type - 通知类型(默认为'info')
146
+ *
147
+ * @example
148
+ * ```typescript
149
+ * showToast('获得 10 金币', 'success');
150
+ * showToast('体力不足', 'warn');
151
+ * ```
152
+ */
153
+ showToast: (text: string, type?: LogEntry['type']) => void;
154
+ /**
155
+ * 显示弹窗通知
156
+ *
157
+ * ⚠️ 重要:弹窗是瞬时通知,不会被持久化
158
+ *
159
+ * 显示一个模态弹窗,需要用户确认才能关闭。
160
+ * 弹窗通知:
161
+ * - 不会被保存到 localStorage
162
+ * - 不会在页面刷新后重新出现
163
+ * - 仅在当前会话中显示
164
+ * - 适用于重要信息和阻塞式交互
165
+ *
166
+ * @param text - 通知文本
167
+ * @param type - 通知类型(默认为'info')
168
+ *
169
+ * @example
170
+ * ```typescript
171
+ * showModal('任务完成!获得传说装备', 'success');
172
+ * showModal('警告:此操作不可撤销', 'warn');
173
+ * ```
174
+ */
175
+ showModal: (text: string, type?: LogEntry['type']) => void;
176
+ /**
177
+ * 推进游戏时间
178
+ *
179
+ * 增加游戏内的天数,用于时间相关的游戏机制。
180
+ *
181
+ * @param amount - 要增加的天数(默认为1)
182
+ *
183
+ * @example
184
+ * ```typescript
185
+ * advanceTime(); // 推进1天
186
+ * advanceTime(7); // 推进7天
187
+ * ```
188
+ */
189
+ advanceTime: (amount?: number) => void;
190
+ /**
191
+ * 传送到指定地点
192
+ *
193
+ * 将玩家传送到指定的地点ID。
194
+ * 这是改变玩家位置的主要方法。
195
+ *
196
+ * @param locationId - 目标地点的ID
197
+ *
198
+ * @example
199
+ * ```typescript
200
+ * teleport('town_square'); // 传送到城镇广场
201
+ * teleport('dungeon_1'); // 传送到地牢
202
+ * ```
203
+ */
204
+ teleport: (locationId: string) => void;
205
+ /**
206
+ * 重置游戏状态
207
+ *
208
+ * 将游戏状态重置为初始状态,清空所有日志。
209
+ * 用于开始新游戏或重置当前进度。
210
+ *
211
+ * @example
212
+ * ```typescript
213
+ * reset(); // 开始新游戏
214
+ * ```
215
+ */
216
+ reset: () => void;
217
+ /**
218
+ * 保存当前状态快照
219
+ *
220
+ * 将当前游戏状态保存到历史记录中,用于后续的撤销操作。
221
+ * 快照会自动排除日志数据以节省内存。
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * saveSnapshot(); // 在重要操作前保存快照
226
+ * ```
227
+ */
228
+ saveSnapshot: () => void;
229
+ /**
230
+ * 撤销到上一个状态
231
+ *
232
+ * 恢复到上一个保存的快照状态。
233
+ * 如果没有可用的历史记录,操作失败并返回false。
234
+ *
235
+ * @returns 是否成功撤销
236
+ *
237
+ * @example
238
+ * ```typescript
239
+ * if (undo()) {
240
+ * console.log('撤销成功');
241
+ * } else {
242
+ * console.log('没有可撤销的历史记录');
243
+ * }
244
+ * ```
245
+ */
246
+ undo: () => boolean;
247
+ }
248
+ /**
249
+ * 游戏Store类型 - 组合数据和操作方法
250
+ *
251
+ * 这是完整的Store类型,包含游戏状态数据和所有操作方法。
252
+ * 使用交叉类型将GameState和GameStoreActions合并。
253
+ *
254
+ * @template S - 数值属性键的联合类型
255
+ * @template I - 物品ID的联合类型
256
+ * @template F - 标记键的联合类型
257
+ *
258
+ * @example
259
+ * ```typescript
260
+ * const useGameStore: GameStore<'hp' | 'mp', 'sword', 'quest_done'>;
261
+ * ```
262
+ */
263
+ type GameStore<S extends string, I extends string, F extends string, X = Record<string, unknown>> = GameState<S, I, F, X> & GameStoreActions<S, I, F, X>;
264
+ /**
265
+ * 创建游戏引擎Store的工厂函数
266
+ *
267
+ * 这是创建游戏状态管理Store的核心函数。它使用Zustand创建一个
268
+ * 带有持久化功能的状态管理器,自动将游戏状态保存到localStorage。
269
+ *
270
+ * 工厂模式的优势:
271
+ * - 可以创建多个独立的游戏实例
272
+ * - 每个实例有自己的初始状态和存档名称
273
+ * - 完全的类型安全和泛型支持
274
+ *
275
+ * @template S - 数值属性键的联合类型
276
+ * @template I - 物品ID的联合类型
277
+ * @template F - 标记键的联合类型
278
+ *
279
+ * @param initialState - 游戏的初始状态
280
+ * @param persistName - localStorage中的存档键名(默认:'generic-rpg-save')
281
+ *
282
+ * @returns Zustand store hook,可在React组件中使用
283
+ *
284
+ * @example
285
+ * ```typescript
286
+ * // 定义游戏类型
287
+ * type Stats = 'hp' | 'mp' | 'gold';
288
+ * type Items = 'sword' | 'potion';
289
+ * type Flags = 'quest_completed';
290
+ *
291
+ * // 创建初始状态
292
+ * const initialState: GameState<Stats, Items, Flags> = {
293
+ * stats: { hp: 100, mp: 50, gold: 0 },
294
+ * inventory: [],
295
+ * flags: { quest_completed: false },
296
+ * world: { currentLocationId: 'start', day: 1, time: 0 },
297
+ * logs: []
298
+ * };
299
+ *
300
+ * // 创建store
301
+ * export const useGameStore = createGameEngineStore(
302
+ * initialState,
303
+ * 'my-rpg-save'
304
+ * );
305
+ *
306
+ * // 在组件中使用
307
+ * function GameUI() {
308
+ * const hp = useGameStore(state => state.stats.hp);
309
+ * const updateStat = useGameStore(state => state.updateStat);
310
+ *
311
+ * return <button onClick={() => updateStat('hp', -10)}>受伤</button>;
312
+ * }
313
+ * ```
314
+ */
315
+ declare const createGameEngineStore: <S extends string, I extends string, F extends string, X = Record<string, unknown>>(initialState: GameState<S, I, F, X>, persistName?: string) => zustand.UseBoundStore<Omit<zustand.StoreApi<GameStore<S, I, F, X>>, "persist"> & {
316
+ persist: {
317
+ setOptions: (options: Partial<zustand_middleware.PersistOptions<GameStore<S, I, F, X>, unknown>>) => void;
318
+ clearStorage: () => void;
319
+ rehydrate: () => Promise<void> | void;
320
+ hasHydrated: () => boolean;
321
+ onHydrate: (fn: (state: GameStore<S, I, F, X>) => void) => () => void;
322
+ onFinishHydration: (fn: (state: GameStore<S, I, F, X>) => void) => () => void;
323
+ getOptions: () => Partial<zustand_middleware.PersistOptions<GameStore<S, I, F, X>, unknown>>;
324
+ };
325
+ }>;
326
+
327
+ export { type GameStoreActions as G, type GameStore as a, createGameEngineStore as c };