@indiegems/gem-web-sdk 23.3.0 → 24.0.1
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/CHANGELOG.md +40 -1
- package/dist/conformance.d.ts +5 -2
- package/dist/function.d.ts +22 -1
- package/dist/game.d.ts +1588 -1466
- package/dist/gem-web-sdk.bridge.js +2 -2
- package/dist/gem-web-sdk.conformance.js +3 -3
- package/dist/gem-web-sdk.esm.js +3 -3
- package/dist/gem-web-sdk.function.js +3 -3
- package/dist/gem-web-sdk.game.js +3 -3
- package/dist/gem-web-sdk.min.js +3 -3
- package/dist/gem-web-sdk.sdk.js +3 -3
- package/dist/gem-web-sdk.server.js +2 -2
- package/dist/index.d.ts +5 -0
- package/dist/sdk.d.ts +1598 -1464
- package/dist/server.d.ts +44 -1
- package/docs/api/api-reference-function.md +194 -44
- package/docs/api/api-reference-game.md +722 -32
- package/docs/api/api-reference-server.md +477 -3
- package/docs/api/reference.json +1786 -99
- package/docs/arcade-and-store.md +166 -63
- package/docs/arcade-economy.md +184 -184
- package/docs/changelog.md +40 -1
- package/docs/deprecation-policy.md +2 -0
- package/docs/getting-started.md +1 -1
- package/docs/inventory-and-catalogs.md +247 -76
- package/docs/manifest.json +20 -20
- package/docs/platform-rules.md +36 -27
- package/docs/player-sign-in.md +20 -11
- package/docs/rewarded-ads.md +1 -1
- package/docs/server-bundles.md +9 -7
- package/package.json +1 -1
- package/schema/bridge.v1.json +56 -7
package/dist/sdk.d.ts
CHANGED
|
@@ -922,6 +922,7 @@ declare class OrdersApi {
|
|
|
922
922
|
interface GamePass {
|
|
923
923
|
readonly pass: string;
|
|
924
924
|
readonly held: boolean;
|
|
925
|
+
readonly daysLeft: number;
|
|
925
926
|
readonly endsAt: string | null;
|
|
926
927
|
}
|
|
927
928
|
type PassesEvent = "changed";
|
|
@@ -1157,1458 +1158,1773 @@ declare class TransfersApi {
|
|
|
1157
1158
|
cancel(transferId: string, signal?: AbortSignal): Promise<Transfer>;
|
|
1158
1159
|
private resolve;
|
|
1159
1160
|
}
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
hash: GameConfigSnapshot["hash"];
|
|
1177
|
-
item(idOrSlug: string): SnapshotItem | null;
|
|
1178
|
-
currency(idOrSlug: string): SnapshotCurrency | null;
|
|
1179
|
-
}
|
|
1180
|
-
declare class GemConfigError extends Error {
|
|
1181
|
-
readonly reason: "config_unreachable" | "config_too_large" | "config_malformed" | "config_timeout" | "config_channel_unknown";
|
|
1182
|
-
constructor(reason: "config_unreachable" | "config_too_large" | "config_malformed" | "config_timeout" | "config_channel_unknown", message: string);
|
|
1161
|
+
declare const PROTOCOL: "gem-web-bridge";
|
|
1162
|
+
type GemErrorCode = "version_mismatch" | "handshake_timeout" | "handshake_duplicate" | "invalid_message" | "rate_limited" | "token_unavailable" | "unsupported" | "unsupported_capability" | "internal";
|
|
1163
|
+
interface GemToken {
|
|
1164
|
+
readonly gem: typeof PROTOCOL;
|
|
1165
|
+
readonly type: "gem.token";
|
|
1166
|
+
readonly token: string;
|
|
1167
|
+
readonly requestId?: string;
|
|
1168
|
+
readonly generation: number;
|
|
1169
|
+
readonly apiBaseUrl?: string;
|
|
1170
|
+
readonly playerId: string;
|
|
1171
|
+
readonly gameId: string;
|
|
1172
|
+
readonly channel: "dev" | "test" | "release";
|
|
1173
|
+
readonly gameVersion?: string;
|
|
1174
|
+
readonly expiresAt: number;
|
|
1175
|
+
readonly chainEndsAt: number;
|
|
1176
|
+
readonly allowDevTools?: boolean;
|
|
1183
1177
|
}
|
|
1184
|
-
interface
|
|
1185
|
-
readonly
|
|
1186
|
-
readonly
|
|
1178
|
+
interface GemTokenDenied {
|
|
1179
|
+
readonly gem: typeof PROTOCOL;
|
|
1180
|
+
readonly type: "gem.token.denied";
|
|
1181
|
+
readonly requestId: string;
|
|
1182
|
+
readonly retryable: boolean;
|
|
1183
|
+
readonly retryAfterMs?: number;
|
|
1184
|
+
readonly reason: "chain_exhausted" | "unavailable";
|
|
1185
|
+
readonly correlationId: string;
|
|
1187
1186
|
}
|
|
1188
|
-
interface
|
|
1189
|
-
readonly
|
|
1190
|
-
readonly
|
|
1191
|
-
readonly
|
|
1192
|
-
readonly rarityTier?: string;
|
|
1187
|
+
interface GemPause {
|
|
1188
|
+
readonly gem: typeof PROTOCOL;
|
|
1189
|
+
readonly type: "gem.pause";
|
|
1190
|
+
readonly paused: boolean;
|
|
1193
1191
|
}
|
|
1194
|
-
interface
|
|
1195
|
-
readonly
|
|
1196
|
-
readonly
|
|
1197
|
-
readonly
|
|
1198
|
-
readonly
|
|
1199
|
-
readonly
|
|
1200
|
-
readonly
|
|
1192
|
+
interface GemPrefs$1 {
|
|
1193
|
+
readonly gem: typeof PROTOCOL;
|
|
1194
|
+
readonly type: "gem.prefs";
|
|
1195
|
+
readonly reducedMotion: boolean;
|
|
1196
|
+
readonly muted: boolean;
|
|
1197
|
+
readonly showFrameStats?: boolean;
|
|
1198
|
+
readonly music?: boolean;
|
|
1199
|
+
readonly sounds?: boolean;
|
|
1200
|
+
readonly locale: string;
|
|
1201
|
+
readonly recommended?: {
|
|
1202
|
+
volume: number;
|
|
1203
|
+
batterySaver: boolean;
|
|
1204
|
+
keyboardLayout: "wasd" | "arrows";
|
|
1205
|
+
gamepadConfirm: "south" | "east";
|
|
1206
|
+
vibration: boolean;
|
|
1207
|
+
lookSensitivity?: number;
|
|
1208
|
+
gamepadLookSensitivity?: number;
|
|
1209
|
+
invertLookY?: boolean;
|
|
1210
|
+
touchMovement?: string;
|
|
1211
|
+
graphicsQuality?: string;
|
|
1212
|
+
graphicsQualityAuto?: boolean;
|
|
1213
|
+
colorHelp?: boolean;
|
|
1214
|
+
textScale?: number;
|
|
1215
|
+
};
|
|
1201
1216
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
private readonly dropRatesByConfig;
|
|
1210
|
-
constructor(api: GameApi$1, channel: () => string, options?: GameConfigOptions);
|
|
1211
|
-
load(): Promise<GameConfig | null>;
|
|
1212
|
-
refresh(): void;
|
|
1213
|
-
dropRates(lootTableId: string, signal?: AbortSignal): Promise<DropRates>;
|
|
1214
|
-
private fetchConfig;
|
|
1217
|
+
interface GemCohorts$1 {
|
|
1218
|
+
readonly gem: typeof PROTOCOL;
|
|
1219
|
+
readonly type: "gem.cohorts";
|
|
1220
|
+
readonly cohorts: {
|
|
1221
|
+
experimentId: string;
|
|
1222
|
+
variantKey: string;
|
|
1223
|
+
}[];
|
|
1215
1224
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
readonly id: string;
|
|
1220
|
-
readonly slug?: string;
|
|
1221
|
-
readonly window: ChallengeWindow;
|
|
1222
|
-
readonly periodStartAt: number;
|
|
1223
|
-
readonly periodEndsAt: number;
|
|
1224
|
-
readonly periodLocalDate?: string;
|
|
1225
|
-
readonly boundary: string;
|
|
1226
|
-
readonly resetTime: string;
|
|
1227
|
-
readonly seed: string;
|
|
1228
|
-
readonly data?: string;
|
|
1229
|
-
readonly dataHash?: string;
|
|
1225
|
+
interface GemInventoryChanged {
|
|
1226
|
+
readonly gem: typeof PROTOCOL;
|
|
1227
|
+
readonly type: "gem.inventoryChanged";
|
|
1230
1228
|
}
|
|
1231
|
-
interface
|
|
1232
|
-
readonly
|
|
1233
|
-
readonly
|
|
1229
|
+
interface GemViewport$1 {
|
|
1230
|
+
readonly gem: typeof PROTOCOL;
|
|
1231
|
+
readonly type: "gem.viewport";
|
|
1232
|
+
readonly insets: {
|
|
1233
|
+
top: number;
|
|
1234
|
+
right: number;
|
|
1235
|
+
bottom: number;
|
|
1236
|
+
left: number;
|
|
1237
|
+
};
|
|
1238
|
+
readonly reserved?: {
|
|
1239
|
+
x: number;
|
|
1240
|
+
y: number;
|
|
1241
|
+
width: number;
|
|
1242
|
+
height: number;
|
|
1243
|
+
control?: {
|
|
1244
|
+
x: number;
|
|
1245
|
+
y: number;
|
|
1246
|
+
width: number;
|
|
1247
|
+
height: number;
|
|
1248
|
+
};
|
|
1249
|
+
}[];
|
|
1234
1250
|
}
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1251
|
+
interface GemDeviceSettings {
|
|
1252
|
+
readonly gem: typeof PROTOCOL;
|
|
1253
|
+
readonly type: "gem.deviceSettings";
|
|
1254
|
+
readonly settings?: unknown;
|
|
1239
1255
|
}
|
|
1240
|
-
interface
|
|
1241
|
-
readonly
|
|
1242
|
-
readonly
|
|
1256
|
+
interface GemWillTerminate {
|
|
1257
|
+
readonly gem: typeof PROTOCOL;
|
|
1258
|
+
readonly type: "gem.willTerminate";
|
|
1259
|
+
readonly reason: "grant_expiring" | "session_ended" | "navigating" | "kill_switch";
|
|
1260
|
+
readonly graceMs: number;
|
|
1243
1261
|
}
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
readonly
|
|
1247
|
-
readonly
|
|
1248
|
-
readonly
|
|
1249
|
-
readonly
|
|
1262
|
+
interface GemRoomEvent {
|
|
1263
|
+
readonly gem: typeof PROTOCOL;
|
|
1264
|
+
readonly type: "gem.roomEvent";
|
|
1265
|
+
readonly event: "updated" | "match_started" | "match_ready" | "match_failed" | "version_stale";
|
|
1266
|
+
readonly roomId: string;
|
|
1267
|
+
readonly matchId?: string;
|
|
1268
|
+
readonly version?: number;
|
|
1269
|
+
readonly reason?: string;
|
|
1270
|
+
readonly platform?: "universal" | "mobile";
|
|
1250
1271
|
}
|
|
1251
|
-
interface
|
|
1252
|
-
readonly
|
|
1253
|
-
readonly
|
|
1254
|
-
readonly
|
|
1255
|
-
readonly
|
|
1256
|
-
readonly avatarIconId?: string;
|
|
1257
|
-
readonly avatarIconUrl?: string;
|
|
1258
|
-
readonly avatar3dId?: string;
|
|
1259
|
-
readonly avatar3dModelUrl?: string;
|
|
1260
|
-
readonly avatar3dIconUrl?: string;
|
|
1261
|
-
readonly avatars3d?: readonly WornAvatar3d$1[];
|
|
1262
|
-
readonly badges: readonly PlayerBadge$1[];
|
|
1272
|
+
interface GemSocketState {
|
|
1273
|
+
readonly gem: typeof PROTOCOL;
|
|
1274
|
+
readonly type: "gem.socketState";
|
|
1275
|
+
readonly connected: boolean;
|
|
1276
|
+
readonly reason?: "connecting" | "dropped" | "watchdog" | "terminal";
|
|
1263
1277
|
}
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
readonly
|
|
1268
|
-
readonly localDate?: string;
|
|
1269
|
-
readonly startAt?: number;
|
|
1270
|
-
readonly endsAt?: number;
|
|
1271
|
-
readonly opensAt: number;
|
|
1272
|
-
readonly closesAt: number;
|
|
1273
|
-
readonly final: boolean;
|
|
1278
|
+
interface GemSeatedEvent {
|
|
1279
|
+
readonly gem: typeof PROTOCOL;
|
|
1280
|
+
readonly type: "gem.seatedEvent";
|
|
1281
|
+
readonly roomId: string;
|
|
1274
1282
|
}
|
|
1275
|
-
interface
|
|
1276
|
-
readonly
|
|
1277
|
-
readonly
|
|
1278
|
-
readonly
|
|
1279
|
-
readonly
|
|
1280
|
-
readonly stats?: Readonly<Record<string, number>>;
|
|
1281
|
-
readonly properties?: Readonly<Record<string, unknown>>;
|
|
1282
|
-
readonly isViewer?: boolean;
|
|
1283
|
+
interface GemAutoStartFailedEvent {
|
|
1284
|
+
readonly gem: typeof PROTOCOL;
|
|
1285
|
+
readonly type: "gem.autoStartFailedEvent";
|
|
1286
|
+
readonly roomId: string;
|
|
1287
|
+
readonly code: string;
|
|
1283
1288
|
}
|
|
1284
|
-
interface
|
|
1285
|
-
readonly
|
|
1286
|
-
readonly
|
|
1287
|
-
readonly
|
|
1288
|
-
readonly
|
|
1289
|
-
readonly
|
|
1290
|
-
readonly
|
|
1291
|
-
readonly
|
|
1292
|
-
readonly
|
|
1289
|
+
interface GemTicketEvent {
|
|
1290
|
+
readonly gem: typeof PROTOCOL;
|
|
1291
|
+
readonly type: "gem.ticketEvent";
|
|
1292
|
+
readonly event: "queued" | "matched" | "expired" | "cancelled" | "failed";
|
|
1293
|
+
readonly ticketId: string;
|
|
1294
|
+
readonly partySize?: number;
|
|
1295
|
+
readonly queuedAt?: number;
|
|
1296
|
+
readonly expiresAt?: number;
|
|
1297
|
+
readonly reason?: string;
|
|
1298
|
+
readonly roomId?: string;
|
|
1293
1299
|
}
|
|
1294
|
-
interface
|
|
1295
|
-
readonly
|
|
1296
|
-
readonly
|
|
1297
|
-
readonly
|
|
1298
|
-
readonly
|
|
1300
|
+
interface GemSignalEvent {
|
|
1301
|
+
readonly gem: typeof PROTOCOL;
|
|
1302
|
+
readonly type: "gem.signalEvent";
|
|
1303
|
+
readonly event: "hello" | "offer" | "answer" | "ice" | "peerJoined" | "peerLeft" | "migration" | "matchEnded" | "error";
|
|
1304
|
+
readonly matchId: string;
|
|
1305
|
+
readonly data: unknown;
|
|
1299
1306
|
}
|
|
1300
|
-
interface
|
|
1301
|
-
readonly
|
|
1302
|
-
readonly
|
|
1307
|
+
interface GemRelayDraining {
|
|
1308
|
+
readonly gem: typeof PROTOCOL;
|
|
1309
|
+
readonly type: "gem.relayDraining";
|
|
1310
|
+
readonly matchId: string;
|
|
1311
|
+
readonly clusterTargetId: string;
|
|
1312
|
+
readonly relayIps: string[];
|
|
1313
|
+
readonly drainingSince: string;
|
|
1314
|
+
readonly deadline: string;
|
|
1303
1315
|
}
|
|
1304
|
-
interface
|
|
1305
|
-
readonly
|
|
1306
|
-
readonly
|
|
1307
|
-
readonly
|
|
1308
|
-
readonly
|
|
1309
|
-
readonly
|
|
1310
|
-
readonly
|
|
1311
|
-
readonly
|
|
1312
|
-
readonly
|
|
1313
|
-
readonly
|
|
1314
|
-
readonly totalRunsExact: boolean;
|
|
1315
|
-
readonly generatedAt: number;
|
|
1316
|
-
readonly period?: LeaderboardPeriod;
|
|
1316
|
+
interface GemDedicatedEvent {
|
|
1317
|
+
readonly gem: typeof PROTOCOL;
|
|
1318
|
+
readonly type: "gem.dedicatedEvent";
|
|
1319
|
+
readonly event: "answer" | "error" | "matchEnded";
|
|
1320
|
+
readonly matchId: string;
|
|
1321
|
+
readonly sdp?: string;
|
|
1322
|
+
readonly sessionId?: string;
|
|
1323
|
+
readonly code?: string;
|
|
1324
|
+
readonly message?: string;
|
|
1325
|
+
readonly reason?: string;
|
|
1317
1326
|
}
|
|
1318
|
-
interface
|
|
1319
|
-
readonly
|
|
1320
|
-
readonly
|
|
1321
|
-
readonly
|
|
1327
|
+
interface GemPartyResult {
|
|
1328
|
+
readonly gem: typeof PROTOCOL;
|
|
1329
|
+
readonly type: "gem.partyResult";
|
|
1330
|
+
readonly requestId: string;
|
|
1331
|
+
readonly partyId?: string;
|
|
1322
1332
|
}
|
|
1323
|
-
interface
|
|
1324
|
-
readonly
|
|
1325
|
-
readonly
|
|
1326
|
-
readonly
|
|
1327
|
-
readonly
|
|
1333
|
+
interface GemClusterTarget {
|
|
1334
|
+
readonly gem: typeof PROTOCOL;
|
|
1335
|
+
readonly type: "gem.clusterTarget";
|
|
1336
|
+
readonly clusterTargetId: string;
|
|
1337
|
+
readonly clusterTargetIds?: string[];
|
|
1328
1338
|
}
|
|
1329
|
-
interface
|
|
1330
|
-
readonly
|
|
1331
|
-
readonly
|
|
1332
|
-
readonly
|
|
1339
|
+
interface GemGraphicsRoutes {
|
|
1340
|
+
readonly gem: typeof PROTOCOL;
|
|
1341
|
+
readonly type: "gem.graphicsRoutes";
|
|
1342
|
+
readonly entries: {
|
|
1343
|
+
gpu: string;
|
|
1344
|
+
route?: string;
|
|
1345
|
+
host?: string;
|
|
1346
|
+
}[];
|
|
1333
1347
|
}
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
mine(leaderboardType: string, options?: EntityLeaderboardOptions): Promise<EntityLeaderboard>;
|
|
1340
|
-
character(leaderboardType: string, characterId: string, options?: EntityLeaderboardOptions): Promise<EntityLeaderboard>;
|
|
1348
|
+
interface GemScreenshotDenied {
|
|
1349
|
+
readonly gem: typeof PROTOCOL;
|
|
1350
|
+
readonly type: "gem.screenshot.denied";
|
|
1351
|
+
readonly reason: "not_wired" | "no_source" | "unsupported" | "unreadable" | "tainted" | "too_large" | "busy" | "declined" | "failed";
|
|
1352
|
+
readonly retryable: boolean;
|
|
1341
1353
|
}
|
|
1342
|
-
interface
|
|
1343
|
-
readonly
|
|
1344
|
-
readonly
|
|
1345
|
-
readonly
|
|
1346
|
-
readonly
|
|
1354
|
+
interface GemDedicatedOffer {
|
|
1355
|
+
readonly gem: typeof PROTOCOL;
|
|
1356
|
+
readonly type: "gem.dedicatedOffer";
|
|
1357
|
+
readonly matchId: string;
|
|
1358
|
+
readonly sdp: string;
|
|
1359
|
+
readonly intent: "initial" | "ice_restart" | "full_reconnect";
|
|
1347
1360
|
}
|
|
1348
|
-
interface
|
|
1349
|
-
readonly
|
|
1350
|
-
readonly
|
|
1351
|
-
readonly
|
|
1352
|
-
readonly
|
|
1361
|
+
interface GemLocalServer {
|
|
1362
|
+
readonly gem: typeof PROTOCOL;
|
|
1363
|
+
readonly type: "gem.localServer";
|
|
1364
|
+
readonly requestId: string;
|
|
1365
|
+
readonly serverId?: string;
|
|
1353
1366
|
}
|
|
1354
|
-
interface
|
|
1355
|
-
readonly
|
|
1356
|
-
readonly
|
|
1357
|
-
readonly
|
|
1367
|
+
interface GemLocalServerDenied {
|
|
1368
|
+
readonly gem: typeof PROTOCOL;
|
|
1369
|
+
readonly type: "gem.localServer.denied";
|
|
1370
|
+
readonly requestId: string;
|
|
1371
|
+
readonly retryable: boolean;
|
|
1372
|
+
readonly reason: "refused" | "unavailable";
|
|
1358
1373
|
}
|
|
1359
|
-
interface
|
|
1360
|
-
readonly
|
|
1374
|
+
interface GemMenuSelect {
|
|
1375
|
+
readonly gem: typeof PROTOCOL;
|
|
1376
|
+
readonly type: "gem.menuSelect";
|
|
1377
|
+
readonly entry: "settings" | "item";
|
|
1378
|
+
readonly id?: string;
|
|
1361
1379
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1380
|
+
interface GemSettingsDeclare {
|
|
1381
|
+
readonly gem: typeof PROTOCOL;
|
|
1382
|
+
readonly type: "gem.settingsDeclare";
|
|
1383
|
+
readonly settings: {
|
|
1384
|
+
id: string;
|
|
1385
|
+
label: string;
|
|
1386
|
+
kind: "toggle" | "slider" | "choice";
|
|
1387
|
+
value: boolean | number | string;
|
|
1388
|
+
quick?: boolean;
|
|
1389
|
+
icon?: string;
|
|
1390
|
+
min?: number;
|
|
1391
|
+
max?: number;
|
|
1392
|
+
step?: number;
|
|
1393
|
+
options?: {
|
|
1394
|
+
id: string;
|
|
1395
|
+
label: string;
|
|
1396
|
+
}[];
|
|
1397
|
+
}[];
|
|
1370
1398
|
}
|
|
1371
|
-
interface
|
|
1372
|
-
readonly
|
|
1399
|
+
interface GemSettingChange {
|
|
1400
|
+
readonly gem: typeof PROTOCOL;
|
|
1401
|
+
readonly type: "gem.settingChange";
|
|
1402
|
+
readonly id: string;
|
|
1403
|
+
readonly value: boolean | number | string;
|
|
1373
1404
|
}
|
|
1374
|
-
interface
|
|
1375
|
-
readonly
|
|
1376
|
-
readonly
|
|
1405
|
+
interface GemShareResult {
|
|
1406
|
+
readonly gem: typeof PROTOCOL;
|
|
1407
|
+
readonly type: "gem.shareResult";
|
|
1408
|
+
readonly requestId: string;
|
|
1409
|
+
readonly outcome: "accepted" | "refused";
|
|
1410
|
+
readonly reason?: string;
|
|
1411
|
+
readonly key?: string;
|
|
1377
1412
|
}
|
|
1378
|
-
interface
|
|
1379
|
-
readonly
|
|
1380
|
-
readonly
|
|
1381
|
-
readonly
|
|
1413
|
+
interface GemPurchaseResult {
|
|
1414
|
+
readonly gem: typeof PROTOCOL;
|
|
1415
|
+
readonly type: "gem.purchaseResult";
|
|
1416
|
+
readonly requestId: string;
|
|
1417
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1418
|
+
readonly reason?: string;
|
|
1419
|
+
readonly purchaseId?: string;
|
|
1382
1420
|
}
|
|
1383
|
-
interface
|
|
1384
|
-
readonly
|
|
1385
|
-
readonly
|
|
1386
|
-
readonly
|
|
1387
|
-
readonly
|
|
1388
|
-
readonly
|
|
1389
|
-
readonly
|
|
1390
|
-
readonly
|
|
1421
|
+
interface GemPurchaseSettled {
|
|
1422
|
+
readonly gem: typeof PROTOCOL;
|
|
1423
|
+
readonly type: "gem.purchaseSettled";
|
|
1424
|
+
readonly purchaseKind: "item" | "recipe";
|
|
1425
|
+
readonly targetId: string;
|
|
1426
|
+
readonly catalogId?: string;
|
|
1427
|
+
readonly quantity: number;
|
|
1428
|
+
readonly purchaseId?: string;
|
|
1391
1429
|
}
|
|
1392
|
-
interface
|
|
1393
|
-
readonly
|
|
1394
|
-
readonly
|
|
1430
|
+
interface GemDeviceSettingsResult {
|
|
1431
|
+
readonly gem: typeof PROTOCOL;
|
|
1432
|
+
readonly type: "gem.deviceSettings.result";
|
|
1433
|
+
readonly requestId: string;
|
|
1434
|
+
readonly outcome: "stored" | "too_large" | "unavailable";
|
|
1395
1435
|
}
|
|
1396
|
-
interface
|
|
1397
|
-
readonly
|
|
1398
|
-
readonly
|
|
1399
|
-
readonly
|
|
1436
|
+
interface GemAdResult {
|
|
1437
|
+
readonly gem: typeof PROTOCOL;
|
|
1438
|
+
readonly type: "gem.adResult";
|
|
1439
|
+
readonly requestId: string;
|
|
1440
|
+
readonly outcome: "shown" | "no_ad" | "unavailable";
|
|
1400
1441
|
}
|
|
1401
|
-
interface
|
|
1402
|
-
readonly
|
|
1403
|
-
readonly
|
|
1404
|
-
readonly
|
|
1442
|
+
interface GemMomentResult {
|
|
1443
|
+
readonly gem: typeof PROTOCOL;
|
|
1444
|
+
readonly type: "gem.momentResult";
|
|
1445
|
+
readonly requestId: string;
|
|
1446
|
+
readonly shown: boolean;
|
|
1405
1447
|
}
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
readonly
|
|
1448
|
+
interface GemSignInResult {
|
|
1449
|
+
readonly gem: typeof PROTOCOL;
|
|
1450
|
+
readonly type: "gem.signInResult";
|
|
1451
|
+
readonly requestId: string;
|
|
1452
|
+
readonly outcome: "signed_in" | "declined" | "unavailable";
|
|
1409
1453
|
}
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
readonly
|
|
1454
|
+
interface GemFriendChallengeResult {
|
|
1455
|
+
readonly gem: typeof PROTOCOL;
|
|
1456
|
+
readonly type: "gem.friendChallengeResult";
|
|
1457
|
+
readonly requestId: string;
|
|
1458
|
+
readonly outcome: "accepted" | "cancelled" | "refused" | "unavailable" | "rate_limited" | "invalid";
|
|
1459
|
+
readonly code?: string;
|
|
1413
1460
|
readonly param?: string;
|
|
1414
1461
|
readonly channel?: string;
|
|
1415
1462
|
readonly configVersion?: number;
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
readonly channel?: string;
|
|
1419
|
-
readonly configVersion?: number;
|
|
1420
|
-
});
|
|
1463
|
+
readonly retryAfterMs?: number;
|
|
1464
|
+
readonly detail?: string;
|
|
1421
1465
|
}
|
|
1422
|
-
interface
|
|
1423
|
-
readonly
|
|
1466
|
+
interface GemRequestPlayInvite {
|
|
1467
|
+
readonly gem: typeof PROTOCOL;
|
|
1468
|
+
readonly type: "gem.requestPlayInvite";
|
|
1469
|
+
readonly requestId: string;
|
|
1470
|
+
readonly params?: {
|
|
1471
|
+
key: string;
|
|
1472
|
+
value: string;
|
|
1473
|
+
}[];
|
|
1424
1474
|
}
|
|
1425
|
-
interface
|
|
1426
|
-
readonly
|
|
1427
|
-
readonly
|
|
1428
|
-
readonly
|
|
1429
|
-
readonly
|
|
1475
|
+
interface GemPlayInviteResult {
|
|
1476
|
+
readonly gem: typeof PROTOCOL;
|
|
1477
|
+
readonly type: "gem.playInviteResult";
|
|
1478
|
+
readonly requestId: string;
|
|
1479
|
+
readonly shown: boolean;
|
|
1430
1480
|
}
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
inbox(options?: ListFriendChallengesOptions): Promise<FriendChallengesPage>;
|
|
1439
|
-
launchedChallenge(options?: {
|
|
1440
|
-
readonly signal?: AbortSignal;
|
|
1441
|
-
}): Promise<FriendChallenge | null>;
|
|
1442
|
-
markAnswered(id: string): Promise<void>;
|
|
1481
|
+
interface GemInviteParams {
|
|
1482
|
+
readonly gem: typeof PROTOCOL;
|
|
1483
|
+
readonly type: "gem.inviteParams";
|
|
1484
|
+
readonly params?: {
|
|
1485
|
+
key: string;
|
|
1486
|
+
value: string;
|
|
1487
|
+
}[];
|
|
1443
1488
|
}
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
readonly
|
|
1447
|
-
readonly
|
|
1448
|
-
readonly balance: number;
|
|
1449
|
-
readonly access: PlatformCurrencyAccess;
|
|
1489
|
+
interface GemRequestAppLinks {
|
|
1490
|
+
readonly gem: typeof PROTOCOL;
|
|
1491
|
+
readonly type: "gem.requestAppLinks";
|
|
1492
|
+
readonly requestId: string;
|
|
1450
1493
|
}
|
|
1451
|
-
interface
|
|
1452
|
-
readonly
|
|
1494
|
+
interface GemAppLinksResult {
|
|
1495
|
+
readonly gem: typeof PROTOCOL;
|
|
1496
|
+
readonly type: "gem.appLinksResult";
|
|
1497
|
+
readonly requestId: string;
|
|
1498
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1499
|
+
readonly reason?: string;
|
|
1500
|
+
readonly arcade?: {
|
|
1501
|
+
store: "app_store" | "google_play";
|
|
1502
|
+
};
|
|
1503
|
+
readonly game?: {
|
|
1504
|
+
store: "app_store" | "google_play";
|
|
1505
|
+
};
|
|
1453
1506
|
}
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
1507
|
+
interface GemRequestOpenApp {
|
|
1508
|
+
readonly gem: typeof PROTOCOL;
|
|
1509
|
+
readonly type: "gem.requestOpenApp";
|
|
1510
|
+
readonly requestId: string;
|
|
1511
|
+
readonly target: "arcade" | "game";
|
|
1458
1512
|
}
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
readonly
|
|
1462
|
-
readonly
|
|
1463
|
-
readonly
|
|
1464
|
-
readonly
|
|
1465
|
-
readonly remaining: number;
|
|
1466
|
-
readonly period: EarnAllowancePeriod;
|
|
1467
|
-
readonly periodDays: number;
|
|
1468
|
-
readonly resetsAt?: number;
|
|
1513
|
+
interface GemOpenAppResult {
|
|
1514
|
+
readonly gem: typeof PROTOCOL;
|
|
1515
|
+
readonly type: "gem.openAppResult";
|
|
1516
|
+
readonly requestId: string;
|
|
1517
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1518
|
+
readonly reason?: string;
|
|
1469
1519
|
}
|
|
1470
|
-
interface
|
|
1471
|
-
readonly
|
|
1520
|
+
interface GemRequestOpenGame {
|
|
1521
|
+
readonly gem: typeof PROTOCOL;
|
|
1522
|
+
readonly type: "gem.requestOpenGame";
|
|
1523
|
+
readonly requestId: string;
|
|
1524
|
+
readonly ref: string;
|
|
1472
1525
|
}
|
|
1473
|
-
interface
|
|
1474
|
-
|
|
1475
|
-
|
|
1526
|
+
interface GemOpenGameResult {
|
|
1527
|
+
readonly gem: typeof PROTOCOL;
|
|
1528
|
+
readonly type: "gem.openGameResult";
|
|
1529
|
+
readonly requestId: string;
|
|
1530
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1531
|
+
readonly reason?: string;
|
|
1476
1532
|
}
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
on(event: EarnAllowanceEvent, listener: () => void): () => void;
|
|
1533
|
+
interface GemRequestSimilarGames {
|
|
1534
|
+
readonly gem: typeof PROTOCOL;
|
|
1535
|
+
readonly type: "gem.requestSimilarGames";
|
|
1536
|
+
readonly requestId: string;
|
|
1537
|
+
readonly limit?: number;
|
|
1483
1538
|
}
|
|
1484
|
-
|
|
1485
|
-
readonly
|
|
1486
|
-
readonly
|
|
1487
|
-
|
|
1539
|
+
interface GemSimilarGamesResult {
|
|
1540
|
+
readonly gem: typeof PROTOCOL;
|
|
1541
|
+
readonly type: "gem.similarGamesResult";
|
|
1542
|
+
readonly requestId: string;
|
|
1543
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1544
|
+
readonly reason?: string;
|
|
1545
|
+
readonly games: {
|
|
1546
|
+
gameId: string;
|
|
1547
|
+
slug?: string;
|
|
1548
|
+
iconUrl: string;
|
|
1549
|
+
capsuleLandscapeUrl: string;
|
|
1550
|
+
capsulePortraitUrl: string;
|
|
1551
|
+
previewVideoUrl?: string;
|
|
1552
|
+
previewPosterUrl?: string;
|
|
1553
|
+
untrusted: {
|
|
1554
|
+
name: string;
|
|
1555
|
+
tagline: string;
|
|
1556
|
+
shortDescription: string;
|
|
1557
|
+
tags: string[];
|
|
1558
|
+
};
|
|
1559
|
+
}[];
|
|
1488
1560
|
}
|
|
1489
|
-
interface
|
|
1490
|
-
readonly
|
|
1491
|
-
readonly
|
|
1492
|
-
readonly
|
|
1493
|
-
readonly updatedAt: number;
|
|
1561
|
+
interface GemRequestStoreOffers {
|
|
1562
|
+
readonly gem: typeof PROTOCOL;
|
|
1563
|
+
readonly type: "gem.requestStoreOffers";
|
|
1564
|
+
readonly requestId: string;
|
|
1494
1565
|
}
|
|
1495
|
-
interface
|
|
1496
|
-
readonly
|
|
1497
|
-
readonly
|
|
1498
|
-
readonly
|
|
1566
|
+
interface GemStoreOffersResult {
|
|
1567
|
+
readonly gem: typeof PROTOCOL;
|
|
1568
|
+
readonly type: "gem.storeOffersResult";
|
|
1569
|
+
readonly requestId: string;
|
|
1570
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1571
|
+
readonly reason?: string;
|
|
1572
|
+
readonly offers: {
|
|
1573
|
+
skuId: string;
|
|
1574
|
+
kind: "gem_pack" | "boost" | "pass" | "bundle";
|
|
1575
|
+
name: string;
|
|
1576
|
+
description: string;
|
|
1577
|
+
imageUrl?: string;
|
|
1578
|
+
priceDisplay: string;
|
|
1579
|
+
grant?: {
|
|
1580
|
+
currency: string;
|
|
1581
|
+
amount: number;
|
|
1582
|
+
};
|
|
1583
|
+
pass?: string;
|
|
1584
|
+
earnMultipliers?: {
|
|
1585
|
+
currencySlug: string;
|
|
1586
|
+
multiplierBp: number;
|
|
1587
|
+
}[];
|
|
1588
|
+
}[];
|
|
1499
1589
|
}
|
|
1500
|
-
interface
|
|
1501
|
-
readonly
|
|
1590
|
+
interface GemRequestStorePurchase {
|
|
1591
|
+
readonly gem: typeof PROTOCOL;
|
|
1592
|
+
readonly type: "gem.requestStorePurchase";
|
|
1593
|
+
readonly requestId: string;
|
|
1594
|
+
readonly skuId: string;
|
|
1502
1595
|
}
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
|
|
1596
|
+
interface GemStorePurchaseResult {
|
|
1597
|
+
readonly gem: typeof PROTOCOL;
|
|
1598
|
+
readonly type: "gem.storePurchaseResult";
|
|
1599
|
+
readonly requestId: string;
|
|
1600
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1601
|
+
readonly reason?: string;
|
|
1507
1602
|
}
|
|
1508
|
-
interface
|
|
1509
|
-
readonly
|
|
1510
|
-
readonly
|
|
1603
|
+
interface GemStorePurchaseSettled {
|
|
1604
|
+
readonly gem: typeof PROTOCOL;
|
|
1605
|
+
readonly type: "gem.storePurchaseSettled";
|
|
1606
|
+
readonly skuId: string;
|
|
1511
1607
|
}
|
|
1512
|
-
interface
|
|
1513
|
-
readonly
|
|
1514
|
-
readonly
|
|
1515
|
-
|
|
1516
|
-
|
|
1608
|
+
interface GemRequestStoreOfferSheet {
|
|
1609
|
+
readonly gem: typeof PROTOCOL;
|
|
1610
|
+
readonly type: "gem.requestStoreOfferSheet";
|
|
1611
|
+
readonly requestId: string;
|
|
1612
|
+
readonly skuId: string;
|
|
1517
1613
|
}
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
readonly
|
|
1521
|
-
readonly
|
|
1522
|
-
readonly
|
|
1523
|
-
|
|
1524
|
-
readonly invocationId?: string;
|
|
1525
|
-
readonly functionMessage?: string;
|
|
1526
|
-
readonly failure?: string;
|
|
1527
|
-
});
|
|
1528
|
-
get retryable(): boolean;
|
|
1614
|
+
interface GemStoreOfferSheetResult {
|
|
1615
|
+
readonly gem: typeof PROTOCOL;
|
|
1616
|
+
readonly type: "gem.storeOfferSheetResult";
|
|
1617
|
+
readonly requestId: string;
|
|
1618
|
+
readonly outcome: "ok" | "declined" | "unavailable";
|
|
1619
|
+
readonly reason?: string;
|
|
1529
1620
|
}
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
cue_id?: string;
|
|
1535
|
-
}) => Promise<BytesResponse>);
|
|
1536
|
-
invoke(input: unknown, options?: FunctionInvokeOptions): Promise<FunctionResult>;
|
|
1621
|
+
interface PlayerBoostMultiplier {
|
|
1622
|
+
readonly currencyId: string;
|
|
1623
|
+
readonly currencySlug: string;
|
|
1624
|
+
readonly multiplier: number;
|
|
1537
1625
|
}
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
type AnalyticsValue = string | number;
|
|
1543
|
-
interface AnalyticsRejection$1 {
|
|
1544
|
-
readonly index: number;
|
|
1545
|
-
readonly code: string;
|
|
1626
|
+
interface PlayerBoost {
|
|
1627
|
+
readonly active: boolean;
|
|
1628
|
+
readonly multipliers: readonly PlayerBoostMultiplier[];
|
|
1629
|
+
readonly expiresInDays?: number;
|
|
1546
1630
|
}
|
|
1547
|
-
interface
|
|
1548
|
-
readonly
|
|
1549
|
-
readonly
|
|
1550
|
-
readonly dropped: number;
|
|
1551
|
-
readonly duplicate: boolean;
|
|
1631
|
+
interface PlayerBadge$1 {
|
|
1632
|
+
readonly itemId: string;
|
|
1633
|
+
readonly iconUrl: string;
|
|
1552
1634
|
}
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
readonly
|
|
1635
|
+
type Avatar3dFamily = "small_human" | "adult_human" | (string & {});
|
|
1636
|
+
interface WornAvatar3d$1 {
|
|
1637
|
+
readonly family: Avatar3dFamily;
|
|
1638
|
+
readonly id: string;
|
|
1639
|
+
readonly modelUrl: string;
|
|
1640
|
+
readonly iconUrl: string;
|
|
1556
1641
|
}
|
|
1557
|
-
interface
|
|
1558
|
-
readonly
|
|
1559
|
-
readonly
|
|
1560
|
-
readonly
|
|
1642
|
+
interface PlayerIdentity {
|
|
1643
|
+
readonly playerId?: string;
|
|
1644
|
+
readonly displayName?: PlayerText;
|
|
1645
|
+
readonly discriminator?: string;
|
|
1646
|
+
readonly displayTag?: PlayerText;
|
|
1647
|
+
readonly avatarIconId?: string;
|
|
1648
|
+
readonly avatarIconUrl?: string;
|
|
1649
|
+
readonly avatar3dId?: string;
|
|
1650
|
+
readonly avatar3dModelUrl?: string;
|
|
1651
|
+
readonly avatar3dIconUrl?: string;
|
|
1652
|
+
readonly avatars3d?: readonly WornAvatar3d$1[];
|
|
1653
|
+
readonly badges: readonly PlayerBadge$1[];
|
|
1561
1654
|
}
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1655
|
+
declare function mapIdentity(row: unknown): PlayerIdentity;
|
|
1656
|
+
declare function platformIconUrl(url: string | undefined): string | undefined;
|
|
1657
|
+
interface RewardCue {
|
|
1658
|
+
currencySlug: string;
|
|
1659
|
+
cueId?: string;
|
|
1660
|
+
expected?: number;
|
|
1661
|
+
origin?: {
|
|
1662
|
+
x: number;
|
|
1663
|
+
y: number;
|
|
1664
|
+
};
|
|
1665
|
+
}
|
|
1666
|
+
type GemCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
1667
|
+
type RewardPresentation = "arcade" | "game";
|
|
1668
|
+
interface MenuStyle {
|
|
1669
|
+
readonly ground: string;
|
|
1670
|
+
readonly accent: string;
|
|
1671
|
+
}
|
|
1672
|
+
type FrameState = "waiting" | "connected" | "refused" | "closed";
|
|
1673
|
+
interface FramePlayer extends PlayerIdentity {
|
|
1674
|
+
readonly displayName: PlayerText;
|
|
1675
|
+
readonly displayHandle: PlayerText;
|
|
1676
|
+
readonly avatarUrl?: string;
|
|
1677
|
+
readonly boost: PlayerBoost;
|
|
1678
|
+
}
|
|
1679
|
+
type GemArcadeAsk = Omit<GemRequestAppLinks, "gem"> | Omit<GemRequestOpenApp, "gem"> | Omit<GemRequestOpenGame, "gem"> | Omit<GemRequestSimilarGames, "gem"> | Omit<GemRequestStoreOffers, "gem"> | Omit<GemRequestStorePurchase, "gem"> | Omit<GemRequestStoreOfferSheet, "gem">;
|
|
1680
|
+
type GemFriendsWindowAsk = Omit<GemRequestPlayInvite, "gem"> | Omit<GemInviteParams, "gem">;
|
|
1681
|
+
type GemArcadeAnswer = GemAppLinksResult | GemOpenAppResult | GemOpenGameResult | GemSimilarGamesResult | GemStoreOffersResult | GemStorePurchaseResult | GemStorePurchaseSettled | GemStoreOfferSheetResult;
|
|
1682
|
+
interface FrameCallbacks {
|
|
1683
|
+
onToken?(msg: GemToken): void;
|
|
1684
|
+
onPause?(msg: GemPause): void;
|
|
1685
|
+
onMenuSelect?(msg: GemMenuSelect): void;
|
|
1686
|
+
onSettingChange?(msg: GemSettingChange): void;
|
|
1687
|
+
onPrefs?(msg: GemPrefs$1): void;
|
|
1688
|
+
onCohorts?(msg: GemCohorts$1): void;
|
|
1689
|
+
onEarnAllowanceChanged?(): void;
|
|
1690
|
+
onInventoryChanged?(msg: GemInventoryChanged): void;
|
|
1691
|
+
onViewport?(msg: GemViewport$1): void;
|
|
1692
|
+
onWillTerminate?(msg: GemWillTerminate): void;
|
|
1693
|
+
onDevtools?(action: "open" | "close" | "toggle"): void;
|
|
1694
|
+
onScreenshot?(request: {
|
|
1695
|
+
maxWidth: number;
|
|
1696
|
+
maxHeight: number;
|
|
1697
|
+
}, port: MessagePort, deny: (reason: GemScreenshotDenied["reason"], retryable: boolean) => void): void;
|
|
1698
|
+
onRequestContext?(): void;
|
|
1699
|
+
onTokenDenied?(msg: GemTokenDenied): void;
|
|
1700
|
+
onLocalServer?(msg: GemLocalServer): void;
|
|
1701
|
+
onLocalServerDenied?(msg: GemLocalServerDenied): void;
|
|
1702
|
+
onPlayer?(player: FramePlayer, signInAvailable?: boolean): void;
|
|
1703
|
+
onRoomEvent?(msg: GemRoomEvent): void;
|
|
1704
|
+
onSeatedEvent?(msg: GemSeatedEvent): void;
|
|
1705
|
+
onAutoStartFailedEvent?(msg: GemAutoStartFailedEvent): void;
|
|
1706
|
+
onTicketEvent?(msg: GemTicketEvent): void;
|
|
1707
|
+
onSocketState?(msg: GemSocketState): void;
|
|
1708
|
+
onSignalEvent?(msg: GemSignalEvent): void;
|
|
1709
|
+
onRelayDraining?(msg: GemRelayDraining): void;
|
|
1710
|
+
onDedicatedEvent?(msg: GemDedicatedEvent): void;
|
|
1711
|
+
onClusterTarget?(msg: GemClusterTarget): void;
|
|
1712
|
+
onGraphicsRoutes?(msg: GemGraphicsRoutes): void;
|
|
1713
|
+
onPartyResult?(msg: GemPartyResult): void;
|
|
1714
|
+
onPurchaseResult?(msg: GemPurchaseResult): void;
|
|
1715
|
+
onPurchaseSettled?(msg: GemPurchaseSettled): void;
|
|
1716
|
+
onShareResult?(msg: GemShareResult): void;
|
|
1717
|
+
onDeviceSettings?(msg: GemDeviceSettings): void;
|
|
1718
|
+
onDeviceSettingsResult?(msg: GemDeviceSettingsResult): void;
|
|
1719
|
+
onAdResult?(msg: GemAdResult): void;
|
|
1720
|
+
onMomentResult?(msg: GemMomentResult): void;
|
|
1721
|
+
onSignInResult?(msg: GemSignInResult): void;
|
|
1722
|
+
onFriendChallengeResult?(msg: GemFriendChallengeResult): void;
|
|
1723
|
+
onArcadeAnswer?(msg: GemArcadeAnswer): void;
|
|
1724
|
+
onPlayInviteResult?(msg: GemPlayInviteResult): void;
|
|
1725
|
+
onError?(code: GemErrorCode, message?: string): void;
|
|
1726
|
+
onDropped?(code: GemErrorCode, message?: string): void;
|
|
1727
|
+
onStateChange?(state: FrameState): void;
|
|
1728
|
+
onRefused?(reason: string): void;
|
|
1729
|
+
}
|
|
1730
|
+
interface FrameOptions extends FrameCallbacks {
|
|
1731
|
+
allowedEmbedders: readonly string[];
|
|
1732
|
+
selfOrigin?: string;
|
|
1733
|
+
expectedSource: unknown;
|
|
1734
|
+
capabilities?: readonly string[];
|
|
1735
|
+
clock?: Clock;
|
|
1736
|
+
}
|
|
1737
|
+
declare class GemFrame {
|
|
1738
|
+
private readonly options;
|
|
1739
|
+
private state;
|
|
1740
|
+
private port;
|
|
1741
|
+
private version;
|
|
1742
|
+
private peerCapabilities;
|
|
1743
|
+
private unbidden;
|
|
1744
|
+
private engagedSent;
|
|
1745
|
+
private readyPending;
|
|
1746
|
+
private readySent;
|
|
1747
|
+
private settleWaiters;
|
|
1748
|
+
private readonly clock;
|
|
1749
|
+
private readonly inbound;
|
|
1750
|
+
private readonly outbound;
|
|
1751
|
+
private readonly expectedSource;
|
|
1752
|
+
constructor(options: FrameOptions);
|
|
1753
|
+
get currentState(): FrameState;
|
|
1754
|
+
get parentCapabilities(): readonly string[];
|
|
1755
|
+
parentSupports(capability: string): boolean;
|
|
1756
|
+
get protocolVersion(): number | null;
|
|
1757
|
+
get unbiddenLaunch(): boolean;
|
|
1758
|
+
handleWindowMessage(event: HandshakeEvent): boolean;
|
|
1759
|
+
ready(): void;
|
|
1760
|
+
settled(timeoutMs?: number): Promise<FrameState>;
|
|
1761
|
+
progress(loaded: number, total: number): void;
|
|
1762
|
+
requestToken(requestId: string, reason: "initial" | "expiring" | "rejected"): void;
|
|
1763
|
+
requestLocalServer(requestId: string, gameRoomId: string): boolean;
|
|
1764
|
+
exit(reason?: string): void;
|
|
1765
|
+
openExternal(url: string): void;
|
|
1766
|
+
requestFullscreen(enabled: boolean): void;
|
|
1767
|
+
reportMuted(muted: boolean): boolean;
|
|
1768
|
+
reportEngaged(): boolean;
|
|
1769
|
+
cueReward(cue: RewardCue): boolean;
|
|
1770
|
+
showPortraitBorders(name: string | null): boolean;
|
|
1771
|
+
setWalletVisible(visible: boolean, options?: {
|
|
1772
|
+
only?: readonly string[];
|
|
1773
|
+
}): boolean;
|
|
1774
|
+
setMenu(items?: ReadonlyArray<{
|
|
1570
1775
|
readonly id: string;
|
|
1571
|
-
readonly
|
|
1572
|
-
}
|
|
1573
|
-
|
|
1574
|
-
|
|
1776
|
+
readonly label: string;
|
|
1777
|
+
}>): boolean;
|
|
1778
|
+
declareSettings(settings: GemSettingsDeclare["settings"]): boolean;
|
|
1779
|
+
setGemCorner(corner: GemCorner): boolean;
|
|
1780
|
+
setRewardPresentation(mode: RewardPresentation): boolean;
|
|
1781
|
+
setMenuStyle(style: MenuStyle | null): boolean;
|
|
1782
|
+
requestShare(params: ReadonlyArray<{
|
|
1783
|
+
readonly key: string;
|
|
1784
|
+
readonly value: string;
|
|
1785
|
+
}>, requestId?: string): boolean;
|
|
1786
|
+
requestAvatarPicker(tab?: "2d" | "3d"): boolean;
|
|
1787
|
+
requestVibrate(pattern: readonly number[]): boolean;
|
|
1788
|
+
reportFrameStats(stats: {
|
|
1789
|
+
fps: number;
|
|
1790
|
+
frameTimeP95Ms: number;
|
|
1791
|
+
counts?: "pageFrames" | "gameDraws";
|
|
1792
|
+
}): boolean;
|
|
1793
|
+
sendGameContext(context: Record<string, unknown>): boolean;
|
|
1794
|
+
signal(signal: string, matchId: string, data: Record<string, unknown>): void;
|
|
1795
|
+
dedicatedOffer(matchId: string, sdp: string, intent: GemDedicatedOffer["intent"]): void;
|
|
1796
|
+
requestParty(requestId: string): boolean;
|
|
1797
|
+
requestPurchase(requestId: string, purchaseKind: "item" | "recipe", targetId: string, currencySlug: string, quantity?: number, catalogId?: string, origin?: "sheet" | "direct_refused"): boolean;
|
|
1798
|
+
requestAvatar3dPurchase(requestId: string, itemId: string, currencySlug: string): boolean;
|
|
1799
|
+
putDeviceSettings(requestId: string, settings: Readonly<Record<string, unknown>>): boolean;
|
|
1800
|
+
requestAd(requestId: string, placement: string, format: "interstitial" | "rewarded"): boolean;
|
|
1801
|
+
signalMoment(requestId: string, kind: string, placement?: string, wall?: boolean): boolean;
|
|
1802
|
+
readyCalled(): boolean;
|
|
1803
|
+
requestSignIn(requestId: string): boolean;
|
|
1804
|
+
requestFriendChallenge(requestId: string, playerId: string, template: string, params?: Readonly<Record<string, string | number>>): boolean;
|
|
1805
|
+
requestArcade(msg: GemArcadeAsk | GemFriendsWindowAsk): boolean;
|
|
1806
|
+
close(): void;
|
|
1807
|
+
private transition;
|
|
1808
|
+
private refuseMalformed;
|
|
1809
|
+
private dropUnknownType;
|
|
1810
|
+
private refuse;
|
|
1811
|
+
private fail;
|
|
1812
|
+
private gated;
|
|
1813
|
+
private send;
|
|
1814
|
+
private receive;
|
|
1815
|
+
private dispatchInbound;
|
|
1816
|
+
private screenshotDenied;
|
|
1575
1817
|
}
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
setContext(props: Readonly<Record<string, AnalyticsValue>>): void;
|
|
1581
|
-
experiment(key: string, count: number): Promise<number>;
|
|
1582
|
-
experiment<T extends string>(key: string, options: readonly T[]): Promise<T>;
|
|
1583
|
-
get environment(): Readonly<Record<string, string>>;
|
|
1584
|
-
flush(options?: AnalyticsFlushOptions): Promise<AnalyticsFlushResult>;
|
|
1585
|
-
trackPlatform(name: PlatformEventName, props?: Readonly<Record<string, AnalyticsValue>>): void;
|
|
1586
|
-
hold(): void;
|
|
1587
|
-
release(): void;
|
|
1588
|
-
get held(): boolean;
|
|
1589
|
-
startSession(): void;
|
|
1590
|
-
endSession(reason: SessionEndReason): void;
|
|
1591
|
-
setPaused(paused: boolean): void;
|
|
1592
|
-
setHidden(hidden: boolean): void;
|
|
1593
|
-
dispose(): void;
|
|
1594
|
-
get pending(): number;
|
|
1818
|
+
type ArcadeOutcomeKind = "ok" | "declined" | "unavailable";
|
|
1819
|
+
interface ArcadeOutcome {
|
|
1820
|
+
readonly outcome: ArcadeOutcomeKind;
|
|
1821
|
+
readonly reason?: string;
|
|
1595
1822
|
}
|
|
1596
|
-
interface
|
|
1823
|
+
interface ArcadeOffer {
|
|
1824
|
+
readonly skuId: string;
|
|
1825
|
+
readonly kind: ArcadeOfferKind;
|
|
1597
1826
|
readonly name: string;
|
|
1598
|
-
readonly
|
|
1827
|
+
readonly description: string;
|
|
1828
|
+
readonly imageUrl?: string;
|
|
1829
|
+
readonly priceDisplay: string;
|
|
1830
|
+
readonly grant?: {
|
|
1831
|
+
readonly currency: string;
|
|
1832
|
+
readonly amount: number;
|
|
1833
|
+
};
|
|
1834
|
+
readonly pass?: string;
|
|
1835
|
+
readonly earnMultipliers: readonly ArcadeOfferEarnMultiplier[];
|
|
1599
1836
|
}
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
readonly
|
|
1837
|
+
type ArcadeOfferKind = "coin_pack" | "gem_pack" | "boost" | "pass" | "bundle";
|
|
1838
|
+
interface ArcadeOfferEarnMultiplier {
|
|
1839
|
+
readonly currencySlug: string;
|
|
1840
|
+
readonly multiplierBp: number;
|
|
1604
1841
|
}
|
|
1605
|
-
interface
|
|
1606
|
-
readonly
|
|
1842
|
+
interface ShowPassOutcome extends ArcadeOutcome {
|
|
1843
|
+
readonly held: boolean;
|
|
1607
1844
|
}
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
declare function createBootTimeline(options?: BootTimelineOptions): BootTimeline;
|
|
1611
|
-
type GemGraphicsRoute = "webgpu" | "webgl";
|
|
1612
|
-
interface GemPreferredRoute {
|
|
1613
|
-
readonly route: GemGraphicsRoute;
|
|
1614
|
-
readonly listed: boolean;
|
|
1845
|
+
interface StoreOffersOutcome extends ArcadeOutcome {
|
|
1846
|
+
readonly offers: readonly ArcadeOffer[];
|
|
1615
1847
|
}
|
|
1616
|
-
interface
|
|
1617
|
-
readonly
|
|
1618
|
-
readonly route?: string;
|
|
1619
|
-
readonly host?: string;
|
|
1848
|
+
interface StoreSettlement {
|
|
1849
|
+
readonly skuId: string;
|
|
1620
1850
|
}
|
|
1621
|
-
interface
|
|
1622
|
-
readonly
|
|
1851
|
+
interface StoreApi {
|
|
1852
|
+
readonly available: boolean;
|
|
1853
|
+
readonly showOfferAvailable: boolean;
|
|
1854
|
+
offers(): Promise<StoreOffersOutcome>;
|
|
1855
|
+
purchase(skuId: string): Promise<ArcadeOutcome>;
|
|
1856
|
+
showOffer(skuId: string): Promise<ArcadeOutcome>;
|
|
1857
|
+
showPass(slug: string): Promise<ShowPassOutcome>;
|
|
1858
|
+
passOnSale(slug: string): Promise<boolean>;
|
|
1859
|
+
onSettled(listener: (settlement: StoreSettlement) => void): () => void;
|
|
1623
1860
|
}
|
|
1624
|
-
|
|
1625
|
-
|
|
1861
|
+
type PlatformGrantSource = {
|
|
1862
|
+
readonly source: "pass";
|
|
1863
|
+
readonly pass: string;
|
|
1864
|
+
readonly amount: number;
|
|
1865
|
+
} | {
|
|
1866
|
+
readonly source: "boost";
|
|
1867
|
+
readonly amount: number;
|
|
1868
|
+
};
|
|
1869
|
+
interface PlatformGrantPreview {
|
|
1870
|
+
readonly currencySlug?: string;
|
|
1871
|
+
readonly currencyId?: string;
|
|
1872
|
+
readonly base: number;
|
|
1873
|
+
readonly total: number;
|
|
1874
|
+
readonly breakdown: readonly PlatformGrantSource[];
|
|
1875
|
+
readonly ifComplete?: true;
|
|
1626
1876
|
}
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
open(): Promise<boolean>;
|
|
1630
|
-
close(): void;
|
|
1631
|
-
readonly isOpen: boolean;
|
|
1877
|
+
interface EarningsApi {
|
|
1878
|
+
fromReceipt(change: unknown): Promise<PlatformGrantPreview | null>;
|
|
1632
1879
|
}
|
|
1633
|
-
type
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
type
|
|
1640
|
-
|
|
1641
|
-
readonly
|
|
1642
|
-
readonly
|
|
1643
|
-
|
|
1880
|
+
type PreviewTarget = {
|
|
1881
|
+
readonly recipe: string;
|
|
1882
|
+
} | {
|
|
1883
|
+
readonly progression: string;
|
|
1884
|
+
readonly add?: number;
|
|
1885
|
+
};
|
|
1886
|
+
type PreviewGrant = {
|
|
1887
|
+
readonly kind: "item";
|
|
1888
|
+
readonly itemId: string;
|
|
1889
|
+
readonly quantity: number;
|
|
1890
|
+
} | {
|
|
1891
|
+
readonly kind: "currency";
|
|
1892
|
+
readonly currencyId: string;
|
|
1893
|
+
readonly amount: number;
|
|
1894
|
+
} | {
|
|
1895
|
+
readonly kind: "roll";
|
|
1896
|
+
readonly lootTableId: string;
|
|
1897
|
+
readonly count: number;
|
|
1898
|
+
};
|
|
1899
|
+
interface UnmetRequirement {
|
|
1900
|
+
readonly index: number;
|
|
1901
|
+
readonly kind: string;
|
|
1644
1902
|
}
|
|
1645
|
-
interface
|
|
1646
|
-
readonly
|
|
1647
|
-
readonly
|
|
1648
|
-
readonly
|
|
1649
|
-
readonly
|
|
1650
|
-
readonly credentialExpiresAt?: number;
|
|
1651
|
-
readonly host?: string;
|
|
1652
|
-
readonly port?: number;
|
|
1903
|
+
interface BonusPreview {
|
|
1904
|
+
readonly id: string;
|
|
1905
|
+
readonly grants: readonly PreviewGrant[];
|
|
1906
|
+
readonly eligible: boolean | "unknown";
|
|
1907
|
+
readonly unmet: readonly UnmetRequirement[];
|
|
1653
1908
|
}
|
|
1654
|
-
interface
|
|
1655
|
-
readonly
|
|
1656
|
-
readonly
|
|
1657
|
-
readonly
|
|
1658
|
-
readonly
|
|
1659
|
-
|
|
1660
|
-
|
|
1909
|
+
interface PassUpsell {
|
|
1910
|
+
readonly pass: string;
|
|
1911
|
+
readonly name: string;
|
|
1912
|
+
readonly offer: ArcadeOffer;
|
|
1913
|
+
readonly platformGrants: readonly {
|
|
1914
|
+
readonly currencySlug?: string;
|
|
1915
|
+
readonly currencyId?: string;
|
|
1916
|
+
readonly total: number;
|
|
1917
|
+
readonly extra: number;
|
|
1918
|
+
readonly ifComplete?: true;
|
|
1919
|
+
}[];
|
|
1920
|
+
readonly bonuses: readonly {
|
|
1921
|
+
readonly id: string;
|
|
1922
|
+
readonly grants: readonly PreviewGrant[];
|
|
1923
|
+
}[];
|
|
1661
1924
|
}
|
|
1662
|
-
interface
|
|
1663
|
-
readonly
|
|
1664
|
-
readonly
|
|
1665
|
-
readonly
|
|
1666
|
-
readonly
|
|
1925
|
+
interface ConfigPreview {
|
|
1926
|
+
readonly grants: readonly PreviewGrant[];
|
|
1927
|
+
readonly platformGrants: readonly PlatformGrantPreview[];
|
|
1928
|
+
readonly bonuses: readonly BonusPreview[];
|
|
1929
|
+
readonly upsells: readonly PassUpsell[];
|
|
1930
|
+
}
|
|
1931
|
+
interface PreviewHoldings {
|
|
1932
|
+
readonly items: ReadonlyMap<string, number> | null;
|
|
1933
|
+
readonly currencies: ReadonlyMap<string, number> | null;
|
|
1934
|
+
readonly progressions: ReadonlyMap<string, {
|
|
1935
|
+
readonly value: number;
|
|
1936
|
+
readonly completed: boolean;
|
|
1937
|
+
}> | null;
|
|
1938
|
+
readonly passes: ReadonlyMap<string, boolean> | null;
|
|
1939
|
+
}
|
|
1940
|
+
interface PreviewBoost {
|
|
1941
|
+
readonly currencyId?: string;
|
|
1942
|
+
readonly currencySlug?: string;
|
|
1943
|
+
readonly multiplierBp: number;
|
|
1944
|
+
}
|
|
1945
|
+
declare class PreviewError extends Error {
|
|
1946
|
+
readonly code: "not_found" | "invalid_argument" | "unsupported";
|
|
1947
|
+
constructor(code: "not_found" | "invalid_argument" | "unsupported", message: string);
|
|
1667
1948
|
}
|
|
1668
|
-
interface
|
|
1669
|
-
|
|
1670
|
-
|
|
1949
|
+
interface GameConfig extends GameConfigSnapshot {
|
|
1950
|
+
items: GameConfigSnapshot["items"];
|
|
1951
|
+
currencies: GameConfigSnapshot["currencies"];
|
|
1952
|
+
catalogs: GameConfigSnapshot["catalogs"];
|
|
1953
|
+
loot_tables: GameConfigSnapshot["loot_tables"];
|
|
1954
|
+
affix_pools?: GameConfigSnapshot["affix_pools"];
|
|
1955
|
+
progressions: GameConfigSnapshot["progressions"];
|
|
1956
|
+
game_room_templates: GameConfigSnapshot["game_room_templates"];
|
|
1957
|
+
kv: GameConfigSnapshot["kv"];
|
|
1958
|
+
run_types?: GameConfigSnapshot["run_types"];
|
|
1959
|
+
leaderboards?: GameConfigSnapshot["leaderboards"];
|
|
1960
|
+
async_opponent_types?: GameConfigSnapshot["async_opponent_types"];
|
|
1961
|
+
analytics_events?: GameConfigSnapshot["analytics_events"];
|
|
1962
|
+
analytics_funnels?: GameConfigSnapshot["analytics_funnels"];
|
|
1963
|
+
"rewarded_placements"?: SnapshotRewardedPlacement[];
|
|
1964
|
+
version: GameConfigSnapshot["version"];
|
|
1965
|
+
hash: GameConfigSnapshot["hash"];
|
|
1966
|
+
item(idOrSlug: string): SnapshotItem | null;
|
|
1967
|
+
currency(idOrSlug: string): SnapshotCurrency | null;
|
|
1671
1968
|
}
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1675
|
-
readonly retryable: boolean;
|
|
1676
|
-
readonly platformCode: string | undefined;
|
|
1677
|
-
constructor(reason: DedicatedServerFailure, message: string, options?: {
|
|
1678
|
-
cause?: unknown;
|
|
1679
|
-
platformCode?: string;
|
|
1680
|
-
});
|
|
1969
|
+
declare class GemConfigError extends Error {
|
|
1970
|
+
readonly reason: "config_unreachable" | "config_too_large" | "config_malformed" | "config_timeout" | "config_channel_unknown";
|
|
1971
|
+
constructor(reason: "config_unreachable" | "config_too_large" | "config_malformed" | "config_timeout" | "config_channel_unknown", message: string);
|
|
1681
1972
|
}
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
readonly
|
|
1686
|
-
readonly intent: SignalingIntent;
|
|
1973
|
+
interface PreviewSources {
|
|
1974
|
+
boost(): readonly PreviewBoost[];
|
|
1975
|
+
holdings(needsInventory: boolean): Promise<PreviewHoldings>;
|
|
1976
|
+
offers(): Promise<readonly ArcadeOffer[]>;
|
|
1687
1977
|
}
|
|
1688
|
-
interface
|
|
1689
|
-
readonly
|
|
1978
|
+
interface GameConfigOptions {
|
|
1979
|
+
readonly fetch?: typeof globalThis.fetch;
|
|
1980
|
+
readonly timeoutMs?: number;
|
|
1690
1981
|
}
|
|
1691
|
-
interface
|
|
1692
|
-
|
|
1693
|
-
|
|
1982
|
+
interface DropRateEntry$1 {
|
|
1983
|
+
readonly entryId: string;
|
|
1984
|
+
readonly weight: number;
|
|
1985
|
+
readonly dropRate: number;
|
|
1986
|
+
readonly rarityTier?: string;
|
|
1694
1987
|
}
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
readonly
|
|
1698
|
-
readonly
|
|
1988
|
+
interface DropRates {
|
|
1989
|
+
readonly lootTableId: string;
|
|
1990
|
+
readonly name: string;
|
|
1991
|
+
readonly rollCount: number;
|
|
1992
|
+
readonly allowDuplicateRolls: boolean;
|
|
1993
|
+
readonly totalWeight: number;
|
|
1994
|
+
readonly entries: readonly DropRateEntry$1[];
|
|
1699
1995
|
}
|
|
1700
|
-
|
|
1701
|
-
readonly
|
|
1702
|
-
readonly
|
|
1996
|
+
declare class GameConfigApi {
|
|
1997
|
+
private readonly api;
|
|
1998
|
+
private readonly channel;
|
|
1999
|
+
private readonly options;
|
|
2000
|
+
private loaded;
|
|
2001
|
+
private inFlight;
|
|
2002
|
+
private generation;
|
|
2003
|
+
private readonly dropRatesByConfig;
|
|
2004
|
+
constructor(api: GameApi$1, channel: () => string, options?: GameConfigOptions);
|
|
2005
|
+
load(): Promise<GameConfig | null>;
|
|
2006
|
+
refresh(): void;
|
|
2007
|
+
bindPreview(sources: PreviewSources): void;
|
|
2008
|
+
private previewSources;
|
|
2009
|
+
preview(target: PreviewTarget): Promise<ConfigPreview>;
|
|
2010
|
+
dropRates(lootTableId: string, signal?: AbortSignal): Promise<DropRates>;
|
|
2011
|
+
private fetchConfig;
|
|
1703
2012
|
}
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
2013
|
+
declare const MAX_PERIODS_BACK = 400;
|
|
2014
|
+
type ChallengeWindow = "daily" | "weekly" | "monthly" | "cron" | (string & {});
|
|
2015
|
+
interface Challenge {
|
|
2016
|
+
readonly id: string;
|
|
2017
|
+
readonly slug?: string;
|
|
2018
|
+
readonly window: ChallengeWindow;
|
|
2019
|
+
readonly periodStartAt: number;
|
|
2020
|
+
readonly periodEndsAt: number;
|
|
2021
|
+
readonly periodLocalDate?: string;
|
|
2022
|
+
readonly boundary: string;
|
|
2023
|
+
readonly resetTime: string;
|
|
2024
|
+
readonly seed: string;
|
|
2025
|
+
readonly data?: string;
|
|
2026
|
+
readonly dataHash?: string;
|
|
1707
2027
|
}
|
|
1708
|
-
interface
|
|
1709
|
-
readonly
|
|
1710
|
-
|
|
1711
|
-
|
|
2028
|
+
interface ListChallengesOptions {
|
|
2029
|
+
readonly periodsBack?: number;
|
|
2030
|
+
readonly signal?: AbortSignal;
|
|
2031
|
+
}
|
|
2032
|
+
declare class ChallengesApi {
|
|
2033
|
+
#private;
|
|
2034
|
+
constructor(api: GameApi$1);
|
|
2035
|
+
list(options?: ListChallengesOptions): Promise<Challenge[]>;
|
|
1712
2036
|
}
|
|
1713
|
-
interface
|
|
1714
|
-
readonly
|
|
1715
|
-
readonly
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
2037
|
+
interface LeaderboardPeriod {
|
|
2038
|
+
readonly id: string;
|
|
2039
|
+
readonly localDate?: string;
|
|
2040
|
+
readonly startAt?: number;
|
|
2041
|
+
readonly endsAt?: number;
|
|
2042
|
+
readonly opensAt: number;
|
|
2043
|
+
readonly closesAt: number;
|
|
2044
|
+
readonly final: boolean;
|
|
1721
2045
|
}
|
|
1722
|
-
interface
|
|
1723
|
-
readonly
|
|
1724
|
-
readonly
|
|
1725
|
-
readonly
|
|
2046
|
+
interface LeaderboardEntry extends RankedRow, PlayerIdentity {
|
|
2047
|
+
readonly rank: number;
|
|
2048
|
+
readonly occurredAt: number;
|
|
2049
|
+
readonly entityId?: string;
|
|
2050
|
+
readonly entityType?: EntityType$1;
|
|
2051
|
+
readonly stats?: Readonly<Record<string, number>>;
|
|
2052
|
+
readonly properties?: Readonly<Record<string, unknown>>;
|
|
2053
|
+
readonly isViewer?: boolean;
|
|
1726
2054
|
}
|
|
1727
|
-
interface
|
|
1728
|
-
readonly
|
|
1729
|
-
|
|
2055
|
+
interface Leaderboard {
|
|
2056
|
+
readonly leaderboardType: string;
|
|
2057
|
+
readonly runType: string;
|
|
2058
|
+
readonly bucket1?: string;
|
|
2059
|
+
readonly bucket2?: string;
|
|
2060
|
+
readonly entries: readonly LeaderboardEntry[];
|
|
2061
|
+
readonly generatedAt: number;
|
|
2062
|
+
readonly updateFrequencySeconds?: number;
|
|
2063
|
+
readonly period?: LeaderboardPeriod;
|
|
1730
2064
|
}
|
|
1731
|
-
interface
|
|
1732
|
-
readonly
|
|
1733
|
-
readonly
|
|
1734
|
-
readonly
|
|
1735
|
-
readonly
|
|
1736
|
-
readonly ceilingMs?: number;
|
|
1737
|
-
readonly wire?: number;
|
|
1738
|
-
readonly heartbeat?: boolean;
|
|
1739
|
-
readonly onMessage?: (data: unknown) => void;
|
|
1740
|
-
readonly signal?: AbortSignal;
|
|
2065
|
+
interface RankedRow {
|
|
2066
|
+
readonly rank: number;
|
|
2067
|
+
readonly occurredAt: number;
|
|
2068
|
+
readonly stats?: Readonly<Record<string, number>>;
|
|
2069
|
+
readonly properties?: Readonly<Record<string, unknown>>;
|
|
1741
2070
|
}
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
interface SendOptions$1 {
|
|
1746
|
-
readonly reliable?: boolean;
|
|
1747
|
-
readonly ordered?: boolean;
|
|
2071
|
+
interface EntityLeaderboardEntry extends RankedRow {
|
|
2072
|
+
readonly rank: number;
|
|
2073
|
+
readonly stats?: Readonly<Record<string, number>>;
|
|
1748
2074
|
}
|
|
1749
|
-
interface
|
|
1750
|
-
readonly
|
|
1751
|
-
readonly
|
|
2075
|
+
interface EntityLeaderboard {
|
|
2076
|
+
readonly leaderboardType: string;
|
|
2077
|
+
readonly runType: string;
|
|
2078
|
+
readonly entityType: EntityType$1;
|
|
2079
|
+
readonly entityId: string;
|
|
2080
|
+
readonly bucket1?: string;
|
|
2081
|
+
readonly bucket2?: string;
|
|
2082
|
+
readonly entries: readonly EntityLeaderboardEntry[];
|
|
2083
|
+
readonly personalBest: EntityLeaderboardEntry | null;
|
|
2084
|
+
readonly totalRuns: number;
|
|
2085
|
+
readonly totalRunsExact: boolean;
|
|
2086
|
+
readonly generatedAt: number;
|
|
2087
|
+
readonly period?: LeaderboardPeriod;
|
|
1752
2088
|
}
|
|
1753
|
-
interface
|
|
1754
|
-
readonly
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
onClose(handler: (reason?: string) => void): void;
|
|
1758
|
-
close(): void;
|
|
2089
|
+
interface PeriodOptions {
|
|
2090
|
+
readonly periodsBack?: number;
|
|
2091
|
+
readonly period?: string;
|
|
2092
|
+
readonly playerId?: string;
|
|
1759
2093
|
}
|
|
1760
|
-
interface
|
|
1761
|
-
readonly
|
|
1762
|
-
readonly
|
|
1763
|
-
readonly
|
|
1764
|
-
readonly
|
|
1765
|
-
readonly webrtc?: boolean;
|
|
1766
|
-
readonly webtransport?: {
|
|
1767
|
-
readonly url: string;
|
|
1768
|
-
readonly cert_sha256_b64: string;
|
|
1769
|
-
readonly expires_at?: number;
|
|
1770
|
-
readonly named_url?: string;
|
|
1771
|
-
};
|
|
1772
|
-
readonly websocket?: {
|
|
1773
|
-
readonly url: string;
|
|
1774
|
-
readonly tls?: boolean;
|
|
1775
|
-
};
|
|
2094
|
+
interface EntityLeaderboardOptions extends PeriodOptions {
|
|
2095
|
+
readonly bucket1?: string;
|
|
2096
|
+
readonly bucket2?: string;
|
|
2097
|
+
readonly limit?: number;
|
|
2098
|
+
readonly signal?: AbortSignal;
|
|
1776
2099
|
}
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
type RoomArgValue$1 = RoomArgScalar | readonly RoomArgScalar[];
|
|
1782
|
-
type RoomArgs = Readonly<Record<string, RoomArgValue$1>>;
|
|
1783
|
-
type RoomArgType$1 = "string" | "int" | "float" | "bool" | (string & {});
|
|
1784
|
-
interface RoomArgEntry {
|
|
1785
|
-
readonly name: string;
|
|
1786
|
-
readonly type: RoomArgType$1;
|
|
1787
|
-
readonly list: boolean;
|
|
1788
|
-
readonly required: boolean;
|
|
1789
|
-
readonly mutable: boolean;
|
|
1790
|
-
readonly fixed?: RoomArgValue$1;
|
|
1791
|
-
readonly default?: RoomArgValue$1;
|
|
1792
|
-
readonly description?: string;
|
|
1793
|
-
readonly allowed?: readonly RoomArgScalar[];
|
|
1794
|
-
readonly min?: number;
|
|
1795
|
-
readonly max?: number;
|
|
1796
|
-
readonly minItems?: number;
|
|
1797
|
-
readonly maxItems?: number;
|
|
1798
|
-
readonly maxLength?: number;
|
|
2100
|
+
interface GetLeaderboardOptions extends PeriodOptions {
|
|
2101
|
+
readonly bucket1?: string;
|
|
2102
|
+
readonly bucket2?: string;
|
|
2103
|
+
readonly signal?: AbortSignal;
|
|
1799
2104
|
}
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
readonly reason?: string;
|
|
1808
|
-
readonly roomReopened?: boolean;
|
|
2105
|
+
declare class LeaderboardsApi {
|
|
2106
|
+
#private;
|
|
2107
|
+
constructor(api: GameApi$1);
|
|
2108
|
+
get(leaderboardType: string, options?: GetLeaderboardOptions): Promise<Leaderboard>;
|
|
2109
|
+
friends(leaderboardType: string, options?: GetLeaderboardOptions): Promise<Leaderboard>;
|
|
2110
|
+
mine(leaderboardType: string, options?: EntityLeaderboardOptions): Promise<EntityLeaderboard>;
|
|
2111
|
+
character(leaderboardType: string, characterId: string, options?: EntityLeaderboardOptions): Promise<EntityLeaderboard>;
|
|
1809
2112
|
}
|
|
1810
|
-
interface
|
|
1811
|
-
readonly
|
|
1812
|
-
readonly
|
|
1813
|
-
readonly
|
|
2113
|
+
interface ShowcaseValue {
|
|
2114
|
+
readonly playerId: string;
|
|
2115
|
+
readonly key: string;
|
|
2116
|
+
readonly value: unknown;
|
|
2117
|
+
readonly updatedAt: number;
|
|
1814
2118
|
}
|
|
1815
|
-
interface
|
|
1816
|
-
readonly
|
|
1817
|
-
readonly
|
|
2119
|
+
interface ShowcaseFriendEntry extends PlayerIdentity {
|
|
2120
|
+
readonly playerId: string;
|
|
2121
|
+
readonly value: unknown;
|
|
2122
|
+
readonly isViewer: boolean;
|
|
2123
|
+
readonly updatedAt: number;
|
|
1818
2124
|
}
|
|
1819
|
-
interface
|
|
1820
|
-
readonly
|
|
1821
|
-
readonly
|
|
1822
|
-
readonly
|
|
1823
|
-
readonly remainingMs: number;
|
|
2125
|
+
interface ShowcaseFriends {
|
|
2126
|
+
readonly key: string;
|
|
2127
|
+
readonly entries: readonly ShowcaseFriendEntry[];
|
|
2128
|
+
readonly generatedAt: number;
|
|
1824
2129
|
}
|
|
1825
|
-
interface
|
|
1826
|
-
readonly
|
|
1827
|
-
readonly attempt: number;
|
|
2130
|
+
interface ShowcaseCallOptions {
|
|
2131
|
+
readonly signal?: AbortSignal;
|
|
1828
2132
|
}
|
|
1829
|
-
|
|
1830
|
-
readonly
|
|
1831
|
-
readonly
|
|
1832
|
-
|
|
2133
|
+
declare class ShowcaseApi {
|
|
2134
|
+
private readonly api;
|
|
2135
|
+
private readonly selfPlayerId;
|
|
2136
|
+
constructor(api: GameApi$1, selfPlayerId: () => Promise<string>);
|
|
2137
|
+
friends(key: string, options?: ShowcaseCallOptions): Promise<ShowcaseFriends>;
|
|
2138
|
+
of(playerId: string, key: string, options?: ShowcaseCallOptions): Promise<ShowcaseValue | null>;
|
|
2139
|
+
set(key: string, value: unknown, options?: ShowcaseCallOptions): Promise<ShowcaseValue>;
|
|
2140
|
+
clear(key: string, options?: ShowcaseCallOptions): Promise<void>;
|
|
1833
2141
|
}
|
|
1834
|
-
interface
|
|
2142
|
+
interface Friend extends PlayerIdentity {
|
|
1835
2143
|
readonly playerId: string;
|
|
1836
|
-
readonly isReady: boolean;
|
|
1837
|
-
readonly role: string;
|
|
1838
|
-
readonly joinedAt: number;
|
|
1839
|
-
readonly groupId?: string;
|
|
1840
|
-
readonly platform?: string;
|
|
1841
2144
|
}
|
|
1842
|
-
interface
|
|
1843
|
-
readonly
|
|
1844
|
-
readonly
|
|
1845
|
-
readonly name: string;
|
|
1846
|
-
readonly status: RoomStatus;
|
|
1847
|
-
readonly hostPlayerId: string;
|
|
1848
|
-
readonly maxPlayers: number;
|
|
1849
|
-
readonly memberCount: number;
|
|
1850
|
-
readonly members: readonly RoomMember[];
|
|
1851
|
-
readonly isPublic: boolean;
|
|
1852
|
-
readonly joinCode?: string;
|
|
1853
|
-
readonly settings?: unknown;
|
|
1854
|
-
readonly roomArgs?: RoomArgs;
|
|
1855
|
-
readonly roomArgsTemplate?: readonly RoomArgEntry[];
|
|
1856
|
-
readonly gameChannel: string;
|
|
1857
|
-
readonly region?: string;
|
|
1858
|
-
readonly clusterTargetId?: string;
|
|
1859
|
-
readonly selfHosted: boolean;
|
|
1860
|
-
readonly matchId?: string;
|
|
1861
|
-
readonly version: number;
|
|
1862
|
-
readonly templateId?: string;
|
|
1863
|
-
readonly templateSlug?: string;
|
|
1864
|
-
readonly roomType: string;
|
|
1865
|
-
readonly transports?: readonly TransportKind[];
|
|
1866
|
-
readonly createdAt: number;
|
|
1867
|
-
readonly updatedAt: number;
|
|
1868
|
-
readonly startedAt?: number;
|
|
2145
|
+
interface FriendsPage {
|
|
2146
|
+
readonly friends: readonly Friend[];
|
|
2147
|
+
readonly nextCursor?: string;
|
|
1869
2148
|
}
|
|
1870
|
-
interface
|
|
1871
|
-
readonly
|
|
1872
|
-
readonly
|
|
1873
|
-
readonly
|
|
2149
|
+
interface ListFriendsOptions {
|
|
2150
|
+
readonly limit?: number;
|
|
2151
|
+
readonly cursor?: string;
|
|
2152
|
+
readonly signal?: AbortSignal;
|
|
1874
2153
|
}
|
|
1875
|
-
interface
|
|
2154
|
+
interface FriendChallenge {
|
|
1876
2155
|
readonly id: string;
|
|
1877
|
-
readonly
|
|
1878
|
-
readonly
|
|
1879
|
-
readonly
|
|
1880
|
-
readonly hostPlayerId: string;
|
|
1881
|
-
readonly maxPlayers: number;
|
|
1882
|
-
readonly memberCount: number;
|
|
1883
|
-
readonly isPublic: boolean;
|
|
1884
|
-
readonly gameChannel: string;
|
|
1885
|
-
readonly roomType: string;
|
|
2156
|
+
readonly from: Friend;
|
|
2157
|
+
readonly template: string;
|
|
2158
|
+
readonly params: Readonly<Record<string, string | number>>;
|
|
1886
2159
|
readonly createdAt: number;
|
|
2160
|
+
readonly openedAt?: number;
|
|
2161
|
+
readonly answeredAt?: number;
|
|
1887
2162
|
}
|
|
1888
|
-
interface
|
|
1889
|
-
readonly
|
|
2163
|
+
interface FriendChallengesPage {
|
|
2164
|
+
readonly challenges: readonly FriendChallenge[];
|
|
1890
2165
|
readonly nextCursor?: string;
|
|
1891
2166
|
}
|
|
1892
|
-
interface
|
|
1893
|
-
readonly
|
|
1894
|
-
readonly
|
|
1895
|
-
readonly reason: string;
|
|
1896
|
-
readonly message: string;
|
|
1897
|
-
readonly retryable: boolean;
|
|
1898
|
-
}
|
|
1899
|
-
interface QueueForMatchOptions {
|
|
1900
|
-
readonly templateSlugs: readonly string[];
|
|
1901
|
-
readonly partyId?: string;
|
|
2167
|
+
interface ListFriendChallengesOptions {
|
|
2168
|
+
readonly limit?: number;
|
|
2169
|
+
readonly cursor?: string;
|
|
1902
2170
|
readonly signal?: AbortSignal;
|
|
1903
2171
|
}
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
readonly
|
|
1907
|
-
readonly
|
|
1908
|
-
} | {
|
|
1909
|
-
readonly status: "expired";
|
|
1910
|
-
readonly reason: string;
|
|
1911
|
-
} | {
|
|
1912
|
-
readonly status: "cancelled";
|
|
1913
|
-
readonly reason: string;
|
|
1914
|
-
} | {
|
|
1915
|
-
readonly status: "failed";
|
|
1916
|
-
readonly reason: string;
|
|
1917
|
-
} | {
|
|
1918
|
-
readonly status: "lost";
|
|
1919
|
-
} | {
|
|
1920
|
-
readonly status: "unavailable";
|
|
1921
|
-
};
|
|
1922
|
-
interface MatchTicket {
|
|
1923
|
-
readonly id: string;
|
|
1924
|
-
readonly status: MatchTicketStatus;
|
|
1925
|
-
readonly partySize: number;
|
|
1926
|
-
readonly queuedAt: number;
|
|
1927
|
-
readonly expiresAt: number;
|
|
1928
|
-
readonly outcome: Promise<MatchTicketOutcome>;
|
|
1929
|
-
cancel(): Promise<MatchTicketOutcome>;
|
|
2172
|
+
interface FriendChallengeRequest {
|
|
2173
|
+
readonly playerId: string;
|
|
2174
|
+
readonly template: string;
|
|
2175
|
+
readonly params?: Readonly<Record<string, string | number>>;
|
|
1930
2176
|
}
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
readonly
|
|
1934
|
-
readonly isPublic?: boolean;
|
|
1935
|
-
readonly settings?: unknown;
|
|
1936
|
-
readonly region?: string;
|
|
1937
|
-
readonly templateId?: string;
|
|
1938
|
-
readonly templateSlug?: string;
|
|
1939
|
-
readonly partyId?: string;
|
|
1940
|
-
readonly roomArgs?: RoomArgs;
|
|
1941
|
-
readonly signal?: AbortSignal;
|
|
2177
|
+
type FriendChallengeOutcomeKind = "accepted" | "cancelled" | "refused" | "unavailable";
|
|
2178
|
+
interface FriendChallengeOutcome {
|
|
2179
|
+
readonly outcome: FriendChallengeOutcomeKind;
|
|
1942
2180
|
}
|
|
1943
|
-
|
|
1944
|
-
|
|
1945
|
-
readonly
|
|
2181
|
+
type FriendChallengeErrorCode = "unknown_template" | "template_not_on_channel" | "param_invalid" | "param_undeclared" | "recipient_invalid" | (string & {});
|
|
2182
|
+
declare class FriendChallengeError extends GemApiError {
|
|
2183
|
+
readonly code?: FriendChallengeErrorCode;
|
|
2184
|
+
readonly param?: string;
|
|
2185
|
+
readonly channel?: string;
|
|
2186
|
+
readonly configVersion?: number;
|
|
2187
|
+
constructor(source: GemApiError, extra?: {
|
|
2188
|
+
readonly param?: string;
|
|
2189
|
+
readonly channel?: string;
|
|
2190
|
+
readonly configVersion?: number;
|
|
2191
|
+
});
|
|
1946
2192
|
}
|
|
1947
|
-
interface
|
|
1948
|
-
readonly
|
|
1949
|
-
readonly templateSlugs?: readonly string[];
|
|
1950
|
-
readonly templateId?: string;
|
|
1951
|
-
readonly region?: string;
|
|
1952
|
-
readonly name?: string;
|
|
2193
|
+
interface PlayInviteRequest {
|
|
2194
|
+
readonly params?: Readonly<Record<string, string>>;
|
|
1953
2195
|
}
|
|
1954
|
-
interface
|
|
1955
|
-
readonly
|
|
1956
|
-
readonly
|
|
1957
|
-
readonly
|
|
1958
|
-
readonly
|
|
2196
|
+
interface FriendsApiDependencies {
|
|
2197
|
+
readonly challenge?: (request: FriendChallengeRequest) => Promise<FriendChallengeOutcome>;
|
|
2198
|
+
readonly inviteToPlay?: (request?: PlayInviteRequest) => Promise<boolean>;
|
|
2199
|
+
readonly setInviteParams?: (params: Readonly<Record<string, string>> | null) => boolean;
|
|
2200
|
+
readonly launchedChallengeId?: string;
|
|
2201
|
+
}
|
|
2202
|
+
declare class FriendsApi {
|
|
2203
|
+
#private;
|
|
2204
|
+
constructor(api: GameApi$1, dependencies?: FriendsApiDependencies);
|
|
2205
|
+
list(options?: ListFriendsOptions): Promise<FriendsPage>;
|
|
2206
|
+
challenge(request: FriendChallengeRequest): Promise<FriendChallengeOutcome>;
|
|
2207
|
+
inviteToPlay(request?: PlayInviteRequest): Promise<boolean>;
|
|
2208
|
+
setInviteParams(params: Readonly<Record<string, string>> | null): boolean;
|
|
2209
|
+
inbox(options?: ListFriendChallengesOptions): Promise<FriendChallengesPage>;
|
|
2210
|
+
launchedChallenge(options?: {
|
|
2211
|
+
readonly signal?: AbortSignal;
|
|
2212
|
+
}): Promise<FriendChallenge | null>;
|
|
2213
|
+
markAnswered(id: string): Promise<void>;
|
|
2214
|
+
}
|
|
2215
|
+
type PlatformCurrencyAccess = "read" | "spend";
|
|
2216
|
+
interface PlatformCurrency {
|
|
2217
|
+
readonly slug: string;
|
|
2218
|
+
readonly currencyId: string;
|
|
2219
|
+
readonly balance: number;
|
|
2220
|
+
readonly access: PlatformCurrencyAccess;
|
|
2221
|
+
}
|
|
2222
|
+
interface PlatformCurrencyReadOptions {
|
|
1959
2223
|
readonly signal?: AbortSignal;
|
|
1960
2224
|
}
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
readonly
|
|
1965
|
-
|
|
1966
|
-
|
|
2225
|
+
declare class PlatformCurrenciesApi {
|
|
2226
|
+
#private;
|
|
2227
|
+
constructor(api: GameApi$1);
|
|
2228
|
+
get(options?: PlatformCurrencyReadOptions): Promise<readonly PlatformCurrency[]>;
|
|
2229
|
+
}
|
|
2230
|
+
type EarnAllowancePeriod = "day" | "window";
|
|
2231
|
+
interface EarnAllowance {
|
|
2232
|
+
readonly currencySlug: string;
|
|
2233
|
+
readonly currencyId: string;
|
|
2234
|
+
readonly limit: number;
|
|
2235
|
+
readonly earned: number;
|
|
2236
|
+
readonly remaining: number;
|
|
2237
|
+
readonly period: EarnAllowancePeriod;
|
|
2238
|
+
readonly periodDays: number;
|
|
2239
|
+
readonly resetsAt?: number;
|
|
2240
|
+
}
|
|
2241
|
+
interface EarnAllowanceReadOptions {
|
|
1967
2242
|
readonly signal?: AbortSignal;
|
|
1968
2243
|
}
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
} | {
|
|
1973
|
-
readonly status: "expired";
|
|
1974
|
-
readonly reason: string;
|
|
1975
|
-
} | {
|
|
1976
|
-
readonly status: "cancelled";
|
|
1977
|
-
readonly reason: string;
|
|
1978
|
-
} | {
|
|
1979
|
-
readonly status: "failed";
|
|
1980
|
-
readonly reason: string;
|
|
1981
|
-
} | {
|
|
1982
|
-
readonly status: "lost";
|
|
1983
|
-
};
|
|
1984
|
-
interface PartyTicket {
|
|
1985
|
-
readonly id: string;
|
|
1986
|
-
readonly status: PartyTicketStatus;
|
|
1987
|
-
readonly partySize: number;
|
|
1988
|
-
readonly queuedAt: number;
|
|
1989
|
-
readonly expiresAt: number;
|
|
1990
|
-
readonly outcome: Promise<PartyTicketOutcome>;
|
|
2244
|
+
interface EarnAllowanceSignal {
|
|
2245
|
+
on(listener: () => void): () => void;
|
|
2246
|
+
emit(): void;
|
|
1991
2247
|
}
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
|
|
1995
|
-
|
|
1996
|
-
readonly
|
|
1997
|
-
|
|
1998
|
-
readonly reason?: string;
|
|
1999
|
-
readonly roomId?: string;
|
|
2248
|
+
type EarnAllowanceEvent = "changed";
|
|
2249
|
+
declare class PlatformEarnAllowanceApi {
|
|
2250
|
+
#private;
|
|
2251
|
+
constructor(api: GameApi$1, signal?: EarnAllowanceSignal, log?: ((line: string) => void) | null);
|
|
2252
|
+
get(options?: EarnAllowanceReadOptions): Promise<readonly EarnAllowance[]>;
|
|
2253
|
+
on(event: EarnAllowanceEvent, listener: () => void): () => void;
|
|
2000
2254
|
}
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
joined: [
|
|
2006
|
-
Room
|
|
2007
|
-
];
|
|
2008
|
-
left: [
|
|
2009
|
-
];
|
|
2010
|
-
closed: [
|
|
2011
|
-
];
|
|
2012
|
-
updated: [
|
|
2013
|
-
Room
|
|
2014
|
-
];
|
|
2015
|
-
seated: [
|
|
2016
|
-
Room
|
|
2017
|
-
];
|
|
2018
|
-
partyQueued: [
|
|
2019
|
-
PartyTicket
|
|
2020
|
-
];
|
|
2021
|
-
listed: [
|
|
2022
|
-
RoomPage
|
|
2023
|
-
];
|
|
2024
|
-
mineListed: [
|
|
2025
|
-
readonly RoomSummary[]
|
|
2026
|
-
];
|
|
2027
|
-
memberJoined: [
|
|
2028
|
-
string
|
|
2029
|
-
];
|
|
2030
|
-
memberLeft: [
|
|
2031
|
-
string
|
|
2032
|
-
];
|
|
2033
|
-
kicked: [
|
|
2034
|
-
];
|
|
2035
|
-
readyChanged: [
|
|
2036
|
-
string,
|
|
2037
|
-
boolean
|
|
2038
|
-
];
|
|
2039
|
-
hostChanged: [
|
|
2040
|
-
string
|
|
2041
|
-
];
|
|
2042
|
-
matchStartWaiting: [
|
|
2043
|
-
StartMatchWaiting
|
|
2044
|
-
];
|
|
2045
|
-
matchAutoStartFailed: [
|
|
2046
|
-
MatchAutoStartFailed
|
|
2047
|
-
];
|
|
2048
|
-
matchAllocationStarted: [
|
|
2049
|
-
string
|
|
2050
|
-
];
|
|
2051
|
-
matchReady: [
|
|
2052
|
-
ReadyMatch
|
|
2053
|
-
];
|
|
2054
|
-
matchFailed: [
|
|
2055
|
-
string,
|
|
2056
|
-
string
|
|
2057
|
-
];
|
|
2058
|
-
matchEnded: [
|
|
2059
|
-
MatchEnded
|
|
2060
|
-
];
|
|
2061
|
-
matchSuspended: [
|
|
2062
|
-
MatchSuspended
|
|
2063
|
-
];
|
|
2064
|
-
matchReconnecting: [
|
|
2065
|
-
MatchReconnecting
|
|
2066
|
-
];
|
|
2067
|
-
matchReconnected: [
|
|
2068
|
-
MatchReconnected
|
|
2069
|
-
];
|
|
2070
|
-
versionUpdateAvailable: [
|
|
2071
|
-
ClientPlatform$1 | undefined
|
|
2072
|
-
];
|
|
2073
|
-
error: [
|
|
2074
|
-
RoomOperationError
|
|
2075
|
-
];
|
|
2255
|
+
declare class PlatformApi {
|
|
2256
|
+
readonly currencies: PlatformCurrenciesApi;
|
|
2257
|
+
readonly earnAllowance: PlatformEarnAllowanceApi;
|
|
2258
|
+
constructor(api: GameApi$1, earnAllowanceSignal?: EarnAllowanceSignal, log?: ((line: string) => void) | null);
|
|
2076
2259
|
}
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
readonly
|
|
2080
|
-
readonly
|
|
2260
|
+
interface ProfileShowcaseEntry$1 {
|
|
2261
|
+
readonly key: string;
|
|
2262
|
+
readonly visibility: string;
|
|
2263
|
+
readonly value: unknown;
|
|
2264
|
+
readonly updatedAt: number;
|
|
2081
2265
|
}
|
|
2082
|
-
interface
|
|
2083
|
-
readonly
|
|
2084
|
-
readonly
|
|
2085
|
-
readonly
|
|
2086
|
-
readonly version?: number;
|
|
2087
|
-
readonly reason?: string;
|
|
2088
|
-
readonly platform?: ClientPlatform$1;
|
|
2266
|
+
interface PlayerProfile extends PlayerIdentity {
|
|
2267
|
+
readonly playerId: string;
|
|
2268
|
+
readonly showcase: readonly ProfileShowcaseEntry$1[];
|
|
2269
|
+
readonly generatedAt: number;
|
|
2089
2270
|
}
|
|
2090
|
-
interface
|
|
2091
|
-
readonly clusterTargetId?: ClusterTargetLike;
|
|
2092
|
-
readonly retry?: StartMatchRetryOptions;
|
|
2271
|
+
interface ProfileCallOptions {
|
|
2093
2272
|
readonly signal?: AbortSignal;
|
|
2094
2273
|
}
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2274
|
+
declare class ProfilesApi {
|
|
2275
|
+
#private;
|
|
2276
|
+
constructor(api: GameApi$1);
|
|
2277
|
+
of(playerId: string, options?: ProfileCallOptions): Promise<PlayerProfile | null>;
|
|
2278
|
+
}
|
|
2279
|
+
interface FunctionInvokeOptions {
|
|
2098
2280
|
readonly signal?: AbortSignal;
|
|
2281
|
+
readonly cueId?: string;
|
|
2099
2282
|
}
|
|
2100
|
-
interface
|
|
2101
|
-
readonly
|
|
2102
|
-
readonly
|
|
2283
|
+
interface FunctionResult {
|
|
2284
|
+
readonly bytes: Uint8Array;
|
|
2285
|
+
readonly invocationId?: string;
|
|
2286
|
+
text(): string;
|
|
2287
|
+
json<T = unknown>(): T;
|
|
2103
2288
|
}
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
keepalive?: boolean;
|
|
2116
|
-
}): Promise<void>;
|
|
2117
|
-
leaveAll(signal?: AbortSignal): Promise<readonly string[]>;
|
|
2118
|
-
close(signal?: AbortSignal): Promise<void>;
|
|
2119
|
-
refresh(signal?: AbortSignal): Promise<Room | null>;
|
|
2120
|
-
setReady(isReady: boolean, signal?: AbortSignal): Promise<Room>;
|
|
2121
|
-
kick(playerId: string, signal?: AbortSignal): Promise<Room>;
|
|
2122
|
-
transferHost(playerId: string, signal?: AbortSignal): Promise<Room>;
|
|
2123
|
-
update(options: UpdateRoomOptions): Promise<Room>;
|
|
2124
|
-
startMatch(options?: StartMatchOptions): Promise<StartedMatch>;
|
|
2125
|
-
awaitMatch(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2126
|
-
pollMatchStatus(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2127
|
-
notifyMatchConnected(matchId: string): void;
|
|
2128
|
-
notifyMatchDisconnected(cause?: string): Promise<void>;
|
|
2129
|
-
reconnectToMatch(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2130
|
-
notifyLeavingMatch(options?: {
|
|
2131
|
-
keepalive?: boolean;
|
|
2132
|
-
}): Promise<void>;
|
|
2133
|
-
readonly gameId: string | null;
|
|
2134
|
-
readonly currentRoom: Room | null;
|
|
2135
|
-
readonly currentTicket: MatchTicket | null;
|
|
2136
|
-
readonly partyTicket: PartyTicket | null;
|
|
2137
|
-
readonly currentMatch: ReadyMatch | null;
|
|
2138
|
-
readonly matchConnectionState: MatchConnectionState;
|
|
2139
|
-
readonly matchSession: MatchSession;
|
|
2140
|
-
readonly isInRoom: boolean;
|
|
2141
|
-
readonly isHost: boolean;
|
|
2142
|
-
readonly members: readonly Room["members"][number][];
|
|
2143
|
-
readonly playWith: PlayWithOutcome | null;
|
|
2144
|
-
on<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): () => void;
|
|
2145
|
-
off<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): void;
|
|
2146
|
-
once<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): () => void;
|
|
2147
|
-
handleRoomEvent(event: RelayedRoomEvent): void;
|
|
2148
|
-
handleSeated(roomId: string): void;
|
|
2149
|
-
handleAutoStartFailed(roomId: string, code: string): void;
|
|
2150
|
-
handleTicketEvent(event: RelayedTicketEvent): void;
|
|
2151
|
-
reconcileSeats(): Promise<void>;
|
|
2152
|
-
reconcile(hint?: MatchEndHint): Promise<void>;
|
|
2153
|
-
startPolling(intervalMs?: number): void;
|
|
2154
|
-
stopPolling(): void;
|
|
2155
|
-
settled(): Promise<void>;
|
|
2156
|
-
dispose(): void;
|
|
2289
|
+
type FunctionFailure = "trap" | "memory_exceeded" | "cpu_budget_exceeded" | "host_call_limit" | "output_too_large" | "argument_too_large";
|
|
2290
|
+
declare class GemFunctionError extends GemApiError {
|
|
2291
|
+
readonly invocationId?: string;
|
|
2292
|
+
readonly functionMessage?: string;
|
|
2293
|
+
readonly failure?: FunctionFailure | (string & {});
|
|
2294
|
+
constructor(source: GemApiError, extra: {
|
|
2295
|
+
readonly invocationId?: string;
|
|
2296
|
+
readonly functionMessage?: string;
|
|
2297
|
+
readonly failure?: string;
|
|
2298
|
+
});
|
|
2299
|
+
get retryable(): boolean;
|
|
2157
2300
|
}
|
|
2158
|
-
declare
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
readonly generation: number;
|
|
2166
|
-
readonly apiBaseUrl?: string;
|
|
2167
|
-
readonly playerId: string;
|
|
2168
|
-
readonly gameId: string;
|
|
2169
|
-
readonly channel: "dev" | "test" | "release";
|
|
2170
|
-
readonly gameVersion?: string;
|
|
2171
|
-
readonly expiresAt: number;
|
|
2172
|
-
readonly chainEndsAt: number;
|
|
2173
|
-
readonly allowDevTools?: boolean;
|
|
2301
|
+
declare class FunctionsApi {
|
|
2302
|
+
#private;
|
|
2303
|
+
constructor(invoke: (body: Uint8Array, options?: {
|
|
2304
|
+
signal?: AbortSignal;
|
|
2305
|
+
cue_id?: string;
|
|
2306
|
+
}) => Promise<BytesResponse>);
|
|
2307
|
+
invoke(input: unknown, options?: FunctionInvokeOptions): Promise<FunctionResult>;
|
|
2174
2308
|
}
|
|
2175
|
-
|
|
2176
|
-
|
|
2177
|
-
|
|
2178
|
-
|
|
2179
|
-
|
|
2180
|
-
|
|
2181
|
-
readonly
|
|
2182
|
-
readonly
|
|
2309
|
+
type SessionEndReason = "grant_expiring" | "session_ended" | "navigating" | "kill_switch" | "pagehide";
|
|
2310
|
+
type MatchTransport = "dedicated" | "p2p";
|
|
2311
|
+
type PlatformEventName = "gem_session_start" | "gem_session_end" | "gem_pause" | "gem_resume" | "gem_boot_ready" | "gem_match_started" | "gem_match_ended" | "gem_auth_lost" | "gem_graphics_context_lost";
|
|
2312
|
+
declare const PLATFORM_EVENTS: readonly PlatformEventName[];
|
|
2313
|
+
type AnalyticsValue = string | number;
|
|
2314
|
+
interface AnalyticsRejection$1 {
|
|
2315
|
+
readonly index: number;
|
|
2316
|
+
readonly code: string;
|
|
2183
2317
|
}
|
|
2184
|
-
interface
|
|
2185
|
-
readonly
|
|
2186
|
-
readonly
|
|
2187
|
-
readonly
|
|
2318
|
+
interface AnalyticsFlushResult {
|
|
2319
|
+
readonly accepted: number;
|
|
2320
|
+
readonly rejected: readonly AnalyticsRejection$1[];
|
|
2321
|
+
readonly dropped: number;
|
|
2322
|
+
readonly duplicate: boolean;
|
|
2188
2323
|
}
|
|
2189
|
-
interface
|
|
2190
|
-
readonly
|
|
2191
|
-
readonly
|
|
2192
|
-
readonly reducedMotion: boolean;
|
|
2193
|
-
readonly muted: boolean;
|
|
2194
|
-
readonly showFrameStats?: boolean;
|
|
2195
|
-
readonly music?: boolean;
|
|
2196
|
-
readonly sounds?: boolean;
|
|
2197
|
-
readonly locale: string;
|
|
2198
|
-
readonly recommended?: {
|
|
2199
|
-
volume: number;
|
|
2200
|
-
batterySaver: boolean;
|
|
2201
|
-
keyboardLayout: "wasd" | "arrows";
|
|
2202
|
-
gamepadConfirm: "south" | "east";
|
|
2203
|
-
vibration: boolean;
|
|
2204
|
-
lookSensitivity?: number;
|
|
2205
|
-
gamepadLookSensitivity?: number;
|
|
2206
|
-
invertLookY?: boolean;
|
|
2207
|
-
touchMovement?: string;
|
|
2208
|
-
graphicsQuality?: string;
|
|
2209
|
-
graphicsQualityAuto?: boolean;
|
|
2210
|
-
colorHelp?: boolean;
|
|
2211
|
-
textScale?: number;
|
|
2212
|
-
};
|
|
2324
|
+
interface AnalyticsFlushOptions {
|
|
2325
|
+
readonly keepalive?: boolean;
|
|
2326
|
+
readonly signal?: AbortSignal;
|
|
2213
2327
|
}
|
|
2214
|
-
interface
|
|
2215
|
-
readonly
|
|
2216
|
-
readonly
|
|
2217
|
-
readonly
|
|
2218
|
-
experimentId: string;
|
|
2219
|
-
variantKey: string;
|
|
2220
|
-
}[];
|
|
2328
|
+
interface AnalyticsOptions {
|
|
2329
|
+
readonly enabled?: boolean;
|
|
2330
|
+
readonly flushIntervalMs?: number;
|
|
2331
|
+
readonly maxQueue?: number;
|
|
2221
2332
|
}
|
|
2222
|
-
interface
|
|
2223
|
-
readonly
|
|
2224
|
-
readonly
|
|
2333
|
+
interface AnalyticsApiOptions {
|
|
2334
|
+
readonly environment?: Readonly<Record<string, string>> | (() => Readonly<Record<string, string>>);
|
|
2335
|
+
readonly client: () => GemClient;
|
|
2336
|
+
readonly clock: Clock;
|
|
2337
|
+
readonly gameId: () => string | null;
|
|
2338
|
+
readonly playerId: () => string | null;
|
|
2339
|
+
readonly awaitPlayerId?: () => Promise<string>;
|
|
2340
|
+
readonly declarations?: () => Promise<readonly {
|
|
2341
|
+
readonly id: string;
|
|
2342
|
+
readonly dimensions?: Readonly<Record<string, unknown>> | null;
|
|
2343
|
+
}[] | null | undefined>;
|
|
2344
|
+
readonly options?: AnalyticsOptions;
|
|
2345
|
+
readonly log?: ((message: string) => void) | null;
|
|
2225
2346
|
}
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
|
|
2244
|
-
|
|
2245
|
-
};
|
|
2246
|
-
}[];
|
|
2347
|
+
declare class AnalyticsApi {
|
|
2348
|
+
#private;
|
|
2349
|
+
constructor(options: AnalyticsApiOptions);
|
|
2350
|
+
track(name: string, props?: Readonly<Record<string, AnalyticsValue>>): void;
|
|
2351
|
+
setContext(props: Readonly<Record<string, AnalyticsValue>>): void;
|
|
2352
|
+
experiment(key: string, count: number): Promise<number>;
|
|
2353
|
+
experiment<T extends string>(key: string, options: readonly T[]): Promise<T>;
|
|
2354
|
+
get environment(): Readonly<Record<string, string>>;
|
|
2355
|
+
flush(options?: AnalyticsFlushOptions): Promise<AnalyticsFlushResult>;
|
|
2356
|
+
trackPlatform(name: PlatformEventName, props?: Readonly<Record<string, AnalyticsValue>>): void;
|
|
2357
|
+
hold(): void;
|
|
2358
|
+
release(): void;
|
|
2359
|
+
get held(): boolean;
|
|
2360
|
+
startSession(): void;
|
|
2361
|
+
endSession(reason: SessionEndReason): void;
|
|
2362
|
+
setPaused(paused: boolean): void;
|
|
2363
|
+
setHidden(hidden: boolean): void;
|
|
2364
|
+
dispose(): void;
|
|
2365
|
+
get pending(): number;
|
|
2247
2366
|
}
|
|
2248
|
-
interface
|
|
2249
|
-
readonly
|
|
2250
|
-
readonly
|
|
2251
|
-
readonly settings?: unknown;
|
|
2367
|
+
interface BootMark {
|
|
2368
|
+
readonly name: string;
|
|
2369
|
+
readonly at: number;
|
|
2252
2370
|
}
|
|
2253
|
-
interface
|
|
2254
|
-
|
|
2255
|
-
|
|
2256
|
-
readonly
|
|
2257
|
-
readonly graceMs: number;
|
|
2371
|
+
interface BootTimeline {
|
|
2372
|
+
mark(name: string, at?: number): boolean;
|
|
2373
|
+
timeline(): string;
|
|
2374
|
+
readonly marks: readonly BootMark[];
|
|
2258
2375
|
}
|
|
2259
|
-
interface
|
|
2260
|
-
readonly
|
|
2261
|
-
readonly type: "gem.roomEvent";
|
|
2262
|
-
readonly event: "updated" | "match_started" | "match_ready" | "match_failed" | "version_stale";
|
|
2263
|
-
readonly roomId: string;
|
|
2264
|
-
readonly matchId?: string;
|
|
2265
|
-
readonly version?: number;
|
|
2266
|
-
readonly reason?: string;
|
|
2267
|
-
readonly platform?: "universal" | "mobile";
|
|
2376
|
+
interface BootTimelineOptions {
|
|
2377
|
+
readonly now?: () => number;
|
|
2268
2378
|
}
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2379
|
+
declare function markOnResolve<T>(boot: BootTimeline, name: string, work: Promise<T>, log?: ((message: string) => void) | null): Promise<T>;
|
|
2380
|
+
declare function reportOnResolve(boot: BootTimeline, log?: ((message: string) => void) | null): <T>(work: Promise<T>) => Promise<T>;
|
|
2381
|
+
declare function createBootTimeline(options?: BootTimelineOptions): BootTimeline;
|
|
2382
|
+
type GemGraphicsRoute = "webgpu" | "webgl";
|
|
2383
|
+
interface GemPreferredRoute {
|
|
2384
|
+
readonly route: GemGraphicsRoute;
|
|
2385
|
+
readonly listed: boolean;
|
|
2274
2386
|
}
|
|
2275
|
-
interface
|
|
2276
|
-
readonly
|
|
2277
|
-
readonly
|
|
2278
|
-
readonly
|
|
2387
|
+
interface GemGraphicsRouteEntry {
|
|
2388
|
+
readonly gpu: string;
|
|
2389
|
+
readonly route?: string;
|
|
2390
|
+
readonly host?: string;
|
|
2279
2391
|
}
|
|
2280
|
-
interface
|
|
2281
|
-
readonly
|
|
2282
|
-
readonly type: "gem.autoStartFailedEvent";
|
|
2283
|
-
readonly roomId: string;
|
|
2284
|
-
readonly code: string;
|
|
2392
|
+
interface PreferredRouteOptions {
|
|
2393
|
+
readonly timeoutMs?: number;
|
|
2285
2394
|
}
|
|
2286
|
-
interface
|
|
2287
|
-
|
|
2288
|
-
readonly type: "gem.ticketEvent";
|
|
2289
|
-
readonly event: "queued" | "matched" | "expired" | "cancelled" | "failed";
|
|
2290
|
-
readonly ticketId: string;
|
|
2291
|
-
readonly partySize?: number;
|
|
2292
|
-
readonly queuedAt?: number;
|
|
2293
|
-
readonly expiresAt?: number;
|
|
2294
|
-
readonly reason?: string;
|
|
2295
|
-
readonly roomId?: string;
|
|
2395
|
+
interface GraphicsApi {
|
|
2396
|
+
preferredRoute(options?: PreferredRouteOptions): Promise<GemPreferredRoute>;
|
|
2296
2397
|
}
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
readonly
|
|
2302
|
-
readonly data: unknown;
|
|
2398
|
+
type DevToolsOpener = "game" | "platform";
|
|
2399
|
+
interface GemDevTools {
|
|
2400
|
+
open(): Promise<boolean>;
|
|
2401
|
+
close(): void;
|
|
2402
|
+
readonly isOpen: boolean;
|
|
2303
2403
|
}
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2404
|
+
type ClusterTargetLike = string | null | undefined;
|
|
2405
|
+
declare const CLIENT_PLATFORMS: readonly [
|
|
2406
|
+
"universal",
|
|
2407
|
+
"mobile",
|
|
2408
|
+
"web"
|
|
2409
|
+
];
|
|
2410
|
+
type ClientPlatform$1 = (typeof CLIENT_PLATFORMS)[number];
|
|
2411
|
+
interface ClientVersion {
|
|
2412
|
+
readonly platform?: ClientPlatform$1;
|
|
2413
|
+
readonly gameVersion: string;
|
|
2414
|
+
readonly engineVersion?: string;
|
|
2312
2415
|
}
|
|
2313
|
-
interface
|
|
2314
|
-
readonly
|
|
2315
|
-
readonly type: "gem.dedicatedEvent";
|
|
2316
|
-
readonly event: "answer" | "error" | "matchEnded";
|
|
2416
|
+
interface ReadyMatch {
|
|
2417
|
+
readonly status: "ready";
|
|
2317
2418
|
readonly matchId: string;
|
|
2318
|
-
readonly
|
|
2319
|
-
readonly
|
|
2320
|
-
readonly
|
|
2321
|
-
readonly
|
|
2322
|
-
readonly
|
|
2419
|
+
readonly protocol: string;
|
|
2420
|
+
readonly joinCredential?: string;
|
|
2421
|
+
readonly credentialExpiresAt?: number;
|
|
2422
|
+
readonly host?: string;
|
|
2423
|
+
readonly port?: number;
|
|
2323
2424
|
}
|
|
2324
|
-
interface
|
|
2325
|
-
readonly
|
|
2326
|
-
readonly
|
|
2327
|
-
readonly
|
|
2328
|
-
readonly
|
|
2425
|
+
interface StartMatchWaiting {
|
|
2426
|
+
readonly attempt: number;
|
|
2427
|
+
readonly elapsedMs: number;
|
|
2428
|
+
readonly budgetMs: number;
|
|
2429
|
+
readonly nextAttemptInMs: number;
|
|
2430
|
+
readonly status: number;
|
|
2431
|
+
readonly message: string;
|
|
2329
2432
|
}
|
|
2330
|
-
interface
|
|
2331
|
-
readonly
|
|
2332
|
-
readonly
|
|
2333
|
-
readonly
|
|
2334
|
-
readonly
|
|
2433
|
+
interface StartMatchRetryOptions {
|
|
2434
|
+
readonly budgetMs?: number;
|
|
2435
|
+
readonly initialDelayMs?: number;
|
|
2436
|
+
readonly maxDelayMs?: number;
|
|
2437
|
+
readonly onWaiting?: (waiting: StartMatchWaiting) => void;
|
|
2335
2438
|
}
|
|
2336
|
-
interface
|
|
2337
|
-
readonly
|
|
2338
|
-
readonly
|
|
2339
|
-
readonly entries: {
|
|
2340
|
-
gpu: string;
|
|
2341
|
-
route?: string;
|
|
2342
|
-
host?: string;
|
|
2343
|
-
}[];
|
|
2439
|
+
interface ClusterTarget {
|
|
2440
|
+
readonly id: string;
|
|
2441
|
+
readonly pressure: string;
|
|
2344
2442
|
}
|
|
2345
|
-
|
|
2346
|
-
|
|
2347
|
-
readonly
|
|
2348
|
-
readonly reason: "not_wired" | "no_source" | "unsupported" | "unreadable" | "tainted" | "too_large" | "busy" | "declined" | "failed";
|
|
2443
|
+
type DedicatedServerFailure = "timeout" | "aborted" | "allocation_failed" | "no_server_ready" | "start_rate_limited" | "p2p_unavailable" | "unsupported_protocol" | "credential_expired" | "credential_reused" | "join_rate_limited" | "signaling_unavailable" | "signaling_failed" | "offer_refused" | "invalid_sdp" | "media_refused" | "connection_failed" | "join_refused" | "match_ended" | "misconfigured";
|
|
2444
|
+
declare class DedicatedServerError extends Error {
|
|
2445
|
+
readonly reason: DedicatedServerFailure;
|
|
2349
2446
|
readonly retryable: boolean;
|
|
2447
|
+
readonly platformCode: string | undefined;
|
|
2448
|
+
constructor(reason: DedicatedServerFailure, message: string, options?: {
|
|
2449
|
+
cause?: unknown;
|
|
2450
|
+
platformCode?: string;
|
|
2451
|
+
});
|
|
2350
2452
|
}
|
|
2351
|
-
|
|
2352
|
-
|
|
2353
|
-
readonly type: "gem.dedicatedOffer";
|
|
2453
|
+
type SignalingIntent = "initial" | "ice_restart" | "full_reconnect";
|
|
2454
|
+
interface OfferRequest {
|
|
2354
2455
|
readonly matchId: string;
|
|
2355
2456
|
readonly sdp: string;
|
|
2356
|
-
readonly intent:
|
|
2457
|
+
readonly intent: SignalingIntent;
|
|
2357
2458
|
}
|
|
2358
|
-
interface
|
|
2359
|
-
readonly
|
|
2360
|
-
readonly type: "gem.localServer";
|
|
2361
|
-
readonly requestId: string;
|
|
2362
|
-
readonly serverId?: string;
|
|
2459
|
+
interface SignalingAnswer {
|
|
2460
|
+
readonly sdp: string;
|
|
2363
2461
|
}
|
|
2364
|
-
interface
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
readonly requestId: string;
|
|
2368
|
-
readonly retryable: boolean;
|
|
2369
|
-
readonly reason: "refused" | "unavailable";
|
|
2462
|
+
interface SignalingChannel {
|
|
2463
|
+
exchange(request: OfferRequest, signal?: AbortSignal): Promise<SignalingAnswer>;
|
|
2464
|
+
close(): void;
|
|
2370
2465
|
}
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
readonly type:
|
|
2374
|
-
readonly
|
|
2375
|
-
readonly id?: string;
|
|
2466
|
+
type SdpType$1 = "offer" | "answer" | "pranswer" | "rollback";
|
|
2467
|
+
interface SessionDescriptionLike$1 {
|
|
2468
|
+
readonly type: SdpType$1;
|
|
2469
|
+
readonly sdp?: string;
|
|
2376
2470
|
}
|
|
2377
|
-
interface
|
|
2378
|
-
readonly
|
|
2379
|
-
readonly
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2471
|
+
interface DataChannelInitLike$1 {
|
|
2472
|
+
readonly ordered?: boolean;
|
|
2473
|
+
readonly maxRetransmits?: number;
|
|
2474
|
+
}
|
|
2475
|
+
interface EventTargetLike$1 {
|
|
2476
|
+
addEventListener(type: string, listener: (event: unknown) => void): void;
|
|
2477
|
+
removeEventListener(type: string, listener: (event: unknown) => void): void;
|
|
2478
|
+
}
|
|
2479
|
+
interface DataChannelLike$1 extends EventTargetLike$1 {
|
|
2480
|
+
readonly readyState: string;
|
|
2481
|
+
send(data: string | Uint8Array): void;
|
|
2482
|
+
close(): void;
|
|
2483
|
+
}
|
|
2484
|
+
interface PeerConnectionLike$1 extends EventTargetLike$1 {
|
|
2485
|
+
readonly localDescription: SessionDescriptionLike$1 | null;
|
|
2486
|
+
readonly iceGatheringState: string;
|
|
2487
|
+
createDataChannel(label: string, init?: DataChannelInitLike$1): DataChannelLike$1;
|
|
2488
|
+
createOffer(): Promise<SessionDescriptionLike$1>;
|
|
2489
|
+
setLocalDescription(description: SessionDescriptionLike$1): Promise<void>;
|
|
2490
|
+
setRemoteDescription(description: SessionDescriptionLike$1): Promise<void>;
|
|
2491
|
+
close(): void;
|
|
2492
|
+
}
|
|
2493
|
+
interface JoinWelcome {
|
|
2494
|
+
readonly playerId?: string;
|
|
2495
|
+
readonly matchId?: string;
|
|
2496
|
+
readonly heartbeatIntervalMs?: number;
|
|
2497
|
+
}
|
|
2498
|
+
interface JoinExchange {
|
|
2499
|
+
readonly welcome: JoinWelcome;
|
|
2500
|
+
detach(): void;
|
|
2501
|
+
}
|
|
2502
|
+
interface PresentCredentialOptions {
|
|
2503
|
+
readonly channel: DataChannelLike$1;
|
|
2504
|
+
readonly credential: string;
|
|
2505
|
+
readonly credentialExpiresAt: number;
|
|
2506
|
+
readonly clock: Clock;
|
|
2507
|
+
readonly ceilingMs?: number;
|
|
2508
|
+
readonly wire?: number;
|
|
2509
|
+
readonly heartbeat?: boolean;
|
|
2510
|
+
readonly onMessage?: (data: unknown) => void;
|
|
2511
|
+
readonly signal?: AbortSignal;
|
|
2512
|
+
}
|
|
2513
|
+
declare function presentJoinCredential(options: PresentCredentialOptions): Promise<JoinExchange>;
|
|
2514
|
+
type TransportKind = "webtransport" | "webrtc" | "websocket";
|
|
2515
|
+
declare const UNRELIABLE_CHANNEL_LABEL = "gem-uu";
|
|
2516
|
+
interface SendOptions$1 {
|
|
2517
|
+
readonly reliable?: boolean;
|
|
2518
|
+
readonly ordered?: boolean;
|
|
2519
|
+
}
|
|
2520
|
+
interface MessageMeta {
|
|
2521
|
+
readonly reliable: boolean;
|
|
2522
|
+
readonly ordered: boolean;
|
|
2523
|
+
}
|
|
2524
|
+
interface GameServerLink {
|
|
2525
|
+
readonly transport: TransportKind;
|
|
2526
|
+
send(data: Uint8Array | string, options?: SendOptions$1): void;
|
|
2527
|
+
onMessage(handler: (data: Uint8Array | string, meta: MessageMeta) => void): void;
|
|
2528
|
+
onClose(handler: (reason?: string) => void): void;
|
|
2529
|
+
close(): void;
|
|
2395
2530
|
}
|
|
2396
|
-
interface
|
|
2397
|
-
readonly
|
|
2398
|
-
readonly
|
|
2399
|
-
readonly
|
|
2400
|
-
readonly
|
|
2531
|
+
interface TransportAdvert {
|
|
2532
|
+
readonly v: number;
|
|
2533
|
+
readonly host: string;
|
|
2534
|
+
readonly port: number;
|
|
2535
|
+
readonly match_id: string;
|
|
2536
|
+
readonly webrtc?: boolean;
|
|
2537
|
+
readonly webtransport?: {
|
|
2538
|
+
readonly url: string;
|
|
2539
|
+
readonly cert_sha256_b64: string;
|
|
2540
|
+
readonly expires_at?: number;
|
|
2541
|
+
readonly named_url?: string;
|
|
2542
|
+
};
|
|
2543
|
+
readonly websocket?: {
|
|
2544
|
+
readonly url: string;
|
|
2545
|
+
readonly tls?: boolean;
|
|
2546
|
+
};
|
|
2401
2547
|
}
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2407
|
-
|
|
2408
|
-
|
|
2548
|
+
declare function readTemplateTransports(value: unknown): readonly TransportKind[] | null;
|
|
2549
|
+
declare function readTransportAdvert(settings: unknown, forMatch?: string): TransportAdvert | null;
|
|
2550
|
+
declare function webTransportAvailable(): boolean;
|
|
2551
|
+
type RoomArgScalar = string | number | boolean;
|
|
2552
|
+
type RoomArgValue$1 = RoomArgScalar | readonly RoomArgScalar[];
|
|
2553
|
+
type RoomArgs = Readonly<Record<string, RoomArgValue$1>>;
|
|
2554
|
+
type RoomArgType$1 = "string" | "int" | "float" | "bool" | (string & {});
|
|
2555
|
+
interface RoomArgEntry {
|
|
2556
|
+
readonly name: string;
|
|
2557
|
+
readonly type: RoomArgType$1;
|
|
2558
|
+
readonly list: boolean;
|
|
2559
|
+
readonly required: boolean;
|
|
2560
|
+
readonly mutable: boolean;
|
|
2561
|
+
readonly fixed?: RoomArgValue$1;
|
|
2562
|
+
readonly default?: RoomArgValue$1;
|
|
2563
|
+
readonly description?: string;
|
|
2564
|
+
readonly allowed?: readonly RoomArgScalar[];
|
|
2565
|
+
readonly min?: number;
|
|
2566
|
+
readonly max?: number;
|
|
2567
|
+
readonly minItems?: number;
|
|
2568
|
+
readonly maxItems?: number;
|
|
2569
|
+
readonly maxLength?: number;
|
|
2409
2570
|
}
|
|
2410
|
-
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2571
|
+
type RoomStatus = "open" | "in_game" | "closed" | (string & {});
|
|
2572
|
+
type PlayWithOutcome = "joined" | "unavailable";
|
|
2573
|
+
type MatchConnectionState = "disconnected" | "connecting" | "connected" | "suspended";
|
|
2574
|
+
type MatchSessionPhase = "none" | "starting" | "ready" | "connected" | "suspended" | "ended" | (string & {});
|
|
2575
|
+
interface MatchSession {
|
|
2576
|
+
readonly phase: MatchSessionPhase;
|
|
2577
|
+
readonly matchId?: string;
|
|
2415
2578
|
readonly reason?: string;
|
|
2416
|
-
readonly
|
|
2579
|
+
readonly roomReopened?: boolean;
|
|
2417
2580
|
}
|
|
2418
|
-
interface
|
|
2419
|
-
readonly
|
|
2420
|
-
readonly
|
|
2421
|
-
readonly
|
|
2422
|
-
readonly targetId: string;
|
|
2423
|
-
readonly catalogId?: string;
|
|
2424
|
-
readonly quantity: number;
|
|
2425
|
-
readonly purchaseId?: string;
|
|
2581
|
+
interface MatchEnded {
|
|
2582
|
+
readonly matchId: string;
|
|
2583
|
+
readonly reason: string;
|
|
2584
|
+
readonly roomReopened: boolean;
|
|
2426
2585
|
}
|
|
2427
|
-
interface
|
|
2428
|
-
readonly
|
|
2429
|
-
readonly
|
|
2430
|
-
readonly requestId: string;
|
|
2431
|
-
readonly outcome: "stored" | "too_large" | "unavailable";
|
|
2586
|
+
interface MatchSuspended {
|
|
2587
|
+
readonly matchId: string;
|
|
2588
|
+
readonly cause: string;
|
|
2432
2589
|
}
|
|
2433
|
-
interface
|
|
2434
|
-
readonly
|
|
2435
|
-
readonly
|
|
2436
|
-
readonly
|
|
2437
|
-
readonly
|
|
2590
|
+
interface MatchReconnecting {
|
|
2591
|
+
readonly matchId: string;
|
|
2592
|
+
readonly attempt: number;
|
|
2593
|
+
readonly attempts: number;
|
|
2594
|
+
readonly remainingMs: number;
|
|
2438
2595
|
}
|
|
2439
|
-
interface
|
|
2440
|
-
readonly
|
|
2441
|
-
readonly
|
|
2442
|
-
readonly requestId: string;
|
|
2443
|
-
readonly shown: boolean;
|
|
2596
|
+
interface MatchReconnected {
|
|
2597
|
+
readonly matchId: string;
|
|
2598
|
+
readonly attempt: number;
|
|
2444
2599
|
}
|
|
2445
|
-
interface
|
|
2446
|
-
readonly
|
|
2447
|
-
readonly
|
|
2448
|
-
readonly
|
|
2449
|
-
readonly outcome: "signed_in" | "declined" | "unavailable";
|
|
2600
|
+
interface AutoReconnectOptions {
|
|
2601
|
+
readonly budgetMs?: number;
|
|
2602
|
+
readonly attempts?: number;
|
|
2603
|
+
readonly maxDelayMs?: number;
|
|
2450
2604
|
}
|
|
2451
|
-
interface
|
|
2452
|
-
readonly
|
|
2453
|
-
readonly
|
|
2454
|
-
readonly
|
|
2455
|
-
readonly
|
|
2456
|
-
readonly
|
|
2457
|
-
readonly
|
|
2458
|
-
readonly channel?: string;
|
|
2459
|
-
readonly configVersion?: number;
|
|
2460
|
-
readonly retryAfterMs?: number;
|
|
2461
|
-
readonly detail?: string;
|
|
2605
|
+
interface RoomMember extends PlayerIdentity {
|
|
2606
|
+
readonly playerId: string;
|
|
2607
|
+
readonly isReady: boolean;
|
|
2608
|
+
readonly role: string;
|
|
2609
|
+
readonly joinedAt: number;
|
|
2610
|
+
readonly groupId?: string;
|
|
2611
|
+
readonly platform?: string;
|
|
2462
2612
|
}
|
|
2463
|
-
interface
|
|
2464
|
-
readonly
|
|
2465
|
-
readonly
|
|
2466
|
-
readonly
|
|
2467
|
-
readonly
|
|
2468
|
-
|
|
2469
|
-
|
|
2470
|
-
|
|
2613
|
+
interface Room {
|
|
2614
|
+
readonly id: string;
|
|
2615
|
+
readonly gameId: string;
|
|
2616
|
+
readonly name: string;
|
|
2617
|
+
readonly status: RoomStatus;
|
|
2618
|
+
readonly hostPlayerId: string;
|
|
2619
|
+
readonly maxPlayers: number;
|
|
2620
|
+
readonly memberCount: number;
|
|
2621
|
+
readonly members: readonly RoomMember[];
|
|
2622
|
+
readonly isPublic: boolean;
|
|
2623
|
+
readonly joinCode?: string;
|
|
2624
|
+
readonly settings?: unknown;
|
|
2625
|
+
readonly roomArgs?: RoomArgs;
|
|
2626
|
+
readonly roomArgsTemplate?: readonly RoomArgEntry[];
|
|
2627
|
+
readonly gameChannel: string;
|
|
2628
|
+
readonly region?: string;
|
|
2629
|
+
readonly clusterTargetId?: string;
|
|
2630
|
+
readonly selfHosted: boolean;
|
|
2631
|
+
readonly matchId?: string;
|
|
2632
|
+
readonly version: number;
|
|
2633
|
+
readonly templateId?: string;
|
|
2634
|
+
readonly templateSlug?: string;
|
|
2635
|
+
readonly roomType: string;
|
|
2636
|
+
readonly transports?: readonly TransportKind[];
|
|
2637
|
+
readonly createdAt: number;
|
|
2638
|
+
readonly updatedAt: number;
|
|
2639
|
+
readonly startedAt?: number;
|
|
2471
2640
|
}
|
|
2472
|
-
interface
|
|
2473
|
-
readonly
|
|
2474
|
-
readonly
|
|
2475
|
-
readonly
|
|
2476
|
-
readonly shown: boolean;
|
|
2641
|
+
interface MatchAutoStartFailed {
|
|
2642
|
+
readonly roomId: string;
|
|
2643
|
+
readonly code: string;
|
|
2644
|
+
readonly handled: boolean;
|
|
2477
2645
|
}
|
|
2478
|
-
interface
|
|
2479
|
-
readonly
|
|
2480
|
-
readonly
|
|
2481
|
-
readonly
|
|
2482
|
-
|
|
2483
|
-
|
|
2484
|
-
|
|
2646
|
+
interface RoomSummary {
|
|
2647
|
+
readonly id: string;
|
|
2648
|
+
readonly gameId: string;
|
|
2649
|
+
readonly name: string;
|
|
2650
|
+
readonly status: RoomStatus;
|
|
2651
|
+
readonly hostPlayerId: string;
|
|
2652
|
+
readonly maxPlayers: number;
|
|
2653
|
+
readonly memberCount: number;
|
|
2654
|
+
readonly isPublic: boolean;
|
|
2655
|
+
readonly gameChannel: string;
|
|
2656
|
+
readonly roomType: string;
|
|
2657
|
+
readonly createdAt: number;
|
|
2485
2658
|
}
|
|
2486
|
-
interface
|
|
2487
|
-
readonly
|
|
2488
|
-
readonly
|
|
2489
|
-
readonly requestId: string;
|
|
2659
|
+
interface RoomPage {
|
|
2660
|
+
readonly rooms: readonly RoomSummary[];
|
|
2661
|
+
readonly nextCursor?: string;
|
|
2490
2662
|
}
|
|
2491
|
-
interface
|
|
2492
|
-
readonly
|
|
2493
|
-
readonly
|
|
2494
|
-
readonly
|
|
2495
|
-
readonly
|
|
2496
|
-
readonly
|
|
2497
|
-
readonly arcade?: {
|
|
2498
|
-
store: "app_store" | "google_play";
|
|
2499
|
-
};
|
|
2500
|
-
readonly game?: {
|
|
2501
|
-
store: "app_store" | "google_play";
|
|
2502
|
-
};
|
|
2663
|
+
interface RoomOperationError {
|
|
2664
|
+
readonly operation: string;
|
|
2665
|
+
readonly code: number;
|
|
2666
|
+
readonly reason: string;
|
|
2667
|
+
readonly message: string;
|
|
2668
|
+
readonly retryable: boolean;
|
|
2503
2669
|
}
|
|
2504
|
-
interface
|
|
2505
|
-
readonly
|
|
2506
|
-
readonly
|
|
2507
|
-
readonly
|
|
2508
|
-
|
|
2670
|
+
interface QueueForMatchOptions {
|
|
2671
|
+
readonly templateSlugs: readonly string[];
|
|
2672
|
+
readonly partyId?: string;
|
|
2673
|
+
readonly signal?: AbortSignal;
|
|
2674
|
+
}
|
|
2675
|
+
type MatchTicketStatus = "queued" | "matched" | "expired" | "cancelled" | "failed" | "lost" | "unavailable";
|
|
2676
|
+
type MatchTicketOutcome = {
|
|
2677
|
+
readonly status: "matched";
|
|
2678
|
+
readonly room: Room;
|
|
2679
|
+
} | {
|
|
2680
|
+
readonly status: "expired";
|
|
2681
|
+
readonly reason: string;
|
|
2682
|
+
} | {
|
|
2683
|
+
readonly status: "cancelled";
|
|
2684
|
+
readonly reason: string;
|
|
2685
|
+
} | {
|
|
2686
|
+
readonly status: "failed";
|
|
2687
|
+
readonly reason: string;
|
|
2688
|
+
} | {
|
|
2689
|
+
readonly status: "lost";
|
|
2690
|
+
} | {
|
|
2691
|
+
readonly status: "unavailable";
|
|
2692
|
+
};
|
|
2693
|
+
interface MatchTicket {
|
|
2694
|
+
readonly id: string;
|
|
2695
|
+
readonly status: MatchTicketStatus;
|
|
2696
|
+
readonly partySize: number;
|
|
2697
|
+
readonly queuedAt: number;
|
|
2698
|
+
readonly expiresAt: number;
|
|
2699
|
+
readonly outcome: Promise<MatchTicketOutcome>;
|
|
2700
|
+
cancel(): Promise<MatchTicketOutcome>;
|
|
2509
2701
|
}
|
|
2510
|
-
interface
|
|
2511
|
-
readonly
|
|
2512
|
-
readonly
|
|
2513
|
-
readonly
|
|
2514
|
-
readonly
|
|
2515
|
-
readonly
|
|
2702
|
+
interface CreateRoomOptions {
|
|
2703
|
+
readonly name: string;
|
|
2704
|
+
readonly maxPlayers?: number;
|
|
2705
|
+
readonly isPublic?: boolean;
|
|
2706
|
+
readonly settings?: unknown;
|
|
2707
|
+
readonly region?: string;
|
|
2708
|
+
readonly templateId?: string;
|
|
2709
|
+
readonly templateSlug?: string;
|
|
2710
|
+
readonly partyId?: string;
|
|
2711
|
+
readonly roomArgs?: RoomArgs;
|
|
2712
|
+
readonly signal?: AbortSignal;
|
|
2516
2713
|
}
|
|
2517
|
-
interface
|
|
2518
|
-
readonly
|
|
2519
|
-
readonly
|
|
2520
|
-
readonly requestId: string;
|
|
2521
|
-
readonly ref: string;
|
|
2714
|
+
interface JoinRoomOptions {
|
|
2715
|
+
readonly partyId?: string;
|
|
2716
|
+
readonly signal?: AbortSignal;
|
|
2522
2717
|
}
|
|
2523
|
-
interface
|
|
2524
|
-
readonly
|
|
2525
|
-
readonly
|
|
2526
|
-
readonly
|
|
2527
|
-
readonly
|
|
2528
|
-
readonly
|
|
2718
|
+
interface QuickJoinOptions extends JoinRoomOptions {
|
|
2719
|
+
readonly templateSlug?: string;
|
|
2720
|
+
readonly templateSlugs?: readonly string[];
|
|
2721
|
+
readonly templateId?: string;
|
|
2722
|
+
readonly region?: string;
|
|
2723
|
+
readonly name?: string;
|
|
2529
2724
|
}
|
|
2530
|
-
interface
|
|
2531
|
-
readonly
|
|
2532
|
-
readonly
|
|
2533
|
-
readonly requestId: string;
|
|
2725
|
+
interface ListRoomsOptions {
|
|
2726
|
+
readonly status?: "open" | "in_game";
|
|
2727
|
+
readonly templateSlug?: string;
|
|
2534
2728
|
readonly limit?: number;
|
|
2729
|
+
readonly cursor?: string;
|
|
2730
|
+
readonly signal?: AbortSignal;
|
|
2535
2731
|
}
|
|
2536
|
-
interface
|
|
2537
|
-
readonly
|
|
2538
|
-
readonly
|
|
2539
|
-
readonly
|
|
2540
|
-
readonly
|
|
2541
|
-
readonly
|
|
2542
|
-
readonly
|
|
2543
|
-
gameId: string;
|
|
2544
|
-
slug?: string;
|
|
2545
|
-
iconUrl: string;
|
|
2546
|
-
capsuleLandscapeUrl: string;
|
|
2547
|
-
capsulePortraitUrl: string;
|
|
2548
|
-
previewVideoUrl?: string;
|
|
2549
|
-
previewPosterUrl?: string;
|
|
2550
|
-
untrusted: {
|
|
2551
|
-
name: string;
|
|
2552
|
-
tagline: string;
|
|
2553
|
-
shortDescription: string;
|
|
2554
|
-
tags: string[];
|
|
2555
|
-
};
|
|
2556
|
-
}[];
|
|
2732
|
+
interface UpdateRoomOptions {
|
|
2733
|
+
readonly name?: string;
|
|
2734
|
+
readonly maxPlayers?: number;
|
|
2735
|
+
readonly isPublic?: boolean;
|
|
2736
|
+
readonly settings?: unknown;
|
|
2737
|
+
readonly roomArgs?: RoomArgs;
|
|
2738
|
+
readonly signal?: AbortSignal;
|
|
2557
2739
|
}
|
|
2558
|
-
|
|
2559
|
-
|
|
2560
|
-
readonly
|
|
2561
|
-
|
|
2740
|
+
type PartyTicketStatus = "queued" | "matched" | "expired" | "cancelled" | "failed" | "lost";
|
|
2741
|
+
type PartyTicketOutcome = {
|
|
2742
|
+
readonly status: "matched";
|
|
2743
|
+
} | {
|
|
2744
|
+
readonly status: "expired";
|
|
2745
|
+
readonly reason: string;
|
|
2746
|
+
} | {
|
|
2747
|
+
readonly status: "cancelled";
|
|
2748
|
+
readonly reason: string;
|
|
2749
|
+
} | {
|
|
2750
|
+
readonly status: "failed";
|
|
2751
|
+
readonly reason: string;
|
|
2752
|
+
} | {
|
|
2753
|
+
readonly status: "lost";
|
|
2754
|
+
};
|
|
2755
|
+
interface PartyTicket {
|
|
2756
|
+
readonly id: string;
|
|
2757
|
+
readonly status: PartyTicketStatus;
|
|
2758
|
+
readonly partySize: number;
|
|
2759
|
+
readonly queuedAt: number;
|
|
2760
|
+
readonly expiresAt: number;
|
|
2761
|
+
readonly outcome: Promise<PartyTicketOutcome>;
|
|
2562
2762
|
}
|
|
2563
|
-
interface
|
|
2564
|
-
readonly
|
|
2565
|
-
readonly
|
|
2566
|
-
readonly
|
|
2567
|
-
readonly
|
|
2763
|
+
interface RelayedTicketEvent {
|
|
2764
|
+
readonly event: "queued" | "matched" | "expired" | "cancelled" | "failed";
|
|
2765
|
+
readonly ticketId: string;
|
|
2766
|
+
readonly partySize?: number;
|
|
2767
|
+
readonly queuedAt?: number;
|
|
2768
|
+
readonly expiresAt?: number;
|
|
2568
2769
|
readonly reason?: string;
|
|
2569
|
-
readonly
|
|
2570
|
-
skuId: string;
|
|
2571
|
-
kind: "gem_pack" | "boost" | "pass" | "bundle";
|
|
2572
|
-
name: string;
|
|
2573
|
-
description: string;
|
|
2574
|
-
imageUrl?: string;
|
|
2575
|
-
priceDisplay: string;
|
|
2576
|
-
grant?: {
|
|
2577
|
-
currency: string;
|
|
2578
|
-
amount: number;
|
|
2579
|
-
};
|
|
2580
|
-
}[];
|
|
2770
|
+
readonly roomId?: string;
|
|
2581
2771
|
}
|
|
2582
|
-
interface
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2772
|
+
interface RoomEventMap {
|
|
2773
|
+
created: [
|
|
2774
|
+
Room
|
|
2775
|
+
];
|
|
2776
|
+
joined: [
|
|
2777
|
+
Room
|
|
2778
|
+
];
|
|
2779
|
+
left: [
|
|
2780
|
+
];
|
|
2781
|
+
closed: [
|
|
2782
|
+
];
|
|
2783
|
+
updated: [
|
|
2784
|
+
Room
|
|
2785
|
+
];
|
|
2786
|
+
seated: [
|
|
2787
|
+
Room
|
|
2788
|
+
];
|
|
2789
|
+
partyQueued: [
|
|
2790
|
+
PartyTicket
|
|
2791
|
+
];
|
|
2792
|
+
listed: [
|
|
2793
|
+
RoomPage
|
|
2794
|
+
];
|
|
2795
|
+
mineListed: [
|
|
2796
|
+
readonly RoomSummary[]
|
|
2797
|
+
];
|
|
2798
|
+
memberJoined: [
|
|
2799
|
+
string
|
|
2800
|
+
];
|
|
2801
|
+
memberLeft: [
|
|
2802
|
+
string
|
|
2803
|
+
];
|
|
2804
|
+
kicked: [
|
|
2805
|
+
];
|
|
2806
|
+
readyChanged: [
|
|
2807
|
+
string,
|
|
2808
|
+
boolean
|
|
2809
|
+
];
|
|
2810
|
+
hostChanged: [
|
|
2811
|
+
string
|
|
2812
|
+
];
|
|
2813
|
+
matchStartWaiting: [
|
|
2814
|
+
StartMatchWaiting
|
|
2815
|
+
];
|
|
2816
|
+
matchAutoStartFailed: [
|
|
2817
|
+
MatchAutoStartFailed
|
|
2818
|
+
];
|
|
2819
|
+
matchAllocationStarted: [
|
|
2820
|
+
string
|
|
2821
|
+
];
|
|
2822
|
+
matchReady: [
|
|
2823
|
+
ReadyMatch
|
|
2824
|
+
];
|
|
2825
|
+
matchFailed: [
|
|
2826
|
+
string,
|
|
2827
|
+
string
|
|
2828
|
+
];
|
|
2829
|
+
matchEnded: [
|
|
2830
|
+
MatchEnded
|
|
2831
|
+
];
|
|
2832
|
+
matchSuspended: [
|
|
2833
|
+
MatchSuspended
|
|
2834
|
+
];
|
|
2835
|
+
matchReconnecting: [
|
|
2836
|
+
MatchReconnecting
|
|
2837
|
+
];
|
|
2838
|
+
matchReconnected: [
|
|
2839
|
+
MatchReconnected
|
|
2840
|
+
];
|
|
2841
|
+
versionUpdateAvailable: [
|
|
2842
|
+
ClientPlatform$1 | undefined
|
|
2843
|
+
];
|
|
2844
|
+
error: [
|
|
2845
|
+
RoomOperationError
|
|
2846
|
+
];
|
|
2587
2847
|
}
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
readonly
|
|
2591
|
-
readonly requestId: string;
|
|
2592
|
-
readonly outcome: "ok" | "declined" | "unavailable";
|
|
2848
|
+
type RoomEventName = keyof RoomEventMap;
|
|
2849
|
+
interface MatchEndHint {
|
|
2850
|
+
readonly matchId?: string;
|
|
2593
2851
|
readonly reason?: string;
|
|
2594
2852
|
}
|
|
2595
|
-
interface
|
|
2596
|
-
readonly
|
|
2597
|
-
readonly
|
|
2598
|
-
readonly
|
|
2853
|
+
interface RelayedRoomEvent {
|
|
2854
|
+
readonly event: "updated" | "match_started" | "match_ready" | "match_failed" | "version_stale";
|
|
2855
|
+
readonly roomId: string;
|
|
2856
|
+
readonly matchId?: string;
|
|
2857
|
+
readonly version?: number;
|
|
2858
|
+
readonly reason?: string;
|
|
2859
|
+
readonly platform?: ClientPlatform$1;
|
|
2599
2860
|
}
|
|
2600
|
-
interface
|
|
2601
|
-
readonly
|
|
2602
|
-
readonly
|
|
2603
|
-
readonly
|
|
2604
|
-
readonly skuId: string;
|
|
2861
|
+
interface StartMatchOptions {
|
|
2862
|
+
readonly clusterTargetId?: ClusterTargetLike;
|
|
2863
|
+
readonly retry?: StartMatchRetryOptions;
|
|
2864
|
+
readonly signal?: AbortSignal;
|
|
2605
2865
|
}
|
|
2606
|
-
interface
|
|
2607
|
-
readonly
|
|
2608
|
-
readonly
|
|
2609
|
-
readonly
|
|
2610
|
-
|
|
2611
|
-
|
|
2866
|
+
interface AwaitMatchOptions {
|
|
2867
|
+
readonly timeoutMs?: number;
|
|
2868
|
+
readonly pollIntervalMs?: number;
|
|
2869
|
+
readonly signal?: AbortSignal;
|
|
2870
|
+
}
|
|
2871
|
+
interface StartedMatch {
|
|
2872
|
+
readonly matchId: string;
|
|
2873
|
+
readonly status: string;
|
|
2874
|
+
}
|
|
2875
|
+
interface RoomManager {
|
|
2876
|
+
create(options: CreateRoomOptions): Promise<Room>;
|
|
2877
|
+
join(roomId: string, options?: JoinRoomOptions): Promise<Room>;
|
|
2878
|
+
joinByCode(code: string, options?: JoinRoomOptions): Promise<Room>;
|
|
2879
|
+
quickJoin(options: QuickJoinOptions): Promise<Room>;
|
|
2880
|
+
queueForMatch(options: QueueForMatchOptions): Promise<MatchTicket>;
|
|
2881
|
+
list(options?: ListRoomsOptions): Promise<RoomPage>;
|
|
2882
|
+
myRooms(signal?: AbortSignal): Promise<readonly RoomSummary[]>;
|
|
2883
|
+
leave(options?: {
|
|
2884
|
+
asGroup?: boolean;
|
|
2885
|
+
signal?: AbortSignal;
|
|
2886
|
+
keepalive?: boolean;
|
|
2887
|
+
}): Promise<void>;
|
|
2888
|
+
leaveAll(signal?: AbortSignal): Promise<readonly string[]>;
|
|
2889
|
+
close(signal?: AbortSignal): Promise<void>;
|
|
2890
|
+
refresh(signal?: AbortSignal): Promise<Room | null>;
|
|
2891
|
+
setReady(isReady: boolean, signal?: AbortSignal): Promise<Room>;
|
|
2892
|
+
kick(playerId: string, signal?: AbortSignal): Promise<Room>;
|
|
2893
|
+
transferHost(playerId: string, signal?: AbortSignal): Promise<Room>;
|
|
2894
|
+
update(options: UpdateRoomOptions): Promise<Room>;
|
|
2895
|
+
startMatch(options?: StartMatchOptions): Promise<StartedMatch>;
|
|
2896
|
+
awaitMatch(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2897
|
+
pollMatchStatus(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2898
|
+
notifyMatchConnected(matchId: string): void;
|
|
2899
|
+
notifyMatchDisconnected(cause?: string): Promise<void>;
|
|
2900
|
+
reconnectToMatch(options?: AwaitMatchOptions): Promise<ReadyMatch>;
|
|
2901
|
+
notifyLeavingMatch(options?: {
|
|
2902
|
+
keepalive?: boolean;
|
|
2903
|
+
}): Promise<void>;
|
|
2904
|
+
readonly gameId: string | null;
|
|
2905
|
+
readonly currentRoom: Room | null;
|
|
2906
|
+
readonly currentTicket: MatchTicket | null;
|
|
2907
|
+
readonly partyTicket: PartyTicket | null;
|
|
2908
|
+
readonly currentMatch: ReadyMatch | null;
|
|
2909
|
+
readonly matchConnectionState: MatchConnectionState;
|
|
2910
|
+
readonly matchSession: MatchSession;
|
|
2911
|
+
readonly isInRoom: boolean;
|
|
2912
|
+
readonly isHost: boolean;
|
|
2913
|
+
readonly members: readonly Room["members"][number][];
|
|
2914
|
+
readonly playWith: PlayWithOutcome | null;
|
|
2915
|
+
on<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): () => void;
|
|
2916
|
+
off<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): void;
|
|
2917
|
+
once<K extends RoomEventName>(event: K, listener: (...args: RoomEventMap[K]) => void): () => void;
|
|
2918
|
+
handleRoomEvent(event: RelayedRoomEvent): void;
|
|
2919
|
+
handleSeated(roomId: string): void;
|
|
2920
|
+
handleAutoStartFailed(roomId: string, code: string): void;
|
|
2921
|
+
handleTicketEvent(event: RelayedTicketEvent): void;
|
|
2922
|
+
reconcileSeats(): Promise<void>;
|
|
2923
|
+
reconcile(hint?: MatchEndHint): Promise<void>;
|
|
2924
|
+
startPolling(intervalMs?: number): void;
|
|
2925
|
+
stopPolling(): void;
|
|
2926
|
+
settled(): Promise<void>;
|
|
2927
|
+
dispose(): void;
|
|
2612
2928
|
}
|
|
2613
2929
|
interface ConnectOptions {
|
|
2614
2930
|
readonly clusterTargetId?: ClusterTargetLike;
|
|
@@ -3027,9 +3343,15 @@ interface GemServerHost extends ServerBundleHost {
|
|
|
3027
3343
|
broadcast(data: string | Uint8Array, options?: BroadcastOptions): void;
|
|
3028
3344
|
kick(playerId: string, reason?: string): void;
|
|
3029
3345
|
endMatch?(): Promise<"ok" | "already_ended" | "refused" | "failed" | (string & {})>;
|
|
3346
|
+
passes?(playerId: string): Promise<GemServerHostRead>;
|
|
3347
|
+
boost?(playerId: string): Promise<GemServerHostRead>;
|
|
3030
3348
|
log(message: string): void;
|
|
3031
3349
|
warn(message: string): void;
|
|
3032
3350
|
}
|
|
3351
|
+
interface GemServerHostRead {
|
|
3352
|
+
readonly status: number;
|
|
3353
|
+
readonly body: unknown;
|
|
3354
|
+
}
|
|
3033
3355
|
interface HostTokenSourceOptions {
|
|
3034
3356
|
readonly clock: Clock;
|
|
3035
3357
|
readonly timeoutMs?: number;
|
|
@@ -4608,6 +4930,15 @@ interface ServerListChallengesOptions {
|
|
|
4608
4930
|
interface ServerChallenges {
|
|
4609
4931
|
list(options: ServerListChallengesOptions): Promise<Challenge[]>;
|
|
4610
4932
|
}
|
|
4933
|
+
interface MatchBoostMultiplier {
|
|
4934
|
+
readonly currencySlug: string;
|
|
4935
|
+
readonly multiplier: number;
|
|
4936
|
+
}
|
|
4937
|
+
interface MatchPlayerBoost {
|
|
4938
|
+
readonly active: boolean;
|
|
4939
|
+
readonly multipliers: readonly MatchBoostMultiplier[];
|
|
4940
|
+
readonly expiresInDays?: number;
|
|
4941
|
+
}
|
|
4611
4942
|
interface GemServerOptions {
|
|
4612
4943
|
readonly baseUrl?: string;
|
|
4613
4944
|
readonly clock?: Clock;
|
|
@@ -4646,7 +4977,10 @@ interface GemServer {
|
|
|
4646
4977
|
readonly seats?: number;
|
|
4647
4978
|
}, signal?: AbortSignal): Promise<MatchBackfillState>;
|
|
4648
4979
|
reportPlayers(reports: readonly MatchPlayerReport[], signal?: AbortSignal): Promise<MatchPlayerReportResult[]>;
|
|
4980
|
+
playerPasses(playerId: string, signal?: AbortSignal): Promise<readonly GamePass[]>;
|
|
4981
|
+
playerBoost(playerId: string, signal?: AbortSignal): Promise<MatchPlayerBoost>;
|
|
4649
4982
|
};
|
|
4983
|
+
readonly earnings: EarningsApi;
|
|
4650
4984
|
readonly analytics: ServerAnalytics;
|
|
4651
4985
|
readonly functions: FunctionsApi;
|
|
4652
4986
|
readonly challenges: ServerChallenges;
|
|
@@ -4816,177 +5150,6 @@ interface AccountApi {
|
|
|
4816
5150
|
onSignInAvailableChange(listener: (available: boolean) => void): () => void;
|
|
4817
5151
|
requestSignIn(): Promise<SignInOutcome>;
|
|
4818
5152
|
}
|
|
4819
|
-
interface PlayerBoostMultiplier {
|
|
4820
|
-
readonly currencyId: string;
|
|
4821
|
-
readonly currencySlug: string;
|
|
4822
|
-
readonly multiplier: number;
|
|
4823
|
-
}
|
|
4824
|
-
interface PlayerBoost {
|
|
4825
|
-
readonly active: boolean;
|
|
4826
|
-
readonly multipliers: readonly PlayerBoostMultiplier[];
|
|
4827
|
-
readonly expiresInDays?: number;
|
|
4828
|
-
}
|
|
4829
|
-
interface RewardCue {
|
|
4830
|
-
currencySlug: string;
|
|
4831
|
-
cueId?: string;
|
|
4832
|
-
expected?: number;
|
|
4833
|
-
origin?: {
|
|
4834
|
-
x: number;
|
|
4835
|
-
y: number;
|
|
4836
|
-
};
|
|
4837
|
-
}
|
|
4838
|
-
type GemCorner = "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
4839
|
-
type RewardPresentation = "arcade" | "game";
|
|
4840
|
-
interface MenuStyle {
|
|
4841
|
-
readonly ground: string;
|
|
4842
|
-
readonly accent: string;
|
|
4843
|
-
}
|
|
4844
|
-
type FrameState = "waiting" | "connected" | "refused" | "closed";
|
|
4845
|
-
interface FramePlayer extends PlayerIdentity {
|
|
4846
|
-
readonly displayName: PlayerText;
|
|
4847
|
-
readonly displayHandle: PlayerText;
|
|
4848
|
-
readonly avatarUrl?: string;
|
|
4849
|
-
readonly boost: PlayerBoost;
|
|
4850
|
-
}
|
|
4851
|
-
type GemArcadeAsk = Omit<GemRequestAppLinks, "gem"> | Omit<GemRequestOpenApp, "gem"> | Omit<GemRequestOpenGame, "gem"> | Omit<GemRequestSimilarGames, "gem"> | Omit<GemRequestStoreOffers, "gem"> | Omit<GemRequestStorePurchase, "gem"> | Omit<GemRequestStoreOfferSheet, "gem">;
|
|
4852
|
-
type GemFriendsWindowAsk = Omit<GemRequestPlayInvite, "gem"> | Omit<GemInviteParams, "gem">;
|
|
4853
|
-
type GemArcadeAnswer = GemAppLinksResult | GemOpenAppResult | GemOpenGameResult | GemSimilarGamesResult | GemStoreOffersResult | GemStorePurchaseResult | GemStorePurchaseSettled | GemStoreOfferSheetResult;
|
|
4854
|
-
interface FrameCallbacks {
|
|
4855
|
-
onToken?(msg: GemToken): void;
|
|
4856
|
-
onPause?(msg: GemPause): void;
|
|
4857
|
-
onMenuSelect?(msg: GemMenuSelect): void;
|
|
4858
|
-
onSettingChange?(msg: GemSettingChange): void;
|
|
4859
|
-
onPrefs?(msg: GemPrefs$1): void;
|
|
4860
|
-
onCohorts?(msg: GemCohorts$1): void;
|
|
4861
|
-
onEarnAllowanceChanged?(): void;
|
|
4862
|
-
onInventoryChanged?(msg: GemInventoryChanged): void;
|
|
4863
|
-
onViewport?(msg: GemViewport$1): void;
|
|
4864
|
-
onWillTerminate?(msg: GemWillTerminate): void;
|
|
4865
|
-
onDevtools?(action: "open" | "close" | "toggle"): void;
|
|
4866
|
-
onScreenshot?(request: {
|
|
4867
|
-
maxWidth: number;
|
|
4868
|
-
maxHeight: number;
|
|
4869
|
-
}, port: MessagePort, deny: (reason: GemScreenshotDenied["reason"], retryable: boolean) => void): void;
|
|
4870
|
-
onRequestContext?(): void;
|
|
4871
|
-
onTokenDenied?(msg: GemTokenDenied): void;
|
|
4872
|
-
onLocalServer?(msg: GemLocalServer): void;
|
|
4873
|
-
onLocalServerDenied?(msg: GemLocalServerDenied): void;
|
|
4874
|
-
onPlayer?(player: FramePlayer, signInAvailable?: boolean): void;
|
|
4875
|
-
onRoomEvent?(msg: GemRoomEvent): void;
|
|
4876
|
-
onSeatedEvent?(msg: GemSeatedEvent): void;
|
|
4877
|
-
onAutoStartFailedEvent?(msg: GemAutoStartFailedEvent): void;
|
|
4878
|
-
onTicketEvent?(msg: GemTicketEvent): void;
|
|
4879
|
-
onSocketState?(msg: GemSocketState): void;
|
|
4880
|
-
onSignalEvent?(msg: GemSignalEvent): void;
|
|
4881
|
-
onRelayDraining?(msg: GemRelayDraining): void;
|
|
4882
|
-
onDedicatedEvent?(msg: GemDedicatedEvent): void;
|
|
4883
|
-
onClusterTarget?(msg: GemClusterTarget): void;
|
|
4884
|
-
onGraphicsRoutes?(msg: GemGraphicsRoutes): void;
|
|
4885
|
-
onPartyResult?(msg: GemPartyResult): void;
|
|
4886
|
-
onPurchaseResult?(msg: GemPurchaseResult): void;
|
|
4887
|
-
onPurchaseSettled?(msg: GemPurchaseSettled): void;
|
|
4888
|
-
onShareResult?(msg: GemShareResult): void;
|
|
4889
|
-
onDeviceSettings?(msg: GemDeviceSettings): void;
|
|
4890
|
-
onDeviceSettingsResult?(msg: GemDeviceSettingsResult): void;
|
|
4891
|
-
onAdResult?(msg: GemAdResult): void;
|
|
4892
|
-
onMomentResult?(msg: GemMomentResult): void;
|
|
4893
|
-
onSignInResult?(msg: GemSignInResult): void;
|
|
4894
|
-
onFriendChallengeResult?(msg: GemFriendChallengeResult): void;
|
|
4895
|
-
onArcadeAnswer?(msg: GemArcadeAnswer): void;
|
|
4896
|
-
onPlayInviteResult?(msg: GemPlayInviteResult): void;
|
|
4897
|
-
onError?(code: GemErrorCode, message?: string): void;
|
|
4898
|
-
onDropped?(code: GemErrorCode, message?: string): void;
|
|
4899
|
-
onStateChange?(state: FrameState): void;
|
|
4900
|
-
onRefused?(reason: string): void;
|
|
4901
|
-
}
|
|
4902
|
-
interface FrameOptions extends FrameCallbacks {
|
|
4903
|
-
allowedEmbedders: readonly string[];
|
|
4904
|
-
selfOrigin?: string;
|
|
4905
|
-
expectedSource: unknown;
|
|
4906
|
-
capabilities?: readonly string[];
|
|
4907
|
-
clock?: Clock;
|
|
4908
|
-
}
|
|
4909
|
-
declare class GemFrame {
|
|
4910
|
-
private readonly options;
|
|
4911
|
-
private state;
|
|
4912
|
-
private port;
|
|
4913
|
-
private version;
|
|
4914
|
-
private peerCapabilities;
|
|
4915
|
-
private unbidden;
|
|
4916
|
-
private engagedSent;
|
|
4917
|
-
private readyPending;
|
|
4918
|
-
private readySent;
|
|
4919
|
-
private settleWaiters;
|
|
4920
|
-
private readonly clock;
|
|
4921
|
-
private readonly inbound;
|
|
4922
|
-
private readonly outbound;
|
|
4923
|
-
private readonly expectedSource;
|
|
4924
|
-
constructor(options: FrameOptions);
|
|
4925
|
-
get currentState(): FrameState;
|
|
4926
|
-
get parentCapabilities(): readonly string[];
|
|
4927
|
-
parentSupports(capability: string): boolean;
|
|
4928
|
-
get protocolVersion(): number | null;
|
|
4929
|
-
get unbiddenLaunch(): boolean;
|
|
4930
|
-
handleWindowMessage(event: HandshakeEvent): boolean;
|
|
4931
|
-
ready(): void;
|
|
4932
|
-
settled(timeoutMs?: number): Promise<FrameState>;
|
|
4933
|
-
progress(loaded: number, total: number): void;
|
|
4934
|
-
requestToken(requestId: string, reason: "initial" | "expiring" | "rejected"): void;
|
|
4935
|
-
requestLocalServer(requestId: string, gameRoomId: string): boolean;
|
|
4936
|
-
exit(reason?: string): void;
|
|
4937
|
-
openExternal(url: string): void;
|
|
4938
|
-
requestFullscreen(enabled: boolean): void;
|
|
4939
|
-
reportMuted(muted: boolean): boolean;
|
|
4940
|
-
reportEngaged(): boolean;
|
|
4941
|
-
cueReward(cue: RewardCue): boolean;
|
|
4942
|
-
showPortraitBorders(name: string | null): boolean;
|
|
4943
|
-
setWalletVisible(visible: boolean, options?: {
|
|
4944
|
-
only?: readonly string[];
|
|
4945
|
-
}): boolean;
|
|
4946
|
-
setMenu(items?: ReadonlyArray<{
|
|
4947
|
-
readonly id: string;
|
|
4948
|
-
readonly label: string;
|
|
4949
|
-
}>): boolean;
|
|
4950
|
-
declareSettings(settings: GemSettingsDeclare["settings"]): boolean;
|
|
4951
|
-
setGemCorner(corner: GemCorner): boolean;
|
|
4952
|
-
setRewardPresentation(mode: RewardPresentation): boolean;
|
|
4953
|
-
setMenuStyle(style: MenuStyle | null): boolean;
|
|
4954
|
-
requestShare(params: ReadonlyArray<{
|
|
4955
|
-
readonly key: string;
|
|
4956
|
-
readonly value: string;
|
|
4957
|
-
}>, requestId?: string): boolean;
|
|
4958
|
-
requestAvatarPicker(tab?: "2d" | "3d"): boolean;
|
|
4959
|
-
requestVibrate(pattern: readonly number[]): boolean;
|
|
4960
|
-
reportFrameStats(stats: {
|
|
4961
|
-
fps: number;
|
|
4962
|
-
frameTimeP95Ms: number;
|
|
4963
|
-
counts?: "pageFrames" | "gameDraws";
|
|
4964
|
-
}): boolean;
|
|
4965
|
-
sendGameContext(context: Record<string, unknown>): boolean;
|
|
4966
|
-
signal(signal: string, matchId: string, data: Record<string, unknown>): void;
|
|
4967
|
-
dedicatedOffer(matchId: string, sdp: string, intent: GemDedicatedOffer["intent"]): void;
|
|
4968
|
-
requestParty(requestId: string): boolean;
|
|
4969
|
-
requestPurchase(requestId: string, purchaseKind: "item" | "recipe", targetId: string, currencySlug: string, quantity?: number, catalogId?: string, origin?: "sheet" | "direct_refused"): boolean;
|
|
4970
|
-
requestAvatar3dPurchase(requestId: string, itemId: string, currencySlug: string): boolean;
|
|
4971
|
-
putDeviceSettings(requestId: string, settings: Readonly<Record<string, unknown>>): boolean;
|
|
4972
|
-
requestAd(requestId: string, placement: string, format: "interstitial" | "rewarded"): boolean;
|
|
4973
|
-
signalMoment(requestId: string, kind: string, placement?: string, wall?: boolean): boolean;
|
|
4974
|
-
readyCalled(): boolean;
|
|
4975
|
-
requestSignIn(requestId: string): boolean;
|
|
4976
|
-
requestFriendChallenge(requestId: string, playerId: string, template: string, params?: Readonly<Record<string, string | number>>): boolean;
|
|
4977
|
-
requestArcade(msg: GemArcadeAsk | GemFriendsWindowAsk): boolean;
|
|
4978
|
-
close(): void;
|
|
4979
|
-
private transition;
|
|
4980
|
-
private refuseMalformed;
|
|
4981
|
-
private dropUnknownType;
|
|
4982
|
-
private refuse;
|
|
4983
|
-
private fail;
|
|
4984
|
-
private gated;
|
|
4985
|
-
private send;
|
|
4986
|
-
private receive;
|
|
4987
|
-
private dispatchInbound;
|
|
4988
|
-
private screenshotDenied;
|
|
4989
|
-
}
|
|
4990
5153
|
interface ShareRequest {
|
|
4991
5154
|
readonly params?: Readonly<Record<string, string>>;
|
|
4992
5155
|
}
|
|
@@ -4999,11 +5162,6 @@ interface ShareApi {
|
|
|
4999
5162
|
readonly available: boolean;
|
|
5000
5163
|
request(request?: ShareRequest): Promise<void>;
|
|
5001
5164
|
}
|
|
5002
|
-
type ArcadeOutcomeKind = "ok" | "declined" | "unavailable";
|
|
5003
|
-
interface ArcadeOutcome {
|
|
5004
|
-
readonly outcome: ArcadeOutcomeKind;
|
|
5005
|
-
readonly reason?: string;
|
|
5006
|
-
}
|
|
5007
5165
|
type AppStore = "app_store" | "google_play";
|
|
5008
5166
|
interface AppListing {
|
|
5009
5167
|
readonly store: AppStore;
|
|
@@ -5041,32 +5199,6 @@ interface ArcadeApi {
|
|
|
5041
5199
|
readonly limit?: number;
|
|
5042
5200
|
}): Promise<SimilarGamesOutcome>;
|
|
5043
5201
|
}
|
|
5044
|
-
interface ArcadeOffer {
|
|
5045
|
-
readonly skuId: string;
|
|
5046
|
-
readonly kind: "gem_pack" | "boost" | "pass" | "bundle";
|
|
5047
|
-
readonly name: string;
|
|
5048
|
-
readonly description: string;
|
|
5049
|
-
readonly imageUrl?: string;
|
|
5050
|
-
readonly priceDisplay: string;
|
|
5051
|
-
readonly grant?: {
|
|
5052
|
-
readonly currency: string;
|
|
5053
|
-
readonly amount: number;
|
|
5054
|
-
};
|
|
5055
|
-
}
|
|
5056
|
-
interface StoreOffersOutcome extends ArcadeOutcome {
|
|
5057
|
-
readonly offers: readonly ArcadeOffer[];
|
|
5058
|
-
}
|
|
5059
|
-
interface StoreSettlement {
|
|
5060
|
-
readonly skuId: string;
|
|
5061
|
-
}
|
|
5062
|
-
interface StoreApi {
|
|
5063
|
-
readonly available: boolean;
|
|
5064
|
-
readonly showOfferAvailable: boolean;
|
|
5065
|
-
offers(): Promise<StoreOffersOutcome>;
|
|
5066
|
-
purchase(skuId: string): Promise<ArcadeOutcome>;
|
|
5067
|
-
showOffer(skuId: string): Promise<ArcadeOutcome>;
|
|
5068
|
-
onSettled(listener: (settlement: StoreSettlement) => void): () => void;
|
|
5069
|
-
}
|
|
5070
5202
|
type BrandingTheme = "light" | "dark";
|
|
5071
5203
|
interface BrandingVariant {
|
|
5072
5204
|
readonly url: string;
|
|
@@ -5291,6 +5423,7 @@ interface GemPlayer extends PlayerIdentity {
|
|
|
5291
5423
|
readonly displayHandle: PlayerText;
|
|
5292
5424
|
readonly avatarUrl?: string;
|
|
5293
5425
|
readonly boost: PlayerBoost;
|
|
5426
|
+
readonly isGuest: boolean;
|
|
5294
5427
|
}
|
|
5295
5428
|
interface GemPrefs {
|
|
5296
5429
|
readonly reducedMotion: boolean;
|
|
@@ -5378,6 +5511,7 @@ interface Gem {
|
|
|
5378
5511
|
readonly characters: CharactersApi;
|
|
5379
5512
|
readonly transfers: TransfersApi;
|
|
5380
5513
|
readonly gameConfig: GameConfigApi;
|
|
5514
|
+
readonly earnings: EarningsApi;
|
|
5381
5515
|
readonly purchases: PurchaseApi;
|
|
5382
5516
|
readonly deviceSettings: DeviceSettingsApi;
|
|
5383
5517
|
readonly graphics: GraphicsApi;
|
|
@@ -5445,4 +5579,4 @@ interface ExitAnalytics {
|
|
|
5445
5579
|
}
|
|
5446
5580
|
declare function leaveAndExit(rooms: ExitRooms, bridge: ExitBridge | null, reason?: string, analytics?: ExitAnalytics): Promise<void>;
|
|
5447
5581
|
declare function createGem(options?: GemOptions): Gem;
|
|
5448
|
-
export { ARCADE_EMBEDDERS, AVATAR_RIGS, type AccountApi, type AdFormat, type AdOutcome, type AdOutcomeKind, type AdRequest, type AdsApi, AnalyticsApi, type AnalyticsFlushOptions, type AnalyticsFlushResult, type AnalyticsOptions, type AnalyticsRejection$1 as AnalyticsRejection, type AnalyticsValue, type AppLinksOutcome, type AppListing, type AppStore, type ArcadeApi, type ArcadeAvailability, type ArcadeOffer, type ArcadeOutcome, type ArcadeOutcomeKind, AuthError, type AuthFailure, type AuthState, type Avatar3dFamily, type Avatar3dOffer, type Avatar3dPrice, type Avatar3dPurchaseRequest, type AvatarRigNode, type AvatarRigs, type Avatars3dApi, type Base64String, type BootMark, type BootTimeline, type BrandingApi, type BrandingAsset, type BrandingAssetOptions, type BrandingCurrency, type BrandingImageOptions, type BrandingList, type BrandingLookup, type BrandingTheme, type BrandingVariant, type BroadcastOptions, type BytesResponse, CONDITIONAL_HEADERS, type Challenge, type ChallengeWindow, ChallengesApi, type ClientOptions, type Clock, type ConditionalRequestHeaders, type ConfiguredPurchasePayment, type ConfiguredPurchaseRequest, type ConfiguredPurchaseResult, type ControlsApi, DEVICE_SETTINGS_MAX_BYTES, DedicatedServerError, type DedicatedServerFailure, type DedicatedServerSession, type DevToolsOpener, type DeviceSettings, type DeviceSettingsApi, type DeviceSettingsPutOutcome, type DirectPurchaseRequest, type DirectPurchaseResult, type EarnAllowance, type EarnAllowanceEvent, type EarnAllowancePeriod, type EarnAllowanceReadOptions, type EntityLeaderboard, type EntityLeaderboardEntry, type EntityLeaderboardOptions, type EntityType$1 as EntityType, type ExitAnalytics, type ExitBridge, type ExitRooms, type FrameState, type Friend, type FriendChallenge, FriendChallengeError, type FriendChallengeErrorCode, type FriendChallengeOutcome, type FriendChallengeOutcomeKind, type FriendChallengeRequest, type FriendChallengesPage, FriendsApi, type FriendsPage, type FunctionFailure, type FunctionInvokeOptions, type FunctionResult, FunctionsApi, type GameApi, type GameCard, type GameConfig, type GameMenu, type GameMenuItem, type GamePass, type GameServerLink, type GameSettingsApi, type Gem, GemApiError, type GemAudioChannels, GemClient, type GemCohort, type GemCohorts, GemConfigError, type GemControlBox, type GemCorner, type GemDevTools, type GemErrorReason, GemFrame, GemFunctionError, type GemGameChoiceSetting, type GemGameSetting, type GemGameSettingBase, type GemGameSettingChange, type GemGameSettingIcon, type GemGameSettingOption, type GemGameSettingValue, type GemGameSliderSetting, type GemGameToggleSetting, type GemGraphicsQuality, type GemGraphicsRoute, type GemGraphicsRouteEntry, type GemIdentity, type GemInsets, type GemLook, type GemLookBase, type GemLookDelta, type GemLookOptions, type GemLookSpeed, type GemMatchApi, type GemMatchServer, type GemMatchServerModule, type GemOptions, type GemPlayer, type GemPreferredRoute, type GemPrefs, type GemRecommendedSettings, type GemReservedArea, GemSaveError, type GemServer, type GemServerBundle, type GemServerFactory, type GemServerHost, type GemServerHostProfile, type GemServerIdentity, type GemServerLifecycle, type GemServerOptions, type GemServerProfile, type GemTerminationNotice, GemUnframedError, type GemViewport, type GetLeaderboardOptions, type GraphicsApi, type HostTokenSource, type HostTokenSourceOptions, type JoinWelcome, type Leaderboard, type LeaderboardEntry, type LeaderboardPeriod, LeaderboardsApi, type ListChallengesOptions, type ListFriendChallengesOptions, type ListFriendsOptions, MAX_PERIODS_BACK, type MatchBackfillState, type MatchConnectOptions, type MatchConnection, type MatchHosting, type MatchHostingMode, type MatchPlayerReport, type MatchPlayerReportResult, type MatchServeOptions, type MatchTransport, type MenuStyle, type MessageMeta, type MomentKind, type MomentResult, type MomentSignal, type MomentsApi, type MultiTransportSession, PLATFORM_EVENTS, type PassesApi, type PassesEvent, type PeriodOptions, PlatformApi, PlatformCurrenciesApi, type PlatformCurrency, type PlatformCurrencyAccess, type PlatformCurrencyPurchasePayment, type PlatformCurrencyPurchaseRequest, type PlatformCurrencyPurchaseResult, type PlatformCurrencyReadOptions, PlatformEarnAllowanceApi, type PlatformEventName, type PlayInviteRequest, type PlayerBadge$1 as PlayerBadge, type PlayerBoost, type PlayerBoostMultiplier, type PlayerIdentity, type PlayerProfile, type PlayerScope, PlayerText, type PreferredRouteOptions, type ProfileCallOptions, type ProfileShowcaseEntry$1 as ProfileShowcaseEntry, ProfilesApi, type PurchaseApi, type PurchaseOptions, type PurchaseOutcome, PurchaseRefusal, type PurchaseRefusalCode, type PurchaseRequest, type PurchaseSettlement, type PutBytesOptions, type PutSaveOptions, type RankedRow, type RecipeAvailability, type RecipeLock, type RequestOptions, type RewardCue, type RewardPresentation, type RewardedOption, type RewardedStatus, type RoomArgValue, type SavePage, type SaveRecord, type SendOptions$1 as SendOptions, type ServerApi, type ServerBundleHost, type ServerTokenGrant, type SessionEndReason, type ShareApi, ShareRefusal, type ShareRequest, ShowcaseApi, type ShowcaseCallOptions, type ShowcaseFriendEntry, type ShowcaseFriends, type ShowcaseValue, type SignInOutcome, type SignInOutcomeKind, type SimilarGamesOutcome, type SnapshotCurrency, type SnapshotItem, type StoreApi, type StoreOffersOutcome, type StoreSettlement, type TokenGrant, type Transport, type TransportAdvert, type TransportKind, TransportRefusal, type TransportRequest, type TransportResponse, UNRELIABLE_CHANNEL_LABEL, type VersionedGetOptions, type VersionedResponse, type VibrationApi, type WalletVisibleOptions, type WornAvatar3d$1 as WornAvatar3d, asPlayerText, createBootTimeline, createGem, createGemServer, createHostTokenSource, createMatchServer, defineServer, experimentSelection, leaveAndExit, mapIdentity, markOnResolve, platformIconUrl, presentJoinCredential, readTemplateTransports, readTransportAdvert, reportOnResolve, systemClock, text, toBase64, webTransportAvailable };
|
|
5582
|
+
export { ARCADE_EMBEDDERS, AVATAR_RIGS, type AccountApi, type AdFormat, type AdOutcome, type AdOutcomeKind, type AdRequest, type AdsApi, AnalyticsApi, type AnalyticsFlushOptions, type AnalyticsFlushResult, type AnalyticsOptions, type AnalyticsRejection$1 as AnalyticsRejection, type AnalyticsValue, type AppLinksOutcome, type AppListing, type AppStore, type ArcadeApi, type ArcadeAvailability, type ArcadeOffer, type ArcadeOfferEarnMultiplier, type ArcadeOfferKind, type ArcadeOutcome, type ArcadeOutcomeKind, AuthError, type AuthFailure, type AuthState, type Avatar3dFamily, type Avatar3dOffer, type Avatar3dPrice, type Avatar3dPurchaseRequest, type AvatarRigNode, type AvatarRigs, type Avatars3dApi, type Base64String, type BonusPreview, type BootMark, type BootTimeline, type BrandingApi, type BrandingAsset, type BrandingAssetOptions, type BrandingCurrency, type BrandingImageOptions, type BrandingList, type BrandingLookup, type BrandingTheme, type BrandingVariant, type BroadcastOptions, type BytesResponse, CONDITIONAL_HEADERS, type Challenge, type ChallengeWindow, ChallengesApi, type ClientOptions, type Clock, type ConditionalRequestHeaders, type ConfigPreview, type ConfiguredPurchasePayment, type ConfiguredPurchaseRequest, type ConfiguredPurchaseResult, type ControlsApi, DEVICE_SETTINGS_MAX_BYTES, DedicatedServerError, type DedicatedServerFailure, type DedicatedServerSession, type DevToolsOpener, type DeviceSettings, type DeviceSettingsApi, type DeviceSettingsPutOutcome, type DirectPurchaseRequest, type DirectPurchaseResult, type EarnAllowance, type EarnAllowanceEvent, type EarnAllowancePeriod, type EarnAllowanceReadOptions, type EarningsApi, type EntityLeaderboard, type EntityLeaderboardEntry, type EntityLeaderboardOptions, type EntityType$1 as EntityType, type ExitAnalytics, type ExitBridge, type ExitRooms, type FrameState, type Friend, type FriendChallenge, FriendChallengeError, type FriendChallengeErrorCode, type FriendChallengeOutcome, type FriendChallengeOutcomeKind, type FriendChallengeRequest, type FriendChallengesPage, FriendsApi, type FriendsPage, type FunctionFailure, type FunctionInvokeOptions, type FunctionResult, FunctionsApi, type GameApi, type GameCard, type GameConfig, type GameMenu, type GameMenuItem, type GamePass, type GameServerLink, type GameSettingsApi, type Gem, GemApiError, type GemAudioChannels, GemClient, type GemCohort, type GemCohorts, GemConfigError, type GemControlBox, type GemCorner, type GemDevTools, type GemErrorReason, GemFrame, GemFunctionError, type GemGameChoiceSetting, type GemGameSetting, type GemGameSettingBase, type GemGameSettingChange, type GemGameSettingIcon, type GemGameSettingOption, type GemGameSettingValue, type GemGameSliderSetting, type GemGameToggleSetting, type GemGraphicsQuality, type GemGraphicsRoute, type GemGraphicsRouteEntry, type GemIdentity, type GemInsets, type GemLook, type GemLookBase, type GemLookDelta, type GemLookOptions, type GemLookSpeed, type GemMatchApi, type GemMatchServer, type GemMatchServerModule, type GemOptions, type GemPlayer, type GemPreferredRoute, type GemPrefs, type GemRecommendedSettings, type GemReservedArea, GemSaveError, type GemServer, type GemServerBundle, type GemServerFactory, type GemServerHost, type GemServerHostProfile, type GemServerHostRead, type GemServerIdentity, type GemServerLifecycle, type GemServerOptions, type GemServerProfile, type GemTerminationNotice, GemUnframedError, type GemViewport, type GetLeaderboardOptions, type GraphicsApi, type HostTokenSource, type HostTokenSourceOptions, type JoinWelcome, type Leaderboard, type LeaderboardEntry, type LeaderboardPeriod, LeaderboardsApi, type ListChallengesOptions, type ListFriendChallengesOptions, type ListFriendsOptions, MAX_PERIODS_BACK, type MatchBackfillState, type MatchBoostMultiplier, type MatchConnectOptions, type MatchConnection, type MatchHosting, type MatchHostingMode, type MatchPlayerBoost, type MatchPlayerReport, type MatchPlayerReportResult, type MatchServeOptions, type MatchTransport, type MenuStyle, type MessageMeta, type MomentKind, type MomentResult, type MomentSignal, type MomentsApi, type MultiTransportSession, PLATFORM_EVENTS, type PassUpsell, type PassesApi, type PassesEvent, type PeriodOptions, PlatformApi, PlatformCurrenciesApi, type PlatformCurrency, type PlatformCurrencyAccess, type PlatformCurrencyPurchasePayment, type PlatformCurrencyPurchaseRequest, type PlatformCurrencyPurchaseResult, type PlatformCurrencyReadOptions, PlatformEarnAllowanceApi, type PlatformEventName, type PlatformGrantPreview, type PlatformGrantSource, type PlayInviteRequest, type PlayerBadge$1 as PlayerBadge, type PlayerBoost, type PlayerBoostMultiplier, type PlayerIdentity, type PlayerProfile, type PlayerScope, PlayerText, type PreferredRouteOptions, PreviewError, type PreviewGrant, type PreviewTarget, type ProfileCallOptions, type ProfileShowcaseEntry$1 as ProfileShowcaseEntry, ProfilesApi, type PurchaseApi, type PurchaseOptions, type PurchaseOutcome, PurchaseRefusal, type PurchaseRefusalCode, type PurchaseRequest, type PurchaseSettlement, type PutBytesOptions, type PutSaveOptions, type RankedRow, type RecipeAvailability, type RecipeLock, type RequestOptions, type RewardCue, type RewardPresentation, type RewardedOption, type RewardedStatus, type RoomArgValue, type SavePage, type SaveRecord, type SendOptions$1 as SendOptions, type ServerApi, type ServerBundleHost, type ServerTokenGrant, type SessionEndReason, type ShareApi, ShareRefusal, type ShareRequest, type ShowPassOutcome, ShowcaseApi, type ShowcaseCallOptions, type ShowcaseFriendEntry, type ShowcaseFriends, type ShowcaseValue, type SignInOutcome, type SignInOutcomeKind, type SimilarGamesOutcome, type SnapshotCurrency, type SnapshotItem, type StoreApi, type StoreOffersOutcome, type StoreSettlement, type TokenGrant, type Transport, type TransportAdvert, type TransportKind, TransportRefusal, type TransportRequest, type TransportResponse, UNRELIABLE_CHANNEL_LABEL, type UnmetRequirement, type VersionedGetOptions, type VersionedResponse, type VibrationApi, type WalletVisibleOptions, type WornAvatar3d$1 as WornAvatar3d, asPlayerText, createBootTimeline, createGem, createGemServer, createHostTokenSource, createMatchServer, defineServer, experimentSelection, leaveAndExit, mapIdentity, markOnResolve, platformIconUrl, presentJoinCredential, readTemplateTransports, readTransportAdvert, reportOnResolve, systemClock, text, toBase64, webTransportAvailable };
|