@series-inc/venus-sdk 3.1.0-beta.0 → 3.1.1-beta.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/README.md +14 -1180
- package/dist/{AdsApi-meVfUcZy.d.mts → AdsApi-BV_VKgMO.d.mts} +467 -269
- package/dist/{AdsApi-meVfUcZy.d.ts → AdsApi-BV_VKgMO.d.ts} +467 -269
- package/dist/chunk-NSSMTXJJ.mjs +7 -0
- package/dist/{chunk-2PDL7CQK.mjs.map → chunk-NSSMTXJJ.mjs.map} +1 -1
- package/dist/{chunk-EMVTVSGL.mjs → chunk-QFQYBUYC.mjs} +978 -1412
- package/dist/chunk-QFQYBUYC.mjs.map +1 -0
- package/dist/chunk-UXY5CKKG.mjs +12 -0
- package/dist/chunk-UXY5CKKG.mjs.map +1 -0
- package/dist/{core-5JLON75E.mjs → core-62LWDHN7.mjs} +3 -3
- package/dist/{core-5JLON75E.mjs.map → core-62LWDHN7.mjs.map} +1 -1
- package/dist/index.cjs +1018 -1783
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +142 -68
- package/dist/index.d.ts +142 -68
- package/dist/index.mjs +3 -7
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +1091 -1883
- package/dist/venus-api/index.cjs.map +1 -1
- package/dist/venus-api/index.d.mts +2 -2
- package/dist/venus-api/index.d.ts +2 -2
- package/dist/venus-api/index.mjs +76 -418
- package/dist/venus-api/index.mjs.map +1 -1
- package/dist/vite/index.cjs.map +1 -1
- package/dist/vite/index.mjs.map +1 -1
- package/dist/webview/index.cjs +4 -335
- package/dist/webview/index.cjs.map +1 -1
- package/dist/webview/index.d.mts +7 -9
- package/dist/webview/index.d.ts +7 -9
- package/dist/webview/index.mjs +2 -2
- package/package.json +5 -3
- package/dist/chunk-2PDL7CQK.mjs +0 -26
- package/dist/chunk-EMVTVSGL.mjs.map +0 -1
- package/dist/chunk-IZLOB7DV.mjs +0 -343
- package/dist/chunk-IZLOB7DV.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-BV_VKgMO.mjs';
|
|
2
|
+
export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-BV_VKgMO.mjs';
|
|
3
3
|
export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './webview/index.mjs';
|
|
4
4
|
|
|
5
5
|
declare class MockAnalyticsApi implements AnalyticsApi {
|
|
@@ -161,15 +161,77 @@ declare class MockPopupsApi implements PopupsApi {
|
|
|
161
161
|
declare function initializePopups(venusApi: VenusAPI, host: Host): void;
|
|
162
162
|
|
|
163
163
|
declare class HostProfileApi implements ProfileApi {
|
|
164
|
+
private readonly venusApi;
|
|
165
|
+
constructor(venusApi: VenusAPI);
|
|
164
166
|
getCurrentProfile(): Profile;
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
declare class MockProfileApi implements ProfileApi {
|
|
170
|
+
private readonly venusApi;
|
|
171
|
+
constructor(venusApi: VenusAPI);
|
|
168
172
|
getCurrentProfile(): Profile;
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
declare function initializeProfile(venusApi: VenusAPI, host: Host): void;
|
|
172
176
|
|
|
177
|
+
declare class HostDeviceApi implements DeviceApi {
|
|
178
|
+
private readonly venusApi;
|
|
179
|
+
constructor(venusApi: VenusAPI);
|
|
180
|
+
getDevice(): DeviceInfo;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare class MockDeviceApi implements DeviceApi {
|
|
184
|
+
private readonly venusApi;
|
|
185
|
+
constructor(venusApi: VenusAPI);
|
|
186
|
+
getDevice(): DeviceInfo;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class HostEnvironmentApi implements EnvironmentApi {
|
|
190
|
+
private readonly venusApi;
|
|
191
|
+
constructor(venusApi: VenusAPI);
|
|
192
|
+
getEnvironment(): EnvironmentInfo;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class MockEnvironmentApi implements EnvironmentApi {
|
|
196
|
+
private readonly venusApi;
|
|
197
|
+
constructor(venusApi: VenusAPI);
|
|
198
|
+
getEnvironment(): EnvironmentInfo;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Host implementation of SystemApi that delegates to device and environment APIs.
|
|
203
|
+
* Acts as a facade combining both system-level information sources.
|
|
204
|
+
*/
|
|
205
|
+
declare class HostSystemApi implements SystemApi {
|
|
206
|
+
private readonly deviceApi;
|
|
207
|
+
private readonly environmentApi;
|
|
208
|
+
private readonly venusApi;
|
|
209
|
+
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
210
|
+
getDevice(): DeviceInfo;
|
|
211
|
+
getEnvironment(): EnvironmentInfo;
|
|
212
|
+
getSafeArea(): SafeArea;
|
|
213
|
+
isMobile(): boolean;
|
|
214
|
+
isWeb(): boolean;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Mock implementation of SystemApi for local development.
|
|
219
|
+
* Delegates to mock device and environment APIs.
|
|
220
|
+
*/
|
|
221
|
+
declare class MockSystemApi implements SystemApi {
|
|
222
|
+
private readonly deviceApi;
|
|
223
|
+
private readonly environmentApi;
|
|
224
|
+
private readonly venusApi;
|
|
225
|
+
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
226
|
+
getDevice(): DeviceInfo;
|
|
227
|
+
getEnvironment(): EnvironmentInfo;
|
|
228
|
+
getSafeArea(): SafeArea;
|
|
229
|
+
isMobile(): boolean;
|
|
230
|
+
isWeb(): boolean;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare function initializeSystem(venusApi: VenusAPI, host: Host): void;
|
|
234
|
+
|
|
173
235
|
declare class HostCdnApi implements CdnApi {
|
|
174
236
|
private readonly baseUrl;
|
|
175
237
|
constructor(baseUrl: string);
|
|
@@ -182,8 +244,10 @@ declare class HostCdnApi implements CdnApi {
|
|
|
182
244
|
}
|
|
183
245
|
|
|
184
246
|
declare class MockCdnApi implements CdnApi {
|
|
185
|
-
private readonly
|
|
186
|
-
constructor();
|
|
247
|
+
private readonly venusApi;
|
|
248
|
+
constructor(venusApi: VenusAPI);
|
|
249
|
+
private get baseUrl();
|
|
250
|
+
private get forceRemoteCdn();
|
|
187
251
|
fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
|
|
188
252
|
getAssetCdnBaseUrl(): string;
|
|
189
253
|
resolveAssetUrl(subPath: string): string;
|
|
@@ -294,69 +358,41 @@ declare function initializeLifecycleApi(venusApi: VenusAPI, host: Host): void;
|
|
|
294
358
|
declare class RpcSimulationApi implements SimulationApi {
|
|
295
359
|
private readonly rpcClient;
|
|
296
360
|
private _simulationConfig;
|
|
361
|
+
private readonly subscriptionCallbacks;
|
|
297
362
|
constructor(rpcClient: RpcClient);
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
363
|
+
isEnabled(): boolean;
|
|
364
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotValidationResult>;
|
|
365
|
+
subscribeAsync(options: SimulationSubscribeOptions): Promise<() => void>;
|
|
366
|
+
executeBatchOperationsAsync(operations: Array<SimulationBatchOperation>, validateOnly?: boolean): Promise<SimulationBatchOperationsResult>;
|
|
367
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<SimulationAvailableItem[]>;
|
|
368
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<SimulationPowerPreview>;
|
|
369
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotMutationResult>;
|
|
370
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<SimulationSlotMutationResult>;
|
|
371
|
+
getSlotContainersAsync(): Promise<SimulationSlotContainer[]>;
|
|
372
|
+
getSlotAssignmentsAsync(containerId: string): Promise<SimulationAssignment[]>;
|
|
373
|
+
getStateAsync(roomId?: string): Promise<SimulationState>;
|
|
308
374
|
getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
|
|
309
|
-
executeRecipeAsync(recipeId: string, inputs?:
|
|
310
|
-
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
311
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
312
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
|
|
313
|
-
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
314
|
-
getRecipeRequirementsAsync(recipe: Recipe): Promise<any>;
|
|
315
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
316
|
-
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
|
|
317
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
318
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
declare class MockSimulationApi implements SimulationApi {
|
|
322
|
-
private readonly mockSimulationConfigs;
|
|
323
|
-
private readonly mockSimulationStates;
|
|
324
|
-
private readonly mockActiveTimers;
|
|
325
|
-
private readonly appId;
|
|
326
|
-
private readonly providedSimulationConfig;
|
|
327
|
-
constructor(simulationConfig?: VenusSimulationConfig | null);
|
|
328
|
-
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
329
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
330
|
-
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
331
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
332
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
333
|
-
getSlotContainersAsync(): Promise<any>;
|
|
334
|
-
getSlotAssignmentsAsync(containerId: string): Promise<any>;
|
|
335
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
336
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
375
|
+
executeRecipeAsync(recipeId: string, inputs?: Record<string, unknown>, options?: ExecuteRecipeOptions): Promise<ExecuteRecipeResponse>;
|
|
337
376
|
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
338
|
-
|
|
339
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?:
|
|
340
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
377
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<SimulationRunSummary[]>;
|
|
378
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, unknown>, options?: ExecuteScopedRecipeOptions): Promise<ExecuteScopedRecipeResult>;
|
|
341
379
|
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
342
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
343
380
|
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
private
|
|
349
|
-
private
|
|
350
|
-
private createSeededRandom;
|
|
351
|
-
private applyEffects;
|
|
352
|
-
getConfigAsync(): Promise<any>;
|
|
353
|
-
getStateAsync(roomId?: string): Promise<any>;
|
|
354
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
355
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
381
|
+
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
382
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<ExecuteRecipeResponse>;
|
|
383
|
+
getEntityMetadataAsync(entityId: string): Promise<Record<string, unknown>>;
|
|
384
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<unknown>;
|
|
385
|
+
private handleSimulationUpdate;
|
|
386
|
+
private ensureValidSubscribeOptions;
|
|
356
387
|
}
|
|
357
388
|
|
|
358
389
|
declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
359
390
|
|
|
391
|
+
interface RoomNotificationSubscriptionState {
|
|
392
|
+
data: Record<string, Array<(event: RoomDataUpdate) => void>>;
|
|
393
|
+
messages: Record<string, Array<(event: RoomMessageEvent) => void>>;
|
|
394
|
+
gameEvents: Record<string, Array<(event: ProposedMoveEvent) => void>>;
|
|
395
|
+
}
|
|
360
396
|
/**
|
|
361
397
|
* Set up room notification listeners using the transport's onVenusMessage hook.
|
|
362
398
|
* This routes host-sent room notifications (H5_ROOM_DATA_UPDATED, etc.) to the
|
|
@@ -364,7 +400,34 @@ declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
|
364
400
|
* @param transport The Venus transport to listen for messages
|
|
365
401
|
* @param getSubscriptions Function to retrieve subscription state from RoomsApi
|
|
366
402
|
*/
|
|
367
|
-
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () =>
|
|
403
|
+
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () => RoomNotificationSubscriptionState): Subscription;
|
|
404
|
+
|
|
405
|
+
declare class RpcRoomsApi implements RoomsApi {
|
|
406
|
+
private readonly rpcClient;
|
|
407
|
+
private readonly subscriptions;
|
|
408
|
+
constructor(rpcClient: RpcClient);
|
|
409
|
+
/**
|
|
410
|
+
* Get the subscription state for external access (used by setupRoomNotifications)
|
|
411
|
+
*/
|
|
412
|
+
getSubscriptions(): RoomNotificationSubscriptionState;
|
|
413
|
+
/**
|
|
414
|
+
* Set up room notification routing from the transport
|
|
415
|
+
*/
|
|
416
|
+
setupNotifications(transport: VenusTransport): void;
|
|
417
|
+
createRoomAsync(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
418
|
+
joinOrCreateRoomAsync(options: JoinOrCreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
419
|
+
joinRoomByCodeAsync(roomCode: string): Promise<VenusRoom>;
|
|
420
|
+
getUserRoomsAsync(options?: ListRoomsOptions): Promise<VenusRoom[]>;
|
|
421
|
+
updateRoomDataAsync(room: VenusRoom, updates: Record<string, unknown>, options?: UpdateRoomDataOptions): Promise<void>;
|
|
422
|
+
getRoomDataAsync(room: VenusRoom): Promise<Record<string, unknown>>;
|
|
423
|
+
sendRoomMessageAsync(venusRoom: VenusRoom, request: RoomMessageRequest): Promise<string>;
|
|
424
|
+
leaveRoomAsync(room: VenusRoom): Promise<void>;
|
|
425
|
+
startRoomGameAsync(room: VenusRoom, options?: StartRoomGameOptions): Promise<void>;
|
|
426
|
+
proposeMoveAsync(room: VenusRoom, proposalPayload: ProposeMoveRequest): Promise<ProposeMoveResult>;
|
|
427
|
+
validateMoveAsync(_room: VenusRoom, moveId: string, verdict: ValidateMoveVerdict): Promise<ValidateMoveResult>;
|
|
428
|
+
subscribeAsync(room: VenusRoom, options?: RoomSubscriptionOptions): Promise<() => void>;
|
|
429
|
+
}
|
|
430
|
+
|
|
368
431
|
declare function initializeRoomsApi(venusApi: VenusAPI, host: Host): void;
|
|
369
432
|
|
|
370
433
|
declare class MockLoggingApi implements LoggingApi {
|
|
@@ -686,10 +749,6 @@ declare enum VenusMessageId {
|
|
|
686
749
|
CONFIRM_DIALOG = "H5_CONFIRM_DIALOG",
|
|
687
750
|
ACTION_SHEET_SHOW = "H5_ACTION_SHEET_SHOW",
|
|
688
751
|
REQUEST_SERVER_TIME = "H5_REQUEST_SERVER_TIME",
|
|
689
|
-
GET_POST_INTERACTIONS = "H5_GET_POST_INTERACTIONS",
|
|
690
|
-
TOGGLE_LIKE = "H5_TOGGLE_LIKE",
|
|
691
|
-
OPEN_COMMENTS = "H5_OPEN_COMMENTS",// For opening comments with callback support
|
|
692
|
-
TOGGLE_FOLLOW = "H5_TOGGLE_FOLLOW",
|
|
693
752
|
SHARE_LINK = "H5_SHARE_LINK",
|
|
694
753
|
CREATE_SHARE_QRCODE = "H5_CREATE_SHARE_QRCODE",
|
|
695
754
|
AI_CHAT_COMPLETION = "H5_AI_CHAT_COMPLETION",
|
|
@@ -734,6 +793,9 @@ declare enum VenusMessageId {
|
|
|
734
793
|
H5_SIMULATION_GET_AVAILABLE_ITEMS = "H5_SIMULATION_GET_AVAILABLE_ITEMS",
|
|
735
794
|
H5_SIMULATION_VALIDATE_ASSIGNMENT = "H5_SIMULATION_VALIDATE_ASSIGNMENT",
|
|
736
795
|
H5_SIMULATION_BATCH_OPERATIONS = "H5_SIMULATION_BATCH_OPERATIONS",
|
|
796
|
+
H5_SIMULATION_SUBSCRIBE = "H5_SIMULATION_SUBSCRIBE",
|
|
797
|
+
H5_SIMULATION_UNSUBSCRIBE = "H5_SIMULATION_UNSUBSCRIBE",
|
|
798
|
+
H5_SIMULATION_UPDATE = "H5_SIMULATION_UPDATE",
|
|
737
799
|
H5_LEADERBOARD_CREATE_SCORE_TOKEN = "H5_LEADERBOARD_CREATE_SCORE_TOKEN",
|
|
738
800
|
H5_LEADERBOARD_SUBMIT_SCORE = "H5_LEADERBOARD_SUBMIT_SCORE",
|
|
739
801
|
H5_LEADERBOARD_GET_PAGED_SCORES = "H5_LEADERBOARD_GET_PAGED_SCORES",
|
|
@@ -781,9 +843,9 @@ declare class RemoteHost implements Host {
|
|
|
781
843
|
readonly notifications: NotificationsApi;
|
|
782
844
|
readonly popups: PopupsApi;
|
|
783
845
|
readonly profile: ProfileApi;
|
|
846
|
+
readonly system: SystemApi;
|
|
784
847
|
readonly cdn: CdnApi;
|
|
785
848
|
readonly time: TimeApi;
|
|
786
|
-
readonly post: PostApi;
|
|
787
849
|
readonly ai: AiApi;
|
|
788
850
|
readonly haptics: HapticsApi;
|
|
789
851
|
readonly features: FeaturesApi;
|
|
@@ -806,14 +868,26 @@ declare class RemoteHost implements Host {
|
|
|
806
868
|
interface InitResponse {
|
|
807
869
|
initializeAsleep: boolean;
|
|
808
870
|
instanceId: string;
|
|
809
|
-
profile
|
|
871
|
+
profile: {
|
|
810
872
|
id: string;
|
|
811
873
|
username: string;
|
|
812
874
|
avatarUrl?: string | null;
|
|
813
875
|
isAnonymous?: boolean;
|
|
814
876
|
};
|
|
815
|
-
|
|
816
|
-
launchParams
|
|
877
|
+
safeArea?: SafeArea;
|
|
878
|
+
launchParams: Record<string, string>;
|
|
879
|
+
environment: EnvironmentInfo;
|
|
880
|
+
device: DeviceInfo;
|
|
881
|
+
locale: string;
|
|
882
|
+
languageCode: string;
|
|
883
|
+
rooms?: {
|
|
884
|
+
gameType?: string;
|
|
885
|
+
rulesPreset?: string;
|
|
886
|
+
matchmaking?: Record<string, any>;
|
|
887
|
+
createOptions?: Record<string, any>;
|
|
888
|
+
privateMatchDefaults?: Record<string, any>;
|
|
889
|
+
[key: string]: any;
|
|
890
|
+
};
|
|
817
891
|
}
|
|
818
892
|
|
|
819
|
-
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, DEFAULT_SHARED_LIB_CDN_BASE, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, type EmbeddedLibraryDefinition, ExecuteRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetPagedScoresOptions, GetPodiumScoresOptions, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostProfileApi,
|
|
893
|
+
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, CreateRoomOptions, DEFAULT_SHARED_LIB_CDN_BASE, DeviceApi, DeviceInfo, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, type EmbeddedLibraryDefinition, EnvironmentApi, EnvironmentInfo, ExecuteRecipeOptions, ExecuteRecipeResponse, ExecuteScopedRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetPagedScoresOptions, GetPodiumScoresOptions, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostDeviceApi, HostEnvironmentApi, HostProfileApi, HostSystemApi, HostTimeApi, IapApi, type InitResponse, InitializationContext, InitializationOptions, JoinOrCreateResult, JoinOrCreateRoomOptions, LeaderboardApi, LifecycleApi, ListRoomsOptions, LoadEmbeddedAssetsResponse, LoggingApi, MODULE_TO_LIBRARY_SPECIFIERS, type MethodIds, MockAdsApi, MockAiApi, MockAnalyticsApi, MockCdnApi, MockDeviceApi, MockEnvironmentApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSocialApi, MockStorageApi, MockSystemApi, MockTimeApi, type ModuleSpecifierConfig, type ModuleSpecifierMatch, NavigationApi, NavigationStackInfo, type NotificationContent, NotificationsApi, PagedScoresResponse, PauseCallback, PlayerRankOptions, PlayerRankResult, PodiumScoresResponse, PopupsApi, PreloaderApi, ProfileApi, ProposeMoveRequest, ProposeMoveResult, ProposedMoveEvent, PushAppOptions, QRCodeResult, QuitCallback, QuitOptions, Recipe, RemoteHost, ResumeCallback, RoomDataUpdate, RoomMessageEvent, RoomMessageRequest, type RoomNotificationSubscriptionState, RoomSubscriptionOptions, RoomsApi, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, type RpcMessage, RpcNavigationApi, RpcNotification, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRequest, RpcResponse, RpcRoomsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, SafeArea, ScheduleLocalNotification, ScheduleNotificationOptions, ScoreToken, ServerTimeData, ShareLinkResult, ShareMetadata, SharedAssetsApi, ShowActionSheetOptions, ShowAlertOptions, ShowConfirmOptions, ShowEditorOptions, ShowInterstitialAdOptions, ShowRewardedAdOptions, ShowToastOptions, type ShowToastResponse, SimulationApi, SimulationAssignment, SimulationAvailableItem, SimulationBatchOperation, SimulationBatchOperationsResult, SimulationPowerPreview, SimulationRunSummary, SimulationSlotContainer, SimulationSlotMutationResult, SimulationSlotValidationResult, SimulationState, SleepCallback, SocialApi, SocialQRCodeOptions, SpendCurrencyOptions, StartRoomGameOptions, StorageApi, type StorageType, SubPath, SubmitScoreParams, SubmitScoreResult, Subscription, SystemApi, TimeApi, TriggerRecipeChainOptions, UpdateRoomDataOptions, ValidateMoveResult, ValidateMoveVerdict, VenusMessageId, VenusRoom, base64ToArrayBuffer, base64ToUtf8, computeScoreHash, createMockStorageApi, getLibraryDefinition, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeSystem, initializeTime, isPacificDaylightTime, setupRoomNotifications };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
1
|
+
import { r as AnalyticsApi, s as RpcRequest, t as RpcResponse, u as RpcNotification, v as RpcClient, V as VenusAPI, H as Host, w as StorageApi, N as NavigationApi, Q as QuitOptions, x as NavigationStackInfo, y as PushAppOptions, z as NotificationsApi, C as ScheduleLocalNotification, D as ScheduleNotificationOptions, E as PopupsApi, F as ActionSheetItem, G as ShowActionSheetOptions, I as ShowAlertOptions, J as ShowConfirmOptions, K as ShowToastOptions, L as ShowInterstitialAdOptions, M as ShowRewardedAdOptions, O as ProfileApi, P as Profile, T as DeviceApi, U as DeviceInfo, W as EnvironmentApi, X as EnvironmentInfo, Y as SystemApi, Z as SafeArea, _ as CdnApi, $ as SubPath, a0 as FetchBlobOptions, a1 as TimeApi, a2 as ServerTimeData, a3 as GetFutureTimeOptions, a4 as AiApi, a5 as AiChatCompletionRequest, a6 as AiChatCompletionData, a7 as HapticsApi, a8 as HapticFeedbackStyle, a9 as FeaturesApi, aa as Experiment, ab as LifecycleApi, ac as SleepCallback, ad as Subscription, ae as AwakeCallback, af as PauseCallback, ag as ResumeCallback, ah as QuitCallback, ai as SimulationApi, aj as SimulationSlotValidationResult, g as SimulationSubscribeOptions, ak as SimulationBatchOperation, al as SimulationBatchOperationsResult, am as SimulationAvailableItem, an as SimulationPowerPreview, ao as SimulationSlotMutationResult, ap as SimulationSlotContainer, aq as SimulationAssignment, ar as SimulationState, j as VenusSimulationConfig, as as ExecuteRecipeOptions, at as ExecuteRecipeResponse, au as CollectRecipeResult, av as GetActiveRunsOptions, S as SimulationRunSummary, aw as ExecuteScopedRecipeOptions, ax as ExecuteScopedRecipeResult, ay as GetAvailableRecipesOptions, az as GetAvailableRecipesResult, aA as Recipe, R as RecipeRequirementResult, aB as GetBatchRecipeRequirements, aC as TriggerRecipeChainOptions, aD as RoomDataUpdate, aE as RoomMessageEvent, aF as ProposedMoveEvent, aG as VenusTransport, aH as RoomsApi, aI as CreateRoomOptions, q as VenusRoom, aJ as JoinOrCreateRoomOptions, aK as JoinOrCreateResult, aL as ListRoomsOptions, aM as UpdateRoomDataOptions, aN as RoomMessageRequest, aO as StartRoomGameOptions, aP as ProposeMoveRequest, aQ as ProposeMoveResult, aR as ValidateMoveVerdict, aS as ValidateMoveResult, aT as RoomSubscriptionOptions, aU as LoggingApi, aV as IapApi, aW as SpendCurrencyOptions, aX as LoadEmbeddedAssetsResponse, aY as SharedAssetsApi, aZ as LeaderboardApi, a_ as ScoreToken, a$ as SubmitScoreParams, b0 as SubmitScoreResult, b1 as GetPagedScoresOptions, b2 as PagedScoresResponse, b3 as PlayerRankOptions, b4 as PlayerRankResult, b5 as GetPodiumScoresOptions, b6 as PodiumScoresResponse, b7 as PreloaderApi, b8 as SocialApi, b9 as ShareMetadata, ba as ShareLinkResult, bb as SocialQRCodeOptions, bc as QRCodeResult, bd as Avatar3dApi, be as AssetManifest, bf as Avatar3dConfig, bg as ShowEditorOptions, bh as Avatar3dEdits, bi as AdsApi, bj as InitializationOptions, bk as InitializationContext } from './AdsApi-BV_VKgMO.js';
|
|
2
|
+
export { bl as AiMessage, bm as Asset, bn as Category, bP as HudInsets, bv as JoinRoomMatchCriteria, bK as LeaderboardAntiCheatConfig, bM as LeaderboardConfig, bL as LeaderboardDisplaySettings, bN as LeaderboardEntry, bH as LeaderboardModeConfig, bJ as LeaderboardPeriodConfig, bI as LeaderboardPeriodType, bG as LoadEmbeddedAssetsRequest, bo as MockAvatarApi, bq as NotificationTriggerInput, bt as OnNotificationCallback, br as OnRequestCallback, bs as OnResponseCallback, bO as PodiumScoresContext, by as RecipeInfo, bw as RoomMessageEventType, bF as RpcSharedAssetsApi, bu as RpcTransport, bC as SimulationBatchOperationAssign, bD as SimulationBatchOperationRemove, bE as SimulationBatchOperationResult, bz as SimulationPersonalState, bA as SimulationRoomActiveRecipe, bB as SimulationRoomState, bp as TimeIntervalTriggerInput, bx as VenusRoomPayload, bQ as createHost } from './AdsApi-BV_VKgMO.js';
|
|
3
3
|
export { WEBVIEW_LIBRARY_SHIM_SOURCE, getWebviewLibraryShimSource } from './webview/index.js';
|
|
4
4
|
|
|
5
5
|
declare class MockAnalyticsApi implements AnalyticsApi {
|
|
@@ -161,15 +161,77 @@ declare class MockPopupsApi implements PopupsApi {
|
|
|
161
161
|
declare function initializePopups(venusApi: VenusAPI, host: Host): void;
|
|
162
162
|
|
|
163
163
|
declare class HostProfileApi implements ProfileApi {
|
|
164
|
+
private readonly venusApi;
|
|
165
|
+
constructor(venusApi: VenusAPI);
|
|
164
166
|
getCurrentProfile(): Profile;
|
|
165
167
|
}
|
|
166
168
|
|
|
167
169
|
declare class MockProfileApi implements ProfileApi {
|
|
170
|
+
private readonly venusApi;
|
|
171
|
+
constructor(venusApi: VenusAPI);
|
|
168
172
|
getCurrentProfile(): Profile;
|
|
169
173
|
}
|
|
170
174
|
|
|
171
175
|
declare function initializeProfile(venusApi: VenusAPI, host: Host): void;
|
|
172
176
|
|
|
177
|
+
declare class HostDeviceApi implements DeviceApi {
|
|
178
|
+
private readonly venusApi;
|
|
179
|
+
constructor(venusApi: VenusAPI);
|
|
180
|
+
getDevice(): DeviceInfo;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
declare class MockDeviceApi implements DeviceApi {
|
|
184
|
+
private readonly venusApi;
|
|
185
|
+
constructor(venusApi: VenusAPI);
|
|
186
|
+
getDevice(): DeviceInfo;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
declare class HostEnvironmentApi implements EnvironmentApi {
|
|
190
|
+
private readonly venusApi;
|
|
191
|
+
constructor(venusApi: VenusAPI);
|
|
192
|
+
getEnvironment(): EnvironmentInfo;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
declare class MockEnvironmentApi implements EnvironmentApi {
|
|
196
|
+
private readonly venusApi;
|
|
197
|
+
constructor(venusApi: VenusAPI);
|
|
198
|
+
getEnvironment(): EnvironmentInfo;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
/**
|
|
202
|
+
* Host implementation of SystemApi that delegates to device and environment APIs.
|
|
203
|
+
* Acts as a facade combining both system-level information sources.
|
|
204
|
+
*/
|
|
205
|
+
declare class HostSystemApi implements SystemApi {
|
|
206
|
+
private readonly deviceApi;
|
|
207
|
+
private readonly environmentApi;
|
|
208
|
+
private readonly venusApi;
|
|
209
|
+
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
210
|
+
getDevice(): DeviceInfo;
|
|
211
|
+
getEnvironment(): EnvironmentInfo;
|
|
212
|
+
getSafeArea(): SafeArea;
|
|
213
|
+
isMobile(): boolean;
|
|
214
|
+
isWeb(): boolean;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Mock implementation of SystemApi for local development.
|
|
219
|
+
* Delegates to mock device and environment APIs.
|
|
220
|
+
*/
|
|
221
|
+
declare class MockSystemApi implements SystemApi {
|
|
222
|
+
private readonly deviceApi;
|
|
223
|
+
private readonly environmentApi;
|
|
224
|
+
private readonly venusApi;
|
|
225
|
+
constructor(deviceApi: DeviceApi, environmentApi: EnvironmentApi, venusApi: VenusAPI);
|
|
226
|
+
getDevice(): DeviceInfo;
|
|
227
|
+
getEnvironment(): EnvironmentInfo;
|
|
228
|
+
getSafeArea(): SafeArea;
|
|
229
|
+
isMobile(): boolean;
|
|
230
|
+
isWeb(): boolean;
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
declare function initializeSystem(venusApi: VenusAPI, host: Host): void;
|
|
234
|
+
|
|
173
235
|
declare class HostCdnApi implements CdnApi {
|
|
174
236
|
private readonly baseUrl;
|
|
175
237
|
constructor(baseUrl: string);
|
|
@@ -182,8 +244,10 @@ declare class HostCdnApi implements CdnApi {
|
|
|
182
244
|
}
|
|
183
245
|
|
|
184
246
|
declare class MockCdnApi implements CdnApi {
|
|
185
|
-
private readonly
|
|
186
|
-
constructor();
|
|
247
|
+
private readonly venusApi;
|
|
248
|
+
constructor(venusApi: VenusAPI);
|
|
249
|
+
private get baseUrl();
|
|
250
|
+
private get forceRemoteCdn();
|
|
187
251
|
fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
|
|
188
252
|
getAssetCdnBaseUrl(): string;
|
|
189
253
|
resolveAssetUrl(subPath: string): string;
|
|
@@ -294,69 +358,41 @@ declare function initializeLifecycleApi(venusApi: VenusAPI, host: Host): void;
|
|
|
294
358
|
declare class RpcSimulationApi implements SimulationApi {
|
|
295
359
|
private readonly rpcClient;
|
|
296
360
|
private _simulationConfig;
|
|
361
|
+
private readonly subscriptionCallbacks;
|
|
297
362
|
constructor(rpcClient: RpcClient);
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
363
|
+
isEnabled(): boolean;
|
|
364
|
+
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotValidationResult>;
|
|
365
|
+
subscribeAsync(options: SimulationSubscribeOptions): Promise<() => void>;
|
|
366
|
+
executeBatchOperationsAsync(operations: Array<SimulationBatchOperation>, validateOnly?: boolean): Promise<SimulationBatchOperationsResult>;
|
|
367
|
+
getAvailableItemsAsync(containerId: string, slotId: string): Promise<SimulationAvailableItem[]>;
|
|
368
|
+
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<SimulationPowerPreview>;
|
|
369
|
+
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<SimulationSlotMutationResult>;
|
|
370
|
+
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<SimulationSlotMutationResult>;
|
|
371
|
+
getSlotContainersAsync(): Promise<SimulationSlotContainer[]>;
|
|
372
|
+
getSlotAssignmentsAsync(containerId: string): Promise<SimulationAssignment[]>;
|
|
373
|
+
getStateAsync(roomId?: string): Promise<SimulationState>;
|
|
308
374
|
getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
|
|
309
|
-
executeRecipeAsync(recipeId: string, inputs?:
|
|
310
|
-
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
311
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
312
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
|
|
313
|
-
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
314
|
-
getRecipeRequirementsAsync(recipe: Recipe): Promise<any>;
|
|
315
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
316
|
-
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
|
|
317
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
318
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
declare class MockSimulationApi implements SimulationApi {
|
|
322
|
-
private readonly mockSimulationConfigs;
|
|
323
|
-
private readonly mockSimulationStates;
|
|
324
|
-
private readonly mockActiveTimers;
|
|
325
|
-
private readonly appId;
|
|
326
|
-
private readonly providedSimulationConfig;
|
|
327
|
-
constructor(simulationConfig?: VenusSimulationConfig | null);
|
|
328
|
-
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
329
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
330
|
-
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
331
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
332
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
333
|
-
getSlotContainersAsync(): Promise<any>;
|
|
334
|
-
getSlotAssignmentsAsync(containerId: string): Promise<any>;
|
|
335
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
336
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
375
|
+
executeRecipeAsync(recipeId: string, inputs?: Record<string, unknown>, options?: ExecuteRecipeOptions): Promise<ExecuteRecipeResponse>;
|
|
337
376
|
collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
|
|
338
|
-
|
|
339
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?:
|
|
340
|
-
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
|
|
377
|
+
getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<SimulationRunSummary[]>;
|
|
378
|
+
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, unknown>, options?: ExecuteScopedRecipeOptions): Promise<ExecuteScopedRecipeResult>;
|
|
341
379
|
getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
|
|
342
|
-
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
343
380
|
getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
private
|
|
349
|
-
private
|
|
350
|
-
private createSeededRandom;
|
|
351
|
-
private applyEffects;
|
|
352
|
-
getConfigAsync(): Promise<any>;
|
|
353
|
-
getStateAsync(roomId?: string): Promise<any>;
|
|
354
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
355
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
381
|
+
getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
|
|
382
|
+
triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<ExecuteRecipeResponse>;
|
|
383
|
+
getEntityMetadataAsync(entityId: string): Promise<Record<string, unknown>>;
|
|
384
|
+
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<unknown>;
|
|
385
|
+
private handleSimulationUpdate;
|
|
386
|
+
private ensureValidSubscribeOptions;
|
|
356
387
|
}
|
|
357
388
|
|
|
358
389
|
declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
359
390
|
|
|
391
|
+
interface RoomNotificationSubscriptionState {
|
|
392
|
+
data: Record<string, Array<(event: RoomDataUpdate) => void>>;
|
|
393
|
+
messages: Record<string, Array<(event: RoomMessageEvent) => void>>;
|
|
394
|
+
gameEvents: Record<string, Array<(event: ProposedMoveEvent) => void>>;
|
|
395
|
+
}
|
|
360
396
|
/**
|
|
361
397
|
* Set up room notification listeners using the transport's onVenusMessage hook.
|
|
362
398
|
* This routes host-sent room notifications (H5_ROOM_DATA_UPDATED, etc.) to the
|
|
@@ -364,7 +400,34 @@ declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
|
|
|
364
400
|
* @param transport The Venus transport to listen for messages
|
|
365
401
|
* @param getSubscriptions Function to retrieve subscription state from RoomsApi
|
|
366
402
|
*/
|
|
367
|
-
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () =>
|
|
403
|
+
declare function setupRoomNotifications(transport: VenusTransport, getSubscriptions: () => RoomNotificationSubscriptionState): Subscription;
|
|
404
|
+
|
|
405
|
+
declare class RpcRoomsApi implements RoomsApi {
|
|
406
|
+
private readonly rpcClient;
|
|
407
|
+
private readonly subscriptions;
|
|
408
|
+
constructor(rpcClient: RpcClient);
|
|
409
|
+
/**
|
|
410
|
+
* Get the subscription state for external access (used by setupRoomNotifications)
|
|
411
|
+
*/
|
|
412
|
+
getSubscriptions(): RoomNotificationSubscriptionState;
|
|
413
|
+
/**
|
|
414
|
+
* Set up room notification routing from the transport
|
|
415
|
+
*/
|
|
416
|
+
setupNotifications(transport: VenusTransport): void;
|
|
417
|
+
createRoomAsync(options: CreateRoomOptions): Promise<VenusRoom>;
|
|
418
|
+
joinOrCreateRoomAsync(options: JoinOrCreateRoomOptions): Promise<JoinOrCreateResult>;
|
|
419
|
+
joinRoomByCodeAsync(roomCode: string): Promise<VenusRoom>;
|
|
420
|
+
getUserRoomsAsync(options?: ListRoomsOptions): Promise<VenusRoom[]>;
|
|
421
|
+
updateRoomDataAsync(room: VenusRoom, updates: Record<string, unknown>, options?: UpdateRoomDataOptions): Promise<void>;
|
|
422
|
+
getRoomDataAsync(room: VenusRoom): Promise<Record<string, unknown>>;
|
|
423
|
+
sendRoomMessageAsync(venusRoom: VenusRoom, request: RoomMessageRequest): Promise<string>;
|
|
424
|
+
leaveRoomAsync(room: VenusRoom): Promise<void>;
|
|
425
|
+
startRoomGameAsync(room: VenusRoom, options?: StartRoomGameOptions): Promise<void>;
|
|
426
|
+
proposeMoveAsync(room: VenusRoom, proposalPayload: ProposeMoveRequest): Promise<ProposeMoveResult>;
|
|
427
|
+
validateMoveAsync(_room: VenusRoom, moveId: string, verdict: ValidateMoveVerdict): Promise<ValidateMoveResult>;
|
|
428
|
+
subscribeAsync(room: VenusRoom, options?: RoomSubscriptionOptions): Promise<() => void>;
|
|
429
|
+
}
|
|
430
|
+
|
|
368
431
|
declare function initializeRoomsApi(venusApi: VenusAPI, host: Host): void;
|
|
369
432
|
|
|
370
433
|
declare class MockLoggingApi implements LoggingApi {
|
|
@@ -686,10 +749,6 @@ declare enum VenusMessageId {
|
|
|
686
749
|
CONFIRM_DIALOG = "H5_CONFIRM_DIALOG",
|
|
687
750
|
ACTION_SHEET_SHOW = "H5_ACTION_SHEET_SHOW",
|
|
688
751
|
REQUEST_SERVER_TIME = "H5_REQUEST_SERVER_TIME",
|
|
689
|
-
GET_POST_INTERACTIONS = "H5_GET_POST_INTERACTIONS",
|
|
690
|
-
TOGGLE_LIKE = "H5_TOGGLE_LIKE",
|
|
691
|
-
OPEN_COMMENTS = "H5_OPEN_COMMENTS",// For opening comments with callback support
|
|
692
|
-
TOGGLE_FOLLOW = "H5_TOGGLE_FOLLOW",
|
|
693
752
|
SHARE_LINK = "H5_SHARE_LINK",
|
|
694
753
|
CREATE_SHARE_QRCODE = "H5_CREATE_SHARE_QRCODE",
|
|
695
754
|
AI_CHAT_COMPLETION = "H5_AI_CHAT_COMPLETION",
|
|
@@ -734,6 +793,9 @@ declare enum VenusMessageId {
|
|
|
734
793
|
H5_SIMULATION_GET_AVAILABLE_ITEMS = "H5_SIMULATION_GET_AVAILABLE_ITEMS",
|
|
735
794
|
H5_SIMULATION_VALIDATE_ASSIGNMENT = "H5_SIMULATION_VALIDATE_ASSIGNMENT",
|
|
736
795
|
H5_SIMULATION_BATCH_OPERATIONS = "H5_SIMULATION_BATCH_OPERATIONS",
|
|
796
|
+
H5_SIMULATION_SUBSCRIBE = "H5_SIMULATION_SUBSCRIBE",
|
|
797
|
+
H5_SIMULATION_UNSUBSCRIBE = "H5_SIMULATION_UNSUBSCRIBE",
|
|
798
|
+
H5_SIMULATION_UPDATE = "H5_SIMULATION_UPDATE",
|
|
737
799
|
H5_LEADERBOARD_CREATE_SCORE_TOKEN = "H5_LEADERBOARD_CREATE_SCORE_TOKEN",
|
|
738
800
|
H5_LEADERBOARD_SUBMIT_SCORE = "H5_LEADERBOARD_SUBMIT_SCORE",
|
|
739
801
|
H5_LEADERBOARD_GET_PAGED_SCORES = "H5_LEADERBOARD_GET_PAGED_SCORES",
|
|
@@ -781,9 +843,9 @@ declare class RemoteHost implements Host {
|
|
|
781
843
|
readonly notifications: NotificationsApi;
|
|
782
844
|
readonly popups: PopupsApi;
|
|
783
845
|
readonly profile: ProfileApi;
|
|
846
|
+
readonly system: SystemApi;
|
|
784
847
|
readonly cdn: CdnApi;
|
|
785
848
|
readonly time: TimeApi;
|
|
786
|
-
readonly post: PostApi;
|
|
787
849
|
readonly ai: AiApi;
|
|
788
850
|
readonly haptics: HapticsApi;
|
|
789
851
|
readonly features: FeaturesApi;
|
|
@@ -806,14 +868,26 @@ declare class RemoteHost implements Host {
|
|
|
806
868
|
interface InitResponse {
|
|
807
869
|
initializeAsleep: boolean;
|
|
808
870
|
instanceId: string;
|
|
809
|
-
profile
|
|
871
|
+
profile: {
|
|
810
872
|
id: string;
|
|
811
873
|
username: string;
|
|
812
874
|
avatarUrl?: string | null;
|
|
813
875
|
isAnonymous?: boolean;
|
|
814
876
|
};
|
|
815
|
-
|
|
816
|
-
launchParams
|
|
877
|
+
safeArea?: SafeArea;
|
|
878
|
+
launchParams: Record<string, string>;
|
|
879
|
+
environment: EnvironmentInfo;
|
|
880
|
+
device: DeviceInfo;
|
|
881
|
+
locale: string;
|
|
882
|
+
languageCode: string;
|
|
883
|
+
rooms?: {
|
|
884
|
+
gameType?: string;
|
|
885
|
+
rulesPreset?: string;
|
|
886
|
+
matchmaking?: Record<string, any>;
|
|
887
|
+
createOptions?: Record<string, any>;
|
|
888
|
+
privateMatchDefaults?: Record<string, any>;
|
|
889
|
+
[key: string]: any;
|
|
890
|
+
};
|
|
817
891
|
}
|
|
818
892
|
|
|
819
|
-
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, DEFAULT_SHARED_LIB_CDN_BASE, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, type EmbeddedLibraryDefinition, ExecuteRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetPagedScoresOptions, GetPodiumScoresOptions, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostProfileApi,
|
|
893
|
+
export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, AwakeCallback, CdnApi, CollectRecipeResult, CreateRoomOptions, DEFAULT_SHARED_LIB_CDN_BASE, DeviceApi, DeviceInfo, EMBEDDED_LIBRARIES, EMBEDDED_LIBRARY_BY_KEY, type EmbeddedLibraryDefinition, EnvironmentApi, EnvironmentInfo, ExecuteRecipeOptions, ExecuteRecipeResponse, ExecuteScopedRecipeOptions, ExecuteScopedRecipeResult, Experiment, FeaturesApi, FetchBlobOptions, GetActiveRunsOptions, GetAvailableRecipesOptions, GetAvailableRecipesResult, GetBatchRecipeRequirements, GetFutureTimeOptions, GetPagedScoresOptions, GetPodiumScoresOptions, HASH_ALGORITHM_NODE, HASH_ALGORITHM_WEB_CRYPTO, HapticFeedbackStyle, HapticsApi, Host, HostCdnApi, HostDeviceApi, HostEnvironmentApi, HostProfileApi, HostSystemApi, HostTimeApi, IapApi, type InitResponse, InitializationContext, InitializationOptions, JoinOrCreateResult, JoinOrCreateRoomOptions, LeaderboardApi, LifecycleApi, ListRoomsOptions, LoadEmbeddedAssetsResponse, LoggingApi, MODULE_TO_LIBRARY_SPECIFIERS, type MethodIds, MockAdsApi, MockAiApi, MockAnalyticsApi, MockCdnApi, MockDeviceApi, MockEnvironmentApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLeaderboardApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockPreloaderApi, MockProfileApi, MockSharedAssetsApi, MockSocialApi, MockStorageApi, MockSystemApi, MockTimeApi, type ModuleSpecifierConfig, type ModuleSpecifierMatch, NavigationApi, NavigationStackInfo, type NotificationContent, NotificationsApi, PagedScoresResponse, PauseCallback, PlayerRankOptions, PlayerRankResult, PodiumScoresResponse, PopupsApi, PreloaderApi, ProfileApi, ProposeMoveRequest, ProposeMoveResult, ProposedMoveEvent, PushAppOptions, QRCodeResult, QuitCallback, QuitOptions, Recipe, RemoteHost, ResumeCallback, RoomDataUpdate, RoomMessageEvent, RoomMessageRequest, type RoomNotificationSubscriptionState, RoomSubscriptionOptions, RoomsApi, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLeaderboardApi, RpcLifecycleApi, RpcLoggingApi, type RpcMessage, RpcNavigationApi, RpcNotification, RpcNotificationsApi, RpcPopupsApi, RpcPreloaderApi, RpcRequest, RpcResponse, RpcRoomsApi, RpcSimulationApi, RpcSocialApi, RpcStorageApi, SDK_VERSION, SafeArea, ScheduleLocalNotification, ScheduleNotificationOptions, ScoreToken, ServerTimeData, ShareLinkResult, ShareMetadata, SharedAssetsApi, ShowActionSheetOptions, ShowAlertOptions, ShowConfirmOptions, ShowEditorOptions, ShowInterstitialAdOptions, ShowRewardedAdOptions, ShowToastOptions, type ShowToastResponse, SimulationApi, SimulationAssignment, SimulationAvailableItem, SimulationBatchOperation, SimulationBatchOperationsResult, SimulationPowerPreview, SimulationRunSummary, SimulationSlotContainer, SimulationSlotMutationResult, SimulationSlotValidationResult, SimulationState, SleepCallback, SocialApi, SocialQRCodeOptions, SpendCurrencyOptions, StartRoomGameOptions, StorageApi, type StorageType, SubPath, SubmitScoreParams, SubmitScoreResult, Subscription, SystemApi, TimeApi, TriggerRecipeChainOptions, UpdateRoomDataOptions, ValidateMoveResult, ValidateMoveVerdict, VenusMessageId, VenusRoom, base64ToArrayBuffer, base64ToUtf8, computeScoreHash, createMockStorageApi, getLibraryDefinition, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLeaderboard, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializePreloader, initializeProfile, initializeRoomsApi, initializeSimulation, initializeSocial, initializeStackNavigation, initializeStorage, initializeSystem, initializeTime, isPacificDaylightTime, setupRoomNotifications };
|