@dreamboard-games/ui-sdk 0.0.43 → 0.0.45
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/dist/components/ActionButton.d.ts.map +1 -1
- package/dist/components/ActionButton.js +2 -1
- package/dist/components/Card.d.ts +1 -1
- package/dist/components/Card.d.ts.map +1 -1
- package/dist/components/DiceRoller.d.ts +3 -2
- package/dist/components/DiceRoller.d.ts.map +1 -1
- package/dist/components/DiceRoller.js +4 -13
- package/dist/components/ErrorBoundary.d.ts.map +1 -1
- package/dist/components/ErrorBoundary.js +94 -2
- package/dist/components/InteractionForm.d.ts +1 -1
- package/dist/components/InteractionForm.d.ts.map +1 -1
- package/dist/components/InteractionForm.js +29 -15
- package/dist/components/PrimaryActionButton.d.ts.map +1 -1
- package/dist/components/PrimaryActionButton.js +7 -6
- package/dist/components/ResourceCounter.d.ts +59 -25
- package/dist/components/ResourceCounter.d.ts.map +1 -1
- package/dist/components/ResourceCounter.js +106 -115
- package/dist/components/Toast.d.ts +13 -6
- package/dist/components/Toast.d.ts.map +1 -1
- package/dist/components/Toast.js +10 -5
- package/dist/components/board/HexGrid.js +6 -6
- package/dist/components/board/target-layer.d.ts +18 -2
- package/dist/components/board/target-layer.d.ts.map +1 -1
- package/dist/components/board/target-layer.js +20 -3
- package/dist/components/index.d.ts +3 -4
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +3 -4
- package/dist/components/surfaces/InboxSurface.d.ts.map +1 -1
- package/dist/components/surfaces/InboxSurface.js +2 -6
- package/dist/components/surfaces/PlayerCardsSurface.js +2 -2
- package/dist/components/surfaces/internal/CardZoneRoutedForm.d.ts +7 -0
- package/dist/components/surfaces/internal/CardZoneRoutedForm.d.ts.map +1 -0
- package/dist/components/surfaces/internal/CardZoneRoutedForm.js +9 -0
- package/dist/components/surfaces/internal/DefaultInteractionButton.d.ts.map +1 -1
- package/dist/components/surfaces/internal/DefaultInteractionButton.js +5 -8
- package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts +2 -2
- package/dist/components/surfaces/internal/useCardZoneInteractions.d.ts.map +1 -1
- package/dist/components/surfaces/internal/useCardZoneInteractions.js +19 -43
- package/dist/context/InteractionDraftContext.d.ts +11 -2
- package/dist/context/InteractionDraftContext.d.ts.map +1 -1
- package/dist/context/InteractionDraftContext.js +41 -4
- package/dist/defaults/components.d.ts +0 -5
- package/dist/defaults/components.d.ts.map +1 -1
- package/dist/defaults/components.js +7 -11
- package/dist/hooks/useBoardInteractions.d.ts +35 -12
- package/dist/hooks/useBoardInteractions.d.ts.map +1 -1
- package/dist/hooks/useBoardInteractions.js +186 -82
- package/dist/hooks/useInteractionHandle.d.ts +1 -1
- package/dist/hooks/useInteractionHandle.d.ts.map +1 -1
- package/dist/hooks/useInteractionHandle.js +12 -27
- package/dist/index.d.ts +11 -17
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -14
- package/dist/primitives/board.d.ts +53 -3
- package/dist/primitives/board.d.ts.map +1 -1
- package/dist/primitives/board.js +65 -41
- package/dist/primitives/dialog-lifecycle.d.ts +17 -0
- package/dist/primitives/dialog-lifecycle.d.ts.map +1 -0
- package/dist/primitives/dialog-lifecycle.js +24 -0
- package/dist/primitives/dice.d.ts +31 -0
- package/dist/primitives/dice.d.ts.map +1 -0
- package/dist/primitives/dice.js +33 -0
- package/dist/primitives/game.d.ts +55 -0
- package/dist/primitives/game.d.ts.map +1 -0
- package/dist/primitives/game.js +101 -0
- package/dist/primitives/index.d.ts +7 -4
- package/dist/primitives/index.d.ts.map +1 -1
- package/dist/primitives/index.js +7 -4
- package/dist/primitives/interaction-form-binding.d.ts +12 -0
- package/dist/primitives/interaction-form-binding.d.ts.map +1 -0
- package/dist/primitives/interaction-form-binding.js +14 -0
- package/dist/primitives/interaction-submit.d.ts +23 -0
- package/dist/primitives/interaction-submit.d.ts.map +1 -0
- package/dist/primitives/interaction-submit.js +41 -0
- package/dist/primitives/interaction.d.ts +76 -6
- package/dist/primitives/interaction.d.ts.map +1 -1
- package/dist/primitives/interaction.js +210 -26
- package/dist/primitives/player-roster.d.ts +2 -1
- package/dist/primitives/player-roster.d.ts.map +1 -1
- package/dist/primitives/prompt.d.ts +36 -11
- package/dist/primitives/prompt.d.ts.map +1 -1
- package/dist/primitives/prompt.js +29 -17
- package/dist/primitives/ui.d.ts +9 -0
- package/dist/primitives/ui.d.ts.map +1 -0
- package/dist/primitives/ui.js +7 -0
- package/dist/primitives/zone.d.ts +111 -5
- package/dist/primitives/zone.d.ts.map +1 -1
- package/dist/primitives/zone.js +349 -9
- package/dist/reducer.d.ts +2 -14
- package/dist/reducer.d.ts.map +1 -1
- package/dist/reducer.js +1 -14
- package/dist/runtime/createPluginRuntimeAPI.js +1 -1
- package/dist/types/hex-color.d.ts +7 -0
- package/dist/types/hex-color.d.ts.map +1 -0
- package/dist/types/hex-color.js +13 -0
- package/dist/types/player-state.d.ts +28 -14
- package/dist/types/player-state.d.ts.map +1 -1
- package/dist/types/plugin-state.d.ts +9 -3
- package/dist/types/plugin-state.d.ts.map +1 -1
- package/dist/ui-contract.d.ts +119 -14
- package/dist/ui-contract.d.ts.map +1 -1
- package/dist/ui-contract.js +4 -3
- package/dist/ui-sdk.d.ts +1637 -1245
- package/dist/utils/interaction-inputs.d.ts +8 -5
- package/dist/utils/interaction-inputs.d.ts.map +1 -1
- package/dist/utils/interaction-inputs.js +82 -14
- package/dist/utils/interaction-router.d.ts +31 -0
- package/dist/utils/interaction-router.d.ts.map +1 -0
- package/dist/utils/interaction-router.js +114 -0
- package/package.json +1 -1
- package/src/components/ActionButton.tsx +2 -1
- package/src/components/Card.tsx +1 -1
- package/src/components/DiceRoller.tsx +13 -22
- package/src/components/ErrorBoundary.test.tsx +19 -0
- package/src/components/ErrorBoundary.tsx +113 -24
- package/src/components/InteractionForm.test.tsx +24 -0
- package/src/components/InteractionForm.tsx +48 -23
- package/src/components/PrimaryActionButton.tsx +19 -5
- package/src/components/ResourceCounter.test.tsx +13 -13
- package/src/components/ResourceCounter.tsx +238 -244
- package/src/components/Toast.tsx +23 -10
- package/src/components/__fixtures__/ResourceCounter.fixture.tsx +70 -169
- package/src/components/board/HexGrid.tsx +6 -6
- package/src/components/board/target-layer.ts +44 -5
- package/src/components/index.ts +17 -10
- package/src/components/surfaces/InboxSurface.tsx +7 -5
- package/src/components/surfaces/PlayerCardsSurface.tsx +6 -6
- package/src/components/surfaces/internal/CardZoneRoutedForm.tsx +35 -0
- package/src/components/surfaces/internal/DefaultInteractionButton.tsx +17 -7
- package/src/components/surfaces/internal/useCardZoneInteractions.ts +25 -67
- package/src/context/InteractionDraftContext.tsx +51 -5
- package/src/defaults/components.tsx +12 -50
- package/src/defaults/defaults.test.tsx +1 -50
- package/src/hooks/useBoardInteractions.test.tsx +240 -17
- package/src/hooks/useBoardInteractions.ts +330 -105
- package/src/hooks/useInteractionHandle.ts +23 -28
- package/src/index.test.ts +60 -40
- package/src/index.ts +30 -36
- package/src/primitives/board.test.tsx +73 -0
- package/src/primitives/board.tsx +191 -40
- package/src/primitives/dialog-lifecycle.ts +58 -0
- package/src/primitives/dice.test.tsx +47 -0
- package/src/primitives/dice.tsx +79 -0
- package/src/primitives/game.test.tsx +98 -0
- package/src/primitives/game.tsx +213 -0
- package/src/primitives/index.ts +84 -0
- package/src/primitives/interaction-form-binding.tsx +56 -0
- package/src/primitives/interaction-submit.ts +90 -0
- package/src/primitives/interaction.test.tsx +396 -0
- package/src/primitives/interaction.tsx +451 -31
- package/src/primitives/player-roster.tsx +2 -1
- package/src/primitives/prompt.test.tsx +94 -3
- package/src/primitives/prompt.tsx +87 -48
- package/src/primitives/ui.test.tsx +131 -0
- package/src/primitives/ui.tsx +13 -0
- package/src/primitives/zone.test.tsx +305 -0
- package/src/primitives/zone.tsx +660 -12
- package/src/reducer.ts +7 -20
- package/src/runtime/createPluginRuntimeAPI.ts +1 -1
- package/src/types/hex-color.ts +20 -0
- package/src/types/player-state.ts +36 -18
- package/src/types/plugin-state.ts +10 -3
- package/src/ui-contract.ts +253 -21
- package/src/utils/interaction-inputs.test.ts +400 -0
- package/src/utils/interaction-inputs.ts +113 -11
- package/src/utils/interaction-router.ts +200 -0
package/dist/ui-sdk.d.ts
CHANGED
|
@@ -1,268 +1,16 @@
|
|
|
1
|
-
import { PlayerId as PlayerId$1, BoardId, SpaceId, SpaceTypeId, EdgeTypeId, VertexTypeId, PieceId, PieceTypeId, BoardBaseId, PerPlayer, DieId, CardIdsByDeckId, CardId, CardProperties, ResourceId } from '@dreamboard/manifest-contract';
|
|
2
|
-
export { BoardRef, PerPlayer, PerPlayerBoardRef, SharedBoardRef } from '@dreamboard/manifest-contract';
|
|
3
|
-
import { GameView, PhaseName } from '@dreamboard/ui-contract';
|
|
4
1
|
import * as React$1 from 'react';
|
|
5
2
|
import React__default, { ReactNode, CSSProperties, AriaAttributes, HTMLAttributes, JSX, ReactElement, ButtonHTMLAttributes, InputHTMLAttributes, RefObject, Component, ErrorInfo, ComponentType, ComponentProps } from 'react';
|
|
6
3
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
4
|
+
import { BoardId, SpaceId, SpaceTypeId, PlayerId, EdgeTypeId, VertexTypeId, PieceId, PieceTypeId, BoardBaseId, DieId, CardIdsByDeckId, CardId, CardProperties, ResourceId } from '@dreamboard/manifest-contract';
|
|
7
5
|
import { HTMLMotionProps } from 'framer-motion';
|
|
8
6
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
type ActionName = string;
|
|
12
|
-
interface SeatAssignment {
|
|
13
|
-
playerId: PlayerId$1;
|
|
14
|
-
controllerUserId?: string;
|
|
15
|
-
displayName: string;
|
|
16
|
-
playerColor?: string;
|
|
17
|
-
isHost?: boolean;
|
|
18
|
-
}
|
|
19
|
-
interface HistoryEntrySummary {
|
|
20
|
-
id: string;
|
|
21
|
-
version: number;
|
|
22
|
-
timestamp: string;
|
|
23
|
-
description: string;
|
|
24
|
-
playerId?: PlayerId$1;
|
|
25
|
-
actionType?: ActionName;
|
|
26
|
-
isCurrent: boolean;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
interface LobbyState {
|
|
30
|
-
|
|
31
|
-
seats: SeatAssignment[];
|
|
32
|
-
|
|
33
|
-
canStart: boolean;
|
|
34
|
-
|
|
35
|
-
hostUserId: string;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
type NotificationType = "YOUR_TURN" | "PROMPT_OPENED" | "ACTION_EXECUTED" | "ACTION_REJECTED" | "TURN_CHANGED" | "STATE_CHANGED" | "GAME_ENDED" | "ERROR";
|
|
39
|
-
|
|
40
|
-
interface YourTurnPayload {
|
|
41
|
-
type: "YOUR_TURN";
|
|
42
|
-
activePlayers: PlayerId$1[];
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
interface PromptOpenedPayload {
|
|
46
|
-
type: "PROMPT_OPENED";
|
|
47
|
-
promptId: string;
|
|
48
|
-
promptInstanceId: string;
|
|
49
|
-
targetPlayer: PlayerId$1;
|
|
50
|
-
title?: string;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
interface ActionExecutedPayload {
|
|
54
|
-
type: "ACTION_EXECUTED";
|
|
55
|
-
playerId: PlayerId$1;
|
|
56
|
-
actionType: string;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
interface ActionRejectedPayload {
|
|
60
|
-
type: "ACTION_REJECTED";
|
|
61
|
-
reason: string;
|
|
62
|
-
targetPlayer?: string;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
interface StateChangedPayload {
|
|
66
|
-
type: "STATE_CHANGED";
|
|
67
|
-
newState: string;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
interface TurnChangedPayload {
|
|
71
|
-
type: "TURN_CHANGED";
|
|
72
|
-
previousPlayers: PlayerId$1[];
|
|
73
|
-
currentPlayers: PlayerId$1[];
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
interface GameEndedPayload {
|
|
77
|
-
type: "GAME_ENDED";
|
|
78
|
-
winner?: string;
|
|
79
|
-
finalScores: Record<string, number>;
|
|
80
|
-
reason: string;
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
interface ErrorPayload {
|
|
84
|
-
type: "ERROR";
|
|
85
|
-
message: string;
|
|
86
|
-
code?: string;
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
type NotificationPayload = YourTurnPayload | PromptOpenedPayload | ActionExecutedPayload | ActionRejectedPayload | TurnChangedPayload | StateChangedPayload | GameEndedPayload | ErrorPayload;
|
|
90
|
-
|
|
91
|
-
interface Notification {
|
|
92
|
-
|
|
93
|
-
id: string;
|
|
94
|
-
|
|
95
|
-
type: NotificationType;
|
|
96
|
-
|
|
97
|
-
payload: NotificationPayload;
|
|
98
|
-
|
|
99
|
-
timestamp: number;
|
|
100
|
-
|
|
101
|
-
read: boolean;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
interface PluginSessionState$1 {
|
|
105
|
-
|
|
106
|
-
sessionId: string | null;
|
|
107
|
-
|
|
108
|
-
controllablePlayerIds: PlayerId$1[];
|
|
109
|
-
|
|
110
|
-
controllingPlayerId: PlayerId$1 | null;
|
|
111
|
-
|
|
112
|
-
userId: string | null;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
interface HistoryState {
|
|
116
|
-
|
|
117
|
-
entries: HistoryEntrySummary[];
|
|
118
|
-
|
|
119
|
-
currentIndex: number;
|
|
120
|
-
|
|
121
|
-
canGoBack: boolean;
|
|
122
|
-
|
|
123
|
-
canGoForward: boolean;
|
|
124
|
-
}
|
|
125
|
-
interface GameplayPromptOption {
|
|
126
|
-
id: string;
|
|
127
|
-
label: string;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
interface InteractionContextOption {
|
|
131
|
-
id: string;
|
|
132
|
-
label?: string;
|
|
133
|
-
data?: unknown;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
interface InteractionContext {
|
|
137
|
-
|
|
138
|
-
to: string;
|
|
139
|
-
title?: string;
|
|
140
|
-
|
|
141
|
-
payload?: Record<string, unknown>;
|
|
142
|
-
|
|
143
|
-
options?: readonly InteractionContextOption[];
|
|
7
|
+
interface UIRootProps {
|
|
8
|
+
children: ReactNode;
|
|
144
9
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
mode: "manual";
|
|
149
|
-
} | {
|
|
150
|
-
mode: "autoWhenReady";
|
|
10
|
+
declare function UIRoot({ children }: UIRootProps): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare const UI: {
|
|
12
|
+
Root: typeof UIRoot;
|
|
151
13
|
};
|
|
152
|
-
interface InputSelection {
|
|
153
|
-
mode: "single" | "many";
|
|
154
|
-
min?: number;
|
|
155
|
-
max?: number;
|
|
156
|
-
distinct?: boolean;
|
|
157
|
-
}
|
|
158
|
-
interface InputDomain {
|
|
159
|
-
type: "target" | "resourceMap" | "boundedNumber" | "choice" | "choiceList";
|
|
160
|
-
targetKind?: string;
|
|
161
|
-
boardId?: string;
|
|
162
|
-
zoneId?: string;
|
|
163
|
-
zoneIds?: readonly string[];
|
|
164
|
-
eligibleTargets?: readonly string[];
|
|
165
|
-
resources?: ReadonlyArray<{
|
|
166
|
-
resourceId: string;
|
|
167
|
-
label?: string;
|
|
168
|
-
icon?: string;
|
|
169
|
-
min: number;
|
|
170
|
-
max: number;
|
|
171
|
-
}>;
|
|
172
|
-
min?: number;
|
|
173
|
-
max?: number;
|
|
174
|
-
step?: number;
|
|
175
|
-
choices?: readonly InteractionChoiceOption[];
|
|
176
|
-
selection?: InputSelection;
|
|
177
|
-
}
|
|
178
|
-
interface InteractionChoiceOption {
|
|
179
|
-
value: string;
|
|
180
|
-
label: string;
|
|
181
|
-
icon?: string;
|
|
182
|
-
badge?: string;
|
|
183
|
-
description?: string;
|
|
184
|
-
disabled?: boolean;
|
|
185
|
-
disabledReason?: string;
|
|
186
|
-
}
|
|
187
|
-
interface InteractionInputDescriptor {
|
|
188
|
-
key: string;
|
|
189
|
-
kind: string;
|
|
190
|
-
domain: InputDomain;
|
|
191
|
-
defaultValue?: unknown;
|
|
192
|
-
}
|
|
193
|
-
interface InteractionDescriptor<Key extends string = string> {
|
|
194
|
-
phaseName: string;
|
|
195
|
-
interactionKey: Key;
|
|
196
|
-
interactionId: string;
|
|
197
|
-
|
|
198
|
-
kind: InteractionKind;
|
|
199
|
-
|
|
200
|
-
commit: InteractionCommitPolicy;
|
|
201
|
-
|
|
202
|
-
zoneId?: string;
|
|
203
|
-
|
|
204
|
-
zoneIds?: readonly string[];
|
|
205
|
-
|
|
206
|
-
inputs: readonly InteractionInputDescriptor[];
|
|
207
|
-
|
|
208
|
-
cost?: Record<string, unknown>;
|
|
209
|
-
|
|
210
|
-
currentResources?: Record<string, unknown>;
|
|
211
|
-
|
|
212
|
-
available: boolean;
|
|
213
|
-
unavailableReason?: string;
|
|
214
|
-
|
|
215
|
-
context?: InteractionContext;
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
interface ZoneHandlesSnapshot<InteractionType extends string = string> {
|
|
219
|
-
cardIds: readonly string[];
|
|
220
|
-
cardsById: Readonly<Record<string, string>>;
|
|
221
|
-
playableByCardId: Readonly<Record<string, ReadonlyArray<InteractionDescriptor<InteractionType>>>>;
|
|
222
|
-
}
|
|
223
|
-
interface SimultaneousPhaseSnapshot {
|
|
224
|
-
phaseName: string;
|
|
225
|
-
interactionId: string;
|
|
226
|
-
actorIds: PlayerId$1[];
|
|
227
|
-
sealedPlayerIds: PlayerId$1[];
|
|
228
|
-
pendingPlayerIds: PlayerId$1[];
|
|
229
|
-
}
|
|
230
|
-
interface GameplaySnapshot$1<PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
231
|
-
currentPhase: PhaseType | null;
|
|
232
|
-
currentStage: StageType | null;
|
|
233
|
-
activePlayers: PlayerId$1[];
|
|
234
|
-
simultaneousPhase?: SimultaneousPhaseSnapshot | null;
|
|
235
|
-
availableInteractions: ReadonlyArray<InteractionDescriptor<InteractionType>>;
|
|
236
|
-
|
|
237
|
-
zones: Readonly<Record<string, ZoneHandlesSnapshot<InteractionType>>>;
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
interface PluginStateSnapshot<View = unknown, PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
241
|
-
|
|
242
|
-
view: View | null;
|
|
243
|
-
|
|
244
|
-
gameplay: GameplaySnapshot$1<PhaseType, StageType, InteractionType>;
|
|
245
|
-
|
|
246
|
-
lobby: LobbyState | null;
|
|
247
|
-
|
|
248
|
-
notifications: Notification[];
|
|
249
|
-
|
|
250
|
-
session: PluginSessionState$1;
|
|
251
|
-
|
|
252
|
-
history: HistoryState | null;
|
|
253
|
-
|
|
254
|
-
syncId: number;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
declare function useSimultaneousPhase(): SimultaneousPhaseSnapshot | null;
|
|
258
|
-
|
|
259
|
-
declare function usePlayerTurnOrder(): readonly PlayerId$1[];
|
|
260
|
-
|
|
261
|
-
type EqualityFn<T> = (left: T, right: T) => boolean;
|
|
262
|
-
|
|
263
|
-
declare function useGameSelector<T>(selector: (state: GameView) => T, equalityFn?: EqualityFn<T>): T;
|
|
264
|
-
|
|
265
|
-
declare function useIsMyTurn(): boolean;
|
|
266
14
|
|
|
267
15
|
interface ViewCard<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> {
|
|
268
16
|
id: CardIdValue;
|
|
@@ -283,11 +31,26 @@ interface ViewSlotOccupant<PieceIdValue extends string = string, PlayerIdValue e
|
|
|
283
31
|
data?: Data;
|
|
284
32
|
}
|
|
285
33
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
34
|
+
type HexColor = string & {
|
|
35
|
+
readonly __brand: "HexColor";
|
|
36
|
+
};
|
|
37
|
+
declare function isHexColor(value: unknown): value is HexColor;
|
|
38
|
+
declare function parseHexColor(value: unknown): HexColor | undefined;
|
|
39
|
+
declare function hexColor(value: string): HexColor;
|
|
289
40
|
|
|
290
|
-
|
|
41
|
+
interface PerPlayer<Value> {
|
|
42
|
+
readonly __perPlayer: true;
|
|
43
|
+
readonly entries: ReadonlyArray<readonly [PlayerId, Value]>;
|
|
44
|
+
}
|
|
45
|
+
interface SharedBoardRef<BaseId extends string = BoardBaseId> {
|
|
46
|
+
readonly baseId: BaseId;
|
|
47
|
+
readonly seat?: undefined;
|
|
48
|
+
}
|
|
49
|
+
interface PerPlayerBoardRef<BaseId extends string = BoardBaseId, Id extends string = PlayerId> {
|
|
50
|
+
readonly baseId: BaseId;
|
|
51
|
+
readonly seat: Id;
|
|
52
|
+
}
|
|
53
|
+
type BoardRef<BaseId extends string = BoardBaseId, Id extends string = PlayerId> = SharedBoardRef<BaseId> | PerPlayerBoardRef<BaseId, Id>;
|
|
291
54
|
|
|
292
55
|
type CardIdsByHandId = Record<string, PerPlayer<CardId[]>>;
|
|
293
56
|
type StateName = string;
|
|
@@ -296,15 +59,15 @@ type EdgePropertiesByBoardId = Record<BoardId, Record<string, unknown>>;
|
|
|
296
59
|
type VertexPropertiesByBoardId = Record<BoardId, Record<string, unknown>>;
|
|
297
60
|
interface Player {
|
|
298
61
|
|
|
299
|
-
playerId: PlayerId
|
|
62
|
+
playerId: PlayerId;
|
|
300
63
|
|
|
301
64
|
name: string;
|
|
302
65
|
|
|
303
66
|
isHost?: boolean;
|
|
304
67
|
|
|
305
|
-
color?:
|
|
68
|
+
color?: HexColor;
|
|
306
69
|
}
|
|
307
|
-
interface HexTileState<B extends string = BoardId, SpaceIdValue extends
|
|
70
|
+
interface HexTileState<B extends string = BoardId, SpaceIdValue extends string = SpaceId, Properties = B extends keyof TilePropertiesByBoardId ? TilePropertiesByBoardId[B] : undefined, View = unknown> {
|
|
308
71
|
|
|
309
72
|
id: SpaceIdValue;
|
|
310
73
|
|
|
@@ -316,14 +79,14 @@ interface HexTileState<B extends string = BoardId, SpaceIdValue extends SpaceId
|
|
|
316
79
|
|
|
317
80
|
label?: string;
|
|
318
81
|
|
|
319
|
-
owner?: PlayerId
|
|
82
|
+
owner?: PlayerId;
|
|
320
83
|
|
|
321
84
|
properties?: Properties;
|
|
322
85
|
|
|
323
86
|
view?: View;
|
|
324
87
|
}
|
|
325
88
|
|
|
326
|
-
interface HexEdgeState<B extends string = BoardId, SpaceIdValue extends
|
|
89
|
+
interface HexEdgeState<B extends string = BoardId, SpaceIdValue extends string = SpaceId, EdgeIdValue extends string = string, Properties = B extends keyof EdgePropertiesByBoardId ? EdgePropertiesByBoardId[B] : undefined> {
|
|
327
90
|
|
|
328
91
|
id: EdgeIdValue;
|
|
329
92
|
|
|
@@ -335,12 +98,12 @@ interface HexEdgeState<B extends string = BoardId, SpaceIdValue extends SpaceId
|
|
|
335
98
|
|
|
336
99
|
label?: string;
|
|
337
100
|
|
|
338
|
-
owner?: PlayerId
|
|
101
|
+
owner?: PlayerId;
|
|
339
102
|
|
|
340
103
|
properties?: Properties;
|
|
341
104
|
}
|
|
342
105
|
|
|
343
|
-
interface HexVertexState<B extends string = BoardId, SpaceIdValue extends
|
|
106
|
+
interface HexVertexState<B extends string = BoardId, SpaceIdValue extends string = SpaceId, VertexIdValue extends string = string, Properties = B extends keyof VertexPropertiesByBoardId ? VertexPropertiesByBoardId[B] : undefined> {
|
|
344
107
|
|
|
345
108
|
id: VertexIdValue;
|
|
346
109
|
|
|
@@ -350,12 +113,12 @@ interface HexVertexState<B extends string = BoardId, SpaceIdValue extends SpaceI
|
|
|
350
113
|
|
|
351
114
|
label?: string;
|
|
352
115
|
|
|
353
|
-
owner?: PlayerId
|
|
116
|
+
owner?: PlayerId;
|
|
354
117
|
|
|
355
118
|
properties?: Properties;
|
|
356
119
|
}
|
|
357
120
|
|
|
358
|
-
interface HexBoardState<B extends string = BoardId, SpaceIdValue extends
|
|
121
|
+
interface HexBoardState<B extends string = BoardId, SpaceIdValue extends string = SpaceId, EdgeIdValue extends string = string, VertexIdValue extends string = string, TileProperties = B extends keyof TilePropertiesByBoardId ? TilePropertiesByBoardId[B] : undefined, EdgeProperties = B extends keyof EdgePropertiesByBoardId ? EdgePropertiesByBoardId[B] : undefined, VertexProperties = B extends keyof VertexPropertiesByBoardId ? VertexPropertiesByBoardId[B] : undefined> {
|
|
359
122
|
|
|
360
123
|
id: B;
|
|
361
124
|
|
|
@@ -378,7 +141,7 @@ interface NetworkNodeState {
|
|
|
378
141
|
|
|
379
142
|
label?: string;
|
|
380
143
|
|
|
381
|
-
owner?: PlayerId
|
|
144
|
+
owner?: PlayerId;
|
|
382
145
|
|
|
383
146
|
properties?: string;
|
|
384
147
|
}
|
|
@@ -395,7 +158,7 @@ interface NetworkEdgeState {
|
|
|
395
158
|
|
|
396
159
|
label?: string;
|
|
397
160
|
|
|
398
|
-
owner?: PlayerId
|
|
161
|
+
owner?: PlayerId;
|
|
399
162
|
|
|
400
163
|
properties?: string;
|
|
401
164
|
}
|
|
@@ -408,7 +171,7 @@ interface NetworkPieceState {
|
|
|
408
171
|
|
|
409
172
|
typeId?: PieceTypeId;
|
|
410
173
|
|
|
411
|
-
owner?: PlayerId
|
|
174
|
+
owner?: PlayerId;
|
|
412
175
|
|
|
413
176
|
properties?: string;
|
|
414
177
|
}
|
|
@@ -424,7 +187,7 @@ interface NetworkBoardState {
|
|
|
424
187
|
pieces: NetworkPieceState[];
|
|
425
188
|
}
|
|
426
189
|
|
|
427
|
-
interface SquareCellState<SpaceIdValue extends
|
|
190
|
+
interface SquareCellState<SpaceIdValue extends string = SpaceId, Properties = Record<string, unknown>> {
|
|
428
191
|
|
|
429
192
|
id: SpaceIdValue;
|
|
430
193
|
|
|
@@ -436,12 +199,12 @@ interface SquareCellState<SpaceIdValue extends SpaceId = SpaceId, Properties = R
|
|
|
436
199
|
|
|
437
200
|
label?: string;
|
|
438
201
|
|
|
439
|
-
owner?: PlayerId
|
|
202
|
+
owner?: PlayerId;
|
|
440
203
|
|
|
441
204
|
properties?: Properties;
|
|
442
205
|
}
|
|
443
206
|
|
|
444
|
-
interface SquareEdgeState<SpaceIdValue extends
|
|
207
|
+
interface SquareEdgeState<SpaceIdValue extends string = SpaceId, EdgeIdValue extends string = string, Properties = Record<string, unknown>> {
|
|
445
208
|
|
|
446
209
|
id: EdgeIdValue;
|
|
447
210
|
|
|
@@ -451,12 +214,12 @@ interface SquareEdgeState<SpaceIdValue extends SpaceId = SpaceId, EdgeIdValue ex
|
|
|
451
214
|
|
|
452
215
|
label?: string;
|
|
453
216
|
|
|
454
|
-
owner?: PlayerId
|
|
217
|
+
owner?: PlayerId;
|
|
455
218
|
|
|
456
219
|
properties?: Properties;
|
|
457
220
|
}
|
|
458
221
|
|
|
459
|
-
interface SquareVertexState<SpaceIdValue extends
|
|
222
|
+
interface SquareVertexState<SpaceIdValue extends string = SpaceId, VertexIdValue extends string = string, Properties = Record<string, unknown>> {
|
|
460
223
|
|
|
461
224
|
id: VertexIdValue;
|
|
462
225
|
|
|
@@ -466,12 +229,12 @@ interface SquareVertexState<SpaceIdValue extends SpaceId = SpaceId, VertexIdValu
|
|
|
466
229
|
|
|
467
230
|
label?: string;
|
|
468
231
|
|
|
469
|
-
owner?: PlayerId
|
|
232
|
+
owner?: PlayerId;
|
|
470
233
|
|
|
471
234
|
properties?: Properties;
|
|
472
235
|
}
|
|
473
236
|
|
|
474
|
-
interface SquarePieceState<PieceIdValue extends
|
|
237
|
+
interface SquarePieceState<PieceIdValue extends string = PieceId, Properties = Record<string, unknown>> {
|
|
475
238
|
|
|
476
239
|
id: PieceIdValue;
|
|
477
240
|
|
|
@@ -481,12 +244,12 @@ interface SquarePieceState<PieceIdValue extends PieceId = PieceId, Properties =
|
|
|
481
244
|
|
|
482
245
|
typeId: PieceTypeId;
|
|
483
246
|
|
|
484
|
-
owner?: PlayerId
|
|
247
|
+
owner?: PlayerId;
|
|
485
248
|
|
|
486
249
|
properties?: Properties;
|
|
487
250
|
}
|
|
488
251
|
|
|
489
|
-
interface SquareBoardState<B extends string = BoardId, SpaceIdValue extends
|
|
252
|
+
interface SquareBoardState<B extends string = BoardId, SpaceIdValue extends string = SpaceId, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = PieceId, CellProperties = Record<string, unknown>, EdgeProperties = Record<string, unknown>, VertexProperties = Record<string, unknown>, PieceProperties = Record<string, unknown>> {
|
|
490
253
|
|
|
491
254
|
id: B;
|
|
492
255
|
|
|
@@ -517,7 +280,7 @@ interface TrackSpaceState {
|
|
|
517
280
|
|
|
518
281
|
typeId?: SpaceTypeId;
|
|
519
282
|
|
|
520
|
-
owner?: PlayerId
|
|
283
|
+
owner?: PlayerId;
|
|
521
284
|
|
|
522
285
|
nextSpaces?: SpaceId[];
|
|
523
286
|
|
|
@@ -530,7 +293,7 @@ interface TrackPieceState {
|
|
|
530
293
|
|
|
531
294
|
spaceId: SpaceId;
|
|
532
295
|
|
|
533
|
-
owner: PlayerId
|
|
296
|
+
owner: PlayerId;
|
|
534
297
|
|
|
535
298
|
typeId?: PieceTypeId;
|
|
536
299
|
|
|
@@ -578,7 +341,7 @@ interface BoardStates {
|
|
|
578
341
|
type DiceStates = Record<DieId, DieState>;
|
|
579
342
|
interface GameState {
|
|
580
343
|
|
|
581
|
-
currentPlayerIds: PlayerId
|
|
344
|
+
currentPlayerIds: PlayerId[];
|
|
582
345
|
decks: CardIdsByDeckId;
|
|
583
346
|
|
|
584
347
|
hands: CardIdsByHandId;
|
|
@@ -592,188 +355,776 @@ interface GameState {
|
|
|
592
355
|
dice: DiceStates;
|
|
593
356
|
}
|
|
594
357
|
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
prompts: readonly InteractionDescriptor[];
|
|
604
|
-
|
|
605
|
-
all: readonly InteractionDescriptor[];
|
|
358
|
+
type RuntimeFields = Record<string, unknown>;
|
|
359
|
+
interface GeneratedTiledEdgeStateLike<SpaceIdValue extends string = string, EdgeIdValue extends string = string, Fields = RuntimeFields> {
|
|
360
|
+
id: EdgeIdValue;
|
|
361
|
+
spaceIds: readonly SpaceIdValue[];
|
|
362
|
+
typeId?: EdgeTypeId | null;
|
|
363
|
+
label?: string | null;
|
|
364
|
+
ownerId?: PlayerId | null;
|
|
365
|
+
fields?: Fields;
|
|
606
366
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
367
|
+
interface GeneratedTiledVertexStateLike<SpaceIdValue extends string = string, VertexIdValue extends string = string, Fields = RuntimeFields> {
|
|
368
|
+
id: VertexIdValue;
|
|
369
|
+
spaceIds: readonly SpaceIdValue[];
|
|
370
|
+
typeId?: VertexTypeId | null;
|
|
371
|
+
label?: string | null;
|
|
372
|
+
ownerId?: PlayerId | null;
|
|
373
|
+
fields?: Fields;
|
|
374
|
+
}
|
|
375
|
+
interface GeneratedHexSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
376
|
+
id: SpaceIdValue;
|
|
377
|
+
q: number;
|
|
378
|
+
r: number;
|
|
379
|
+
typeId?: SpaceTypeId | null;
|
|
380
|
+
label?: string | null;
|
|
381
|
+
ownerId?: PlayerId | null;
|
|
382
|
+
fields?: Fields;
|
|
383
|
+
}
|
|
384
|
+
interface GeneratedSquareSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
385
|
+
id: SpaceIdValue;
|
|
386
|
+
row: number;
|
|
387
|
+
col: number;
|
|
388
|
+
typeId?: SpaceTypeId | null;
|
|
389
|
+
label?: string | null;
|
|
390
|
+
ownerId?: PlayerId | null;
|
|
391
|
+
fields?: Fields;
|
|
392
|
+
}
|
|
393
|
+
interface GeneratedHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> {
|
|
394
|
+
id: BoardIdValue;
|
|
395
|
+
layout?: "hex";
|
|
396
|
+
orientation?: "pointy-top" | "flat-top";
|
|
397
|
+
spaces: Readonly<Record<SpaceIdValue, GeneratedHexSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
398
|
+
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
399
|
+
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
400
|
+
}
|
|
401
|
+
interface AuthoredHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, SpaceView = unknown> {
|
|
402
|
+
id: BoardIdValue;
|
|
403
|
+
layout?: "hex";
|
|
404
|
+
orientation?: "pointy-top" | "flat-top";
|
|
405
|
+
tiles: ReadonlyArray<HexTileState<BoardIdValue, SpaceIdValue, SpaceFields, SpaceView>>;
|
|
406
|
+
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
407
|
+
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
408
|
+
}
|
|
409
|
+
type HexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> = AuthoredHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields> | GeneratedHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields>;
|
|
410
|
+
interface GeneratedSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
411
|
+
id: BoardIdValue;
|
|
412
|
+
layout?: "square";
|
|
413
|
+
spaces: Readonly<Record<SpaceIdValue, GeneratedSquareSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
414
|
+
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
415
|
+
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
416
|
+
pieces?: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
417
|
+
}
|
|
418
|
+
interface AuthoredSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
419
|
+
id: BoardIdValue;
|
|
420
|
+
layout?: "square";
|
|
421
|
+
rows: number;
|
|
422
|
+
cols: number;
|
|
423
|
+
cells: ReadonlyArray<SquareCellState<SpaceIdValue, SpaceFields>>;
|
|
424
|
+
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
425
|
+
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
426
|
+
pieces: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
427
|
+
}
|
|
428
|
+
type SquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> = AuthoredSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields> | GeneratedSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields>;
|
|
429
|
+
type AnyHexBoardInput = HexBoardInput<string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
430
|
+
type AnySquareBoardInput = SquareBoardInput<string, string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
431
|
+
type BoardIdOf<TBoard> = TBoard extends {
|
|
432
|
+
id: infer Id extends string;
|
|
433
|
+
} ? Id : string;
|
|
434
|
+
type SpaceRecordValueOf<TBoard> = TBoard extends {
|
|
435
|
+
spaces: Readonly<Record<string, infer Space>>;
|
|
436
|
+
} ? Space : never;
|
|
437
|
+
type TileValueOf<TBoard> = TBoard extends {
|
|
438
|
+
tiles: ReadonlyArray<infer Tile>;
|
|
439
|
+
} ? Tile : never;
|
|
440
|
+
type CellValueOf<TBoard> = TBoard extends {
|
|
441
|
+
cells: ReadonlyArray<infer Cell>;
|
|
442
|
+
} ? Cell : never;
|
|
443
|
+
type EdgeValueOf<TBoard> = TBoard extends {
|
|
444
|
+
edges: ReadonlyArray<infer Edge>;
|
|
445
|
+
} ? Edge : never;
|
|
446
|
+
type VertexValueOf<TBoard> = TBoard extends {
|
|
447
|
+
vertices: ReadonlyArray<infer Vertex>;
|
|
448
|
+
} ? Vertex : never;
|
|
449
|
+
type PieceValueOf<TBoard> = TBoard extends {
|
|
450
|
+
pieces?: ReadonlyArray<infer Piece>;
|
|
451
|
+
} ? Piece : never;
|
|
452
|
+
type BoardSpaceIdOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
453
|
+
id: infer Id extends string;
|
|
454
|
+
} ? Id : TileValueOf<TBoard> extends {
|
|
455
|
+
id: infer Id extends string;
|
|
456
|
+
} ? Id : CellValueOf<TBoard> extends {
|
|
457
|
+
id: infer Id extends string;
|
|
458
|
+
} ? Id : never;
|
|
459
|
+
type BoardEdgeIdOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
460
|
+
id: infer Id extends string;
|
|
461
|
+
} ? Id : never;
|
|
462
|
+
type BoardVertexIdOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
463
|
+
id: infer Id extends string;
|
|
464
|
+
} ? Id : never;
|
|
465
|
+
type HexTilePropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
466
|
+
fields?: infer Fields;
|
|
467
|
+
} ? Fields : TileValueOf<TBoard> extends {
|
|
468
|
+
properties?: infer Properties;
|
|
469
|
+
} ? Properties : RuntimeFields;
|
|
470
|
+
type HexTileViewOf<TBoard> = TileValueOf<TBoard> extends {
|
|
471
|
+
view: infer View;
|
|
472
|
+
} ? View : TileValueOf<TBoard> extends {
|
|
473
|
+
view?: infer View;
|
|
474
|
+
} ? View | undefined : unknown;
|
|
475
|
+
type HexEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
476
|
+
fields?: infer Fields;
|
|
477
|
+
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
478
|
+
properties?: infer Properties;
|
|
479
|
+
} ? Properties : RuntimeFields;
|
|
480
|
+
type HexVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
481
|
+
fields?: infer Fields;
|
|
482
|
+
} ? Fields : VertexValueOf<TBoard> extends {
|
|
483
|
+
properties?: infer Properties;
|
|
484
|
+
} ? Properties : RuntimeFields;
|
|
485
|
+
type SquareCellPropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
486
|
+
fields?: infer Fields;
|
|
487
|
+
} ? Fields : CellValueOf<TBoard> extends {
|
|
488
|
+
properties?: infer Properties;
|
|
489
|
+
} ? Properties : RuntimeFields;
|
|
490
|
+
type SquareEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
491
|
+
fields?: infer Fields;
|
|
492
|
+
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
493
|
+
properties?: infer Properties;
|
|
494
|
+
} ? Properties : RuntimeFields;
|
|
495
|
+
type SquareVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
496
|
+
fields?: infer Fields;
|
|
497
|
+
} ? Fields : VertexValueOf<TBoard> extends {
|
|
498
|
+
properties?: infer Properties;
|
|
499
|
+
} ? Properties : RuntimeFields;
|
|
500
|
+
type SquarePiecePropertiesOf<TBoard> = PieceValueOf<TBoard> extends {
|
|
501
|
+
properties?: infer Properties;
|
|
502
|
+
} ? Properties : RuntimeFields;
|
|
503
|
+
|
|
504
|
+
type NormalizedHexTileOf<TBoard extends AnyHexBoardInput> = Omit<HexTileState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, HexTilePropertiesOf<TBoard>, HexTileViewOf<TBoard>>, "view"> & {
|
|
505
|
+
view: HexTileViewOf<TBoard>;
|
|
623
506
|
};
|
|
507
|
+
type NormalizedHexEdgeOf<TBoard extends AnyHexBoardInput> = HexEdgeState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, HexEdgePropertiesOf<TBoard>>;
|
|
508
|
+
type NormalizedHexVertexOf<TBoard extends AnyHexBoardInput> = HexVertexState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardVertexIdOf<TBoard>, HexVertexPropertiesOf<TBoard>>;
|
|
509
|
+
type NormalizedSquareCellOf<TBoard extends AnySquareBoardInput> = SquareCellState<BoardSpaceIdOf<TBoard>, SquareCellPropertiesOf<TBoard>>;
|
|
510
|
+
type NormalizedSquareEdgeOf<TBoard extends AnySquareBoardInput> = SquareEdgeState<BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, SquareEdgePropertiesOf<TBoard>>;
|
|
511
|
+
type NormalizedSquareVertexOf<TBoard extends AnySquareBoardInput> = SquareVertexState<BoardSpaceIdOf<TBoard>, BoardVertexIdOf<TBoard>, SquareVertexPropertiesOf<TBoard>>;
|
|
512
|
+
type NormalizedSquarePieceOf<TBoard extends AnySquareBoardInput> = SquarePieceState<PieceValueOf<TBoard> extends {
|
|
513
|
+
id: infer PieceIdValue extends string;
|
|
514
|
+
} ? PieceIdValue : string, SquarePiecePropertiesOf<TBoard>>;
|
|
515
|
+
type NormalizedHexBoard<TBoard extends AnyHexBoardInput> = Omit<Pick<HexBoardState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, BoardVertexIdOf<TBoard>, HexTilePropertiesOf<TBoard>, HexEdgePropertiesOf<TBoard>, HexVertexPropertiesOf<TBoard>>, "id" | "tiles" | "edges" | "vertices">, "tiles"> & {
|
|
516
|
+
tiles: ReadonlyArray<NormalizedHexTileOf<TBoard>>;
|
|
517
|
+
orientation?: "pointy-top" | "flat-top";
|
|
518
|
+
};
|
|
519
|
+
type NormalizedSquareBoard<TBoard extends AnySquareBoardInput> = Pick<SquareBoardState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, BoardEdgeIdOf<TBoard>, BoardVertexIdOf<TBoard>, PieceValueOf<TBoard> extends {
|
|
520
|
+
id: infer PieceIdValue extends string;
|
|
521
|
+
} ? PieceIdValue : string, SquareCellPropertiesOf<TBoard>, SquareEdgePropertiesOf<TBoard>, SquareVertexPropertiesOf<TBoard>, SquarePiecePropertiesOf<TBoard>>, "id" | "rows" | "cols" | "cells" | "edges" | "vertices" | "pieces">;
|
|
522
|
+
declare function normalizeHexBoardInput<TBoard extends AnyHexBoardInput>(board: TBoard): NormalizedHexBoard<TBoard>;
|
|
523
|
+
declare function normalizeSquareBoardInput<TBoard extends AnySquareBoardInput>(board: TBoard): NormalizedSquareBoard<TBoard>;
|
|
624
524
|
|
|
625
|
-
|
|
626
|
-
|
|
525
|
+
type HexBoardViewTile<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
526
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
527
|
+
}> = Omit<NormalizedHexTileOf<TBoard>, "view"> & {
|
|
528
|
+
view: TSpaceView;
|
|
529
|
+
};
|
|
530
|
+
|
|
531
|
+
interface HexBoardView<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
532
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
533
|
+
}> {
|
|
534
|
+
id: BoardIdOf<TBoard>;
|
|
535
|
+
layout?: "hex";
|
|
536
|
+
orientation?: "pointy-top" | "flat-top";
|
|
537
|
+
tiles: ReadonlyArray<HexBoardViewTile<TBoard, TSpaceView>>;
|
|
538
|
+
edges: TBoard["edges"];
|
|
539
|
+
vertices: TBoard["vertices"];
|
|
540
|
+
}
|
|
541
|
+
interface CreateHexBoardViewOptions<TSpaceView> {
|
|
542
|
+
spaces: readonly TSpaceView[];
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
declare function createHexBoardView<const TBoard extends AnyHexBoardInput, const TSpaceView extends {
|
|
546
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
547
|
+
}>(board: TBoard, options: CreateHexBoardViewOptions<TSpaceView>): HexBoardView<TBoard, TSpaceView>;
|
|
548
|
+
|
|
549
|
+
type ActionName = string;
|
|
550
|
+
interface SeatAssignment {
|
|
551
|
+
playerId: PlayerId;
|
|
552
|
+
controllerUserId?: string;
|
|
553
|
+
displayName: string;
|
|
554
|
+
playerColor?: HexColor;
|
|
555
|
+
isHost?: boolean;
|
|
556
|
+
}
|
|
557
|
+
interface HistoryEntrySummary {
|
|
558
|
+
id: string;
|
|
559
|
+
version: number;
|
|
560
|
+
timestamp: string;
|
|
561
|
+
description: string;
|
|
562
|
+
playerId?: PlayerId;
|
|
563
|
+
actionType?: ActionName;
|
|
564
|
+
isCurrent: boolean;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
interface LobbyState {
|
|
627
568
|
|
|
628
|
-
|
|
569
|
+
seats: SeatAssignment[];
|
|
629
570
|
|
|
630
|
-
|
|
571
|
+
canStart: boolean;
|
|
631
572
|
|
|
632
|
-
|
|
573
|
+
hostUserId: string;
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
type NotificationType = "YOUR_TURN" | "PROMPT_OPENED" | "ACTION_EXECUTED" | "ACTION_REJECTED" | "TURN_CHANGED" | "STATE_CHANGED" | "GAME_ENDED" | "ERROR";
|
|
577
|
+
|
|
578
|
+
interface YourTurnPayload {
|
|
579
|
+
type: "YOUR_TURN";
|
|
580
|
+
activePlayers: PlayerId[];
|
|
581
|
+
}
|
|
582
|
+
|
|
583
|
+
interface PromptOpenedPayload {
|
|
584
|
+
type: "PROMPT_OPENED";
|
|
585
|
+
promptId: string;
|
|
586
|
+
promptInstanceId: string;
|
|
587
|
+
targetPlayer: PlayerId;
|
|
588
|
+
title?: string;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
interface ActionExecutedPayload {
|
|
592
|
+
type: "ACTION_EXECUTED";
|
|
593
|
+
playerId: PlayerId;
|
|
594
|
+
actionType: string;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
interface ActionRejectedPayload {
|
|
598
|
+
type: "ACTION_REJECTED";
|
|
599
|
+
reason: string;
|
|
600
|
+
targetPlayer?: string;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
interface StateChangedPayload {
|
|
604
|
+
type: "STATE_CHANGED";
|
|
605
|
+
newState: string;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
interface TurnChangedPayload {
|
|
609
|
+
type: "TURN_CHANGED";
|
|
610
|
+
previousPlayers: PlayerId[];
|
|
611
|
+
currentPlayers: PlayerId[];
|
|
612
|
+
}
|
|
613
|
+
|
|
614
|
+
interface GameEndedPayload {
|
|
615
|
+
type: "GAME_ENDED";
|
|
616
|
+
winner?: string;
|
|
617
|
+
finalScores: Record<string, number>;
|
|
618
|
+
reason: string;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
interface ErrorPayload {
|
|
622
|
+
type: "ERROR";
|
|
623
|
+
message: string;
|
|
624
|
+
code?: string;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
type NotificationPayload = YourTurnPayload | PromptOpenedPayload | ActionExecutedPayload | ActionRejectedPayload | TurnChangedPayload | StateChangedPayload | GameEndedPayload | ErrorPayload;
|
|
628
|
+
|
|
629
|
+
interface Notification {
|
|
633
630
|
|
|
634
|
-
|
|
631
|
+
id: string;
|
|
635
632
|
|
|
636
|
-
|
|
633
|
+
type: NotificationType;
|
|
634
|
+
|
|
635
|
+
payload: NotificationPayload;
|
|
636
|
+
|
|
637
|
+
timestamp: number;
|
|
638
|
+
|
|
639
|
+
read: boolean;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
interface PluginSessionState$1 {
|
|
643
|
+
|
|
644
|
+
sessionId: string | null;
|
|
645
|
+
|
|
646
|
+
controllablePlayerIds: PlayerId[];
|
|
647
|
+
|
|
648
|
+
controllingPlayerId: PlayerId | null;
|
|
649
|
+
|
|
650
|
+
userId: string | null;
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
interface HistoryState {
|
|
654
|
+
|
|
655
|
+
entries: HistoryEntrySummary[];
|
|
656
|
+
|
|
657
|
+
currentIndex: number;
|
|
658
|
+
|
|
659
|
+
canGoBack: boolean;
|
|
660
|
+
|
|
661
|
+
canGoForward: boolean;
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
interface InteractionContextOption {
|
|
665
|
+
id: string;
|
|
666
|
+
label?: string;
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
interface InteractionContext {
|
|
670
|
+
|
|
671
|
+
to: string;
|
|
672
|
+
title?: string;
|
|
673
|
+
|
|
674
|
+
payload?: Record<string, unknown>;
|
|
675
|
+
|
|
676
|
+
options?: readonly InteractionContextOption[];
|
|
677
|
+
}
|
|
678
|
+
|
|
679
|
+
type InteractionKind = "action" | "prompt";
|
|
680
|
+
type InteractionCommitPolicy = {
|
|
681
|
+
mode: "manual";
|
|
682
|
+
} | {
|
|
683
|
+
mode: "autoWhenReady";
|
|
684
|
+
};
|
|
685
|
+
interface InputSelection {
|
|
686
|
+
mode: "single" | "many";
|
|
687
|
+
min?: number;
|
|
688
|
+
max?: number;
|
|
689
|
+
distinct?: boolean;
|
|
690
|
+
}
|
|
691
|
+
interface InputDomain {
|
|
692
|
+
type: "target" | "resourceMap" | "boundedNumber" | "choice" | "choiceList";
|
|
693
|
+
targetKind?: string;
|
|
694
|
+
boardId?: string;
|
|
695
|
+
zoneId?: string;
|
|
696
|
+
zoneIds?: readonly string[];
|
|
697
|
+
eligibleTargets?: readonly string[];
|
|
698
|
+
resources?: ReadonlyArray<{
|
|
699
|
+
resourceId: string;
|
|
700
|
+
label?: string;
|
|
701
|
+
icon?: string;
|
|
702
|
+
min: number;
|
|
703
|
+
max: number;
|
|
704
|
+
}>;
|
|
705
|
+
min?: number;
|
|
706
|
+
max?: number;
|
|
707
|
+
step?: number;
|
|
708
|
+
choices?: readonly InteractionChoiceOption[];
|
|
709
|
+
selection?: InputSelection;
|
|
710
|
+
dependsOn?: readonly string[];
|
|
711
|
+
dependentCases?: readonly InputDomainDependencyCase[];
|
|
712
|
+
}
|
|
713
|
+
interface InputDomainDependencyCase {
|
|
714
|
+
when: Readonly<Record<string, string>>;
|
|
715
|
+
domain: InputDomain;
|
|
716
|
+
}
|
|
717
|
+
interface InteractionChoiceOption {
|
|
718
|
+
value: string | null;
|
|
719
|
+
label: string;
|
|
720
|
+
icon?: string;
|
|
721
|
+
badge?: string;
|
|
722
|
+
description?: string;
|
|
723
|
+
disabled?: boolean;
|
|
724
|
+
disabledReason?: string;
|
|
725
|
+
}
|
|
726
|
+
interface InteractionInputDescriptor {
|
|
727
|
+
key: string;
|
|
728
|
+
kind: string;
|
|
729
|
+
domain: InputDomain;
|
|
730
|
+
defaultValue?: unknown;
|
|
731
|
+
}
|
|
732
|
+
interface InteractionDescriptor<Key extends string = string> {
|
|
733
|
+
phaseName: string;
|
|
734
|
+
interactionKey: Key;
|
|
735
|
+
interactionId: string;
|
|
736
|
+
|
|
737
|
+
kind: InteractionKind;
|
|
738
|
+
|
|
739
|
+
commit: InteractionCommitPolicy;
|
|
740
|
+
|
|
741
|
+
zoneId?: string;
|
|
742
|
+
|
|
743
|
+
zoneIds?: readonly string[];
|
|
744
|
+
|
|
745
|
+
inputs: readonly InteractionInputDescriptor[];
|
|
746
|
+
|
|
747
|
+
cost?: Record<string, unknown>;
|
|
637
748
|
|
|
638
|
-
|
|
749
|
+
currentResources?: Record<string, unknown>;
|
|
639
750
|
|
|
640
751
|
available: boolean;
|
|
641
|
-
|
|
642
752
|
unavailableReason?: string;
|
|
643
753
|
|
|
644
|
-
|
|
754
|
+
context?: InteractionContext;
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
interface ZoneHandlesSnapshot<InteractionType extends string = string> {
|
|
758
|
+
cardIds: readonly string[];
|
|
759
|
+
cardsById: Readonly<Record<string, string>>;
|
|
760
|
+
playableByCardId: Readonly<Record<string, ReadonlyArray<InteractionDescriptor<InteractionType>>>>;
|
|
761
|
+
}
|
|
762
|
+
interface SimultaneousPhaseSnapshot {
|
|
763
|
+
phaseName: string;
|
|
764
|
+
interactionId: string;
|
|
765
|
+
actorIds: PlayerId[];
|
|
766
|
+
sealedPlayerIds: PlayerId[];
|
|
767
|
+
pendingPlayerIds: PlayerId[];
|
|
768
|
+
}
|
|
769
|
+
interface GameplaySnapshot<PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
770
|
+
currentPhase: PhaseType | null;
|
|
771
|
+
currentStage: StageType | null;
|
|
772
|
+
activePlayers: PlayerId[];
|
|
773
|
+
simultaneousPhase?: SimultaneousPhaseSnapshot | null;
|
|
774
|
+
availableInteractions: ReadonlyArray<InteractionDescriptor<InteractionType>>;
|
|
645
775
|
|
|
646
|
-
|
|
776
|
+
zones: Readonly<Record<string, ZoneHandlesSnapshot<InteractionType>>>;
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
interface PluginStateSnapshot<View = unknown, PhaseType extends string = string, StageType extends string = string, InteractionType extends string = string> {
|
|
647
780
|
|
|
648
|
-
|
|
781
|
+
view: View | null;
|
|
649
782
|
|
|
650
|
-
|
|
783
|
+
gameplay: GameplaySnapshot<PhaseType, StageType, InteractionType>;
|
|
651
784
|
|
|
652
|
-
|
|
785
|
+
lobby: LobbyState | null;
|
|
653
786
|
|
|
654
|
-
|
|
787
|
+
notifications: Notification[];
|
|
655
788
|
|
|
656
|
-
|
|
789
|
+
session: PluginSessionState$1;
|
|
657
790
|
|
|
658
|
-
|
|
791
|
+
history: HistoryState | null;
|
|
659
792
|
|
|
660
|
-
|
|
793
|
+
syncId: number;
|
|
661
794
|
}
|
|
662
795
|
|
|
663
|
-
|
|
796
|
+
type BoardTargetKind = "edge" | "vertex" | "space" | "tile";
|
|
797
|
+
|
|
798
|
+
interface InteractiveTargetState {
|
|
799
|
+
kind?: BoardTargetKind;
|
|
800
|
+
id: string;
|
|
801
|
+
eligible: boolean;
|
|
802
|
+
selectable: boolean;
|
|
803
|
+
hovered: boolean;
|
|
804
|
+
interactionKey?: string;
|
|
805
|
+
interactionId?: string;
|
|
806
|
+
inputKey?: string;
|
|
807
|
+
pending: boolean;
|
|
808
|
+
conflict: boolean;
|
|
809
|
+
unavailableReason?: string;
|
|
810
|
+
select?: () => unknown | Promise<unknown>;
|
|
811
|
+
}
|
|
812
|
+
interface InteractiveTargetLayer {
|
|
813
|
+
enabled?: boolean;
|
|
814
|
+
eligible?: ReadonlySet<string>;
|
|
815
|
+
selectTargetId?: (targetId: string) => unknown | Promise<unknown>;
|
|
816
|
+
targetState?: (targetId: string) => Partial<InteractiveTargetState>;
|
|
817
|
+
}
|
|
818
|
+
interface InteractiveTargetRenderState extends InteractiveTargetState {
|
|
819
|
+
isEnabled: boolean;
|
|
820
|
+
isEligible: boolean;
|
|
821
|
+
isHovered: boolean;
|
|
822
|
+
}
|
|
664
823
|
|
|
665
|
-
|
|
824
|
+
type HexOrientation = "pointy-top" | "flat-top";
|
|
666
825
|
|
|
667
|
-
interface
|
|
826
|
+
interface HexTileGeometry {
|
|
827
|
+
size: number;
|
|
828
|
+
orientation: HexOrientation;
|
|
829
|
+
center: {
|
|
830
|
+
x: 0;
|
|
831
|
+
y: 0;
|
|
832
|
+
};
|
|
833
|
+
position: {
|
|
834
|
+
x: number;
|
|
835
|
+
y: number;
|
|
836
|
+
};
|
|
837
|
+
corners: (options?: {
|
|
838
|
+
inset?: number;
|
|
839
|
+
}) => Array<{
|
|
840
|
+
x: number;
|
|
841
|
+
y: number;
|
|
842
|
+
}>;
|
|
843
|
+
points: (options?: {
|
|
844
|
+
inset?: number;
|
|
845
|
+
}) => string;
|
|
846
|
+
bounds: {
|
|
847
|
+
minX: number;
|
|
848
|
+
minY: number;
|
|
849
|
+
maxX: number;
|
|
850
|
+
maxY: number;
|
|
851
|
+
width: number;
|
|
852
|
+
height: number;
|
|
853
|
+
};
|
|
854
|
+
}
|
|
855
|
+
interface EdgePosition {
|
|
668
856
|
|
|
669
|
-
|
|
857
|
+
x1: number;
|
|
858
|
+
y1: number;
|
|
670
859
|
|
|
671
|
-
|
|
860
|
+
x2: number;
|
|
861
|
+
y2: number;
|
|
672
862
|
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
interface SubmissionError extends Error {
|
|
863
|
+
midX: number;
|
|
864
|
+
midY: number;
|
|
677
865
|
|
|
678
|
-
|
|
866
|
+
centerAngle: number;
|
|
867
|
+
|
|
868
|
+
edgeAngle: number;
|
|
679
869
|
}
|
|
680
|
-
|
|
681
|
-
|
|
870
|
+
interface InteractiveHexVertex<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexVertexOf<TBoard> {
|
|
871
|
+
position: {
|
|
872
|
+
x: number;
|
|
873
|
+
y: number;
|
|
874
|
+
};
|
|
875
|
+
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
876
|
+
}
|
|
877
|
+
interface InteractiveHexEdge<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexEdgeOf<TBoard> {
|
|
878
|
+
position: EdgePosition;
|
|
879
|
+
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
880
|
+
}
|
|
881
|
+
type InteractiveHexSpace<TBoard extends AnyHexBoardInput = AnyHexBoardInput> = NormalizedHexTileOf<TBoard>;
|
|
882
|
+
interface HexGeneratedGridInputProps {
|
|
883
|
+
id?: string;
|
|
884
|
+
layout?: "hex";
|
|
885
|
+
orientation?: HexOrientation;
|
|
886
|
+
spaces: Extract<AnyHexBoardInput, {
|
|
887
|
+
spaces: unknown;
|
|
888
|
+
}>["spaces"];
|
|
889
|
+
edges?: AnyHexBoardInput["edges"];
|
|
890
|
+
vertices?: AnyHexBoardInput["vertices"];
|
|
891
|
+
}
|
|
892
|
+
interface HexAuthoredGridInputProps {
|
|
893
|
+
id?: string;
|
|
894
|
+
layout?: "hex";
|
|
895
|
+
orientation?: HexOrientation;
|
|
896
|
+
tiles: Extract<AnyHexBoardInput, {
|
|
897
|
+
tiles: unknown;
|
|
898
|
+
}>["tiles"];
|
|
899
|
+
edges?: AnyHexBoardInput["edges"];
|
|
900
|
+
vertices?: AnyHexBoardInput["vertices"];
|
|
901
|
+
}
|
|
902
|
+
type HexGridInputProps = HexGeneratedGridInputProps | HexAuthoredGridInputProps;
|
|
903
|
+
type ResolvedArrayProp<Value> = Exclude<Value, undefined> extends readonly unknown[] ? Exclude<Value, undefined> : readonly [];
|
|
904
|
+
type HexBoardLikeOfProps<TProps extends HexGridInputProps> = TProps extends {
|
|
905
|
+
id?: infer Id;
|
|
906
|
+
layout?: infer Layout;
|
|
907
|
+
orientation?: infer Orientation;
|
|
908
|
+
spaces: infer Spaces;
|
|
909
|
+
edges?: infer Edges;
|
|
910
|
+
vertices?: infer Vertices;
|
|
911
|
+
} ? {
|
|
912
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
913
|
+
layout?: Extract<Layout, "hex">;
|
|
914
|
+
orientation?: Extract<Orientation, HexOrientation>;
|
|
915
|
+
spaces: Spaces;
|
|
916
|
+
edges: ResolvedArrayProp<Edges>;
|
|
917
|
+
vertices: ResolvedArrayProp<Vertices>;
|
|
918
|
+
} & GeneratedHexBoardInput : TProps extends {
|
|
919
|
+
id?: infer Id;
|
|
920
|
+
layout?: infer Layout;
|
|
921
|
+
orientation?: infer Orientation;
|
|
922
|
+
tiles: infer Tiles;
|
|
923
|
+
edges?: infer Edges;
|
|
924
|
+
vertices?: infer Vertices;
|
|
925
|
+
} ? {
|
|
926
|
+
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
927
|
+
layout?: Extract<Layout, "hex">;
|
|
928
|
+
orientation?: Extract<Orientation, HexOrientation>;
|
|
929
|
+
tiles: Tiles;
|
|
930
|
+
edges: ResolvedArrayProp<Edges>;
|
|
931
|
+
vertices: ResolvedArrayProp<Vertices>;
|
|
932
|
+
} & AuthoredHexBoardInput : never;
|
|
933
|
+
type HexGridProps<TProps extends HexGridInputProps = HexGridInputProps> = TProps & {
|
|
934
|
+
orientation?: HexOrientation;
|
|
682
935
|
|
|
683
|
-
|
|
936
|
+
hexSize?: number;
|
|
684
937
|
|
|
685
|
-
|
|
938
|
+
renderTile: (tile: NormalizedHexTileOf<NoInfer<HexBoardLikeOfProps<TProps>>>, geometry: HexTileGeometry) => ReactNode;
|
|
939
|
+
|
|
940
|
+
renderEdge: (edge: NormalizedHexEdgeOf<NoInfer<HexBoardLikeOfProps<TProps>>>, position: EdgePosition) => ReactNode;
|
|
941
|
+
renderVertex: (vertex: NormalizedHexVertexOf<NoInfer<HexBoardLikeOfProps<TProps>>>, position: {
|
|
942
|
+
x: number;
|
|
943
|
+
y: number;
|
|
944
|
+
}) => ReactNode;
|
|
945
|
+
width?: number | string;
|
|
946
|
+
height?: number | string;
|
|
947
|
+
enablePanZoom?: boolean;
|
|
948
|
+
initialZoom?: number;
|
|
949
|
+
minZoom?: number;
|
|
950
|
+
maxZoom?: number;
|
|
951
|
+
className?: string;
|
|
686
952
|
|
|
687
|
-
|
|
953
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
688
954
|
|
|
689
|
-
|
|
955
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
690
956
|
|
|
691
|
-
|
|
692
|
-
}
|
|
693
|
-
|
|
694
|
-
interface RuntimeAPI {
|
|
957
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
695
958
|
|
|
696
|
-
|
|
959
|
+
renderInteractiveSpace?: (space: InteractiveHexSpace<NoInfer<HexBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
697
960
|
|
|
698
|
-
|
|
961
|
+
renderInteractiveVertex?: (vertex: InteractiveHexVertex<NoInfer<HexBoardLikeOfProps<TProps>>>, position: {
|
|
962
|
+
x: number;
|
|
963
|
+
y: number;
|
|
964
|
+
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
699
965
|
|
|
700
|
-
|
|
966
|
+
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<HexBoardLikeOfProps<TProps>>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
967
|
+
interactiveVertexSize?: number;
|
|
968
|
+
interactiveEdgeSize?: number;
|
|
969
|
+
};
|
|
970
|
+
interface HexGridBoardProps<TBoard extends AnyHexBoardInput = AnyHexBoardInput> {
|
|
971
|
+
board: TBoard;
|
|
972
|
+
orientation?: HexOrientation;
|
|
973
|
+
hexSize?: number;
|
|
701
974
|
|
|
702
|
-
|
|
975
|
+
renderTile: (tile: NormalizedHexTileOf<NoInfer<TBoard>>, geometry: HexTileGeometry) => ReactNode;
|
|
976
|
+
|
|
977
|
+
renderEdge: (edge: NormalizedHexEdgeOf<NoInfer<TBoard>>, position: EdgePosition) => ReactNode;
|
|
978
|
+
renderVertex: (vertex: NormalizedHexVertexOf<NoInfer<TBoard>>, position: {
|
|
979
|
+
x: number;
|
|
980
|
+
y: number;
|
|
981
|
+
}) => ReactNode;
|
|
982
|
+
width?: number | string;
|
|
983
|
+
height?: number | string;
|
|
984
|
+
enablePanZoom?: boolean;
|
|
985
|
+
initialZoom?: number;
|
|
986
|
+
minZoom?: number;
|
|
987
|
+
maxZoom?: number;
|
|
988
|
+
className?: string;
|
|
989
|
+
interactiveSpaces?: InteractiveTargetLayer;
|
|
990
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
991
|
+
interactiveEdges?: InteractiveTargetLayer;
|
|
703
992
|
|
|
704
|
-
|
|
993
|
+
renderInteractiveSpace?: (space: InteractiveHexSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
994
|
+
|
|
995
|
+
renderInteractiveVertex?: (vertex: InteractiveHexVertex<NoInfer<TBoard>>, position: {
|
|
996
|
+
x: number;
|
|
997
|
+
y: number;
|
|
998
|
+
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
999
|
+
|
|
1000
|
+
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<TBoard>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
1001
|
+
interactiveVertexSize?: number;
|
|
1002
|
+
interactiveEdgeSize?: number;
|
|
705
1003
|
}
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
}>;
|
|
720
|
-
};
|
|
1004
|
+
interface DefaultHexTileProps {
|
|
1005
|
+
|
|
1006
|
+
size: number;
|
|
1007
|
+
fill: string;
|
|
1008
|
+
stroke?: string;
|
|
1009
|
+
strokeWidth?: number;
|
|
1010
|
+
isSelected?: boolean;
|
|
1011
|
+
isHighlighted?: boolean;
|
|
1012
|
+
label?: string;
|
|
1013
|
+
showCoordinates?: boolean;
|
|
1014
|
+
coordinates?: {
|
|
1015
|
+
q: number;
|
|
1016
|
+
r: number;
|
|
721
1017
|
};
|
|
1018
|
+
orientation?: HexOrientation;
|
|
1019
|
+
onClick?: () => void;
|
|
1020
|
+
onPointerEnter?: () => void;
|
|
1021
|
+
onPointerLeave?: () => void;
|
|
1022
|
+
className?: string;
|
|
722
1023
|
}
|
|
723
|
-
type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
|
|
724
1024
|
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
overlayClassName?: string;
|
|
735
|
-
titleClassName?: string;
|
|
736
|
-
renderBody?: (prompt: InteractionDescriptor) => ReactNode;
|
|
737
|
-
renderOptionLabel?: (option: InteractionContextOption, prompt: InteractionDescriptor) => ReactNode;
|
|
738
|
-
onSubmitError?: (error: unknown, prompt: InteractionDescriptor, option: InteractionContextOption) => void;
|
|
1025
|
+
declare function DefaultHexTile({ size, fill, stroke, strokeWidth, isSelected, isHighlighted, label, showCoordinates, coordinates, orientation, onClick, onPointerEnter, onPointerLeave, className, }: DefaultHexTileProps): react_jsx_runtime.JSX.Element;
|
|
1026
|
+
interface DefaultHexEdgeProps {
|
|
1027
|
+
position: EdgePosition;
|
|
1028
|
+
color: string;
|
|
1029
|
+
hasOwner?: boolean;
|
|
1030
|
+
strokeWidth?: number;
|
|
1031
|
+
touchTargetSize?: number;
|
|
1032
|
+
onClick?: () => void;
|
|
1033
|
+
className?: string;
|
|
739
1034
|
}
|
|
740
|
-
declare function PromptDialogHost(props: PromptDialogHostProps): react_jsx_runtime.JSX.Element | null;
|
|
741
1035
|
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
1036
|
+
declare function DefaultHexEdge({ position, color, hasOwner, strokeWidth, touchTargetSize, onClick, className, }: DefaultHexEdgeProps): react_jsx_runtime.JSX.Element;
|
|
1037
|
+
interface DefaultHexVertexProps {
|
|
1038
|
+
position: {
|
|
1039
|
+
x: number;
|
|
1040
|
+
y: number;
|
|
1041
|
+
};
|
|
1042
|
+
color: string;
|
|
1043
|
+
stroke?: string;
|
|
1044
|
+
strokeWidth?: number;
|
|
1045
|
+
hasOwner?: boolean;
|
|
1046
|
+
isSelected?: boolean;
|
|
1047
|
+
isHighlighted?: boolean;
|
|
1048
|
+
size?: number;
|
|
1049
|
+
touchTargetSize?: number;
|
|
1050
|
+
shape?: "circle" | "square";
|
|
1051
|
+
onClick?: () => void;
|
|
1052
|
+
onPointerEnter?: () => void;
|
|
1053
|
+
onPointerLeave?: () => void;
|
|
1054
|
+
className?: string;
|
|
751
1055
|
}
|
|
752
1056
|
|
|
753
|
-
|
|
1057
|
+
declare function DefaultHexVertex({ position, color, stroke, strokeWidth, hasOwner, isSelected, isHighlighted, size, touchTargetSize, shape, onClick, onPointerEnter, onPointerLeave, className, }: DefaultHexVertexProps): react_jsx_runtime.JSX.Element;
|
|
1058
|
+
declare const hexUtils: {
|
|
1059
|
+
|
|
1060
|
+
axialToPixel(q: number, r: number, size: number, orientation: HexOrientation): {
|
|
1061
|
+
x: number;
|
|
1062
|
+
y: number;
|
|
1063
|
+
};
|
|
1064
|
+
getNeighbors(q: number, r: number): Array<{
|
|
1065
|
+
q: number;
|
|
1066
|
+
r: number;
|
|
1067
|
+
}>;
|
|
1068
|
+
getDistance(q1: number, r1: number, q2: number, r2: number): number;
|
|
1069
|
+
getHexCorners(centerX: number, centerY: number, size: number, orientation: HexOrientation): Array<{
|
|
1070
|
+
x: number;
|
|
1071
|
+
y: number;
|
|
1072
|
+
}>;
|
|
1073
|
+
getHexPoints(centerX: number, centerY: number, size: number, orientation: HexOrientation): string;
|
|
1074
|
+
getEdgePosition(hex1Pos: {
|
|
1075
|
+
x: number;
|
|
1076
|
+
y: number;
|
|
1077
|
+
}, hex2Pos: {
|
|
1078
|
+
x: number;
|
|
1079
|
+
y: number;
|
|
1080
|
+
}, size: number): EdgePosition;
|
|
1081
|
+
getVertexPosition(hex1Pos: {
|
|
1082
|
+
x: number;
|
|
1083
|
+
y: number;
|
|
1084
|
+
}, hex2Pos: {
|
|
1085
|
+
x: number;
|
|
1086
|
+
y: number;
|
|
1087
|
+
}, hex3Pos: {
|
|
1088
|
+
x: number;
|
|
1089
|
+
y: number;
|
|
1090
|
+
}): {
|
|
1091
|
+
x: number;
|
|
1092
|
+
y: number;
|
|
1093
|
+
};
|
|
1094
|
+
};
|
|
1095
|
+
interface HexGridComponent {
|
|
1096
|
+
<const TBoard extends AnyHexBoardInput>(props: HexGridBoardProps<TBoard>): ReactNode;
|
|
1097
|
+
<const TProps extends HexGeneratedGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
1098
|
+
<const TProps extends HexAuthoredGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
1099
|
+
}
|
|
1100
|
+
declare const HexGrid: HexGridComponent;
|
|
754
1101
|
|
|
755
1102
|
type BoardEligibleTargets = Readonly<Record<BoardTargetKind, ReadonlySet<string>>>;
|
|
756
1103
|
interface BoardTargetLayerOptions {
|
|
757
1104
|
enabled?: boolean;
|
|
1105
|
+
interactionKeys?: readonly string[];
|
|
758
1106
|
extraInputs?: Record<string, unknown> | ((targetId: string) => Record<string, unknown>);
|
|
759
1107
|
onBeforeSelect?: () => void;
|
|
760
1108
|
onError?: (error: unknown) => void;
|
|
761
1109
|
}
|
|
762
1110
|
type BoardTargetLayerFactory = (options?: BoardTargetLayerOptions) => InteractiveTargetLayer;
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
readonly
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
1111
|
+
type BoardSelectionResult<I extends string = string> = {
|
|
1112
|
+
status: "none";
|
|
1113
|
+
} | {
|
|
1114
|
+
status: "pending";
|
|
1115
|
+
interactionKey: I;
|
|
1116
|
+
descriptor: InteractionDescriptor<I>;
|
|
1117
|
+
missingInputs: readonly string[];
|
|
1118
|
+
} | {
|
|
1119
|
+
status: "submitted";
|
|
1120
|
+
interactionKey: I;
|
|
1121
|
+
descriptor: InteractionDescriptor<I>;
|
|
1122
|
+
};
|
|
1123
|
+
interface BoardPendingInteraction<I extends string = string> {
|
|
1124
|
+
interactionKey: I;
|
|
1125
|
+
descriptor: InteractionDescriptor<I>;
|
|
1126
|
+
missingInputs: readonly string[];
|
|
1127
|
+
clear(): void;
|
|
777
1128
|
}
|
|
778
1129
|
|
|
779
1130
|
interface BoardInteractionsContext<I extends string = string> {
|
|
@@ -784,11 +1135,12 @@ interface BoardInteractionsContext<I extends string = string> {
|
|
|
784
1135
|
|
|
785
1136
|
isEligible(targetId: string, targetKind?: BoardTargetKind): boolean;
|
|
786
1137
|
|
|
1138
|
+
pendingInteraction: BoardPendingInteraction<I> | null;
|
|
787
1139
|
select: {
|
|
788
|
-
edge(targetId: string, extraInputs?: Record<string, unknown>): Promise<
|
|
789
|
-
vertex(targetId: string, extraInputs?: Record<string, unknown>): Promise<
|
|
790
|
-
space(targetId: string, extraInputs?: Record<string, unknown>): Promise<
|
|
791
|
-
tile(targetId: string, extraInputs?: Record<string, unknown>): Promise<
|
|
1140
|
+
edge(targetId: string, extraInputs?: Record<string, unknown>): Promise<BoardSelectionResult<I>>;
|
|
1141
|
+
vertex(targetId: string, extraInputs?: Record<string, unknown>): Promise<BoardSelectionResult<I>>;
|
|
1142
|
+
space(targetId: string, extraInputs?: Record<string, unknown>): Promise<BoardSelectionResult<I>>;
|
|
1143
|
+
tile(targetId: string, extraInputs?: Record<string, unknown>): Promise<BoardSelectionResult<I>>;
|
|
792
1144
|
};
|
|
793
1145
|
|
|
794
1146
|
targetLayers: {
|
|
@@ -797,10 +1149,10 @@ interface BoardInteractionsContext<I extends string = string> {
|
|
|
797
1149
|
space: BoardTargetLayerFactory;
|
|
798
1150
|
tile: BoardTargetLayerFactory;
|
|
799
1151
|
};
|
|
1152
|
+
targetState(targetKind: BoardTargetKind, targetId: string, options?: Pick<BoardTargetLayerOptions, "enabled" | "interactionKeys">): InteractiveTargetState;
|
|
1153
|
+
selectTarget(descriptor: InteractionDescriptor<I>, targetKind: BoardTargetKind, targetId: string, inputKey: string, extraInputs?: Record<string, unknown>): Promise<BoardSelectionResult<I>>;
|
|
800
1154
|
}
|
|
801
1155
|
|
|
802
|
-
declare function useBoardInteractions<I extends string = string>(options?: BoardInteractionsOptions): BoardInteractionsContext<I>;
|
|
803
|
-
|
|
804
1156
|
type PrimitiveDataAttributes = Record<`data-${string}`, string | boolean | number | undefined>;
|
|
805
1157
|
type PrimitiveCommonProps = {
|
|
806
1158
|
asChild?: boolean;
|
|
@@ -814,13 +1166,48 @@ declare function composeEventHandlers<Event extends {
|
|
|
814
1166
|
}>(authorHandler: EventHandler<Event> | undefined, primitiveHandler: EventHandler<Event> | undefined): EventHandler<Event> | undefined;
|
|
815
1167
|
declare function renderPrimitive<ElementProps extends HTMLAttributes<HTMLElement>>(tagName: keyof JSX.IntrinsicElements, props: ElementProps & PrimitiveCommonProps): ReactElement;
|
|
816
1168
|
|
|
817
|
-
type BoardContextValue =
|
|
1169
|
+
type BoardContextValue = BoardInteractionsContext;
|
|
818
1170
|
declare function useBoardPrimitiveContext(): BoardContextValue;
|
|
819
1171
|
interface BoardRootProps extends PrimitiveCommonProps {
|
|
820
1172
|
children: ReactNode;
|
|
821
1173
|
targetKinds?: readonly BoardTargetKind[];
|
|
822
1174
|
}
|
|
823
1175
|
declare function BoardRoot({ children, targetKinds, ...props }: BoardRootProps): react_jsx_runtime.JSX.Element;
|
|
1176
|
+
interface BoardStateProps {
|
|
1177
|
+
children: (board: BoardInteractionsContext) => ReactNode;
|
|
1178
|
+
}
|
|
1179
|
+
declare function BoardState({ children }: BoardStateProps): react_jsx_runtime.JSX.Element;
|
|
1180
|
+
interface BoardHexViewProps<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
1181
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1182
|
+
}> {
|
|
1183
|
+
board: TBoard;
|
|
1184
|
+
spaces: readonly TSpaceView[];
|
|
1185
|
+
children: (view: HexBoardView<TBoard, TSpaceView>) => ReactNode;
|
|
1186
|
+
}
|
|
1187
|
+
declare function BoardHexView<const TBoard extends AnyHexBoardInput, const TSpaceView extends {
|
|
1188
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1189
|
+
}>({ board, spaces, children }: BoardHexViewProps<TBoard, TSpaceView>): react_jsx_runtime.JSX.Element;
|
|
1190
|
+
interface BoardHexGridInteractions {
|
|
1191
|
+
edge?: BoardTargetLayerOptions;
|
|
1192
|
+
vertex?: BoardTargetLayerOptions;
|
|
1193
|
+
space?: BoardTargetLayerOptions;
|
|
1194
|
+
}
|
|
1195
|
+
type BoardHexGridInteractionFilter = "auto" | false | {
|
|
1196
|
+
edge?: readonly string[];
|
|
1197
|
+
vertex?: readonly string[];
|
|
1198
|
+
space?: readonly string[];
|
|
1199
|
+
};
|
|
1200
|
+
type BoardHexGridView<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
1201
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1202
|
+
}> = HexBoardView<TBoard, TSpaceView> & AnyHexBoardInput;
|
|
1203
|
+
type BoardHexGridProps<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
1204
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1205
|
+
}> = Omit<HexGridBoardProps<BoardHexGridView<TBoard, TSpaceView>>, "board" | "interactiveEdges" | "interactiveVertices" | "interactiveSpaces"> & Omit<BoardHexViewProps<TBoard, TSpaceView>, "children"> & {
|
|
1206
|
+
interactions?: BoardHexGridInteractionFilter;
|
|
1207
|
+
};
|
|
1208
|
+
declare function BoardHexGrid<const TBoard extends AnyHexBoardInput, const TSpaceView extends {
|
|
1209
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1210
|
+
}>({ board, spaces, interactions, ...props }: BoardHexGridProps<TBoard, TSpaceView>): react_jsx_runtime.JSX.Element;
|
|
824
1211
|
type BoardTargetExtraInputs = Record<string, unknown> | ((targetId: string) => Record<string, unknown>);
|
|
825
1212
|
type BoardTargetProps<Target extends string = BoardTargetKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
826
1213
|
kind: BoardTargetKind;
|
|
@@ -828,15 +1215,229 @@ type BoardTargetProps<Target extends string = BoardTargetKey> = PrimitiveCommonP
|
|
|
828
1215
|
interaction?: string;
|
|
829
1216
|
input?: string;
|
|
830
1217
|
extraInputs?: BoardTargetExtraInputs;
|
|
831
|
-
onSelect?: (
|
|
1218
|
+
onSelect?: (result: BoardSelectionResult) => void;
|
|
832
1219
|
onSelectError?: (error: unknown) => void;
|
|
833
1220
|
};
|
|
834
1221
|
declare function BoardTarget<Target extends string = BoardTargetKey>({ interaction, input, ...props }: BoardTargetProps<Target>): react_jsx_runtime.JSX.Element;
|
|
1222
|
+
type BoardSpaceTargetProps<Target extends string = BoardTargetKey> = Omit<BoardTargetProps<Target>, "kind">;
|
|
1223
|
+
declare function BoardSpaceTarget<Target extends string = BoardTargetKey>(props: BoardSpaceTargetProps<Target>): react_jsx_runtime.JSX.Element;
|
|
1224
|
+
type BoardEdgeTargetProps<Target extends string = BoardTargetKey> = Omit<BoardTargetProps<Target>, "kind">;
|
|
1225
|
+
declare function BoardEdgeTarget<Target extends string = BoardTargetKey>(props: BoardEdgeTargetProps<Target>): react_jsx_runtime.JSX.Element;
|
|
1226
|
+
type BoardVertexTargetProps<Target extends string = BoardTargetKey> = Omit<BoardTargetProps<Target>, "kind">;
|
|
1227
|
+
declare function BoardVertexTarget<Target extends string = BoardTargetKey>(props: BoardVertexTargetProps<Target>): react_jsx_runtime.JSX.Element;
|
|
835
1228
|
declare const Board: {
|
|
836
1229
|
Root: typeof BoardRoot;
|
|
1230
|
+
State: typeof BoardState;
|
|
1231
|
+
HexGrid: typeof BoardHexGrid;
|
|
1232
|
+
HexView: typeof BoardHexView;
|
|
837
1233
|
Target: typeof BoardTarget;
|
|
1234
|
+
SpaceTarget: typeof BoardSpaceTarget;
|
|
1235
|
+
EdgeTarget: typeof BoardEdgeTarget;
|
|
1236
|
+
VertexTarget: typeof BoardVertexTarget;
|
|
1237
|
+
};
|
|
1238
|
+
|
|
1239
|
+
interface ValidationResult {
|
|
1240
|
+
|
|
1241
|
+
valid: boolean;
|
|
1242
|
+
|
|
1243
|
+
errorCode?: string;
|
|
1244
|
+
|
|
1245
|
+
message?: string;
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
interface SubmissionError extends Error {
|
|
1249
|
+
|
|
1250
|
+
errorCode?: string;
|
|
1251
|
+
}
|
|
1252
|
+
|
|
1253
|
+
interface PluginSessionState {
|
|
1254
|
+
|
|
1255
|
+
status: "loading" | "ready";
|
|
1256
|
+
|
|
1257
|
+
sessionId: string | null;
|
|
1258
|
+
|
|
1259
|
+
controllablePlayerIds: PlayerId[];
|
|
1260
|
+
|
|
1261
|
+
controllingPlayerId: PlayerId | null;
|
|
1262
|
+
|
|
1263
|
+
userId: string | null;
|
|
1264
|
+
}
|
|
1265
|
+
|
|
1266
|
+
interface RuntimeAPI {
|
|
1267
|
+
|
|
1268
|
+
validateInteraction: (playerId: PlayerId, interactionId: string, params: unknown) => Promise<ValidationResult>;
|
|
1269
|
+
|
|
1270
|
+
submitInteraction: (playerId: PlayerId, interactionId: string, params: unknown) => Promise<void>;
|
|
1271
|
+
|
|
1272
|
+
getSessionState: () => PluginSessionState;
|
|
1273
|
+
|
|
1274
|
+
disconnect: () => void;
|
|
1275
|
+
|
|
1276
|
+
switchPlayer?: (playerId: PlayerId) => void;
|
|
1277
|
+
}
|
|
1278
|
+
|
|
1279
|
+
declare function usePluginSession(): PluginSessionState;
|
|
1280
|
+
|
|
1281
|
+
type GamePlayer<PlayerIdValue extends string = PlayerId> = Omit<Player, "playerId"> & {
|
|
1282
|
+
playerId: PlayerIdValue;
|
|
1283
|
+
};
|
|
1284
|
+
type GamePlayerEntry<PlayerIdValue extends string = PlayerId> = GamePlayer<PlayerIdValue> & {
|
|
1285
|
+
index: number;
|
|
1286
|
+
isActive: boolean;
|
|
1287
|
+
isCurrentPlayer: boolean;
|
|
1288
|
+
isControllable: boolean;
|
|
1289
|
+
};
|
|
1290
|
+
interface GamePlayersState<PlayerIdValue extends string = PlayerId> {
|
|
1291
|
+
byId: ReadonlyMap<PlayerIdValue, GamePlayer<PlayerIdValue>>;
|
|
1292
|
+
order: readonly PlayerIdValue[];
|
|
1293
|
+
entries: ReadonlyArray<GamePlayerEntry<PlayerIdValue>>;
|
|
1294
|
+
active: readonly PlayerIdValue[];
|
|
1295
|
+
current: GamePlayer<PlayerIdValue> | null;
|
|
1296
|
+
}
|
|
1297
|
+
interface GameMeState<PlayerIdValue extends string = PlayerId> {
|
|
1298
|
+
playerId: PlayerIdValue | null;
|
|
1299
|
+
player: GamePlayer<PlayerIdValue> | null;
|
|
1300
|
+
controllablePlayerIds: readonly PlayerIdValue[];
|
|
1301
|
+
canAct: boolean;
|
|
1302
|
+
}
|
|
1303
|
+
interface GameTurnState<PlayerIdValue extends string = PlayerId, PhaseValue extends string = string> {
|
|
1304
|
+
phase: PhaseValue | null;
|
|
1305
|
+
stage: string | null;
|
|
1306
|
+
activePlayerIds: readonly PlayerIdValue[];
|
|
1307
|
+
currentPlayerId: PlayerIdValue | null;
|
|
1308
|
+
order: readonly PlayerIdValue[];
|
|
1309
|
+
isMine: boolean;
|
|
1310
|
+
}
|
|
1311
|
+
interface GameRenderState<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string> {
|
|
1312
|
+
view: ViewValue;
|
|
1313
|
+
phase: PhaseValue | null;
|
|
1314
|
+
stage: string | null;
|
|
1315
|
+
session: ReturnType<typeof usePluginSession>;
|
|
1316
|
+
me: GameMeState<PlayerIdValue>;
|
|
1317
|
+
turn: GameTurnState<PlayerIdValue, PhaseValue>;
|
|
1318
|
+
players: GamePlayersState<PlayerIdValue>;
|
|
1319
|
+
}
|
|
1320
|
+
interface GameRootProps<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string> {
|
|
1321
|
+
onActionError?: (error: unknown) => void;
|
|
1322
|
+
children: (state: GameRenderState<ViewValue, PlayerIdValue, PhaseValue>) => ReactNode;
|
|
1323
|
+
}
|
|
1324
|
+
type GameActionErrorHandler = (error: unknown) => void;
|
|
1325
|
+
declare function useGameActionError(): GameActionErrorHandler | null;
|
|
1326
|
+
declare function GameRoot<ViewValue = unknown, PlayerIdValue extends string = PlayerId, PhaseValue extends string = string>({ children, onActionError, }: GameRootProps<ViewValue, PlayerIdValue, PhaseValue>): react_jsx_runtime.JSX.Element;
|
|
1327
|
+
declare const Game: {
|
|
1328
|
+
Root: typeof GameRoot;
|
|
838
1329
|
};
|
|
839
1330
|
|
|
1331
|
+
type InteractionParamsShape = Record<string, unknown>;
|
|
1332
|
+
type InteractionHandleStatus = "open" | "submitting" | "submitted";
|
|
1333
|
+
type DraftValidation<Params extends InteractionParamsShape = InteractionParamsShape> = {
|
|
1334
|
+
ok: true;
|
|
1335
|
+
params: Params;
|
|
1336
|
+
fieldErrors: Partial<Record<keyof Params & string, readonly string[]>>;
|
|
1337
|
+
formErrors: readonly string[];
|
|
1338
|
+
missing: ReadonlyArray<keyof Params & string>;
|
|
1339
|
+
} | {
|
|
1340
|
+
ok: false;
|
|
1341
|
+
fieldErrors: Partial<Record<keyof Params & string, readonly string[]>>;
|
|
1342
|
+
formErrors: readonly string[];
|
|
1343
|
+
missing: ReadonlyArray<keyof Params & string>;
|
|
1344
|
+
};
|
|
1345
|
+
|
|
1346
|
+
interface InteractionHandle<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
1347
|
+
descriptor: InteractionDescriptor;
|
|
1348
|
+
|
|
1349
|
+
commit: InteractionDescriptor["commit"];
|
|
1350
|
+
|
|
1351
|
+
submit: (params?: Params) => Promise<void>;
|
|
1352
|
+
|
|
1353
|
+
validate: (params?: Params) => Promise<void>;
|
|
1354
|
+
|
|
1355
|
+
validateDraft: () => DraftValidation<Params>;
|
|
1356
|
+
|
|
1357
|
+
validateDraftServer: () => Promise<void>;
|
|
1358
|
+
|
|
1359
|
+
submitDraft: () => Promise<void>;
|
|
1360
|
+
|
|
1361
|
+
available: boolean;
|
|
1362
|
+
|
|
1363
|
+
unavailableReason?: string;
|
|
1364
|
+
|
|
1365
|
+
status: InteractionHandleStatus;
|
|
1366
|
+
|
|
1367
|
+
draft: Readonly<Partial<Params>>;
|
|
1368
|
+
|
|
1369
|
+
values: Readonly<Partial<Params> & Pick<Params, DefaultedKeys>>;
|
|
1370
|
+
|
|
1371
|
+
setInput: <K extends keyof Params & string>(key: K, value: Params[K]) => void;
|
|
1372
|
+
|
|
1373
|
+
clearInput: (key?: keyof Params & string) => void;
|
|
1374
|
+
|
|
1375
|
+
isReady: boolean;
|
|
1376
|
+
|
|
1377
|
+
isArmed: boolean;
|
|
1378
|
+
|
|
1379
|
+
arm: () => void;
|
|
1380
|
+
|
|
1381
|
+
disarm: () => void;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
declare function useInteractionHandle<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>(descriptor: InteractionDescriptor): InteractionHandle<Params, DefaultedKeys>;
|
|
1385
|
+
|
|
1386
|
+
interface InteractionFieldRenderProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
1387
|
+
descriptor: InteractionDescriptor;
|
|
1388
|
+
input: InteractionInputDescriptor & {
|
|
1389
|
+
key: Key;
|
|
1390
|
+
};
|
|
1391
|
+
handle: InteractionHandle<Params>;
|
|
1392
|
+
value: Params[Key] | undefined;
|
|
1393
|
+
setValue: (value: Params[Key]) => void;
|
|
1394
|
+
clearValue: () => void;
|
|
1395
|
+
errors: readonly string[];
|
|
1396
|
+
missing: boolean;
|
|
1397
|
+
disabled: boolean;
|
|
1398
|
+
}
|
|
1399
|
+
type InteractionFieldRenderMap<Params extends InteractionParamsShape = InteractionParamsShape> = Partial<{
|
|
1400
|
+
[K in keyof Params & string]: (props: InteractionFieldRenderProps<Params, K>) => ReactNode;
|
|
1401
|
+
}>;
|
|
1402
|
+
interface InteractionFieldProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
1403
|
+
descriptor: InteractionDescriptor;
|
|
1404
|
+
inputKey: Key;
|
|
1405
|
+
handle: InteractionHandle<Params>;
|
|
1406
|
+
errors?: readonly string[];
|
|
1407
|
+
missing?: boolean;
|
|
1408
|
+
disabled?: boolean;
|
|
1409
|
+
render?: InteractionFieldRenderMap<Params>[Key];
|
|
1410
|
+
}
|
|
1411
|
+
interface InteractionFormProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
1412
|
+
descriptor: InteractionDescriptor;
|
|
1413
|
+
handle: InteractionHandle<Params, DefaultedKeys>;
|
|
1414
|
+
fields?: ReadonlyArray<keyof Params & string>;
|
|
1415
|
+
hiddenFields?: ReadonlyArray<keyof Params & string>;
|
|
1416
|
+
renderFields?: InteractionFieldRenderMap<Params>;
|
|
1417
|
+
title?: ReactNode;
|
|
1418
|
+
description?: ReactNode;
|
|
1419
|
+
submitLabel?: ReactNode;
|
|
1420
|
+
cancelLabel?: ReactNode;
|
|
1421
|
+
onCancel?: () => void;
|
|
1422
|
+
onSubmitSuccess?: () => void;
|
|
1423
|
+
disabled?: boolean;
|
|
1424
|
+
accordion?: boolean;
|
|
1425
|
+
defaultOpen?: boolean;
|
|
1426
|
+
style?: CSSProperties;
|
|
1427
|
+
}
|
|
1428
|
+
declare function InteractionForm<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>({ descriptor, handle, fields, hiddenFields, renderFields, title, description, submitLabel, cancelLabel, onCancel, onSubmitSuccess, disabled, accordion, defaultOpen, style, }: InteractionFormProps<Params, DefaultedKeys>): react_jsx_runtime.JSX.Element;
|
|
1429
|
+
declare function hasDefaultInteractionFormFields(descriptor: Pick<InteractionDescriptor, "inputs">): boolean;
|
|
1430
|
+
declare function defaultFormInputs(descriptor: Pick<InteractionDescriptor, "inputs">, values?: Readonly<Record<string, unknown>>): InteractionInputDescriptor[];
|
|
1431
|
+
|
|
1432
|
+
type BoundInteractionFormProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> = Omit<InteractionFormProps<Params, DefaultedKeys>, "descriptor" | "handle">;
|
|
1433
|
+
|
|
1434
|
+
interface InteractionSubmitCallbacks {
|
|
1435
|
+
onSubmitSuccess?: () => void;
|
|
1436
|
+
onSubmitError?: (error: unknown) => void;
|
|
1437
|
+
}
|
|
1438
|
+
|
|
1439
|
+
type DialogLifecycleState = "open" | "minimized" | "dismissed";
|
|
1440
|
+
|
|
840
1441
|
interface InteractionContextValue {
|
|
841
1442
|
interaction: string;
|
|
842
1443
|
descriptor: InteractionDescriptor | null;
|
|
@@ -849,6 +1450,37 @@ interface InteractionRootProps<Interaction extends string = InteractionKey> {
|
|
|
849
1450
|
unavailable?: "render" | "hide";
|
|
850
1451
|
}
|
|
851
1452
|
declare function InteractionRoot<Interaction extends string = InteractionKey>({ interaction, children, unavailable, }: InteractionRootProps<Interaction>): react_jsx_runtime.JSX.Element | null;
|
|
1453
|
+
type InteractionDialogState = DialogLifecycleState;
|
|
1454
|
+
interface InteractionDialogRenderState<Interaction extends string = InteractionKey> {
|
|
1455
|
+
interaction: Interaction;
|
|
1456
|
+
state: InteractionDialogState;
|
|
1457
|
+
open: boolean;
|
|
1458
|
+
minimized: boolean;
|
|
1459
|
+
dismissed: boolean;
|
|
1460
|
+
setOpen: (open: boolean) => void;
|
|
1461
|
+
restore: () => void;
|
|
1462
|
+
minimize: () => void;
|
|
1463
|
+
dismiss: () => void;
|
|
1464
|
+
}
|
|
1465
|
+
interface InteractionDialogProps<Interaction extends string = InteractionKey> {
|
|
1466
|
+
defaultOpen?: boolean;
|
|
1467
|
+
onStateChange?: (state: InteractionDialogState) => void;
|
|
1468
|
+
children: (state: InteractionDialogRenderState<Interaction>) => ReactNode;
|
|
1469
|
+
}
|
|
1470
|
+
declare function InteractionDialog<Interaction extends string = InteractionKey>({ defaultOpen, onStateChange, children, }: InteractionDialogProps<Interaction>): react_jsx_runtime.JSX.Element;
|
|
1471
|
+
interface InteractionSwitchRenderState<Interaction extends string = InteractionKey> {
|
|
1472
|
+
interaction: Interaction;
|
|
1473
|
+
descriptor: InteractionDescriptor<Interaction>;
|
|
1474
|
+
}
|
|
1475
|
+
type InteractionRouteMap<Interaction extends string = InteractionKey> = {
|
|
1476
|
+
[Key in Interaction]?: (state: InteractionSwitchRenderState<Key>) => ReactNode;
|
|
1477
|
+
};
|
|
1478
|
+
interface InteractionSwitchProps<Interaction extends string = InteractionKey> {
|
|
1479
|
+
interaction?: Interaction;
|
|
1480
|
+
routes: InteractionRouteMap<Interaction>;
|
|
1481
|
+
fallback?: ReactNode;
|
|
1482
|
+
}
|
|
1483
|
+
declare function InteractionSwitch<Interaction extends string = InteractionKey>({ interaction, routes, fallback, }: InteractionSwitchProps<Interaction>): react_jsx_runtime.JSX.Element;
|
|
852
1484
|
type InteractionPartProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
853
1485
|
declare function InteractionLabel({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
854
1486
|
declare function InteractionDescription({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
@@ -856,8 +1488,39 @@ declare function InteractionUnavailableMessage({ children, ...props }: Interacti
|
|
|
856
1488
|
declare function InteractionValidationMessage({ children, ...props }: InteractionPartProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
857
1489
|
type InteractionTriggerProps = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement>;
|
|
858
1490
|
declare function InteractionTrigger({ disabled, onClick, ...props }: InteractionTriggerProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
859
|
-
|
|
860
|
-
|
|
1491
|
+
interface InteractionStateSnapshot<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
1492
|
+
interaction: string;
|
|
1493
|
+
descriptor: InteractionDescriptor;
|
|
1494
|
+
handle: InteractionHandle<Params, DefaultedKeys>;
|
|
1495
|
+
draft: InteractionHandle<Params, DefaultedKeys>["draft"];
|
|
1496
|
+
values: InteractionHandle<Params, DefaultedKeys>["values"];
|
|
1497
|
+
status: InteractionHandle<Params, DefaultedKeys>["status"];
|
|
1498
|
+
available: boolean;
|
|
1499
|
+
isReady: boolean;
|
|
1500
|
+
isArmed: boolean;
|
|
1501
|
+
inputKeys: readonly string[];
|
|
1502
|
+
missingInputs: readonly string[];
|
|
1503
|
+
readyFrontier: readonly string[];
|
|
1504
|
+
blockedInputs: readonly string[];
|
|
1505
|
+
hasInputs: boolean;
|
|
1506
|
+
}
|
|
1507
|
+
interface InteractionStateProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
1508
|
+
unavailable: ReactNode;
|
|
1509
|
+
children: (state: InteractionStateSnapshot<Params, DefaultedKeys>) => ReactNode;
|
|
1510
|
+
}
|
|
1511
|
+
declare function InteractionState<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>({ children, unavailable }: InteractionStateProps<Params, DefaultedKeys>): react_jsx_runtime.JSX.Element;
|
|
1512
|
+
type InteractionFormPrimitiveProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> = BoundInteractionFormProps<Params, DefaultedKeys>;
|
|
1513
|
+
declare function InteractionFormPrimitive<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>(props: InteractionFormPrimitiveProps<Params, DefaultedKeys>): react_jsx_runtime.JSX.Element | null;
|
|
1514
|
+
type InteractionFieldPrimitiveProps<Params extends InteractionParamsShape = InteractionParamsShape, Input extends keyof Params & string = keyof Params & string> = Omit<InteractionFieldProps<Params, Input>, "descriptor" | "handle" | "inputKey"> & {
|
|
1515
|
+
input: Input;
|
|
1516
|
+
};
|
|
1517
|
+
declare function InteractionFieldPrimitive<Params extends InteractionParamsShape = InteractionParamsShape, Input extends keyof Params & string = keyof Params & string>({ input, ...props }: InteractionFieldPrimitiveProps<Params, Input>): react_jsx_runtime.JSX.Element | null;
|
|
1518
|
+
type InteractionSubmitProps = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
1519
|
+
params?: InteractionParamsShape | (() => InteractionParamsShape | null | undefined);
|
|
1520
|
+
onSubmitSuccess?: InteractionSubmitCallbacks["onSubmitSuccess"];
|
|
1521
|
+
onSubmitError?: InteractionSubmitCallbacks["onSubmitError"];
|
|
1522
|
+
};
|
|
1523
|
+
declare function InteractionSubmit({ disabled, onClick, params, onSubmitSuccess, onSubmitError, ...props }: InteractionSubmitProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
861
1524
|
type InteractionInputProps = PrimitiveCommonProps & Omit<InputHTMLAttributes<HTMLInputElement>, "name"> & {
|
|
862
1525
|
name: string;
|
|
863
1526
|
parse?: (value: string) => unknown;
|
|
@@ -865,21 +1528,25 @@ type InteractionInputProps = PrimitiveCommonProps & Omit<InputHTMLAttributes<HTM
|
|
|
865
1528
|
declare function InteractionInput({ name, parse, onChange, disabled, ...props }: InteractionInputProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
866
1529
|
type InteractionCardInputProps<Input extends string = InteractionInputKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
867
1530
|
input: Input;
|
|
868
|
-
|
|
869
|
-
card?: string;
|
|
1531
|
+
unsafeCardId?: string;
|
|
870
1532
|
selected?: boolean;
|
|
871
1533
|
onSelectedChange?: (selected: boolean) => void;
|
|
872
1534
|
};
|
|
873
|
-
declare function InteractionCardInput<Input extends string = InteractionInputKey>({ input,
|
|
1535
|
+
declare function InteractionCardInput<Input extends string = InteractionInputKey>({ input, unsafeCardId, selected, onSelectedChange, onClick, disabled, children, ...props }: InteractionCardInputProps<Input>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
874
1536
|
declare const Interaction: {
|
|
875
1537
|
Root: typeof InteractionRoot;
|
|
1538
|
+
State: typeof InteractionState;
|
|
1539
|
+
Switch: typeof InteractionSwitch;
|
|
1540
|
+
Dialog: typeof InteractionDialog;
|
|
876
1541
|
Trigger: typeof InteractionTrigger;
|
|
877
1542
|
Label: typeof InteractionLabel;
|
|
878
1543
|
Description: typeof InteractionDescription;
|
|
879
1544
|
UnavailableMessage: typeof InteractionUnavailableMessage;
|
|
880
1545
|
ValidationMessage: typeof InteractionValidationMessage;
|
|
881
1546
|
Input: typeof InteractionInput;
|
|
1547
|
+
Field: typeof InteractionFieldPrimitive;
|
|
882
1548
|
CardInput: typeof InteractionCardInput;
|
|
1549
|
+
Form: typeof InteractionFormPrimitive;
|
|
883
1550
|
Submit: typeof InteractionSubmit;
|
|
884
1551
|
};
|
|
885
1552
|
|
|
@@ -903,9 +1570,9 @@ interface PlayerRosterBadge {
|
|
|
903
1570
|
tooltip?: string;
|
|
904
1571
|
}
|
|
905
1572
|
interface PlayerRosterEntry {
|
|
906
|
-
playerId: PlayerId
|
|
1573
|
+
playerId: PlayerId;
|
|
907
1574
|
name: string;
|
|
908
|
-
color?:
|
|
1575
|
+
color?: HexColor;
|
|
909
1576
|
index: number;
|
|
910
1577
|
isActive: boolean;
|
|
911
1578
|
isCurrentPlayer: boolean;
|
|
@@ -920,10 +1587,10 @@ interface PlayerRosterRootProps {
|
|
|
920
1587
|
children: ReactNode;
|
|
921
1588
|
order?: "turn" | "self-first";
|
|
922
1589
|
include?: "all" | "self" | "opponents";
|
|
923
|
-
score?: (playerId: PlayerId
|
|
924
|
-
scoreLabel?: string | ((playerId: PlayerId
|
|
925
|
-
badges?: (playerId: PlayerId
|
|
926
|
-
metadata?: (playerId: PlayerId
|
|
1590
|
+
score?: (playerId: PlayerId) => number | undefined;
|
|
1591
|
+
scoreLabel?: string | ((playerId: PlayerId) => string | undefined);
|
|
1592
|
+
badges?: (playerId: PlayerId) => ReadonlyArray<PlayerRosterBadge | null | false | undefined>;
|
|
1593
|
+
metadata?: (playerId: PlayerId) => Record<string, unknown> | undefined;
|
|
927
1594
|
}
|
|
928
1595
|
declare function PlayerRosterRoot({ children, order, include, score, scoreLabel, badges, metadata, }: PlayerRosterRootProps): react_jsx_runtime.JSX.Element;
|
|
929
1596
|
type PlayerRosterListProps = Omit<PrimitiveCommonProps, "children"> & Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
@@ -964,31 +1631,54 @@ declare function PromptMessage(props: InteractionPartProps): react_jsx_runtime.J
|
|
|
964
1631
|
type PromptOptionProps<Option extends string = PromptOptionKey> = PrimitiveCommonProps & ButtonHTMLAttributes<HTMLButtonElement> & {
|
|
965
1632
|
value: Option;
|
|
966
1633
|
disableWhenUnavailable?: boolean;
|
|
967
|
-
onSubmitError?:
|
|
968
|
-
onSubmitSuccess?:
|
|
1634
|
+
onSubmitError?: InteractionSubmitCallbacks["onSubmitError"];
|
|
1635
|
+
onSubmitSuccess?: InteractionSubmitCallbacks["onSubmitSuccess"];
|
|
969
1636
|
};
|
|
970
1637
|
declare function PromptOption<Option extends string = PromptOptionKey>({ value, disabled, disableWhenUnavailable, onClick, onSubmitError, onSubmitSuccess, children, ...props }: PromptOptionProps<Option>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
1638
|
+
interface PromptOptionRenderItem {
|
|
1639
|
+
id: string;
|
|
1640
|
+
label?: string;
|
|
1641
|
+
}
|
|
1642
|
+
interface PromptOptionsProps {
|
|
1643
|
+
children: (option: PromptOptionRenderItem) => ReactNode;
|
|
1644
|
+
}
|
|
1645
|
+
declare function PromptOptions({ children }: PromptOptionsProps): react_jsx_runtime.JSX.Element;
|
|
1646
|
+
type PromptDialogState = DialogLifecycleState;
|
|
1647
|
+
interface PromptDialogRenderState<Prompt extends string = PromptKey> {
|
|
1648
|
+
prompt: Prompt;
|
|
1649
|
+
state: PromptDialogState;
|
|
1650
|
+
open: boolean;
|
|
1651
|
+
minimized: boolean;
|
|
1652
|
+
dismissed: boolean;
|
|
1653
|
+
setOpen: (open: boolean) => void;
|
|
1654
|
+
restore: () => void;
|
|
1655
|
+
minimize: () => void;
|
|
1656
|
+
dismiss: () => void;
|
|
1657
|
+
}
|
|
1658
|
+
interface PromptDialogProps<Prompt extends string = PromptKey> {
|
|
1659
|
+
prompt: Prompt;
|
|
1660
|
+
defaultOpen?: boolean;
|
|
1661
|
+
onStateChange?: (state: PromptDialogState) => void;
|
|
1662
|
+
children: (state: PromptDialogRenderState<Prompt>) => ReactNode;
|
|
1663
|
+
}
|
|
1664
|
+
declare function PromptDialog<Prompt extends string = PromptKey>({ prompt, defaultOpen, onStateChange, children, }: PromptDialogProps<Prompt>): react_jsx_runtime.JSX.Element;
|
|
977
1665
|
declare function PromptInboxRoot({ children }: {
|
|
978
1666
|
children: ReactNode;
|
|
979
1667
|
}): react_jsx_runtime.JSX.Element;
|
|
980
1668
|
declare function PromptInboxEmpty({ children }: {
|
|
981
1669
|
children?: ReactNode;
|
|
982
1670
|
}): react_jsx_runtime.JSX.Element | null;
|
|
983
|
-
|
|
984
|
-
children
|
|
985
|
-
}
|
|
1671
|
+
interface PromptInboxItemsProps {
|
|
1672
|
+
children: (prompt: InteractionDescriptor) => ReactNode;
|
|
1673
|
+
}
|
|
1674
|
+
declare function PromptInboxItems({ children }: PromptInboxItemsProps): react_jsx_runtime.JSX.Element;
|
|
986
1675
|
declare const Prompt: {
|
|
987
1676
|
Root: typeof PromptRoot;
|
|
988
1677
|
Title: typeof PromptTitle;
|
|
989
1678
|
Message: typeof PromptMessage;
|
|
990
1679
|
Option: typeof PromptOption;
|
|
991
1680
|
Options: typeof PromptOptions;
|
|
1681
|
+
Dialog: typeof PromptDialog;
|
|
992
1682
|
};
|
|
993
1683
|
declare const PromptInbox: {
|
|
994
1684
|
Root: typeof PromptInboxRoot;
|
|
@@ -996,6 +1686,36 @@ declare const PromptInbox: {
|
|
|
996
1686
|
Items: typeof PromptInboxItems;
|
|
997
1687
|
};
|
|
998
1688
|
|
|
1689
|
+
type DiceValue = number | null | undefined;
|
|
1690
|
+
interface DiceState {
|
|
1691
|
+
values: ReadonlyArray<number | undefined> | undefined;
|
|
1692
|
+
|
|
1693
|
+
sum: number | undefined;
|
|
1694
|
+
diceCount: number;
|
|
1695
|
+
allRolled: boolean;
|
|
1696
|
+
}
|
|
1697
|
+
interface DiceRootProps {
|
|
1698
|
+
values?: readonly DiceValue[] | null;
|
|
1699
|
+
|
|
1700
|
+
count?: number;
|
|
1701
|
+
children: ReactNode;
|
|
1702
|
+
}
|
|
1703
|
+
interface DiceValuesProps {
|
|
1704
|
+
children: (state: DiceState) => ReactNode;
|
|
1705
|
+
}
|
|
1706
|
+
interface DiceComponents {
|
|
1707
|
+
Root(props: DiceRootProps): ReactNode;
|
|
1708
|
+
Values(props: DiceValuesProps): ReactNode;
|
|
1709
|
+
}
|
|
1710
|
+
declare function normalizeDiceState({ values, count, }: {
|
|
1711
|
+
values?: readonly DiceValue[] | null;
|
|
1712
|
+
count?: number;
|
|
1713
|
+
}): DiceState;
|
|
1714
|
+
declare function DiceRoot({ values, count, children }: DiceRootProps): react_jsx_runtime.JSX.Element;
|
|
1715
|
+
declare function useDicePrimitiveContext(): DiceState;
|
|
1716
|
+
declare function DiceValues({ children }: DiceValuesProps): ReactNode;
|
|
1717
|
+
declare const Dice: DiceComponents;
|
|
1718
|
+
|
|
999
1719
|
interface ZoneContextValue {
|
|
1000
1720
|
zone: string;
|
|
1001
1721
|
snapshot: ZoneHandlesSnapshot | null;
|
|
@@ -1004,22 +1724,114 @@ interface ZoneCardContextValue {
|
|
|
1004
1724
|
zone: string;
|
|
1005
1725
|
cardId: string;
|
|
1006
1726
|
}
|
|
1727
|
+
|
|
1728
|
+
type ZoneCardRenderItem<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> = HydratedZoneCardRenderItem<CardIdValue, CardTypeValue, Properties> | HiddenZoneCardRenderItem<CardIdValue>;
|
|
1729
|
+
interface HydratedZoneCardRenderItem<CardIdValue extends string = string, CardTypeValue extends string = string, Properties extends Record<string, unknown> = Record<string, unknown>> extends ViewCard<CardIdValue, CardTypeValue, Properties> {
|
|
1730
|
+
zone: string;
|
|
1731
|
+
index: number;
|
|
1732
|
+
hidden: false;
|
|
1733
|
+
playable: boolean;
|
|
1734
|
+
interactions: readonly InteractionDescriptor[];
|
|
1735
|
+
}
|
|
1736
|
+
interface HiddenZoneCardRenderItem<CardIdValue extends string = string> {
|
|
1737
|
+
id: CardIdValue;
|
|
1738
|
+
zone: string;
|
|
1739
|
+
index: number;
|
|
1740
|
+
hidden: true;
|
|
1741
|
+
}
|
|
1742
|
+
interface ZonePileContextValue {
|
|
1743
|
+
zone: string;
|
|
1744
|
+
label: string;
|
|
1745
|
+
count: number;
|
|
1746
|
+
cards: readonly string[];
|
|
1747
|
+
items: readonly ZoneCardRenderItem[];
|
|
1748
|
+
hasVisibleCards: boolean;
|
|
1749
|
+
isHidden: boolean;
|
|
1750
|
+
description: string | null;
|
|
1751
|
+
}
|
|
1007
1752
|
declare function useZonePrimitiveContext(): ZoneContextValue;
|
|
1753
|
+
declare function useOptionalZonePrimitiveContext(): ZoneContextValue | null;
|
|
1008
1754
|
declare function useZoneCardContext(): ZoneCardContextValue | null;
|
|
1755
|
+
declare function useZonePileContext(): ZonePileContextValue;
|
|
1009
1756
|
interface ZoneRootProps<Zone extends string = ZoneKey> extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
|
|
1010
1757
|
zone: Zone;
|
|
1011
1758
|
}
|
|
1012
1759
|
declare function ZoneRoot<Zone extends string = ZoneKey>({ zone, children, ...props }: ZoneRootProps<Zone>): react_jsx_runtime.JSX.Element;
|
|
1013
|
-
|
|
1014
|
-
|
|
1760
|
+
interface ZoneListProps extends Omit<PrimitiveCommonProps, "children">, Omit<HTMLAttributes<HTMLElement>, "children"> {
|
|
1761
|
+
children?: ReactNode | ((card: ZoneCardRenderItem) => ReactNode);
|
|
1762
|
+
empty?: ReactNode;
|
|
1763
|
+
sort?: (a: ZoneCardRenderItem, b: ZoneCardRenderItem) => number;
|
|
1764
|
+
}
|
|
1765
|
+
declare function ZoneList({ children, empty, sort, ...props }: ZoneListProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1015
1766
|
interface ZoneItemProps extends PrimitiveCommonProps, HTMLAttributes<HTMLElement> {
|
|
1016
|
-
card: string;
|
|
1767
|
+
card: string | ZoneCardRenderItem;
|
|
1017
1768
|
}
|
|
1018
1769
|
declare function ZoneItem({ card, children, ...props }: ZoneItemProps): react_jsx_runtime.JSX.Element;
|
|
1770
|
+
interface ZoneCardAtProps<Zone extends string = ZoneKey> extends Omit<ZoneItemProps, "card" | "children"> {
|
|
1771
|
+
zone?: Zone;
|
|
1772
|
+
index: number;
|
|
1773
|
+
children?: ReactNode | ((card: ZoneCardRenderItem) => ReactNode);
|
|
1774
|
+
empty?: ReactNode;
|
|
1775
|
+
}
|
|
1776
|
+
declare function ZoneCardAt<Zone extends string = ZoneKey>({ zone, ...props }: ZoneCardAtProps<Zone>): react_jsx_runtime.JSX.Element;
|
|
1777
|
+
type ZoneTopCardProps<Zone extends string = ZoneKey> = Omit<ZoneCardAtProps<Zone>, "index">;
|
|
1778
|
+
declare function ZoneTopCard<Zone extends string = ZoneKey>(props: ZoneTopCardProps<Zone>): react_jsx_runtime.JSX.Element;
|
|
1779
|
+
type ZoneCardActionExtraInputs = Record<string, unknown> | ((cardId: string) => Record<string, unknown>);
|
|
1780
|
+
interface ZoneCardActionProps<Card extends string = string> extends PrimitiveCommonProps, Omit<ButtonHTMLAttributes<HTMLButtonElement>, "onSelect"> {
|
|
1781
|
+
card?: Card;
|
|
1782
|
+
interaction?: string;
|
|
1783
|
+
input?: string;
|
|
1784
|
+
extraInputs?: ZoneCardActionExtraInputs;
|
|
1785
|
+
onSelect?: (result: ZoneCardActionResult) => void;
|
|
1786
|
+
onSelectError?: (error: unknown) => void;
|
|
1787
|
+
}
|
|
1788
|
+
type ZoneCardActionResult = {
|
|
1789
|
+
status: "none";
|
|
1790
|
+
} | {
|
|
1791
|
+
status: "pending";
|
|
1792
|
+
interactionKey: string;
|
|
1793
|
+
descriptor: InteractionDescriptor;
|
|
1794
|
+
missingInputs: readonly string[];
|
|
1795
|
+
} | {
|
|
1796
|
+
status: "submitted";
|
|
1797
|
+
interactionKey: string;
|
|
1798
|
+
descriptor: InteractionDescriptor;
|
|
1799
|
+
};
|
|
1800
|
+
declare function ZoneCardAction<Card extends string = string>({ card, interaction, input, extraInputs, onSelect, onSelectError, disabled, onClick, children, ...props }: ZoneCardActionProps<Card>): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1801
|
+
interface ZonePileRootProps<Zone extends string = ZoneKey> extends Omit<ZoneRootProps<Zone>, "children"> {
|
|
1802
|
+
label: string;
|
|
1803
|
+
children?: ReactNode;
|
|
1804
|
+
hiddenDescription?: string | null;
|
|
1805
|
+
emptyDescription?: string | null;
|
|
1806
|
+
visibleDescription?: ((count: number) => string) | null;
|
|
1807
|
+
}
|
|
1808
|
+
declare function ZonePileRoot<Zone extends string = ZoneKey>({ zone, label, hiddenDescription, emptyDescription, visibleDescription, children, ...props }: ZonePileRootProps<Zone>): react_jsx_runtime.JSX.Element;
|
|
1809
|
+
interface ZonePileTriggerProps extends PrimitiveCommonProps, ButtonHTMLAttributes<HTMLButtonElement> {
|
|
1810
|
+
}
|
|
1811
|
+
declare function ZonePileTrigger({ children, ...props }: ZonePileTriggerProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1812
|
+
type ZonePileLabelProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
1813
|
+
declare function ZonePileLabel({ children, ...props }: ZonePileLabelProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1814
|
+
type ZonePileCountProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
1815
|
+
declare function ZonePileCount({ children, ...props }: ZonePileCountProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
1816
|
+
type ZonePileDescriptionProps = PrimitiveCommonProps & HTMLAttributes<HTMLElement>;
|
|
1817
|
+
declare function ZonePileDescription({ children, ...props }: ZonePileDescriptionProps): React$1.ReactElement<unknown, string | React$1.JSXElementConstructor<any>> | null;
|
|
1818
|
+
interface ZonePileCardsProps extends Omit<ZoneListProps, "children"> {
|
|
1819
|
+
renderCard: (card: ZoneCardRenderItem) => ReactNode;
|
|
1820
|
+
}
|
|
1821
|
+
declare function ZonePileCards({ renderCard, ...props }: ZonePileCardsProps): react_jsx_runtime.JSX.Element | null;
|
|
1019
1822
|
declare const Zone: {
|
|
1020
1823
|
Root: typeof ZoneRoot;
|
|
1021
1824
|
List: typeof ZoneList;
|
|
1022
1825
|
Item: typeof ZoneItem;
|
|
1826
|
+
CardAt: typeof ZoneCardAt;
|
|
1827
|
+
TopCard: typeof ZoneTopCard;
|
|
1828
|
+
CardAction: typeof ZoneCardAction;
|
|
1829
|
+
PileRoot: typeof ZonePileRoot;
|
|
1830
|
+
PileTrigger: typeof ZonePileTrigger;
|
|
1831
|
+
PileLabel: typeof ZonePileLabel;
|
|
1832
|
+
PileCount: typeof ZonePileCount;
|
|
1833
|
+
PileDescription: typeof ZonePileDescription;
|
|
1834
|
+
PileCards: typeof ZonePileCards;
|
|
1023
1835
|
};
|
|
1024
1836
|
|
|
1025
1837
|
interface DreamboardUIRegister {
|
|
@@ -1030,6 +1842,7 @@ interface UIContract {
|
|
|
1030
1842
|
inputs?: UIContractBucket;
|
|
1031
1843
|
prompts?: UIContractBucket;
|
|
1032
1844
|
promptOptions?: UIContractBucket;
|
|
1845
|
+
players?: UIContractBucket;
|
|
1033
1846
|
zones?: UIContractBucket;
|
|
1034
1847
|
cards?: UIContractBucket;
|
|
1035
1848
|
phases?: UIContractBucket;
|
|
@@ -1039,339 +1852,158 @@ type RegisteredUIContract = DreamboardUIRegister extends {
|
|
|
1039
1852
|
ui: infer Registered extends UIContract;
|
|
1040
1853
|
} ? Registered : UIContract;
|
|
1041
1854
|
type BucketOf<Contract extends UIContract, Key extends keyof UIContract> = NonNullable<Contract[Key]> extends UIContractBucket ? NonNullable<Contract[Key]> : UIContractBucket;
|
|
1042
|
-
type
|
|
1855
|
+
type StringKeyOf<Bucket extends UIContractBucket> = Extract<keyof Bucket, string>;
|
|
1856
|
+
type StringKeysOrFallback<Bucket extends UIContractBucket> = [
|
|
1857
|
+
StringKeyOf<Bucket>
|
|
1858
|
+
] extends [never] ? string : string extends StringKeyOf<Bucket> ? string : StringKeyOf<Bucket>;
|
|
1043
1859
|
type RegisteredUI = RegisteredUIContract;
|
|
1044
1860
|
type InteractionKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "interactions">>;
|
|
1045
1861
|
type InteractionInputKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "inputs">>;
|
|
1046
1862
|
type PromptKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "prompts">>;
|
|
1047
1863
|
type PromptOptionKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "promptOptions">>;
|
|
1864
|
+
type PlayerKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "players">>;
|
|
1048
1865
|
type ZoneKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "zones">>;
|
|
1049
1866
|
type CardKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "cards">>;
|
|
1050
1867
|
type PhaseKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "phases">>;
|
|
1051
1868
|
type BoardTargetKey<Contract extends UIContract = RegisteredUI> = StringKeysOrFallback<BucketOf<Contract, "boardTargets">>;
|
|
1052
|
-
type
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
};
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
};
|
|
1074
|
-
type TypedBoard<Contract extends UIContract> = Omit<typeof Board, "Target"> & {
|
|
1075
|
-
Target<Target extends BoardTargetKey<Contract>>(props: Omit<BoardTargetProps, "value"> & {
|
|
1076
|
-
value: Target;
|
|
1077
|
-
}): ReactElement;
|
|
1078
|
-
};
|
|
1079
|
-
interface DreamboardUI<Contract extends UIContract = RegisteredUI> {
|
|
1080
|
-
readonly contract: Contract;
|
|
1081
|
-
readonly Interaction: TypedInteraction<Contract>;
|
|
1082
|
-
readonly Prompt: TypedPrompt<Contract>;
|
|
1083
|
-
readonly PromptInbox: TypedPromptInbox;
|
|
1084
|
-
readonly PlayerRoster: TypedPlayerRoster;
|
|
1085
|
-
readonly PromptDialogHost: (props: PromptDialogHostProps) => ReactElement | null;
|
|
1086
|
-
readonly Phase: TypedPhase<Contract>;
|
|
1087
|
-
readonly Zone: TypedZone<Contract>;
|
|
1088
|
-
readonly Board: TypedBoard<Contract>;
|
|
1089
|
-
}
|
|
1090
|
-
declare function createDreamboardUI<const Contract extends UIContract>(contract: Contract): DreamboardUI<Contract>;
|
|
1091
|
-
|
|
1092
|
-
type RuntimeFields = Record<string, unknown>;
|
|
1093
|
-
interface GeneratedTiledEdgeStateLike<SpaceIdValue extends string = string, EdgeIdValue extends string = string, Fields = RuntimeFields> {
|
|
1094
|
-
id: EdgeIdValue;
|
|
1095
|
-
spaceIds: readonly SpaceIdValue[];
|
|
1096
|
-
typeId?: EdgeTypeId | null;
|
|
1097
|
-
label?: string | null;
|
|
1098
|
-
ownerId?: PlayerId$1 | null;
|
|
1099
|
-
fields?: Fields;
|
|
1100
|
-
}
|
|
1101
|
-
interface GeneratedTiledVertexStateLike<SpaceIdValue extends string = string, VertexIdValue extends string = string, Fields = RuntimeFields> {
|
|
1102
|
-
id: VertexIdValue;
|
|
1103
|
-
spaceIds: readonly SpaceIdValue[];
|
|
1104
|
-
typeId?: VertexTypeId | null;
|
|
1105
|
-
label?: string | null;
|
|
1106
|
-
ownerId?: PlayerId$1 | null;
|
|
1107
|
-
fields?: Fields;
|
|
1108
|
-
}
|
|
1109
|
-
interface GeneratedHexSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
1110
|
-
id: SpaceIdValue;
|
|
1111
|
-
q: number;
|
|
1112
|
-
r: number;
|
|
1113
|
-
typeId?: SpaceTypeId | null;
|
|
1114
|
-
label?: string | null;
|
|
1115
|
-
ownerId?: PlayerId$1 | null;
|
|
1116
|
-
fields?: Fields;
|
|
1117
|
-
}
|
|
1118
|
-
interface GeneratedSquareSpaceStateLike<SpaceIdValue extends string = string, Fields = RuntimeFields> {
|
|
1119
|
-
id: SpaceIdValue;
|
|
1120
|
-
row: number;
|
|
1121
|
-
col: number;
|
|
1122
|
-
typeId?: SpaceTypeId | null;
|
|
1123
|
-
label?: string | null;
|
|
1124
|
-
ownerId?: PlayerId$1 | null;
|
|
1125
|
-
fields?: Fields;
|
|
1126
|
-
}
|
|
1127
|
-
interface GeneratedHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> {
|
|
1128
|
-
id: BoardIdValue;
|
|
1129
|
-
layout?: "hex";
|
|
1130
|
-
orientation?: "pointy-top" | "flat-top";
|
|
1131
|
-
spaces: Readonly<Record<SpaceIdValue, GeneratedHexSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
1132
|
-
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1133
|
-
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1134
|
-
}
|
|
1135
|
-
interface AuthoredHexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, SpaceView = unknown> {
|
|
1136
|
-
id: BoardIdValue;
|
|
1137
|
-
layout?: "hex";
|
|
1138
|
-
orientation?: "pointy-top" | "flat-top";
|
|
1139
|
-
tiles: ReadonlyArray<HexTileState<BoardIdValue, SpaceIdValue, SpaceFields, SpaceView>>;
|
|
1140
|
-
edges: ReadonlyArray<HexEdgeState<BoardIdValue, SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1141
|
-
vertices: ReadonlyArray<HexVertexState<BoardIdValue, SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1142
|
-
}
|
|
1143
|
-
type HexBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields> = AuthoredHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields> | GeneratedHexBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, SpaceFields, EdgeFields, VertexFields>;
|
|
1144
|
-
interface GeneratedSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
1145
|
-
id: BoardIdValue;
|
|
1146
|
-
layout?: "square";
|
|
1147
|
-
spaces: Readonly<Record<SpaceIdValue, GeneratedSquareSpaceStateLike<SpaceIdValue, SpaceFields>>>;
|
|
1148
|
-
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1149
|
-
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1150
|
-
pieces?: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
1151
|
-
}
|
|
1152
|
-
interface AuthoredSquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> {
|
|
1153
|
-
id: BoardIdValue;
|
|
1154
|
-
layout?: "square";
|
|
1155
|
-
rows: number;
|
|
1156
|
-
cols: number;
|
|
1157
|
-
cells: ReadonlyArray<SquareCellState<SpaceIdValue, SpaceFields>>;
|
|
1158
|
-
edges: ReadonlyArray<SquareEdgeState<SpaceIdValue, EdgeIdValue, EdgeFields> | GeneratedTiledEdgeStateLike<SpaceIdValue, EdgeIdValue, EdgeFields>>;
|
|
1159
|
-
vertices: ReadonlyArray<SquareVertexState<SpaceIdValue, VertexIdValue, VertexFields> | GeneratedTiledVertexStateLike<SpaceIdValue, VertexIdValue, VertexFields>>;
|
|
1160
|
-
pieces: ReadonlyArray<SquarePieceState<PieceIdValue, PieceFields>>;
|
|
1161
|
-
}
|
|
1162
|
-
type SquareBoardInput<BoardIdValue extends string = BoardId, SpaceIdValue extends string = string, EdgeIdValue extends string = string, VertexIdValue extends string = string, PieceIdValue extends string = string, SpaceFields = RuntimeFields, EdgeFields = RuntimeFields, VertexFields = RuntimeFields, PieceFields = RuntimeFields> = AuthoredSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields> | GeneratedSquareBoardInput<BoardIdValue, SpaceIdValue, EdgeIdValue, VertexIdValue, PieceIdValue, SpaceFields, EdgeFields, VertexFields, PieceFields>;
|
|
1163
|
-
type AnyHexBoardInput = HexBoardInput<string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
1164
|
-
type AnySquareBoardInput = SquareBoardInput<string, string, string, string, string, RuntimeFields, RuntimeFields, RuntimeFields, RuntimeFields>;
|
|
1165
|
-
type BoardIdOf<TBoard> = TBoard extends {
|
|
1166
|
-
id: infer Id extends string;
|
|
1167
|
-
} ? Id : string;
|
|
1168
|
-
type SpaceRecordValueOf<TBoard> = TBoard extends {
|
|
1169
|
-
spaces: Readonly<Record<string, infer Space>>;
|
|
1170
|
-
} ? Space : never;
|
|
1171
|
-
type TileValueOf<TBoard> = TBoard extends {
|
|
1172
|
-
tiles: ReadonlyArray<infer Tile>;
|
|
1173
|
-
} ? Tile : never;
|
|
1174
|
-
type CellValueOf<TBoard> = TBoard extends {
|
|
1175
|
-
cells: ReadonlyArray<infer Cell>;
|
|
1176
|
-
} ? Cell : never;
|
|
1177
|
-
type EdgeValueOf<TBoard> = TBoard extends {
|
|
1178
|
-
edges: ReadonlyArray<infer Edge>;
|
|
1179
|
-
} ? Edge : never;
|
|
1180
|
-
type VertexValueOf<TBoard> = TBoard extends {
|
|
1181
|
-
vertices: ReadonlyArray<infer Vertex>;
|
|
1182
|
-
} ? Vertex : never;
|
|
1183
|
-
type PieceValueOf<TBoard> = TBoard extends {
|
|
1184
|
-
pieces?: ReadonlyArray<infer Piece>;
|
|
1185
|
-
} ? Piece : never;
|
|
1186
|
-
type BoardSpaceIdOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1187
|
-
id: infer Id extends string;
|
|
1188
|
-
} ? Id : TileValueOf<TBoard> extends {
|
|
1189
|
-
id: infer Id extends string;
|
|
1190
|
-
} ? Id : CellValueOf<TBoard> extends {
|
|
1191
|
-
id: infer Id extends string;
|
|
1192
|
-
} ? Id : never;
|
|
1193
|
-
type BoardEdgeIdOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1194
|
-
id: infer Id extends string;
|
|
1195
|
-
} ? Id : never;
|
|
1196
|
-
type BoardVertexIdOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1197
|
-
id: infer Id extends string;
|
|
1198
|
-
} ? Id : never;
|
|
1199
|
-
type HexTilePropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1200
|
-
fields?: infer Fields;
|
|
1201
|
-
} ? Fields : TileValueOf<TBoard> extends {
|
|
1202
|
-
properties?: infer Properties;
|
|
1203
|
-
} ? Properties : RuntimeFields;
|
|
1204
|
-
type HexTileViewOf<TBoard> = TileValueOf<TBoard> extends {
|
|
1205
|
-
view: infer View;
|
|
1206
|
-
} ? View : TileValueOf<TBoard> extends {
|
|
1207
|
-
view?: infer View;
|
|
1208
|
-
} ? View | undefined : unknown;
|
|
1209
|
-
type HexEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1210
|
-
fields?: infer Fields;
|
|
1211
|
-
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
1212
|
-
properties?: infer Properties;
|
|
1213
|
-
} ? Properties : RuntimeFields;
|
|
1214
|
-
type HexVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1215
|
-
fields?: infer Fields;
|
|
1216
|
-
} ? Fields : VertexValueOf<TBoard> extends {
|
|
1217
|
-
properties?: infer Properties;
|
|
1218
|
-
} ? Properties : RuntimeFields;
|
|
1219
|
-
type SquareCellPropertiesOf<TBoard> = SpaceRecordValueOf<TBoard> extends {
|
|
1220
|
-
fields?: infer Fields;
|
|
1221
|
-
} ? Fields : CellValueOf<TBoard> extends {
|
|
1222
|
-
properties?: infer Properties;
|
|
1223
|
-
} ? Properties : RuntimeFields;
|
|
1224
|
-
type SquareEdgePropertiesOf<TBoard> = EdgeValueOf<TBoard> extends {
|
|
1225
|
-
fields?: infer Fields;
|
|
1226
|
-
} ? Fields : EdgeValueOf<TBoard> extends {
|
|
1227
|
-
properties?: infer Properties;
|
|
1228
|
-
} ? Properties : RuntimeFields;
|
|
1229
|
-
type SquareVertexPropertiesOf<TBoard> = VertexValueOf<TBoard> extends {
|
|
1230
|
-
fields?: infer Fields;
|
|
1231
|
-
} ? Fields : VertexValueOf<TBoard> extends {
|
|
1232
|
-
properties?: infer Properties;
|
|
1233
|
-
} ? Properties : RuntimeFields;
|
|
1234
|
-
type SquarePiecePropertiesOf<TBoard> = PieceValueOf<TBoard> extends {
|
|
1235
|
-
properties?: infer Properties;
|
|
1236
|
-
} ? Properties : RuntimeFields;
|
|
1237
|
-
|
|
1238
|
-
type NormalizedHexTileOf<TBoard extends AnyHexBoardInput> = Omit<HexTileState<BoardIdOf<TBoard>, BoardSpaceIdOf<TBoard>, HexTilePropertiesOf<TBoard>, HexTileViewOf<TBoard>>, "view"> & {
|
|
1239
|
-
view: HexTileViewOf<TBoard>;
|
|
1869
|
+
type TypedZoneCardRenderItem<Contract extends UIContract> = ZoneCardRenderItem<CardKey<Contract> & string> extends infer Item ? Item extends {
|
|
1870
|
+
id: string;
|
|
1871
|
+
zone: string;
|
|
1872
|
+
} ? Omit<Item, "id" | "zone"> & {
|
|
1873
|
+
id: CardKey<Contract>;
|
|
1874
|
+
zone: ZoneKey<Contract>;
|
|
1875
|
+
} : never : never;
|
|
1876
|
+
type TypedInteraction<Contract extends UIContract> = Omit<typeof Interaction, "Root" | "CardInput" | "Dialog" | "Field" | "Form" | "Switch"> & {
|
|
1877
|
+
Root<Interaction extends InteractionKey<Contract>>(props: InteractionRootProps<Interaction>): ReactElement | null;
|
|
1878
|
+
Switch(props: Omit<InteractionSwitchProps<InteractionKey<Contract>>, "routes"> & {
|
|
1879
|
+
routes: InteractionRouteMap<InteractionKey<Contract>>;
|
|
1880
|
+
}): ReactElement;
|
|
1881
|
+
CardInput<Input extends InteractionInputKey<Contract>>(props: Omit<InteractionCardInputProps, "input" | "unsafeCardId"> & {
|
|
1882
|
+
input: Input;
|
|
1883
|
+
unsafeCardId?: CardKey<Contract>;
|
|
1884
|
+
}): ReactElement;
|
|
1885
|
+
Dialog<Interaction extends InteractionKey<Contract>>(props: InteractionDialogProps<Interaction>): ReactElement;
|
|
1886
|
+
Field<Input extends InteractionInputKey<Contract>>(props: Omit<InteractionFieldPrimitiveProps, "input"> & {
|
|
1887
|
+
input: Input;
|
|
1888
|
+
}): ReactElement | null;
|
|
1889
|
+
Form(props: InteractionFormPrimitiveProps): ReactElement | null;
|
|
1240
1890
|
};
|
|
1241
|
-
type
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1891
|
+
type TypedPrompt<Contract extends UIContract> = Omit<typeof Prompt, "Root" | "Option" | "Options" | "Dialog"> & {
|
|
1892
|
+
Root<Prompt extends PromptKey<Contract>>(props: PromptRootProps<Prompt>): ReactElement | null;
|
|
1893
|
+
Option<Option extends PromptOptionKey<Contract>>(props: Omit<PromptOptionProps, "value"> & {
|
|
1894
|
+
value: Option;
|
|
1895
|
+
}): ReactElement;
|
|
1896
|
+
Options(props: Omit<PromptOptionsProps, "children"> & {
|
|
1897
|
+
children: (option: Omit<PromptOptionRenderItem, "id"> & {
|
|
1898
|
+
id: PromptOptionKey<Contract>;
|
|
1899
|
+
}) => ReactNode;
|
|
1900
|
+
}): ReactElement;
|
|
1901
|
+
Dialog<Prompt extends PromptKey<Contract>>(props: PromptDialogProps<Prompt>): ReactElement;
|
|
1252
1902
|
};
|
|
1253
|
-
type
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
type BoardTopologyData = AnyHexBoardInput | AnySquareBoardInput;
|
|
1260
|
-
type BoardSpaceOf$1<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never;
|
|
1261
|
-
type BoardEdgeOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never;
|
|
1262
|
-
type BoardVertexOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never;
|
|
1263
|
-
type NormalizedBoardOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? NormalizedHexBoard<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareBoard<TBoard> : never;
|
|
1264
|
-
type BoardLayoutOf<TBoard extends BoardTopologyData> = TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1265
|
-
interface UseBoardTopologyReturn<TBoard extends BoardTopologyData> {
|
|
1266
|
-
layout: BoardLayoutOf<TBoard>;
|
|
1267
|
-
board: NormalizedBoardOf<TBoard>;
|
|
1268
|
-
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => BoardSpaceOf$1<TBoard> | undefined;
|
|
1269
|
-
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => BoardEdgeOf<TBoard> | undefined;
|
|
1270
|
-
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => BoardVertexOf<TBoard> | undefined;
|
|
1271
|
-
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardSpaceOf$1<TBoard>>;
|
|
1272
|
-
getDistance: (fromSpaceId: BoardSpaceIdOf<TBoard>, toSpaceId: BoardSpaceIdOf<TBoard>) => number;
|
|
1273
|
-
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardEdgeOf<TBoard>>;
|
|
1274
|
-
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => Array<BoardVertexOf<TBoard>>;
|
|
1275
|
-
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => Array<BoardEdgeOf<TBoard>>;
|
|
1276
|
-
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => Array<BoardVertexOf<TBoard>>;
|
|
1277
|
-
}
|
|
1278
|
-
declare function useBoardTopology<const TBoard extends BoardTopologyData>(board: TBoard): UseBoardTopologyReturn<TBoard>;
|
|
1279
|
-
|
|
1280
|
-
declare function useHexBoard<const TBoard extends AnyHexBoardInput>(board: TBoard): {
|
|
1281
|
-
board: NormalizedHexBoard<TBoard>;
|
|
1282
|
-
getTile: (tileId: BoardSpaceIdOf<TBoard>) => NormalizedHexTileOf<TBoard> | undefined;
|
|
1283
|
-
getTileAt: (q: number, r: number) => NormalizedHexTileOf<TBoard> | undefined;
|
|
1284
|
-
getNeighbors: (tileId: BoardSpaceIdOf<TBoard>) => Array<NormalizedHexTileOf<TBoard>>;
|
|
1285
|
-
getTilesInRange: (centerTileId: BoardSpaceIdOf<TBoard>, range: number) => Array<NormalizedHexTileOf<TBoard>>;
|
|
1286
|
-
layout: TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1287
|
-
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never) | undefined;
|
|
1288
|
-
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never) | undefined;
|
|
1289
|
-
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never) | undefined;
|
|
1290
|
-
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never)[];
|
|
1291
|
-
getDistance: (fromSpaceId: BoardSpaceIdOf<TBoard>, toSpaceId: BoardSpaceIdOf<TBoard>) => number;
|
|
1292
|
-
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1293
|
-
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1294
|
-
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1295
|
-
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1903
|
+
type TypedPromptInbox<Contract extends UIContract> = Omit<typeof PromptInbox, "Items"> & {
|
|
1904
|
+
Items(props: Omit<PromptInboxItemsProps, "children"> & {
|
|
1905
|
+
children: (prompt: Omit<InteractionDescriptor, "interactionKey"> & {
|
|
1906
|
+
interactionKey: PromptKey<Contract>;
|
|
1907
|
+
}) => ReactNode;
|
|
1908
|
+
}): ReactElement;
|
|
1296
1909
|
};
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
type DistanceMetric = "manhattan" | "chebyshev";
|
|
1300
|
-
declare function useSquareBoard<const TBoard extends AnySquareBoardInput>(board: TBoard): {
|
|
1301
|
-
board: NormalizedSquareBoard<TBoard>;
|
|
1302
|
-
getCell: (cellId: BoardSpaceIdOf<TBoard>) => NormalizedSquareCellOf<TBoard> | undefined;
|
|
1303
|
-
getCellAt: (row: number, col: number) => NormalizedSquareCellOf<TBoard> | undefined;
|
|
1304
|
-
getNeighbors: (cellId: BoardSpaceIdOf<TBoard>, mode?: NeighborMode) => NormalizedSquareCellOf<TBoard>[];
|
|
1305
|
-
getDistance: (fromCellId: BoardSpaceIdOf<TBoard>, toCellId: BoardSpaceIdOf<TBoard>, metric?: DistanceMetric) => number;
|
|
1306
|
-
layout: TBoard extends AnyHexBoardInput ? "hex" : "square";
|
|
1307
|
-
getSpace: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never) | undefined;
|
|
1308
|
-
getEdge: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never) | undefined;
|
|
1309
|
-
getVertex: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never) | undefined;
|
|
1310
|
-
getAdjacentSpaces: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexTileOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareCellOf<TBoard> : never)[];
|
|
1311
|
-
getSpaceEdges: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1312
|
-
getSpaceVertices: (spaceId: BoardSpaceIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1313
|
-
getIncidentEdges: (vertexId: BoardVertexIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexEdgeOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareEdgeOf<TBoard> : never)[];
|
|
1314
|
-
getIncidentVertices: (edgeId: BoardEdgeIdOf<TBoard>) => (TBoard extends AnyHexBoardInput ? NormalizedHexVertexOf<TBoard> : TBoard extends AnySquareBoardInput ? NormalizedSquareVertexOf<TBoard> : never)[];
|
|
1910
|
+
type TypedPlayerRosterEntry<Player extends string> = Omit<PlayerRosterEntry, "playerId"> & {
|
|
1911
|
+
playerId: Player;
|
|
1315
1912
|
};
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
}
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1913
|
+
type TypedPlayerRosterRootProps<Player extends string> = Omit<PlayerRosterRootProps, "score" | "scoreLabel" | "badges" | "metadata"> & {
|
|
1914
|
+
score?: (playerId: Player) => number | undefined;
|
|
1915
|
+
scoreLabel?: string | ((playerId: Player) => string | undefined);
|
|
1916
|
+
badges?: (playerId: Player) => ReadonlyArray<PlayerRosterBadge | null | false | undefined>;
|
|
1917
|
+
metadata?: (playerId: Player) => Record<string, unknown> | undefined;
|
|
1918
|
+
};
|
|
1919
|
+
type TypedPlayerRosterListProps<Player extends string> = Omit<PlayerRosterListProps, "children"> & {
|
|
1920
|
+
children?: (player: TypedPlayerRosterEntry<Player>) => ReactNode;
|
|
1921
|
+
};
|
|
1922
|
+
type TypedPlayerRosterPartProps<Player extends string> = Omit<PlayerRosterPartProps, "player"> & {
|
|
1923
|
+
player: TypedPlayerRosterEntry<Player>;
|
|
1924
|
+
};
|
|
1925
|
+
type TypedPlayerRosterSwitchButtonProps<Player extends string> = Omit<PlayerRosterSwitchButtonProps, "player"> & {
|
|
1926
|
+
player: TypedPlayerRosterEntry<Player>;
|
|
1927
|
+
};
|
|
1928
|
+
type TypedPlayerRoster<Contract extends UIContract> = Omit<PlayerRosterComponents, "Root" | "List" | "SwitchButton" | "Name" | "Score" | "Badges"> & {
|
|
1929
|
+
Root(props: TypedPlayerRosterRootProps<PlayerKey<Contract>>): ReactElement | null;
|
|
1930
|
+
List(props: TypedPlayerRosterListProps<PlayerKey<Contract>>): ReactElement;
|
|
1931
|
+
SwitchButton(props: TypedPlayerRosterSwitchButtonProps<PlayerKey<Contract>>): ReactElement;
|
|
1932
|
+
Name(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement;
|
|
1933
|
+
Score(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement | null;
|
|
1934
|
+
Badges(props: TypedPlayerRosterPartProps<PlayerKey<Contract>>): ReactElement | null;
|
|
1935
|
+
};
|
|
1936
|
+
type TypedPhase<Contract extends UIContract> = Omit<typeof Phase, "Switch"> & {
|
|
1937
|
+
Switch(props: PhaseSwitchProps<PhaseKey<Contract>>): ReactElement | null;
|
|
1938
|
+
};
|
|
1939
|
+
type TypedZone<Contract extends UIContract> = Omit<typeof Zone, "Root" | "Item" | "CardAt" | "TopCard" | "CardAction" | "List" | "PileRoot" | "PileCards"> & {
|
|
1940
|
+
Root<Zone extends ZoneKey<Contract>>(props: Omit<ZoneRootProps, "zone"> & {
|
|
1941
|
+
zone: Zone;
|
|
1942
|
+
}): ReactElement;
|
|
1943
|
+
Item<Card extends CardKey<Contract>>(props: Omit<ZoneItemProps, "card"> & {
|
|
1944
|
+
card: Card;
|
|
1945
|
+
}): ReactElement;
|
|
1946
|
+
CardAction<Card extends CardKey<Contract>>(props: Omit<ZoneCardActionProps, "card"> & {
|
|
1947
|
+
card?: Card;
|
|
1948
|
+
}): ReactElement;
|
|
1949
|
+
CardAt<Zone extends ZoneKey<Contract>>(props: Omit<ZoneCardAtProps<Zone>, "zone" | "children"> & {
|
|
1950
|
+
zone?: Zone;
|
|
1951
|
+
children?: ReactNode | ((card: TypedZoneCardRenderItem<Contract>) => ReactNode);
|
|
1952
|
+
}): ReactElement | null;
|
|
1953
|
+
TopCard<Zone extends ZoneKey<Contract>>(props: Omit<ZoneCardAtProps<Zone>, "zone" | "index" | "children"> & {
|
|
1954
|
+
zone?: Zone;
|
|
1955
|
+
children?: ReactNode | ((card: TypedZoneCardRenderItem<Contract>) => ReactNode);
|
|
1956
|
+
}): ReactElement | null;
|
|
1957
|
+
List(props: Omit<ZoneListProps, "children"> & {
|
|
1958
|
+
children?: ReactNode | ((card: TypedZoneCardRenderItem<Contract>) => ReactNode);
|
|
1959
|
+
}): ReactElement;
|
|
1960
|
+
PileRoot<Zone extends ZoneKey<Contract>>(props: Omit<ZonePileRootProps<Zone>, "zone"> & {
|
|
1961
|
+
zone: Zone;
|
|
1962
|
+
}): ReactElement;
|
|
1963
|
+
PileCards(props: Omit<ZonePileCardsProps, "renderCard"> & {
|
|
1964
|
+
renderCard: (card: TypedZoneCardRenderItem<Contract>) => ReactNode;
|
|
1965
|
+
}): ReactElement | null;
|
|
1966
|
+
};
|
|
1967
|
+
type TypedBoard<Contract extends UIContract> = Omit<typeof Board, "Target" | "SpaceTarget" | "EdgeTarget" | "VertexTarget" | "HexGrid"> & {
|
|
1968
|
+
Target<Target extends BoardTargetKey<Contract>>(props: Omit<BoardTargetProps, "value"> & {
|
|
1969
|
+
value: Target;
|
|
1970
|
+
}): ReactElement;
|
|
1971
|
+
SpaceTarget<Target extends BoardTargetKey<Contract>>(props: Omit<BoardSpaceTargetProps, "value"> & {
|
|
1972
|
+
value: Target;
|
|
1973
|
+
}): ReactElement;
|
|
1974
|
+
EdgeTarget<Target extends BoardTargetKey<Contract>>(props: Omit<BoardEdgeTargetProps, "value"> & {
|
|
1975
|
+
value: Target;
|
|
1976
|
+
}): ReactElement;
|
|
1977
|
+
VertexTarget<Target extends BoardTargetKey<Contract>>(props: Omit<BoardVertexTargetProps, "value"> & {
|
|
1978
|
+
value: Target;
|
|
1979
|
+
}): ReactElement;
|
|
1980
|
+
HexGrid<TBoard extends AnyHexBoardInput, TSpaceView extends {
|
|
1981
|
+
id: BoardSpaceIdOf<TBoard>;
|
|
1982
|
+
}>(props: Omit<BoardHexGridProps<TBoard, TSpaceView>, "interactions"> & {
|
|
1983
|
+
interactions?: Exclude<BoardHexGridInteractionFilter, object> | {
|
|
1984
|
+
edge?: ReadonlyArray<InteractionKey<Contract>>;
|
|
1985
|
+
vertex?: ReadonlyArray<InteractionKey<Contract>>;
|
|
1986
|
+
space?: ReadonlyArray<InteractionKey<Contract>>;
|
|
1987
|
+
};
|
|
1988
|
+
}): ReactElement;
|
|
1989
|
+
};
|
|
1990
|
+
type TypedGame<_Contract extends UIContract, View = unknown, Player extends string = PlayerKey<_Contract>, Phase extends string = PhaseKey<_Contract>> = Omit<typeof Game, "Root"> & {
|
|
1991
|
+
Root(props: GameRootProps<View, Player, Phase>): ReactElement;
|
|
1992
|
+
};
|
|
1993
|
+
interface DreamboardUI<Contract extends UIContract = RegisteredUI> {
|
|
1994
|
+
readonly contract: Contract;
|
|
1995
|
+
Root(props: UIRootProps): ReactElement;
|
|
1996
|
+
readonly Game: TypedGame<Contract>;
|
|
1997
|
+
readonly Interaction: TypedInteraction<Contract>;
|
|
1998
|
+
readonly Prompt: TypedPrompt<Contract>;
|
|
1999
|
+
readonly PromptInbox: TypedPromptInbox<Contract>;
|
|
2000
|
+
readonly PlayerRoster: TypedPlayerRoster<Contract>;
|
|
2001
|
+
readonly Dice: DiceComponents;
|
|
2002
|
+
readonly Phase: TypedPhase<Contract>;
|
|
2003
|
+
readonly Zone: TypedZone<Contract>;
|
|
2004
|
+
readonly Board: TypedBoard<Contract>;
|
|
1370
2005
|
}
|
|
1371
|
-
|
|
1372
|
-
declare function useHandLayout({ cardCount, cardSize, layout, containerPadding, }: UseHandLayoutOptions): UseHandLayoutReturn;
|
|
1373
|
-
|
|
1374
|
-
declare function useIsMobile(breakpoint?: number): boolean;
|
|
2006
|
+
declare function createDreamboardUI<const Contract extends UIContract>(contract: Contract): DreamboardUI<Contract>;
|
|
1375
2007
|
|
|
1376
2008
|
interface PanZoomTransform {
|
|
1377
2009
|
|
|
@@ -1436,32 +2068,6 @@ declare function calculateViewBox(bounds: {
|
|
|
1436
2068
|
height: number;
|
|
1437
2069
|
}, transform: PanZoomTransform): string;
|
|
1438
2070
|
|
|
1439
|
-
interface PluginRuntimeAPI extends RuntimeAPI {
|
|
1440
|
-
|
|
1441
|
-
getSnapshot: () => PluginStateSnapshot | null;
|
|
1442
|
-
|
|
1443
|
-
subscribeToState: (listener: (state: PluginStateSnapshot) => void) => () => void;
|
|
1444
|
-
|
|
1445
|
-
_subscribeToSessionState: (listener: (state: PluginSessionState) => void) => () => void;
|
|
1446
|
-
|
|
1447
|
-
restoreHistory?: (entryId: string) => void;
|
|
1448
|
-
}
|
|
1449
|
-
|
|
1450
|
-
interface UsePluginRuntimeOptions {
|
|
1451
|
-
|
|
1452
|
-
timeout?: number;
|
|
1453
|
-
}
|
|
1454
|
-
interface UsePluginRuntimeResult {
|
|
1455
|
-
|
|
1456
|
-
runtime: PluginRuntimeAPI;
|
|
1457
|
-
|
|
1458
|
-
isReady: boolean;
|
|
1459
|
-
|
|
1460
|
-
error: string | null;
|
|
1461
|
-
}
|
|
1462
|
-
|
|
1463
|
-
declare function usePluginRuntime(options?: UsePluginRuntimeOptions): UsePluginRuntimeResult;
|
|
1464
|
-
|
|
1465
2071
|
interface TrackSpace<SpaceIdValue extends string = string, Data = unknown> {
|
|
1466
2072
|
id: SpaceIdValue;
|
|
1467
2073
|
index: number;
|
|
@@ -1647,8 +2253,6 @@ declare function toTrackBoardData<TBoard extends GenericBoardLike, TPiece extend
|
|
|
1647
2253
|
pieces: Array<TrackPiece<PieceIdOf<TPiece>, SpaceIdOf<TBoard>, PieceOwnerOf<TPiece>, PieceFieldsOf<TPiece>>>;
|
|
1648
2254
|
};
|
|
1649
2255
|
|
|
1650
|
-
type PlayerId = string;
|
|
1651
|
-
|
|
1652
2256
|
interface PluginStateProviderProps {
|
|
1653
2257
|
children: React__default.ReactNode;
|
|
1654
2258
|
|
|
@@ -1657,26 +2261,29 @@ interface PluginStateProviderProps {
|
|
|
1657
2261
|
|
|
1658
2262
|
declare function PluginStateProvider({ children, loadingComponent, }: PluginStateProviderProps): react_jsx_runtime.JSX.Element;
|
|
1659
2263
|
|
|
1660
|
-
declare function usePluginState<T>(selector: (state: PluginStateSnapshot) => T): T;
|
|
1661
|
-
|
|
1662
|
-
declare function usePluginActions(): {
|
|
1663
|
-
|
|
1664
|
-
markNotificationRead: (notificationId: string) => void;
|
|
1665
|
-
|
|
1666
|
-
switchPlayer: (playerId: string) => void;
|
|
1667
|
-
|
|
1668
|
-
submitInteraction: (playerId: PlayerId, interactionId: string, params: unknown) => Promise<void>;
|
|
1669
|
-
};
|
|
1670
|
-
|
|
1671
2264
|
declare const RuntimeContext: React__default.Context<RuntimeAPI | null>;
|
|
1672
2265
|
|
|
1673
|
-
declare function useRuntimeContext(): RuntimeAPI;
|
|
1674
|
-
|
|
1675
2266
|
declare function RuntimeProvider({ runtime, children, }: {
|
|
1676
2267
|
runtime: RuntimeAPI;
|
|
1677
2268
|
children: React__default.ReactNode;
|
|
1678
2269
|
}): react_jsx_runtime.JSX.Element;
|
|
1679
2270
|
|
|
2271
|
+
interface ClientParamSchema {
|
|
2272
|
+
safeParse: (value: unknown) => {
|
|
2273
|
+
success: true;
|
|
2274
|
+
data: Record<string, unknown>;
|
|
2275
|
+
} | {
|
|
2276
|
+
success: false;
|
|
2277
|
+
error: {
|
|
2278
|
+
issues: ReadonlyArray<{
|
|
2279
|
+
path: readonly PropertyKey[];
|
|
2280
|
+
message: string;
|
|
2281
|
+
}>;
|
|
2282
|
+
};
|
|
2283
|
+
};
|
|
2284
|
+
}
|
|
2285
|
+
type ClientParamSchemaMap = Readonly<Record<string, Readonly<Record<string, ClientParamSchema>>>>;
|
|
2286
|
+
|
|
1680
2287
|
interface ThemeMeta {
|
|
1681
2288
|
|
|
1682
2289
|
readonly id: string;
|
|
@@ -2041,53 +2648,6 @@ declare function useBoardTheme(): BoardTheme;
|
|
|
2041
2648
|
|
|
2042
2649
|
declare function deriveBoardTheme(theme: Theme): BoardTheme;
|
|
2043
2650
|
|
|
2044
|
-
interface InteractionFieldRenderProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
2045
|
-
descriptor: InteractionDescriptor;
|
|
2046
|
-
input: InteractionInputDescriptor & {
|
|
2047
|
-
key: Key;
|
|
2048
|
-
};
|
|
2049
|
-
handle: InteractionHandle<Params>;
|
|
2050
|
-
value: Params[Key] | undefined;
|
|
2051
|
-
setValue: (value: Params[Key]) => void;
|
|
2052
|
-
clearValue: () => void;
|
|
2053
|
-
errors: readonly string[];
|
|
2054
|
-
missing: boolean;
|
|
2055
|
-
disabled: boolean;
|
|
2056
|
-
}
|
|
2057
|
-
type InteractionFieldRenderMap<Params extends InteractionParamsShape = InteractionParamsShape> = Partial<{
|
|
2058
|
-
[K in keyof Params & string]: (props: InteractionFieldRenderProps<Params, K>) => ReactNode;
|
|
2059
|
-
}>;
|
|
2060
|
-
interface InteractionFieldProps<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string> {
|
|
2061
|
-
descriptor: InteractionDescriptor;
|
|
2062
|
-
inputKey: Key;
|
|
2063
|
-
handle: InteractionHandle<Params>;
|
|
2064
|
-
errors?: readonly string[];
|
|
2065
|
-
missing?: boolean;
|
|
2066
|
-
disabled?: boolean;
|
|
2067
|
-
render?: InteractionFieldRenderMap<Params>[Key];
|
|
2068
|
-
}
|
|
2069
|
-
interface InteractionFormProps<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never> {
|
|
2070
|
-
descriptor: InteractionDescriptor;
|
|
2071
|
-
handle: InteractionHandle<Params, DefaultedKeys>;
|
|
2072
|
-
fields?: ReadonlyArray<keyof Params & string>;
|
|
2073
|
-
hiddenFields?: ReadonlyArray<keyof Params & string>;
|
|
2074
|
-
renderFields?: InteractionFieldRenderMap<Params>;
|
|
2075
|
-
title?: ReactNode;
|
|
2076
|
-
description?: ReactNode;
|
|
2077
|
-
submitLabel?: ReactNode;
|
|
2078
|
-
cancelLabel?: ReactNode;
|
|
2079
|
-
onCancel?: () => void;
|
|
2080
|
-
onSubmitSuccess?: () => void;
|
|
2081
|
-
disabled?: boolean;
|
|
2082
|
-
accordion?: boolean;
|
|
2083
|
-
defaultOpen?: boolean;
|
|
2084
|
-
style?: CSSProperties;
|
|
2085
|
-
}
|
|
2086
|
-
declare function InteractionForm<Params extends InteractionParamsShape = InteractionParamsShape, DefaultedKeys extends keyof Params & string = never>({ descriptor, handle, fields, hiddenFields, renderFields, title, description, submitLabel, cancelLabel, onCancel, onSubmitSuccess, disabled, accordion, defaultOpen, style, }: InteractionFormProps<Params, DefaultedKeys>): react_jsx_runtime.JSX.Element;
|
|
2087
|
-
declare function InteractionField<Params extends InteractionParamsShape = InteractionParamsShape, Key extends keyof Params & string = keyof Params & string>({ descriptor, inputKey, handle, errors, missing, disabled, render, }: InteractionFieldProps<Params, Key>): react_jsx_runtime.JSX.Element | null;
|
|
2088
|
-
declare function hasDefaultInteractionFormFields(descriptor: Pick<InteractionDescriptor, "inputs">): boolean;
|
|
2089
|
-
declare function defaultFormInputs(descriptor: Pick<InteractionDescriptor, "inputs">): InteractionInputDescriptor[];
|
|
2090
|
-
|
|
2091
2651
|
interface CardProps<CardData extends ViewCard = ViewCard> extends Omit<HTMLMotionProps<"button">, "children"> {
|
|
2092
2652
|
card: CardData;
|
|
2093
2653
|
selected?: boolean;
|
|
@@ -2095,11 +2655,68 @@ interface CardProps<CardData extends ViewCard = ViewCard> extends Omit<HTMLMotio
|
|
|
2095
2655
|
size?: "sm" | "md" | "lg";
|
|
2096
2656
|
faceDown?: boolean;
|
|
2097
2657
|
renderContent?: (card: CardData) => React.ReactNode;
|
|
2098
|
-
onCardClick?: (cardId:
|
|
2658
|
+
onCardClick?: (cardId: CardData["id"]) => void;
|
|
2099
2659
|
"aria-label"?: string;
|
|
2100
2660
|
}
|
|
2101
2661
|
|
|
2102
|
-
declare function Card<CardData extends ViewCard = ViewCard>({ card, selected, disabled, size, faceDown, renderContent, onCardClick, className, "aria-label": ariaLabel, ...motionProps }: CardProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
2662
|
+
declare function Card<CardData extends ViewCard = ViewCard>({ card, selected, disabled, size, faceDown, renderContent, onCardClick, className, "aria-label": ariaLabel, ...motionProps }: CardProps<CardData>): react_jsx_runtime.JSX.Element;
|
|
2663
|
+
|
|
2664
|
+
type CardSize = "sm" | "md" | "lg";
|
|
2665
|
+
type HandLayout = "spread" | "stack" | "overlap";
|
|
2666
|
+
interface CardPositionProps {
|
|
2667
|
+
|
|
2668
|
+
x: number;
|
|
2669
|
+
|
|
2670
|
+
y: number;
|
|
2671
|
+
|
|
2672
|
+
zIndex: number;
|
|
2673
|
+
|
|
2674
|
+
transformOrigin: string;
|
|
2675
|
+
}
|
|
2676
|
+
interface UseHandLayoutOptions {
|
|
2677
|
+
|
|
2678
|
+
cardCount: number;
|
|
2679
|
+
|
|
2680
|
+
cardSize?: CardSize;
|
|
2681
|
+
|
|
2682
|
+
layout?: HandLayout;
|
|
2683
|
+
|
|
2684
|
+
containerPadding?: number;
|
|
2685
|
+
}
|
|
2686
|
+
interface UseHandLayoutReturn {
|
|
2687
|
+
|
|
2688
|
+
containerRef: RefObject<HTMLDivElement | null>;
|
|
2689
|
+
|
|
2690
|
+
cardsContainerRef: RefObject<HTMLDivElement | null>;
|
|
2691
|
+
|
|
2692
|
+
containerWidth: number;
|
|
2693
|
+
|
|
2694
|
+
cardOffset: number;
|
|
2695
|
+
|
|
2696
|
+
totalWidth: number;
|
|
2697
|
+
|
|
2698
|
+
useDrawerMode: boolean;
|
|
2699
|
+
|
|
2700
|
+
cardDimensions: {
|
|
2701
|
+
width: number;
|
|
2702
|
+
height: number;
|
|
2703
|
+
};
|
|
2704
|
+
|
|
2705
|
+
constants: {
|
|
2706
|
+
hoverLift: number;
|
|
2707
|
+
selectedLift: number;
|
|
2708
|
+
};
|
|
2709
|
+
|
|
2710
|
+
hoveredIndex: number | null;
|
|
2711
|
+
|
|
2712
|
+
handleMouseMove: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
2713
|
+
|
|
2714
|
+
handleMouseLeave: () => void;
|
|
2715
|
+
|
|
2716
|
+
getCardPosition: (index: number, isHovered: boolean, isSelected: boolean) => CardPositionProps;
|
|
2717
|
+
}
|
|
2718
|
+
|
|
2719
|
+
declare function useHandLayout({ cardCount, cardSize, layout, containerPadding, }: UseHandLayoutOptions): UseHandLayoutReturn;
|
|
2103
2720
|
|
|
2104
2721
|
interface HandCardRenderProps<CardData extends ViewCard = ViewCard> {
|
|
2105
2722
|
card: CardData;
|
|
@@ -2215,14 +2832,14 @@ interface GameSkeletonProps {
|
|
|
2215
2832
|
declare function GameSkeleton({ variant, message, className, }: GameSkeletonProps): react_jsx_runtime.JSX.Element;
|
|
2216
2833
|
|
|
2217
2834
|
type ToastType = "success" | "error" | "info" | "warning";
|
|
2218
|
-
interface
|
|
2835
|
+
interface ToastNotification {
|
|
2219
2836
|
id: string;
|
|
2220
2837
|
type: ToastType;
|
|
2221
2838
|
message: string;
|
|
2222
2839
|
duration?: number;
|
|
2223
2840
|
}
|
|
2224
2841
|
interface ToastContextValue {
|
|
2225
|
-
toasts:
|
|
2842
|
+
toasts: ToastNotification[];
|
|
2226
2843
|
show: (message: string, type?: ToastType, duration?: number) => void;
|
|
2227
2844
|
dismiss: (id: string) => void;
|
|
2228
2845
|
success: (message: string, duration?: number) => void;
|
|
@@ -2230,11 +2847,18 @@ interface ToastContextValue {
|
|
|
2230
2847
|
info: (message: string, duration?: number) => void;
|
|
2231
2848
|
warning: (message: string, duration?: number) => void;
|
|
2232
2849
|
}
|
|
2850
|
+
type ToastActionsValue = ToastContextValue;
|
|
2233
2851
|
interface ToastProviderProps {
|
|
2234
2852
|
children: ReactNode;
|
|
2235
2853
|
}
|
|
2236
2854
|
declare function ToastProvider({ children }: ToastProviderProps): react_jsx_runtime.JSX.Element;
|
|
2237
|
-
|
|
2855
|
+
interface ToastActionsProps {
|
|
2856
|
+
children: (actions: ToastActionsValue) => ReactNode;
|
|
2857
|
+
}
|
|
2858
|
+
declare function ToastActions({ children }: ToastActionsProps): react_jsx_runtime.JSX.Element;
|
|
2859
|
+
declare const Toast: {
|
|
2860
|
+
readonly Actions: typeof ToastActions;
|
|
2861
|
+
};
|
|
2238
2862
|
|
|
2239
2863
|
interface ErrorBoundaryProps {
|
|
2240
2864
|
children: ReactNode;
|
|
@@ -2480,30 +3104,74 @@ declare function DialogFooter({ className, ...props }: React$1.ComponentProps<"d
|
|
|
2480
3104
|
declare function DialogTitle({ className, ...props }: React$1.ComponentProps<typeof Title>): react_jsx_runtime.JSX.Element;
|
|
2481
3105
|
declare function DialogDescription({ className, ...props }: React$1.ComponentProps<typeof Description>): react_jsx_runtime.JSX.Element;
|
|
2482
3106
|
|
|
2483
|
-
interface ResourceDisplayConfig {
|
|
2484
|
-
type:
|
|
3107
|
+
interface ResourceDisplayConfig<Resource extends string = ResourceId> {
|
|
3108
|
+
type: Resource;
|
|
2485
3109
|
label: string;
|
|
2486
3110
|
icon: ReactNode | ComponentType<{
|
|
2487
3111
|
className?: string;
|
|
2488
3112
|
strokeWidth?: number;
|
|
2489
|
-
"aria-hidden"?:
|
|
3113
|
+
"aria-hidden"?: boolean | "true" | "false";
|
|
2490
3114
|
}>;
|
|
2491
3115
|
iconColor?: string;
|
|
2492
3116
|
bgColor?: string;
|
|
2493
3117
|
textColor?: string;
|
|
2494
3118
|
}
|
|
2495
|
-
interface
|
|
2496
|
-
|
|
2497
|
-
|
|
2498
|
-
|
|
2499
|
-
|
|
2500
|
-
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
3119
|
+
interface ResourceCounterItemState<Resource extends string = ResourceId> {
|
|
3120
|
+
type: Resource;
|
|
3121
|
+
label: string;
|
|
3122
|
+
icon: ResourceDisplayConfig<Resource>["icon"];
|
|
3123
|
+
iconColor?: string;
|
|
3124
|
+
bgColor?: string;
|
|
3125
|
+
textColor?: string;
|
|
3126
|
+
count: number;
|
|
3127
|
+
isZero: boolean;
|
|
3128
|
+
interactive: boolean;
|
|
3129
|
+
select: () => void;
|
|
3130
|
+
renderIcon: (props?: ResourceIconProps) => ReactNode;
|
|
3131
|
+
dataAttributes: {
|
|
3132
|
+
"data-resource-id": Resource;
|
|
3133
|
+
"data-resource-count": number;
|
|
3134
|
+
"data-resource-zero": boolean | undefined;
|
|
3135
|
+
"data-interactive": boolean | undefined;
|
|
3136
|
+
};
|
|
3137
|
+
}
|
|
3138
|
+
interface ResourceIconProps {
|
|
2504
3139
|
className?: string;
|
|
3140
|
+
strokeWidth?: number;
|
|
3141
|
+
"aria-hidden"?: boolean | "true" | "false";
|
|
2505
3142
|
}
|
|
2506
|
-
|
|
3143
|
+
type ResourceCounterRootProps<Resource extends string = ResourceId> = Omit<PrimitiveCommonProps, "children"> & Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
3144
|
+
resources: ReadonlyArray<ResourceDisplayConfig<Resource>>;
|
|
3145
|
+
counts: Partial<Record<Resource, number>>;
|
|
3146
|
+
zero?: "show" | "hide";
|
|
3147
|
+
onResourceClick?: (resourceType: Resource) => void;
|
|
3148
|
+
children: ReactNode;
|
|
3149
|
+
};
|
|
3150
|
+
type BoundResourceCounterRootProps<Resource extends string = ResourceId> = Omit<ResourceCounterRootProps<Resource>, "resources">;
|
|
3151
|
+
type ResourceCounterProps<Resource extends string = ResourceId> = ResourceCounterRootProps<Resource>;
|
|
3152
|
+
type ResourceCounterPartProps<Resource extends string = ResourceId> = Omit<PrimitiveCommonProps, "children"> & Omit<HTMLAttributes<HTMLElement>, "children"> & {
|
|
3153
|
+
children?: ReactNode | ((resource: ResourceCounterItemState<Resource>) => ReactNode);
|
|
3154
|
+
};
|
|
3155
|
+
declare function ResourceCounterRoot<Resource extends string = ResourceId>({ resources, counts, zero, onResourceClick, children, "aria-label": ariaLabel, ...props }: ResourceCounterRootProps<Resource>): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
3156
|
+
declare function ResourceCounterItem<Resource extends string = ResourceId>({ children, onClick, "aria-label": ariaLabel, ...props }: ResourceCounterPartProps<Resource>): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
3157
|
+
declare function ResourceCounterIcon<Resource extends string = ResourceId>({ className, strokeWidth, "aria-hidden": ariaHidden, }: ResourceIconProps): ReactNode;
|
|
3158
|
+
declare function ResourceCounterCount<Resource extends string = ResourceId>({ children, ...props }: ResourceCounterPartProps<Resource>): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
3159
|
+
declare function ResourceCounterLabel<Resource extends string = ResourceId>({ children, ...props }: ResourceCounterPartProps<Resource>): ReactElement<unknown, string | React$1.JSXElementConstructor<any>>;
|
|
3160
|
+
interface ResourceCounterComponents<Resource extends string = ResourceId> {
|
|
3161
|
+
Root(props: BoundResourceCounterRootProps<Resource>): ReactElement;
|
|
3162
|
+
Item(props: ResourceCounterPartProps<Resource>): ReactElement;
|
|
3163
|
+
Icon(props: ResourceIconProps): ReactNode;
|
|
3164
|
+
Count(props: ResourceCounterPartProps<Resource>): ReactElement;
|
|
3165
|
+
Label(props: ResourceCounterPartProps<Resource>): ReactElement;
|
|
3166
|
+
}
|
|
3167
|
+
declare function createResourceCounter<Resource extends string>(resources: ReadonlyArray<ResourceDisplayConfig<Resource>>): ResourceCounterComponents<Resource>;
|
|
3168
|
+
declare const ResourceCounter: {
|
|
3169
|
+
Root: typeof ResourceCounterRoot;
|
|
3170
|
+
Item: typeof ResourceCounterItem;
|
|
3171
|
+
Icon: typeof ResourceCounterIcon;
|
|
3172
|
+
Count: typeof ResourceCounterCount;
|
|
3173
|
+
Label: typeof ResourceCounterLabel;
|
|
3174
|
+
};
|
|
2507
3175
|
|
|
2508
3176
|
interface ResourceDefinition {
|
|
2509
3177
|
type: string;
|
|
@@ -2628,7 +3296,7 @@ interface MoreActionsProps {
|
|
|
2628
3296
|
declare function MoreActions({ children, label, count, defaultOpen, style, }: MoreActionsProps): react_jsx_runtime.JSX.Element;
|
|
2629
3297
|
|
|
2630
3298
|
interface DiceRollerRenderProps {
|
|
2631
|
-
values:
|
|
3299
|
+
values: ReadonlyArray<number | undefined> | undefined;
|
|
2632
3300
|
|
|
2633
3301
|
sum: number | undefined;
|
|
2634
3302
|
diceCount: number;
|
|
@@ -2645,7 +3313,7 @@ interface DiceRollerRollAction<Params extends InteractionParamsShape = Interacti
|
|
|
2645
3313
|
revealHoldMs?: number;
|
|
2646
3314
|
}
|
|
2647
3315
|
interface DiceRollerProps<Params extends InteractionParamsShape = InteractionParamsShape> {
|
|
2648
|
-
values?:
|
|
3316
|
+
values?: readonly DiceValue[] | null;
|
|
2649
3317
|
|
|
2650
3318
|
diceCount?: number;
|
|
2651
3319
|
render?: (props: DiceRollerRenderProps) => ReactNode;
|
|
@@ -2976,254 +3644,45 @@ type SquareBoardLikeOfProps<TProps extends SquareGridInputProps> = TProps extend
|
|
|
2976
3644
|
id?: infer Id;
|
|
2977
3645
|
layout?: infer Layout;
|
|
2978
3646
|
spaces: infer Spaces;
|
|
2979
|
-
pieces?: infer Pieces;
|
|
2980
|
-
edges?: infer Edges;
|
|
2981
|
-
vertices?: infer Vertices;
|
|
2982
|
-
} ? {
|
|
2983
|
-
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
2984
|
-
layout?: Extract<Layout, "square">;
|
|
2985
|
-
spaces: Spaces;
|
|
2986
|
-
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
2987
|
-
edges: ResolvedSquareArrayProp<Edges>;
|
|
2988
|
-
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
2989
|
-
} & GeneratedSquareBoardInput : TProps extends {
|
|
2990
|
-
id?: infer Id;
|
|
2991
|
-
layout?: infer Layout;
|
|
2992
|
-
rows?: infer Rows;
|
|
2993
|
-
cols?: infer Cols;
|
|
2994
|
-
cells: infer Cells;
|
|
2995
|
-
pieces?: infer Pieces;
|
|
2996
|
-
edges?: infer Edges;
|
|
2997
|
-
vertices?: infer Vertices;
|
|
2998
|
-
} ? {
|
|
2999
|
-
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3000
|
-
layout?: Extract<Layout, "square">;
|
|
3001
|
-
rows: Extract<Rows, number> extends never ? number : Extract<Rows, number>;
|
|
3002
|
-
cols: Extract<Cols, number> extends never ? number : Extract<Cols, number>;
|
|
3003
|
-
cells: Cells;
|
|
3004
|
-
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
3005
|
-
edges: ResolvedSquareArrayProp<Edges>;
|
|
3006
|
-
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
3007
|
-
} & AuthoredSquareBoardInput : never;
|
|
3008
|
-
type SquareGridProps<TProps extends SquareGridInputProps = SquareGridInputProps> = TProps & {
|
|
3009
|
-
cellSize?: number;
|
|
3010
|
-
|
|
3011
|
-
renderCell: (row: number, col: number) => ReactNode;
|
|
3012
|
-
|
|
3013
|
-
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<SquareBoardLikeOfProps<TProps>>>) => ReactNode;
|
|
3014
|
-
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition) => ReactNode;
|
|
3015
|
-
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition) => ReactNode;
|
|
3016
|
-
showCoordinates?: boolean;
|
|
3017
|
-
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3018
|
-
width?: number | string;
|
|
3019
|
-
height?: number | string;
|
|
3020
|
-
enablePanZoom?: boolean;
|
|
3021
|
-
initialZoom?: number;
|
|
3022
|
-
minZoom?: number;
|
|
3023
|
-
maxZoom?: number;
|
|
3024
|
-
className?: string;
|
|
3025
|
-
interactiveSpaces?: InteractiveTargetLayer;
|
|
3026
|
-
interactiveEdges?: InteractiveTargetLayer;
|
|
3027
|
-
interactiveVertices?: InteractiveTargetLayer;
|
|
3028
|
-
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<SquareBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3029
|
-
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3030
|
-
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3031
|
-
};
|
|
3032
|
-
interface SquareGridBoardProps<TBoard extends AnySquareBoardInput = AnySquareBoardInput> {
|
|
3033
|
-
board: TBoard;
|
|
3034
|
-
cellSize?: number;
|
|
3035
|
-
renderCell: (row: number, col: number) => ReactNode;
|
|
3036
|
-
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<TBoard>>) => ReactNode;
|
|
3037
|
-
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<TBoard>>, position: SquareEdgePosition) => ReactNode;
|
|
3038
|
-
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<TBoard>>, position: SquareVertexPosition) => ReactNode;
|
|
3039
|
-
showCoordinates?: boolean;
|
|
3040
|
-
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3041
|
-
width?: number | string;
|
|
3042
|
-
height?: number | string;
|
|
3043
|
-
enablePanZoom?: boolean;
|
|
3044
|
-
initialZoom?: number;
|
|
3045
|
-
minZoom?: number;
|
|
3046
|
-
maxZoom?: number;
|
|
3047
|
-
className?: string;
|
|
3048
|
-
interactiveSpaces?: InteractiveTargetLayer;
|
|
3049
|
-
interactiveEdges?: InteractiveTargetLayer;
|
|
3050
|
-
interactiveVertices?: InteractiveTargetLayer;
|
|
3051
|
-
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3052
|
-
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<TBoard>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3053
|
-
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<TBoard>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3054
|
-
}
|
|
3055
|
-
interface DefaultGridCellProps {
|
|
3056
|
-
size: number;
|
|
3057
|
-
isLight?: boolean;
|
|
3058
|
-
lightColor?: string;
|
|
3059
|
-
darkColor?: string;
|
|
3060
|
-
isHighlighted?: boolean;
|
|
3061
|
-
highlightColor?: string;
|
|
3062
|
-
isSelected?: boolean;
|
|
3063
|
-
selectedColor?: string;
|
|
3064
|
-
isValidMove?: boolean;
|
|
3065
|
-
isCapture?: boolean;
|
|
3066
|
-
onClick?: () => void;
|
|
3067
|
-
onPointerEnter?: () => void;
|
|
3068
|
-
onPointerLeave?: () => void;
|
|
3069
|
-
className?: string;
|
|
3070
|
-
}
|
|
3071
|
-
|
|
3072
|
-
declare function DefaultGridCell({ size, isLight, lightColor, darkColor, isHighlighted, highlightColor, isSelected, selectedColor, isValidMove, isCapture, onClick, onPointerEnter, onPointerLeave, className, }: DefaultGridCellProps): react_jsx_runtime.JSX.Element;
|
|
3073
|
-
interface DefaultGridPieceProps {
|
|
3074
|
-
size: number;
|
|
3075
|
-
color?: string;
|
|
3076
|
-
strokeColor?: string;
|
|
3077
|
-
label?: string;
|
|
3078
|
-
isDragging?: boolean;
|
|
3079
|
-
onClick?: () => void;
|
|
3080
|
-
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3081
|
-
className?: string;
|
|
3082
|
-
}
|
|
3083
|
-
|
|
3084
|
-
declare function DefaultGridPiece({ size, color, strokeColor, label, isDragging, onClick, onPointerDown, className, }: DefaultGridPieceProps): react_jsx_runtime.JSX.Element;
|
|
3085
|
-
interface DefaultChessPieceProps {
|
|
3086
|
-
size: number;
|
|
3087
|
-
type: string;
|
|
3088
|
-
owner: "white" | "black";
|
|
3089
|
-
onClick?: () => void;
|
|
3090
|
-
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3091
|
-
className?: string;
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
declare function DefaultChessPiece({ size, type, owner, onClick, onPointerDown, className, }: DefaultChessPieceProps): react_jsx_runtime.JSX.Element;
|
|
3095
|
-
|
|
3096
|
-
declare function toAlgebraic(row: number, col: number, totalRows: number): string;
|
|
3097
|
-
|
|
3098
|
-
declare function toNumeric(row: number, col: number): string;
|
|
3099
|
-
interface SquareGridComponent {
|
|
3100
|
-
<const TBoard extends AnySquareBoardInput>(props: SquareGridBoardProps<TBoard>): ReactNode;
|
|
3101
|
-
<const TProps extends SquareGeneratedGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3102
|
-
<const TProps extends SquareAuthoredGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3103
|
-
}
|
|
3104
|
-
declare const SquareGrid: SquareGridComponent;
|
|
3105
|
-
|
|
3106
|
-
type HexOrientation = "pointy-top" | "flat-top";
|
|
3107
|
-
|
|
3108
|
-
interface HexTileGeometry {
|
|
3109
|
-
size: number;
|
|
3110
|
-
orientation: HexOrientation;
|
|
3111
|
-
center: {
|
|
3112
|
-
x: 0;
|
|
3113
|
-
y: 0;
|
|
3114
|
-
};
|
|
3115
|
-
position: {
|
|
3116
|
-
x: number;
|
|
3117
|
-
y: number;
|
|
3118
|
-
};
|
|
3119
|
-
corners: (options?: {
|
|
3120
|
-
inset?: number;
|
|
3121
|
-
}) => Array<{
|
|
3122
|
-
x: number;
|
|
3123
|
-
y: number;
|
|
3124
|
-
}>;
|
|
3125
|
-
points: (options?: {
|
|
3126
|
-
inset?: number;
|
|
3127
|
-
}) => string;
|
|
3128
|
-
bounds: {
|
|
3129
|
-
minX: number;
|
|
3130
|
-
minY: number;
|
|
3131
|
-
maxX: number;
|
|
3132
|
-
maxY: number;
|
|
3133
|
-
width: number;
|
|
3134
|
-
height: number;
|
|
3135
|
-
};
|
|
3136
|
-
}
|
|
3137
|
-
interface EdgePosition {
|
|
3138
|
-
|
|
3139
|
-
x1: number;
|
|
3140
|
-
y1: number;
|
|
3141
|
-
|
|
3142
|
-
x2: number;
|
|
3143
|
-
y2: number;
|
|
3144
|
-
|
|
3145
|
-
midX: number;
|
|
3146
|
-
midY: number;
|
|
3147
|
-
|
|
3148
|
-
centerAngle: number;
|
|
3149
|
-
|
|
3150
|
-
edgeAngle: number;
|
|
3151
|
-
}
|
|
3152
|
-
interface InteractiveHexVertex<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexVertexOf<TBoard> {
|
|
3153
|
-
position: {
|
|
3154
|
-
x: number;
|
|
3155
|
-
y: number;
|
|
3156
|
-
};
|
|
3157
|
-
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
3158
|
-
}
|
|
3159
|
-
interface InteractiveHexEdge<TBoard extends AnyHexBoardInput = AnyHexBoardInput> extends NormalizedHexEdgeOf<TBoard> {
|
|
3160
|
-
position: EdgePosition;
|
|
3161
|
-
spaceIds: ReadonlyArray<BoardSpaceIdOf<TBoard>>;
|
|
3162
|
-
}
|
|
3163
|
-
type InteractiveHexSpace<TBoard extends AnyHexBoardInput = AnyHexBoardInput> = NormalizedHexTileOf<TBoard>;
|
|
3164
|
-
interface HexGeneratedGridInputProps {
|
|
3165
|
-
id?: string;
|
|
3166
|
-
layout?: "hex";
|
|
3167
|
-
orientation?: HexOrientation;
|
|
3168
|
-
spaces: Extract<AnyHexBoardInput, {
|
|
3169
|
-
spaces: unknown;
|
|
3170
|
-
}>["spaces"];
|
|
3171
|
-
edges?: AnyHexBoardInput["edges"];
|
|
3172
|
-
vertices?: AnyHexBoardInput["vertices"];
|
|
3173
|
-
}
|
|
3174
|
-
interface HexAuthoredGridInputProps {
|
|
3175
|
-
id?: string;
|
|
3176
|
-
layout?: "hex";
|
|
3177
|
-
orientation?: HexOrientation;
|
|
3178
|
-
tiles: Extract<AnyHexBoardInput, {
|
|
3179
|
-
tiles: unknown;
|
|
3180
|
-
}>["tiles"];
|
|
3181
|
-
edges?: AnyHexBoardInput["edges"];
|
|
3182
|
-
vertices?: AnyHexBoardInput["vertices"];
|
|
3183
|
-
}
|
|
3184
|
-
type HexGridInputProps = HexGeneratedGridInputProps | HexAuthoredGridInputProps;
|
|
3185
|
-
type ResolvedArrayProp<Value> = Exclude<Value, undefined> extends readonly unknown[] ? Exclude<Value, undefined> : readonly [];
|
|
3186
|
-
type HexBoardLikeOfProps<TProps extends HexGridInputProps> = TProps extends {
|
|
3187
|
-
id?: infer Id;
|
|
3188
|
-
layout?: infer Layout;
|
|
3189
|
-
orientation?: infer Orientation;
|
|
3190
|
-
spaces: infer Spaces;
|
|
3647
|
+
pieces?: infer Pieces;
|
|
3191
3648
|
edges?: infer Edges;
|
|
3192
3649
|
vertices?: infer Vertices;
|
|
3193
3650
|
} ? {
|
|
3194
3651
|
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3195
|
-
layout?: Extract<Layout, "
|
|
3196
|
-
orientation?: Extract<Orientation, HexOrientation>;
|
|
3652
|
+
layout?: Extract<Layout, "square">;
|
|
3197
3653
|
spaces: Spaces;
|
|
3198
|
-
|
|
3199
|
-
|
|
3200
|
-
|
|
3654
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
3655
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
3656
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
3657
|
+
} & GeneratedSquareBoardInput : TProps extends {
|
|
3201
3658
|
id?: infer Id;
|
|
3202
3659
|
layout?: infer Layout;
|
|
3203
|
-
|
|
3204
|
-
|
|
3660
|
+
rows?: infer Rows;
|
|
3661
|
+
cols?: infer Cols;
|
|
3662
|
+
cells: infer Cells;
|
|
3663
|
+
pieces?: infer Pieces;
|
|
3205
3664
|
edges?: infer Edges;
|
|
3206
3665
|
vertices?: infer Vertices;
|
|
3207
3666
|
} ? {
|
|
3208
3667
|
id: Extract<Id, string> extends never ? string : Extract<Id, string>;
|
|
3209
|
-
layout?: Extract<Layout, "
|
|
3210
|
-
|
|
3211
|
-
|
|
3212
|
-
|
|
3213
|
-
|
|
3214
|
-
|
|
3215
|
-
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3668
|
+
layout?: Extract<Layout, "square">;
|
|
3669
|
+
rows: Extract<Rows, number> extends never ? number : Extract<Rows, number>;
|
|
3670
|
+
cols: Extract<Cols, number> extends never ? number : Extract<Cols, number>;
|
|
3671
|
+
cells: Cells;
|
|
3672
|
+
pieces: ResolvedSquareArrayProp<Pieces>;
|
|
3673
|
+
edges: ResolvedSquareArrayProp<Edges>;
|
|
3674
|
+
vertices: ResolvedSquareArrayProp<Vertices>;
|
|
3675
|
+
} & AuthoredSquareBoardInput : never;
|
|
3676
|
+
type SquareGridProps<TProps extends SquareGridInputProps = SquareGridInputProps> = TProps & {
|
|
3677
|
+
cellSize?: number;
|
|
3219
3678
|
|
|
3220
|
-
|
|
3679
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
3221
3680
|
|
|
3222
|
-
|
|
3223
|
-
|
|
3224
|
-
|
|
3225
|
-
|
|
3226
|
-
|
|
3681
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<SquareBoardLikeOfProps<TProps>>>) => ReactNode;
|
|
3682
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition) => ReactNode;
|
|
3683
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition) => ReactNode;
|
|
3684
|
+
showCoordinates?: boolean;
|
|
3685
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3227
3686
|
width?: number | string;
|
|
3228
3687
|
height?: number | string;
|
|
3229
3688
|
enablePanZoom?: boolean;
|
|
@@ -3231,36 +3690,22 @@ type HexGridProps<TProps extends HexGridInputProps = HexGridInputProps> = TProps
|
|
|
3231
3690
|
minZoom?: number;
|
|
3232
3691
|
maxZoom?: number;
|
|
3233
3692
|
className?: string;
|
|
3234
|
-
|
|
3235
3693
|
interactiveSpaces?: InteractiveTargetLayer;
|
|
3236
|
-
|
|
3237
|
-
interactiveVertices?: InteractiveTargetLayer;
|
|
3238
|
-
|
|
3239
3694
|
interactiveEdges?: InteractiveTargetLayer;
|
|
3240
|
-
|
|
3241
|
-
renderInteractiveSpace?: (space:
|
|
3242
|
-
|
|
3243
|
-
renderInteractiveVertex?: (vertex:
|
|
3244
|
-
x: number;
|
|
3245
|
-
y: number;
|
|
3246
|
-
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
3247
|
-
|
|
3248
|
-
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<HexBoardLikeOfProps<TProps>>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3249
|
-
interactiveVertexSize?: number;
|
|
3250
|
-
interactiveEdgeSize?: number;
|
|
3695
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3696
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<SquareBoardLikeOfProps<TProps>>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3697
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3698
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<SquareBoardLikeOfProps<TProps>>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3251
3699
|
};
|
|
3252
|
-
interface
|
|
3700
|
+
interface SquareGridBoardProps<TBoard extends AnySquareBoardInput = AnySquareBoardInput> {
|
|
3253
3701
|
board: TBoard;
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3260
|
-
|
|
3261
|
-
x: number;
|
|
3262
|
-
y: number;
|
|
3263
|
-
}) => ReactNode;
|
|
3702
|
+
cellSize?: number;
|
|
3703
|
+
renderCell: (row: number, col: number) => ReactNode;
|
|
3704
|
+
renderPiece: (piece: NormalizedSquarePieceOf<NoInfer<TBoard>>) => ReactNode;
|
|
3705
|
+
renderEdge?: (edge: NormalizedSquareEdgeOf<NoInfer<TBoard>>, position: SquareEdgePosition) => ReactNode;
|
|
3706
|
+
renderVertex?: (vertex: NormalizedSquareVertexOf<NoInfer<TBoard>>, position: SquareVertexPosition) => ReactNode;
|
|
3707
|
+
showCoordinates?: boolean;
|
|
3708
|
+
coordinateStyle?: "algebraic" | "numeric" | "none";
|
|
3264
3709
|
width?: number | string;
|
|
3265
3710
|
height?: number | string;
|
|
3266
3711
|
enablePanZoom?: boolean;
|
|
@@ -3269,141 +3714,88 @@ interface HexGridBoardProps<TBoard extends AnyHexBoardInput = AnyHexBoardInput>
|
|
|
3269
3714
|
maxZoom?: number;
|
|
3270
3715
|
className?: string;
|
|
3271
3716
|
interactiveSpaces?: InteractiveTargetLayer;
|
|
3272
|
-
interactiveVertices?: InteractiveTargetLayer;
|
|
3273
3717
|
interactiveEdges?: InteractiveTargetLayer;
|
|
3274
|
-
|
|
3275
|
-
renderInteractiveSpace?: (space:
|
|
3276
|
-
|
|
3277
|
-
renderInteractiveVertex?: (vertex:
|
|
3278
|
-
x: number;
|
|
3279
|
-
y: number;
|
|
3280
|
-
}, state: InteractiveTargetRenderState) => ReactNode;
|
|
3281
|
-
|
|
3282
|
-
renderInteractiveEdge?: (edge: InteractiveHexEdge<NoInfer<TBoard>>, position: EdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3283
|
-
interactiveVertexSize?: number;
|
|
3284
|
-
interactiveEdgeSize?: number;
|
|
3718
|
+
interactiveVertices?: InteractiveTargetLayer;
|
|
3719
|
+
renderInteractiveSpace?: (space: InteractiveSquareSpace<NoInfer<TBoard>>, state: InteractiveTargetRenderState) => ReactNode;
|
|
3720
|
+
renderInteractiveEdge?: (edge: InteractiveSquareEdge<NoInfer<TBoard>>, position: SquareEdgePosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3721
|
+
renderInteractiveVertex?: (vertex: InteractiveSquareVertex<NoInfer<TBoard>>, position: SquareVertexPosition, state: InteractiveTargetRenderState) => ReactNode;
|
|
3285
3722
|
}
|
|
3286
|
-
interface
|
|
3287
|
-
|
|
3723
|
+
interface DefaultGridCellProps {
|
|
3288
3724
|
size: number;
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
isSelected?: boolean;
|
|
3725
|
+
isLight?: boolean;
|
|
3726
|
+
lightColor?: string;
|
|
3727
|
+
darkColor?: string;
|
|
3293
3728
|
isHighlighted?: boolean;
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
};
|
|
3300
|
-
orientation?: HexOrientation;
|
|
3729
|
+
highlightColor?: string;
|
|
3730
|
+
isSelected?: boolean;
|
|
3731
|
+
selectedColor?: string;
|
|
3732
|
+
isValidMove?: boolean;
|
|
3733
|
+
isCapture?: boolean;
|
|
3301
3734
|
onClick?: () => void;
|
|
3302
3735
|
onPointerEnter?: () => void;
|
|
3303
3736
|
onPointerLeave?: () => void;
|
|
3304
3737
|
className?: string;
|
|
3305
3738
|
}
|
|
3306
3739
|
|
|
3307
|
-
declare function
|
|
3308
|
-
interface
|
|
3309
|
-
|
|
3310
|
-
color
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3740
|
+
declare function DefaultGridCell({ size, isLight, lightColor, darkColor, isHighlighted, highlightColor, isSelected, selectedColor, isValidMove, isCapture, onClick, onPointerEnter, onPointerLeave, className, }: DefaultGridCellProps): react_jsx_runtime.JSX.Element;
|
|
3741
|
+
interface DefaultGridPieceProps {
|
|
3742
|
+
size: number;
|
|
3743
|
+
color?: string;
|
|
3744
|
+
strokeColor?: string;
|
|
3745
|
+
label?: string;
|
|
3746
|
+
isDragging?: boolean;
|
|
3314
3747
|
onClick?: () => void;
|
|
3748
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3315
3749
|
className?: string;
|
|
3316
3750
|
}
|
|
3317
3751
|
|
|
3318
|
-
declare function
|
|
3319
|
-
interface
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
};
|
|
3324
|
-
color: string;
|
|
3325
|
-
stroke?: string;
|
|
3326
|
-
strokeWidth?: number;
|
|
3327
|
-
hasOwner?: boolean;
|
|
3328
|
-
isSelected?: boolean;
|
|
3329
|
-
isHighlighted?: boolean;
|
|
3330
|
-
size?: number;
|
|
3331
|
-
touchTargetSize?: number;
|
|
3332
|
-
shape?: "circle" | "square";
|
|
3752
|
+
declare function DefaultGridPiece({ size, color, strokeColor, label, isDragging, onClick, onPointerDown, className, }: DefaultGridPieceProps): react_jsx_runtime.JSX.Element;
|
|
3753
|
+
interface DefaultChessPieceProps {
|
|
3754
|
+
size: number;
|
|
3755
|
+
type: string;
|
|
3756
|
+
owner: "white" | "black";
|
|
3333
3757
|
onClick?: () => void;
|
|
3334
|
-
|
|
3335
|
-
onPointerLeave?: () => void;
|
|
3758
|
+
onPointerDown?: (e: React.PointerEvent) => void;
|
|
3336
3759
|
className?: string;
|
|
3337
3760
|
}
|
|
3338
3761
|
|
|
3339
|
-
declare function
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3348
|
-
r: number;
|
|
3349
|
-
}>;
|
|
3350
|
-
getDistance(q1: number, r1: number, q2: number, r2: number): number;
|
|
3351
|
-
getHexCorners(centerX: number, centerY: number, size: number, orientation: HexOrientation): Array<{
|
|
3352
|
-
x: number;
|
|
3353
|
-
y: number;
|
|
3354
|
-
}>;
|
|
3355
|
-
getHexPoints(centerX: number, centerY: number, size: number, orientation: HexOrientation): string;
|
|
3356
|
-
getEdgePosition(hex1Pos: {
|
|
3357
|
-
x: number;
|
|
3358
|
-
y: number;
|
|
3359
|
-
}, hex2Pos: {
|
|
3360
|
-
x: number;
|
|
3361
|
-
y: number;
|
|
3362
|
-
}, size: number): EdgePosition;
|
|
3363
|
-
getVertexPosition(hex1Pos: {
|
|
3364
|
-
x: number;
|
|
3365
|
-
y: number;
|
|
3366
|
-
}, hex2Pos: {
|
|
3367
|
-
x: number;
|
|
3368
|
-
y: number;
|
|
3369
|
-
}, hex3Pos: {
|
|
3370
|
-
x: number;
|
|
3371
|
-
y: number;
|
|
3372
|
-
}): {
|
|
3373
|
-
x: number;
|
|
3374
|
-
y: number;
|
|
3375
|
-
};
|
|
3376
|
-
};
|
|
3377
|
-
interface HexGridComponent {
|
|
3378
|
-
<const TBoard extends AnyHexBoardInput>(props: HexGridBoardProps<TBoard>): ReactNode;
|
|
3379
|
-
<const TProps extends HexGeneratedGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
3380
|
-
<const TProps extends HexAuthoredGridInputProps>(props: HexGridProps<TProps>): ReactNode;
|
|
3762
|
+
declare function DefaultChessPiece({ size, type, owner, onClick, onPointerDown, className, }: DefaultChessPieceProps): react_jsx_runtime.JSX.Element;
|
|
3763
|
+
|
|
3764
|
+
declare function toAlgebraic(row: number, col: number, totalRows: number): string;
|
|
3765
|
+
|
|
3766
|
+
declare function toNumeric(row: number, col: number): string;
|
|
3767
|
+
interface SquareGridComponent {
|
|
3768
|
+
<const TBoard extends AnySquareBoardInput>(props: SquareGridBoardProps<TBoard>): ReactNode;
|
|
3769
|
+
<const TProps extends SquareGeneratedGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3770
|
+
<const TProps extends SquareAuthoredGridInputProps>(props: SquareGridProps<TProps>): ReactNode;
|
|
3381
3771
|
}
|
|
3382
|
-
declare const
|
|
3772
|
+
declare const SquareGrid: SquareGridComponent;
|
|
3383
3773
|
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3774
|
+
interface PluginRuntimeAPI extends RuntimeAPI {
|
|
3775
|
+
|
|
3776
|
+
getSnapshot: () => PluginStateSnapshot | null;
|
|
3777
|
+
|
|
3778
|
+
subscribeToState: (listener: (state: PluginStateSnapshot) => void) => () => void;
|
|
3779
|
+
|
|
3780
|
+
_subscribeToSessionState: (listener: (state: PluginSessionState) => void) => () => void;
|
|
3781
|
+
|
|
3782
|
+
restoreHistory?: (entryId: string) => void;
|
|
3783
|
+
}
|
|
3389
3784
|
|
|
3390
|
-
interface
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
id: BoardIdOf<TBoard>;
|
|
3394
|
-
layout?: "hex";
|
|
3395
|
-
orientation?: "pointy-top" | "flat-top";
|
|
3396
|
-
tiles: ReadonlyArray<HexBoardViewTile<TBoard, TSpaceView>>;
|
|
3397
|
-
edges: TBoard["edges"];
|
|
3398
|
-
vertices: TBoard["vertices"];
|
|
3785
|
+
interface UsePluginRuntimeOptions {
|
|
3786
|
+
|
|
3787
|
+
timeout?: number;
|
|
3399
3788
|
}
|
|
3400
|
-
interface
|
|
3401
|
-
|
|
3789
|
+
interface UsePluginRuntimeResult {
|
|
3790
|
+
|
|
3791
|
+
runtime: PluginRuntimeAPI;
|
|
3792
|
+
|
|
3793
|
+
isReady: boolean;
|
|
3794
|
+
|
|
3795
|
+
error: string | null;
|
|
3402
3796
|
}
|
|
3403
3797
|
|
|
3404
|
-
declare function
|
|
3405
|
-
id: BoardSpaceIdOf<TBoard>;
|
|
3406
|
-
}>(board: TBoard, options: CreateHexBoardViewOptions<TSpaceView>): HexBoardView<TBoard, TSpaceView>;
|
|
3798
|
+
declare function usePluginRuntime(options?: UsePluginRuntimeOptions): UsePluginRuntimeResult;
|
|
3407
3799
|
|
|
3408
|
-
export { ActionButton, ActionGroup, ActionPanel, Board,
|
|
3409
|
-
export type { ActionButtonProps, ActionGroupProps, ActionPanelProps, AnyHexBoardInput, AnySquareBoardInput, AuthoredHexBoardInput, AuthoredSquareBoardInput, BoardEdgeIdOf,
|
|
3800
|
+
export { ActionButton, ActionGroup, ActionPanel, Board, BoardEdgeTarget, BoardHexGrid, BoardHexView, BoardRoot, BoardSpaceTarget, BoardState, BoardTarget, BoardVertexTarget, Card, CostDisplay, DefaultChessPiece, DefaultEmptySlot, DefaultGridCell, DefaultGridPiece, DefaultHexEdge, DefaultHexTile, DefaultHexVertex, DefaultNetworkEdge, DefaultNetworkNode, DefaultNetworkPiece, DefaultSlotItem, DefaultSlotOccupant, DefaultTrackConnection, DefaultTrackJump, DefaultTrackPiece, DefaultTrackSpace, DefaultZone, DefaultZonePiece, DefaultZonePieces, Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, Dice, DiceRoller, DiceRoot, DiceValues, Drawer, DrawerClose, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerPortal, DrawerTitle, DrawerTrigger, ErrorBoundary, Game, GameEndDisplay, GameRoot, GameSkeleton, Hand, HandDock, HexGrid, Interaction, InteractionCardInput, InteractionDescription, InteractionDialog, InteractionForm, InteractionFormPrimitive, InteractionInput, InteractionLabel, InteractionRoot, InteractionState, InteractionSubmit, InteractionSwitch, InteractionTrigger, InteractionUnavailableMessage, InteractionValidationMessage, MoreActions, NetworkGraph, Phase, PhaseIndicator, PhaseSwitch, PlayArea, PlayerRoster, PlayerRosterBadges, PlayerRosterEmpty, PlayerRosterList, PlayerRosterName, PlayerRosterRoot, PlayerRosterScore, PlayerRosterSwitchButton, PluginRuntime, PluginStateProvider, PrimaryActionButton, PrimaryButton, Prompt, PromptDialog, PromptInbox, PromptInboxEmpty, PromptInboxItems, PromptInboxRoot, PromptMessage, PromptOption, PromptOptions, PromptRoot, PromptTitle, ResourceCounter, ResourceCounterCount, ResourceCounterIcon, ResourceCounterItem, ResourceCounterLabel, ResourceCounterRoot, RuntimeContext, RuntimeProvider, SlotSystem, SquareGrid, ThemeProvider, ThemedButton, Toast, ToastActions, ToastProvider, TrackBoard, UI, UIRoot, Zone, ZoneCardAction, ZoneCardAt, ZoneItem, ZoneList, ZoneMap, ZonePileCards, ZonePileCount, ZonePileDescription, ZonePileLabel, ZonePileRoot, ZonePileTrigger, ZoneRoot, ZoneTopCard, arcadeTheme, buttonStyle, calculateViewBox, chipStyle, composeEventHandlers, createDreamboardUI, createHexBoardView, createResourceCounter, cssVar, cssVarOr, defaultFormInputs, deriveBoardTheme, getThemePreset, hasDefaultInteractionFormFields, hexColor, hexUtils, intentForVariant, isHexColor, mergeTheme, motionDuration, normalizeDiceState, normalizeHexBoardInput, normalizeSquareBoardInput, parseHexColor, playerColor, renderPrimitive, resolveTheme, studioTheme, surfaceStyle, tabletopTheme, themeToCssVars, toAlgebraic, toNumeric, toTrackBoardData, useBoardPrimitiveContext, useBoardTheme, useDicePrimitiveContext, useGameActionError, useHandLayout, useInteractionPrimitiveContext, useOptionalZonePrimitiveContext, usePanZoom, usePluginRuntime, useTheme, useThemeCssVars, useZoneCardContext, useZonePileContext, useZonePrimitiveContext };
|
|
3801
|
+
export type { ActionButtonProps, ActionGroupProps, ActionPanelProps, AnyHexBoardInput, AnySquareBoardInput, AuthoredHexBoardInput, AuthoredSquareBoardInput, BoardEdgeIdOf, BoardEdgeTargetProps, BoardHexGridInteractionFilter, BoardHexGridInteractions, BoardHexGridProps, BoardHexViewProps, BoardKindStates, BoardRef, BoardRootProps, BoardSelectionResult, BoardSpaceIdOf, BoardSpaceTargetProps, BoardStateProps, BoardStates, BoardTargetExtraInputs, BoardTargetKey, BoardTargetProps, BoardTheme, BoardVertexIdOf, BoardVertexTargetProps, BoundResourceCounterRootProps, ButtonSize$1 as ButtonSize, ButtonVariant$1 as ButtonVariant, CardCollection, CardKey, CardPositionProps, CardProps, CardSize, ClientParamSchema, ClientParamSchemaMap, ColorRamp, ComponentTokens, CostDisplayProps, DefaultChessPieceProps, DefaultEmptySlotProps, DefaultGridCellProps, DefaultGridPieceProps, DefaultHexEdgeProps, DefaultHexTileProps, DefaultHexVertexProps, DefaultNetworkEdgeProps, DefaultNetworkNodeProps, DefaultNetworkPieceProps, DefaultSlotItemProps, DefaultSlotOccupantProps, DefaultTrackConnectionProps, DefaultTrackJumpProps, DefaultTrackPieceProps, DefaultTrackSpaceProps, DefaultZonePieceProps, DefaultZonePiecesProps, DefaultZoneProps, DiceComponents, DiceRollerProps, DiceRootProps, DiceState, DiceStates, DiceValue, DiceValuesProps, DieState, DraftValidation, DreamboardUI, DreamboardUIRegister, EdgePosition, Elevation, ErrorBoundaryProps, FoundationColor, GameEndDisplayProps, GameMeState, GamePlayer, GamePlayerEntry, GamePlayersState, GameRenderState, GameRootProps, GameSkeletonProps, GameState, GameTurnState, GeneratedHexBoardInput, GeneratedHexSpaceStateLike, GeneratedSquareBoardInput, GeneratedSquareSpaceStateLike, GeneratedTiledEdgeStateLike, GeneratedTiledVertexStateLike, HandDockMode, HandDockPlacement, HandDockPresentation, HandDockProps, HandDockToggleContext, HandLayout, HandProps, HexBoardInput, HexBoardState, HexBoardView, HexBoardViewTile, HexColor, HexEdgeState, HexGridBoardProps, HexGridProps, HexOrientation, HexTileGeometry, HexTileState, HexVertexState, InputDomainDependencyCase, IntentColor, InteractionCardInputProps, InteractionContext, InteractionContextOption, InteractionDescriptor, InteractionDialogProps, InteractionDialogRenderState, InteractionDialogState, InteractionFieldPrimitiveProps, InteractionFormPrimitiveProps, InteractionFormProps, InteractionHandle, InteractionHandleStatus, InteractionInputKey, InteractionInputProps, InteractionKey, InteractionParamsShape, InteractionPartProps, InteractionRootProps, InteractionRouteMap, InteractionStateProps, InteractionStateSnapshot, InteractionSubmitProps, InteractionSwitchProps, InteractionSwitchRenderState, InteractionTriggerProps, InteractiveHexEdge, InteractiveHexVertex, InteractiveSquareEdge, InteractiveSquareVertex, InteractiveTargetLayer, InteractiveTargetRenderState, MoreActionsProps, Motion, NetworkBoardState, NetworkEdge, NetworkEdgeState, NetworkGraphProps, NetworkNode, NetworkNodeState, NetworkPiece, NetworkPieceState, NormalizedHexBoard, NormalizedHexEdgeOf, NormalizedHexTileOf, NormalizedHexVertexOf, NormalizedSquareBoard, NormalizedSquareCellOf, NormalizedSquareEdgeOf, NormalizedSquarePieceOf, NormalizedSquareVertexOf, PanZoomTransform, PerPlayer, PerPlayerBoardRef, PhaseFallback, PhaseIndicatorProps, PhaseKey, PhaseRouteMap, PhaseSwitchProps, PlayAreaProps, Player, PlayerColor, PlayerRosterBadge, PlayerRosterComponents, PlayerRosterEntry, PlayerRosterListProps, PlayerRosterPartProps, PlayerRosterRootProps, PlayerRosterSwitchButtonProps, PlayerScore, PluginRuntimeProps, PluginSessionState, PluginStateSnapshot, PrimaryActionAttention, PrimaryActionButtonProps, PrimaryButtonProps, PrimitiveCommonProps, PrimitiveDataAttributes, PromptDialogProps, PromptDialogRenderState, PromptDialogState, PromptInboxItemsProps, PromptKey, PromptOptionKey, PromptOptionProps, PromptOptionRenderItem, PromptOptionsProps, PromptRootProps, Radius, RegisteredUI, ResourceCounterComponents, ResourceCounterItemState, ResourceCounterPartProps, ResourceCounterProps, ResourceCounterRootProps, ResourceDefinition, ResourceDisplayConfig, ResourceIconProps, RuntimeAPI, SemanticColor, SharedBoardRef, SlotDefinition, SlotOccupant, SlotSystemProps, Space, SquareBoardInput, SquareBoardState, SquareCellState, SquareEdgePosition, SquareEdgeState, SquareGridBoardProps, SquareGridProps, SquarePieceState, SquareVertexPosition, SquareVertexState, SubmissionError, Theme, ThemeContextValue, ThemeMeta, ThemeOverride, ThemePresetId, ThemeProviderProps, ThemedButtonProps, ToastActionsProps, ToastActionsValue, ToastNotification, ToastType, TrackBoardProps, TrackBoardState, TrackPiece, TrackPieceState, TrackSpace, TrackSpaceState, TypedBoard, TypedGame, TypedInteraction, TypedPhase, TypedPlayerRoster, TypedPrompt, TypedPromptInbox, TypedZone, Typography, UIContract, UIContractBucket, UIRootProps, UseHandLayoutOptions, UseHandLayoutReturn, UsePanZoomOptions, UsePanZoomReturn, UsePluginRuntimeOptions, UsePluginRuntimeResult, ValidationResult, ViewCard, ViewSlotOccupant, ZoneCardActionExtraInputs, ZoneCardActionProps, ZoneCardActionResult, ZoneCardAtProps, ZoneCardRenderItem, ZoneDefinition, ZoneHighlightType, ZoneItemProps, ZoneKey, ZoneListProps, ZoneMapProps, ZonePiece, ZonePileCardsProps, ZonePileContextValue, ZonePileCountProps, ZonePileDescriptionProps, ZonePileLabelProps, ZonePileRootProps, ZonePileTriggerProps, ZoneRootProps, ZoneShape, ZoneTopCardProps };
|