castle-web-sdk 0.4.47 → 0.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +260 -3
- package/dist/castle.d.ts +7 -3
- package/dist/castle.js +2 -0
- package/dist/commands.d.ts +162 -1
- package/dist/commands.js +3 -0
- package/dist/display.d.ts +3 -0
- package/dist/display.js +9 -3
- package/dist/hub.d.ts +33 -6
- package/dist/hub.js +50 -4
- package/dist/multiplayer.d.ts +7 -1
- package/dist/multiplayer.js +140 -40
- package/dist/multiplayerProtocol.d.ts +2 -0
- package/dist/party.d.ts +23 -0
- package/dist/party.js +91 -0
- package/dist/reconnectBudget.d.ts +23 -0
- package/dist/reconnectBudget.js +96 -0
- package/dist/save.d.ts +38 -1
- package/dist/save.js +79 -6
- package/dist/server/hub.d.ts +31 -1
- package/dist/server/hub.js +50 -3
- package/dist/server/platformHandle.d.ts +13 -1
- package/dist/server/storage.d.ts +4 -0
- package/dist/server/storage.js +19 -3
- package/dist/server/wrapper.d.ts +7 -1
- package/dist/server/wrapper.js +10 -1
- package/dist/social.d.ts +9 -0
- package/dist/social.js +5 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -26,12 +26,15 @@ import { setup, initCard, Store, Leaderboard } from "castle-web-sdk";
|
|
|
26
26
|
- [Pass](#pass)
|
|
27
27
|
- [Snapshot](#snapshot)
|
|
28
28
|
- [Portal](#portal)
|
|
29
|
+
- [Social](#social)
|
|
30
|
+
- [Party](#party)
|
|
29
31
|
- [Hub](#hub)
|
|
30
32
|
- [Decks](#decks)
|
|
31
33
|
- [Clipboard](#clipboard)
|
|
32
34
|
- [Haptics](#haptics)
|
|
33
35
|
- [Agent](#agent)
|
|
34
36
|
- [Lifecycle](#lifecycle)
|
|
37
|
+
- [Display](#display)
|
|
35
38
|
- [Multiplayer](#multiplayer)
|
|
36
39
|
- [Setup](#setup)
|
|
37
40
|
- [Saving files](#writefilepath-contents-promisevoid)
|
|
@@ -64,7 +67,25 @@ Named rooms use `{ mode: "named", key: "room-name" }`; party sessions use
|
|
|
64
67
|
reconnects temporary socket drops automatically. `onStateChange` reports
|
|
65
68
|
`acquiring`, `connecting`, `connected`, `reconnecting`, and `closed`; its optional
|
|
66
69
|
metadata distinguishes a server `bye`, a replaced server version, an explicit
|
|
67
|
-
`leave`, and connection failures.
|
|
70
|
+
`leave`, and connection failures. The reconnect retry budget counts 30 seconds
|
|
71
|
+
of foreground time; time while the page is hidden or frozen does not spend it,
|
|
72
|
+
and a stall of the page's JavaScript (a debugger pause, an app pausing its web
|
|
73
|
+
view) spends at most two seconds. After any return the SDK tries the reconnect
|
|
74
|
+
credential at least once before giving up on it. Retries wait for the page to
|
|
75
|
+
become visible and resume. A server rejecting the
|
|
76
|
+
credential or confirming the session ended can still trigger a fresh join sooner.
|
|
77
|
+
|
|
78
|
+
`connection.serverBundleId` and `connection.serverBundleSha256` identify the server publication running the connected session. These read-only diagnostics are `null` before a live connection, while disconnected, in solo mode, or when the host does not provide them. The ID identifies a publication; the SHA-256 identifies its code bytes, so two publications can share a hash. Read the values again after a reconnect or a destination join. They describe the running server, not the client bundle or the deck’s newest save.
|
|
79
|
+
|
|
80
|
+
Experimental: `Multiplayer.join({ mode: "public", pongTimeoutMs: 10_000 })`
|
|
81
|
+
reconnects if a keepalive ping receives no pong within the given milliseconds.
|
|
82
|
+
Omitting the option (or passing `0`) preserves the existing keepalive behavior.
|
|
83
|
+
The deadline starts at a ping, normally sent every 25 seconds; it is not a
|
|
84
|
+
deadline for game messages. A deadline callback delayed by more than one second (for example during page
|
|
85
|
+
suspension) sends one fresh ping and waits a full deadline before reconnecting. Only one
|
|
86
|
+
such extension is allowed without a pong, so repeated timer throttling cannot
|
|
87
|
+
postpone recovery indefinitely.
|
|
88
|
+
|
|
68
89
|
During local development, reloading a Play panel restores that panel's session
|
|
69
90
|
when its dev server is still running. A separate Play panel joins separately.
|
|
70
91
|
|
|
@@ -147,6 +168,13 @@ export default {
|
|
|
147
168
|
|
|
148
169
|
`session.storage.deck` is shared by everyone playing.
|
|
149
170
|
`session.storage.user(userId)` is one player's public data.
|
|
171
|
+
`await session.storage.playthrough(userId)` opens that player's generation-bound
|
|
172
|
+
game state. Its `resetGeneration` is present only after an administrator has
|
|
173
|
+
reset that player's progress for this deck. It is a monotonic reset marker,
|
|
174
|
+
separate from the handle's `generation`, which fences playthrough operations.
|
|
175
|
+
Deck-scope storage writes are not fenced by either generation; a server using
|
|
176
|
+
`session.storage.deck` must discard its own stale queued writes and cached
|
|
177
|
+
per-player values when it observes a newer reset marker.
|
|
150
178
|
`session.storage.board(name)` is a leaderboard. The root and its buckets also
|
|
151
179
|
support the [atomic save API](#atomic-saves). Each scope has the same
|
|
152
180
|
`get`, `set`, `remove`, `increment` and `list` as `Store`.
|
|
@@ -196,10 +224,22 @@ dev serve.
|
|
|
196
224
|
|
|
197
225
|
- `session.hub.place`, `.title` and `.result` are the place and the result shape
|
|
198
226
|
as published (`result` is `null` for a place that reports none, such as a town).
|
|
227
|
+
- `session.hub.reconnectWindowMs`, when present, is Castle's pinned hub-place
|
|
228
|
+
reconnect grace in milliseconds, inclusive at the deadline. It is absent on
|
|
229
|
+
sessions without a pinned grace and older hosts. Kits use it to match visit retention to the
|
|
230
|
+
transport window; deck code does not choose it.
|
|
199
231
|
- `session.hub.arrival(playerId)` is how a player came in when Castle placed them
|
|
200
232
|
through a hub door: `{ fromDeckId, doorId }` (`doorId` is `null` when the door
|
|
201
233
|
names none), else `null`. It is Castle's word, never a client's, and it is also
|
|
202
234
|
the third argument of `onPlayerJoin`.
|
|
235
|
+
- `session.hub.push` is optional, present only for a place declaring
|
|
236
|
+
`hub.push: { version: 1 }` on a capable runtime. Its
|
|
237
|
+
`visit(playerId, { userId, timezone })` reports a visit with the captured
|
|
238
|
+
authenticated account and an IANA timezone. It returns a boolean acknowledgement.
|
|
239
|
+
Ghost derives the three-day come-back reminder and checks consent, answered
|
|
240
|
+
age, experiments, quiet hours and delivery limits. Reporting a visit does not
|
|
241
|
+
opt the player in or promise a notification. No crop reporting or queue
|
|
242
|
+
reconciliation API is exposed.
|
|
203
243
|
- `session.hub.reportResult(playerId, { outcome?, score?, stats? })` records a
|
|
204
244
|
signed-in player's result for this visit, once. The host checks it against the
|
|
205
245
|
published shape and Castle keeps it only for a place behind a curated door;
|
|
@@ -257,6 +297,9 @@ dev serve.
|
|
|
257
297
|
ids. Missing lists are empty on older hosts. Mutual friends keep the chat age
|
|
258
298
|
and block rules; follows in either direction require no block, with no age rule.
|
|
259
299
|
These lists belong to the viewer only and must never go to another client.
|
|
300
|
+
Optional third argument `{ strict: true }` rejects malformed raw lists before
|
|
301
|
+
normalization and adds `validated: true` to a successful result. Without it,
|
|
302
|
+
the existing response shape and older-host behavior remain unchanged.
|
|
260
303
|
- `session.hub.hiddenPair(playerIdA, playerIdB)` is true when a block hides these
|
|
261
304
|
two players from each other (either one blocked the other). Never send either
|
|
262
305
|
one the other's pose, avatar or name. The block lists themselves never reach
|
|
@@ -625,6 +668,72 @@ claim can fail with writer loss while `committed === true` and its original
|
|
|
625
668
|
receipt; it never takes ownership again. Transport ambiguity keeps the outcome
|
|
626
669
|
unknown until receipt lookup or identical replay settles it.
|
|
627
670
|
|
|
671
|
+
### Conditional writes and recovery (gated)
|
|
672
|
+
|
|
673
|
+
`Store.conditionalWrite(input)` and `session.storage.conditionalWrite(input)`
|
|
674
|
+
use the same request and receipt as `transaction`. Read with `snapshot`, then
|
|
675
|
+
pass its `access` and each target's `revision` as `expectedAccess` and
|
|
676
|
+
`expectedRevision`. Use `null` to create an absent target. A revision belongs
|
|
677
|
+
to a **prefix**, so changing any key in it changes the revision. For an
|
|
678
|
+
independent value, give it a separate, non-overlapping prefix.
|
|
679
|
+
|
|
680
|
+
This additive API is off by default. The platform must enable conditional
|
|
681
|
+
storage for the deck after its database index and host support are ready.
|
|
682
|
+
Older hosts and the dev memory store do not support it. Keep a dependent
|
|
683
|
+
feature off when the API is unavailable; never fall back to ordinary writes.
|
|
684
|
+
Existing `get`, `set` and save methods keep their behavior.
|
|
685
|
+
|
|
686
|
+
Session servers can read `session.storage.resetGeneration(userId)` (zero before
|
|
687
|
+
the first reset) and pass `resetFences: [{ playerId, resetGeneration }]` to
|
|
688
|
+
`conditionalWrite`. Supply one or two unique numeric account IDs and integer
|
|
689
|
+
generations from 0 through 2147483647. Read generations before the snapshot used
|
|
690
|
+
to build the write. A reset that commits first refuses the write with
|
|
691
|
+
`CAULDRON_STORAGE_STALE_RESET_GENERATION`, `committed: false`, and
|
|
692
|
+
`playerId`, `expectedResetGeneration`, and current `resetGeneration` on the
|
|
693
|
+
`SaveError` and its `extensions`. A write that commits first retains its receipt;
|
|
694
|
+
recovery must check current generations before adopting it. Clients cannot send
|
|
695
|
+
reset fences. Omitting them preserves the existing request.
|
|
696
|
+
|
|
697
|
+
One call changes up to eight targets, with up to eight explicit key changes
|
|
698
|
+
per target, across the same deck and at most two players. Every target needs
|
|
699
|
+
its expected revision. A read-only `check` can use `expectedRevision: null`
|
|
700
|
+
to require absence without creating that target. All changes commit together. Clients may address their
|
|
701
|
+
own user/private targets and writable deck targets; only the deck server can
|
|
702
|
+
condition on another player's user target. Servers cannot access private data.
|
|
703
|
+
Existing quota, byte and rate allowances still apply. A prefix replacement
|
|
704
|
+
also removes its previous rows, subject to those allowances.
|
|
705
|
+
|
|
706
|
+
On a revision conflict, `SaveError.code` is
|
|
707
|
+
`CAULDRON_STORAGE_REVISION_CONFLICT`, `committed` is `false`, and `current`
|
|
708
|
+
contains the current values and revisions read at the failed comparison.
|
|
709
|
+
If that full snapshot exceeds the byte allowance, the call fails with
|
|
710
|
+
`CAULDRON_STORAGE_TOO_LARGE`; no changes commit. Keep the player's proposed
|
|
711
|
+
change and reload before offering another choice.
|
|
712
|
+
|
|
713
|
+
Use a unique `operationId` for each action. Retrying the **identical request**
|
|
714
|
+
after a lost reply returns its original committed receipt, even if values
|
|
715
|
+
have since changed. Reusing the ID with different input is refused. Failed
|
|
716
|
+
comparisons do not create receipts. Receipts have no automatic expiry and
|
|
717
|
+
are retained beyond 24 hours; an explicit data/account reset may remove them.
|
|
718
|
+
Never reuse old operation IDs or access tokens after a reset.
|
|
719
|
+
|
|
720
|
+
`recentOperations({ limit?, cursor? })`, on both root APIs, discovers the
|
|
721
|
+
caller's committed operation IDs after a restart. It returns
|
|
722
|
+
`{ operations: [{ operationId, committedAt, receipt }], cursor }`, newest
|
|
723
|
+
first. `limit` defaults to 16 and is at most 32; pass the returned cursor for
|
|
724
|
+
the next page. This lists existing save receipts too. Client and server
|
|
725
|
+
histories are separate; all layers of the same deck share the server history.
|
|
726
|
+
Use a smaller limit if the reply exceeds the byte allowance. A history page
|
|
727
|
+
is discovery, not a snapshot of current values: reload with `snapshot` before
|
|
728
|
+
building the next change. `operation(id)` still looks up a known ID.
|
|
729
|
+
|
|
730
|
+
Pairing can atomically create a project and reserve both players' recovery
|
|
731
|
+
entries. The game server must still validate consent, membership and editing
|
|
732
|
+
leases. A market sale can atomically update stock, the daily cap and the
|
|
733
|
+
purse, once **every** writer of those values uses the managed targets.
|
|
734
|
+
Durable game recovery entries belong in those targets; recent operation
|
|
735
|
+
receipts alone do not define permanent project ownership or sale policy.
|
|
736
|
+
|
|
628
737
|
### Save coordinator
|
|
629
738
|
|
|
630
739
|
`createSaveCoordinator`, from `castle-web-sdk` or `castle-web-sdk/server`,
|
|
@@ -1075,14 +1184,128 @@ Snapshot.onTaken(() => {
|
|
|
1075
1184
|
});
|
|
1076
1185
|
```
|
|
1077
1186
|
|
|
1187
|
+
## Social
|
|
1188
|
+
|
|
1189
|
+
`Social` gives a Cauldron deck the signed-in player's mutual Castle follows.
|
|
1190
|
+
The host supplies the player and current deck from trusted play context; a deck
|
|
1191
|
+
cannot ask about another account or deck. A host from before Social rejects with
|
|
1192
|
+
`CastleError` code `UNKNOWN_COMMAND`.
|
|
1193
|
+
|
|
1194
|
+
- `Social.friends()` returns at most 20 mutual follows as
|
|
1195
|
+
`{ userId, username, photoUrl? }`. A one-way follow is not a friend here.
|
|
1196
|
+
- `Social.presence()` returns the mutual friends playing this deck now as
|
|
1197
|
+
`{ userId, username, photoUrl?, sessionId, routeId?, slot?, updatedAt }`.
|
|
1198
|
+
Castle's now-playing privacy and multiplayer gates apply. It fails closed to
|
|
1199
|
+
`[]` when presence is gated or unavailable.
|
|
1200
|
+
|
|
1201
|
+
Presence has no event in v1. Poll `Social.presence()` when the game needs to
|
|
1202
|
+
refresh its list; do not treat `updatedAt` as a durable offline record.
|
|
1203
|
+
|
|
1204
|
+
```js
|
|
1205
|
+
import { Social } from "castle-web-sdk";
|
|
1206
|
+
|
|
1207
|
+
const friends = await Social.friends();
|
|
1208
|
+
const playingHere = await Social.presence();
|
|
1209
|
+
```
|
|
1210
|
+
|
|
1211
|
+
## Party
|
|
1212
|
+
|
|
1213
|
+
`Party` creates and drives Castle parties with the signed-in player's account.
|
|
1214
|
+
Castle still enforces membership, roles, age and party permissions; refusals are
|
|
1215
|
+
`CastleError`s carrying the server's code. Party and user-id arrays are bounded
|
|
1216
|
+
to 32 users.
|
|
1217
|
+
|
|
1218
|
+
- `Party.current()` returns the party this play was launched with as
|
|
1219
|
+
`{ partyId, name, status, hasUnreadMessages }`, or `null`. The party id comes
|
|
1220
|
+
only from trusted host context, and no request is made when the play has none.
|
|
1221
|
+
- `Party.create(userIds)` creates a party containing those users and the
|
|
1222
|
+
signed-in player. It never sets an initial deck. Creating one does not change
|
|
1223
|
+
`Party.current()` or the launch party used by
|
|
1224
|
+
`Multiplayer.join({ mode: "party" })`.
|
|
1225
|
+
- `Party.invite(partyId, userIds)` invites more users.
|
|
1226
|
+
- `Party.respond(partyId, accept)` accepts or rejects an invitation.
|
|
1227
|
+
- `Party.members(partyId)` returns
|
|
1228
|
+
`{ userId, username, photoUrl?, status, role }` rows. `role` is `member`,
|
|
1229
|
+
`host` or `owner`.
|
|
1230
|
+
- `Party.leave(partyId)` leaves the party.
|
|
1231
|
+
- `Party.messages(partyId, cursor?)` returns
|
|
1232
|
+
`{ messages, cursor }`. Messages are newest first; pass the cursor to load
|
|
1233
|
+
**older** history (the opposite direction from `Hub.chat(after)`). Each message
|
|
1234
|
+
has `{ id, fromUserId, fromUsername, body, text, createdAt }`. `body` is the
|
|
1235
|
+
Castle chat JSON; `text` is non-null only when that body is plain text with no
|
|
1236
|
+
tags, links or embeds.
|
|
1237
|
+
- `Party.say(partyId, text)` sends plain text to the party. The host trims it
|
|
1238
|
+
and caps it at 1,000 characters, then returns the stored `PartyMessage`.
|
|
1239
|
+
|
|
1240
|
+
```js
|
|
1241
|
+
import { Party } from "castle-web-sdk";
|
|
1242
|
+
|
|
1243
|
+
const party = await Party.current();
|
|
1244
|
+
if (party) {
|
|
1245
|
+
const page = await Party.messages(party.partyId);
|
|
1246
|
+
await Party.say(party.partyId, "Meet by the gate!");
|
|
1247
|
+
}
|
|
1248
|
+
```
|
|
1249
|
+
|
|
1078
1250
|
## Hub
|
|
1079
1251
|
|
|
1252
|
+
Hub contract v1.95 adds optional invites. A place declaring `hub.invite: true`
|
|
1253
|
+
can call `hub.invite(playerId)` on its server to offer **Invite a friend**.
|
|
1254
|
+
As of contract v1.124, `Hub.invite()` makes one link for up to five friends,
|
|
1255
|
+
expiring within 24 hours. The kit opens it directly with native Share when
|
|
1256
|
+
supported and an explicit Copy link action. `Hub.invite({ crew: false })`
|
|
1257
|
+
retains the one-use option for callers that need it. Hosts without invite
|
|
1258
|
+
support return `unavailable`.
|
|
1259
|
+
|
|
1260
|
+
`Hub.canInvite()` answers `{ status: 'ok', canInvite }`: whether the host will
|
|
1261
|
+
make a link for this player, by Castle's invite rule for the account (signed
|
|
1262
|
+
in, over 13, in the invite audience). The kit offers **Invite a friend** only on
|
|
1263
|
+
`canInvite: true`. Hosts without hub support answer `unavailable`, and a host
|
|
1264
|
+
older than the command rejects it, so treat anything else as no.
|
|
1265
|
+
With `canInvite: true`, newer hosts also name the account the links belong to
|
|
1266
|
+
(`userId`, a guest's included); the kit offers the action only while that
|
|
1267
|
+
account is the player's own, and checks `User.getCurrent()` when a host names
|
|
1268
|
+
none.
|
|
1269
|
+
|
|
1270
|
+
The trusted host resolves the link after sign-in, retains its token, and requests
|
|
1271
|
+
the inviter's layer when it has room. If resolution refuses the invite, the host
|
|
1272
|
+
discards it for that visit and joins normally. Transient resolution failures
|
|
1273
|
+
retry with backoff; after five failures the host also discards the invite.
|
|
1274
|
+
Anonymous players join normally without using the invite.
|
|
1275
|
+
An invite can also route through the
|
|
1276
|
+
existing `Hub.inviteArrival()` result `{ status: 'route', doorId }` to the
|
|
1277
|
+
inviter's house or active run behind a curated door that allows late joins.
|
|
1278
|
+
Contract v1.113 active-run routing requires root `hub.bringFriend: true`
|
|
1279
|
+
in addition to `invite: true` on both the town and destination. The destination
|
|
1280
|
+
also declares `hub.bringFriend: true` so its saved bundle and fresh pin retain
|
|
1281
|
+
the invite capability;
|
|
1282
|
+
it admits only to the matching live run while the inviter is present. A full,
|
|
1283
|
+
ended or unavailable run is refused rather than recreated. The kit calls
|
|
1284
|
+
`Hub.inviteArrival()` after joining that destination. Ghost verifies arrival
|
|
1285
|
+
before creating mutual follows between each eligible
|
|
1286
|
+
over-13 arrival and the inviter. New arrivals do not follow one another;
|
|
1287
|
+
existing pairs from earlier links remain available for Undo. Under-13 arrivals create no follows. The arrival
|
|
1288
|
+
surface shows an authored now-friends line and `Hub.undoInvite(userId)` removes
|
|
1289
|
+
both follow directions for that pair. No player-entered message travels with a link.
|
|
1290
|
+
These operations retain the existing hub access gates. Link creation and arrival
|
|
1291
|
+
completion wait up to 16 seconds when the server presence roster is still catching
|
|
1292
|
+
up with the game connection.
|
|
1293
|
+
|
|
1080
1294
|
`Hub` moves a player between hub places: every deck built on the hub-game kit is
|
|
1081
1295
|
a place, and a door is a row in Castle's curated door table. A deck names only a
|
|
1082
1296
|
door; the host supplies the current place, the session it joined there and the
|
|
1083
1297
|
party, and calls Castle with the player's own account. Hosts without hub support
|
|
1084
1298
|
answer `unavailable`; older hosts reject with `CastleError` code `UNKNOWN_COMMAND`.
|
|
1085
1299
|
|
|
1300
|
+
`Hub.signIn({ reason })` asks the host to open its native sign-in flow for an
|
|
1301
|
+
anonymous player. `reason` is the short explanation shown to the player (at most
|
|
1302
|
+
200 characters and 512 UTF-8 bytes). It resolves to
|
|
1303
|
+
`{ status: 'signedIn', userId? }`, `{ status: 'dismissed' }`, or
|
|
1304
|
+
`{ status: 'unavailable' }`. `userId` is present only when the host can return
|
|
1305
|
+
the signed-in account id. A new host without native sign-in support returns
|
|
1306
|
+
`unavailable`; an older host that does not know this command rejects with
|
|
1307
|
+
`UNKNOWN_COMMAND`.
|
|
1308
|
+
|
|
1086
1309
|
- `Hub.doors()` reads the current place's doors and who is inside them:
|
|
1087
1310
|
`{ status: "ok", doors }` or `{ status: "unavailable", doors: null }`. A row has
|
|
1088
1311
|
`doorId`, `launcherKind` (`door`, `table`, `cabinet`, `gate`), `placementKind`
|
|
@@ -1091,6 +1314,10 @@ answer `unavailable`; older hosts reject with `CastleError` code `UNKNOWN_COMMAN
|
|
|
1091
1314
|
- `Hub.go(doorId)` acquires the destination behind a door of the current place.
|
|
1092
1315
|
A door used within seconds of arriving can take up to 15 seconds to answer
|
|
1093
1316
|
while Castle catches up with the arrival.
|
|
1317
|
+
`Hub.go(doorId, { ownerUserId })` on a House door visits that friend's House
|
|
1318
|
+
(the `ownerUserId` `Hub.friends()` gives a friend at home); Castle admits it
|
|
1319
|
+
only while the two are connected and the owner is home. A host that predates
|
|
1320
|
+
it ignores `ownerUserId` and acquires the player's own House.
|
|
1094
1321
|
- `Hub.back()` acquires the way back through the door the player came in by: the
|
|
1095
1322
|
layer they left if it has room, else their party's, else the usual pick. The
|
|
1096
1323
|
deck cannot choose where it leads; `not_found` when there is no way back.
|
|
@@ -1099,7 +1326,9 @@ answer `unavailable`; older hosts reject with `CastleError` code `UNKNOWN_COMMAN
|
|
|
1099
1326
|
20): `{ status: "ok", friends: [{ userId, username, here, door }] }` or
|
|
1100
1327
|
`{ status: "unavailable", friends: null }`. `here` is true for a friend in the
|
|
1101
1328
|
player's own layer; `door` is set instead for a friend inside the place behind
|
|
1102
|
-
one of this place's doors (that door's id), and null otherwise.
|
|
1329
|
+
one of this place's doors (that door's id), and null otherwise. A friend
|
|
1330
|
+
inside their own House behind that door also has `home: true` and
|
|
1331
|
+
`ownerUserId`, which `Hub.go` takes to visit them.
|
|
1103
1332
|
- `Hub.jump(userId)` acquires the layer of the current place that friend is in:
|
|
1104
1333
|
the same place in another session, joined exactly like a door's. The way back
|
|
1105
1334
|
does not change. `not_found` when the friend is not in another layer of it.
|
|
@@ -1120,7 +1349,13 @@ answer `unavailable`; older hosts reject with `CastleError` code `UNKNOWN_COMMAN
|
|
|
1120
1349
|
send it to), `refused`, `limited` (said too fast) or `unavailable`.
|
|
1121
1350
|
- `Hub.reportChat(messageId)` reports a chat message the player was returned to
|
|
1122
1351
|
Castle's moderators. The host names the place and session. `{ status: "ok" }`
|
|
1123
|
-
or `unavailable`.
|
|
1352
|
+
or `unavailable`. Pass `{ block: true }` as a second argument to also block
|
|
1353
|
+
the sender of that stored message. The host asks for confirmation naming the
|
|
1354
|
+
sender; dismissing it, or using a host without confirmation support, reports
|
|
1355
|
+
the message without blocking. Hosts limit confirmation prompts to one per
|
|
1356
|
+
minute; another request during that window reports without blocking. Only `{ status: "ok", blocked: true }`
|
|
1357
|
+
confirms both actions; older hosts can report without confirming a block.
|
|
1358
|
+
Blocks prevent chat between the pair in either direction. Hub chrome only.
|
|
1124
1359
|
- `Hub.cancel()` gives back an acquisition the deck will not join. Optional: one
|
|
1125
1360
|
that is never joined expires within two minutes.
|
|
1126
1361
|
- `Hub.onBack(listener)` hears the host's Back control, which a game cannot hide.
|
|
@@ -1511,6 +1746,13 @@ startGame(saved ?? newGame());
|
|
|
1511
1746
|
Lifecycle.ready();
|
|
1512
1747
|
```
|
|
1513
1748
|
|
|
1749
|
+
## Display
|
|
1750
|
+
|
|
1751
|
+
`getDisplay()` returns a `DeckDisplay`. Its optional `orientation` field is the
|
|
1752
|
+
deck's preferred display orientation: `landscape`, `portrait`, or `any`.
|
|
1753
|
+
Missing or unrecognized preferences mean `any`; read the value as
|
|
1754
|
+
`display.orientation ?? "any"`.
|
|
1755
|
+
|
|
1514
1756
|
## Setup
|
|
1515
1757
|
|
|
1516
1758
|
Startup, editor-mode check, and a file-write call for editor UI.
|
|
@@ -1653,6 +1895,12 @@ load its assets through the bundler instead.
|
|
|
1653
1895
|
|
|
1654
1896
|
## CastleError
|
|
1655
1897
|
|
|
1898
|
+
A multiplayer socket closed before its first hello reports its WebSocket close
|
|
1899
|
+
code in `error.extensions.closeCode` when available. Code `4404` means the
|
|
1900
|
+
play proxy could not route the session (`not_running`); it does not prove the
|
|
1901
|
+
runtime ended. A failed hub join cancels its handoff, so retrying a door requires
|
|
1902
|
+
a fresh `Hub.go` acquisition.
|
|
1903
|
+
|
|
1656
1904
|
Every error the SDK throws is a `CastleError`. Check `code` to tell
|
|
1657
1905
|
the kinds apart.
|
|
1658
1906
|
|
|
@@ -1702,3 +1950,12 @@ places may save hearts. Guests and unavailable hosts return
|
|
|
1702
1950
|
`{ status: 'unavailable', hearts: [] }`; older hosts throw `UNKNOWN_COMMAND`.
|
|
1703
1951
|
Invalid lists throw `INVALID_ARGUMENT`, and other host failures use `CastleError`.
|
|
1704
1952
|
The dev serve keeps hearts per account in memory until it stops.
|
|
1953
|
+
|
|
1954
|
+
Server hub analytics (hub-game contract v1.93): `session.hub.track(playerId,
|
|
1955
|
+
{ kind, subject?, value?, result?, flags? })` sends a numeric event through the
|
|
1956
|
+
server's authenticated platform channel. It returns `Promise<boolean>`: `true`
|
|
1957
|
+
acknowledges queueing, while unsupported hosts and refused delivery return `false`.
|
|
1958
|
+
It never throws. Only opted-in hub bundles are recorded; Ghost stamps the player
|
|
1959
|
+
and town from the session and door pin and excludes the town creator's own plays.
|
|
1960
|
+
The hub-game kit exposes `hub.track(playerId, eventName, properties)` only on
|
|
1961
|
+
places declaring `hub.analytics: true`; see its contract for the numeric vocabulary.
|
package/dist/castle.d.ts
CHANGED
|
@@ -13,7 +13,11 @@ export { deckPrefixOf, IMPORTS_DIR, IMPORTS_PREFIX, isImportedFile, resolveDeckF
|
|
|
13
13
|
export { Haptics } from "./haptics";
|
|
14
14
|
export type { CastleHapticsApi, HapticsResult, HapticsStatus, HapticStyle } from "./haptics";
|
|
15
15
|
export { Hub } from "./hub";
|
|
16
|
-
export type { CastleHubApi, HubBackResult, HubCancelResult, HubCancelStatus, HubChatMessage, HubChatResult, HubDoor, HubDoorsResult, HubFriend, HubFriendsResult, HubHeartsResult, HubGoParams, HubGoResult, HubHandoffResult, HubHandoffStatus, HubJumpResult, HubPlacementKind, HubReportResult, HubSayResult, } from "./hub";
|
|
16
|
+
export type { CastleHubApi, HubBackResult, HubCancelResult, HubCancelStatus, HubChatMessage, HubChatResult, HubDoor, HubDoorsResult, HubFriend, HubFriendsResult, HubInviteResult, HubCanInviteResult, HubInviteArrivalResult, HubHeartsResult, HubGoParams, HubSignInParams, HubSignInResult, HubGoResult, HubHandoffResult, HubHandoffStatus, HubJumpResult, HubPlacementKind, HubReportResult, HubSayResult, } from "./hub";
|
|
17
|
+
export { Social } from "./social";
|
|
18
|
+
export type { CastleSocialApi, SocialFriend, SocialPresence } from "./social";
|
|
19
|
+
export { Party } from "./party";
|
|
20
|
+
export type { CastlePartyApi, PartyMember, PartyMessage, PartyMessagesResult, PartyStatus, PartySummary, } from "./party";
|
|
17
21
|
export { Leaderboard } from "./leaderboard";
|
|
18
22
|
export type { LeaderboardData, LeaderboardEntry, LeaderboardOptions, LeaderboardScope, LeaderboardShowOptions, LeaderboardShowResult, LeaderboardShowStatus, LeaderboardSort, } from "./leaderboard";
|
|
19
23
|
export { Lifecycle } from "./lifecycle";
|
|
@@ -35,7 +39,7 @@ export type { CastlePortalApi, PortalOpenResult, PortalOpenStatus, PortalPrefetc
|
|
|
35
39
|
export { CARD_RATIO, deleteFile, fileUrl, initCard, onBeforeRestart, onFilesChanged, onSaveReloadState, openFile, renameFile, requestReload, setup, takeReloadState, writeFileOnce, } from "./runtime";
|
|
36
40
|
export type { FileChange, FilesChangedEvent } from "./runtime";
|
|
37
41
|
export { cardUnit, fitStage, fovForAspect, getDisplay } from "./display";
|
|
38
|
-
export type { DeckDisplay, DeckLayout } from "./display";
|
|
42
|
+
export type { DeckDisplay, DeckLayout, DeckOrientation } from "./display";
|
|
39
43
|
export { flushSaves, hasPendingSave, onSaveState, writeFile, } from "./saveQueue";
|
|
40
44
|
export type { SaveState } from "./saveQueue";
|
|
41
45
|
export { SharedStorage, Storage } from "./storage";
|
|
@@ -49,4 +53,4 @@ export type { CastleUser, CastleUserApi } from "./user";
|
|
|
49
53
|
export { createSaveCoordinator } from "./saveCoordinator";
|
|
50
54
|
export type { CoordinatedChange, CoordinatedSave, SaveCoordinator, SaveStatus, } from "./saveCoordinator";
|
|
51
55
|
export { SaveError } from "./save";
|
|
52
|
-
export type { SaveApi, SaveBucketApi, SaveBucketRead, SaveChange, SaveCheck, SaveClaimed, SaveClaimInput, SaveErrorEnvelope, SaveInitial, SaveInitializeInput, SaveOpened, SaveOperation, SaveReadTarget, SaveReceipt, SaveRevision, SaveRows, SaveScope, SaveSelection, SaveSnapshot, SaveTarget, SaveTransactionInput, SaveWriter, } from "./save";
|
|
56
|
+
export type { SaveApi, SaveBucketApi, SaveBucketRead, SaveChange, SaveCheck, SaveConditionalCheck, SaveConditionalWriteInput, SaveClaimed, SaveClaimInput, SaveErrorEnvelope, SaveInitial, SaveInitializeInput, SaveOpened, SaveOperation, SaveReadTarget, SaveReceipt, SaveRecentOperationsInput, SaveRecentOperationsPage, SaveRevision, SaveRows, SaveScope, SaveSelection, SaveSnapshot, SaveTarget, SaveTransactionInput, SaveWriter, } from "./save";
|
package/dist/castle.js
CHANGED
|
@@ -9,6 +9,8 @@ export { experiment, experiments, experimentsReady } from "./experiments";
|
|
|
9
9
|
export { deckPrefixOf, IMPORTS_DIR, IMPORTS_PREFIX, isImportedFile, resolveDeckFile, } from "./files";
|
|
10
10
|
export { Haptics } from "./haptics";
|
|
11
11
|
export { Hub } from "./hub";
|
|
12
|
+
export { Social } from "./social";
|
|
13
|
+
export { Party } from "./party";
|
|
12
14
|
export { Leaderboard } from "./leaderboard";
|
|
13
15
|
export { Lifecycle } from "./lifecycle";
|
|
14
16
|
export { Multiplayer } from "./multiplayer";
|
package/dist/commands.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SaveClaimed, SaveClaimInput, SaveInitializeInput, SaveOpened, SaveOperation, SaveReadTarget, SaveReceipt, SaveSnapshot, SaveTransactionInput } from "./save";
|
|
1
|
+
import type { SaveClaimed, SaveConditionalWriteInput, SaveClaimInput, SaveInitializeInput, SaveOpened, SaveOperation, SaveReadTarget, SaveRecentOperationsInput, SaveRecentOperationsPage, SaveReceipt, SaveSnapshot, SaveTransactionInput } from "./save";
|
|
2
2
|
import type { Json } from "./types";
|
|
3
3
|
export declare const CASTLE_SDK_PROTOCOL = 1;
|
|
4
4
|
export type StorageBlob = Record<string, string>;
|
|
@@ -84,8 +84,49 @@ export type PortalInfoResult = {
|
|
|
84
84
|
export interface PortalPrefetchResult {
|
|
85
85
|
status: PortalPrefetchStatus;
|
|
86
86
|
}
|
|
87
|
+
/** One mutual Castle friend visible to a Cauldron deck. */
|
|
88
|
+
export interface SocialFriend {
|
|
89
|
+
userId: string;
|
|
90
|
+
username: string;
|
|
91
|
+
photoUrl?: string;
|
|
92
|
+
}
|
|
93
|
+
export interface SocialPresence extends SocialFriend {
|
|
94
|
+
sessionId: string;
|
|
95
|
+
routeId?: string;
|
|
96
|
+
slot?: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
export type PartyStatus = "invited" | "joined" | "rejected" | "left" | "party_closed" | "banned";
|
|
100
|
+
export interface PartySummary {
|
|
101
|
+
partyId: string;
|
|
102
|
+
name: string;
|
|
103
|
+
status: PartyStatus;
|
|
104
|
+
hasUnreadMessages: boolean;
|
|
105
|
+
}
|
|
106
|
+
export interface PartyMember extends SocialFriend {
|
|
107
|
+
status: PartyStatus;
|
|
108
|
+
role: "member" | "host" | "owner";
|
|
109
|
+
}
|
|
110
|
+
export interface PartyMessage {
|
|
111
|
+
id: string;
|
|
112
|
+
fromUserId: string;
|
|
113
|
+
fromUsername: string | null;
|
|
114
|
+
body: Json;
|
|
115
|
+
text: string | null;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
}
|
|
118
|
+
export interface PartyMessagesResult {
|
|
119
|
+
messages: PartyMessage[];
|
|
120
|
+
cursor: string | null;
|
|
121
|
+
}
|
|
87
122
|
export interface HubGoParams {
|
|
88
123
|
doorId: string;
|
|
124
|
+
/**
|
|
125
|
+
* A House door only: visit this owner's House instead of the player's own.
|
|
126
|
+
* Ghost admits it only when the two are connected and the owner is home;
|
|
127
|
+
* a host that predates it ignores it and acquires the player's own House.
|
|
128
|
+
*/
|
|
129
|
+
ownerUserId?: string;
|
|
89
130
|
}
|
|
90
131
|
export type HubPlacementKind = "layer" | "pad" | "exact";
|
|
91
132
|
export type HubHandoffStatus = "ok" | "cancelled" | "full" | "unavailable" | "not_found" | "forbidden" | "party_required";
|
|
@@ -141,6 +182,12 @@ export interface HubFriend {
|
|
|
141
182
|
* of its doors: that door's id. Null for a friend in a layer of this place.
|
|
142
183
|
*/
|
|
143
184
|
door: string | null;
|
|
185
|
+
/**
|
|
186
|
+
* Present only for a friend inside their own House behind `door`: `home` is
|
|
187
|
+
* true and `ownerUserId` is the owner to pass to `Hub.go` to visit them.
|
|
188
|
+
*/
|
|
189
|
+
home?: true;
|
|
190
|
+
ownerUserId?: string;
|
|
144
191
|
}
|
|
145
192
|
/** Hub.report: another player, by user id, and an optional short reason. */
|
|
146
193
|
export interface HubReportParams {
|
|
@@ -150,6 +197,17 @@ export interface HubReportParams {
|
|
|
150
197
|
/** `unavailable` on hosts without hub support or outside a hub session. */
|
|
151
198
|
export interface HubReportResult {
|
|
152
199
|
status: "ok" | "unavailable";
|
|
200
|
+
/** Present only when a chat sender was also blocked successfully. */
|
|
201
|
+
blocked?: true;
|
|
202
|
+
}
|
|
203
|
+
/** Why the hub is asking the player to replace an anonymous account. */
|
|
204
|
+
export interface HubSignInParams {
|
|
205
|
+
reason: string;
|
|
206
|
+
}
|
|
207
|
+
/** The outcome of the host-owned sign-in flow. */
|
|
208
|
+
export interface HubSignInResult {
|
|
209
|
+
status: "signedIn" | "dismissed" | "unavailable";
|
|
210
|
+
userId?: string;
|
|
153
211
|
}
|
|
154
212
|
export type HubFriendsResult = {
|
|
155
213
|
status: "ok";
|
|
@@ -158,6 +216,45 @@ export type HubFriendsResult = {
|
|
|
158
216
|
status: "unavailable";
|
|
159
217
|
friends: null;
|
|
160
218
|
};
|
|
219
|
+
export interface HubInviteResult {
|
|
220
|
+
status: "ok" | "unavailable";
|
|
221
|
+
url?: string;
|
|
222
|
+
expiresAt?: string;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Whether the host will make invite links for this player: Castle's invite
|
|
226
|
+
* rule for the account (signed in, over 13, in the invite audience), as the
|
|
227
|
+
* host resolved it. `unavailable` on hosts without hub support. With
|
|
228
|
+
* `canInvite: true`, `userId` names the account the links belong to (a guest's
|
|
229
|
+
* included), so a deck offers them only to the player that account plays as;
|
|
230
|
+
* older hosts leave it out.
|
|
231
|
+
*/
|
|
232
|
+
export type HubCanInviteResult = {
|
|
233
|
+
status: "ok";
|
|
234
|
+
canInvite: boolean;
|
|
235
|
+
userId?: string;
|
|
236
|
+
} | {
|
|
237
|
+
status: "unavailable";
|
|
238
|
+
canInvite: false;
|
|
239
|
+
};
|
|
240
|
+
export interface HubInviteArrivalResult {
|
|
241
|
+
status: "ok" | "unavailable" | "route";
|
|
242
|
+
doorId?: string;
|
|
243
|
+
destination?: {
|
|
244
|
+
hub: {
|
|
245
|
+
version: 1;
|
|
246
|
+
townDeckId: string;
|
|
247
|
+
target: {
|
|
248
|
+
kind: "player";
|
|
249
|
+
id: string;
|
|
250
|
+
};
|
|
251
|
+
};
|
|
252
|
+
};
|
|
253
|
+
friends?: Array<{
|
|
254
|
+
userId: string;
|
|
255
|
+
username: string;
|
|
256
|
+
}>;
|
|
257
|
+
}
|
|
161
258
|
/** Account-wide hub door hearts, in oldest-first order (at most eight). */
|
|
162
259
|
export interface HubHeartsResult {
|
|
163
260
|
status: "ok" | "unavailable";
|
|
@@ -213,6 +310,8 @@ export interface HubSayResult {
|
|
|
213
310
|
/** Hub.reportChat: a message this player was returned, by its id. */
|
|
214
311
|
export interface HubReportChatParams {
|
|
215
312
|
messageId: string;
|
|
313
|
+
/** Also block the sender identified by the stored message. */
|
|
314
|
+
block?: boolean;
|
|
216
315
|
}
|
|
217
316
|
/** Public door row; destination identity and return tickets stay host-owned. */
|
|
218
317
|
export interface HubDoor {
|
|
@@ -532,14 +631,51 @@ export interface CommandParams {
|
|
|
532
631
|
"portal.info": {
|
|
533
632
|
targetDeckId: string;
|
|
534
633
|
};
|
|
634
|
+
"social.friends": Record<string, never>;
|
|
635
|
+
"social.presence": Record<string, never>;
|
|
636
|
+
"party.current": Record<string, never>;
|
|
637
|
+
"party.create": {
|
|
638
|
+
userIds: string[];
|
|
639
|
+
};
|
|
640
|
+
"party.invite": {
|
|
641
|
+
partyId: string;
|
|
642
|
+
userIds: string[];
|
|
643
|
+
};
|
|
644
|
+
"party.respond": {
|
|
645
|
+
partyId: string;
|
|
646
|
+
accept: boolean;
|
|
647
|
+
};
|
|
648
|
+
"party.members": {
|
|
649
|
+
partyId: string;
|
|
650
|
+
};
|
|
651
|
+
"party.leave": {
|
|
652
|
+
partyId: string;
|
|
653
|
+
};
|
|
654
|
+
"party.messages": {
|
|
655
|
+
partyId: string;
|
|
656
|
+
cursor?: string;
|
|
657
|
+
};
|
|
658
|
+
"party.say": {
|
|
659
|
+
partyId: string;
|
|
660
|
+
text: string;
|
|
661
|
+
};
|
|
535
662
|
"hub.go": HubGoParams;
|
|
536
663
|
"hub.back": Record<string, never>;
|
|
537
664
|
"hub.doors": Record<string, never>;
|
|
538
665
|
"hub.friends": Record<string, never>;
|
|
666
|
+
"hub.invite": {
|
|
667
|
+
crew?: boolean;
|
|
668
|
+
};
|
|
669
|
+
"hub.canInvite": Record<string, never>;
|
|
670
|
+
"hub.inviteArrival": Record<string, never>;
|
|
671
|
+
"hub.undoInvite": {
|
|
672
|
+
userId: string;
|
|
673
|
+
};
|
|
539
674
|
"hub.hearts": Record<string, never>;
|
|
540
675
|
"hub.setHearts": {
|
|
541
676
|
doorIds: string[];
|
|
542
677
|
};
|
|
678
|
+
"hub.signIn": HubSignInParams;
|
|
543
679
|
"hub.jump": HubJumpParams;
|
|
544
680
|
"hub.report": HubReportParams;
|
|
545
681
|
"hub.chat": HubChatParams;
|
|
@@ -601,6 +737,8 @@ export interface CommandParams {
|
|
|
601
737
|
"cauldronStorage.transaction": SaveTransactionInput;
|
|
602
738
|
"cauldronStorage.claim": SaveClaimInput;
|
|
603
739
|
"cauldronStorage.initialize": SaveInitializeInput;
|
|
740
|
+
"cauldronStorage.conditionalWrite": SaveConditionalWriteInput;
|
|
741
|
+
"cauldronStorage.recentOperations": SaveRecentOperationsInput;
|
|
604
742
|
"cauldronStorage.operation": {
|
|
605
743
|
operationId: string;
|
|
606
744
|
};
|
|
@@ -706,12 +844,33 @@ export interface CommandResult {
|
|
|
706
844
|
"portal.open": PortalOpenResult;
|
|
707
845
|
"portal.prefetch": PortalPrefetchResult;
|
|
708
846
|
"portal.info": PortalInfoResult;
|
|
847
|
+
"social.friends": SocialFriend[];
|
|
848
|
+
"social.presence": SocialPresence[];
|
|
849
|
+
"party.current": PartySummary | null;
|
|
850
|
+
"party.create": PartySummary;
|
|
851
|
+
"party.invite": {
|
|
852
|
+
ok: true;
|
|
853
|
+
};
|
|
854
|
+
"party.respond": {
|
|
855
|
+
ok: true;
|
|
856
|
+
};
|
|
857
|
+
"party.members": PartyMember[];
|
|
858
|
+
"party.leave": {
|
|
859
|
+
ok: true;
|
|
860
|
+
};
|
|
861
|
+
"party.messages": PartyMessagesResult;
|
|
862
|
+
"party.say": PartyMessage;
|
|
709
863
|
"hub.go": HubGoResult;
|
|
710
864
|
"hub.back": HubBackResult;
|
|
711
865
|
"hub.doors": HubDoorsResult;
|
|
712
866
|
"hub.friends": HubFriendsResult;
|
|
867
|
+
"hub.invite": HubInviteResult;
|
|
868
|
+
"hub.canInvite": HubCanInviteResult;
|
|
869
|
+
"hub.inviteArrival": HubInviteArrivalResult;
|
|
870
|
+
"hub.undoInvite": HubReportResult;
|
|
713
871
|
"hub.hearts": HubHeartsResult;
|
|
714
872
|
"hub.setHearts": HubHeartsResult;
|
|
873
|
+
"hub.signIn": HubSignInResult;
|
|
715
874
|
"hub.jump": HubJumpResult;
|
|
716
875
|
"hub.report": HubReportResult;
|
|
717
876
|
"hub.chat": HubChatResult;
|
|
@@ -747,6 +906,8 @@ export interface CommandResult {
|
|
|
747
906
|
"cauldronStorage.transaction": SaveReceipt;
|
|
748
907
|
"cauldronStorage.claim": SaveClaimed;
|
|
749
908
|
"cauldronStorage.initialize": SaveOpened;
|
|
909
|
+
"cauldronStorage.conditionalWrite": SaveReceipt;
|
|
910
|
+
"cauldronStorage.recentOperations": SaveRecentOperationsPage;
|
|
750
911
|
"cauldronStorage.operation": SaveOperation;
|
|
751
912
|
"cauldronStorage.get": {
|
|
752
913
|
entries: StoreEntry[];
|
package/dist/commands.js
CHANGED
|
@@ -29,6 +29,9 @@ export const COMMAND_TIMEOUTS_MS = {
|
|
|
29
29
|
"hub.go": 30_000,
|
|
30
30
|
"hub.back": 30_000,
|
|
31
31
|
"hub.jump": 30_000,
|
|
32
|
+
// Native auth may include a provider handoff, but it must not leave a deck
|
|
33
|
+
// waiting forever if the host loses the completion callback.
|
|
34
|
+
"hub.signIn": 120_000,
|
|
32
35
|
};
|
|
33
36
|
// Once a host streams a command, each stream envelope restarts the wait at this
|
|
34
37
|
// length instead. The deck-agent service sends a heartbeat every 15 seconds, and the host
|
package/dist/display.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
export type DeckLayout = "card" | "fill";
|
|
2
|
+
export type DeckOrientation = "landscape" | "portrait" | "any";
|
|
2
3
|
export interface DeckDisplay {
|
|
3
4
|
layout: DeckLayout;
|
|
5
|
+
/** The orientation the deck prefers the host to use. */
|
|
6
|
+
orientation?: DeckOrientation;
|
|
4
7
|
/** Narrowest width / height the deck accepts. */
|
|
5
8
|
minAspect: number;
|
|
6
9
|
/** Widest width / height the deck accepts. */
|