@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.
- package/README.md +186 -45
- package/dist/board-target-B0QG6OYx.d.ts +8 -0
- package/dist/chunk-3JXUL4VN.js +139 -0
- package/dist/chunk-3JXUL4VN.js.map +1 -0
- package/dist/{chunk-S2JEDVWH.js → chunk-C77SYIVT.js} +6102 -6505
- package/dist/chunk-C77SYIVT.js.map +1 -0
- package/dist/chunk-DMFVAZI2.js +16 -0
- package/dist/chunk-DMFVAZI2.js.map +1 -0
- package/dist/chunk-OOFMBCFF.js +1338 -0
- package/dist/chunk-OOFMBCFF.js.map +1 -0
- package/dist/chunk-UG2Q4NLG.js +590 -0
- package/dist/chunk-UG2Q4NLG.js.map +1 -0
- package/dist/chunk-XU6WJW6K.js +847 -0
- package/dist/chunk-XU6WJW6K.js.map +1 -0
- package/dist/diagnostics-B8d5aLad.d.ts +65 -0
- package/dist/extract-gVKcB8Og.d.ts +4736 -0
- package/dist/index.d.ts +3782 -1
- package/dist/index.js +1096 -6
- package/dist/index.js.map +1 -1
- package/dist/model-vdpLHrxh.d.ts +432 -0
- package/dist/react.d.ts +60 -0
- package/dist/react.js +208 -0
- package/dist/react.js.map +1 -0
- package/dist/reducer.d.ts +1244 -78
- package/dist/reducer.js +4204 -121
- package/dist/reducer.js.map +1 -1
- package/dist/testing.d.ts +520 -564
- package/dist/testing.js +2451 -915
- package/dist/testing.js.map +1 -1
- package/dist/types-Bj5ZLTUV.d.ts +114 -0
- package/package.json +40 -142
- package/dist/HandView-Bi2lxzQP.d.ts +0 -79
- package/dist/ResourceCounter-BFxJknqp.d.ts +0 -98
- package/dist/ThemeProvider-CElaL2ik.d.ts +0 -99
- package/dist/attributes-DbvyMbXw.d.ts +0 -68
- package/dist/browser-interaction.d.ts +0 -910
- package/dist/browser-interaction.js +0 -119
- package/dist/browser-interaction.js.map +0 -1
- package/dist/chunk-32PFKDV7.js +0 -11705
- package/dist/chunk-32PFKDV7.js.map +0 -1
- package/dist/chunk-3BAD4VC2.js +0 -263
- package/dist/chunk-3BAD4VC2.js.map +0 -1
- package/dist/chunk-3SKDNDPG.js +0 -104
- package/dist/chunk-3SKDNDPG.js.map +0 -1
- package/dist/chunk-5YV2WHJ4.js +0 -25
- package/dist/chunk-5YV2WHJ4.js.map +0 -1
- package/dist/chunk-ANRB4XKA.js +0 -90
- package/dist/chunk-ANRB4XKA.js.map +0 -1
- package/dist/chunk-BI4G3PM2.js +0 -1864
- package/dist/chunk-BI4G3PM2.js.map +0 -1
- package/dist/chunk-EVCLTY4Q.js +0 -935
- package/dist/chunk-EVCLTY4Q.js.map +0 -1
- package/dist/chunk-GDPKTBUR.js +0 -564
- package/dist/chunk-GDPKTBUR.js.map +0 -1
- package/dist/chunk-H6VDGFL5.js +0 -2903
- package/dist/chunk-H6VDGFL5.js.map +0 -1
- package/dist/chunk-LR3ZTWQF.js +0 -5960
- package/dist/chunk-LR3ZTWQF.js.map +0 -1
- package/dist/chunk-PF7L4BMG.js +0 -117
- package/dist/chunk-PF7L4BMG.js.map +0 -1
- package/dist/chunk-PN5O6GG2.js +0 -32
- package/dist/chunk-PN5O6GG2.js.map +0 -1
- package/dist/chunk-PZ5AY32C.js +0 -10
- package/dist/chunk-PZ5AY32C.js.map +0 -1
- package/dist/chunk-S2JEDVWH.js.map +0 -1
- package/dist/chunk-T3ZKNUZ7.js +0 -1
- package/dist/chunk-T3ZKNUZ7.js.map +0 -1
- package/dist/chunk-UGH54WZ2.js +0 -223
- package/dist/chunk-UGH54WZ2.js.map +0 -1
- package/dist/chunk-VCDWP5VL.js +0 -746
- package/dist/chunk-VCDWP5VL.js.map +0 -1
- package/dist/chunk-VDXOF4FW.js +0 -69
- package/dist/chunk-VDXOF4FW.js.map +0 -1
- package/dist/chunk-WHR5UW3F.js +0 -1988
- package/dist/chunk-WHR5UW3F.js.map +0 -1
- package/dist/chunk-Y75CFE77.js +0 -17
- package/dist/chunk-Y75CFE77.js.map +0 -1
- package/dist/chunk-Z7QCREWI.js +0 -3435
- package/dist/chunk-Z7QCREWI.js.map +0 -1
- package/dist/chunk-ZZGN2ATS.js +0 -1941
- package/dist/chunk-ZZGN2ATS.js.map +0 -1
- package/dist/components-gAbIz7hK.d.ts +0 -1284
- package/dist/definitions-BgmV_GhC.d.ts +0 -300
- package/dist/diagnostics-DIi3ina7.d.ts +0 -50
- package/dist/digest.d.ts +0 -8
- package/dist/game-CsZScpcn.d.ts +0 -763
- package/dist/hex-board-view-aKkblDp6.d.ts +0 -1228
- package/dist/index-CcT9Q7N7.d.ts +0 -193
- package/dist/index.d-DjzoK7zn.d.ts +0 -2101
- package/dist/package-set.d.ts +0 -13
- package/dist/package-set.js +0 -12
- package/dist/package-set.js.map +0 -1
- package/dist/player-state-Cqpyeql0.d.ts +0 -371
- package/dist/plugin-runtime-contract.d.ts +0 -17
- package/dist/plugin-runtime-contract.js +0 -92
- package/dist/plugin-runtime-contract.js.map +0 -1
- package/dist/primitive-props-BNHDkgd7.d.ts +0 -16
- package/dist/protocol-dYgafTYY.d.ts +0 -314
- package/dist/reducer/advanced.d.ts +0 -82
- package/dist/reducer/advanced.js +0 -51
- package/dist/reducer/advanced.js.map +0 -1
- package/dist/reducer-contract.d.ts +0 -11
- package/dist/reducer-contract.js +0 -16
- package/dist/reducer-contract.js.map +0 -1
- package/dist/reference-games/index.d.ts +0 -31
- package/dist/reference-games/index.js +0 -48
- package/dist/reference-games/index.js.map +0 -1
- package/dist/runtime/primitives.d.ts +0 -250
- package/dist/runtime/primitives.js +0 -189
- package/dist/runtime/primitives.js.map +0 -1
- package/dist/runtime/runtime-api.d.ts +0 -2
- package/dist/runtime/runtime-api.js +0 -1
- package/dist/runtime/runtime-api.js.map +0 -1
- package/dist/runtime/workspace-contract.d.ts +0 -392
- package/dist/runtime/workspace-contract.js +0 -28
- package/dist/runtime/workspace-contract.js.map +0 -1
- package/dist/runtime-RJ5orDJU.d.ts +0 -1699
- package/dist/runtime-api-Bz5pwNU_.d.ts +0 -296
- package/dist/runtime-json-CQ9QbLZ5.d.ts +0 -5
- package/dist/runtime.d.ts +0 -83
- package/dist/runtime.js +0 -242
- package/dist/runtime.js.map +0 -1
- package/dist/schema.d.ts +0 -379
- package/dist/stale-contract-artifact-error-XLaweZtF.d.ts +0 -18
- package/dist/testing-compiler.d.ts +0 -37
- package/dist/testing-compiler.js +0 -272
- package/dist/testing-compiler.js.map +0 -1
- package/dist/testing-runtime.d.ts +0 -119
- package/dist/testing-runtime.js +0 -212
- package/dist/testing-runtime.js.map +0 -1
- package/dist/types-DJj5MJkl.d.ts +0 -256
- package/dist/types-DR7DoB1x.d.ts +0 -28
- package/dist/types-JWCYHmu7.d.ts +0 -122
- package/dist/types.d.ts +0 -1958
- package/dist/types.js +0 -14
- package/dist/types.js.map +0 -1
- package/dist/ui/components.d.ts +0 -17
- package/dist/ui/components.js +0 -216
- package/dist/ui/components.js.map +0 -1
- package/dist/ui/defaults.d.ts +0 -19
- package/dist/ui/defaults.js +0 -104
- package/dist/ui/defaults.js.map +0 -1
- package/dist/ui/player-state.d.ts +0 -2
- package/dist/ui/player-state.js +0 -1
- package/dist/ui/player-state.js.map +0 -1
- package/dist/ui/plugin-styles.css +0 -2
- package/dist/ui-contract-GTUPkf8z.d.ts +0 -1168
- package/dist/ui.d.ts +0 -317
- package/dist/ui.js +0 -277
- package/dist/ui.js.map +0 -1
- package/dist/views-BpuWcOyN.d.ts +0 -1641
package/dist/types.d.ts
DELETED
|
@@ -1,1958 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported player-count metadata for the game
|
|
3
|
-
*/
|
|
4
|
-
type PlayersDefinition = {
|
|
5
|
-
minPlayers: number;
|
|
6
|
-
maxPlayers: number;
|
|
7
|
-
optimalPlayers?: number;
|
|
8
|
-
};
|
|
9
|
-
type PresetCardSetDefinition = {
|
|
10
|
-
/**
|
|
11
|
-
* Unique local identifier for the authored card set
|
|
12
|
-
*/
|
|
13
|
-
id: string;
|
|
14
|
-
/**
|
|
15
|
-
* Built-in preset card-set selector
|
|
16
|
-
*/
|
|
17
|
-
presetId: string;
|
|
18
|
-
/**
|
|
19
|
-
* Display name of the card set
|
|
20
|
-
*/
|
|
21
|
-
name: string;
|
|
22
|
-
/**
|
|
23
|
-
* Type of card set source
|
|
24
|
-
*/
|
|
25
|
-
type: "preset";
|
|
26
|
-
/**
|
|
27
|
-
* Default initial home for cards materialized from the preset.
|
|
28
|
-
*/
|
|
29
|
-
defaultHome: ComponentHomeSpec;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Arbitrary authored JSON value.
|
|
33
|
-
*/
|
|
34
|
-
type JsonValue = string | number | boolean | null | Array<JsonValue> | {
|
|
35
|
-
[key: string]: JsonValue;
|
|
36
|
-
};
|
|
37
|
-
type PropertySchema = {
|
|
38
|
-
/**
|
|
39
|
-
* The data type of the property.
|
|
40
|
-
*/
|
|
41
|
-
type: "string" | "integer" | "number" | "boolean" | "zoneId" | "cardId" | "playerId" | "boardId" | "edgeId" | "vertexId" | "spaceId" | "pieceId" | "dieId" | "resourceId" | "array" | "object" | "record" | "enum";
|
|
42
|
-
/**
|
|
43
|
-
* Optional description of the property's purpose and usage.
|
|
44
|
-
*/
|
|
45
|
-
description?: string;
|
|
46
|
-
/**
|
|
47
|
-
* Whether an object property may be omitted.
|
|
48
|
-
*/
|
|
49
|
-
optional?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Whether the value may be null.
|
|
52
|
-
*/
|
|
53
|
-
nullable?: boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Optional authored default value for this property. When present, omitted
|
|
56
|
-
* seed values materialize to the default and generated TypeScript treats
|
|
57
|
-
* the property as present even if `optional: true` is also set.
|
|
58
|
-
*
|
|
59
|
-
*/
|
|
60
|
-
default?: JsonValue;
|
|
61
|
-
/**
|
|
62
|
-
* For array types, the schema of the array items. Required if type is 'array'.
|
|
63
|
-
*/
|
|
64
|
-
items?: PropertySchema;
|
|
65
|
-
/**
|
|
66
|
-
* For object types, the schema of the object's properties. Required if type is 'object'.
|
|
67
|
-
*/
|
|
68
|
-
properties?: {
|
|
69
|
-
[key: string]: PropertySchema;
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* For enum types, the list of allowed string values. Required if type is 'enum'.
|
|
73
|
-
*/
|
|
74
|
-
enums?: Array<string>;
|
|
75
|
-
/**
|
|
76
|
-
* For record types, the schema of the record's values. Required if type is 'record'.
|
|
77
|
-
*/
|
|
78
|
-
values?: PropertySchema;
|
|
79
|
-
};
|
|
80
|
-
type ObjectSchema = {
|
|
81
|
-
/**
|
|
82
|
-
* Map of property names to their schemas. Type is always 'object' and all properties are required.
|
|
83
|
-
*/
|
|
84
|
-
properties: {
|
|
85
|
-
[key: string]: PropertySchema;
|
|
86
|
-
};
|
|
87
|
-
};
|
|
88
|
-
type CardPropertySchemaVariants = {
|
|
89
|
-
/**
|
|
90
|
-
* Property schemas present on every card-type variant.
|
|
91
|
-
*/
|
|
92
|
-
shared?: {
|
|
93
|
-
[key: string]: PropertySchema;
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Property schema for each card type in this manual card set.
|
|
97
|
-
*/
|
|
98
|
-
variants: {
|
|
99
|
-
[key: string]: ObjectSchema;
|
|
100
|
-
};
|
|
101
|
-
};
|
|
102
|
-
type CardPropertySchema = ObjectSchema | CardPropertySchemaVariants;
|
|
103
|
-
type DetachedHomeSpec = {
|
|
104
|
-
type: "detached";
|
|
105
|
-
};
|
|
106
|
-
type ZoneHomeSpec = {
|
|
107
|
-
type: "zone";
|
|
108
|
-
zoneId: string;
|
|
109
|
-
};
|
|
110
|
-
type SpaceHomeSpec = {
|
|
111
|
-
type: "space";
|
|
112
|
-
boardId: string;
|
|
113
|
-
spaceId: string;
|
|
114
|
-
};
|
|
115
|
-
type ContainerHomeSpec = {
|
|
116
|
-
type: "container";
|
|
117
|
-
boardId: string;
|
|
118
|
-
containerId: string;
|
|
119
|
-
};
|
|
120
|
-
/**
|
|
121
|
-
* Tiled board edge identified by the spaces that border it
|
|
122
|
-
*/
|
|
123
|
-
type BoardEdgeRef = {
|
|
124
|
-
spaces: Array<string>;
|
|
125
|
-
};
|
|
126
|
-
type EdgeHomeSpec = {
|
|
127
|
-
type: "edge";
|
|
128
|
-
boardId: string;
|
|
129
|
-
ref: BoardEdgeRef;
|
|
130
|
-
};
|
|
131
|
-
/**
|
|
132
|
-
* Tiled board vertex identified by the spaces that touch it
|
|
133
|
-
*/
|
|
134
|
-
type BoardVertexRef = {
|
|
135
|
-
spaces: Array<string>;
|
|
136
|
-
};
|
|
137
|
-
type VertexHomeSpec = {
|
|
138
|
-
type: "vertex";
|
|
139
|
-
boardId: string;
|
|
140
|
-
ref: BoardVertexRef;
|
|
141
|
-
};
|
|
142
|
-
type PieceSlotHostRef = {
|
|
143
|
-
kind: "piece";
|
|
144
|
-
id: string;
|
|
145
|
-
};
|
|
146
|
-
type DieSlotHostRef = {
|
|
147
|
-
kind: "die";
|
|
148
|
-
id: string;
|
|
149
|
-
};
|
|
150
|
-
type SlotHostRef = ({
|
|
151
|
-
kind: "piece";
|
|
152
|
-
} & PieceSlotHostRef) | ({
|
|
153
|
-
kind: "die";
|
|
154
|
-
} & DieSlotHostRef);
|
|
155
|
-
type SlotHomeSpec = {
|
|
156
|
-
type: "slot";
|
|
157
|
-
host: SlotHostRef;
|
|
158
|
-
slotId: string;
|
|
159
|
-
};
|
|
160
|
-
type ComponentHomeSpec = ({
|
|
161
|
-
type: "detached";
|
|
162
|
-
} & DetachedHomeSpec) | ({
|
|
163
|
-
type: "zone";
|
|
164
|
-
} & ZoneHomeSpec) | ({
|
|
165
|
-
type: "space";
|
|
166
|
-
} & SpaceHomeSpec) | ({
|
|
167
|
-
type: "container";
|
|
168
|
-
} & ContainerHomeSpec) | ({
|
|
169
|
-
type: "edge";
|
|
170
|
-
} & EdgeHomeSpec) | ({
|
|
171
|
-
type: "vertex";
|
|
172
|
-
} & VertexHomeSpec) | ({
|
|
173
|
-
type: "slot";
|
|
174
|
-
} & SlotHomeSpec);
|
|
175
|
-
/**
|
|
176
|
-
* Default authored visibility for a component instance
|
|
177
|
-
*/
|
|
178
|
-
type ComponentVisibilitySpec = {
|
|
179
|
-
faceUp?: boolean;
|
|
180
|
-
/**
|
|
181
|
-
* When omitted, visible to all players
|
|
182
|
-
*/
|
|
183
|
-
visibleTo?: Array<string>;
|
|
184
|
-
};
|
|
185
|
-
type BoardCard = {
|
|
186
|
-
/**
|
|
187
|
-
* Card type identifier used to generate runtime CardIds. When count > 1, runtime IDs are generated as '{type}-1', '{type}-2', etc.
|
|
188
|
-
*/
|
|
189
|
-
type: string;
|
|
190
|
-
/**
|
|
191
|
-
* Display name of the card
|
|
192
|
-
*/
|
|
193
|
-
name: string;
|
|
194
|
-
/**
|
|
195
|
-
* URL to the card's image
|
|
196
|
-
*/
|
|
197
|
-
imageUrl?: string;
|
|
198
|
-
/**
|
|
199
|
-
* Text content on the card
|
|
200
|
-
*/
|
|
201
|
-
text?: string;
|
|
202
|
-
/**
|
|
203
|
-
* Number of copies of this card
|
|
204
|
-
*/
|
|
205
|
-
count: number;
|
|
206
|
-
/**
|
|
207
|
-
* Optional authored card category or subtype identifier
|
|
208
|
-
*/
|
|
209
|
-
cardType?: string;
|
|
210
|
-
/**
|
|
211
|
-
* Optional per-card initial home. Omitted cards use their manual card set's
|
|
212
|
-
* defaultHome. Compatibility declarations such as allowedCardSetIds never
|
|
213
|
-
* imply placement. Player-scoped distribution belongs in reducer setup.
|
|
214
|
-
*/
|
|
215
|
-
home?: ComponentHomeSpec;
|
|
216
|
-
/**
|
|
217
|
-
* Default authored visibility for the card inventory
|
|
218
|
-
*/
|
|
219
|
-
visibility?: ComponentVisibilitySpec;
|
|
220
|
-
/**
|
|
221
|
-
* Actual property values for this specific card instance. Keys must match the properties defined in the referenced cardSchema.
|
|
222
|
-
*/
|
|
223
|
-
properties: {
|
|
224
|
-
[key: string]: JsonValue;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
type ManualCardSetDefinition = {
|
|
228
|
-
/**
|
|
229
|
-
* Unique identifier for the card set
|
|
230
|
-
*/
|
|
231
|
-
id: string;
|
|
232
|
-
/**
|
|
233
|
-
* Display name of the card set
|
|
234
|
-
*/
|
|
235
|
-
name: string;
|
|
236
|
-
/**
|
|
237
|
-
* Type of card set source
|
|
238
|
-
*/
|
|
239
|
-
type: "manual";
|
|
240
|
-
/**
|
|
241
|
-
* Schema definition for authored card properties in this card set
|
|
242
|
-
*/
|
|
243
|
-
cardSchema: CardPropertySchema;
|
|
244
|
-
/**
|
|
245
|
-
* Default initial home for cards that do not declare a per-card home.
|
|
246
|
-
*/
|
|
247
|
-
defaultHome: ComponentHomeSpec;
|
|
248
|
-
/**
|
|
249
|
-
* List of authored cards in this card set
|
|
250
|
-
*/
|
|
251
|
-
cards: Array<BoardCard>;
|
|
252
|
-
};
|
|
253
|
-
type CardSetDefinition = ({
|
|
254
|
-
type: "preset";
|
|
255
|
-
} & PresetCardSetDefinition) | ({
|
|
256
|
-
type: "manual";
|
|
257
|
-
} & ManualCardSetDefinition);
|
|
258
|
-
/**
|
|
259
|
-
* Whether authored topology exists once for the table or once per player
|
|
260
|
-
*/
|
|
261
|
-
type TopologyScope = "shared" | "perPlayer";
|
|
262
|
-
/**
|
|
263
|
-
* Default topology visibility for a zone or slot
|
|
264
|
-
*/
|
|
265
|
-
type ZoneVisibility = "ownerOnly" | "public" | "hidden";
|
|
266
|
-
/**
|
|
267
|
-
* Generic authored container that can hold cards, pieces, or dice
|
|
268
|
-
*/
|
|
269
|
-
type ZoneSpec = {
|
|
270
|
-
/**
|
|
271
|
-
* Stable zone identifier
|
|
272
|
-
*/
|
|
273
|
-
id: string;
|
|
274
|
-
/**
|
|
275
|
-
* Display name for the zone
|
|
276
|
-
*/
|
|
277
|
-
name: string;
|
|
278
|
-
scope: TopologyScope;
|
|
279
|
-
/**
|
|
280
|
-
* Optional card-set restriction for this zone
|
|
281
|
-
*/
|
|
282
|
-
allowedCardSetIds?: Array<string>;
|
|
283
|
-
visibility?: ZoneVisibility;
|
|
284
|
-
};
|
|
285
|
-
/**
|
|
286
|
-
* Stable authored board space or slot anchor
|
|
287
|
-
*/
|
|
288
|
-
type BoardSpaceSpec = {
|
|
289
|
-
/**
|
|
290
|
-
* Stable space identifier local to the board
|
|
291
|
-
*/
|
|
292
|
-
id: string;
|
|
293
|
-
/**
|
|
294
|
-
* Human-readable space name
|
|
295
|
-
*/
|
|
296
|
-
name?: string;
|
|
297
|
-
/**
|
|
298
|
-
* Optional authored space type identifier
|
|
299
|
-
*/
|
|
300
|
-
typeId?: string;
|
|
301
|
-
/**
|
|
302
|
-
* Typed authored fields validated against the board's spaceFieldsSchema
|
|
303
|
-
*/
|
|
304
|
-
fields?: {
|
|
305
|
-
[key: string]: JsonValue;
|
|
306
|
-
};
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* Named relation between two authored spaces
|
|
310
|
-
*/
|
|
311
|
-
type BoardRelationSpec = {
|
|
312
|
-
/**
|
|
313
|
-
* Optional stable relation identifier
|
|
314
|
-
*/
|
|
315
|
-
id?: string;
|
|
316
|
-
/**
|
|
317
|
-
* Relation type identifier such as adjacent, covers, blocks, or linked
|
|
318
|
-
*/
|
|
319
|
-
typeId: string;
|
|
320
|
-
fromSpaceId: string;
|
|
321
|
-
toSpaceId: string;
|
|
322
|
-
directed?: boolean;
|
|
323
|
-
/**
|
|
324
|
-
* Typed authored relation fields validated against relationFieldsSchema
|
|
325
|
-
*/
|
|
326
|
-
fields?: {
|
|
327
|
-
[key: string]: JsonValue;
|
|
328
|
-
};
|
|
329
|
-
};
|
|
330
|
-
type BoardHostSpec = {
|
|
331
|
-
type: "board";
|
|
332
|
-
};
|
|
333
|
-
type SpaceHostSpec = {
|
|
334
|
-
type: "space";
|
|
335
|
-
spaceId: string;
|
|
336
|
-
};
|
|
337
|
-
type BoardContainerHostSpec = ({
|
|
338
|
-
type: "board";
|
|
339
|
-
} & BoardHostSpec) | ({
|
|
340
|
-
type: "space";
|
|
341
|
-
} & SpaceHostSpec);
|
|
342
|
-
/**
|
|
343
|
-
* Authored board-attached or space-attached container/slot
|
|
344
|
-
*/
|
|
345
|
-
type BoardContainerSpec = {
|
|
346
|
-
/**
|
|
347
|
-
* Stable container identifier local to the board
|
|
348
|
-
*/
|
|
349
|
-
id: string;
|
|
350
|
-
/**
|
|
351
|
-
* Display name for the container
|
|
352
|
-
*/
|
|
353
|
-
name: string;
|
|
354
|
-
host: BoardContainerHostSpec;
|
|
355
|
-
allowedCardSetIds?: Array<string>;
|
|
356
|
-
/**
|
|
357
|
-
* Typed authored container fields validated against containerFieldsSchema
|
|
358
|
-
*/
|
|
359
|
-
fields?: {
|
|
360
|
-
[key: string]: JsonValue;
|
|
361
|
-
};
|
|
362
|
-
};
|
|
363
|
-
/**
|
|
364
|
-
* Reusable authored board topology template
|
|
365
|
-
*/
|
|
366
|
-
type GenericBoardTemplateSpec = {
|
|
367
|
-
/**
|
|
368
|
-
* Stable template identifier
|
|
369
|
-
*/
|
|
370
|
-
id: string;
|
|
371
|
-
name: string;
|
|
372
|
-
layout: "generic";
|
|
373
|
-
/**
|
|
374
|
-
* Optional authored board type identifier such as track, map, tableau, or grid
|
|
375
|
-
*/
|
|
376
|
-
typeId?: string;
|
|
377
|
-
boardFieldsSchema?: ObjectSchema;
|
|
378
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
379
|
-
relationFieldsSchema?: ObjectSchema;
|
|
380
|
-
containerFieldsSchema?: ObjectSchema;
|
|
381
|
-
spaces?: Array<BoardSpaceSpec>;
|
|
382
|
-
relations?: Array<BoardRelationSpec>;
|
|
383
|
-
containers?: Array<BoardContainerSpec>;
|
|
384
|
-
};
|
|
385
|
-
/**
|
|
386
|
-
* Visual orientation for authored hex coordinates
|
|
387
|
-
*/
|
|
388
|
-
type HexOrientation = "pointy-top" | "flat-top";
|
|
389
|
-
/**
|
|
390
|
-
* One authored hex space in axial coordinates
|
|
391
|
-
*/
|
|
392
|
-
type HexSpaceSpec = {
|
|
393
|
-
/**
|
|
394
|
-
* Stable space identifier local to the board
|
|
395
|
-
*/
|
|
396
|
-
id: string;
|
|
397
|
-
/**
|
|
398
|
-
* Axial q coordinate
|
|
399
|
-
*/
|
|
400
|
-
q: number;
|
|
401
|
-
/**
|
|
402
|
-
* Axial r coordinate
|
|
403
|
-
*/
|
|
404
|
-
r: number;
|
|
405
|
-
/**
|
|
406
|
-
* Optional authored space type identifier
|
|
407
|
-
*/
|
|
408
|
-
typeId?: string;
|
|
409
|
-
/**
|
|
410
|
-
* Optional hex-space label for setup or rendering
|
|
411
|
-
*/
|
|
412
|
-
label?: string;
|
|
413
|
-
/**
|
|
414
|
-
* Typed authored fields validated against the board's spaceFieldsSchema
|
|
415
|
-
*/
|
|
416
|
-
fields?: {
|
|
417
|
-
[key: string]: JsonValue;
|
|
418
|
-
};
|
|
419
|
-
};
|
|
420
|
-
/**
|
|
421
|
-
* Hex edge identified by two adjacent hex spaces
|
|
422
|
-
*/
|
|
423
|
-
type HexEdgeRef = {
|
|
424
|
-
spaces: [string, string];
|
|
425
|
-
};
|
|
426
|
-
/**
|
|
427
|
-
* Authored metadata attached to one derived hex edge
|
|
428
|
-
*/
|
|
429
|
-
type HexEdgeSpec = {
|
|
430
|
-
ref: HexEdgeRef;
|
|
431
|
-
/**
|
|
432
|
-
* Optional authored edge type identifier
|
|
433
|
-
*/
|
|
434
|
-
typeId?: string;
|
|
435
|
-
/**
|
|
436
|
-
* Optional edge label for setup or rendering
|
|
437
|
-
*/
|
|
438
|
-
label?: string;
|
|
439
|
-
tags?: Array<string>;
|
|
440
|
-
/**
|
|
441
|
-
* Typed authored edge fields validated against edgeFieldsSchema
|
|
442
|
-
*/
|
|
443
|
-
fields?: {
|
|
444
|
-
[key: string]: JsonValue;
|
|
445
|
-
};
|
|
446
|
-
};
|
|
447
|
-
/**
|
|
448
|
-
* Hex vertex identified by three touching hex spaces
|
|
449
|
-
*/
|
|
450
|
-
type HexVertexRef = {
|
|
451
|
-
spaces: [string, string, string];
|
|
452
|
-
};
|
|
453
|
-
/**
|
|
454
|
-
* Authored metadata attached to one derived hex vertex
|
|
455
|
-
*/
|
|
456
|
-
type HexVertexSpec = {
|
|
457
|
-
ref: HexVertexRef;
|
|
458
|
-
/**
|
|
459
|
-
* Optional authored vertex type identifier
|
|
460
|
-
*/
|
|
461
|
-
typeId?: string;
|
|
462
|
-
/**
|
|
463
|
-
* Optional vertex label for setup or rendering
|
|
464
|
-
*/
|
|
465
|
-
label?: string;
|
|
466
|
-
tags?: Array<string>;
|
|
467
|
-
/**
|
|
468
|
-
* Typed authored vertex fields validated against vertexFieldsSchema
|
|
469
|
-
*/
|
|
470
|
-
fields?: {
|
|
471
|
-
[key: string]: JsonValue;
|
|
472
|
-
};
|
|
473
|
-
};
|
|
474
|
-
/**
|
|
475
|
-
* Reusable authored hex board topology template
|
|
476
|
-
*/
|
|
477
|
-
type HexBoardTemplateSpec = {
|
|
478
|
-
/**
|
|
479
|
-
* Stable template identifier
|
|
480
|
-
*/
|
|
481
|
-
id: string;
|
|
482
|
-
name: string;
|
|
483
|
-
layout: "hex";
|
|
484
|
-
/**
|
|
485
|
-
* Optional authored board type identifier
|
|
486
|
-
*/
|
|
487
|
-
typeId?: string;
|
|
488
|
-
orientation?: HexOrientation;
|
|
489
|
-
boardFieldsSchema?: ObjectSchema;
|
|
490
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
491
|
-
edgeFieldsSchema?: ObjectSchema;
|
|
492
|
-
vertexFieldsSchema?: ObjectSchema;
|
|
493
|
-
spaces?: Array<HexSpaceSpec>;
|
|
494
|
-
edges?: Array<HexEdgeSpec>;
|
|
495
|
-
vertices?: Array<HexVertexSpec>;
|
|
496
|
-
};
|
|
497
|
-
/**
|
|
498
|
-
* One authored square space in row/column coordinates
|
|
499
|
-
*/
|
|
500
|
-
type SquareSpaceSpec = {
|
|
501
|
-
/**
|
|
502
|
-
* Stable space identifier local to the board
|
|
503
|
-
*/
|
|
504
|
-
id: string;
|
|
505
|
-
/**
|
|
506
|
-
* Zero-based row coordinate
|
|
507
|
-
*/
|
|
508
|
-
row: number;
|
|
509
|
-
/**
|
|
510
|
-
* Zero-based column coordinate
|
|
511
|
-
*/
|
|
512
|
-
col: number;
|
|
513
|
-
/**
|
|
514
|
-
* Optional authored space type identifier
|
|
515
|
-
*/
|
|
516
|
-
typeId?: string;
|
|
517
|
-
/**
|
|
518
|
-
* Optional square-space label for setup or rendering
|
|
519
|
-
*/
|
|
520
|
-
label?: string;
|
|
521
|
-
/**
|
|
522
|
-
* Typed authored fields validated against the board's spaceFieldsSchema
|
|
523
|
-
*/
|
|
524
|
-
fields?: {
|
|
525
|
-
[key: string]: JsonValue;
|
|
526
|
-
};
|
|
527
|
-
};
|
|
528
|
-
/**
|
|
529
|
-
* Authored metadata attached to one derived square edge
|
|
530
|
-
*/
|
|
531
|
-
type SquareEdgeSpec = {
|
|
532
|
-
ref: BoardEdgeRef;
|
|
533
|
-
/**
|
|
534
|
-
* Optional authored edge type identifier
|
|
535
|
-
*/
|
|
536
|
-
typeId?: string;
|
|
537
|
-
/**
|
|
538
|
-
* Optional edge label for setup or rendering
|
|
539
|
-
*/
|
|
540
|
-
label?: string;
|
|
541
|
-
tags?: Array<string>;
|
|
542
|
-
/**
|
|
543
|
-
* Typed authored edge fields validated against edgeFieldsSchema
|
|
544
|
-
*/
|
|
545
|
-
fields?: {
|
|
546
|
-
[key: string]: JsonValue;
|
|
547
|
-
};
|
|
548
|
-
};
|
|
549
|
-
/**
|
|
550
|
-
* Authored metadata attached to one derived square vertex
|
|
551
|
-
*/
|
|
552
|
-
type SquareVertexSpec = {
|
|
553
|
-
ref: BoardVertexRef;
|
|
554
|
-
/**
|
|
555
|
-
* Optional authored vertex type identifier
|
|
556
|
-
*/
|
|
557
|
-
typeId?: string;
|
|
558
|
-
/**
|
|
559
|
-
* Optional vertex label for setup or rendering
|
|
560
|
-
*/
|
|
561
|
-
label?: string;
|
|
562
|
-
tags?: Array<string>;
|
|
563
|
-
/**
|
|
564
|
-
* Typed authored vertex fields validated against vertexFieldsSchema
|
|
565
|
-
*/
|
|
566
|
-
fields?: {
|
|
567
|
-
[key: string]: JsonValue;
|
|
568
|
-
};
|
|
569
|
-
};
|
|
570
|
-
/**
|
|
571
|
-
* Reusable authored square board topology template
|
|
572
|
-
*/
|
|
573
|
-
type SquareBoardTemplateSpec = {
|
|
574
|
-
/**
|
|
575
|
-
* Stable template identifier
|
|
576
|
-
*/
|
|
577
|
-
id: string;
|
|
578
|
-
name: string;
|
|
579
|
-
layout: "square";
|
|
580
|
-
/**
|
|
581
|
-
* Optional authored board type identifier
|
|
582
|
-
*/
|
|
583
|
-
typeId?: string;
|
|
584
|
-
boardFieldsSchema?: ObjectSchema;
|
|
585
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
586
|
-
relationFieldsSchema?: ObjectSchema;
|
|
587
|
-
containerFieldsSchema?: ObjectSchema;
|
|
588
|
-
edgeFieldsSchema?: ObjectSchema;
|
|
589
|
-
vertexFieldsSchema?: ObjectSchema;
|
|
590
|
-
spaces?: Array<SquareSpaceSpec>;
|
|
591
|
-
relations?: Array<BoardRelationSpec>;
|
|
592
|
-
containers?: Array<BoardContainerSpec>;
|
|
593
|
-
edges?: Array<SquareEdgeSpec>;
|
|
594
|
-
vertices?: Array<SquareVertexSpec>;
|
|
595
|
-
};
|
|
596
|
-
type BoardTemplateSpec = ({
|
|
597
|
-
layout: "generic";
|
|
598
|
-
} & GenericBoardTemplateSpec) | ({
|
|
599
|
-
layout: "hex";
|
|
600
|
-
} & HexBoardTemplateSpec) | ({
|
|
601
|
-
layout: "square";
|
|
602
|
-
} & SquareBoardTemplateSpec);
|
|
603
|
-
/**
|
|
604
|
-
* Shared or per-player authored board instance shell
|
|
605
|
-
*/
|
|
606
|
-
type GenericBoardSpec = {
|
|
607
|
-
/**
|
|
608
|
-
* Stable board identifier
|
|
609
|
-
*/
|
|
610
|
-
id: string;
|
|
611
|
-
name: string;
|
|
612
|
-
layout: "generic";
|
|
613
|
-
/**
|
|
614
|
-
* Optional authored board type identifier such as track, map, tableau, or grid
|
|
615
|
-
*/
|
|
616
|
-
typeId?: string;
|
|
617
|
-
scope: TopologyScope;
|
|
618
|
-
/**
|
|
619
|
-
* Optional board template to clone before applying inline authored additions
|
|
620
|
-
*/
|
|
621
|
-
templateId?: string;
|
|
622
|
-
boardFieldsSchema?: ObjectSchema;
|
|
623
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
624
|
-
relationFieldsSchema?: ObjectSchema;
|
|
625
|
-
containerFieldsSchema?: ObjectSchema;
|
|
626
|
-
/**
|
|
627
|
-
* Typed authored board fields validated against boardFieldsSchema
|
|
628
|
-
*/
|
|
629
|
-
fields?: {
|
|
630
|
-
[key: string]: JsonValue;
|
|
631
|
-
};
|
|
632
|
-
spaces?: Array<BoardSpaceSpec>;
|
|
633
|
-
relations?: Array<BoardRelationSpec>;
|
|
634
|
-
containers?: Array<BoardContainerSpec>;
|
|
635
|
-
};
|
|
636
|
-
/**
|
|
637
|
-
* Shared or per-player authored hex board instance shell
|
|
638
|
-
*/
|
|
639
|
-
type HexBoardSpec = {
|
|
640
|
-
/**
|
|
641
|
-
* Stable board identifier
|
|
642
|
-
*/
|
|
643
|
-
id: string;
|
|
644
|
-
name: string;
|
|
645
|
-
layout: "hex";
|
|
646
|
-
/**
|
|
647
|
-
* Optional authored board type identifier
|
|
648
|
-
*/
|
|
649
|
-
typeId?: string;
|
|
650
|
-
scope: TopologyScope;
|
|
651
|
-
/**
|
|
652
|
-
* Optional hex board template to clone before applying inline authored additions
|
|
653
|
-
*/
|
|
654
|
-
templateId?: string;
|
|
655
|
-
orientation?: HexOrientation;
|
|
656
|
-
boardFieldsSchema?: ObjectSchema;
|
|
657
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
658
|
-
edgeFieldsSchema?: ObjectSchema;
|
|
659
|
-
vertexFieldsSchema?: ObjectSchema;
|
|
660
|
-
/**
|
|
661
|
-
* Typed authored board fields validated against boardFieldsSchema
|
|
662
|
-
*/
|
|
663
|
-
fields?: {
|
|
664
|
-
[key: string]: JsonValue;
|
|
665
|
-
};
|
|
666
|
-
spaces?: Array<HexSpaceSpec>;
|
|
667
|
-
edges?: Array<HexEdgeSpec>;
|
|
668
|
-
vertices?: Array<HexVertexSpec>;
|
|
669
|
-
};
|
|
670
|
-
/**
|
|
671
|
-
* Shared or per-player authored square board instance shell
|
|
672
|
-
*/
|
|
673
|
-
type SquareBoardSpec = {
|
|
674
|
-
/**
|
|
675
|
-
* Stable board identifier
|
|
676
|
-
*/
|
|
677
|
-
id: string;
|
|
678
|
-
name: string;
|
|
679
|
-
layout: "square";
|
|
680
|
-
/**
|
|
681
|
-
* Optional authored board type identifier
|
|
682
|
-
*/
|
|
683
|
-
typeId?: string;
|
|
684
|
-
scope: TopologyScope;
|
|
685
|
-
/**
|
|
686
|
-
* Optional square board template to clone before applying inline authored additions
|
|
687
|
-
*/
|
|
688
|
-
templateId?: string;
|
|
689
|
-
boardFieldsSchema?: ObjectSchema;
|
|
690
|
-
spaceFieldsSchema?: ObjectSchema;
|
|
691
|
-
relationFieldsSchema?: ObjectSchema;
|
|
692
|
-
containerFieldsSchema?: ObjectSchema;
|
|
693
|
-
edgeFieldsSchema?: ObjectSchema;
|
|
694
|
-
vertexFieldsSchema?: ObjectSchema;
|
|
695
|
-
/**
|
|
696
|
-
* Typed authored board fields validated against boardFieldsSchema
|
|
697
|
-
*/
|
|
698
|
-
fields?: {
|
|
699
|
-
[key: string]: JsonValue;
|
|
700
|
-
};
|
|
701
|
-
spaces?: Array<SquareSpaceSpec>;
|
|
702
|
-
relations?: Array<BoardRelationSpec>;
|
|
703
|
-
containers?: Array<BoardContainerSpec>;
|
|
704
|
-
edges?: Array<SquareEdgeSpec>;
|
|
705
|
-
vertices?: Array<SquareVertexSpec>;
|
|
706
|
-
};
|
|
707
|
-
type BoardSpec = ({
|
|
708
|
-
layout: "generic";
|
|
709
|
-
} & GenericBoardSpec) | ({
|
|
710
|
-
layout: "hex";
|
|
711
|
-
} & HexBoardSpec) | ({
|
|
712
|
-
layout: "square";
|
|
713
|
-
} & SquareBoardSpec);
|
|
714
|
-
/**
|
|
715
|
-
* Named authored slot exposed by a piece or die type
|
|
716
|
-
*/
|
|
717
|
-
type ComponentSlotSpec = {
|
|
718
|
-
id: string;
|
|
719
|
-
name?: string;
|
|
720
|
-
};
|
|
721
|
-
/**
|
|
722
|
-
* Reusable authored piece type
|
|
723
|
-
*/
|
|
724
|
-
type PieceTypeSpec = {
|
|
725
|
-
id: string;
|
|
726
|
-
name: string;
|
|
727
|
-
fieldsSchema?: ObjectSchema;
|
|
728
|
-
slots?: Array<ComponentSlotSpec>;
|
|
729
|
-
};
|
|
730
|
-
/**
|
|
731
|
-
* Authored seeded piece inventory or supply definition
|
|
732
|
-
*/
|
|
733
|
-
type PieceSeedSpec = {
|
|
734
|
-
/**
|
|
735
|
-
* Stable piece id seed. When count > 1, runtime ids are generated as '{id}-1', '{id}-2', etc.
|
|
736
|
-
*/
|
|
737
|
-
id?: string;
|
|
738
|
-
name?: string;
|
|
739
|
-
typeId: string;
|
|
740
|
-
count?: number;
|
|
741
|
-
ownerId?: string;
|
|
742
|
-
home?: ComponentHomeSpec;
|
|
743
|
-
visibility?: ComponentVisibilitySpec;
|
|
744
|
-
/**
|
|
745
|
-
* Typed authored piece fields validated against the piece type schema
|
|
746
|
-
*/
|
|
747
|
-
fields?: {
|
|
748
|
-
[key: string]: JsonValue;
|
|
749
|
-
};
|
|
750
|
-
};
|
|
751
|
-
/**
|
|
752
|
-
* Reusable authored die type
|
|
753
|
-
*/
|
|
754
|
-
type DieTypeSpec$2 = {
|
|
755
|
-
id: string;
|
|
756
|
-
name: string;
|
|
757
|
-
sides?: number;
|
|
758
|
-
fieldsSchema?: ObjectSchema;
|
|
759
|
-
slots?: Array<ComponentSlotSpec>;
|
|
760
|
-
};
|
|
761
|
-
/**
|
|
762
|
-
* Authored seeded die inventory or supply definition
|
|
763
|
-
*/
|
|
764
|
-
type DieSeedSpec = {
|
|
765
|
-
/**
|
|
766
|
-
* Stable die id seed. When count > 1, runtime ids are generated as '{id}-1', '{id}-2', etc.
|
|
767
|
-
*/
|
|
768
|
-
id?: string;
|
|
769
|
-
name?: string;
|
|
770
|
-
typeId: string;
|
|
771
|
-
count?: number;
|
|
772
|
-
ownerId?: string;
|
|
773
|
-
home?: ComponentHomeSpec;
|
|
774
|
-
visibility?: ComponentVisibilitySpec;
|
|
775
|
-
/**
|
|
776
|
-
* Typed authored die fields validated against the die type schema
|
|
777
|
-
*/
|
|
778
|
-
fields?: {
|
|
779
|
-
[key: string]: JsonValue;
|
|
780
|
-
};
|
|
781
|
-
};
|
|
782
|
-
/**
|
|
783
|
-
* Definition of a game resource type
|
|
784
|
-
*/
|
|
785
|
-
type ResourceDefinition = {
|
|
786
|
-
/**
|
|
787
|
-
* Unique identifier for the resource. Used as a typed ResourceId.
|
|
788
|
-
*/
|
|
789
|
-
id: string;
|
|
790
|
-
/**
|
|
791
|
-
* Human-readable display name for the resource
|
|
792
|
-
*/
|
|
793
|
-
name: string;
|
|
794
|
-
/**
|
|
795
|
-
* Optional compact icon or emoji rendered by generic UI resource controls.
|
|
796
|
-
*/
|
|
797
|
-
icon?: string;
|
|
798
|
-
};
|
|
799
|
-
/**
|
|
800
|
-
* One authored setup option choice
|
|
801
|
-
*/
|
|
802
|
-
type SetupOptionChoiceSpec = {
|
|
803
|
-
id: string;
|
|
804
|
-
label: string;
|
|
805
|
-
description?: string;
|
|
806
|
-
};
|
|
807
|
-
/**
|
|
808
|
-
* Authored setup module/variant axis metadata
|
|
809
|
-
*/
|
|
810
|
-
type SetupOptionSpec = {
|
|
811
|
-
id: string;
|
|
812
|
-
name: string;
|
|
813
|
-
description?: string;
|
|
814
|
-
choices?: Array<SetupOptionChoiceSpec>;
|
|
815
|
-
};
|
|
816
|
-
/**
|
|
817
|
-
* One player-facing setup guidance step. Completion state remains game-owned
|
|
818
|
-
* view data; the framework only preserves authored copy.
|
|
819
|
-
*/
|
|
820
|
-
type SetupGuidanceStep = {
|
|
821
|
-
id: string;
|
|
822
|
-
label: string;
|
|
823
|
-
description?: string;
|
|
824
|
-
};
|
|
825
|
-
/**
|
|
826
|
-
* Reducer-consumed authored setup profile, recipe, or loadout metadata
|
|
827
|
-
*/
|
|
828
|
-
type SetupProfileSpec = {
|
|
829
|
-
id: string;
|
|
830
|
-
name: string;
|
|
831
|
-
description?: string;
|
|
832
|
-
/**
|
|
833
|
-
* Selected setup-option values for this profile
|
|
834
|
-
*/
|
|
835
|
-
optionValues?: {
|
|
836
|
-
[key: string]: string;
|
|
837
|
-
};
|
|
838
|
-
guidance?: {
|
|
839
|
-
summary?: string;
|
|
840
|
-
steps?: ReadonlyArray<SetupGuidanceStep>;
|
|
841
|
-
};
|
|
842
|
-
};
|
|
843
|
-
/**
|
|
844
|
-
* Authoritative topology manifest for reducer-native games
|
|
845
|
-
*/
|
|
846
|
-
type GameTopologyManifest$2 = {
|
|
847
|
-
players: PlayersDefinition;
|
|
848
|
-
/**
|
|
849
|
-
* Authored card catalogs and schemas
|
|
850
|
-
*/
|
|
851
|
-
cardSets: Array<CardSetDefinition>;
|
|
852
|
-
/**
|
|
853
|
-
* Shared and per-player authored containers
|
|
854
|
-
*/
|
|
855
|
-
zones?: Array<ZoneSpec>;
|
|
856
|
-
/**
|
|
857
|
-
* Reusable board topology templates
|
|
858
|
-
*/
|
|
859
|
-
boardTemplates?: Array<BoardTemplateSpec>;
|
|
860
|
-
/**
|
|
861
|
-
* Shared and per-player authored board shells
|
|
862
|
-
*/
|
|
863
|
-
boards?: Array<BoardSpec>;
|
|
864
|
-
pieceTypes?: Array<PieceTypeSpec>;
|
|
865
|
-
pieceSeeds?: Array<PieceSeedSpec>;
|
|
866
|
-
dieTypes?: Array<DieTypeSpec$2>;
|
|
867
|
-
dieSeeds?: Array<DieSeedSpec>;
|
|
868
|
-
resources?: Array<ResourceDefinition>;
|
|
869
|
-
/**
|
|
870
|
-
* Authored setup-option metadata consumed by reducer-owned setup flows
|
|
871
|
-
*/
|
|
872
|
-
setupOptions?: Array<SetupOptionSpec>;
|
|
873
|
-
/**
|
|
874
|
-
* Authored setup recipes, loadouts, or module profiles consumed by reducer setup code
|
|
875
|
-
*/
|
|
876
|
-
setupProfiles?: Array<SetupProfileSpec>;
|
|
877
|
-
};
|
|
878
|
-
/**
|
|
879
|
-
* Authenticated user acting in a session.
|
|
880
|
-
*/
|
|
881
|
-
type SessionActorAuthUser = {
|
|
882
|
-
kind: "AUTH_USER";
|
|
883
|
-
/**
|
|
884
|
-
* Internal user id
|
|
885
|
-
*/
|
|
886
|
-
id: string;
|
|
887
|
-
};
|
|
888
|
-
/**
|
|
889
|
-
* Anonymous demo principal for one demo_sessions row (shared across tabs).
|
|
890
|
-
*/
|
|
891
|
-
type SessionActorDemoGuest = {
|
|
892
|
-
kind: "DEMO_GUEST";
|
|
893
|
-
/**
|
|
894
|
-
* demo_sessions.id
|
|
895
|
-
*/
|
|
896
|
-
demoActorSessionId: string;
|
|
897
|
-
};
|
|
898
|
-
type SessionActor = ({
|
|
899
|
-
kind: "AUTH_USER";
|
|
900
|
-
} & SessionActorAuthUser) | ({
|
|
901
|
-
kind: "DEMO_GUEST";
|
|
902
|
-
} & SessionActorDemoGuest);
|
|
903
|
-
type SessionGameSourceUserCompiled = {
|
|
904
|
-
kind: "USER_COMPILED";
|
|
905
|
-
ownerUserId: string;
|
|
906
|
-
gameId: string;
|
|
907
|
-
compiledResultId: string;
|
|
908
|
-
};
|
|
909
|
-
type SessionGameSourceDemoRevision = {
|
|
910
|
-
kind: "DEMO_REVISION";
|
|
911
|
-
slug: string;
|
|
912
|
-
revisionId: string;
|
|
913
|
-
};
|
|
914
|
-
type SessionGameSource = ({
|
|
915
|
-
kind: "USER_COMPILED";
|
|
916
|
-
} & SessionGameSourceUserCompiled) | ({
|
|
917
|
-
kind: "DEMO_REVISION";
|
|
918
|
-
} & SessionGameSourceDemoRevision);
|
|
919
|
-
type SessionSnapshotPhase = "lobby" | "gameplay" | "ended";
|
|
920
|
-
type HostSessionStatus = "active" | "ended";
|
|
921
|
-
/**
|
|
922
|
-
* Summary of a game state history entry.
|
|
923
|
-
*/
|
|
924
|
-
type HistoryEntrySummary = {
|
|
925
|
-
id: string;
|
|
926
|
-
version: number;
|
|
927
|
-
timestamp: string;
|
|
928
|
-
description: string;
|
|
929
|
-
playerId?: string;
|
|
930
|
-
actionType?: string;
|
|
931
|
-
isCurrent: boolean;
|
|
932
|
-
};
|
|
933
|
-
type SessionSnapshotHistory = {
|
|
934
|
-
entries: Array<HistoryEntrySummary>;
|
|
935
|
-
currentIndex: number;
|
|
936
|
-
canGoBack: boolean;
|
|
937
|
-
canGoForward: boolean;
|
|
938
|
-
};
|
|
939
|
-
type HostSessionContext = {
|
|
940
|
-
/**
|
|
941
|
-
* Unique identifier for the session.
|
|
942
|
-
*/
|
|
943
|
-
sessionId: string;
|
|
944
|
-
/**
|
|
945
|
-
* Memorable short code for sharing.
|
|
946
|
-
*/
|
|
947
|
-
shortCode: string;
|
|
948
|
-
phase: SessionSnapshotPhase;
|
|
949
|
-
status: HostSessionStatus;
|
|
950
|
-
hostActor: SessionActor;
|
|
951
|
-
gameSource: SessionGameSource;
|
|
952
|
-
/**
|
|
953
|
-
* Selected authored setup profile for this session.
|
|
954
|
-
*/
|
|
955
|
-
setupProfileId?: string;
|
|
956
|
-
/**
|
|
957
|
-
* Player IDs the authenticated session actor may select.
|
|
958
|
-
*/
|
|
959
|
-
switchablePlayerIds: Array<string>;
|
|
960
|
-
history?: SessionSnapshotHistory;
|
|
961
|
-
};
|
|
962
|
-
type SeatAssignment = {
|
|
963
|
-
/**
|
|
964
|
-
* Player identifier (e.g., 'player-1')
|
|
965
|
-
*/
|
|
966
|
-
playerId: string;
|
|
967
|
-
/**
|
|
968
|
-
* Session actor controlling this seat (null if empty)
|
|
969
|
-
*/
|
|
970
|
-
controllerActor?: SessionActor;
|
|
971
|
-
/**
|
|
972
|
-
* Display name for this seat/player
|
|
973
|
-
*/
|
|
974
|
-
displayName: string;
|
|
975
|
-
/**
|
|
976
|
-
* Hex color code for the player (e.g., '#FF5733')
|
|
977
|
-
*/
|
|
978
|
-
playerColor?: string;
|
|
979
|
-
/**
|
|
980
|
-
* Whether this seat is the host
|
|
981
|
-
*/
|
|
982
|
-
isHost?: boolean;
|
|
983
|
-
};
|
|
984
|
-
type HostLobbyView = {
|
|
985
|
-
/**
|
|
986
|
-
* Current public seat assignments for the session.
|
|
987
|
-
*/
|
|
988
|
-
seats: Array<SeatAssignment>;
|
|
989
|
-
/**
|
|
990
|
-
* Whether the lobby can currently be started.
|
|
991
|
-
*/
|
|
992
|
-
canStart: boolean;
|
|
993
|
-
/**
|
|
994
|
-
* Session actor that hosts this session.
|
|
995
|
-
*/
|
|
996
|
-
hostActor: SessionActor;
|
|
997
|
-
/**
|
|
998
|
-
* Selected authored setup profile for this session.
|
|
999
|
-
*/
|
|
1000
|
-
setupProfileId?: string;
|
|
1001
|
-
};
|
|
1002
|
-
type HostLobbySessionSnapshot = {
|
|
1003
|
-
type: "lobby";
|
|
1004
|
-
context: HostSessionContext;
|
|
1005
|
-
lobby: HostLobbyView;
|
|
1006
|
-
};
|
|
1007
|
-
type SimultaneousPhaseSnapshot = {
|
|
1008
|
-
phaseName: string;
|
|
1009
|
-
interactionId: string;
|
|
1010
|
-
actorIds: Array<string>;
|
|
1011
|
-
sealedPlayerIds: Array<string>;
|
|
1012
|
-
pendingPlayerIds: Array<string>;
|
|
1013
|
-
};
|
|
1014
|
-
type HostGameplaySharedView = {
|
|
1015
|
-
/**
|
|
1016
|
-
* Player IDs currently active in the game state.
|
|
1017
|
-
*/
|
|
1018
|
-
activePlayers: Array<string>;
|
|
1019
|
-
/**
|
|
1020
|
-
* Current reducer-native gameplay phase.
|
|
1021
|
-
*/
|
|
1022
|
-
currentPhase: string;
|
|
1023
|
-
/**
|
|
1024
|
-
* Current stage within the phase. Null when the phase has no active stage.
|
|
1025
|
-
*/
|
|
1026
|
-
currentStage: string | null;
|
|
1027
|
-
/**
|
|
1028
|
-
* Player IDs this stage currently admits.
|
|
1029
|
-
*/
|
|
1030
|
-
stageSeats: Array<string>;
|
|
1031
|
-
/**
|
|
1032
|
-
* Visibility-safe progress metadata for an active simultaneous-player phase.
|
|
1033
|
-
*/
|
|
1034
|
-
simultaneousPhase?: SimultaneousPhaseSnapshot | null;
|
|
1035
|
-
/**
|
|
1036
|
-
* JSON-serialized dynamic view shared by every player for this projection.
|
|
1037
|
-
*/
|
|
1038
|
-
dynamicView?: string | null;
|
|
1039
|
-
/**
|
|
1040
|
-
* JSON-serialized session-scoped static view. Populated on gameplay bootstrap payloads only.
|
|
1041
|
-
*/
|
|
1042
|
-
boardStatic?: string | null;
|
|
1043
|
-
/**
|
|
1044
|
-
* Content hash of the session-scoped static view held on the host.
|
|
1045
|
-
*/
|
|
1046
|
-
boardStaticHash?: string | null;
|
|
1047
|
-
};
|
|
1048
|
-
/**
|
|
1049
|
-
* Draft commit policy consumed by default UI surfaces.
|
|
1050
|
-
*/
|
|
1051
|
-
type InteractionCommitPolicy = {
|
|
1052
|
-
mode: "manual" | "autoWhenReady";
|
|
1053
|
-
};
|
|
1054
|
-
/**
|
|
1055
|
-
* Single-value input selection.
|
|
1056
|
-
*/
|
|
1057
|
-
type SingleInputSelection = {
|
|
1058
|
-
mode: "single";
|
|
1059
|
-
};
|
|
1060
|
-
/**
|
|
1061
|
-
* Multi-value input selection.
|
|
1062
|
-
*/
|
|
1063
|
-
type ManyInputSelection = {
|
|
1064
|
-
mode: "many";
|
|
1065
|
-
min: number;
|
|
1066
|
-
max?: number;
|
|
1067
|
-
distinct?: boolean;
|
|
1068
|
-
};
|
|
1069
|
-
type InputSelection = ({
|
|
1070
|
-
mode: "single";
|
|
1071
|
-
} & SingleInputSelection) | ({
|
|
1072
|
-
mode: "many";
|
|
1073
|
-
} & ManyInputSelection);
|
|
1074
|
-
type InputDomain = ({
|
|
1075
|
-
type: "cardTarget";
|
|
1076
|
-
} & CardTargetDomain) | ({
|
|
1077
|
-
type: "boardTarget";
|
|
1078
|
-
} & BoardTargetDomain) | ({
|
|
1079
|
-
type: "resourceMap";
|
|
1080
|
-
} & ResourceMapDomain) | ({
|
|
1081
|
-
type: "boundedNumber";
|
|
1082
|
-
} & BoundedNumberDomain) | ({
|
|
1083
|
-
type: "choice";
|
|
1084
|
-
} & ChoiceDomain) | ({
|
|
1085
|
-
type: "choiceList";
|
|
1086
|
-
} & ChoiceListDomain);
|
|
1087
|
-
type InputDomainDependencyCase = {
|
|
1088
|
-
when: {
|
|
1089
|
-
[key: string]: string;
|
|
1090
|
-
};
|
|
1091
|
-
domain: InputDomain;
|
|
1092
|
-
};
|
|
1093
|
-
type EagerInputDomainDependencies = {
|
|
1094
|
-
mode: "eager";
|
|
1095
|
-
dependentCases: Array<InputDomainDependencyCase>;
|
|
1096
|
-
};
|
|
1097
|
-
type ResolvedCardTargetDomain = {
|
|
1098
|
-
type: "cardTarget";
|
|
1099
|
-
projection: "resolved";
|
|
1100
|
-
targetKind: "card";
|
|
1101
|
-
zoneIds: Array<string>;
|
|
1102
|
-
eligibleTargets: Array<string>;
|
|
1103
|
-
selection?: InputSelection;
|
|
1104
|
-
dependencies?: EagerInputDomainDependencies;
|
|
1105
|
-
};
|
|
1106
|
-
type InputDomainResolver = {
|
|
1107
|
-
interactionKey?: string;
|
|
1108
|
-
inputKey: string;
|
|
1109
|
-
};
|
|
1110
|
-
type LazyInputDomainDependencies = {
|
|
1111
|
-
mode: "lazy";
|
|
1112
|
-
dependsOn: Array<string>;
|
|
1113
|
-
resolver: InputDomainResolver;
|
|
1114
|
-
};
|
|
1115
|
-
type LazyCardTargetDomain = {
|
|
1116
|
-
type: "cardTarget";
|
|
1117
|
-
projection: "lazy";
|
|
1118
|
-
targetKind: "card";
|
|
1119
|
-
zoneIds: Array<string>;
|
|
1120
|
-
selection?: InputSelection;
|
|
1121
|
-
dependencies: LazyInputDomainDependencies;
|
|
1122
|
-
};
|
|
1123
|
-
type CardTargetDomain = ({
|
|
1124
|
-
projection: "resolved";
|
|
1125
|
-
} & ResolvedCardTargetDomain) | ({
|
|
1126
|
-
projection: "lazy";
|
|
1127
|
-
} & LazyCardTargetDomain);
|
|
1128
|
-
type ResolvedBoardTargetDomain = {
|
|
1129
|
-
type: "boardTarget";
|
|
1130
|
-
projection: "resolved";
|
|
1131
|
-
targetKind: "edge" | "vertex" | "space" | "tile";
|
|
1132
|
-
boardId: string;
|
|
1133
|
-
valueKind?: "board-id" | "player-board-space";
|
|
1134
|
-
eligibleTargets: Array<string>;
|
|
1135
|
-
selection?: InputSelection;
|
|
1136
|
-
dependencies?: EagerInputDomainDependencies;
|
|
1137
|
-
};
|
|
1138
|
-
type LazyBoardTargetDomain = {
|
|
1139
|
-
type: "boardTarget";
|
|
1140
|
-
projection: "lazy";
|
|
1141
|
-
targetKind: "edge" | "vertex" | "space" | "tile";
|
|
1142
|
-
boardId: string;
|
|
1143
|
-
valueKind?: "board-id" | "player-board-space";
|
|
1144
|
-
selection?: InputSelection;
|
|
1145
|
-
dependencies: LazyInputDomainDependencies;
|
|
1146
|
-
};
|
|
1147
|
-
type BoardTargetDomain = ({
|
|
1148
|
-
projection: "resolved";
|
|
1149
|
-
} & ResolvedBoardTargetDomain) | ({
|
|
1150
|
-
projection: "lazy";
|
|
1151
|
-
} & LazyBoardTargetDomain);
|
|
1152
|
-
type ResourceMapDomainEntry = {
|
|
1153
|
-
resourceId: string;
|
|
1154
|
-
label?: string;
|
|
1155
|
-
icon?: string;
|
|
1156
|
-
min: number;
|
|
1157
|
-
max: number;
|
|
1158
|
-
};
|
|
1159
|
-
type ResourceMapDomain = {
|
|
1160
|
-
type: "resourceMap";
|
|
1161
|
-
resources: Array<ResourceMapDomainEntry>;
|
|
1162
|
-
selection?: InputSelection;
|
|
1163
|
-
};
|
|
1164
|
-
type BoundedNumberDomain = {
|
|
1165
|
-
type: "boundedNumber";
|
|
1166
|
-
min: number;
|
|
1167
|
-
max: number;
|
|
1168
|
-
step?: number;
|
|
1169
|
-
selection?: InputSelection;
|
|
1170
|
-
};
|
|
1171
|
-
type ChoiceDomainOption = {
|
|
1172
|
-
value: string | null;
|
|
1173
|
-
label: string;
|
|
1174
|
-
icon?: string;
|
|
1175
|
-
badge?: string;
|
|
1176
|
-
description?: string;
|
|
1177
|
-
disabled?: boolean;
|
|
1178
|
-
disabledReason?: string;
|
|
1179
|
-
};
|
|
1180
|
-
type ChoiceDomain = {
|
|
1181
|
-
type: "choice";
|
|
1182
|
-
choices: Array<ChoiceDomainOption>;
|
|
1183
|
-
selection?: InputSelection;
|
|
1184
|
-
dependencies?: EagerInputDomainDependencies;
|
|
1185
|
-
};
|
|
1186
|
-
type ChoiceListDomain = {
|
|
1187
|
-
type: "choiceList";
|
|
1188
|
-
choices: Array<ChoiceDomainOption>;
|
|
1189
|
-
min?: number;
|
|
1190
|
-
max?: number;
|
|
1191
|
-
selection?: InputSelection;
|
|
1192
|
-
dependencies?: EagerInputDomainDependencies;
|
|
1193
|
-
};
|
|
1194
|
-
/**
|
|
1195
|
-
* Canonical descriptor for one interaction input collector.
|
|
1196
|
-
*/
|
|
1197
|
-
type InteractionInputDescriptor = {
|
|
1198
|
-
key: string;
|
|
1199
|
-
kind: string;
|
|
1200
|
-
domain: InputDomain;
|
|
1201
|
-
/**
|
|
1202
|
-
* Optional default value applied to this input when the player has not
|
|
1203
|
-
* yet drafted a value. Mirrors the input collector's `defaultValue`
|
|
1204
|
-
* from the authored interaction, so plugins can render a sensible
|
|
1205
|
-
* starting state (e.g. a pre-selected resource for a bank trade).
|
|
1206
|
-
*
|
|
1207
|
-
*/
|
|
1208
|
-
defaultValue?: JsonValue;
|
|
1209
|
-
};
|
|
1210
|
-
type AvailableInteractionAvailability = {
|
|
1211
|
-
status: "available";
|
|
1212
|
-
};
|
|
1213
|
-
type NotYourTurnInteractionAvailability = {
|
|
1214
|
-
status: "notYourTurn";
|
|
1215
|
-
reason: string;
|
|
1216
|
-
};
|
|
1217
|
-
type InsufficientResourcesInteractionAvailability = {
|
|
1218
|
-
status: "insufficientResources";
|
|
1219
|
-
reason: string;
|
|
1220
|
-
/**
|
|
1221
|
-
* Resource shortfall by resource id when a costed interaction is not currently affordable.
|
|
1222
|
-
*/
|
|
1223
|
-
missingResources: {
|
|
1224
|
-
[key: string]: number;
|
|
1225
|
-
};
|
|
1226
|
-
};
|
|
1227
|
-
type BlockedInteractionAvailability = {
|
|
1228
|
-
status: "blocked";
|
|
1229
|
-
reason: string;
|
|
1230
|
-
code?: string;
|
|
1231
|
-
};
|
|
1232
|
-
type InteractionAvailability = ({
|
|
1233
|
-
status: "available";
|
|
1234
|
-
} & AvailableInteractionAvailability) | ({
|
|
1235
|
-
status: "notYourTurn";
|
|
1236
|
-
} & NotYourTurnInteractionAvailability) | ({
|
|
1237
|
-
status: "insufficientResources";
|
|
1238
|
-
} & InsufficientResourcesInteractionAvailability) | ({
|
|
1239
|
-
status: "blocked";
|
|
1240
|
-
} & BlockedInteractionAvailability);
|
|
1241
|
-
/**
|
|
1242
|
-
* Authoritative interaction descriptor resolved by the trusted bundle.
|
|
1243
|
-
*/
|
|
1244
|
-
type InteractionDescriptorBase = {
|
|
1245
|
-
phaseName: string;
|
|
1246
|
-
interactionKey: string;
|
|
1247
|
-
interactionId: string;
|
|
1248
|
-
zoneId?: string;
|
|
1249
|
-
/**
|
|
1250
|
-
* Draft commit policy materialized by the trusted reducer bundle. Omitted authoring specs default to manual before this descriptor crosses the runtime boundary.
|
|
1251
|
-
*/
|
|
1252
|
-
commit: InteractionCommitPolicy;
|
|
1253
|
-
/**
|
|
1254
|
-
* Ordered input descriptors. Each entry is the canonical source for its collector key, collector kind, and valid-value domain.
|
|
1255
|
-
*/
|
|
1256
|
-
inputs: Array<InteractionInputDescriptor>;
|
|
1257
|
-
cost?: {
|
|
1258
|
-
[key: string]: JsonValue;
|
|
1259
|
-
};
|
|
1260
|
-
currentResources?: {
|
|
1261
|
-
[key: string]: JsonValue;
|
|
1262
|
-
};
|
|
1263
|
-
availability: InteractionAvailability;
|
|
1264
|
-
};
|
|
1265
|
-
type ActionInteractionDescriptor = InteractionDescriptorBase & {
|
|
1266
|
-
kind: "action";
|
|
1267
|
-
};
|
|
1268
|
-
type InteractionContextOption = {
|
|
1269
|
-
id: string;
|
|
1270
|
-
label: string;
|
|
1271
|
-
};
|
|
1272
|
-
type InteractionContext = {
|
|
1273
|
-
to: string;
|
|
1274
|
-
title?: string;
|
|
1275
|
-
payload?: {
|
|
1276
|
-
[key: string]: JsonValue;
|
|
1277
|
-
};
|
|
1278
|
-
options?: Array<InteractionContextOption>;
|
|
1279
|
-
};
|
|
1280
|
-
type PromptInteractionDescriptor = InteractionDescriptorBase & {
|
|
1281
|
-
kind: "prompt";
|
|
1282
|
-
context: InteractionContext;
|
|
1283
|
-
};
|
|
1284
|
-
type InteractionDescriptor = ({
|
|
1285
|
-
kind: "action";
|
|
1286
|
-
} & ActionInteractionDescriptor) | ({
|
|
1287
|
-
kind: "prompt";
|
|
1288
|
-
} & PromptInteractionDescriptor);
|
|
1289
|
-
type ZoneHandles = {
|
|
1290
|
-
cardIds: Array<string>;
|
|
1291
|
-
cardViewsById: {
|
|
1292
|
-
[key: string]: string;
|
|
1293
|
-
};
|
|
1294
|
-
playableByCardId: {
|
|
1295
|
-
[key: string]: Array<string>;
|
|
1296
|
-
};
|
|
1297
|
-
};
|
|
1298
|
-
type HostGameplaySeatView = {
|
|
1299
|
-
/**
|
|
1300
|
-
* Opaque revision token for this seat's available descriptors and input domains.
|
|
1301
|
-
*/
|
|
1302
|
-
actionSetVersion: string;
|
|
1303
|
-
/**
|
|
1304
|
-
* JSON-serialized reducer-projected UI view for this player.
|
|
1305
|
-
*/
|
|
1306
|
-
view: string | null;
|
|
1307
|
-
/**
|
|
1308
|
-
* Descriptor refs for interactions available to this player.
|
|
1309
|
-
*/
|
|
1310
|
-
availableInteractionRefs: Array<string>;
|
|
1311
|
-
/**
|
|
1312
|
-
* Zone handles for this player, keyed by zone id.
|
|
1313
|
-
*/
|
|
1314
|
-
zones: {
|
|
1315
|
-
[key: string]: ZoneHandles;
|
|
1316
|
-
};
|
|
1317
|
-
};
|
|
1318
|
-
type HostPlayerGameplayView = {
|
|
1319
|
-
/**
|
|
1320
|
-
* Monotonic gameplay version for stale-client detection.
|
|
1321
|
-
*/
|
|
1322
|
-
version: number;
|
|
1323
|
-
/**
|
|
1324
|
-
* Opaque revision token for the returned descriptors and input domains.
|
|
1325
|
-
*/
|
|
1326
|
-
actionSetVersion: string;
|
|
1327
|
-
/**
|
|
1328
|
-
* Player ID currently selected for rendering and input.
|
|
1329
|
-
*/
|
|
1330
|
-
perspectivePlayerId: string;
|
|
1331
|
-
shared: HostGameplaySharedView;
|
|
1332
|
-
/**
|
|
1333
|
-
* Deduplicated interaction descriptor registry keyed by stable descriptor ref.
|
|
1334
|
-
*/
|
|
1335
|
-
interactionsByRef: {
|
|
1336
|
-
[key: string]: InteractionDescriptor;
|
|
1337
|
-
};
|
|
1338
|
-
/**
|
|
1339
|
-
* Player-scoped projections keyed by authorized player id.
|
|
1340
|
-
*/
|
|
1341
|
-
seats: {
|
|
1342
|
-
[key: string]: HostGameplaySeatView;
|
|
1343
|
-
};
|
|
1344
|
-
};
|
|
1345
|
-
type HostGameplaySessionSnapshot = {
|
|
1346
|
-
type: "gameplay";
|
|
1347
|
-
context: HostSessionContext;
|
|
1348
|
-
lobby: HostLobbyView;
|
|
1349
|
-
gameplay: HostPlayerGameplayView;
|
|
1350
|
-
};
|
|
1351
|
-
type HostEndedSessionSnapshot = {
|
|
1352
|
-
type: "ended";
|
|
1353
|
-
context: HostSessionContext;
|
|
1354
|
-
lobby: HostLobbyView;
|
|
1355
|
-
};
|
|
1356
|
-
type HostSessionSnapshot = ({
|
|
1357
|
-
type: "lobby";
|
|
1358
|
-
} & HostLobbySessionSnapshot) | ({
|
|
1359
|
-
type: "gameplay";
|
|
1360
|
-
} & HostGameplaySessionSnapshot) | ({
|
|
1361
|
-
type: "ended";
|
|
1362
|
-
} & HostEndedSessionSnapshot);
|
|
1363
|
-
type HostSessionEventCausation = {
|
|
1364
|
-
clientActionId?: string;
|
|
1365
|
-
};
|
|
1366
|
-
type HostSessionGameplayUpdatedEvent = {
|
|
1367
|
-
type: "session.gameplayUpdated";
|
|
1368
|
-
context: HostSessionContext;
|
|
1369
|
-
gameplay: HostPlayerGameplayView;
|
|
1370
|
-
causation?: HostSessionEventCausation;
|
|
1371
|
-
};
|
|
1372
|
-
type HostActionSubmitResponse = {
|
|
1373
|
-
success: boolean;
|
|
1374
|
-
version: number;
|
|
1375
|
-
actionSetVersion: string;
|
|
1376
|
-
accepted?: boolean;
|
|
1377
|
-
durabilityStatus?: "COMMITTED";
|
|
1378
|
-
errorCode?: string;
|
|
1379
|
-
message?: string;
|
|
1380
|
-
clientActionId?: string;
|
|
1381
|
-
update?: HostSessionGameplayUpdatedEvent;
|
|
1382
|
-
};
|
|
1383
|
-
/**
|
|
1384
|
-
* Type of parameter accepted by a runtime action
|
|
1385
|
-
*/
|
|
1386
|
-
type ParameterType = "cardId" | "cardType" | "playerId" | "string" | "number" | "boolean" | "zoneId" | "pieceId" | "dieId" | "boardId" | "edgeId" | "vertexId" | "spaceId" | "resourceId";
|
|
1387
|
-
/**
|
|
1388
|
-
* Defines a parameter for an action
|
|
1389
|
-
*/
|
|
1390
|
-
type ActionParameterDefinition = {
|
|
1391
|
-
name: string;
|
|
1392
|
-
type: ParameterType;
|
|
1393
|
-
required?: boolean;
|
|
1394
|
-
array?: boolean;
|
|
1395
|
-
minLength?: number;
|
|
1396
|
-
maxLength?: number;
|
|
1397
|
-
/**
|
|
1398
|
-
* Optional card set ID to specify which card set a CARD_ID parameter refers to
|
|
1399
|
-
*/
|
|
1400
|
-
cardSetId?: string;
|
|
1401
|
-
description?: string;
|
|
1402
|
-
};
|
|
1403
|
-
/**
|
|
1404
|
-
* Defines an available player action with metadata and parameter definitions
|
|
1405
|
-
*/
|
|
1406
|
-
type ActionDefinition = {
|
|
1407
|
-
/**
|
|
1408
|
-
* Unique action identifier
|
|
1409
|
-
*/
|
|
1410
|
-
actionType: string;
|
|
1411
|
-
/**
|
|
1412
|
-
* UI display name for this action
|
|
1413
|
-
*/
|
|
1414
|
-
displayName: string;
|
|
1415
|
-
/**
|
|
1416
|
-
* Optional help text describing the action
|
|
1417
|
-
*/
|
|
1418
|
-
description?: string;
|
|
1419
|
-
/**
|
|
1420
|
-
* List of parameters this action accepts
|
|
1421
|
-
*/
|
|
1422
|
-
parameters: Array<ActionParameterDefinition>;
|
|
1423
|
-
/**
|
|
1424
|
-
* List of possible validation error codes
|
|
1425
|
-
*/
|
|
1426
|
-
errorCodes?: Array<string>;
|
|
1427
|
-
};
|
|
1428
|
-
/**
|
|
1429
|
-
* Type of source for the card set
|
|
1430
|
-
*/
|
|
1431
|
-
type CardSetSourceType = "preset" | "csv" | "manual";
|
|
1432
|
-
/**
|
|
1433
|
-
* Engine-level structural board layout discriminator
|
|
1434
|
-
*/
|
|
1435
|
-
type BoardLayout = "generic" | "hex" | "square";
|
|
1436
|
-
/**
|
|
1437
|
-
* Unique identifier for the player (e.g., 'player-1')
|
|
1438
|
-
*/
|
|
1439
|
-
type PlayerId$1 = string;
|
|
1440
|
-
|
|
1441
|
-
interface ViewCard<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> {
|
|
1442
|
-
id: CardIdValue;
|
|
1443
|
-
cardType: CardTypeValue;
|
|
1444
|
-
name?: string;
|
|
1445
|
-
text?: string;
|
|
1446
|
-
properties: Properties;
|
|
1447
|
-
}
|
|
1448
|
-
interface CardCollection<CardIdValue extends string = string, Card extends ViewCard<CardIdValue> = ViewCard<CardIdValue>> {
|
|
1449
|
-
cardIds: readonly CardIdValue[];
|
|
1450
|
-
cardsById: Readonly<Record<CardIdValue, Card | undefined>>;
|
|
1451
|
-
}
|
|
1452
|
-
|
|
1453
|
-
interface ViewSlotOccupant<PieceIdValue extends string = string, PlayerIdValue extends string = string, SlotIdValue extends string = string, Data extends Record<string, unknown> = Record<string, unknown>> {
|
|
1454
|
-
pieceId: PieceIdValue;
|
|
1455
|
-
playerId: PlayerIdValue | null;
|
|
1456
|
-
slotId: SlotIdValue;
|
|
1457
|
-
data?: Data;
|
|
1458
|
-
}
|
|
1459
|
-
|
|
1460
|
-
type DieTypeSpec$1 = Omit<DieTypeSpec$2, "sides"> & {
|
|
1461
|
-
sides?: DieTypeSpec$2["sides"];
|
|
1462
|
-
};
|
|
1463
|
-
type DeepReadonly<T> = T extends (...args: readonly unknown[]) => unknown ? T : T extends readonly (infer Item)[] ? ReadonlyArray<DeepReadonly<Item>> : T extends object ? {
|
|
1464
|
-
readonly [Key in keyof T]: DeepReadonly<T[Key]>;
|
|
1465
|
-
} : T;
|
|
1466
|
-
type GameTopologyManifest$1 = DeepReadonly<Omit<GameTopologyManifest$2, "dieTypes"> & {
|
|
1467
|
-
dieTypes?: readonly DieTypeSpec$1[];
|
|
1468
|
-
}>;
|
|
1469
|
-
type ArrayItem<T> = T extends readonly (infer Item)[] ? Item : never;
|
|
1470
|
-
type EntryId<T> = T extends {
|
|
1471
|
-
id: infer Id extends string;
|
|
1472
|
-
} ? Id : never;
|
|
1473
|
-
type IdsOf<T> = EntryId<ArrayItem<NonNullable<T>>>;
|
|
1474
|
-
type RuntimeRecord = Record<string, JsonValue>;
|
|
1475
|
-
type CardSetId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["cardSets"]>;
|
|
1476
|
-
type ZoneId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["zones"]>;
|
|
1477
|
-
type BoardId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["boards"]>;
|
|
1478
|
-
type PerPlayerZoneId<Manifest extends GameTopologyManifest$1> = EntryId<Extract<ArrayItem<NonNullable<Manifest["zones"]>>, {
|
|
1479
|
-
scope: "perPlayer";
|
|
1480
|
-
}>>;
|
|
1481
|
-
type SharedZoneId<Manifest extends GameTopologyManifest$1> = Exclude<ZoneId<Manifest>, PerPlayerZoneId<Manifest>>;
|
|
1482
|
-
type PerPlayerBoardId<Manifest extends GameTopologyManifest$1> = EntryId<Extract<ArrayItem<NonNullable<Manifest["boards"]>>, {
|
|
1483
|
-
scope: "perPlayer";
|
|
1484
|
-
}>>;
|
|
1485
|
-
type SharedBoardId<Manifest extends GameTopologyManifest$1> = Exclude<BoardId<Manifest>, PerPlayerBoardId<Manifest>>;
|
|
1486
|
-
type ResourceId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["resources"]>;
|
|
1487
|
-
type PieceTypeId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["pieceTypes"]>;
|
|
1488
|
-
type DieTypeId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["dieTypes"]>;
|
|
1489
|
-
type PieceSeedOf<Manifest extends GameTopologyManifest$1> = ArrayItem<NonNullable<Manifest["pieceSeeds"]>>;
|
|
1490
|
-
type DieSeedOf<Manifest extends GameTopologyManifest$1> = ArrayItem<NonNullable<Manifest["dieSeeds"]>>;
|
|
1491
|
-
type SetupOptionId<Manifest extends GameTopologyManifest$1> = IdsOf<Manifest["setupOptions"]>;
|
|
1492
|
-
type ManualCardSetOf<Manifest extends GameTopologyManifest$1> = Extract<ArrayItem<NonNullable<Manifest["cardSets"]>>, {
|
|
1493
|
-
type: "manual";
|
|
1494
|
-
}>;
|
|
1495
|
-
type CardOf<Manifest extends GameTopologyManifest$1> = ManualCardSetOf<Manifest> extends infer CardSet ? CardSet extends {
|
|
1496
|
-
cards: infer Cards extends readonly unknown[];
|
|
1497
|
-
} ? ArrayItem<Cards> : never : never;
|
|
1498
|
-
type BoardOf<Manifest extends GameTopologyManifest$1, CurrentBoardId extends BoardId<Manifest>> = Extract<ArrayItem<NonNullable<Manifest["boards"]>>, {
|
|
1499
|
-
id: CurrentBoardId;
|
|
1500
|
-
}>;
|
|
1501
|
-
type BoardTemplateOf<Manifest extends GameTopologyManifest$1, CurrentTemplateId extends string> = Extract<ArrayItem<NonNullable<Manifest["boardTemplates"]>>, {
|
|
1502
|
-
id: CurrentTemplateId;
|
|
1503
|
-
}>;
|
|
1504
|
-
type ResolvedBoardLikeOf<Manifest extends GameTopologyManifest$1, CurrentBoardId extends BoardId<Manifest>> = BoardOf<Manifest, CurrentBoardId> | (BoardOf<Manifest, CurrentBoardId> extends {
|
|
1505
|
-
templateId: infer CurrentTemplateId extends string;
|
|
1506
|
-
} ? BoardTemplateOf<Manifest, CurrentTemplateId> : never);
|
|
1507
|
-
type SpaceIdOf<BoardLike> = IdsOf<BoardLike extends {
|
|
1508
|
-
spaces?: infer Spaces;
|
|
1509
|
-
} ? Spaces : never>;
|
|
1510
|
-
type ContainerIdOf<BoardLike> = IdsOf<BoardLike extends {
|
|
1511
|
-
containers?: infer Containers;
|
|
1512
|
-
} ? Containers : never>;
|
|
1513
|
-
type SpaceOf<BoardLike> = ArrayItem<NonNullable<BoardLike extends {
|
|
1514
|
-
spaces?: infer Spaces;
|
|
1515
|
-
} ? Spaces : never>>;
|
|
1516
|
-
type SquareSpaceOf<BoardLike> = Extract<SpaceOf<BoardLike>, {
|
|
1517
|
-
row: number;
|
|
1518
|
-
col: number;
|
|
1519
|
-
}>;
|
|
1520
|
-
type HexSpaceOf<BoardLike> = Extract<SpaceOf<BoardLike>, {
|
|
1521
|
-
q: number;
|
|
1522
|
-
r: number;
|
|
1523
|
-
}>;
|
|
1524
|
-
type BoardEntryOf<Manifest extends GameTopologyManifest$1> = ArrayItem<NonNullable<Manifest["boards"]>>;
|
|
1525
|
-
type TemplateForBoardEntry<Manifest extends GameTopologyManifest$1, Entry> = Entry extends {
|
|
1526
|
-
templateId: infer TemplateId extends string;
|
|
1527
|
-
layout: infer Layout;
|
|
1528
|
-
} ? Extract<BoardTemplateOf<Manifest, TemplateId>, {
|
|
1529
|
-
layout: Layout;
|
|
1530
|
-
}> : never;
|
|
1531
|
-
type BoardLikeForEntry<Manifest extends GameTopologyManifest$1, Entry> = Entry extends BoardEntryOf<Manifest> ? Entry extends {
|
|
1532
|
-
id: infer CurrentBoardId extends BoardId<Manifest>;
|
|
1533
|
-
} ? ResolvedBoardLikeOf<Manifest, CurrentBoardId> : Entry : Entry;
|
|
1534
|
-
type SpaceIdForBoard<Manifest extends GameTopologyManifest$1, CurrentBoardId extends BoardId<Manifest>> = SpaceIdOf<ResolvedBoardLikeOf<Manifest, CurrentBoardId>>;
|
|
1535
|
-
type ContainerIdForBoard<Manifest extends GameTopologyManifest$1, CurrentBoardId extends BoardId<Manifest>> = ContainerIdOf<ResolvedBoardLikeOf<Manifest, CurrentBoardId>>;
|
|
1536
|
-
type RuntimeIdsFromCount<BaseId extends string, Count> = Count extends number ? number extends Count ? BaseId | `${BaseId}-${number}` : Count extends 1 ? BaseId : `${BaseId}-${OneTo<Count>}` : BaseId;
|
|
1537
|
-
type CardRuntimeId<Card> = Card extends {
|
|
1538
|
-
type: infer TypeId extends string;
|
|
1539
|
-
} ? RuntimeIdsFromCount<TypeId, Card extends {
|
|
1540
|
-
count: infer Count extends number;
|
|
1541
|
-
} ? Count : never> : never;
|
|
1542
|
-
type SeedRuntimeId<Seed> = Seed extends {
|
|
1543
|
-
typeId: infer TypeId extends string;
|
|
1544
|
-
} ? RuntimeIdsFromCount<Seed extends {
|
|
1545
|
-
id: infer Id extends string;
|
|
1546
|
-
} ? Id : TypeId, Seed extends {
|
|
1547
|
-
count: infer Count extends number;
|
|
1548
|
-
} ? Count : never> : never;
|
|
1549
|
-
type CardId<Manifest extends GameTopologyManifest$1> = CardRuntimeId<CardOf<Manifest>>;
|
|
1550
|
-
type PieceId<Manifest extends GameTopologyManifest$1> = SeedRuntimeId<PieceSeedOf<Manifest>>;
|
|
1551
|
-
type DieId<Manifest extends GameTopologyManifest$1> = SeedRuntimeId<DieSeedOf<Manifest>>;
|
|
1552
|
-
type PieceTypeOf<Manifest extends GameTopologyManifest$1, CurrentTypeId extends PieceTypeId<Manifest>> = Extract<ArrayItem<NonNullable<Manifest["pieceTypes"]>>, {
|
|
1553
|
-
id: CurrentTypeId;
|
|
1554
|
-
}>;
|
|
1555
|
-
type DieTypeOf<Manifest extends GameTopologyManifest$1, CurrentTypeId extends DieTypeId<Manifest>> = Extract<ArrayItem<NonNullable<Manifest["dieTypes"]>>, {
|
|
1556
|
-
id: CurrentTypeId;
|
|
1557
|
-
}>;
|
|
1558
|
-
type SlotIdOf<TypeSpec> = IdsOf<TypeSpec extends {
|
|
1559
|
-
slots?: infer Slots;
|
|
1560
|
-
} ? Slots : never>;
|
|
1561
|
-
type SlotIdForPieceType<Manifest extends GameTopologyManifest$1, CurrentTypeId extends PieceTypeId<Manifest>> = SlotIdOf<PieceTypeOf<Manifest, CurrentTypeId>>;
|
|
1562
|
-
type SlotIdForDieType<Manifest extends GameTopologyManifest$1, CurrentTypeId extends DieTypeId<Manifest>> = SlotIdOf<DieTypeOf<Manifest, CurrentTypeId>>;
|
|
1563
|
-
type SingletonExplicitSeed<Seed> = Seed extends {
|
|
1564
|
-
id: string;
|
|
1565
|
-
} ? Seed extends {
|
|
1566
|
-
count: infer Count extends number;
|
|
1567
|
-
} ? Count extends 1 ? Seed : never : Seed : never;
|
|
1568
|
-
type TypedPieceSlotHostSeed<Manifest extends GameTopologyManifest$1> = SingletonExplicitSeed<PieceSeedOf<Manifest>> extends infer Seed ? Seed extends {
|
|
1569
|
-
typeId: infer CurrentTypeId extends PieceTypeId<Manifest>;
|
|
1570
|
-
} ? [SlotIdForPieceType<Manifest, CurrentTypeId>] extends [never] ? never : Seed : never : never;
|
|
1571
|
-
type TypedDieSlotHostSeed<Manifest extends GameTopologyManifest$1> = SingletonExplicitSeed<DieSeedOf<Manifest>> extends infer Seed ? Seed extends {
|
|
1572
|
-
typeId: infer CurrentTypeId extends DieTypeId<Manifest>;
|
|
1573
|
-
} ? [SlotIdForDieType<Manifest, CurrentTypeId>] extends [never] ? never : Seed : never : never;
|
|
1574
|
-
type TypedPieceSlotHomeSpec<Manifest extends GameTopologyManifest$1> = TypedPieceSlotHostSeed<Manifest> extends infer Seed ? Seed extends {
|
|
1575
|
-
id: infer HostId extends string;
|
|
1576
|
-
typeId: infer CurrentTypeId extends PieceTypeId<Manifest>;
|
|
1577
|
-
} ? {
|
|
1578
|
-
type: "slot";
|
|
1579
|
-
host: {
|
|
1580
|
-
kind: "piece";
|
|
1581
|
-
id: HostId;
|
|
1582
|
-
};
|
|
1583
|
-
slotId: SlotIdForPieceType<Manifest, CurrentTypeId>;
|
|
1584
|
-
} : never : never;
|
|
1585
|
-
type TypedDieSlotHomeSpec<Manifest extends GameTopologyManifest$1> = TypedDieSlotHostSeed<Manifest> extends infer Seed ? Seed extends {
|
|
1586
|
-
id: infer HostId extends string;
|
|
1587
|
-
typeId: infer CurrentTypeId extends DieTypeId<Manifest>;
|
|
1588
|
-
} ? {
|
|
1589
|
-
type: "slot";
|
|
1590
|
-
host: {
|
|
1591
|
-
kind: "die";
|
|
1592
|
-
id: HostId;
|
|
1593
|
-
};
|
|
1594
|
-
slotId: SlotIdForDieType<Manifest, CurrentTypeId>;
|
|
1595
|
-
} : never : never;
|
|
1596
|
-
type RequiredSchemaKeys<Properties extends Readonly<Record<string, unknown>>> = {
|
|
1597
|
-
[Key in keyof Properties]: Properties[Key] extends {
|
|
1598
|
-
optional: true;
|
|
1599
|
-
} ? never : Properties[Key] extends {
|
|
1600
|
-
default: unknown;
|
|
1601
|
-
} ? never : Key;
|
|
1602
|
-
}[keyof Properties];
|
|
1603
|
-
type OptionalSchemaKeys<Properties extends Readonly<Record<string, unknown>>> = {
|
|
1604
|
-
[Key in keyof Properties]: Properties[Key] extends {
|
|
1605
|
-
optional: true;
|
|
1606
|
-
} ? Key : Properties[Key] extends {
|
|
1607
|
-
default: unknown;
|
|
1608
|
-
} ? Key : never;
|
|
1609
|
-
}[keyof Properties];
|
|
1610
|
-
type SchemaValueFromObjectProperties<Properties extends Readonly<Record<string, unknown>>, Manifest extends GameTopologyManifest$1, BoardLike = never> = keyof Properties extends never ? RuntimeRecord : {
|
|
1611
|
-
[Key in RequiredSchemaKeys<Properties>]: SchemaValueForProperty<Properties[Key], Manifest, BoardLike>;
|
|
1612
|
-
} & {
|
|
1613
|
-
[Key in OptionalSchemaKeys<Properties>]?: SchemaValueForProperty<Properties[Key], Manifest, BoardLike>;
|
|
1614
|
-
};
|
|
1615
|
-
type SchemaValueForObjectSchema<Schema, Manifest extends GameTopologyManifest$1, BoardLike = never> = Schema extends {
|
|
1616
|
-
properties: infer Properties extends Readonly<Record<string, unknown>>;
|
|
1617
|
-
} ? SchemaValueFromObjectProperties<Properties, Manifest, BoardLike> : RuntimeRecord;
|
|
1618
|
-
type MergeSharedProperties<Variant, Shared> = Variant extends {
|
|
1619
|
-
properties: infer VariantProperties extends Readonly<Record<string, unknown>>;
|
|
1620
|
-
} ? {
|
|
1621
|
-
properties: Shared extends Readonly<Record<string, unknown>> ? Omit<Shared, keyof VariantProperties> & VariantProperties : VariantProperties;
|
|
1622
|
-
} : Variant;
|
|
1623
|
-
type BaseSchemaValueForProperty<Schema, Manifest extends GameTopologyManifest$1, BoardLike = never> = Schema extends {
|
|
1624
|
-
type: "string";
|
|
1625
|
-
} ? string : Schema extends {
|
|
1626
|
-
type: "integer" | "number";
|
|
1627
|
-
} ? number : Schema extends {
|
|
1628
|
-
type: "boolean";
|
|
1629
|
-
} ? boolean : Schema extends {
|
|
1630
|
-
type: "zoneId";
|
|
1631
|
-
} ? ZoneId<Manifest> : Schema extends {
|
|
1632
|
-
type: "cardId";
|
|
1633
|
-
} ? CardId<Manifest> : Schema extends {
|
|
1634
|
-
type: "playerId";
|
|
1635
|
-
} ? PlayerId<Manifest> : Schema extends {
|
|
1636
|
-
type: "boardId";
|
|
1637
|
-
} ? BoardId<Manifest> : Schema extends {
|
|
1638
|
-
type: "spaceId";
|
|
1639
|
-
} ? [BoardLike] extends [never] ? string : SpaceIdOf<BoardLike> : Schema extends {
|
|
1640
|
-
type: "edgeId";
|
|
1641
|
-
} ? [BoardLike] extends [never] ? string : DerivedEdgeIdOf<BoardLike> : Schema extends {
|
|
1642
|
-
type: "vertexId";
|
|
1643
|
-
} ? [BoardLike] extends [never] ? string : DerivedVertexIdOf<BoardLike> : Schema extends {
|
|
1644
|
-
type: "pieceId";
|
|
1645
|
-
} ? PieceId<Manifest> : Schema extends {
|
|
1646
|
-
type: "dieId";
|
|
1647
|
-
} ? DieId<Manifest> : Schema extends {
|
|
1648
|
-
type: "resourceId";
|
|
1649
|
-
} ? ResourceId<Manifest> : Schema extends {
|
|
1650
|
-
type: "enum";
|
|
1651
|
-
} ? Schema extends {
|
|
1652
|
-
enums: infer Values extends readonly string[];
|
|
1653
|
-
} ? Values[number] : string : Schema extends {
|
|
1654
|
-
type: "array";
|
|
1655
|
-
} ? ReadonlyArray<SchemaValueForProperty<Schema extends {
|
|
1656
|
-
items?: infer Items;
|
|
1657
|
-
} ? Items : undefined, Manifest, BoardLike>> : Schema extends {
|
|
1658
|
-
type: "object";
|
|
1659
|
-
} ? SchemaValueForObjectSchema<Schema extends {
|
|
1660
|
-
properties?: infer Properties extends Record<string, unknown>;
|
|
1661
|
-
} ? {
|
|
1662
|
-
properties: Properties;
|
|
1663
|
-
} : undefined, Manifest, BoardLike> : Schema extends {
|
|
1664
|
-
type: "record";
|
|
1665
|
-
} ? Record<string, SchemaValueForProperty<Schema extends {
|
|
1666
|
-
values?: infer Values;
|
|
1667
|
-
} ? Values : undefined, Manifest, BoardLike>> : RuntimeRecord;
|
|
1668
|
-
type SchemaValueForProperty<Schema, Manifest extends GameTopologyManifest$1, BoardLike = never> = Schema extends {
|
|
1669
|
-
nullable: true;
|
|
1670
|
-
} ? BaseSchemaValueForProperty<Schema, Manifest, BoardLike> | null : BaseSchemaValueForProperty<Schema, Manifest, BoardLike>;
|
|
1671
|
-
type BuildTuple<Length extends number, Accumulator extends unknown[] = []> = Accumulator["length"] extends Length ? Accumulator : BuildTuple<Length, [...Accumulator, unknown]>;
|
|
1672
|
-
type EnumerateInternal<Length extends number, Accumulator extends number[] = []> = Accumulator["length"] extends Length ? Accumulator[number] : EnumerateInternal<Length, [...Accumulator, Accumulator["length"]]>;
|
|
1673
|
-
type AddOne<Count extends number> = [...BuildTuple<Count>, unknown]["length"] & number;
|
|
1674
|
-
type OneTo<Count extends number> = Exclude<EnumerateInternal<AddOne<Count>>, 0>;
|
|
1675
|
-
type PlayerId<Manifest extends GameTopologyManifest$1> = Manifest["players"]["maxPlayers"] extends infer MaxPlayers extends number ? `player-${OneTo<MaxPlayers>}` : `player-${number}`;
|
|
1676
|
-
type ToNumber<Input extends string> = Input extends `${infer Value extends number}` ? Value : never;
|
|
1677
|
-
type AbsoluteNumber<Count extends number> = `${Count}` extends `-${infer Value extends number}` ? Value : Count;
|
|
1678
|
-
type IsNegative<Count extends number> = `${Count}` extends `-${string}` ? true : false;
|
|
1679
|
-
type Negate<Count extends number> = Count extends 0 ? 0 : ToNumber<`${`${Count}` extends `-${infer Value extends number}` ? Value : `-${Count}`}`>;
|
|
1680
|
-
type AddPositive<Left extends number, Right extends number> = number extends Left | Right ? number : [...BuildTuple<Left>, ...BuildTuple<Right>]["length"] & number;
|
|
1681
|
-
type ComparePositive<Left extends number, Right extends number> = Left extends Right ? "equal" : number extends Left | Right ? "unknown" : BuildTuple<Left> extends [...BuildTuple<Right>, ...infer Rest] ? Rest extends [] ? "equal" : "greater" : "less";
|
|
1682
|
-
type SubtractPositive<Left extends number, Right extends number> = number extends Left | Right ? number : BuildTuple<Left> extends [...BuildTuple<Right>, ...infer Rest] ? Rest["length"] & number : never;
|
|
1683
|
-
type AddSigned<Left extends number, Right extends number> = number extends Left | Right ? number : IsNegative<Left> extends IsNegative<Right> ? IsNegative<Left> extends true ? Negate<AddPositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>>> : AddPositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>> : ComparePositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>> extends "equal" ? 0 : ComparePositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>> extends "greater" ? IsNegative<Left> extends true ? Negate<SubtractPositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>>> : SubtractPositive<AbsoluteNumber<Left>, AbsoluteNumber<Right>> : IsNegative<Right> extends true ? Negate<SubtractPositive<AbsoluteNumber<Right>, AbsoluteNumber<Left>>> : SubtractPositive<AbsoluteNumber<Right>, AbsoluteNumber<Left>>;
|
|
1684
|
-
type MultiplyByThree<Count extends number> = AddSigned<Count, AddSigned<Count, Count>>;
|
|
1685
|
-
type CharRank<Character extends string> = Character extends "," ? 0 : Character extends "-" ? 1 : Character extends "0" ? 2 : Character extends "1" ? 3 : Character extends "2" ? 4 : Character extends "3" ? 5 : Character extends "4" ? 6 : Character extends "5" ? 7 : Character extends "6" ? 8 : Character extends "7" ? 9 : Character extends "8" ? 10 : Character extends "9" ? 11 : never;
|
|
1686
|
-
type CompareCharacters<Left extends string, Right extends string> = Left extends Right ? "equal" : ComparePositive<CharRank<Left>, CharRank<Right>> extends "less" ? "less" : "greater";
|
|
1687
|
-
type CompareStrings<Left extends string, Right extends string> = Left extends `${infer LeftHead}${infer LeftTail}` ? Right extends `${infer RightHead}${infer RightTail}` ? LeftHead extends RightHead ? CompareStrings<LeftTail, RightTail> : CompareCharacters<LeftHead, RightHead> : "greater" : Right extends "" ? "equal" : "less";
|
|
1688
|
-
type SortPair<Left extends string, Right extends string> = CompareStrings<Left, Right> extends "greater" ? `${Right}::${Left}` : `${Left}::${Right}`;
|
|
1689
|
-
type SquareCornerGeometryKey<Space extends {
|
|
1690
|
-
row: number;
|
|
1691
|
-
col: number;
|
|
1692
|
-
}, Corner extends "nw" | "ne" | "se" | "sw"> = Corner extends "nw" ? `${Space["col"]},${Space["row"]}` : Corner extends "ne" ? `${AddSigned<Space["col"], 1>},${Space["row"]}` : Corner extends "se" ? `${AddSigned<Space["col"], 1>},${AddSigned<Space["row"], 1>}` : `${Space["col"]},${AddSigned<Space["row"], 1>}`;
|
|
1693
|
-
type SquareEdgeGeometryKey<Space extends {
|
|
1694
|
-
row: number;
|
|
1695
|
-
col: number;
|
|
1696
|
-
}, Side extends "north" | "east" | "south" | "west"> = Side extends "north" ? `${Space["col"]},${Space["row"]}::${AddSigned<Space["col"], 1>},${Space["row"]}` : Side extends "east" ? `${AddSigned<Space["col"], 1>},${Space["row"]}::${AddSigned<Space["col"], 1>},${AddSigned<Space["row"], 1>}` : Side extends "south" ? `${Space["col"]},${AddSigned<Space["row"], 1>}::${AddSigned<Space["col"], 1>},${AddSigned<Space["row"], 1>}` : `${Space["col"]},${Space["row"]}::${Space["col"]},${AddSigned<Space["row"], 1>}`;
|
|
1697
|
-
type HexCornerGeometryKey<Space extends {
|
|
1698
|
-
q: number;
|
|
1699
|
-
r: number;
|
|
1700
|
-
}, Corner extends "ne-e" | "e-se" | "se-sw" | "sw-w" | "w-nw" | "nw-ne"> = `${AddSigned<MultiplyByThree<Space["q"]>, Corner extends "ne-e" ? 2 : Corner extends "e-se" ? 1 : Corner extends "se-sw" ? -1 : Corner extends "sw-w" ? -2 : Corner extends "w-nw" ? -1 : 1>},${AddSigned<MultiplyByThree<Negate<AddSigned<Space["q"], Space["r"]>>>, Corner extends "ne-e" ? -1 : Corner extends "e-se" ? -2 : Corner extends "se-sw" ? -1 : Corner extends "sw-w" ? 1 : Corner extends "w-nw" ? 2 : 1>},${AddSigned<MultiplyByThree<Space["r"]>, Corner extends "ne-e" ? -1 : Corner extends "e-se" ? 1 : Corner extends "se-sw" ? 2 : Corner extends "sw-w" ? 1 : Corner extends "w-nw" ? -1 : -2>}`;
|
|
1701
|
-
type HexEdgeGeometryKey<Space extends {
|
|
1702
|
-
q: number;
|
|
1703
|
-
r: number;
|
|
1704
|
-
}, Side extends "e" | "ne" | "nw" | "w" | "sw" | "se"> = SortPair<HexCornerGeometryKey<Space, Side extends "e" ? "ne-e" : Side extends "ne" ? "nw-ne" : Side extends "nw" ? "w-nw" : Side extends "w" ? "sw-w" : Side extends "sw" ? "se-sw" : "e-se">, HexCornerGeometryKey<Space, Side extends "e" ? "e-se" : Side extends "ne" ? "ne-e" : Side extends "nw" ? "nw-ne" : Side extends "w" ? "w-nw" : Side extends "sw" ? "sw-w" : "se-sw">>;
|
|
1705
|
-
type DerivedSquareEdgeIdOf<BoardLike> = SquareSpaceOf<BoardLike> extends infer Space ? Space extends {
|
|
1706
|
-
row: number;
|
|
1707
|
-
col: number;
|
|
1708
|
-
} ? `square-edge:${SquareEdgeGeometryKey<Space, "north">}` | `square-edge:${SquareEdgeGeometryKey<Space, "east">}` | `square-edge:${SquareEdgeGeometryKey<Space, "south">}` | `square-edge:${SquareEdgeGeometryKey<Space, "west">}` : never : never;
|
|
1709
|
-
type DerivedSquareVertexIdOf<BoardLike> = SquareSpaceOf<BoardLike> extends infer Space ? Space extends {
|
|
1710
|
-
row: number;
|
|
1711
|
-
col: number;
|
|
1712
|
-
} ? `square-vertex:${SquareCornerGeometryKey<Space, "nw">}` | `square-vertex:${SquareCornerGeometryKey<Space, "ne">}` | `square-vertex:${SquareCornerGeometryKey<Space, "se">}` | `square-vertex:${SquareCornerGeometryKey<Space, "sw">}` : never : never;
|
|
1713
|
-
type DerivedHexEdgeIdOf<BoardLike> = HexSpaceOf<BoardLike> extends infer Space ? Space extends {
|
|
1714
|
-
q: number;
|
|
1715
|
-
r: number;
|
|
1716
|
-
} ? `hex-edge:${HexEdgeGeometryKey<Space, "e">}` | `hex-edge:${HexEdgeGeometryKey<Space, "ne">}` | `hex-edge:${HexEdgeGeometryKey<Space, "nw">}` | `hex-edge:${HexEdgeGeometryKey<Space, "w">}` | `hex-edge:${HexEdgeGeometryKey<Space, "sw">}` | `hex-edge:${HexEdgeGeometryKey<Space, "se">}` : never : never;
|
|
1717
|
-
type DerivedHexVertexIdOf<BoardLike> = HexSpaceOf<BoardLike> extends infer Space ? Space extends {
|
|
1718
|
-
q: number;
|
|
1719
|
-
r: number;
|
|
1720
|
-
} ? `hex-vertex:${HexCornerGeometryKey<Space, "ne-e">}` | `hex-vertex:${HexCornerGeometryKey<Space, "e-se">}` | `hex-vertex:${HexCornerGeometryKey<Space, "se-sw">}` | `hex-vertex:${HexCornerGeometryKey<Space, "sw-w">}` | `hex-vertex:${HexCornerGeometryKey<Space, "w-nw">}` | `hex-vertex:${HexCornerGeometryKey<Space, "nw-ne">}` : never : never;
|
|
1721
|
-
type DerivedEdgeIdOf<BoardLike> = BoardLike extends {
|
|
1722
|
-
layout: "square";
|
|
1723
|
-
} ? DerivedSquareEdgeIdOf<BoardLike> : BoardLike extends {
|
|
1724
|
-
layout: "hex";
|
|
1725
|
-
} ? DerivedHexEdgeIdOf<BoardLike> : never;
|
|
1726
|
-
type DerivedVertexIdOf<BoardLike> = BoardLike extends {
|
|
1727
|
-
layout: "square";
|
|
1728
|
-
} ? DerivedSquareVertexIdOf<BoardLike> : BoardLike extends {
|
|
1729
|
-
layout: "hex";
|
|
1730
|
-
} ? DerivedHexVertexIdOf<BoardLike> : never;
|
|
1731
|
-
type SetupOptionChoiceId<Option> = IdsOf<Option extends {
|
|
1732
|
-
choices?: infer Choices;
|
|
1733
|
-
} ? Choices : never>;
|
|
1734
|
-
type SetupOptionOf<Manifest extends GameTopologyManifest$1> = ArrayItem<NonNullable<Manifest["setupOptions"]>>;
|
|
1735
|
-
type SetupOptionChoiceIdFor<Manifest extends GameTopologyManifest$1, OptionId extends SetupOptionId<Manifest>> = SetupOptionChoiceId<Extract<SetupOptionOf<Manifest>, {
|
|
1736
|
-
id: OptionId;
|
|
1737
|
-
}>>;
|
|
1738
|
-
type TypedSharedSpaceHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1739
|
-
[CurrentBoardId in SharedBoardId<Manifest>]: {
|
|
1740
|
-
type: "space";
|
|
1741
|
-
boardId: CurrentBoardId;
|
|
1742
|
-
spaceId: SpaceIdForBoard<Manifest, CurrentBoardId>;
|
|
1743
|
-
};
|
|
1744
|
-
}[SharedBoardId<Manifest>];
|
|
1745
|
-
type TypedPerPlayerSpaceHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1746
|
-
[CurrentBoardId in PerPlayerBoardId<Manifest>]: {
|
|
1747
|
-
type: "space";
|
|
1748
|
-
boardId: CurrentBoardId;
|
|
1749
|
-
spaceId: SpaceIdForBoard<Manifest, CurrentBoardId>;
|
|
1750
|
-
};
|
|
1751
|
-
}[PerPlayerBoardId<Manifest>];
|
|
1752
|
-
type TypedSharedContainerHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1753
|
-
[CurrentBoardId in SharedBoardId<Manifest>]: {
|
|
1754
|
-
type: "container";
|
|
1755
|
-
boardId: CurrentBoardId;
|
|
1756
|
-
containerId: ContainerIdForBoard<Manifest, CurrentBoardId>;
|
|
1757
|
-
};
|
|
1758
|
-
}[SharedBoardId<Manifest>];
|
|
1759
|
-
type TypedPerPlayerContainerHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1760
|
-
[CurrentBoardId in PerPlayerBoardId<Manifest>]: {
|
|
1761
|
-
type: "container";
|
|
1762
|
-
boardId: CurrentBoardId;
|
|
1763
|
-
containerId: ContainerIdForBoard<Manifest, CurrentBoardId>;
|
|
1764
|
-
};
|
|
1765
|
-
}[PerPlayerBoardId<Manifest>];
|
|
1766
|
-
type TypedSharedEdgeHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1767
|
-
[CurrentBoardId in SharedBoardId<Manifest>]: {
|
|
1768
|
-
type: "edge";
|
|
1769
|
-
boardId: CurrentBoardId;
|
|
1770
|
-
ref: BoardEdgeRef;
|
|
1771
|
-
};
|
|
1772
|
-
}[SharedBoardId<Manifest>];
|
|
1773
|
-
type TypedPerPlayerEdgeHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1774
|
-
[CurrentBoardId in PerPlayerBoardId<Manifest>]: {
|
|
1775
|
-
type: "edge";
|
|
1776
|
-
boardId: CurrentBoardId;
|
|
1777
|
-
ref: BoardEdgeRef;
|
|
1778
|
-
};
|
|
1779
|
-
}[PerPlayerBoardId<Manifest>];
|
|
1780
|
-
type TypedSharedVertexHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1781
|
-
[CurrentBoardId in SharedBoardId<Manifest>]: {
|
|
1782
|
-
type: "vertex";
|
|
1783
|
-
boardId: CurrentBoardId;
|
|
1784
|
-
ref: BoardVertexRef;
|
|
1785
|
-
};
|
|
1786
|
-
}[SharedBoardId<Manifest>];
|
|
1787
|
-
type TypedPerPlayerVertexHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1788
|
-
[CurrentBoardId in PerPlayerBoardId<Manifest>]: {
|
|
1789
|
-
type: "vertex";
|
|
1790
|
-
boardId: CurrentBoardId;
|
|
1791
|
-
ref: BoardVertexRef;
|
|
1792
|
-
};
|
|
1793
|
-
}[PerPlayerBoardId<Manifest>];
|
|
1794
|
-
type TypedSharedZoneHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1795
|
-
type: "zone";
|
|
1796
|
-
zoneId: SharedZoneId<Manifest>;
|
|
1797
|
-
};
|
|
1798
|
-
type TypedPerPlayerZoneHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1799
|
-
type: "zone";
|
|
1800
|
-
zoneId: PerPlayerZoneId<Manifest>;
|
|
1801
|
-
};
|
|
1802
|
-
type TypedPlayerScopedComponentHomeSpec<Manifest extends GameTopologyManifest$1> = TypedPerPlayerZoneHomeSpec<Manifest> | TypedPerPlayerSpaceHomeSpec<Manifest> | TypedPerPlayerContainerHomeSpec<Manifest> | TypedPerPlayerEdgeHomeSpec<Manifest> | TypedPerPlayerVertexHomeSpec<Manifest>;
|
|
1803
|
-
type TypedSharedComponentHomeSpec<Manifest extends GameTopologyManifest$1> = {
|
|
1804
|
-
type: "detached";
|
|
1805
|
-
} | TypedSharedZoneHomeSpec<Manifest> | TypedSharedSpaceHomeSpec<Manifest> | TypedSharedContainerHomeSpec<Manifest> | TypedSharedEdgeHomeSpec<Manifest> | TypedSharedVertexHomeSpec<Manifest> | TypedPieceSlotHomeSpec<Manifest> | TypedDieSlotHomeSpec<Manifest>;
|
|
1806
|
-
type TypedComponentHomeSpec<Manifest extends GameTopologyManifest$1> = TypedSharedComponentHomeSpec<Manifest> | TypedPlayerScopedComponentHomeSpec<Manifest>;
|
|
1807
|
-
type TypedSeedLocationSpec<Seed, Manifest extends GameTopologyManifest$1> = Seed extends {
|
|
1808
|
-
home: infer Home;
|
|
1809
|
-
} ? Home extends TypedPlayerScopedComponentHomeSpec<Manifest> ? Omit<Seed, "ownerId" | "home"> & {
|
|
1810
|
-
ownerId: PlayerId<Manifest>;
|
|
1811
|
-
home: TypedPlayerScopedComponentHomeSpec<Manifest>;
|
|
1812
|
-
} : Omit<Seed, "ownerId" | "home"> & {
|
|
1813
|
-
ownerId?: PlayerId<Manifest>;
|
|
1814
|
-
home?: TypedComponentHomeSpec<Manifest>;
|
|
1815
|
-
} : Omit<Seed, "ownerId" | "home"> & {
|
|
1816
|
-
ownerId?: PlayerId<Manifest>;
|
|
1817
|
-
home?: TypedComponentHomeSpec<Manifest>;
|
|
1818
|
-
};
|
|
1819
|
-
type TypedVisibilitySpec<Manifest extends GameTopologyManifest$1> = {
|
|
1820
|
-
faceUp?: boolean;
|
|
1821
|
-
visibleTo?: readonly PlayerId<Manifest>[];
|
|
1822
|
-
};
|
|
1823
|
-
type TypedVisibility<T, Manifest extends GameTopologyManifest$1> = T extends {
|
|
1824
|
-
visibility?: unknown;
|
|
1825
|
-
} ? Omit<T, "visibility"> & {
|
|
1826
|
-
visibility?: TypedVisibilitySpec<Manifest>;
|
|
1827
|
-
} : T;
|
|
1828
|
-
type TypedFields<T, Schema, Manifest extends GameTopologyManifest$1, BoardLike = never> = T extends {
|
|
1829
|
-
fields?: unknown;
|
|
1830
|
-
} ? Omit<T, "fields"> & {
|
|
1831
|
-
fields?: SchemaValueForObjectSchema<Schema, Manifest, BoardLike>;
|
|
1832
|
-
} : T;
|
|
1833
|
-
type TypedBoardContainerHost<Host, BoardLike> = Host extends {
|
|
1834
|
-
type: "space";
|
|
1835
|
-
spaceId: string;
|
|
1836
|
-
} ? Omit<Host, "spaceId"> & {
|
|
1837
|
-
spaceId: SpaceIdOf<BoardLike>;
|
|
1838
|
-
} : Host;
|
|
1839
|
-
type TypedBoardContainer<Container, Manifest extends GameTopologyManifest$1, BoardLike, ContainerSchema> = Container extends {
|
|
1840
|
-
host: infer Host;
|
|
1841
|
-
} ? Omit<TypedFields<TypedAllowedCardSetIds<Container, Manifest>, ContainerSchema, Manifest, BoardLike>, "host"> & {
|
|
1842
|
-
host: TypedBoardContainerHost<Host, BoardLike>;
|
|
1843
|
-
} : TypedFields<TypedAllowedCardSetIds<Container, Manifest>, ContainerSchema, Manifest, BoardLike>;
|
|
1844
|
-
type TypedBoardRelation<Relation, Manifest extends GameTopologyManifest$1, BoardLike, RelationSchema> = Relation extends object ? Omit<TypedFields<Relation, RelationSchema, Manifest, BoardLike>, "fromSpaceId" | "toSpaceId"> & {
|
|
1845
|
-
fromSpaceId: SpaceIdOf<BoardLike>;
|
|
1846
|
-
toSpaceId: SpaceIdOf<BoardLike>;
|
|
1847
|
-
} : Relation;
|
|
1848
|
-
type TypedOptionalArray<Base, Source, Key extends string, Item> = Source extends {
|
|
1849
|
-
[Property in Key]?: readonly unknown[];
|
|
1850
|
-
} ? Base & {
|
|
1851
|
-
[Property in Key]?: ReadonlyArray<Item>;
|
|
1852
|
-
} : Base;
|
|
1853
|
-
type EffectiveSchemaForEntry<Manifest extends GameTopologyManifest$1, Entry, Key extends string> = Key extends keyof Entry ? Entry[Key] : TemplateForBoardEntry<Manifest, Entry> extends infer Template ? Key extends keyof Template ? Template[Key] : undefined : undefined;
|
|
1854
|
-
type TypedGenericBoardLike<Entry, Manifest extends GameTopologyManifest$1, BoardLike> = TypedOptionalArray<TypedOptionalArray<TypedOptionalArray<TypedFields<Omit<Entry, "spaces" | "relations" | "containers">, EffectiveSchemaForEntry<Manifest, Entry, "boardFieldsSchema">, Manifest, BoardLike>, Entry, "spaces", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1855
|
-
spaces?: infer Spaces;
|
|
1856
|
-
} ? Spaces : never>>, EffectiveSchemaForEntry<Manifest, Entry, "spaceFieldsSchema">, Manifest, BoardLike>>, Entry, "relations", TypedBoardRelation<ArrayItem<NonNullable<Entry extends {
|
|
1857
|
-
relations?: infer Relations;
|
|
1858
|
-
} ? Relations : never>>, Manifest, BoardLike, EffectiveSchemaForEntry<Manifest, Entry, "relationFieldsSchema">>>, Entry, "containers", TypedBoardContainer<ArrayItem<NonNullable<Entry extends {
|
|
1859
|
-
containers?: infer Containers;
|
|
1860
|
-
} ? Containers : never>>, Manifest, BoardLike, EffectiveSchemaForEntry<Manifest, Entry, "containerFieldsSchema">>>;
|
|
1861
|
-
type TypedHexBoardLike<Entry, Manifest extends GameTopologyManifest$1, BoardLike> = TypedOptionalArray<TypedOptionalArray<TypedOptionalArray<TypedFields<Omit<Entry, "spaces" | "edges" | "vertices">, EffectiveSchemaForEntry<Manifest, Entry, "boardFieldsSchema">, Manifest, BoardLike>, Entry, "spaces", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1862
|
-
spaces?: infer Spaces;
|
|
1863
|
-
} ? Spaces : never>>, EffectiveSchemaForEntry<Manifest, Entry, "spaceFieldsSchema">, Manifest, BoardLike>>, Entry, "edges", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1864
|
-
edges?: infer Edges;
|
|
1865
|
-
} ? Edges : never>>, EffectiveSchemaForEntry<Manifest, Entry, "edgeFieldsSchema">, Manifest, BoardLike>>, Entry, "vertices", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1866
|
-
vertices?: infer Vertices;
|
|
1867
|
-
} ? Vertices : never>>, EffectiveSchemaForEntry<Manifest, Entry, "vertexFieldsSchema">, Manifest, BoardLike>>;
|
|
1868
|
-
type TypedSquareBoardLike<Entry, Manifest extends GameTopologyManifest$1, BoardLike> = TypedOptionalArray<TypedOptionalArray<TypedOptionalArray<TypedOptionalArray<TypedOptionalArray<TypedFields<Omit<Entry, "spaces" | "relations" | "containers" | "edges" | "vertices">, EffectiveSchemaForEntry<Manifest, Entry, "boardFieldsSchema">, Manifest, BoardLike>, Entry, "spaces", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1869
|
-
spaces?: infer Spaces;
|
|
1870
|
-
} ? Spaces : never>>, EffectiveSchemaForEntry<Manifest, Entry, "spaceFieldsSchema">, Manifest, BoardLike>>, Entry, "relations", TypedBoardRelation<ArrayItem<NonNullable<Entry extends {
|
|
1871
|
-
relations?: infer Relations;
|
|
1872
|
-
} ? Relations : never>>, Manifest, BoardLike, EffectiveSchemaForEntry<Manifest, Entry, "relationFieldsSchema">>>, Entry, "containers", TypedBoardContainer<ArrayItem<NonNullable<Entry extends {
|
|
1873
|
-
containers?: infer Containers;
|
|
1874
|
-
} ? Containers : never>>, Manifest, BoardLike, EffectiveSchemaForEntry<Manifest, Entry, "containerFieldsSchema">>>, Entry, "edges", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1875
|
-
edges?: infer Edges;
|
|
1876
|
-
} ? Edges : never>>, EffectiveSchemaForEntry<Manifest, Entry, "edgeFieldsSchema">, Manifest, BoardLike>>, Entry, "vertices", TypedFields<ArrayItem<NonNullable<Entry extends {
|
|
1877
|
-
vertices?: infer Vertices;
|
|
1878
|
-
} ? Vertices : never>>, EffectiveSchemaForEntry<Manifest, Entry, "vertexFieldsSchema">, Manifest, BoardLike>>;
|
|
1879
|
-
type TypedBoardLikeEntry<Entry, Manifest extends GameTopologyManifest$1> = Entry extends {
|
|
1880
|
-
layout: "generic";
|
|
1881
|
-
} ? TypedGenericBoardLike<Entry, Manifest, BoardLikeForEntry<Manifest, Entry>> : Entry extends {
|
|
1882
|
-
layout: "hex";
|
|
1883
|
-
} ? TypedHexBoardLike<Entry, Manifest, BoardLikeForEntry<Manifest, Entry>> : Entry extends {
|
|
1884
|
-
layout: "square";
|
|
1885
|
-
} ? TypedSquareBoardLike<Entry, Manifest, BoardLikeForEntry<Manifest, Entry>> : Entry;
|
|
1886
|
-
type TypedCard<Card, Manifest extends GameTopologyManifest$1, CardSchema> = Card extends {
|
|
1887
|
-
type: infer CardType extends string;
|
|
1888
|
-
} ? Omit<TypedVisibility<Card, Manifest>, "home" | "properties"> & {
|
|
1889
|
-
home?: TypedComponentHomeSpec<Manifest>;
|
|
1890
|
-
properties: CardSchema extends {
|
|
1891
|
-
variants: infer Variants extends Record<string, unknown>;
|
|
1892
|
-
shared?: infer Shared;
|
|
1893
|
-
} ? CardType extends keyof Variants ? SchemaValueForObjectSchema<MergeSharedProperties<Variants[CardType], Shared>, Manifest> : never : SchemaValueForObjectSchema<CardSchema, Manifest>;
|
|
1894
|
-
} : Card;
|
|
1895
|
-
type TypedCardSet<CardSet, Manifest extends GameTopologyManifest$1> = CardSet extends {
|
|
1896
|
-
type: "manual";
|
|
1897
|
-
cardSchema: infer CardSchema;
|
|
1898
|
-
cards: infer Cards extends readonly unknown[];
|
|
1899
|
-
} ? Omit<CardSet, "cards" | "defaultHome"> & {
|
|
1900
|
-
defaultHome: TypedComponentHomeSpec<Manifest>;
|
|
1901
|
-
cards: ReadonlyArray<TypedCard<ArrayItem<Cards>, Manifest, CardSchema>>;
|
|
1902
|
-
} : CardSet;
|
|
1903
|
-
type TypedAllowedCardSetIds<T, Manifest extends GameTopologyManifest$1> = T extends object ? Omit<T, "allowedCardSetIds"> & {
|
|
1904
|
-
allowedCardSetIds?: readonly CardSetId<Manifest>[];
|
|
1905
|
-
} : T;
|
|
1906
|
-
type TypedZone<Zone, Manifest extends GameTopologyManifest$1> = TypedAllowedCardSetIds<Zone, Manifest>;
|
|
1907
|
-
type TypedPieceSeed<Seed, Manifest extends GameTopologyManifest$1> = Seed extends {
|
|
1908
|
-
typeId: infer CurrentTypeId;
|
|
1909
|
-
} ? CurrentTypeId extends PieceTypeId<Manifest> ? Omit<TypedSeedLocationSpec<TypedVisibility<Seed, Manifest>, Manifest>, "typeId" | "ownerId" | "home" | "fields"> & {
|
|
1910
|
-
typeId: CurrentTypeId;
|
|
1911
|
-
fields?: SchemaValueForObjectSchema<PieceTypeOf<Manifest, CurrentTypeId> extends {
|
|
1912
|
-
fieldsSchema?: infer FieldsSchema;
|
|
1913
|
-
} ? FieldsSchema : undefined, Manifest>;
|
|
1914
|
-
} & Pick<TypedSeedLocationSpec<TypedVisibility<Seed, Manifest>, Manifest>, "ownerId" | "home"> : Omit<Seed, "typeId"> & {
|
|
1915
|
-
typeId: PieceTypeId<Manifest>;
|
|
1916
|
-
} : never;
|
|
1917
|
-
type TypedDieSeed<Seed, Manifest extends GameTopologyManifest$1> = Seed extends {
|
|
1918
|
-
typeId: infer CurrentTypeId;
|
|
1919
|
-
} ? CurrentTypeId extends DieTypeId<Manifest> ? Omit<TypedSeedLocationSpec<TypedVisibility<Seed, Manifest>, Manifest>, "typeId" | "ownerId" | "home" | "fields"> & {
|
|
1920
|
-
typeId: CurrentTypeId;
|
|
1921
|
-
fields?: SchemaValueForObjectSchema<DieTypeOf<Manifest, CurrentTypeId> extends {
|
|
1922
|
-
fieldsSchema?: infer FieldsSchema;
|
|
1923
|
-
} ? FieldsSchema : undefined, Manifest>;
|
|
1924
|
-
} & Pick<TypedSeedLocationSpec<TypedVisibility<Seed, Manifest>, Manifest>, "ownerId" | "home"> : Omit<Seed, "typeId"> & {
|
|
1925
|
-
typeId: DieTypeId<Manifest>;
|
|
1926
|
-
} : never;
|
|
1927
|
-
type TypedSetupOptionValues<Manifest extends GameTopologyManifest$1> = Partial<{
|
|
1928
|
-
[OptionId in SetupOptionId<Manifest>]: SetupOptionChoiceIdFor<Manifest, OptionId>;
|
|
1929
|
-
}>;
|
|
1930
|
-
type TypedSetupProfile<Profile, Manifest extends GameTopologyManifest$1> = Profile extends object ? Omit<Profile, "optionValues"> & {
|
|
1931
|
-
optionValues?: TypedSetupOptionValues<Manifest>;
|
|
1932
|
-
} : Profile;
|
|
1933
|
-
type TypedTopologyManifest<Manifest extends GameTopologyManifest$1> = Omit<Manifest, "cardSets" | "zones" | "boardTemplates" | "boards" | "pieceSeeds" | "dieSeeds" | "setupProfiles"> & {
|
|
1934
|
-
cardSets: ReadonlyArray<TypedCardSet<ArrayItem<Manifest["cardSets"]>, Manifest>>;
|
|
1935
|
-
zones?: Manifest["zones"] extends readonly unknown[] ? ReadonlyArray<TypedZone<ArrayItem<Manifest["zones"]>, Manifest>> : Manifest["zones"];
|
|
1936
|
-
boardTemplates?: Manifest["boardTemplates"] extends readonly unknown[] ? ReadonlyArray<TypedBoardLikeEntry<ArrayItem<Manifest["boardTemplates"]>, Manifest>> : Manifest["boardTemplates"];
|
|
1937
|
-
boards: Manifest["boards"] extends readonly unknown[] ? ReadonlyArray<TypedBoardLikeEntry<ArrayItem<Manifest["boards"]>, Manifest>> : Manifest["boards"];
|
|
1938
|
-
pieceSeeds?: Manifest["pieceSeeds"] extends readonly unknown[] ? ReadonlyArray<TypedPieceSeed<ArrayItem<Manifest["pieceSeeds"]>, Manifest>> : Manifest["pieceSeeds"];
|
|
1939
|
-
dieSeeds?: Manifest["dieSeeds"] extends readonly unknown[] ? ReadonlyArray<TypedDieSeed<ArrayItem<Manifest["dieSeeds"]>, Manifest>> : Manifest["dieSeeds"];
|
|
1940
|
-
setupProfiles?: Manifest["setupProfiles"] extends readonly unknown[] ? ReadonlyArray<TypedSetupProfile<ArrayItem<Manifest["setupProfiles"]>, Manifest>> : Manifest["setupProfiles"];
|
|
1941
|
-
};
|
|
1942
|
-
type TopologyManifestValidation<Manifest> = Manifest extends GameTopologyManifest$1 ? TypedTopologyManifest<Manifest> : GameTopologyManifest$1;
|
|
1943
|
-
type DefinedTopologyManifest<Manifest> = Manifest extends GameTopologyManifest$1 ? Manifest : GameTopologyManifest$1;
|
|
1944
|
-
declare function defineTopologyManifest<const Manifest>(manifest: Manifest & TopologyManifestValidation<NoInfer<Manifest>>): DefinedTopologyManifest<Manifest>;
|
|
1945
|
-
|
|
1946
|
-
type RecordInitializer<Id extends string, Value> = Value | ((id: Id) => Value);
|
|
1947
|
-
declare function buildTypedRecord<Id extends string, Value>(ids: readonly Id[], initial: RecordInitializer<Id, Value>): Record<Id, Value>;
|
|
1948
|
-
declare function isTypedId<Id extends string>(ids: readonly Id[], value: string): value is Id;
|
|
1949
|
-
declare function expectTypedId<Id extends string>(ids: readonly Id[], value: string, description: string): Id;
|
|
1950
|
-
|
|
1951
|
-
type DieTypeSpec = Omit<DieTypeSpec$2, "sides"> & {
|
|
1952
|
-
sides?: DieTypeSpec$2["sides"];
|
|
1953
|
-
};
|
|
1954
|
-
type GameTopologyManifest = Omit<GameTopologyManifest$2, "dieTypes"> & {
|
|
1955
|
-
dieTypes?: Array<DieTypeSpec>;
|
|
1956
|
-
};
|
|
1957
|
-
|
|
1958
|
-
export { type ActionDefinition, type ActionInteractionDescriptor, type ActionParameterDefinition, type AvailableInteractionAvailability, type BlockedInteractionAvailability, type BoardCard, type BoardContainerHostSpec, type BoardContainerSpec, type BoardEdgeRef, type BoardHostSpec, type BoardLayout, type BoardRelationSpec, type BoardSpaceSpec, type BoardSpec, type BoardTargetDomain, type BoardTemplateSpec, type BoardVertexRef, type BoundedNumberDomain, type CardCollection, type CardPropertySchema, type CardPropertySchemaVariants, type CardSetDefinition, type CardSetSourceType, type CardTargetDomain, type ChoiceDomain, type ChoiceDomainOption, type ChoiceListDomain, type ComponentHomeSpec, type ComponentSlotSpec, type ComponentVisibilitySpec, type ContainerHomeSpec, type DetachedHomeSpec, type DieSeedSpec, type DieSlotHostRef, type DieTypeSpec, type EagerInputDomainDependencies, type EdgeHomeSpec, type GameTopologyManifest, type GenericBoardSpec, type GenericBoardTemplateSpec, type HexBoardSpec, type HexBoardTemplateSpec, type HexEdgeRef, type HexEdgeSpec, type HexOrientation, type HexSpaceSpec, type HexVertexRef, type HexVertexSpec, type HistoryEntrySummary, type HostActionSubmitResponse, type HostEndedSessionSnapshot, type HostGameplaySeatView, type HostGameplaySessionSnapshot, type HostGameplaySharedView, type HostLobbySessionSnapshot, type HostLobbyView, type HostPlayerGameplayView, type HostSessionContext, type HostSessionEventCausation, type HostSessionGameplayUpdatedEvent, type HostSessionSnapshot, type HostSessionStatus, type InputDomain, type InputDomainDependencyCase, type InputDomainResolver, type InputSelection, type InsufficientResourcesInteractionAvailability, type InteractionAvailability, type InteractionCommitPolicy, type InteractionContext, type InteractionContextOption, type InteractionDescriptor, type InteractionDescriptorBase, type InteractionInputDescriptor, type JsonValue, type LazyBoardTargetDomain, type LazyCardTargetDomain, type LazyInputDomainDependencies, type ManualCardSetDefinition, type ManyInputSelection, type NotYourTurnInteractionAvailability, type ObjectSchema, type ParameterType, type PieceSeedSpec, type PieceSlotHostRef, type PieceTypeSpec, type PlayerId$1 as PlayerId, type PlayersDefinition, type PresetCardSetDefinition, type PromptInteractionDescriptor, type PropertySchema, type ResolvedBoardTargetDomain, type ResolvedCardTargetDomain, type ResourceDefinition, type ResourceMapDomain, type ResourceMapDomainEntry, type SeatAssignment, type SessionActor, type SessionActorAuthUser, type SessionActorDemoGuest, type SessionGameSource, type SessionGameSourceDemoRevision, type SessionGameSourceUserCompiled, type SessionSnapshotHistory, type SessionSnapshotPhase, type SetupOptionChoiceSpec, type SetupOptionSpec, type SetupProfileSpec, type SimultaneousPhaseSnapshot, type SingleInputSelection, type SlotHomeSpec, type SlotHostRef, type SpaceHomeSpec, type SpaceHostSpec, type SquareBoardSpec, type SquareBoardTemplateSpec, type SquareEdgeSpec, type SquareSpaceSpec, type SquareVertexSpec, type TopologyScope, type TypedTopologyManifest, type VertexHomeSpec, type ViewCard, type ViewSlotOccupant, type ZoneHandles, type ZoneHomeSpec, type ZoneSpec, type ZoneVisibility, buildTypedRecord, defineTopologyManifest, expectTypedId, isTypedId };
|