@series-inc/venus-sdk 2.2.0

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.
@@ -0,0 +1,702 @@
1
+ import { A as AnalyticsApi, V as VenusAPI, N as NavigationApi, Q as QuitOptions, a as NavigationStackInfo, P as PushAppOptions, b as PopupsApi, c as ActionSheetItem, S as ShowActionSheetOptions, d as ShowAlertOptions, e as ShowConfirmOptions, f as ShowToastOptions, g as Profile, h as AiApi, i as AiChatCompletionRequest, j as AiChatCompletionData, H as HapticsApi, k as HapticFeedbackStyle, L as LifecycleApi, O as OnCleanupCallback, l as OnShowCallback, m as OnHideCallback, n as OnPauseCallback, o as OnPlayCallback, p as OnQuitCallback, q as OnResumeCallback, r as PlayContext, s as ShowContext, t as VenusSimulationConfig, R as RecipeRequirementResult, I as IapApi, u as SpendCurrencyOptions, v as AdsApi, w as Avatar3dApi, C as CdnApi, x as AssetManifest, y as Avatar3dConfig, z as ShowEditorOptions, B as Avatar3dEdits, D as SubPath, F as FetchBlobOptions } from './AdsApi-BbMHVPYM.mjs';
2
+ export { E as AiMessage, G as Asset, J as Category, K as Insets, M as MockAvatarApi, T as PostInfo } from './AdsApi-BbMHVPYM.mjs';
3
+
4
+ declare class MockAnalyticsApi implements AnalyticsApi {
5
+ recordCustomEvent(eventName: string, payload: Record<string, any>): Promise<void>;
6
+ trackFunnelStep(stepNumber: number, stepName: string, funnelName?: string): Promise<void>;
7
+ }
8
+
9
+ interface RpcRequest {
10
+ type: 'rpc-request';
11
+ id: string;
12
+ method: string;
13
+ args?: any[];
14
+ }
15
+
16
+ interface RpcResponse {
17
+ type: 'rpc-response';
18
+ id: string;
19
+ method: string;
20
+ result?: any;
21
+ error?: {
22
+ message: string;
23
+ stack?: string;
24
+ };
25
+ }
26
+
27
+ interface RpcNotification {
28
+ type: 'rpc-notification';
29
+ id: string;
30
+ payload?: any;
31
+ }
32
+
33
+ type OnRequestCallback = (request: RpcRequest) => Promise<boolean>;
34
+ type OnResponseCallback = (response: RpcResponse) => Promise<boolean>;
35
+ type OnNotificationCallback = (notification: RpcNotification) => void;
36
+ interface RpcTransport {
37
+ onRequest(callback: OnRequestCallback): Subscription;
38
+ onResponse(callback: OnResponseCallback): Subscription;
39
+ onNotification(callback: OnNotificationCallback): Subscription;
40
+ sendRequest(request: RpcRequest): void;
41
+ sendResponse(response: RpcResponse): void;
42
+ }
43
+
44
+ interface Subscription {
45
+ unsubscribe: () => void;
46
+ }
47
+ declare class RpcClient {
48
+ private readonly pendingCalls;
49
+ private readonly notificationCallbacks;
50
+ private onResponseSub;
51
+ private onNotificationSub;
52
+ private transport;
53
+ start(transport: RpcTransport): void;
54
+ stop(): void;
55
+ onNotification<TPayload>(id: string, callback: (payload: TPayload) => void): Subscription;
56
+ callT<TArgs, TResult>(method: string, args: TArgs, timeout?: number): Promise<TResult>;
57
+ call<TResponse>(method: string, args?: any, timeout?: number): Promise<TResponse>;
58
+ private hasPendingCall;
59
+ private addPendingCall;
60
+ private removePendingCall;
61
+ private getPendingCall;
62
+ private generateId;
63
+ private handleRpcResponse;
64
+ private handleRpcNotification;
65
+ }
66
+
67
+ type RpcMessage = RpcRequest | RpcResponse | RpcNotification;
68
+
69
+ declare class RpcAnalyticsApi implements AnalyticsApi {
70
+ private readonly rpcClient;
71
+ constructor(rpcClient: RpcClient);
72
+ recordCustomEvent(eventName: string, payload: Record<string, any>): Promise<void>;
73
+ trackFunnelStep(stepNumber: number, stepName: string, funnelName?: string): Promise<void>;
74
+ }
75
+
76
+ declare function initializeAnalytics(venusApiInstance: VenusAPI, host: Host): void;
77
+
78
+ interface StorageApi {
79
+ key(index: number): Promise<string | null>;
80
+ clear(): Promise<void>;
81
+ length(): Promise<number>;
82
+ getAllItems(): Promise<string[]>;
83
+ setMultipleItems(items: {
84
+ key: string;
85
+ value: string;
86
+ }[]): Promise<void>;
87
+ removeMultipleItems(keys: string[]): Promise<void>;
88
+ setItem(key: string, item: string): Promise<void>;
89
+ getItem(key: string): Promise<string | null>;
90
+ removeItem(key: string): Promise<void>;
91
+ }
92
+
93
+ declare class MockNavigationApi implements NavigationApi {
94
+ private readonly venusApi;
95
+ constructor(venusApi: VenusAPI);
96
+ requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
97
+ getStackInfo(): NavigationStackInfo;
98
+ popApp(): Promise<void>;
99
+ pushApp(appId: string, options?: PushAppOptions): Promise<void>;
100
+ private log;
101
+ }
102
+
103
+ declare class RpcNavigationApi implements NavigationApi {
104
+ private readonly venusApi;
105
+ private readonly rpcClient;
106
+ constructor(rpcClient: RpcClient, venusApi: VenusAPI);
107
+ requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
108
+ getStackInfo(): NavigationStackInfo;
109
+ popApp(): Promise<void>;
110
+ pushApp(appId: string, options?: PushAppOptions): Promise<void>;
111
+ }
112
+
113
+ declare function initializeStackNavigation(venusApi: VenusAPI, host: Host): void;
114
+
115
+ interface ScheduleLocalNotificationOptions {
116
+ priority?: number;
117
+ groupId?: string;
118
+ payload?: Record<string, any>;
119
+ }
120
+ interface ScheduleLocalNotification {
121
+ id: string;
122
+ title?: string | null;
123
+ body?: string | null;
124
+ payload?: Record<string, any>;
125
+ }
126
+ interface NotificationsApi {
127
+ scheduleLocalNotification(title: string, body: string, options?: ScheduleLocalNotificationOptions): Promise<string | null>;
128
+ cancelLocalNotification(notificationId: string): Promise<boolean>;
129
+ getAllScheduledLocalNotifications(): Promise<ScheduleLocalNotification[]>;
130
+ isLocalNotificationsEnabled(): Promise<boolean>;
131
+ setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
132
+ }
133
+
134
+ declare class MockNotificationsApi implements NotificationsApi {
135
+ private readonly venusApi;
136
+ constructor(venusApi: VenusAPI);
137
+ cancelLocalNotification(notificationId: string): Promise<boolean>;
138
+ getAllScheduledLocalNotifications(): Promise<ScheduleLocalNotification[]>;
139
+ isLocalNotificationsEnabled(): Promise<boolean>;
140
+ scheduleLocalNotification(title: string, body: string, options?: ScheduleLocalNotificationOptions): Promise<string | null>;
141
+ setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
142
+ }
143
+
144
+ declare function initializeLocalNotifications(venusApi: VenusAPI, host: Host): void;
145
+
146
+ declare class RpcPopupsApi implements PopupsApi {
147
+ private readonly rpcClient;
148
+ constructor(rpcClient: RpcClient);
149
+ showActionSheet(items: ActionSheetItem[], options?: ShowActionSheetOptions): Promise<string | number | null>;
150
+ showAlert(title: string, message: string, options?: ShowAlertOptions): Promise<void>;
151
+ showConfirm(title: string, message: string, options?: ShowConfirmOptions): Promise<boolean>;
152
+ showToast(message: string, options?: ShowToastOptions): Promise<boolean>;
153
+ }
154
+ interface ShowToastResponse {
155
+ shown: boolean;
156
+ actionTriggered: boolean;
157
+ }
158
+
159
+ interface MockOverlay {
160
+ container: HTMLElement;
161
+ elements: OverlayElements;
162
+ adOverlay: HTMLElement;
163
+ actionSheetOverlay: HTMLElement;
164
+ appVisibilityState: 'visible' | 'hidden';
165
+ showAdOverlay: () => Promise<boolean>;
166
+ showActionSheet: (items: ActionSheetItem[], options?: ShowActionSheetOptions) => Promise<string | number | null>;
167
+ }
168
+ interface OverlayElements {
169
+ visibility: HTMLElement;
170
+ play: HTMLElement;
171
+ close: HTMLElement;
172
+ [id: string]: HTMLElement;
173
+ }
174
+
175
+ declare class MockPopupsApi implements PopupsApi {
176
+ private readonly overlay;
177
+ constructor(override: MockOverlay);
178
+ showActionSheet(items: ActionSheetItem[], options?: ShowActionSheetOptions): Promise<string | number | null>;
179
+ showAlert(title: string, message: string, options?: ShowAlertOptions): Promise<void>;
180
+ showConfirm(title: string, message: string, options?: ShowConfirmOptions): Promise<boolean>;
181
+ showToast(message: string, options?: ShowToastOptions): Promise<boolean>;
182
+ }
183
+
184
+ declare function initializePopups(venusApi: VenusAPI, host: Host): void;
185
+
186
+ interface ProfileApi {
187
+ getCurrentProfile(): Profile;
188
+ }
189
+
190
+ declare class HostProfileApi implements ProfileApi {
191
+ getCurrentProfile(): Profile;
192
+ }
193
+
194
+ declare class MockProfileApi implements ProfileApi {
195
+ getCurrentProfile(): Profile;
196
+ }
197
+
198
+ declare function initializeProfile(venusApi: VenusAPI, host: Host): void;
199
+
200
+ interface ServerTimeData {
201
+ serverTime: number;
202
+ localTime: number;
203
+ timezoneOffset: number;
204
+ formattedTime: string;
205
+ locale: string;
206
+ }
207
+ interface GetFutureTimeOptions {
208
+ days?: number;
209
+ hours?: number;
210
+ minutes?: number;
211
+ timeOfDay?: {
212
+ hour: number;
213
+ minute: number;
214
+ second: number;
215
+ };
216
+ timezone?: any;
217
+ }
218
+ interface TimeApi {
219
+ requestTimeAsync(): Promise<ServerTimeData>;
220
+ formatTime(timestamp: number, options?: any): string;
221
+ formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
222
+ getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
223
+ }
224
+
225
+ declare class HostTimeApi implements TimeApi {
226
+ private readonly rpcClient;
227
+ constructor(rpcClient: RpcClient);
228
+ requestTimeAsync(): Promise<ServerTimeData>;
229
+ formatTime(timestamp: number, options?: any): string;
230
+ formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
231
+ getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
232
+ }
233
+
234
+ declare function isPacificDaylightTime(date: Date): boolean;
235
+
236
+ declare class MockTimeApi implements TimeApi {
237
+ private readonly venusApi;
238
+ constructor(venusApi: VenusAPI);
239
+ formatNumber(value: number, options?: Intl.NumberFormatOptions): string;
240
+ formatTime(timestamp: number, options?: any): string;
241
+ getFutureTimeAsync(options?: GetFutureTimeOptions): Promise<number>;
242
+ requestTimeAsync(): Promise<ServerTimeData>;
243
+ private getLocale;
244
+ }
245
+
246
+ declare function initializeTime(venusApi: VenusAPI, host: Host): void;
247
+
248
+ interface PostInfo {
249
+ isLiked: boolean;
250
+ isFollowing: boolean;
251
+ likesCount: number;
252
+ commentsCount: number;
253
+ }
254
+ interface ToggleLikeResult {
255
+ isLiked: boolean;
256
+ likesCount: number;
257
+ action: 'liked' | 'unliked';
258
+ }
259
+ interface ToggleFollowResult {
260
+ isFollowing: boolean;
261
+ action: 'followed' | 'unfollowed';
262
+ }
263
+ interface OpenCommentsResult {
264
+ opened: boolean;
265
+ commentsCount: number;
266
+ }
267
+ interface ShareContext {
268
+ message?: string;
269
+ title?: string;
270
+ senderId?: string | null;
271
+ additionalInfo?: Record<string, any>;
272
+ }
273
+ interface SharePostResult {
274
+ shared: true;
275
+ platform: string;
276
+ customMessage?: string;
277
+ }
278
+ interface PostApi {
279
+ getPostInfo(): Promise<PostInfo>;
280
+ toggleLikeAsync(): Promise<ToggleLikeResult>;
281
+ openCommentsAsync(): Promise<OpenCommentsResult>;
282
+ toggleFollowAsync(): Promise<ToggleFollowResult>;
283
+ sharePostAsync(context: ShareContext): Promise<SharePostResult>;
284
+ }
285
+
286
+ declare class RpcAiApi implements AiApi {
287
+ private readonly rpcClient;
288
+ constructor(rpcClient: RpcClient);
289
+ requestChatCompletionAsync(request: AiChatCompletionRequest): Promise<AiChatCompletionData>;
290
+ getAvailableCompletionModels(): Promise<Array<string>>;
291
+ }
292
+
293
+ declare class MockAiApi implements AiApi {
294
+ requestChatCompletionAsync(request: AiChatCompletionRequest): Promise<AiChatCompletionData>;
295
+ getAvailableCompletionModels(): Promise<Array<string>>;
296
+ }
297
+
298
+ declare function initializeAi(venusApi: VenusAPI, host: Host): void;
299
+
300
+ declare class RpcHapticsApi implements HapticsApi {
301
+ private readonly rpcClient;
302
+ constructor(rpcClient: RpcClient);
303
+ triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
304
+ }
305
+
306
+ declare class MockHapticsApi implements HapticsApi {
307
+ private readonly venusApi;
308
+ constructor(venusApi: VenusAPI);
309
+ triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
310
+ }
311
+
312
+ declare function initializeHaptics(venusApi: VenusAPI, host: Host): void;
313
+
314
+ interface Experiment {
315
+ readonly name: string;
316
+ readonly ruleID: string;
317
+ readonly value: Record<string, unknown>;
318
+ readonly groupName: string | null;
319
+ }
320
+ interface FeaturesApi {
321
+ getExperiment(experimentName: string): Promise<Experiment | null>;
322
+ getFeatureFlag(flagName: string): Promise<boolean>;
323
+ getFeatureGate(gateName: string): Promise<boolean>;
324
+ }
325
+
326
+ declare class RpcFeaturesApi implements FeaturesApi {
327
+ private readonly rpcClient;
328
+ constructor(rcpClient: RpcClient);
329
+ getExperiment(experimentName: string): Promise<Experiment | null>;
330
+ getFeatureFlag(flagName: string): Promise<boolean>;
331
+ getFeatureGate(gateName: string): Promise<boolean>;
332
+ }
333
+
334
+ declare class MockFeaturesApi implements FeaturesApi {
335
+ getExperiment(experimentName: string): Promise<Experiment | null>;
336
+ getFeatureFlag(flagName: string): Promise<boolean>;
337
+ getFeatureGate(gateName: string): Promise<boolean>;
338
+ }
339
+
340
+ declare function initializeFeaturesApi(venusApi: VenusAPI, host: Host): void;
341
+
342
+ declare class MockLifecycleApi implements LifecycleApi {
343
+ private playCallbacks;
344
+ private pauseCallbacks;
345
+ private resumeCallbacks;
346
+ private quitCallbacks;
347
+ private showCallbacks;
348
+ private hideCallbacks;
349
+ onCleanup(callback: OnCleanupCallback): void;
350
+ onShow(callback: OnShowCallback): void;
351
+ onHide(callback: OnHideCallback): void;
352
+ onPause(callback: OnPauseCallback): void;
353
+ onPlay(callback: OnPlayCallback): void;
354
+ onQuit(callback: OnQuitCallback): void;
355
+ onResume(callback: OnResumeCallback): void;
356
+ triggerOnPlayCallbacks(context: PlayContext): void;
357
+ triggerOnPauseCallbacks(): void;
358
+ triggerOnResumeCallbacks(): void;
359
+ triggerOnShowCallbacks(context: ShowContext): void;
360
+ triggerOnHideCallbacks(): void;
361
+ triggerOnQuitCallbacks(): void;
362
+ }
363
+
364
+ declare class RpcLifecycleApi implements LifecycleApi {
365
+ private readonly rpcClient;
366
+ constructor(rpcClient: RpcClient);
367
+ onCleanup(callback: OnCleanupCallback): void;
368
+ onHide(callback: OnHideCallback): void;
369
+ onPause(callback: OnPauseCallback): void;
370
+ onPlay(callback: OnPlayCallback): void;
371
+ onQuit(callback: OnQuitCallback): void;
372
+ onResume(callback: OnResumeCallback): void;
373
+ onShow(callback: OnShowCallback): void;
374
+ }
375
+
376
+ declare function initializeLifecycleApi(venusApi: VenusAPI, host: Host): void;
377
+
378
+ interface ExecuteRecipeOptions {
379
+ roomId?: string;
380
+ batchAmount?: number;
381
+ allowPartialBatch?: boolean;
382
+ entity?: string;
383
+ }
384
+ interface GetActiveRunsOptions {
385
+ roomId?: string;
386
+ }
387
+ interface ExecuteScopedRecipeOptions {
388
+ roomId?: string;
389
+ }
390
+ interface GetAvailableRecipesOptions {
391
+ roomId?: string;
392
+ includeActorRecipes?: boolean;
393
+ }
394
+ interface Recipe {
395
+ recipeId: string;
396
+ entity?: string;
397
+ batchAmount?: number;
398
+ }
399
+ interface TriggerRecipeChainOptions {
400
+ roomId?: string;
401
+ context?: any;
402
+ }
403
+ interface CollectRecipeResult {
404
+ success: boolean;
405
+ runId: string;
406
+ rewards: any;
407
+ message: string;
408
+ }
409
+ interface ExecuteScopedRecipeResult {
410
+ success: boolean;
411
+ message: string;
412
+ }
413
+ interface RecipeInfo {
414
+ id: string;
415
+ scope: string;
416
+ clientViewable: boolean;
417
+ }
418
+ interface GetAvailableRecipesResult {
419
+ success: boolean;
420
+ recipes: RecipeInfo[];
421
+ }
422
+ interface GetBatchRecipeRequirements {
423
+ success: boolean;
424
+ results: RecipeRequirementResult[];
425
+ }
426
+ interface SimulationApi {
427
+ getStateAsync(roomId?: string): Promise<any>;
428
+ getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
429
+ executeRecipeAsync(recipeId: string, inputs?: any, options?: ExecuteRecipeOptions): Promise<any>;
430
+ getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
431
+ collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
432
+ executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: ExecuteScopedRecipeOptions | any): Promise<ExecuteScopedRecipeResult>;
433
+ triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
434
+ getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
435
+ getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
436
+ getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
437
+ resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
438
+ getEntityMetadataAsync(entityId: string): Promise<any>;
439
+ getSlotContainersAsync(): Promise<any>;
440
+ getSlotAssignmentsAsync(containerId: string): Promise<any>;
441
+ assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
442
+ removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
443
+ getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
444
+ calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
445
+ validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
446
+ executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
447
+ sumContributions(contributions: Record<string, any>): Record<string, number>;
448
+ }
449
+
450
+ declare class RpcSimulationApi implements SimulationApi {
451
+ private readonly rpcClient;
452
+ private _simulationConfig;
453
+ constructor(rpcClient: RpcClient);
454
+ validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
455
+ sumContributions(contributions: Record<string, any>): Record<string, number>;
456
+ executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
457
+ getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
458
+ calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
459
+ assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
460
+ removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
461
+ getSlotContainersAsync(): Promise<any>;
462
+ getSlotAssignmentsAsync(containerId: string): Promise<any>;
463
+ getStateAsync(roomId?: string): Promise<any>;
464
+ getConfigAsync(roomId?: string): Promise<VenusSimulationConfig>;
465
+ executeRecipeAsync(recipeId: string, inputs?: any, options?: ExecuteRecipeOptions): Promise<any>;
466
+ collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
467
+ getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
468
+ executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
469
+ getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
470
+ getRecipeRequirementsAsync(recipe: Recipe): Promise<any>;
471
+ getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
472
+ triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
473
+ getEntityMetadataAsync(entityId: string): Promise<any>;
474
+ resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
475
+ }
476
+
477
+ declare class MockSimulationApi implements SimulationApi {
478
+ private readonly mockSimulationConfigs;
479
+ private readonly mockSimulationStates;
480
+ private readonly mockActiveTimers;
481
+ private readonly appId;
482
+ private readonly providedSimulationConfig;
483
+ constructor(simulationConfig?: VenusSimulationConfig | null);
484
+ sumContributions(contributions: Record<string, any>): Record<string, number>;
485
+ validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
486
+ executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
487
+ getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
488
+ calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
489
+ getSlotContainersAsync(): Promise<any>;
490
+ getSlotAssignmentsAsync(containerId: string): Promise<any>;
491
+ resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
492
+ getEntityMetadataAsync(entityId: string): Promise<any>;
493
+ collectRecipeAsync(runId: string): Promise<CollectRecipeResult>;
494
+ executeRecipeAsync(recipeId: string, inputs?: any, options?: ExecuteRecipeOptions): Promise<any>;
495
+ executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: any, options?: any): Promise<ExecuteScopedRecipeResult>;
496
+ getActiveRunsAsync(options?: GetActiveRunsOptions): Promise<any>;
497
+ getAvailableRecipesAsync(options?: GetAvailableRecipesOptions): Promise<GetAvailableRecipesResult>;
498
+ getBatchRecipeRequirementsAsync(recipes: Recipe[]): Promise<GetBatchRecipeRequirements>;
499
+ getRecipeRequirementsAsync(recipe: Recipe): Promise<RecipeRequirementResult>;
500
+ triggerRecipeChainAsync(recipeId: string, options?: TriggerRecipeChainOptions): Promise<any>;
501
+ private log;
502
+ private executeRecipe;
503
+ private initializeSimulationState;
504
+ private generateRunId;
505
+ private completeRun;
506
+ private createSeededRandom;
507
+ private applyEffects;
508
+ getConfigAsync(): Promise<any>;
509
+ getStateAsync(roomId?: string): Promise<any>;
510
+ assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
511
+ removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
512
+ }
513
+
514
+ declare function initializeSimulation(venusApi: VenusAPI, host: Host): void;
515
+
516
+ interface RoomsApi {
517
+ createRoom(options: any): Promise<any>;
518
+ join(roomId: string): Promise<any>;
519
+ }
520
+
521
+ interface LoggingApi {
522
+ logDebug(message: string, ...args: any[]): void;
523
+ logError(message: string, ...args: any[]): void;
524
+ }
525
+
526
+ declare class MockLoggingApi implements LoggingApi {
527
+ logDebug(message?: any, ...args: any[]): void;
528
+ logError(message: string, ...args: any[]): void;
529
+ }
530
+
531
+ declare class RpcLoggingApi implements LoggingApi {
532
+ private readonly host;
533
+ private readonly rpcClient;
534
+ constructor(host: Host, rpcClient: RpcClient);
535
+ logDebug(message: string, ...args: any[]): void;
536
+ logError(message: string, ...args: any[]): void;
537
+ private buildMessage;
538
+ private toStringArg;
539
+ }
540
+
541
+ declare function initializeLoggingApi(venusApi: VenusAPI, host: Host): void;
542
+
543
+ declare class RpcIapApi implements IapApi {
544
+ private readonly rpcClient;
545
+ constructor(rpcClient: RpcClient);
546
+ getHardCurrencyBalance(): Promise<number>;
547
+ spendCurrency(productId: string, cost: number, options?: SpendCurrencyOptions): Promise<void>;
548
+ }
549
+
550
+ declare class MockIapApi implements IapApi {
551
+ private _hardCurrency;
552
+ get hardCurrency(): number;
553
+ set hardCurrency(value: number);
554
+ spendCurrency(productId: string, cost: number, options?: SpendCurrencyOptions): Promise<void>;
555
+ getHardCurrencyBalance(): Promise<number>;
556
+ }
557
+
558
+ declare function initializeIap(venusApiInstance: VenusAPI, host: Host): void;
559
+
560
+ interface Host {
561
+ readonly ads: AdsApi;
562
+ readonly analytics: AnalyticsApi;
563
+ readonly deviceCache: StorageApi;
564
+ readonly appStorage: StorageApi;
565
+ readonly globalStorage: StorageApi;
566
+ readonly avatar3d: Avatar3dApi;
567
+ readonly navigation: NavigationApi;
568
+ readonly notifications: NotificationsApi;
569
+ readonly popups: PopupsApi;
570
+ readonly profile: ProfileApi;
571
+ readonly cdn: CdnApi;
572
+ readonly time: TimeApi;
573
+ readonly post: PostApi;
574
+ readonly ai: AiApi;
575
+ readonly haptics: HapticsApi;
576
+ readonly features: FeaturesApi;
577
+ readonly lifecycle: LifecycleApi;
578
+ readonly simulation: SimulationApi;
579
+ readonly rooms: RoomsApi;
580
+ readonly logging: LoggingApi;
581
+ readonly isInitialized: boolean;
582
+ initialize(): Promise<void>;
583
+ readonly iap: IapApi;
584
+ }
585
+
586
+ declare class RpcAvatarApi implements Avatar3dApi {
587
+ private readonly venusApi;
588
+ private readonly rpcClient;
589
+ constructor(rpcClient: RpcClient, venusApi: VenusAPI);
590
+ downloadAssetPaths(): Promise<Record<string, string[]>>;
591
+ downloadManifest(): Promise<AssetManifest>;
592
+ loadAvatar(avatarId?: string): Promise<Avatar3dConfig | null>;
593
+ saveAvatar(config: Avatar3dConfig): Promise<string>;
594
+ deleteAvatar(): Promise<void>;
595
+ showEditor(options?: ShowEditorOptions): Promise<Avatar3dEdits>;
596
+ private fetchFromCdn;
597
+ private log;
598
+ }
599
+
600
+ declare function initializeAvatar3d(venusApi: VenusAPI, host: Host): void;
601
+
602
+ declare class HostCdnApi implements CdnApi {
603
+ private readonly baseUrl;
604
+ constructor(baseUrl: string);
605
+ fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
606
+ fetchFromCdn(url: string, request?: RequestInit): Promise<Response>;
607
+ getAssetCdnBaseUrl(): string;
608
+ resolveAssetUrl(subPath: string): string;
609
+ resolveAvatarAssetUrl(subPath: string): string;
610
+ resolveSharedLibUrl(subPath: string): string;
611
+ }
612
+
613
+ declare class MockCdnApi implements CdnApi {
614
+ private readonly baseUrl;
615
+ constructor();
616
+ fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
617
+ getAssetCdnBaseUrl(): string;
618
+ resolveAssetUrl(subPath: string): string;
619
+ resolveAvatarAssetUrl(subPath: string): string;
620
+ resolveSharedLibUrl(subPath: string): string;
621
+ fetchFromCdn(url: string, options?: RequestInit): Promise<Response>;
622
+ }
623
+
624
+ declare function initializeCdn(venusApi: VenusAPI, host: Host): void;
625
+
626
+ declare class RpcAdsApi implements AdsApi {
627
+ private readonly rpcClient;
628
+ constructor(rpcClient: RpcClient);
629
+ showInterstitialAd(): Promise<boolean>;
630
+ isRewardedAdReadyAsync(): Promise<boolean>;
631
+ showRewardedAdAsync(): Promise<boolean>;
632
+ }
633
+
634
+ declare class MockAdsApi implements AdsApi {
635
+ private mockOverlay;
636
+ constructor(mockOverlay: MockOverlay);
637
+ isRewardedAdReadyAsync(): Promise<boolean>;
638
+ showRewardedAdAsync(): Promise<boolean>;
639
+ showInterstitialAd(): Promise<boolean>;
640
+ private log;
641
+ }
642
+
643
+ declare function initializeAds(venusApiInstance: VenusAPI, host: Host): void;
644
+
645
+ type StorageType = 'globalStorage' | 'deviceCache' | 'appStorage';
646
+ declare function createMockStorageApi(storageType: StorageType, appUrl?: string): MockStorageApi;
647
+ declare class MockStorageApi implements StorageApi {
648
+ private readonly prefix;
649
+ private readonly syncDelay;
650
+ constructor(prefix: string, syncDelay: number);
651
+ clear(): Promise<void>;
652
+ getAllItems(): Promise<string[]>;
653
+ getItem(key: string): Promise<string | null>;
654
+ key(index: number): Promise<string | null>;
655
+ length(): Promise<number>;
656
+ removeItem(key: string): Promise<void>;
657
+ setItem(key: string, item: string): Promise<void>;
658
+ setMultipleItems(entries: {
659
+ key: string;
660
+ value: string;
661
+ }[]): Promise<void>;
662
+ removeMultipleItems(keys: string[]): Promise<void>;
663
+ private buildKey;
664
+ private extractKey;
665
+ private keys;
666
+ private simulateSyncDelay;
667
+ }
668
+
669
+ interface MethodIds {
670
+ clear: string;
671
+ getItem: string;
672
+ getKey: string;
673
+ length: string;
674
+ removeItem: string;
675
+ setItem: string;
676
+ getAllItems?: string;
677
+ removeMultipleItems?: string;
678
+ setMultipleItems?: string;
679
+ }
680
+ declare class RpcStorageApi implements StorageApi {
681
+ private readonly rpcClient;
682
+ private readonly methodIds;
683
+ constructor(rpcClient: RpcClient, methodIds: MethodIds);
684
+ clear(): Promise<void>;
685
+ getItem(key: string): Promise<string | null>;
686
+ setItem(key: string, value: string): Promise<void>;
687
+ key(index: number): Promise<string | null>;
688
+ length(): Promise<number>;
689
+ removeItem(key: string): Promise<void>;
690
+ removeMultipleItems(keys: string[]): Promise<void>;
691
+ getAllItems(): Promise<string[]>;
692
+ setMultipleItems(items: {
693
+ key: string;
694
+ value: string;
695
+ }[]): Promise<void>;
696
+ }
697
+
698
+ declare function initializeStorage(venusApiInstance: VenusAPI, host: Host): void;
699
+
700
+ declare const SDK_VERSION: string;
701
+
702
+ export { ActionSheetItem, AdsApi, AiApi, AiChatCompletionData, AiChatCompletionRequest, AnalyticsApi, AssetManifest, Avatar3dApi, Avatar3dConfig, Avatar3dEdits, CdnApi, type CollectRecipeResult, type ExecuteRecipeOptions, type ExecuteScopedRecipeOptions, type ExecuteScopedRecipeResult, type Experiment, type FeaturesApi, FetchBlobOptions, type GetActiveRunsOptions, type GetAvailableRecipesOptions, type GetAvailableRecipesResult, type GetBatchRecipeRequirements, type GetFutureTimeOptions, HapticFeedbackStyle, HapticsApi, HostCdnApi, HostProfileApi, HostTimeApi, IapApi, LifecycleApi, type LoggingApi, type MethodIds, MockAdsApi, MockAiApi, MockAnalyticsApi, MockCdnApi, MockFeaturesApi, MockHapticsApi, MockIapApi, MockLifecycleApi, MockLoggingApi, MockNavigationApi, MockNotificationsApi, MockPopupsApi, MockProfileApi, MockSimulationApi, MockStorageApi, MockTimeApi, NavigationApi, NavigationStackInfo, type NotificationsApi, OnCleanupCallback, OnHideCallback, type OnNotificationCallback, OnPauseCallback, OnPlayCallback, OnQuitCallback, type OnRequestCallback, type OnResponseCallback, OnResumeCallback, OnShowCallback, PlayContext, PopupsApi, type ProfileApi, PushAppOptions, QuitOptions, type Recipe, type RecipeInfo, RpcAdsApi, RpcAiApi, RpcAnalyticsApi, RpcAvatarApi, RpcClient, RpcFeaturesApi, RpcHapticsApi, RpcIapApi, RpcLifecycleApi, RpcLoggingApi, type RpcMessage, RpcNavigationApi, type RpcNotification, RpcPopupsApi, type RpcRequest, type RpcResponse, RpcSimulationApi, RpcStorageApi, type RpcTransport, SDK_VERSION, type ScheduleLocalNotification, type ScheduleLocalNotificationOptions, type ServerTimeData, ShowActionSheetOptions, ShowAlertOptions, ShowConfirmOptions, ShowContext, ShowEditorOptions, ShowToastOptions, type ShowToastResponse, type SimulationApi, SpendCurrencyOptions, type StorageApi, type StorageType, SubPath, type Subscription, type TimeApi, type TriggerRecipeChainOptions, createMockStorageApi, initializeAds, initializeAi, initializeAnalytics, initializeAvatar3d, initializeCdn, initializeFeaturesApi, initializeHaptics, initializeIap, initializeLifecycleApi, initializeLocalNotifications, initializeLoggingApi, initializePopups, initializeProfile, initializeSimulation, initializeStackNavigation, initializeStorage, initializeTime, isPacificDaylightTime };