@dreamboard-games/sdk 0.5.0-alpha.2 → 0.5.0-alpha.4

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.
Files changed (151) hide show
  1. package/README.md +186 -45
  2. package/dist/board-target-B0QG6OYx.d.ts +8 -0
  3. package/dist/chunk-3JXUL4VN.js +139 -0
  4. package/dist/chunk-3JXUL4VN.js.map +1 -0
  5. package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
  6. package/dist/chunk-C77SYIVT.js.map +1 -0
  7. package/dist/chunk-DMFVAZI2.js +16 -0
  8. package/dist/chunk-DMFVAZI2.js.map +1 -0
  9. package/dist/chunk-OOFMBCFF.js +1338 -0
  10. package/dist/chunk-OOFMBCFF.js.map +1 -0
  11. package/dist/chunk-UG2Q4NLG.js +590 -0
  12. package/dist/chunk-UG2Q4NLG.js.map +1 -0
  13. package/dist/chunk-XU6WJW6K.js +847 -0
  14. package/dist/chunk-XU6WJW6K.js.map +1 -0
  15. package/dist/diagnostics-B8d5aLad.d.ts +65 -0
  16. package/dist/extract-gVKcB8Og.d.ts +4736 -0
  17. package/dist/index.d.ts +3782 -1
  18. package/dist/index.js +1096 -6
  19. package/dist/index.js.map +1 -1
  20. package/dist/model-vdpLHrxh.d.ts +432 -0
  21. package/dist/react.d.ts +60 -0
  22. package/dist/react.js +208 -0
  23. package/dist/react.js.map +1 -0
  24. package/dist/reducer.d.ts +1244 -78
  25. package/dist/reducer.js +4204 -121
  26. package/dist/reducer.js.map +1 -1
  27. package/dist/testing.d.ts +520 -564
  28. package/dist/testing.js +2451 -915
  29. package/dist/testing.js.map +1 -1
  30. package/dist/types-Bj5ZLTUV.d.ts +114 -0
  31. package/package.json +40 -142
  32. package/dist/HandView-Bi2lxzQP.d.ts +0 -79
  33. package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
  34. package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
  35. package/dist/attributes-DbvyMbXw.d.ts +0 -68
  36. package/dist/browser-interaction.d.ts +0 -910
  37. package/dist/browser-interaction.js +0 -119
  38. package/dist/browser-interaction.js.map +0 -1
  39. package/dist/chunk-32PFKDV7.js +0 -11705
  40. package/dist/chunk-32PFKDV7.js.map +0 -1
  41. package/dist/chunk-3BAD4VC2.js +0 -263
  42. package/dist/chunk-3BAD4VC2.js.map +0 -1
  43. package/dist/chunk-3SKDNDPG.js +0 -104
  44. package/dist/chunk-3SKDNDPG.js.map +0 -1
  45. package/dist/chunk-5YV2WHJ4.js +0 -25
  46. package/dist/chunk-5YV2WHJ4.js.map +0 -1
  47. package/dist/chunk-ANRB4XKA.js +0 -90
  48. package/dist/chunk-ANRB4XKA.js.map +0 -1
  49. package/dist/chunk-BI4G3PM2.js +0 -1864
  50. package/dist/chunk-BI4G3PM2.js.map +0 -1
  51. package/dist/chunk-EVCLTY4Q.js +0 -935
  52. package/dist/chunk-EVCLTY4Q.js.map +0 -1
  53. package/dist/chunk-GDPKTBUR.js +0 -564
  54. package/dist/chunk-GDPKTBUR.js.map +0 -1
  55. package/dist/chunk-H6VDGFL5.js +0 -2903
  56. package/dist/chunk-H6VDGFL5.js.map +0 -1
  57. package/dist/chunk-LR3ZTWQF.js +0 -5960
  58. package/dist/chunk-LR3ZTWQF.js.map +0 -1
  59. package/dist/chunk-PF7L4BMG.js +0 -117
  60. package/dist/chunk-PF7L4BMG.js.map +0 -1
  61. package/dist/chunk-PN5O6GG2.js +0 -32
  62. package/dist/chunk-PN5O6GG2.js.map +0 -1
  63. package/dist/chunk-PZ5AY32C.js +0 -10
  64. package/dist/chunk-PZ5AY32C.js.map +0 -1
  65. package/dist/chunk-S2JEDVWH.js.map +0 -1
  66. package/dist/chunk-T3ZKNUZ7.js +0 -1
  67. package/dist/chunk-T3ZKNUZ7.js.map +0 -1
  68. package/dist/chunk-UGH54WZ2.js +0 -223
  69. package/dist/chunk-UGH54WZ2.js.map +0 -1
  70. package/dist/chunk-VCDWP5VL.js +0 -746
  71. package/dist/chunk-VCDWP5VL.js.map +0 -1
  72. package/dist/chunk-VDXOF4FW.js +0 -69
  73. package/dist/chunk-VDXOF4FW.js.map +0 -1
  74. package/dist/chunk-WHR5UW3F.js +0 -1988
  75. package/dist/chunk-WHR5UW3F.js.map +0 -1
  76. package/dist/chunk-Y75CFE77.js +0 -17
  77. package/dist/chunk-Y75CFE77.js.map +0 -1
  78. package/dist/chunk-Z7QCREWI.js +0 -3435
  79. package/dist/chunk-Z7QCREWI.js.map +0 -1
  80. package/dist/chunk-ZZGN2ATS.js +0 -1941
  81. package/dist/chunk-ZZGN2ATS.js.map +0 -1
  82. package/dist/components-gAbIz7hK.d.ts +0 -1284
  83. package/dist/definitions-BgmV_GhC.d.ts +0 -300
  84. package/dist/diagnostics-DIi3ina7.d.ts +0 -50
  85. package/dist/digest.d.ts +0 -8
  86. package/dist/game-CsZScpcn.d.ts +0 -763
  87. package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
  88. package/dist/index-CcT9Q7N7.d.ts +0 -193
  89. package/dist/index.d-DjzoK7zn.d.ts +0 -2101
  90. package/dist/package-set.d.ts +0 -13
  91. package/dist/package-set.js +0 -12
  92. package/dist/package-set.js.map +0 -1
  93. package/dist/player-state-Cqpyeql0.d.ts +0 -371
  94. package/dist/plugin-runtime-contract.d.ts +0 -17
  95. package/dist/plugin-runtime-contract.js +0 -92
  96. package/dist/plugin-runtime-contract.js.map +0 -1
  97. package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
  98. package/dist/protocol-dYgafTYY.d.ts +0 -314
  99. package/dist/reducer/advanced.d.ts +0 -82
  100. package/dist/reducer/advanced.js +0 -51
  101. package/dist/reducer/advanced.js.map +0 -1
  102. package/dist/reducer-contract.d.ts +0 -11
  103. package/dist/reducer-contract.js +0 -16
  104. package/dist/reducer-contract.js.map +0 -1
  105. package/dist/reference-games/index.d.ts +0 -31
  106. package/dist/reference-games/index.js +0 -48
  107. package/dist/reference-games/index.js.map +0 -1
  108. package/dist/runtime/primitives.d.ts +0 -250
  109. package/dist/runtime/primitives.js +0 -189
  110. package/dist/runtime/primitives.js.map +0 -1
  111. package/dist/runtime/runtime-api.d.ts +0 -2
  112. package/dist/runtime/runtime-api.js +0 -1
  113. package/dist/runtime/runtime-api.js.map +0 -1
  114. package/dist/runtime/workspace-contract.d.ts +0 -392
  115. package/dist/runtime/workspace-contract.js +0 -28
  116. package/dist/runtime/workspace-contract.js.map +0 -1
  117. package/dist/runtime-RJ5orDJU.d.ts +0 -1699
  118. package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
  119. package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
  120. package/dist/runtime.d.ts +0 -83
  121. package/dist/runtime.js +0 -242
  122. package/dist/runtime.js.map +0 -1
  123. package/dist/schema.d.ts +0 -379
  124. package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
  125. package/dist/testing-compiler.d.ts +0 -37
  126. package/dist/testing-compiler.js +0 -272
  127. package/dist/testing-compiler.js.map +0 -1
  128. package/dist/testing-runtime.d.ts +0 -119
  129. package/dist/testing-runtime.js +0 -212
  130. package/dist/testing-runtime.js.map +0 -1
  131. package/dist/types-DJj5MJkl.d.ts +0 -256
  132. package/dist/types-DR7DoB1x.d.ts +0 -28
  133. package/dist/types-JWCYHmu7.d.ts +0 -122
  134. package/dist/types.d.ts +0 -1958
  135. package/dist/types.js +0 -14
  136. package/dist/types.js.map +0 -1
  137. package/dist/ui/components.d.ts +0 -17
  138. package/dist/ui/components.js +0 -216
  139. package/dist/ui/components.js.map +0 -1
  140. package/dist/ui/defaults.d.ts +0 -19
  141. package/dist/ui/defaults.js +0 -104
  142. package/dist/ui/defaults.js.map +0 -1
  143. package/dist/ui/player-state.d.ts +0 -2
  144. package/dist/ui/player-state.js +0 -1
  145. package/dist/ui/player-state.js.map +0 -1
  146. package/dist/ui/plugin-styles.css +0 -2
  147. package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
  148. package/dist/ui.d.ts +0 -317
  149. package/dist/ui.js +0 -277
  150. package/dist/ui.js.map +0 -1
  151. package/dist/views-BpuWcOyN.d.ts +0 -1641
@@ -1,1699 +0,0 @@
1
- import { z } from 'zod';
2
- import { CardCollection, ViewCard, ViewSlotOccupant } from './types.js';
3
- import { d, O, s, t, u } from './protocol-dYgafTYY.js';
4
-
5
- /**
6
- * Opaque brand applied to a runtime player identifier.
7
- *
8
- * The reducer owns the branded `PlayerId` identity. Authors
9
- * obtain `PlayerId` values only through:
10
- * - `q.player.order()` / `q.player.current()` (reducer queries),
11
- * - engine-injected callback arguments (actions, phases, prompts),
12
- * - `perPlayerKeys(...)` / entries iteration,
13
- * - `asPlayerId(raw)` as an explicit escape hatch (e.g. ingress parsing).
14
- *
15
- * The brand is a phantom type: at runtime a `PlayerId` is just a string.
16
- * Do not JSON-serialize the brand marker; it exists purely at the type
17
- * level to block accidental literal comparisons such as
18
- * `playerId === "player-1"`.
19
- */
20
- type PlayerId = Brand<string, "PlayerId">;
21
- /**
22
- * Explicit conversion from a raw string to a branded `PlayerId`.
23
- *
24
- * Use at trust boundaries only (wire ingress, tests, fixtures). Inside
25
- * reducer logic, obtain `PlayerId` values from the engine instead of
26
- * constructing them yourself.
27
- */
28
- declare function asPlayerId(raw: string): PlayerId;
29
- /**
30
- * Type guard that narrows `unknown` to `PlayerId` when the value is a
31
- * non-empty string. Does not validate against a specific player roster;
32
- * use `perPlayerSchema`/ingress parsing for that.
33
- */
34
- declare function isPlayerId(value: unknown): value is PlayerId;
35
- /**
36
- * A runtime-accurate per-player map.
37
- *
38
- * `PerPlayer<Value>` is an opaque, ordered container whose entries are
39
- * exactly the players that exist at runtime (the seats passed to
40
- * `initialize`).
41
- *
42
- * The `__perPlayer` discriminator keeps the structural type nominal-ish
43
- * without depending on a symbol (symbols do not round-trip through JSON,
44
- * which this shape must).
45
- *
46
- * Construct with `perPlayer(ids, init)` and read with the accessors in
47
- * this module; do not reach into `entries` directly unless you need
48
- * ordered iteration.
49
- */
50
- interface PerPlayer<Value, Id extends PlayerId = PlayerId> {
51
- readonly __perPlayer: true;
52
- readonly entries: ReadonlyArray<readonly [Id, Value]>;
53
- }
54
- /**
55
- * Construct a `PerPlayer<Value>` with one entry per `id` in `ids`.
56
- *
57
- * `ids` is treated as the authoritative runtime seat list: the returned
58
- * `PerPlayer` contains exactly `ids.length` entries, in the same order.
59
- * Duplicate ids throw.
60
- */
61
- declare function perPlayer<Value, Id extends PlayerId = PlayerId>(ids: readonly Id[], init: (id: Id, index: number) => Value): PerPlayer<Value, Id>;
62
- /** Ordered list of seat ids present in the `PerPlayer`. */
63
- declare function perPlayerKeys<Id extends PlayerId>(value: PerPlayer<unknown, Id>): Id[];
64
- /** Ordered list of values present in the `PerPlayer`. */
65
- declare function perPlayerValues<Value>(value: PerPlayer<Value, PlayerId>): Value[];
66
- /**
67
- * Ordered `[id, value]` pairs. Returns the backing array as-is; callers
68
- * must not mutate it.
69
- */
70
- declare function perPlayerEntries<Value, Id extends PlayerId>(value: PerPlayer<Value, Id>): ReadonlyArray<readonly [Id, Value]>;
71
- /** Number of seats in the `PerPlayer`. */
72
- declare function perPlayerSize(value: PerPlayer<unknown, PlayerId>): number;
73
- /** Whether `id` has a value. */
74
- declare function perPlayerHas<Id extends PlayerId>(value: PerPlayer<unknown, Id>, id: Id): boolean;
75
- /** Lookup with no fallback; returns `undefined` for missing seats. */
76
- declare function perPlayerGet<Value, Id extends PlayerId>(value: PerPlayer<Value, Id>, id: Id): Value | undefined;
77
- /**
78
- * Lookup that throws if `id` is not present.
79
- *
80
- * Use when the caller has already established (via `q.player.order()`,
81
- * an action context, etc.) that `id` is an active runtime seat.
82
- */
83
- declare function perPlayerRequire<Value, Id extends PlayerId>(value: PerPlayer<Value, Id>, id: Id): Value;
84
- /**
85
- * Return a new `PerPlayer` with `id`'s value replaced (or added if the
86
- * id is not present). Preserves entry order; new entries are appended.
87
- */
88
- declare function perPlayerSet<Value, Id extends PlayerId>(value: PerPlayer<Value, Id>, id: Id, next: Value): PerPlayer<Value, Id>;
89
- /**
90
- * Return a new `PerPlayer` where each value is replaced by `f(value, id)`.
91
- * Seat order is preserved.
92
- */
93
- declare function perPlayerMap<Value, Next, Id extends PlayerId>(value: PerPlayer<Value, Id>, f: (v: Value, id: Id, index: number) => Next): PerPlayer<Next, Id>;
94
- /**
95
- * Structural check for a `PerPlayer` without a Zod schema. Useful in
96
- * debug paths and as a fast pre-filter before schema validation.
97
- */
98
- declare function isPerPlayer(value: unknown): value is PerPlayer<unknown>;
99
- /**
100
- * Options accepted by `perPlayerSchema`.
101
- *
102
- * Setting `players` locks the schema to an exact seat list: parse fails
103
- * if the input is missing any seat or has an unknown id. Leaving
104
- * `players` unset yields a schema that accepts any non-empty string as
105
- * a key, which is the right default for generic SDK types.
106
- *
107
- * `playerIdSchema` lets callers feed a manifest-scoped Zod id schema in
108
- * so parse errors carry the same message as other branded ids.
109
- */
110
- type PerPlayerSchemaOptions<Id extends PlayerId> = {
111
- readonly playerIdSchema?: z.ZodType<Id>;
112
- readonly players?: readonly Id[];
113
- };
114
- /**
115
- * Build a Zod schema that validates a wire-shaped `PerPlayer<Value>`.
116
- *
117
- * When `options.players` is supplied the schema enforces that entries
118
- * match that exact set (same cardinality, same ids, any order). This is
119
- * the mechanism that catches the class of bug where a 3-player session
120
- * produced a view shape the old `Record<PlayerId, T>` type claimed had
121
- * a `player-4` key.
122
- */
123
- declare function perPlayerSchema<Value, Id extends PlayerId = PlayerId>(valueSchema: z.ZodType<Value>, options?: PerPlayerSchemaOptions<Id>): z.ZodType<PerPlayer<Value, Id>>;
124
- /**
125
- * Reference to a board by its authored `baseId`, plus an optional seat
126
- * for per-player boards.
127
- *
128
- * Replaces the old generated `"ring:player-1" | "ring:player-2" | ...`
129
- * flat unions whose keys pretended to be static but were actually
130
- * derived from `maxPlayers` and therefore misaligned with the runtime
131
- * seat list.
132
- *
133
- * The discriminant is the *presence* of `seat`, not a `scope` field, so
134
- * authors can destructure and pass the ref directly without needing a
135
- * discriminator check for shared boards.
136
- */
137
- type BoardRef<BaseId extends string = string, Id extends PlayerId = PlayerId> = SharedBoardRef<BaseId> | PerPlayerBoardRef<BaseId, Id>;
138
- interface SharedBoardRef<BaseId extends string = string> {
139
- readonly baseId: BaseId;
140
- readonly seat?: undefined;
141
- }
142
- interface PerPlayerBoardRef<BaseId extends string = string, Id extends PlayerId = PlayerId> {
143
- readonly baseId: BaseId;
144
- readonly seat: Id;
145
- }
146
- /** Construct a shared board ref. */
147
- declare function sharedBoardRef<BaseId extends string>(baseId: BaseId): SharedBoardRef<BaseId>;
148
- /** Construct a per-player board ref. */
149
- declare function perPlayerBoardRef<BaseId extends string, Id extends PlayerId>(baseId: BaseId, seat: Id): PerPlayerBoardRef<BaseId, Id>;
150
- /**
151
- * Construct a `BoardRef` without knowing the scope ahead of time. Pass
152
- * `seat` for per-player boards; omit for shared boards.
153
- */
154
- declare function boardRef<BaseId extends string, Id extends PlayerId>(baseId: BaseId, seat?: Id): BoardRef<BaseId, Id>;
155
- /** Stable string key for Maps/Records keyed by a `BoardRef`. */
156
- declare function boardRefKey(ref: BoardRef): string;
157
- /**
158
- * Inverse of `boardRefKey`. Parses `"base"` as a shared ref and
159
- * `"base:player-N"` as a per-player ref. Returns `null` for malformed
160
- * input.
161
- */
162
- declare function parseBoardRefKey(key: string): BoardRef | null;
163
- /**
164
- * Zod schema for a `BoardRef` with free-form base and seat ids.
165
- *
166
- * Feed a manifest-scoped `baseIdSchema` and `playerIdSchema` to bind
167
- * the ref to a specific workspace.
168
- */
169
- declare function boardRefSchema<BaseId extends string = string, Id extends PlayerId = PlayerId>(options?: {
170
- readonly baseIdSchema?: z.ZodType<BaseId>;
171
- readonly playerIdSchema?: z.ZodType<Id>;
172
- }): z.ZodType<BoardRef<BaseId, Id>>;
173
- /** True when `ref` targets a shared board (no seat). */
174
- declare function isSharedBoardRef<BaseId extends string>(ref: BoardRef<BaseId, PlayerId>): ref is SharedBoardRef<BaseId>;
175
- /** True when `ref` targets a per-player board (has a seat). */
176
- declare function isPerPlayerBoardRef<BaseId extends string, Id extends PlayerId>(ref: BoardRef<BaseId, Id>): ref is PerPlayerBoardRef<BaseId, Id>;
177
-
178
- type RuntimeScalar = boolean | number | string | null;
179
- interface RuntimeRecord {
180
- [key: string]: RuntimePayload;
181
- }
182
- type RuntimePayload = RuntimeScalar | RuntimePayload[] | RuntimeRecord;
183
- type RuntimeParams = RuntimeRecord;
184
- type SchemaLike<Output> = z.ZodType<Output>;
185
- type AnySchema = z.ZodTypeAny;
186
- type StringKeyOf<T> = Extract<keyof T, string>;
187
- type NonEmptyReadonlyArray<T> = readonly [T, ...T[]];
188
- type Brand<Value, Name extends string> = Value & {
189
- readonly __brand: Name;
190
- };
191
- type RuntimeHandVisibilityMode = "all" | "ownerOnly" | "public" | "hidden";
192
- type RuntimeDeckMap = Record<string, string[]>;
193
- type RuntimeHandMap = Record<string, PerPlayer<string[]>>;
194
- type RuntimeZoneMap = {
195
- shared: Record<string, string[]>;
196
- perPlayer: Record<string, PerPlayer<string[]>>;
197
- visibility: Record<string, RuntimeHandVisibilityMode>;
198
- cardSetIdsByZoneId?: Record<string, readonly string[]>;
199
- };
200
- type RuntimeOwnerMap = Record<string, string | null>;
201
- type RuntimeResourceMap = PerPlayer<RuntimeRecord>;
202
- type RuntimeBoardSpaceState = {
203
- id: string;
204
- name?: string | null;
205
- typeId?: string | null;
206
- fields: RuntimeRecord;
207
- zoneId?: string | null;
208
- };
209
- type RuntimeBoardRelationState = {
210
- id?: string | null;
211
- typeId: string;
212
- fromSpaceId: string;
213
- toSpaceId: string;
214
- directed: boolean;
215
- fields: RuntimeRecord;
216
- };
217
- type RuntimeBoardContainerState = {
218
- id: string;
219
- name: string;
220
- host: {
221
- type: "board";
222
- } | {
223
- type: "space";
224
- spaceId: string;
225
- };
226
- allowedCardSetIds?: readonly string[];
227
- zoneId: string;
228
- fields: RuntimeRecord;
229
- };
230
- type RuntimeBoardCompatibilityState = {
231
- spaces: Record<string, RuntimeBoardSpaceState>;
232
- relations: RuntimeBoardRelationState[];
233
- containers: Record<string, RuntimeBoardContainerState>;
234
- };
235
- type RuntimeBoardBaseState = {
236
- id: string;
237
- baseId?: string;
238
- layout: "generic" | "hex" | "square";
239
- typeId?: string | null;
240
- scope: "shared" | "perPlayer";
241
- playerId?: string | null;
242
- templateId?: string | null;
243
- fields: RuntimeRecord;
244
- };
245
- type RuntimeGenericBoardState = RuntimeBoardBaseState & {
246
- layout: "generic";
247
- } & RuntimeBoardCompatibilityState;
248
- type RuntimeHexSpaceState = RuntimeBoardSpaceState & {
249
- q: number;
250
- r: number;
251
- };
252
- type RuntimeSquareSpaceState = RuntimeBoardSpaceState & {
253
- row: number;
254
- col: number;
255
- };
256
- type RuntimeTiledSpaceState = RuntimeHexSpaceState | RuntimeSquareSpaceState;
257
- type RuntimeTiledEdgeState = {
258
- id: string;
259
- spaceIds: readonly string[];
260
- typeId?: string | null;
261
- label?: string | null;
262
- ownerId?: string | null;
263
- fields: RuntimeRecord;
264
- };
265
- type RuntimeTiledVertexState = {
266
- id: string;
267
- spaceIds: readonly string[];
268
- typeId?: string | null;
269
- label?: string | null;
270
- ownerId?: string | null;
271
- fields: RuntimeRecord;
272
- };
273
- type RuntimeHexEdgeState = RuntimeTiledEdgeState;
274
- type RuntimeHexVertexState = RuntimeTiledVertexState;
275
- type RuntimeSquareEdgeState = RuntimeTiledEdgeState;
276
- type RuntimeSquareVertexState = RuntimeTiledVertexState;
277
- type RuntimeHexOrientation = "pointy-top" | "flat-top";
278
- type RuntimeTiledBoardBaseState = RuntimeBoardBaseState & {
279
- layout: "hex" | "square";
280
- relations: RuntimeBoardRelationState[];
281
- containers: Record<string, RuntimeBoardContainerState>;
282
- edges: RuntimeTiledEdgeState[];
283
- vertices: RuntimeTiledVertexState[];
284
- };
285
- type RuntimeHexBoardState = RuntimeTiledBoardBaseState & {
286
- layout: "hex";
287
- spaces: Record<string, RuntimeHexSpaceState>;
288
- orientation: RuntimeHexOrientation;
289
- edges: RuntimeHexEdgeState[];
290
- vertices: RuntimeHexVertexState[];
291
- };
292
- type RuntimeSquareBoardState = RuntimeTiledBoardBaseState & {
293
- layout: "square";
294
- spaces: Record<string, RuntimeSquareSpaceState>;
295
- edges: RuntimeSquareEdgeState[];
296
- vertices: RuntimeSquareVertexState[];
297
- };
298
- type RuntimeTiledBoardState = RuntimeHexBoardState | RuntimeSquareBoardState;
299
- type RuntimeBoardState = RuntimeGenericBoardState | RuntimeTiledBoardState;
300
- type RuntimeBoardCollections = {
301
- byId: Record<string, RuntimeBoardState>;
302
- hex: Record<string, RuntimeHexBoardState>;
303
- square: Record<string, RuntimeSquareBoardState>;
304
- /** Structured board buckets used by manifest table schemas (empty when unused). */
305
- network: Record<string, RuntimeRecord>;
306
- track: Record<string, RuntimeRecord>;
307
- };
308
- type RuntimeCardVisibility = {
309
- faceUp: boolean;
310
- visibleTo?: string[] | null;
311
- };
312
- type RuntimeCardData = {
313
- componentType?: string;
314
- id: string;
315
- cardSetId: string;
316
- cardType: string;
317
- name?: string;
318
- text?: string;
319
- properties: RuntimeRecord;
320
- };
321
- type RuntimePieceData = {
322
- componentType?: string;
323
- id: string;
324
- pieceTypeId: string;
325
- pieceName?: string | null;
326
- ownerId?: string | null;
327
- properties: RuntimeRecord;
328
- };
329
- type RuntimeDieData = {
330
- componentType?: string;
331
- id: string;
332
- dieTypeId: string;
333
- dieName?: string | null;
334
- ownerId?: string | null;
335
- sides: number;
336
- value?: number | null;
337
- properties: RuntimeRecord;
338
- };
339
- type RuntimeSlotHostRef = {
340
- kind: "piece";
341
- id: string;
342
- } | {
343
- kind: "die";
344
- id: string;
345
- };
346
- type RuntimeComponentLocation = {
347
- type: "Detached";
348
- } | {
349
- type: "InDeck";
350
- deckId: string;
351
- playedBy: string | null;
352
- position?: number | null;
353
- } | {
354
- type: "InHand";
355
- handId: string;
356
- playerId: string;
357
- position?: number | null;
358
- } | {
359
- type: "InZone";
360
- zoneId: string;
361
- playedBy?: string | null;
362
- position?: number | null;
363
- } | {
364
- type: "OnSpace";
365
- boardId: string;
366
- spaceId: string;
367
- position?: number | null;
368
- } | {
369
- type: "InContainer";
370
- boardId: string;
371
- containerId: string;
372
- position?: number | null;
373
- } | {
374
- type: "OnEdge";
375
- boardId: string;
376
- edgeId: string;
377
- position?: number | null;
378
- } | {
379
- type: "OnVertex";
380
- boardId: string;
381
- vertexId: string;
382
- position?: number | null;
383
- } | {
384
- type: "InSlot";
385
- host: RuntimeSlotHostRef;
386
- slotId: string;
387
- position?: number | null;
388
- };
389
- type RuntimeComponentLocationMap = Record<string, RuntimeComponentLocation>;
390
- type RuntimeVisibilityMap = Record<string, RuntimeCardVisibility>;
391
- type RuntimeTableRecord = {
392
- playerOrder: string[];
393
- zones: RuntimeZoneMap;
394
- decks: RuntimeDeckMap;
395
- hands: RuntimeHandMap;
396
- handVisibility: Record<string, RuntimeHandVisibilityMode>;
397
- cards: Record<string, RuntimeCardData>;
398
- pieces: Record<string, RuntimePieceData>;
399
- componentLocations: RuntimeComponentLocationMap;
400
- ownerOfCard: RuntimeOwnerMap;
401
- visibility: RuntimeVisibilityMap;
402
- resources: RuntimeResourceMap;
403
- boards: RuntimeBoardCollections;
404
- dice: Record<string, RuntimeDieData>;
405
- };
406
-
407
- declare const FrameworkErrorCodes: {
408
- readonly NOT_YOUR_TURN: "NOT_YOUR_TURN";
409
- readonly WRONG_PHASE: "WRONG_PHASE";
410
- readonly WRONG_STEP: "WRONG_STEP";
411
- readonly NO_LEGAL_INPUT: "NO_LEGAL_INPUT";
412
- readonly INVALID_PARAMS: "INVALID_PARAMS";
413
- readonly UNKNOWN_INTERACTION: "UNKNOWN_INTERACTION";
414
- readonly INTERNAL_ERROR: "INTERNAL_ERROR";
415
- };
416
- type FrameworkErrorCode = (typeof FrameworkErrorCodes)[keyof typeof FrameworkErrorCodes];
417
-
418
- type TableOfState<State> = State extends {
419
- table: infer Table;
420
- } ? Table : never;
421
- type TableOfManifest<Manifest> = Manifest extends {
422
- tableSchema: z.ZodType<infer Table extends RuntimeTableRecord>;
423
- } ? Table : Manifest extends ReducerManifestContractLike<infer Table> ? Table : never;
424
- type PhaseNameOfState<State> = State extends {
425
- flow: {
426
- currentPhase: infer PhaseName;
427
- };
428
- } ? Extract<PhaseName, string> : never;
429
- type PhaseNameOfManifest<Manifest> = Manifest extends {
430
- literals: {
431
- phaseNames: readonly (infer PhaseName)[];
432
- };
433
- } ? Extract<PhaseName, string> : never;
434
- type PlayerIdOfTable<Table> = Table extends {
435
- playerOrder: readonly (infer PlayerId)[];
436
- } ? Extract<PlayerId, string> : never;
437
- type PlayerIdOfManifest<Manifest> = Manifest extends {
438
- literals: {
439
- playerIds: readonly (infer PlayerId)[];
440
- };
441
- } ? Extract<PlayerId, string> : string;
442
- type PlayerIdOfState<State> = PlayerIdOfTable<TableOfState<State>>;
443
- type ErrorCodeOfContract<Contract> = Contract extends {
444
- errors: infer Errors extends Record<string, string>;
445
- } ? (keyof Errors & string) | FrameworkErrorCode : string;
446
- /**
447
- * Manifest-declared resource id union for a runtime table.
448
- *
449
- * Derived from the shape of `table.resources`, which the generated
450
- * manifest contract seeds as `PerPlayer<Record<ResourceId, number>>`.
451
- * The helper peeks inside the `PerPlayer` wrapper to surface the
452
- * resource-id keys without forcing callers to remember the wrapper.
453
- */
454
- type ResourceIdOfTable<Table> = Table extends {
455
- resources: infer Resources;
456
- } ? ValueOfPerPlayer<Resources> extends infer PerPlayerValue ? PerPlayerValue extends Record<string, unknown> ? StringKeyOf<PerPlayerValue> : never : never : never;
457
- type ResourceIdOfState<State> = ResourceIdOfTable<TableOfState<State>>;
458
- /**
459
- * Per-player balance shape for a runtime table. Strips the `PerPlayer`
460
- * wrapper around `table.resources` so callers receive the manifest-typed
461
- * record directly (e.g. `Record<ResourceId, number>`).
462
- */
463
- type ResourceBalancesOfTable<Table> = Table extends {
464
- resources: infer Resources;
465
- } ? ValueOfPerPlayer<Resources> extends infer PerPlayerValue ? PerPlayerValue extends Record<string, unknown> ? PerPlayerValue : never : never : never;
466
- type ResourceBalancesOfState<State> = ResourceBalancesOfTable<TableOfState<State>>;
467
- type ResourceIdOfManifest<Manifest> = Manifest extends {
468
- literals: {
469
- resourceIds: readonly (infer ResourceId)[];
470
- };
471
- } ? Extract<ResourceId, string> : string;
472
- /**
473
- * Per-player resource counts: a partial `Record<ResourceId, number>`.
474
- *
475
- * Used as the input shape for {@link ReducerOps.addResources},
476
- * {@link ReducerOps.spendResources}, and {@link ReducerOps.transferResources}.
477
- */
478
- type ResourceAmountsOfTable<Table> = Partial<Record<ResourceIdOfTable<Table>, number>>;
479
- type PhaseStateOfState<State> = State extends {
480
- phase: infer PhaseState;
481
- } ? PhaseState : never;
482
- type PhaseStepOfState<State> = PhaseStateOfState<State> extends {
483
- step?: infer Step;
484
- } ? Extract<NonNullable<Step>, string> : never;
485
- type PhaseMapOfState<State> = PhaseStateOfState<State>;
486
- type PublicStateOfState<State> = State extends {
487
- publicState: infer PublicState;
488
- } ? PublicState : never;
489
- type HiddenStateOfState<State> = State extends {
490
- hiddenState: infer HiddenState;
491
- } ? HiddenState : never;
492
- type PrivateStateOfState<State> = State extends {
493
- privateState: Record<string, infer PrivateState>;
494
- } ? PrivateState : never;
495
- type DeckIdOfTable<Table> = Table extends {
496
- decks: infer Decks;
497
- } ? StringKeyOf<Decks> : never;
498
- type HandIdOfTable<Table> = Table extends {
499
- hands: infer Hands;
500
- } ? StringKeyOf<Hands> : never;
501
- type CardIdOfTable<Table> = Table extends {
502
- cards: infer Cards;
503
- } ? StringKeyOf<Cards> : never;
504
- type CardTypeOfTable<Table> = Table extends {
505
- cards: Record<string, {
506
- cardType: infer CardType;
507
- }>;
508
- } ? Extract<CardType, string> : string;
509
- type DeckIdOfState<State> = DeckIdOfTable<TableOfState<State>>;
510
- type HandIdOfState<State> = HandIdOfTable<TableOfState<State>>;
511
- type CardIdOfState<State> = CardIdOfTable<TableOfState<State>>;
512
- type CardTypeOfState<State> = CardTypeOfTable<TableOfState<State>>;
513
- type CardIdOfManifest<Manifest> = Manifest extends {
514
- literals: {
515
- cardIds: readonly (infer CardId)[];
516
- };
517
- } ? Extract<CardId, string> : string;
518
- type SharedZoneIdOfTable<Table> = DeckIdOfTable<Table>;
519
- type PlayerZoneIdOfTable<Table> = HandIdOfTable<Table>;
520
- type BoardMapOfTable<Table> = Table extends {
521
- boards: {
522
- byId: infer Boards;
523
- };
524
- } ? Boards : never;
525
- type BoardIdOfTable<Table> = StringKeyOf<BoardMapOfTable<Table>>;
526
- type BoardStateOfTable<Table, BoardId extends BoardIdOfTable<Table>> = BoardMapOfTable<Table>[BoardId];
527
- type BoardTypeIdOfTable<Table> = BoardStateOfTable<Table, BoardIdOfTable<Table>> extends {
528
- typeId?: infer BoardTypeId | null;
529
- } ? Extract<BoardTypeId, string> : never;
530
- type TiledBoardIdOfTable<Table> = {
531
- [BoardId in BoardIdOfTable<Table>]: BoardStateOfTable<Table, BoardId> extends {
532
- layout: "hex" | "square";
533
- } ? BoardId : never;
534
- }[BoardIdOfTable<Table>];
535
- type TiledBoardStateOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends infer BoardState ? BoardState extends {
536
- layout: "hex" | "square";
537
- spaces: Record<string, unknown>;
538
- edges: readonly {
539
- id: string;
540
- }[];
541
- vertices: readonly {
542
- id: string;
543
- }[];
544
- } ? BoardState : never : never;
545
- type HexBoardIdOfTable<Table> = {
546
- [BoardId in BoardIdOfTable<Table>]: BoardStateOfTable<Table, BoardId> extends {
547
- layout: "hex";
548
- } ? BoardId : never;
549
- }[BoardIdOfTable<Table>];
550
- type HexBoardStateOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends infer BoardState ? BoardState extends {
551
- layout: "hex";
552
- spaces: Record<string, unknown>;
553
- edges: readonly {
554
- id: string;
555
- }[];
556
- vertices: readonly {
557
- id: string;
558
- }[];
559
- } ? BoardState : never : never;
560
- type SquareBoardIdOfTable<Table> = {
561
- [BoardId in BoardIdOfTable<Table>]: BoardStateOfTable<Table, BoardId> extends {
562
- layout: "square";
563
- } ? BoardId : never;
564
- }[BoardIdOfTable<Table>];
565
- type SquareBoardStateOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends infer BoardState ? BoardState extends {
566
- layout: "square";
567
- spaces: Record<string, unknown>;
568
- edges: readonly {
569
- id: string;
570
- }[];
571
- vertices: readonly {
572
- id: string;
573
- }[];
574
- } ? BoardState : never : never;
575
- type SpaceIdOfTable<Table, BoardId extends BoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends {
576
- spaces: infer Spaces;
577
- } ? StringKeyOf<Spaces> : never;
578
- type SpaceTypeIdOfTable<Table, BoardId extends BoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends {
579
- spaces: infer Spaces extends Record<string, unknown>;
580
- } ? Spaces[StringKeyOf<Spaces>] extends {
581
- typeId?: infer SpaceTypeId | null;
582
- } ? Extract<SpaceTypeId, string> : never : never;
583
- type BoardContainerIdOfTable<Table, BoardId extends BoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends {
584
- containers: infer Containers;
585
- } ? StringKeyOf<Containers> : never;
586
- type RelationTypeIdOfTable<Table, BoardId extends BoardIdOfTable<Table>> = BoardStateOfTable<Table, BoardId> extends {
587
- relations: readonly (infer Relation)[];
588
- } ? Relation extends {
589
- typeId: infer RelationTypeId;
590
- } ? Extract<RelationTypeId, string> : never : never;
591
- type TiledSpaceIdOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = TiledBoardStateOfTable<Table, BoardId> extends {
592
- spaces: infer Spaces;
593
- } ? StringKeyOf<Spaces> : never;
594
- type HexSpaceIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
595
- spaces: infer Spaces;
596
- } ? StringKeyOf<Spaces> : never;
597
- type SquareSpaceIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
598
- spaces: infer Spaces;
599
- } ? StringKeyOf<Spaces> : never;
600
- type HexSpaceTypeIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
601
- spaces: infer Spaces extends Record<string, unknown>;
602
- } ? Spaces[StringKeyOf<Spaces>] extends {
603
- typeId?: infer SpaceTypeId | null;
604
- } ? Extract<SpaceTypeId, string> : never : never;
605
- type SquareSpaceTypeIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
606
- spaces: infer Spaces extends Record<string, unknown>;
607
- } ? Spaces[StringKeyOf<Spaces>] extends {
608
- typeId?: infer SpaceTypeId | null;
609
- } ? Extract<SpaceTypeId, string> : never : never;
610
- type TiledEdgeIdOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = TiledBoardStateOfTable<Table, BoardId> extends {
611
- edges: readonly (infer Edge)[];
612
- } ? Edge extends {
613
- id: infer EdgeId;
614
- } ? Extract<EdgeId, string> : never : never;
615
- type HexEdgeIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
616
- edges: readonly (infer Edge)[];
617
- } ? Edge extends {
618
- id: infer EdgeId;
619
- } ? Extract<EdgeId, string> : never : never;
620
- type SquareEdgeIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
621
- edges: readonly (infer Edge)[];
622
- } ? Edge extends {
623
- id: infer EdgeId;
624
- } ? Extract<EdgeId, string> : never : never;
625
- /**
626
- * Edge record on a tiled board narrowed to a specific `EdgeId` literal.
627
- *
628
- * The generated board state stores edges as a single array element type
629
- * `{ id: <union-of-edge-ids>, spaceIds, typeId, fields, ... }`. Looking up an
630
- * edge by id should return a record whose `id` is narrowed to the literal
631
- * that was requested, not the entire edge-id union.
632
- */
633
- type TiledEdgeStateOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>, EdgeId extends TiledEdgeIdOfTable<Table, BoardId>> = TiledBoardStateOfTable<Table, BoardId> extends {
634
- edges: readonly (infer Edge)[];
635
- } ? Edge extends {
636
- id: string;
637
- } ? Omit<Edge, "id"> & {
638
- id: EdgeId;
639
- } : never : never;
640
- type HexEdgeStateOfTable<Table, BoardId extends HexBoardIdOfTable<Table>, EdgeId extends HexEdgeIdOfTable<Table, BoardId>> = HexBoardStateOfTable<Table, BoardId> extends {
641
- edges: readonly (infer Edge)[];
642
- } ? Edge extends {
643
- id: string;
644
- } ? Omit<Edge, "id"> & {
645
- id: EdgeId;
646
- } : never : never;
647
- type SquareEdgeStateOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>, EdgeId extends SquareEdgeIdOfTable<Table, BoardId>> = SquareBoardStateOfTable<Table, BoardId> extends {
648
- edges: readonly (infer Edge)[];
649
- } ? Edge extends {
650
- id: string;
651
- } ? Omit<Edge, "id"> & {
652
- id: EdgeId;
653
- } : never : never;
654
- type TiledEdgeTypeIdOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = TiledBoardStateOfTable<Table, BoardId> extends {
655
- edges: readonly (infer Edge)[];
656
- } ? Edge extends {
657
- typeId?: infer EdgeTypeId | null;
658
- } ? Extract<EdgeTypeId, string> : never : never;
659
- type HexEdgeTypeIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
660
- edges: readonly (infer Edge)[];
661
- } ? Edge extends {
662
- typeId?: infer EdgeTypeId | null;
663
- } ? Extract<EdgeTypeId, string> : never : never;
664
- type SquareEdgeTypeIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
665
- edges: readonly (infer Edge)[];
666
- } ? Edge extends {
667
- typeId?: infer EdgeTypeId | null;
668
- } ? Extract<EdgeTypeId, string> : never : never;
669
- type TiledVertexIdOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = TiledBoardStateOfTable<Table, BoardId> extends {
670
- vertices: readonly (infer Vertex)[];
671
- } ? Vertex extends {
672
- id: infer VertexId;
673
- } ? Extract<VertexId, string> : never : never;
674
- type HexVertexIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
675
- vertices: readonly (infer Vertex)[];
676
- } ? Vertex extends {
677
- id: infer VertexId;
678
- } ? Extract<VertexId, string> : never : never;
679
- type SquareVertexIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
680
- vertices: readonly (infer Vertex)[];
681
- } ? Vertex extends {
682
- id: infer VertexId;
683
- } ? Extract<VertexId, string> : never : never;
684
- /**
685
- * Vertex record on a tiled board narrowed to a specific `VertexId` literal.
686
- * See {@link TiledEdgeStateOfTable} for rationale.
687
- */
688
- type TiledVertexStateOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>, VertexId extends TiledVertexIdOfTable<Table, BoardId>> = TiledBoardStateOfTable<Table, BoardId> extends {
689
- vertices: readonly (infer Vertex)[];
690
- } ? Vertex extends {
691
- id: string;
692
- } ? Omit<Vertex, "id"> & {
693
- id: VertexId;
694
- } : never : never;
695
- type HexVertexStateOfTable<Table, BoardId extends HexBoardIdOfTable<Table>, VertexId extends HexVertexIdOfTable<Table, BoardId>> = HexBoardStateOfTable<Table, BoardId> extends {
696
- vertices: readonly (infer Vertex)[];
697
- } ? Vertex extends {
698
- id: string;
699
- } ? Omit<Vertex, "id"> & {
700
- id: VertexId;
701
- } : never : never;
702
- type SquareVertexStateOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>, VertexId extends SquareVertexIdOfTable<Table, BoardId>> = SquareBoardStateOfTable<Table, BoardId> extends {
703
- vertices: readonly (infer Vertex)[];
704
- } ? Vertex extends {
705
- id: string;
706
- } ? Omit<Vertex, "id"> & {
707
- id: VertexId;
708
- } : never : never;
709
- type TiledVertexTypeIdOfTable<Table, BoardId extends TiledBoardIdOfTable<Table>> = TiledBoardStateOfTable<Table, BoardId> extends {
710
- vertices: readonly (infer Vertex)[];
711
- } ? Vertex extends {
712
- typeId?: infer VertexTypeId | null;
713
- } ? Extract<VertexTypeId, string> : never : never;
714
- type HexVertexTypeIdOfTable<Table, BoardId extends HexBoardIdOfTable<Table>> = HexBoardStateOfTable<Table, BoardId> extends {
715
- vertices: readonly (infer Vertex)[];
716
- } ? Vertex extends {
717
- typeId?: infer VertexTypeId | null;
718
- } ? Extract<VertexTypeId, string> : never : never;
719
- type SquareVertexTypeIdOfTable<Table, BoardId extends SquareBoardIdOfTable<Table>> = SquareBoardStateOfTable<Table, BoardId> extends {
720
- vertices: readonly (infer Vertex)[];
721
- } ? Vertex extends {
722
- typeId?: infer VertexTypeId | null;
723
- } ? Extract<VertexTypeId, string> : never : never;
724
- type TiledSpaceMap<Table, BoardId extends TiledBoardIdOfTable<Table>, Value> = Partial<Record<TiledSpaceIdOfTable<Table, BoardId>, Value>>;
725
- type TiledEdgeMap<Table, BoardId extends TiledBoardIdOfTable<Table>, Value> = Partial<Record<TiledEdgeIdOfTable<Table, BoardId>, Value>>;
726
- type TiledVertexMap<Table, BoardId extends TiledBoardIdOfTable<Table>, Value> = Partial<Record<TiledVertexIdOfTable<Table, BoardId>, Value>>;
727
- type ComponentIdOfTable<Table> = Table extends {
728
- componentLocations: infer ComponentLocations;
729
- } ? StringKeyOf<ComponentLocations> : never;
730
- type SharedZoneIdOfManifest<Manifest> = Manifest extends {
731
- literals: {
732
- sharedZoneIds: readonly (infer ZoneId)[];
733
- };
734
- } ? Extract<ZoneId, string> : string;
735
- type PlayerZoneIdOfManifest<Manifest> = Manifest extends {
736
- literals: {
737
- playerZoneIds: readonly (infer ZoneId)[];
738
- };
739
- } ? Extract<ZoneId, string> : string;
740
- type SharedZoneIdOfState<State> = DeckIdOfState<State>;
741
- type PlayerZoneIdOfState<State> = HandIdOfState<State>;
742
- type BoardIdOfManifest<Manifest> = Manifest extends {
743
- literals: {
744
- boardIds: readonly (infer BoardId)[];
745
- };
746
- } ? Extract<BoardId, string> : string;
747
- type BoardLayoutOfManifest<Manifest> = Manifest extends {
748
- literals: {
749
- boardLayouts: readonly (infer BoardLayout)[];
750
- };
751
- } ? Extract<BoardLayout, string> : "generic" | "hex" | "square";
752
- type BoardTypeIdOfManifest<Manifest> = Manifest extends {
753
- literals: {
754
- boardTypeIds: readonly (infer BoardTypeId)[];
755
- };
756
- } ? Extract<BoardTypeId, string> : string;
757
- type BoardBaseIdOfManifest<Manifest> = Manifest extends {
758
- literals: {
759
- boardBaseIds: readonly (infer BoardBaseId)[];
760
- };
761
- } ? Extract<BoardBaseId, string> : string;
762
- type RelationTypeIdOfManifest<Manifest> = Manifest extends {
763
- literals: {
764
- relationTypeIds: readonly (infer RelationTypeId)[];
765
- };
766
- } ? Extract<RelationTypeId, string> : string;
767
- type BoardContainerIdOfManifest<Manifest> = Manifest extends {
768
- literals: {
769
- boardContainerIds: readonly (infer ContainerId)[];
770
- };
771
- } ? Extract<ContainerId, string> : string;
772
- type EdgeTypeIdOfManifest<Manifest> = Manifest extends {
773
- literals: {
774
- edgeTypeIds: readonly (infer EdgeTypeId)[];
775
- };
776
- } ? Extract<EdgeTypeId, string> : string;
777
- type VertexTypeIdOfManifest<Manifest> = Manifest extends {
778
- literals: {
779
- vertexTypeIds: readonly (infer VertexTypeId)[];
780
- };
781
- } ? Extract<VertexTypeId, string> : string;
782
- type SpaceIdOfManifest<Manifest> = Manifest extends {
783
- literals: {
784
- spaceIds: readonly (infer SpaceId)[];
785
- };
786
- } ? Extract<SpaceId, string> : string;
787
- type SpaceTypeIdOfManifest<Manifest> = Manifest extends {
788
- literals: {
789
- spaceTypeIds: readonly (infer SpaceTypeId)[];
790
- };
791
- } ? Extract<SpaceTypeId, string> : string;
792
- type PieceIdOfManifest<Manifest> = Manifest extends {
793
- literals: {
794
- pieceIds: readonly (infer PieceId)[];
795
- };
796
- } ? Extract<PieceId, string> : string;
797
- type DieIdOfManifest<Manifest> = Manifest extends {
798
- literals: {
799
- dieIds: readonly (infer DieId)[];
800
- };
801
- } ? Extract<DieId, string> : string;
802
- type ManifestOf<Source> = Source extends {
803
- contract: infer Contract;
804
- } ? ManifestOf<Contract> : Source extends {
805
- manifest: infer Manifest;
806
- } ? Manifest : never;
807
- type SetupOptionIdOfManifest<Manifest> = Manifest extends {
808
- literals: {
809
- setupOptionIds: readonly (infer SetupOptionId)[];
810
- };
811
- } ? Extract<SetupOptionId, string> : string;
812
- type SetupProfileIdOfManifest<Manifest> = Manifest extends {
813
- literals: {
814
- setupProfileIds: readonly (infer SetupProfileId)[];
815
- };
816
- } ? Extract<SetupProfileId, string> : string;
817
- type SetupSelectionInputOfManifest<Manifest> = {
818
- profileId: SetupProfileIdOfManifest<Manifest>;
819
- optionValues?: Partial<Record<SetupOptionIdOfManifest<Manifest>, string>>;
820
- };
821
- type SetupSelectionOfManifest<Manifest> = {
822
- profileId: SetupProfileIdOfManifest<Manifest>;
823
- optionValues: Record<SetupOptionIdOfManifest<Manifest>, string | null>;
824
- };
825
- type RuntimeSetupSelectionInput<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = SetupSelectionInputOfManifest<Manifest>;
826
- type RuntimeSetupSelection<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = SetupSelectionOfManifest<Manifest>;
827
- type RuntimeSetupSelectionOverride<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = SetupSelectionInputOfManifest<Manifest>;
828
- type StateDefinitionOfContract<Contract> = Contract extends {
829
- state: infer StateDefinitionValue;
830
- } ? StateDefinitionValue : never;
831
- type PhaseSchemasOfContract<Contract> = Contract extends {
832
- phases: infer Phases extends Record<string, SchemaLike<object>>;
833
- } ? Phases : Record<PhaseNameOfManifest<ManifestOf<Contract>>, SchemaLike<object>>;
834
- type PhaseStateMapOfContract<Contract> = {
835
- [Name in keyof PhaseSchemasOfContract<Contract> & string]: z.infer<PhaseSchemasOfContract<Contract>[Name]>;
836
- };
837
- type PublicSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<infer PublicSchema, SchemaLike<object>, SchemaLike<object>> ? PublicSchema : never;
838
- type PrivateSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<SchemaLike<object>, infer PrivateSchema, SchemaLike<object>> ? PrivateSchema : never;
839
- type HiddenSchemaOfContract<Contract> = StateDefinitionOfContract<Contract> extends StateDefinition<SchemaLike<object>, SchemaLike<object>, infer HiddenSchema> ? HiddenSchema : never;
840
- type PhaseNameOfContract<Contract> = keyof PhaseSchemasOfContract<Contract> extends string ? keyof PhaseSchemasOfContract<Contract> & string : PhaseNameOfManifest<ManifestOf<Contract>>;
841
- type ManifestContractOf<Contract> = ManifestContract<TableOfManifest<ManifestOf<Contract>>>;
842
- type ExactManifestContractOf<Contract> = ManifestOf<Contract> & ReducerManifestContractLike<TableOfManifest<ManifestOf<Contract>>>;
843
- type PhaseNameOf<Source> = Source extends {
844
- flow: {
845
- currentPhase: infer PhaseName;
846
- };
847
- } ? Extract<PhaseName, string> : PhaseNameOfContract<Source>;
848
- type DeckCardsOfTable<Table, DeckId extends DeckIdOfTable<Table>> = Table extends {
849
- decks: infer Decks extends Record<string, readonly unknown[]>;
850
- } ? Decks[DeckId] : never;
851
- type ValueOfPerPlayer<T> = T extends {
852
- readonly entries: ReadonlyArray<readonly [unknown, infer Value]>;
853
- } ? Value : never;
854
- type HandCardsOfTable<Table, HandId extends HandIdOfTable<Table>> = Table extends {
855
- hands: infer Hands extends Record<string, unknown>;
856
- } ? HandId extends keyof Hands ? ValueOfPerPlayer<Hands[HandId]> extends infer Value ? Value extends readonly unknown[] ? Value : never : never : never : never;
857
- type CardIdOfDeck<Table, DeckId extends DeckIdOfTable<Table>> = DeckCardsOfTable<Table, DeckId>[number];
858
- type CardIdOfHand<Table, HandId extends HandIdOfTable<Table>> = HandCardsOfTable<Table, HandId>[number];
859
- type CompatibleHandIdForDeck<Table, DeckId extends DeckIdOfTable<Table>> = {
860
- [CandidateHandId in HandIdOfTable<Table>]: Extract<CardIdOfDeck<Table, DeckId>, CardIdOfHand<Table, CandidateHandId>> extends never ? never : CandidateHandId;
861
- }[HandIdOfTable<Table>];
862
- type CompatibleCardIdForHandAndDeck<Table, HandId extends HandIdOfTable<Table>, DeckId extends DeckIdOfTable<Table>> = Extract<CardIdOfHand<Table, HandId>, CardIdOfDeck<Table, DeckId>>;
863
- type CompatibleCardIdForTwoPlayerZones<Table, FromZoneId extends HandIdOfTable<Table>, ToZoneId extends HandIdOfTable<Table>> = Extract<CardIdOfHand<Table, FromZoneId>, CardIdOfHand<Table, ToZoneId>>;
864
-
865
- type BoardRecord<Table extends RuntimeTableRecord, BoardId extends BoardIdOfTable<Table>> = Table["boards"]["byId"][BoardId];
866
- type TiledBoardRecord<Table extends RuntimeTableRecord, BoardId extends TiledBoardIdOfTable<Table>> = Extract<BoardRecord<Table, BoardId>, {
867
- layout: "hex" | "square";
868
- }>;
869
- type ViewCardOfTable<Table extends RuntimeTableRecord, CardId extends CardIdOfTable<Table>> = CardId extends CardIdOfTable<Table> ? ViewCard<CardId & string, Table["cards"][CardId]["cardType"] & string, Extract<Table["cards"][CardId]["properties"], Record<string, unknown>>> : never;
870
- type CardsByIdOfTable<Table extends RuntimeTableRecord, CardIds extends readonly CardIdOfTable<Table>[]> = Readonly<{
871
- [Id in CardIds[number]]: ViewCardOfTable<Table, Id> | undefined;
872
- }>;
873
- type DeckCardsForZone<Table extends RuntimeTableRecord, ZoneId extends DeckIdOfTable<Table>> = ZoneId extends infer Each extends DeckIdOfTable<Table> ? DeckCardsOfTable<Table, Each> : never;
874
- type HandCardsForZone<Table extends RuntimeTableRecord, ZoneId extends HandIdOfTable<Table>> = ZoneId extends infer Each extends HandIdOfTable<Table> ? HandCardsOfTable<Table, Each> : never;
875
- type CardCollectionOfTable<Table extends RuntimeTableRecord> = CardCollection<CardIdOfTable<Table> & string, ViewCardOfTable<Table, CardIdOfTable<Table>>>;
876
- type SlotOccupantOfTable<Table extends RuntimeTableRecord> = ViewSlotOccupant<ComponentIdOfTable<Table> & string, PlayerIdOfTable<Table> & string, string, Record<string, unknown>>;
877
- type SlotOccupantsOfTable<Table extends RuntimeTableRecord> = ReadonlyArray<SlotOccupantOfTable<Table>>;
878
- type SlotOccupantsBySlotIdOfTable<Table extends RuntimeTableRecord> = Readonly<Record<string, SlotOccupantsOfTable<Table>>>;
879
- type ComponentLocationOfTable<Table, ComponentId extends ComponentIdOfTable<Table>> = Table extends {
880
- componentLocations: infer ComponentLocations extends Record<string, unknown>;
881
- } ? ComponentLocations[ComponentId] : never;
882
- type ComponentDataOfTable<Table, ComponentId extends ComponentIdOfTable<Table>> = Table extends {
883
- cards: infer Cards extends Record<string, unknown>;
884
- pieces: infer Pieces extends Record<string, unknown>;
885
- dice: infer Dice extends Record<string, unknown>;
886
- } ? ComponentId extends keyof Cards ? Cards[ComponentId] : ComponentId extends keyof Pieces ? Pieces[ComponentId] : ComponentId extends keyof Dice ? Dice[ComponentId] : never : never;
887
- type ComponentLocationByTypeOfTable<Table, ComponentId extends ComponentIdOfTable<Table>, Type extends RuntimeComponentLocation["type"]> = Extract<ComponentLocationOfTable<Table, ComponentId>, {
888
- type: Type;
889
- }>;
890
- type ResolvedDeckLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
891
- [DeckId in DeckIdOfTable<Table>]: {
892
- componentId: ComponentId;
893
- deckId: DeckId;
894
- cards: DeckCardsOfTable<Table, DeckId>;
895
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "InDeck"> & {
896
- deckId: DeckId;
897
- };
898
- };
899
- }[DeckIdOfTable<Table>];
900
- type ResolvedHandLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
901
- [HandId in HandIdOfTable<Table>]: {
902
- [PlayerId in PlayerIdOfTable<Table>]: {
903
- componentId: ComponentId;
904
- handId: HandId;
905
- playerId: PlayerId;
906
- cards: HandCardsOfTable<Table, HandId>;
907
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "InHand"> & {
908
- handId: HandId;
909
- playerId: PlayerId;
910
- };
911
- };
912
- }[PlayerIdOfTable<Table>];
913
- }[HandIdOfTable<Table>];
914
- type ResolvedZoneLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = ComponentLocationByTypeOfTable<Table, ComponentId, "InZone"> extends infer Location ? Location extends {
915
- type: "InZone";
916
- zoneId: infer ZoneId extends string;
917
- } ? {
918
- componentId: ComponentId;
919
- zoneId: ZoneId;
920
- location: Location;
921
- } : never : never;
922
- type ResolvedSpaceLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
923
- [BoardId in BoardIdOfTable<Table>]: {
924
- [SpaceId in SpaceIdOfTable<Table, BoardId>]: {
925
- componentId: ComponentId;
926
- boardId: BoardId;
927
- board: BoardRecord<Table, BoardId>;
928
- spaceId: SpaceId;
929
- space: Table["boards"]["byId"][BoardId]["spaces"][SpaceId];
930
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "OnSpace"> & {
931
- boardId: BoardId;
932
- spaceId: SpaceId;
933
- };
934
- };
935
- }[SpaceIdOfTable<Table, BoardId>];
936
- }[BoardIdOfTable<Table>];
937
- type ResolvedContainerLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
938
- [BoardId in BoardIdOfTable<Table>]: {
939
- [ContainerId in BoardContainerIdOfTable<Table, BoardId>]: {
940
- componentId: ComponentId;
941
- boardId: BoardId;
942
- board: BoardRecord<Table, BoardId>;
943
- containerId: ContainerId;
944
- container: Table["boards"]["byId"][BoardId]["containers"][ContainerId];
945
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "InContainer"> & {
946
- boardId: BoardId;
947
- containerId: ContainerId;
948
- };
949
- };
950
- }[BoardContainerIdOfTable<Table, BoardId>];
951
- }[BoardIdOfTable<Table>];
952
- type ResolvedEdgeLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
953
- [BoardId in TiledBoardIdOfTable<Table>]: {
954
- [EdgeId in TiledEdgeIdOfTable<Table, BoardId>]: {
955
- componentId: ComponentId;
956
- boardId: BoardId;
957
- board: TiledBoardRecord<Table, BoardId>;
958
- edgeId: EdgeId;
959
- edge: Extract<Table["boards"]["byId"][BoardId], {
960
- layout: "hex" | "square";
961
- }>["edges"][number];
962
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "OnEdge"> & {
963
- boardId: BoardId;
964
- edgeId: EdgeId;
965
- };
966
- };
967
- }[TiledEdgeIdOfTable<Table, BoardId>];
968
- }[TiledBoardIdOfTable<Table>];
969
- type ResolvedVertexLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = {
970
- [BoardId in TiledBoardIdOfTable<Table>]: {
971
- [VertexId in TiledVertexIdOfTable<Table, BoardId>]: {
972
- componentId: ComponentId;
973
- boardId: BoardId;
974
- board: TiledBoardRecord<Table, BoardId>;
975
- vertexId: VertexId;
976
- vertex: Extract<Table["boards"]["byId"][BoardId], {
977
- layout: "hex" | "square";
978
- }>["vertices"][number];
979
- location: ComponentLocationByTypeOfTable<Table, ComponentId, "OnVertex"> & {
980
- boardId: BoardId;
981
- vertexId: VertexId;
982
- };
983
- };
984
- }[TiledVertexIdOfTable<Table, BoardId>];
985
- }[TiledBoardIdOfTable<Table>];
986
- type ResolvedSlotLocation<Table extends RuntimeTableRecord, ComponentId extends ComponentIdOfTable<Table>> = ComponentLocationByTypeOfTable<Table, ComponentId, "InSlot"> extends infer Location ? Location extends {
987
- type: "InSlot";
988
- host: infer Host extends RuntimeSlotHostRef;
989
- slotId: infer SlotId extends string;
990
- } ? {
991
- componentId: ComponentId;
992
- host: Host;
993
- slotId: SlotId;
994
- location: Location;
995
- } : never : never;
996
- type TableQueries<Table extends RuntimeTableRecord> = {
997
- board: {
998
- get: <BoardId extends BoardIdOfTable<Table>>(boardId: BoardId) => BoardRecord<Table, BoardId>;
999
- hex: <BoardId extends HexBoardIdOfTable<Table>>(boardId: BoardId) => Extract<BoardRecord<Table, BoardId>, {
1000
- layout: "hex";
1001
- }>;
1002
- square: <BoardId extends SquareBoardIdOfTable<Table>>(boardId: BoardId) => Extract<BoardRecord<Table, BoardId>, {
1003
- layout: "square";
1004
- }>;
1005
- tiled: <BoardId extends TiledBoardIdOfTable<Table>>(boardId: BoardId) => TiledBoardRecord<Table, BoardId>;
1006
- space: <BoardId extends BoardIdOfTable<Table>, SpaceId extends SpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId) => Table["boards"]["byId"][BoardId]["spaces"][SpaceId];
1007
- hexSpace: <BoardId extends HexBoardIdOfTable<Table>, SpaceId extends HexSpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId) => Extract<Table["boards"]["byId"][BoardId], {
1008
- layout: "hex";
1009
- }>["spaces"][SpaceId];
1010
- squareSpace: <BoardId extends SquareBoardIdOfTable<Table>, SpaceId extends SquareSpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId) => Extract<Table["boards"]["byId"][BoardId], {
1011
- layout: "square";
1012
- }>["spaces"][SpaceId];
1013
- container: <BoardId extends BoardIdOfTable<Table>, ContainerId extends BoardContainerIdOfTable<Table, BoardId>>(boardId: BoardId, containerId: ContainerId) => Table["boards"]["byId"][BoardId]["containers"][ContainerId];
1014
- edge: <BoardId extends TiledBoardIdOfTable<Table>, EdgeId extends TiledEdgeIdOfTable<Table, BoardId>>(boardId: BoardId, edgeId: EdgeId) => TiledEdgeStateOfTable<Table, BoardId, EdgeId>;
1015
- vertex: <BoardId extends TiledBoardIdOfTable<Table>, VertexId extends TiledVertexIdOfTable<Table, BoardId>>(boardId: BoardId, vertexId: VertexId) => TiledVertexStateOfTable<Table, BoardId, VertexId>;
1016
- byType: <TypeId extends BoardTypeIdOfTable<Table>>(typeId: TypeId) => BoardIdOfTable<Table>[];
1017
- spacesByType: <BoardId extends BoardIdOfTable<Table>, TypeId extends SpaceTypeIdOfTable<Table, BoardId>>(boardId: BoardId, typeId: TypeId) => SpaceIdOfTable<Table, BoardId>[];
1018
- edgesByType: <BoardId extends TiledBoardIdOfTable<Table>, TypeId extends TiledEdgeTypeIdOfTable<Table, BoardId>>(boardId: BoardId, typeId: TypeId) => TiledEdgeIdOfTable<Table, BoardId>[];
1019
- verticesByType: <BoardId extends TiledBoardIdOfTable<Table>, TypeId extends TiledVertexTypeIdOfTable<Table, BoardId>>(boardId: BoardId, typeId: TypeId) => TiledVertexIdOfTable<Table, BoardId>[];
1020
- adjacentSpaces: <BoardId extends BoardIdOfTable<Table>, SpaceId extends SpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId) => SpaceIdOfTable<Table, BoardId>[];
1021
- relatedSpaces: <BoardId extends BoardIdOfTable<Table>, SpaceId extends SpaceIdOfTable<Table, BoardId>, TypeId extends RelationTypeIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId, relationTypeId: TypeId) => SpaceIdOfTable<Table, BoardId>[];
1022
- incidentEdges: <BoardId extends TiledBoardIdOfTable<Table>, VertexId extends TiledVertexIdOfTable<Table, BoardId>>(boardId: BoardId, vertexId: VertexId) => TiledEdgeIdOfTable<Table, BoardId>[];
1023
- incidentVertices: <BoardId extends TiledBoardIdOfTable<Table>, EdgeId extends TiledEdgeIdOfTable<Table, BoardId>>(boardId: BoardId, edgeId: EdgeId) => TiledVertexIdOfTable<Table, BoardId>[];
1024
- spaceEdges: <BoardId extends TiledBoardIdOfTable<Table>>(boardId: BoardId, spaceId: SpaceIdOfTable<Table, BoardId>) => TiledEdgeIdOfTable<Table, BoardId>[];
1025
- spaceVertices: <BoardId extends TiledBoardIdOfTable<Table>>(boardId: BoardId, spaceId: SpaceIdOfTable<Table, BoardId>) => TiledVertexIdOfTable<Table, BoardId>[];
1026
- spaceDistance: <BoardId extends BoardIdOfTable<Table>, SpaceId extends SpaceIdOfTable<Table, BoardId>>(boardId: BoardId, fromSpaceId: SpaceId, toSpaceId: SpaceId) => number;
1027
- hexSpaceAt: <BoardId extends HexBoardIdOfTable<Table>>(boardId: BoardId, q: number, r: number) => Extract<Table["boards"]["byId"][BoardId], {
1028
- layout: "hex";
1029
- }>["spaces"][HexSpaceIdOfTable<Table, BoardId>] | undefined;
1030
- squareSpaceAt: <BoardId extends SquareBoardIdOfTable<Table>>(boardId: BoardId, row: number, col: number) => Extract<Table["boards"]["byId"][BoardId], {
1031
- layout: "square";
1032
- }>["spaces"][SquareSpaceIdOfTable<Table, BoardId>] | undefined;
1033
- squareNeighbors: <BoardId extends SquareBoardIdOfTable<Table>, SpaceId extends SquareSpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId, options?: {
1034
- mode?: "orthogonal" | "diagonal" | "all";
1035
- }) => SquareSpaceIdOfTable<Table, BoardId>[];
1036
- squareDistance: <BoardId extends SquareBoardIdOfTable<Table>, SpaceId extends SquareSpaceIdOfTable<Table, BoardId>>(boardId: BoardId, fromSpaceId: SpaceId, toSpaceId: SpaceId, options?: {
1037
- metric?: "manhattan" | "chebyshev";
1038
- }) => number;
1039
- spaceOccupants: <BoardId extends BoardIdOfTable<Table>, SpaceId extends SpaceIdOfTable<Table, BoardId>>(boardId: BoardId, spaceId: SpaceId) => ComponentIdOfTable<Table>[];
1040
- containerOccupants: <BoardId extends BoardIdOfTable<Table>, ContainerId extends BoardContainerIdOfTable<Table, BoardId>>(boardId: BoardId, containerId: ContainerId) => ComponentIdOfTable<Table>[];
1041
- edgeOccupants: <BoardId extends TiledBoardIdOfTable<Table>, EdgeId extends TiledEdgeIdOfTable<Table, BoardId>>(boardId: BoardId, edgeId: EdgeId) => ComponentIdOfTable<Table>[];
1042
- vertexOccupants: <BoardId extends TiledBoardIdOfTable<Table>, VertexId extends TiledVertexIdOfTable<Table, BoardId>>(boardId: BoardId, vertexId: VertexId) => ComponentIdOfTable<Table>[];
1043
- };
1044
- zone: {
1045
- sharedCards: <ZoneId extends DeckIdOfTable<Table>>(zoneId: ZoneId) => DeckCardsForZone<Table, ZoneId>;
1046
- sharedCardCollection: <ZoneId extends DeckIdOfTable<Table>>(zoneId: ZoneId) => CardCollectionOfTable<Table>;
1047
- allSharedCards: () => {
1048
- readonly [Z in DeckIdOfTable<Table>]: DeckCardsOfTable<Table, Z>;
1049
- };
1050
- playerCards: <PlayerId extends PlayerIdOfTable<Table>, ZoneId extends HandIdOfTable<Table>>(playerId: PlayerId, zoneId: ZoneId) => HandCardsForZone<Table, ZoneId>;
1051
- playerCardCollection: <PlayerId extends PlayerIdOfTable<Table>, ZoneId extends HandIdOfTable<Table>>(playerId: PlayerId, zoneId: ZoneId) => CardCollectionOfTable<Table>;
1052
- allPlayerCards: <ZoneId extends HandIdOfTable<Table>>(zoneId: ZoneId) => {
1053
- readonly [P in PlayerIdOfTable<Table>]: HandCardsOfTable<Table, ZoneId>;
1054
- };
1055
- };
1056
- card: {
1057
- get: <CardId extends CardIdOfTable<Table>>(cardId: CardId) => ViewCardOfTable<Table, CardId>;
1058
- byIds: <CardIds extends readonly CardIdOfTable<Table>[]>(cardIds: CardIds) => CardsByIdOfTable<Table, CardIds>;
1059
- owner: <CardId extends CardIdOfTable<Table>>(cardId: CardId) => Table["ownerOfCard"][CardId];
1060
- visibility: <CardId extends CardIdOfTable<Table>>(cardId: CardId) => Table["visibility"][CardId];
1061
- };
1062
- slot: {
1063
- occupants: (host: RuntimeSlotHostRef, slotId: string) => SlotOccupantsOfTable<Table>;
1064
- occupantsByHost: (host: RuntimeSlotHostRef) => SlotOccupantsBySlotIdOfTable<Table>;
1065
- pieceOccupants: (hostId: string, slotId: string) => SlotOccupantsOfTable<Table>;
1066
- pieceOccupantsByHost: (hostId: string) => SlotOccupantsBySlotIdOfTable<Table>;
1067
- dieOccupants: (hostId: string, slotId: string) => SlotOccupantsOfTable<Table>;
1068
- dieOccupantsByHost: (hostId: string) => SlotOccupantsBySlotIdOfTable<Table>;
1069
- };
1070
- player: {
1071
- /** Seating order from the manifest / setup profile. */
1072
- order: () => Table["playerOrder"];
1073
- /**
1074
- * Next player id in seating order after `playerId`, wrapping around to
1075
- * the first seat. Returns `null` when `playerId` is unknown or the
1076
- * order is empty. Convenient for "whose turn is next" logic.
1077
- */
1078
- nextInOrder: (playerId: PlayerIdOfTable<Table>) => PlayerIdOfTable<Table> | null;
1079
- /** All resource balances for a player, as the manifest-typed record. */
1080
- resources: <PlayerId extends PlayerIdOfTable<Table>>(playerId: PlayerId) => ResourceBalancesOfTable<Table>;
1081
- /** Balance of a single resource; returns `0` when unset. */
1082
- resource: (playerId: PlayerIdOfTable<Table>, resourceId: ResourceIdOfTable<Table>) => number;
1083
- /**
1084
- * Sum of every resource amount held by a player (e.g. "total cards in
1085
- * hand" checks). Returns `0` for unknown players or empty balances.
1086
- */
1087
- resourceTotal: (playerId: PlayerIdOfTable<Table>) => number;
1088
- /** `true` when the player can pay every non-zero amount in `amounts`. */
1089
- canAfford: (playerId: PlayerIdOfTable<Table>, amounts: ResourceAmountsOfTable<Table>) => boolean;
1090
- /** Shortfall per resource when the player cannot afford `amounts`. */
1091
- missingResources: (playerId: PlayerIdOfTable<Table>, amounts: ResourceAmountsOfTable<Table>) => Partial<Record<ResourceIdOfTable<Table>, number>>;
1092
- };
1093
- component: {
1094
- data: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ComponentDataOfTable<Table, ComponentId> | undefined;
1095
- location: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ComponentLocationOfTable<Table, ComponentId> | undefined;
1096
- deck: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedDeckLocation<Table, ComponentId> | null;
1097
- hand: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedHandLocation<Table, ComponentId> | null;
1098
- zone: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedZoneLocation<Table, ComponentId> | null;
1099
- space: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedSpaceLocation<Table, ComponentId> | null;
1100
- container: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedContainerLocation<Table, ComponentId> | null;
1101
- edge: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedEdgeLocation<Table, ComponentId> | null;
1102
- vertex: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedVertexLocation<Table, ComponentId> | null;
1103
- slot: <ComponentId extends ComponentIdOfTable<Table>>(componentId: ComponentId) => ResolvedSlotLocation<Table, ComponentId> | null;
1104
- };
1105
- };
1106
- type TableQueriesOfState<State extends {
1107
- table: RuntimeTableRecord;
1108
- }> = TableQueries<TableOfState<State>>;
1109
-
1110
- declare const manifestIdSchemaBrand: unique symbol;
1111
- type ManifestIdFamily = keyof ManifestIds<string, string, string, string, string>;
1112
- type ManifestIdSchema<Output = unknown, Family extends ManifestIdFamily | undefined = ManifestIdFamily | undefined> = z.ZodType<Output> & {
1113
- readonly [manifestIdSchemaBrand]: Family;
1114
- };
1115
- type ManifestLiterals<PlayerId extends string, DeckId extends string, HandId extends string, CardId extends string, PhaseName extends string = string> = {
1116
- playerIds: readonly PlayerId[];
1117
- phaseNames: readonly PhaseName[];
1118
- boardLayouts: readonly ("generic" | "hex" | "square")[];
1119
- setupOptionIds: readonly string[];
1120
- setupProfileIds: readonly string[];
1121
- cardSetIds: readonly string[];
1122
- cardTypes: readonly string[];
1123
- deckIds: readonly DeckId[];
1124
- handIds: readonly HandId[];
1125
- sharedZoneIds: readonly DeckId[];
1126
- playerZoneIds: readonly HandId[];
1127
- zoneIds: readonly (DeckId | HandId)[];
1128
- cardIds: readonly CardId[];
1129
- resourceIds: readonly string[];
1130
- resourcePresentationById?: Record<string, {
1131
- label: string;
1132
- icon?: string | null;
1133
- }>;
1134
- pieceTypeIds: readonly string[];
1135
- pieceIds: readonly string[];
1136
- dieTypeIds: readonly string[];
1137
- dieIds: readonly string[];
1138
- boardTemplateIds: readonly string[];
1139
- boardTypeIds: readonly string[];
1140
- boardBaseIds: readonly string[];
1141
- boardIds: readonly string[];
1142
- boardContainerIds: readonly string[];
1143
- relationTypeIds: readonly string[];
1144
- edgeIds: readonly string[];
1145
- edgeTypeIds: readonly string[];
1146
- vertexIds: readonly string[];
1147
- vertexTypeIds: readonly string[];
1148
- spaceIds: readonly string[];
1149
- spaceTypeIds: readonly string[];
1150
- handVisibilityById: Record<HandId, RuntimeHandVisibilityMode>;
1151
- zoneVisibilityById: Record<DeckId | HandId, RuntimeHandVisibilityMode>;
1152
- setupChoiceIdsByOptionId: Record<string, readonly string[]>;
1153
- cardSetIdByCardId: Record<CardId, string>;
1154
- cardTypeByCardId: Record<CardId, string>;
1155
- cardSetIdsBySharedZoneId: Record<DeckId, readonly string[]>;
1156
- cardSetIdsByPlayerZoneId: Record<HandId, readonly string[]>;
1157
- };
1158
- type ManifestIds<PlayerId extends string, DeckId extends string, HandId extends string, CardId extends string, PhaseName extends string = string> = {
1159
- playerId: z.ZodType<PlayerId>;
1160
- phaseName: z.ZodType<PhaseName>;
1161
- boardLayout: AnySchema;
1162
- setupOptionId: AnySchema;
1163
- setupProfileId: AnySchema;
1164
- cardSetId: AnySchema;
1165
- cardType: AnySchema;
1166
- cardId: z.ZodType<CardId>;
1167
- deckId: z.ZodType<DeckId>;
1168
- handId: z.ZodType<HandId>;
1169
- sharedZoneId: AnySchema;
1170
- playerZoneId: AnySchema;
1171
- zoneId: AnySchema;
1172
- resourceId: AnySchema;
1173
- pieceTypeId: AnySchema;
1174
- pieceId: AnySchema;
1175
- dieId: AnySchema;
1176
- dieTypeId: AnySchema;
1177
- boardTypeId: AnySchema;
1178
- boardId: AnySchema;
1179
- boardBaseId: AnySchema;
1180
- boardContainerId: AnySchema;
1181
- relationTypeId: AnySchema;
1182
- edgeId: AnySchema;
1183
- edgeTypeId: AnySchema;
1184
- vertexId: AnySchema;
1185
- vertexTypeId: AnySchema;
1186
- spaceId: AnySchema;
1187
- spaceTypeId: AnySchema;
1188
- };
1189
- type ManifestDefaults<Table extends RuntimeTableRecord> = {
1190
- zones: (playerIds?: readonly string[]) => Table["zones"];
1191
- decks: (playerIds?: readonly string[]) => Table["decks"];
1192
- hands: (playerIds?: readonly string[]) => Table["hands"];
1193
- handVisibility: (playerIds?: readonly string[]) => Table["handVisibility"];
1194
- ownerOfCard: (playerIds?: readonly string[]) => Table["ownerOfCard"];
1195
- visibility: (playerIds?: readonly string[]) => Table["visibility"];
1196
- resources: (playerIds?: readonly string[]) => Table["resources"];
1197
- };
1198
- type ManifestNormalSetup<Table extends RuntimeTableRecord> = {
1199
- readonly minPlayers: number;
1200
- readonly maxPlayers: number;
1201
- readonly createInitialTable: (options: {
1202
- readonly playerIds: readonly string[];
1203
- }) => Table;
1204
- };
1205
- type StaticBoards<Table extends RuntimeTableRecord> = Pick<Table["boards"], "byId" | "hex" | "square">;
1206
- type SetupOptionChoiceMetadata = {
1207
- id: string;
1208
- label: string;
1209
- description?: string | null;
1210
- };
1211
- type SetupOptionMetadata = {
1212
- id: string;
1213
- name: string;
1214
- description?: string | null;
1215
- choices: readonly SetupOptionChoiceMetadata[];
1216
- };
1217
- type SetupProfileMetadata = {
1218
- id: string;
1219
- name: string;
1220
- description?: string | null;
1221
- optionValues?: Record<string, string> | null;
1222
- guidance?: {
1223
- summary?: string | null;
1224
- steps: readonly {
1225
- id: string;
1226
- label: string;
1227
- description?: string | null;
1228
- }[];
1229
- } | null;
1230
- };
1231
- type ReducerManifestContract<Table extends RuntimeTableRecord, PhaseName extends string, PlayerId extends string, DeckId extends string, HandId extends string, CardId extends string> = {
1232
- literals: ManifestLiterals<PlayerId, DeckId, HandId, CardId, PhaseName>;
1233
- ids: ManifestIds<PlayerId, DeckId, HandId, CardId, PhaseName>;
1234
- defaults: ManifestDefaults<Table>;
1235
- /**
1236
- * Normal-session setup capability supplied by the manifest compiler.
1237
- *
1238
- * This remains optional on the structural contract so small handwritten
1239
- * manifests can model focused reducer tests without recreating generated
1240
- * topology metadata. Compiled manifests always provide it.
1241
- */
1242
- normalSetup?: ManifestNormalSetup<Table>;
1243
- staticBoards?: StaticBoards<Table>;
1244
- setupOptionsById: Record<string, SetupOptionMetadata>;
1245
- setupChoiceIdsByOptionId: Record<string, readonly string[]>;
1246
- setupProfilesById: Record<string, SetupProfileMetadata>;
1247
- tableSchema: z.ZodType<Table>;
1248
- runtimeSchema: AnySchema;
1249
- createGameStateSchema: (config: {
1250
- phaseNameSchema: AnySchema;
1251
- publicSchema: AnySchema;
1252
- privateSchema: AnySchema;
1253
- hiddenSchema: AnySchema;
1254
- phasesSchema: AnySchema;
1255
- }) => AnySchema;
1256
- };
1257
- type ReducerManifestContractLike<Table extends RuntimeTableRecord = RuntimeTableRecord, PhaseName extends string = string, PlayerId extends string = string, DeckId extends string = string, HandId extends string = string, CardId extends string = string> = ReducerManifestContract<Table, PhaseName, PlayerId, DeckId, HandId, CardId>;
1258
- type ManifestContract<Table extends RuntimeTableRecord> = ReducerManifestContract<Table, string, PlayerIdOfTable<Table>, DeckIdOfTable<Table>, HandIdOfTable<Table>, CardIdOfTable<Table>>;
1259
- declare function markManifestScopedSchema<Schema extends z.ZodTypeAny, const Family extends ManifestIdFamily | undefined = undefined>(schema: Schema, family?: Family): Schema & ManifestIdSchema<z.infer<Schema>, Family>;
1260
- declare function isManifestScopedSchema(schema: unknown): boolean;
1261
- declare function manifestSchemaFamily(schema: unknown): ManifestIdFamily | undefined;
1262
- declare function createManifestStringLiteralSchema<Values extends readonly string[], const Family extends ManifestIdFamily | undefined = undefined>(values: Values, family?: Family): ManifestIdSchema<Values[number] extends never ? string : Values[number], Family>;
1263
- declare function assumeManifestSchema<Output, Family extends ManifestIdFamily | undefined>(schema: ManifestIdSchema<unknown, Family>): ManifestIdSchema<Output, Family>;
1264
- declare function assumeManifestSchema<Output>(schema: z.ZodTypeAny): z.ZodType<Output>;
1265
- declare function cloneManifestDefault<Value>(value: Value): Value;
1266
- declare function resolveManifestPlayerIds<PlayerId extends string>(manifestPlayerIds: readonly PlayerId[], playerIds: readonly string[] | undefined): readonly PlayerId[];
1267
- declare function createManifestRuntimeSchema<PhaseNameSchema extends z.ZodTypeAny, PlayerId extends string, SetupProfileId extends string>({ phaseNameSchema, playerIdSchema, setupProfileIdSchema, }: {
1268
- phaseNameSchema: PhaseNameSchema;
1269
- playerIdSchema: z.ZodType<PlayerId>;
1270
- setupProfileIdSchema: z.ZodType<SetupProfileId>;
1271
- }): z.ZodObject<{
1272
- prompts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1273
- id: z.ZodString;
1274
- promptId: z.ZodString;
1275
- to: z.ZodType<PlayerId, unknown, z.core.$ZodTypeInternals<PlayerId, unknown>>;
1276
- title: z.ZodOptional<z.ZodString>;
1277
- payload: z.ZodOptional<z.ZodUnknown>;
1278
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1279
- id: z.ZodString;
1280
- label: z.ZodString;
1281
- }, z.core.$strip>>>;
1282
- resume: z.ZodObject<{
1283
- id: z.ZodString;
1284
- data: z.ZodUnknown;
1285
- }, z.core.$strip>;
1286
- }, z.core.$strip>>>;
1287
- rng: z.ZodDefault<z.ZodObject<{
1288
- seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1289
- cursor: z.ZodDefault<z.ZodNumber>;
1290
- trace: z.ZodDefault<z.ZodArray<z.ZodString>>;
1291
- draws: z.ZodDefault<z.ZodArray<z.ZodObject<{
1292
- index: z.ZodNumber;
1293
- cursorBefore: z.ZodNumber;
1294
- cursorAfter: z.ZodNumber;
1295
- operation: z.ZodObject<{
1296
- kind: z.ZodString;
1297
- parameters: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1298
- }, z.core.$strict>;
1299
- }, z.core.$strict>>>;
1300
- }, z.core.$strip>>;
1301
- setup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1302
- profileId: z.ZodType<SetupProfileId, unknown, z.core.$ZodTypeInternals<SetupProfileId, unknown>>;
1303
- optionValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
1304
- }, z.core.$strip>>>;
1305
- simultaneous: z.ZodDefault<z.ZodObject<{
1306
- current: z.ZodNullable<z.ZodObject<{
1307
- phaseName: PhaseNameSchema;
1308
- actors: z.ZodArray<z.ZodType<PlayerId, unknown, z.core.$ZodTypeInternals<PlayerId, unknown>>>;
1309
- submissions: z.ZodRecord<z.ZodString, z.ZodObject<{
1310
- interactionId: z.ZodString;
1311
- params: z.ZodUnknown;
1312
- }, z.core.$strip>>;
1313
- }, z.core.$strip>>;
1314
- }, z.core.$strip>>;
1315
- lastTransition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1316
- from: PhaseNameSchema;
1317
- to: PhaseNameSchema;
1318
- }, z.core.$strip>>>;
1319
- nextInstanceId: z.ZodDefault<z.ZodNumber>;
1320
- }, z.core.$strip>;
1321
- declare function createManifestGameStateSchema<Table extends RuntimeTableRecord, PhaseNameSchema extends z.ZodTypeAny, PublicSchema extends z.ZodTypeAny, PrivateSchema extends z.ZodTypeAny, HiddenSchema extends z.ZodTypeAny, PhasesSchema extends z.ZodTypeAny, PlayerId extends string, SetupProfileId extends string>({ tableSchema, playerIdSchema, setupProfileIdSchema, phaseNameSchema, publicSchema, privateSchema, hiddenSchema, phasesSchema, }: {
1322
- tableSchema: z.ZodType<Table>;
1323
- playerIdSchema: z.ZodType<PlayerId>;
1324
- setupProfileIdSchema: z.ZodType<SetupProfileId>;
1325
- phaseNameSchema: PhaseNameSchema;
1326
- publicSchema: PublicSchema;
1327
- privateSchema: PrivateSchema;
1328
- hiddenSchema: HiddenSchema;
1329
- phasesSchema: PhasesSchema;
1330
- }): z.ZodObject<{
1331
- table: z.ZodType<Table, unknown, z.core.$ZodTypeInternals<Table, unknown>>;
1332
- public: PublicSchema;
1333
- private: z.ZodRecord<z.ZodString, PrivateSchema>;
1334
- hidden: HiddenSchema;
1335
- flow: z.ZodObject<{
1336
- currentPhase: PhaseNameSchema;
1337
- turn: z.ZodNumber;
1338
- round: z.ZodNumber;
1339
- activePlayers: z.ZodArray<z.ZodType<PlayerId, unknown, z.core.$ZodTypeInternals<PlayerId, unknown>>>;
1340
- }, z.core.$strip>;
1341
- phase: PhasesSchema;
1342
- runtime: z.ZodObject<{
1343
- prompts: z.ZodDefault<z.ZodArray<z.ZodObject<{
1344
- id: z.ZodString;
1345
- promptId: z.ZodString;
1346
- to: z.ZodType<PlayerId, unknown, z.core.$ZodTypeInternals<PlayerId, unknown>>;
1347
- title: z.ZodOptional<z.ZodString>;
1348
- payload: z.ZodOptional<z.ZodUnknown>;
1349
- options: z.ZodOptional<z.ZodArray<z.ZodObject<{
1350
- id: z.ZodString;
1351
- label: z.ZodString;
1352
- }, z.core.$strip>>>;
1353
- resume: z.ZodObject<{
1354
- id: z.ZodString;
1355
- data: z.ZodUnknown;
1356
- }, z.core.$strip>;
1357
- }, z.core.$strip>>>;
1358
- rng: z.ZodDefault<z.ZodObject<{
1359
- seed: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
1360
- cursor: z.ZodDefault<z.ZodNumber>;
1361
- trace: z.ZodDefault<z.ZodArray<z.ZodString>>;
1362
- draws: z.ZodDefault<z.ZodArray<z.ZodObject<{
1363
- index: z.ZodNumber;
1364
- cursorBefore: z.ZodNumber;
1365
- cursorAfter: z.ZodNumber;
1366
- operation: z.ZodObject<{
1367
- kind: z.ZodString;
1368
- parameters: z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>;
1369
- }, z.core.$strict>;
1370
- }, z.core.$strict>>>;
1371
- }, z.core.$strip>>;
1372
- setup: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1373
- profileId: z.ZodType<SetupProfileId, unknown, z.core.$ZodTypeInternals<SetupProfileId, unknown>>;
1374
- optionValues: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodString>>>;
1375
- }, z.core.$strip>>>;
1376
- simultaneous: z.ZodDefault<z.ZodObject<{
1377
- current: z.ZodNullable<z.ZodObject<{
1378
- phaseName: PhaseNameSchema;
1379
- actors: z.ZodArray<z.ZodType<PlayerId, unknown, z.core.$ZodTypeInternals<PlayerId, unknown>>>;
1380
- submissions: z.ZodRecord<z.ZodString, z.ZodObject<{
1381
- interactionId: z.ZodString;
1382
- params: z.ZodUnknown;
1383
- }, z.core.$strip>>;
1384
- }, z.core.$strip>>;
1385
- }, z.core.$strip>>;
1386
- lastTransition: z.ZodDefault<z.ZodNullable<z.ZodObject<{
1387
- from: PhaseNameSchema;
1388
- to: PhaseNameSchema;
1389
- }, z.core.$strip>>>;
1390
- nextInstanceId: z.ZodDefault<z.ZodNumber>;
1391
- }, z.core.$strip>;
1392
- }, z.core.$strip>;
1393
- type StateDefinition<PublicSchema extends SchemaLike<object>, PrivateSchema extends SchemaLike<object>, HiddenSchema extends SchemaLike<object>> = {
1394
- public: PublicSchema;
1395
- private: PrivateSchema;
1396
- hidden: HiddenSchema;
1397
- };
1398
- type InitContext<Table extends RuntimeTableRecord, Manifest extends ReducerManifestContract<Table, string, string, string, string, string> = ManifestContract<Table>> = {
1399
- manifest: Manifest;
1400
- table: Table;
1401
- playerIds: PlayerIdOfTable<Table>[];
1402
- rngSeed?: number | null;
1403
- setup: SetupSelectionOfManifest<Manifest> | null;
1404
- q: TableQueriesOfState<{
1405
- table: Table;
1406
- }>;
1407
- };
1408
- type InitSetupSelectionInput<Manifest extends ReducerManifestContract<RuntimeTableRecord, string, string, string, string, string> = ReducerManifestContractLike> = SetupSelectionInputOfManifest<Manifest>;
1409
- type SetupBootstrapSharedZoneRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1410
- type: "sharedZone";
1411
- zoneId: SharedZoneIdOfManifest<Manifest>;
1412
- };
1413
- type SetupBootstrapPerPlayerZoneRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1414
- type: "playerZone";
1415
- zoneId: PlayerZoneIdOfManifest<Manifest>;
1416
- playerId: PlayerIdOfManifest<Manifest>;
1417
- };
1418
- type SetupBootstrapSharedBoardContainerRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1419
- type: "sharedBoardContainer";
1420
- boardId: BoardBaseIdOfManifest<Manifest>;
1421
- containerId: BoardContainerIdOfManifest<Manifest>;
1422
- };
1423
- type SetupBootstrapPerPlayerBoardContainerRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1424
- type: "playerBoardContainer";
1425
- boardId: BoardBaseIdOfManifest<Manifest>;
1426
- playerId: PlayerIdOfManifest<Manifest>;
1427
- containerId: BoardContainerIdOfManifest<Manifest>;
1428
- };
1429
- type SetupBootstrapSharedBoardSpaceRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1430
- type: "sharedBoardSpace";
1431
- boardId: BoardBaseIdOfManifest<Manifest>;
1432
- spaceId: SpaceIdOfManifest<Manifest>;
1433
- };
1434
- type SetupBootstrapPerPlayerBoardSpaceRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1435
- type: "playerBoardSpace";
1436
- boardId: BoardBaseIdOfManifest<Manifest>;
1437
- playerId: PlayerIdOfManifest<Manifest>;
1438
- spaceId: SpaceIdOfManifest<Manifest>;
1439
- };
1440
- type SetupBootstrapContainerRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = SetupBootstrapSharedZoneRef<Manifest> | SetupBootstrapPerPlayerZoneRef<Manifest> | SetupBootstrapSharedBoardContainerRef<Manifest> | SetupBootstrapPerPlayerBoardContainerRef<Manifest>;
1441
- type SetupBootstrapDestinationRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = SetupBootstrapContainerRef<Manifest> | SetupBootstrapSharedBoardSpaceRef<Manifest> | SetupBootstrapPerPlayerBoardSpaceRef<Manifest>;
1442
- type SetupBootstrapPerPlayerContainerTemplateRef<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1443
- type: "playerZone";
1444
- zoneId: PlayerZoneIdOfManifest<Manifest>;
1445
- } | {
1446
- type: "playerBoardContainer";
1447
- boardId: BoardBaseIdOfManifest<Manifest>;
1448
- containerId: BoardContainerIdOfManifest<Manifest>;
1449
- };
1450
- type SetupBootstrapStep<Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1451
- type: "shuffle";
1452
- container: SetupBootstrapContainerRef<Manifest>;
1453
- } | {
1454
- type: "move";
1455
- from: SetupBootstrapContainerRef<Manifest>;
1456
- to: SetupBootstrapDestinationRef<Manifest>;
1457
- count?: number;
1458
- componentIds?: readonly (CardIdOfManifest<Manifest> | PieceIdOfManifest<Manifest> | DieIdOfManifest<Manifest>)[];
1459
- } | {
1460
- type: "deal";
1461
- from: SetupBootstrapSharedZoneRef<Manifest> | SetupBootstrapSharedBoardContainerRef<Manifest>;
1462
- to: SetupBootstrapPerPlayerContainerTemplateRef<Manifest>;
1463
- count: number;
1464
- playerIds?: readonly PlayerIdOfManifest<Manifest>[];
1465
- };
1466
- type SetupProfileDefinition<PhaseName extends string = string, Manifest extends ReducerManifestContractLike = ReducerManifestContractLike> = {
1467
- initialPhase?: PhaseName;
1468
- bootstrap?: readonly SetupBootstrapStep<Manifest>[];
1469
- };
1470
-
1471
- type FlowInstruction<PhaseName extends string> = {
1472
- kind: "flow.transition";
1473
- to: PhaseName;
1474
- };
1475
- type EngineRollDieInstruction = {
1476
- kind: "engine.rollDie";
1477
- dieId: string;
1478
- continuation?: AnyContinuationToken;
1479
- };
1480
- type EngineShuffleSharedZoneInstruction<DeckId extends string> = {
1481
- kind: "engine.shuffleSharedZone";
1482
- zoneId: DeckId;
1483
- continuation?: AnyContinuationToken;
1484
- };
1485
- type EngineShufflePlayerZoneInstruction<PlayerZoneId extends string, PlayerId extends string> = {
1486
- kind: "engine.shufflePlayerZone";
1487
- zoneId: PlayerZoneId;
1488
- playerId: PlayerId;
1489
- continuation?: AnyContinuationToken;
1490
- };
1491
- type EngineInstruction<DeckId extends string, PlayerZoneId extends string = string, PlayerId extends string = string> = EngineRollDieInstruction | EngineShuffleSharedZoneInstruction<DeckId> | EngineShufflePlayerZoneInstruction<PlayerZoneId, PlayerId>;
1492
- type RuntimeInstruction<PhaseName extends string, DeckId extends string, PlayerZoneId extends string = string, PlayerId extends string = string> = FlowInstruction<PhaseName> | EngineInstruction<DeckId, PlayerZoneId, PlayerId>;
1493
- type RuntimeInstructionForState<State> = RuntimeInstruction<PhaseNameOfState<State>, DeckIdOfState<State>, PlayerZoneIdOfState<State>, PlayerIdOfState<State>>;
1494
-
1495
- type ContinuationToken<Data = RuntimePayload, ContinuationId extends string = string, Response = RuntimePayload> = {
1496
- id: ContinuationId;
1497
- data: Data;
1498
- readonly __responseType?: Response;
1499
- };
1500
- type ContinuationResponseOf<Token> = Token extends ContinuationToken<unknown, string, infer Response> ? Response : never;
1501
- type AnyContinuationToken = ContinuationToken<RuntimePayload, string, RuntimePayload>;
1502
- /**
1503
- * Declarative choice option. Retained as the shape used by prompt-kind
1504
- * interactions' `options` field (see `InteractionSpec.options` in
1505
- * `model/spec.ts`). Independent of any specific prompt authoring API.
1506
- */
1507
- type ChoiceOption<OptionId extends string = string> = {
1508
- id: OptionId;
1509
- label: string;
1510
- };
1511
- type RuntimePhaseState = object;
1512
- type PhaseAccessor<PhaseStates extends Record<string, object>, CurrentPhase extends keyof PhaseStates & string = keyof PhaseStates & string> = {
1513
- get<PhaseName extends keyof PhaseStates & string>(phaseName: PhaseName): CurrentPhase extends PhaseName ? PhaseStates[PhaseName] : PhaseStates[PhaseName] | null;
1514
- };
1515
- type PhasePayload<PhaseStates extends Record<string, object>, CurrentPhase extends keyof PhaseStates & string> = PhaseStates[CurrentPhase] & PhaseAccessor<PhaseStates, CurrentPhase>;
1516
- type FlowState<PhaseName extends string, PlayerId extends string> = {
1517
- currentPhase: PhaseName;
1518
- turn: number;
1519
- round: number;
1520
- activePlayers: PlayerId[];
1521
- };
1522
- type RuntimeRngState = {
1523
- seed?: number | null;
1524
- cursor: number;
1525
- trace: string[];
1526
- draws: RuntimeRngDraw[];
1527
- };
1528
- type RuntimeRngOperationParameter = string | number | boolean;
1529
- type RuntimeRngOperation = {
1530
- kind: string;
1531
- parameters: Record<string, RuntimeRngOperationParameter>;
1532
- };
1533
- /**
1534
- * Public, persisted identity for one deterministic RNG cursor advance.
1535
- *
1536
- * Sampled values deliberately remain absent. Their consequences are exposed
1537
- * only through the normal public/player projections.
1538
- */
1539
- type RuntimeRngDraw = {
1540
- index: number;
1541
- cursorBefore: number;
1542
- cursorAfter: number;
1543
- operation: RuntimeRngOperation;
1544
- };
1545
- type RuntimeSimultaneousSubmission = {
1546
- interactionId: string;
1547
- params: RuntimePayload;
1548
- };
1549
- type RuntimeSimultaneousState<PhaseName extends string, PlayerId extends string> = {
1550
- current: {
1551
- phaseName: PhaseName;
1552
- actors: PlayerId[];
1553
- submissions: Partial<Record<PlayerId, RuntimeSimultaneousSubmission>>;
1554
- } | null;
1555
- };
1556
- /**
1557
- * Marker tag attached by `defineEffect` to every effect spec. `fx.effect`
1558
- * uses `type` to dispatch to the right wire-effect builder.
1559
- */
1560
- type EffectTypeTag = "rollDie" | "shuffleSharedZone" | "shufflePlayerZone";
1561
- /**
1562
- * Structural shape of the objects produced by `defineEffect`, as seen by
1563
- * the `fx.effect` dispatcher. The public, per-type effect definitions live
1564
- * in `model/spec.ts`.
1565
- */
1566
- type EffectSpecLike<ContextSchema extends AnySchema = AnySchema> = {
1567
- type: EffectTypeTag;
1568
- id: string;
1569
- contextSchema?: ContextSchema;
1570
- /**
1571
- * Opaque authoring-time continuation callable. The runtime only needs its
1572
- * `id`; the heterogeneously-typed `(data) => ...` signature is erased
1573
- * here. The `data` parameter is typed as `never` so that this structural
1574
- * upper bound is assignable-from every concrete per-effect continuation
1575
- * (function parameters are contravariant — a specific `(data: T) => R`
1576
- * is assignable to `(data: X) => R` only when `X <: T`, and `never <: T`
1577
- * holds for every `T`).
1578
- */
1579
- __continuation?: ((data: never) => unknown) & {
1580
- id: string;
1581
- };
1582
- };
1583
- /**
1584
- * Options accepted by `fx.effect(effect, options)`, specialized by
1585
- * `effect.type`.
1586
- */
1587
- type EffectContextValue<Effect extends EffectSpecLike> = NonNullable<Effect["contextSchema"]> extends AnySchema ? z.infer<NonNullable<Effect["contextSchema"]>> : undefined;
1588
- type EffectInvokeOptions<Effect extends EffectSpecLike, State extends {
1589
- table: RuntimeTableRecord;
1590
- flow: {
1591
- currentPhase: string;
1592
- };
1593
- }> = Effect["type"] extends "rollDie" ? {
1594
- dieId: StringKeyOf<TableOfState<State>["dice"]>;
1595
- context?: EffectContextValue<Effect>;
1596
- } : Effect["type"] extends "shuffleSharedZone" ? {
1597
- zoneId: DeckIdOfState<State>;
1598
- context?: EffectContextValue<Effect>;
1599
- } : Effect["type"] extends "shufflePlayerZone" ? {
1600
- zoneId: PlayerZoneIdOfState<State>;
1601
- playerId: PlayerIdOfState<State>;
1602
- context?: EffectContextValue<Effect>;
1603
- } : never;
1604
- type EffectInstructionForState<Effect extends EffectSpecLike, State extends {
1605
- table: RuntimeTableRecord;
1606
- flow: {
1607
- currentPhase: string;
1608
- };
1609
- }> = Effect["type"] extends "rollDie" ? EngineRollDieInstruction : Effect["type"] extends "shuffleSharedZone" ? EngineShuffleSharedZoneInstruction<DeckIdOfState<State>> : Effect["type"] extends "shufflePlayerZone" ? EngineShufflePlayerZoneInstruction<PlayerZoneIdOfState<State>, PlayerIdOfState<State>> : never;
1610
- type ReducerFx<State extends {
1611
- table: RuntimeTableRecord;
1612
- flow: {
1613
- currentPhase: string;
1614
- };
1615
- }> = {
1616
- transition: <To extends PhaseNameOfState<State>>(to: To) => FlowInstruction<To>;
1617
- /**
1618
- * Invoke an engine-side resumable effect authored via `defineEffect`.
1619
- * The returned runtime instruction is consumed by the engine; if the effect
1620
- * has a `reduce`, its continuation is delivered back as a typed input.
1621
- */
1622
- effect: <Effect extends EffectSpecLike>(effect: Effect, options: EffectInvokeOptions<Effect, State>) => EffectInstructionForState<Effect, State>;
1623
- };
1624
- type RuntimeState<PhaseName extends string, PlayerId extends string, Setup extends RuntimeSetupSelection = RuntimeSetupSelection> = {
1625
- rng: RuntimeRngState;
1626
- setup: Setup | null;
1627
- simultaneous: RuntimeSimultaneousState<PhaseName, PlayerId>;
1628
- lastTransition: {
1629
- from: PhaseName;
1630
- to: PhaseName;
1631
- } | null;
1632
- };
1633
- type ReducerRuntimeStateForState<State extends {
1634
- table: RuntimeTableRecord;
1635
- flow: {
1636
- currentPhase: string;
1637
- };
1638
- }, Setup extends RuntimeSetupSelection = RuntimeSetupSelection> = RuntimeState<PhaseNameOfState<State>, PlayerIdOfState<State>, Setup>;
1639
- type ReducerGameState<Table extends RuntimeTableRecord, PublicState extends object, PrivateState extends object, HiddenState extends object, PhaseState extends RuntimePhaseState, PhaseName extends string, PhaseStates extends Record<PhaseName, object> = Record<PhaseName, PhaseState>> = {
1640
- table: Table;
1641
- publicState: PublicState;
1642
- privateState: Record<PlayerIdOfTable<Table>, PrivateState>;
1643
- hiddenState: HiddenState;
1644
- flow: FlowState<PhaseName, PlayerIdOfTable<Table>>;
1645
- phase: PhaseState & PhaseAccessor<PhaseStates>;
1646
- };
1647
- type ReducerSessionState<State extends {
1648
- table: RuntimeTableRecord;
1649
- flow: {
1650
- currentPhase: string;
1651
- };
1652
- }, Setup extends RuntimeSetupSelection = RuntimeSetupSelection> = {
1653
- domain: State;
1654
- runtime: ReducerRuntimeStateForState<State, Setup>;
1655
- };
1656
- type ReducerValidationResult = {
1657
- valid: true;
1658
- } | {
1659
- valid: false;
1660
- errorCode: string;
1661
- message?: string;
1662
- };
1663
- type ReducerReject = {
1664
- type: "reject";
1665
- errorCode: string;
1666
- message?: string;
1667
- };
1668
-
1669
- type OutcomeResult = O;
1670
- type OutcomeScoreComponent = s;
1671
- type OutcomeTieBreak = u;
1672
- type OutcomeStanding<Player extends string = string> = t<Player>;
1673
- type GameOutcome<Player extends string = string> = d<Player>;
1674
- type GameEventDetail = {
1675
- label: string;
1676
- value: string | number | boolean;
1677
- };
1678
- type SystemActionEvent = {
1679
- kind: "systemAction";
1680
- procedureId: string;
1681
- title: string;
1682
- summary?: string;
1683
- details?: readonly GameEventDetail[];
1684
- };
1685
- type GameEvent = SystemActionEvent;
1686
- type ReducerAcceptOptions<State> = {
1687
- instructions?: readonly RuntimeInstructionForState<State>[];
1688
- events?: readonly GameEvent[];
1689
- };
1690
- type ReducerAccept<State> = {
1691
- type: "accept";
1692
- state: State;
1693
- instructions?: readonly RuntimeInstructionForState<State>[];
1694
- events?: readonly GameEvent[];
1695
- terminal?: GameOutcome<PlayerIdOfState<State>>;
1696
- };
1697
- type ReducerResult<State> = ReducerAccept<State> | ReducerReject;
1698
-
1699
- export { type HexEdgeStateOfTable as $, type AnyContinuationToken as A, type BoardBaseIdOfManifest as B, type CardIdOfDeck as C, type ContinuationResponseOf as D, type ContinuationToken as E, type DeckCardsOfTable as F, type DeckIdOfState as G, type DeckIdOfTable as H, type DieIdOfManifest as I, type EdgeTypeIdOfManifest as J, type EffectInvokeOptions as K, type EffectSpecLike as L, type EffectTypeTag as M, type ErrorCodeOfContract as N, type ExactManifestContractOf as O, type FlowState as P, type FrameworkErrorCode as Q, FrameworkErrorCodes as R, type GameEvent as S, type GameEventDetail as T, type GameOutcome as U, type HandCardsOfTable as V, type HandIdOfState as W, type HandIdOfTable as X, type HexBoardIdOfTable as Y, type HexBoardStateOfTable as Z, type HexEdgeIdOfTable as _, type AnySchema as a, type ResolvedContainerLocation as a$, type HexEdgeTypeIdOfTable as a0, type HexSpaceIdOfTable as a1, type HexSpaceTypeIdOfTable as a2, type HexVertexIdOfTable as a3, type HexVertexStateOfTable as a4, type HexVertexTypeIdOfTable as a5, type HiddenSchemaOfContract as a6, type HiddenStateOfState as a7, type InitContext as a8, type InitSetupSelectionInput as a9, type PhaseStateOfState as aA, type PhaseStepOfState as aB, type PieceIdOfManifest as aC, type PlayerId as aD, type PlayerIdOfManifest as aE, type PlayerIdOfState as aF, type PlayerIdOfTable as aG, type PlayerZoneIdOfManifest as aH, type PlayerZoneIdOfState as aI, type PlayerZoneIdOfTable as aJ, type PrivateSchemaOfContract as aK, type PrivateStateOfState as aL, type PublicSchemaOfContract as aM, type PublicStateOfState as aN, type ReducerAccept as aO, type ReducerAcceptOptions as aP, type ReducerFx as aQ, type ReducerGameState as aR, type ReducerManifestContract as aS, type ReducerManifestContractLike as aT, type ReducerReject as aU, type ReducerResult as aV, type ReducerRuntimeStateForState as aW, type ReducerSessionState as aX, type ReducerValidationResult as aY, type RelationTypeIdOfManifest as aZ, type RelationTypeIdOfTable as a_, type ManifestContract as aa, type ManifestContractOf as ab, type ManifestDefaults as ac, type ManifestIdFamily as ad, type ManifestIdSchema as ae, type ManifestIds as af, type ManifestLiterals as ag, type ManifestNormalSetup as ah, type ManifestOf as ai, type NonEmptyReadonlyArray as aj, type OutcomeResult as ak, type OutcomeScoreComponent as al, type OutcomeStanding as am, type OutcomeTieBreak as an, type PerPlayer as ao, type PerPlayerBoardRef as ap, type PerPlayerSchemaOptions as aq, type PhaseAccessor as ar, type PhaseMapOfState as as, type PhaseNameOf as at, type PhaseNameOfContract as au, type PhaseNameOfManifest as av, type PhaseNameOfState as aw, type PhasePayload as ax, type PhaseSchemasOfContract as ay, type PhaseStateMapOfContract as az, type BoardContainerIdOfManifest as b, type RuntimeTiledVertexState as b$, type ResolvedDeckLocation as b0, type ResolvedEdgeLocation as b1, type ResolvedHandLocation as b2, type ResolvedSlotLocation as b3, type ResolvedSpaceLocation as b4, type ResolvedVertexLocation as b5, type ResolvedZoneLocation as b6, type ResourceAmountsOfTable as b7, type ResourceBalancesOfState as b8, type ResourceBalancesOfTable as b9, type RuntimeParams as bA, type RuntimePayload as bB, type RuntimePhaseState as bC, type RuntimePieceData as bD, type RuntimeRecord as bE, type RuntimeResourceMap as bF, type RuntimeRngDraw as bG, type RuntimeRngOperation as bH, type RuntimeRngOperationParameter as bI, type RuntimeRngState as bJ, type RuntimeScalar as bK, type RuntimeSetupSelection as bL, type RuntimeSetupSelectionInput as bM, type RuntimeSetupSelectionOverride as bN, type RuntimeSimultaneousState as bO, type RuntimeSimultaneousSubmission as bP, type RuntimeSlotHostRef as bQ, type RuntimeSquareBoardState as bR, type RuntimeSquareEdgeState as bS, type RuntimeSquareSpaceState as bT, type RuntimeSquareVertexState as bU, type RuntimeState as bV, type RuntimeTableRecord as bW, type RuntimeTiledBoardBaseState as bX, type RuntimeTiledBoardState as bY, type RuntimeTiledEdgeState as bZ, type RuntimeTiledSpaceState as b_, type ResourceIdOfManifest as ba, type ResourceIdOfState as bb, type ResourceIdOfTable as bc, type RuntimeBoardBaseState as bd, type RuntimeBoardCollections as be, type RuntimeBoardCompatibilityState as bf, type RuntimeBoardContainerState as bg, type RuntimeBoardRelationState as bh, type RuntimeBoardSpaceState as bi, type RuntimeBoardState as bj, type RuntimeCardData as bk, type RuntimeCardVisibility as bl, type RuntimeComponentLocation as bm, type RuntimeComponentLocationMap as bn, type RuntimeDeckMap as bo, type RuntimeDieData as bp, type RuntimeGenericBoardState as bq, type RuntimeHandMap as br, type RuntimeHandVisibilityMode as bs, type RuntimeHexBoardState as bt, type RuntimeHexEdgeState as bu, type RuntimeHexOrientation as bv, type RuntimeHexSpaceState as bw, type RuntimeHexVertexState as bx, type RuntimeInstructionForState as by, type RuntimeOwnerMap as bz, type BoardContainerIdOfTable as c, boardRef as c$, type RuntimeVisibilityMap as c0, type RuntimeZoneMap as c1, type SchemaLike as c2, type SetupBootstrapContainerRef as c3, type SetupBootstrapDestinationRef as c4, type SetupBootstrapPerPlayerBoardContainerRef as c5, type SetupBootstrapPerPlayerBoardSpaceRef as c6, type SetupBootstrapPerPlayerContainerTemplateRef as c7, type SetupBootstrapPerPlayerZoneRef as c8, type SetupBootstrapSharedBoardContainerRef as c9, type SquareVertexIdOfTable as cA, type SquareVertexStateOfTable as cB, type SquareVertexTypeIdOfTable as cC, type StateDefinition as cD, type StateDefinitionOfContract as cE, type StaticBoards as cF, type StringKeyOf as cG, type SystemActionEvent as cH, type TableOfManifest as cI, type TableOfState as cJ, type TableQueries as cK, type TableQueriesOfState as cL, type TiledBoardIdOfTable as cM, type TiledBoardStateOfTable as cN, type TiledEdgeIdOfTable as cO, type TiledEdgeMap as cP, type TiledEdgeStateOfTable as cQ, type TiledEdgeTypeIdOfTable as cR, type TiledSpaceIdOfTable as cS, type TiledSpaceMap as cT, type TiledVertexIdOfTable as cU, type TiledVertexMap as cV, type TiledVertexStateOfTable as cW, type TiledVertexTypeIdOfTable as cX, type VertexTypeIdOfManifest as cY, asPlayerId as cZ, assumeManifestSchema as c_, type SetupBootstrapSharedBoardSpaceRef as ca, type SetupBootstrapSharedZoneRef as cb, type SetupBootstrapStep as cc, type SetupOptionChoiceMetadata as cd, type SetupOptionIdOfManifest as ce, type SetupOptionMetadata as cf, type SetupProfileDefinition as cg, type SetupProfileIdOfManifest as ch, type SetupProfileMetadata as ci, type SetupSelectionInputOfManifest as cj, type SetupSelectionOfManifest as ck, type SharedBoardRef as cl, type SharedZoneIdOfManifest as cm, type SharedZoneIdOfState as cn, type SharedZoneIdOfTable as co, type SpaceIdOfManifest as cp, type SpaceIdOfTable as cq, type SpaceTypeIdOfManifest as cr, type SpaceTypeIdOfTable as cs, type SquareBoardIdOfTable as ct, type SquareBoardStateOfTable as cu, type SquareEdgeIdOfTable as cv, type SquareEdgeStateOfTable as cw, type SquareEdgeTypeIdOfTable as cx, type SquareSpaceIdOfTable as cy, type SquareSpaceTypeIdOfTable as cz, type BoardIdOfManifest as d, boardRefKey as d0, boardRefSchema as d1, cloneManifestDefault as d2, createManifestGameStateSchema as d3, createManifestRuntimeSchema as d4, createManifestStringLiteralSchema as d5, isManifestScopedSchema as d6, isPerPlayer as d7, isPerPlayerBoardRef as d8, isPlayerId as d9, isSharedBoardRef as da, manifestSchemaFamily as db, markManifestScopedSchema as dc, parseBoardRefKey as dd, perPlayer as de, perPlayerBoardRef as df, perPlayerEntries as dg, perPlayerGet as dh, perPlayerHas as di, perPlayerKeys as dj, perPlayerMap as dk, perPlayerRequire as dl, perPlayerSchema as dm, perPlayerSet as dn, perPlayerSize as dp, perPlayerValues as dq, resolveManifestPlayerIds as dr, sharedBoardRef as ds, type BoardIdOfTable as e, type BoardLayoutOfManifest as f, type BoardMapOfTable as g, type BoardRef as h, type BoardStateOfTable as i, type BoardTypeIdOfManifest as j, type BoardTypeIdOfTable as k, type Brand as l, type CardIdOfHand as m, type CardIdOfManifest as n, type CardIdOfState as o, type CardIdOfTable as p, type CardTypeOfState as q, type CardTypeOfTable as r, type ChoiceOption as s, type CompatibleCardIdForHandAndDeck as t, type CompatibleCardIdForTwoPlayerZones as u, type CompatibleHandIdForDeck as v, type ComponentDataOfTable as w, type ComponentIdOfTable as x, type ComponentLocationByTypeOfTable as y, type ComponentLocationOfTable as z };