@series-inc/venus-sdk 2.4.1 → 3.0.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.
- package/README.md +345 -249
- package/dist/AdsApi-3DEYUUuj.d.mts +1414 -0
- package/dist/AdsApi-3DEYUUuj.d.ts +1414 -0
- package/dist/{chunk-KQZIPQLJ.mjs → chunk-6DYG4RFQ.mjs} +2066 -133
- package/dist/chunk-6DYG4RFQ.mjs.map +1 -0
- package/dist/{chunk-MWUS3A7C.mjs → chunk-W7IPHM67.mjs} +22 -3
- package/dist/chunk-W7IPHM67.mjs.map +1 -0
- package/dist/core-R3FHW62G.mjs +3 -0
- package/dist/{core-RDMPQV6U.mjs.map → core-R3FHW62G.mjs.map} +1 -1
- package/dist/index.cjs +2084 -129
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +253 -303
- package/dist/index.d.ts +253 -303
- package/dist/index.mjs +6 -2
- package/dist/index.mjs.map +1 -1
- package/dist/venus-api/index.cjs +1072 -1654
- 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 +31 -2552
- package/dist/venus-api/index.mjs.map +1 -1
- package/package.json +2 -2
- package/dist/AdsApi-Cz0XgLM8.d.mts +0 -851
- package/dist/AdsApi-Cz0XgLM8.d.ts +0 -851
- package/dist/chunk-KQZIPQLJ.mjs.map +0 -1
- package/dist/chunk-MWUS3A7C.mjs.map +0 -1
- package/dist/core-RDMPQV6U.mjs +0 -3
|
@@ -1,851 +0,0 @@
|
|
|
1
|
-
interface AnalyticsApi {
|
|
2
|
-
recordCustomEvent(eventName: string, payload?: Record<string, any>): Promise<void>;
|
|
3
|
-
trackFunnelStep(stepNumber: number, stepName: string, funnelName?: string): Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface RpcRequest {
|
|
7
|
-
type: 'rpc-request';
|
|
8
|
-
id: string;
|
|
9
|
-
method: string;
|
|
10
|
-
args?: any[];
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
interface RpcResponse {
|
|
14
|
-
type: 'rpc-response';
|
|
15
|
-
id: string;
|
|
16
|
-
method: string;
|
|
17
|
-
result?: any;
|
|
18
|
-
error?: {
|
|
19
|
-
message: string;
|
|
20
|
-
stack?: string;
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface RpcNotification {
|
|
25
|
-
type: 'rpc-notification';
|
|
26
|
-
id: string;
|
|
27
|
-
payload?: any;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
type OnRequestCallback = (request: RpcRequest) => Promise<boolean>;
|
|
31
|
-
type OnResponseCallback = (response: RpcResponse) => Promise<boolean>;
|
|
32
|
-
type OnNotificationCallback = (notification: RpcNotification) => void;
|
|
33
|
-
interface RpcTransport {
|
|
34
|
-
onRequest(callback: OnRequestCallback): Subscription;
|
|
35
|
-
onResponse(callback: OnResponseCallback): Subscription;
|
|
36
|
-
onNotification(callback: OnNotificationCallback): Subscription;
|
|
37
|
-
sendRequest(request: RpcRequest): void;
|
|
38
|
-
sendResponse(response: RpcResponse): void;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
interface Subscription {
|
|
42
|
-
unsubscribe: () => void;
|
|
43
|
-
}
|
|
44
|
-
declare class RpcClient {
|
|
45
|
-
private readonly pendingCalls;
|
|
46
|
-
private readonly notificationCallbacks;
|
|
47
|
-
private onResponseSub;
|
|
48
|
-
private onNotificationSub;
|
|
49
|
-
private transport;
|
|
50
|
-
start(transport: RpcTransport): void;
|
|
51
|
-
stop(): void;
|
|
52
|
-
onNotification<TPayload>(id: string, callback: (payload: TPayload) => void): Subscription;
|
|
53
|
-
callT<TArgs, TResult>(method: string, args: TArgs, timeout?: number): Promise<TResult>;
|
|
54
|
-
call<TResponse>(method: string, args?: any, timeout?: number): Promise<TResponse>;
|
|
55
|
-
private hasPendingCall;
|
|
56
|
-
private addPendingCall;
|
|
57
|
-
private removePendingCall;
|
|
58
|
-
private getPendingCall;
|
|
59
|
-
private generateId;
|
|
60
|
-
private handleRpcResponse;
|
|
61
|
-
private handleRpcNotification;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
interface NavigationStackInfo {
|
|
65
|
-
isInStack: boolean;
|
|
66
|
-
stackPosition: number;
|
|
67
|
-
isTopOfStack: boolean;
|
|
68
|
-
stackDepth: number;
|
|
69
|
-
parentInstanceId: string;
|
|
70
|
-
}
|
|
71
|
-
interface PushAppOptions {
|
|
72
|
-
contextData?: any;
|
|
73
|
-
appParams?: any;
|
|
74
|
-
}
|
|
75
|
-
interface QuitOptions {
|
|
76
|
-
reason?: string;
|
|
77
|
-
forceClose?: boolean;
|
|
78
|
-
[key: string]: any;
|
|
79
|
-
}
|
|
80
|
-
interface NavigationApi {
|
|
81
|
-
pushApp(appId: string, options?: PushAppOptions): Promise<void>;
|
|
82
|
-
popApp(): Promise<void>;
|
|
83
|
-
getStackInfo(): NavigationStackInfo;
|
|
84
|
-
requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
type TimeIntervalTriggerInput = {
|
|
88
|
-
type: 'timeInterval';
|
|
89
|
-
seconds: number;
|
|
90
|
-
repeats?: boolean;
|
|
91
|
-
channelId?: string;
|
|
92
|
-
};
|
|
93
|
-
type DateTriggerInput = {
|
|
94
|
-
type: 'date';
|
|
95
|
-
date: string;
|
|
96
|
-
channelId?: string;
|
|
97
|
-
};
|
|
98
|
-
type CalendarTriggerInput = {
|
|
99
|
-
type: 'calendar';
|
|
100
|
-
year?: number;
|
|
101
|
-
month?: number;
|
|
102
|
-
day?: number;
|
|
103
|
-
hour?: number;
|
|
104
|
-
minute?: number;
|
|
105
|
-
second?: number;
|
|
106
|
-
repeats?: boolean;
|
|
107
|
-
channelId?: string;
|
|
108
|
-
};
|
|
109
|
-
type DailyTriggerInput = {
|
|
110
|
-
type: 'daily';
|
|
111
|
-
hour: number;
|
|
112
|
-
minute: number;
|
|
113
|
-
channelId?: string;
|
|
114
|
-
};
|
|
115
|
-
type WeeklyTriggerInput = {
|
|
116
|
-
type: 'weekly';
|
|
117
|
-
weekday: number;
|
|
118
|
-
hour: number;
|
|
119
|
-
minute: number;
|
|
120
|
-
channelId?: string;
|
|
121
|
-
};
|
|
122
|
-
type MonthlyTriggerInput = {
|
|
123
|
-
type: 'monthly';
|
|
124
|
-
day: number;
|
|
125
|
-
hour: number;
|
|
126
|
-
minute: number;
|
|
127
|
-
channelId?: string;
|
|
128
|
-
};
|
|
129
|
-
type YearlyTriggerInput = {
|
|
130
|
-
type: 'yearly';
|
|
131
|
-
month: number;
|
|
132
|
-
day: number;
|
|
133
|
-
hour: number;
|
|
134
|
-
minute: number;
|
|
135
|
-
channelId?: string;
|
|
136
|
-
};
|
|
137
|
-
type NotificationTriggerInput = null | TimeIntervalTriggerInput | DateTriggerInput | CalendarTriggerInput | DailyTriggerInput | WeeklyTriggerInput | MonthlyTriggerInput | YearlyTriggerInput;
|
|
138
|
-
interface ScheduleLocalNotificationOptions {
|
|
139
|
-
priority?: number;
|
|
140
|
-
groupId?: string;
|
|
141
|
-
payload?: Record<string, any>;
|
|
142
|
-
trigger?: NotificationTriggerInput;
|
|
143
|
-
}
|
|
144
|
-
interface ScheduleLocalNotification {
|
|
145
|
-
id: string;
|
|
146
|
-
title?: string | null;
|
|
147
|
-
body?: string | null;
|
|
148
|
-
payload?: Record<string, any>;
|
|
149
|
-
trigger?: NotificationTriggerInput;
|
|
150
|
-
}
|
|
151
|
-
interface NotificationsApi {
|
|
152
|
-
scheduleLocalNotification(title: string, body: string, options?: ScheduleLocalNotificationOptions): Promise<string | null>;
|
|
153
|
-
cancelLocalNotification(notificationId: string): Promise<boolean>;
|
|
154
|
-
getAllScheduledLocalNotifications(): Promise<ScheduleLocalNotification[]>;
|
|
155
|
-
isLocalNotificationsEnabled(): Promise<boolean>;
|
|
156
|
-
setLocalNotificationsEnabled(enabled: boolean): Promise<boolean>;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
interface ShowConfirmOptions {
|
|
160
|
-
confirmText?: string;
|
|
161
|
-
cancelText?: string;
|
|
162
|
-
}
|
|
163
|
-
interface ShowAlertOptions {
|
|
164
|
-
buttonText?: string;
|
|
165
|
-
}
|
|
166
|
-
interface ShowToastOptions {
|
|
167
|
-
duration?: number;
|
|
168
|
-
variant?: 'success' | 'error' | 'warning' | 'info';
|
|
169
|
-
action?: {
|
|
170
|
-
label: string;
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
|
-
interface PopupsApi {
|
|
174
|
-
showAlert(title: string, message: string, options?: ShowAlertOptions): Promise<void>;
|
|
175
|
-
showConfirm(title: string, message: string, options?: ShowConfirmOptions): Promise<boolean>;
|
|
176
|
-
showToast(message: string, options?: ShowToastOptions): Promise<boolean>;
|
|
177
|
-
showActionSheet(items: ActionSheetItem[], options?: ShowActionSheetOptions): Promise<string | number | null>;
|
|
178
|
-
}
|
|
179
|
-
interface ActionSheetItem {
|
|
180
|
-
id?: string;
|
|
181
|
-
label: string;
|
|
182
|
-
icon?: string;
|
|
183
|
-
}
|
|
184
|
-
interface ShowActionSheetOptions {
|
|
185
|
-
title?: string;
|
|
186
|
-
message?: string;
|
|
187
|
-
cancelButtonText?: string;
|
|
188
|
-
disableCancel?: boolean;
|
|
189
|
-
}
|
|
190
|
-
|
|
191
|
-
type SubPath = string;
|
|
192
|
-
interface FetchBlobOptions {
|
|
193
|
-
timeout?: number;
|
|
194
|
-
}
|
|
195
|
-
interface CdnApi {
|
|
196
|
-
resolveAssetUrl(subPath: string): string;
|
|
197
|
-
resolveAvatarAssetUrl(subPath: string): string;
|
|
198
|
-
resolveSharedLibUrl(subPath: string): string;
|
|
199
|
-
getAssetCdnBaseUrl(): string;
|
|
200
|
-
fetchFromCdn(url: string, request?: RequestInit): Promise<Response>;
|
|
201
|
-
fetchBlob(path: SubPath, options?: FetchBlobOptions): Promise<Blob>;
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
interface AiMessage {
|
|
205
|
-
/**
|
|
206
|
-
* Depends on the model you are using. Most common is user, system, and assistant.
|
|
207
|
-
* If you are unsure, look up the specific model you are using.
|
|
208
|
-
*/
|
|
209
|
-
role: string;
|
|
210
|
-
content: string;
|
|
211
|
-
}
|
|
212
|
-
type AiChatCompletionRequest = {
|
|
213
|
-
model: string;
|
|
214
|
-
messages?: Array<AiMessage>;
|
|
215
|
-
maxTokens?: number;
|
|
216
|
-
temperature?: number;
|
|
217
|
-
topP?: number;
|
|
218
|
-
topK?: number;
|
|
219
|
-
n?: number;
|
|
220
|
-
stop?: string | string[];
|
|
221
|
-
presencePenalty?: number;
|
|
222
|
-
frequencyPenalty?: number;
|
|
223
|
-
logitBias?: Record<string, number>;
|
|
224
|
-
seed?: number;
|
|
225
|
-
/**
|
|
226
|
-
* This is ONLY ever used when running the sdk outside of venus.
|
|
227
|
-
* This gets ignored when the game using the sdk is used within a venus instance.
|
|
228
|
-
*
|
|
229
|
-
* In other words, this should only be uswed when developing a game locally.
|
|
230
|
-
*/
|
|
231
|
-
apiKey?: string;
|
|
232
|
-
};
|
|
233
|
-
type AiChatCompletionData = {
|
|
234
|
-
id: string;
|
|
235
|
-
ullm_id: string;
|
|
236
|
-
cost: {
|
|
237
|
-
prompt_cost: number;
|
|
238
|
-
completion_cost: number;
|
|
239
|
-
};
|
|
240
|
-
object: string;
|
|
241
|
-
created: number;
|
|
242
|
-
model: string;
|
|
243
|
-
choices: Array<{
|
|
244
|
-
index: number;
|
|
245
|
-
message: {
|
|
246
|
-
role: string;
|
|
247
|
-
content: string;
|
|
248
|
-
};
|
|
249
|
-
finish_reason: string;
|
|
250
|
-
}>;
|
|
251
|
-
usage: {
|
|
252
|
-
prompt_tokens: number;
|
|
253
|
-
completion_tokens: number;
|
|
254
|
-
total_tokens: number;
|
|
255
|
-
reasoning_tokens?: number;
|
|
256
|
-
cache_read_tokens?: number;
|
|
257
|
-
cache_write_tokens?: number;
|
|
258
|
-
};
|
|
259
|
-
};
|
|
260
|
-
interface AiApi {
|
|
261
|
-
requestChatCompletionAsync(request: AiChatCompletionRequest): Promise<AiChatCompletionData>;
|
|
262
|
-
getAvailableCompletionModels(): Promise<Array<string>>;
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
declare enum HapticFeedbackStyle {
|
|
266
|
-
Light = "light",
|
|
267
|
-
Medium = "medium",
|
|
268
|
-
Heavy = "heavy",
|
|
269
|
-
Success = "success",
|
|
270
|
-
Warning = "warning",
|
|
271
|
-
Error = "error"
|
|
272
|
-
}
|
|
273
|
-
interface HapticsApi {
|
|
274
|
-
triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
|
|
275
|
-
}
|
|
276
|
-
|
|
277
|
-
interface Insets {
|
|
278
|
-
top: number;
|
|
279
|
-
right: number;
|
|
280
|
-
bottom: number;
|
|
281
|
-
left: number;
|
|
282
|
-
}
|
|
283
|
-
interface PostInfo {
|
|
284
|
-
postId: string;
|
|
285
|
-
config: null;
|
|
286
|
-
isLiked: boolean;
|
|
287
|
-
isFollowing: boolean;
|
|
288
|
-
likesCount: number;
|
|
289
|
-
commentsCount: number;
|
|
290
|
-
}
|
|
291
|
-
interface PlayContext {
|
|
292
|
-
hudInsets: Insets;
|
|
293
|
-
postData?: PostInfo;
|
|
294
|
-
format: 'post';
|
|
295
|
-
}
|
|
296
|
-
type OnPlayCallback = (context: PlayContext) => void;
|
|
297
|
-
type OnPauseCallback = () => void;
|
|
298
|
-
type OnResumeCallback = () => void;
|
|
299
|
-
type OnQuitCallback = () => void;
|
|
300
|
-
type OnHideCallback = () => void;
|
|
301
|
-
interface ShowContext {
|
|
302
|
-
hudInsets: Insets;
|
|
303
|
-
postData?: PostInfo;
|
|
304
|
-
}
|
|
305
|
-
type OnShowCallback = (context: ShowContext) => void;
|
|
306
|
-
type OnCleanupCallback = () => void;
|
|
307
|
-
interface LifecycleApi {
|
|
308
|
-
onPlay(callback: OnPlayCallback): void;
|
|
309
|
-
onPause(callback: OnPauseCallback): void;
|
|
310
|
-
onResume(callback: OnResumeCallback): void;
|
|
311
|
-
onQuit(callback: OnQuitCallback): void;
|
|
312
|
-
onHide(callback: OnHideCallback): void;
|
|
313
|
-
onShow(callback: OnShowCallback): void;
|
|
314
|
-
onCleanup(callback: OnCleanupCallback): void;
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
interface SharedAssetsApi {
|
|
318
|
-
loadCharactersBundle(): Promise<ArrayBuffer>;
|
|
319
|
-
loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
declare class RpcSharedAssetsApi implements SharedAssetsApi {
|
|
323
|
-
private readonly venusApi;
|
|
324
|
-
private readonly rpcClient;
|
|
325
|
-
constructor(rpcClient: RpcClient, venusApi: VenusAPI);
|
|
326
|
-
loadBurgerTimeAssetsBundle(): Promise<ArrayBuffer>;
|
|
327
|
-
loadCharactersBundle(): Promise<ArrayBuffer>;
|
|
328
|
-
}
|
|
329
|
-
interface LoadEmbeddedAssetsRequest {
|
|
330
|
-
assetKey: string;
|
|
331
|
-
}
|
|
332
|
-
interface LoadEmbeddedAssetsResponse {
|
|
333
|
-
base64Data: string;
|
|
334
|
-
}
|
|
335
|
-
|
|
336
|
-
interface SpendCurrencyOptions {
|
|
337
|
-
screenName?: string;
|
|
338
|
-
}
|
|
339
|
-
interface IapApi {
|
|
340
|
-
getHardCurrencyBalance(): Promise<number>;
|
|
341
|
-
spendCurrency(productId: string, amount: number, options?: SpendCurrencyOptions): Promise<void>;
|
|
342
|
-
openStore(): Promise<void>;
|
|
343
|
-
getCurrencyIcon(): Promise<LoadEmbeddedAssetsResponse>;
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
interface Avatar3dConfig {
|
|
347
|
-
headAsset: string | null;
|
|
348
|
-
outfitAsset: string | null;
|
|
349
|
-
hatAsset: string | null;
|
|
350
|
-
hairAsset: string | null;
|
|
351
|
-
faceAccessoryAsset: string | null;
|
|
352
|
-
animationAsset: string | null;
|
|
353
|
-
skinColor: string | null;
|
|
354
|
-
}
|
|
355
|
-
|
|
356
|
-
interface Asset {
|
|
357
|
-
id: string;
|
|
358
|
-
filename: string;
|
|
359
|
-
displayName: string;
|
|
360
|
-
preload?: boolean;
|
|
361
|
-
tags?: string[];
|
|
362
|
-
metadata?: Record<string, any>;
|
|
363
|
-
}
|
|
364
|
-
interface Category {
|
|
365
|
-
displayName?: string;
|
|
366
|
-
type: 'mesh';
|
|
367
|
-
assets: Asset[];
|
|
368
|
-
}
|
|
369
|
-
interface AssetManifest {
|
|
370
|
-
version: string;
|
|
371
|
-
generatedAt: string;
|
|
372
|
-
categories: Record<string, Category>;
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
interface Avatar3dEdits {
|
|
376
|
-
wasChanged: boolean;
|
|
377
|
-
config: Avatar3dConfig | null;
|
|
378
|
-
savedAvatarId: string | null;
|
|
379
|
-
}
|
|
380
|
-
interface ShowEditorOptions {
|
|
381
|
-
currentAvatar?: any;
|
|
382
|
-
contextData?: any;
|
|
383
|
-
onSave?: () => void;
|
|
384
|
-
onCancel?: () => void;
|
|
385
|
-
}
|
|
386
|
-
interface Avatar3dApi {
|
|
387
|
-
loadAvatar(avatarId?: string): Promise<Avatar3dConfig | null>;
|
|
388
|
-
saveAvatar(config: Avatar3dConfig): Promise<string>;
|
|
389
|
-
deleteAvatar(): Promise<void>;
|
|
390
|
-
downloadManifest(): Promise<AssetManifest>;
|
|
391
|
-
showEditor(options?: ShowEditorOptions): Promise<Avatar3dEdits>;
|
|
392
|
-
downloadAssetPaths(): Promise<Record<string, string[]>>;
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
declare global {
|
|
396
|
-
interface Window {
|
|
397
|
-
VenusPrototyping?: {
|
|
398
|
-
showAvatarEditorOverlay: (options: any, resolve: (args: any) => void) => Promise<void>;
|
|
399
|
-
};
|
|
400
|
-
}
|
|
401
|
-
}
|
|
402
|
-
declare class MockAvatarApi implements Avatar3dApi {
|
|
403
|
-
private readonly _venusApi;
|
|
404
|
-
private cachedAssets;
|
|
405
|
-
private cachedVersion;
|
|
406
|
-
constructor(venusApi: VenusAPI);
|
|
407
|
-
downloadAssetPaths(): Promise<Record<string, string[]>>;
|
|
408
|
-
deleteAvatar(): Promise<void>;
|
|
409
|
-
loadAvatar(avatar3dId?: string): Promise<Avatar3dConfig | null>;
|
|
410
|
-
saveAvatar(config: Avatar3dConfig): Promise<string>;
|
|
411
|
-
downloadManifest(): Promise<AssetManifest>;
|
|
412
|
-
showEditor(options?: ShowEditorOptions): Promise<Avatar3dEdits>;
|
|
413
|
-
private getAssets;
|
|
414
|
-
private loadAssetsManifest;
|
|
415
|
-
private selectAvatarConfig;
|
|
416
|
-
private selectAsset;
|
|
417
|
-
private seededRandom;
|
|
418
|
-
private simpleHash;
|
|
419
|
-
private getAllAssetPaths;
|
|
420
|
-
private log;
|
|
421
|
-
}
|
|
422
|
-
|
|
423
|
-
/**
|
|
424
|
-
* DEFINITIVE TypeScript definitions for Venus H5 API
|
|
425
|
-
*
|
|
426
|
-
* This is the single source of truth for all H5 games.
|
|
427
|
-
*
|
|
428
|
-
* Usage in H5 games:
|
|
429
|
-
* ```typescript
|
|
430
|
-
* import type { VenusAPI } from '../../venus-api/types';
|
|
431
|
-
* declare const VenusAPI: VenusAPI;
|
|
432
|
-
* ```
|
|
433
|
-
*/
|
|
434
|
-
|
|
435
|
-
interface RecipeRequirementResult {
|
|
436
|
-
recipeId: string;
|
|
437
|
-
entity: string | null;
|
|
438
|
-
amount?: number;
|
|
439
|
-
inputs: Record<string, any>;
|
|
440
|
-
canAfford: boolean;
|
|
441
|
-
disabled: boolean;
|
|
442
|
-
}
|
|
443
|
-
interface VenusSimulationState {
|
|
444
|
-
inventory: Record<string, number | string>;
|
|
445
|
-
activeRuns: Array<{
|
|
446
|
-
id: string;
|
|
447
|
-
recipeId: string;
|
|
448
|
-
status: string;
|
|
449
|
-
startTime: number;
|
|
450
|
-
expiresAt: number;
|
|
451
|
-
inputs?: Record<string, number | string>;
|
|
452
|
-
outputs?: Record<string, number | string>;
|
|
453
|
-
entity?: string;
|
|
454
|
-
}>;
|
|
455
|
-
disabledRecipes: string[];
|
|
456
|
-
}
|
|
457
|
-
interface VenusSimulationEffect {
|
|
458
|
-
type: string;
|
|
459
|
-
target: any;
|
|
460
|
-
value: any;
|
|
461
|
-
}
|
|
462
|
-
interface VenusSimulationRecipe {
|
|
463
|
-
scope: 'player' | 'room' | 'actor';
|
|
464
|
-
inputs: Record<string, any>;
|
|
465
|
-
autoRestart?: boolean;
|
|
466
|
-
beginEffects?: VenusSimulationEffect[];
|
|
467
|
-
endEffects?: VenusSimulationEffect[];
|
|
468
|
-
outputs?: Record<string, any>;
|
|
469
|
-
duration?: number;
|
|
470
|
-
maxRestartCondition?: any;
|
|
471
|
-
metadata?: {
|
|
472
|
-
startsDisabled?: boolean;
|
|
473
|
-
autoRestart?: boolean;
|
|
474
|
-
maxRestartCondition?: any;
|
|
475
|
-
};
|
|
476
|
-
guards?: Record<string, any>;
|
|
477
|
-
effects?: Array<any>;
|
|
478
|
-
clientViewable?: boolean;
|
|
479
|
-
}
|
|
480
|
-
interface VenusSimulationConfig {
|
|
481
|
-
version: string;
|
|
482
|
-
entities: Record<string, {
|
|
483
|
-
tags?: string[];
|
|
484
|
-
metadata?: Record<string, any>;
|
|
485
|
-
stackable?: boolean;
|
|
486
|
-
neverConsumable?: boolean;
|
|
487
|
-
clientViewable?: boolean;
|
|
488
|
-
slots?: Record<string, {
|
|
489
|
-
allowedTags: string[];
|
|
490
|
-
maxItems: number;
|
|
491
|
-
}>;
|
|
492
|
-
actorTemplate?: {
|
|
493
|
-
defaultState?: Record<string, any>;
|
|
494
|
-
availableRecipes?: string[];
|
|
495
|
-
};
|
|
496
|
-
}>;
|
|
497
|
-
recipes: Record<string, VenusSimulationRecipe>;
|
|
498
|
-
fieldResolution?: Record<string, any>;
|
|
499
|
-
matchmaking?: Record<string, any>;
|
|
500
|
-
}
|
|
501
|
-
interface RecipeRequirementQuery {
|
|
502
|
-
recipeId: string;
|
|
503
|
-
entity?: string;
|
|
504
|
-
batchAmount?: number;
|
|
505
|
-
}
|
|
506
|
-
interface BatchRecipeRequirementsResult {
|
|
507
|
-
success: boolean;
|
|
508
|
-
results: RecipeRequirementResult[];
|
|
509
|
-
errors?: Array<any>;
|
|
510
|
-
}
|
|
511
|
-
interface VenusSimulationAPI {
|
|
512
|
-
isEnabled(): boolean;
|
|
513
|
-
getStateAsync(options?: {
|
|
514
|
-
roomId?: string;
|
|
515
|
-
}): Promise<VenusSimulationState>;
|
|
516
|
-
getConfigAsync(): Promise<VenusSimulationConfig>;
|
|
517
|
-
executeRecipeAsync(recipeId: string, inputs?: Record<string, any>, options?: any): Promise<any>;
|
|
518
|
-
executeScopedRecipeAsync(recipeId: string, entity: string, inputs?: Record<string, any>, roomId?: string, options?: any): Promise<any>;
|
|
519
|
-
getActiveRunsAsync(): Promise<any[]>;
|
|
520
|
-
collectRecipeAsync(runId: string): Promise<any>;
|
|
521
|
-
triggerRecipeChainAsync(triggerRecipeId: string, context?: any, roomId?: string): Promise<any>;
|
|
522
|
-
getRecipeRequirementsAsync(recipeId: string, entity?: string, amount?: number): Promise<RecipeRequirementResult>;
|
|
523
|
-
getBatchRecipeRequirementsAsync(queries: RecipeRequirementQuery[]): Promise<BatchRecipeRequirementsResult>;
|
|
524
|
-
getAvailableRecipesAsync(roomId?: string, includeActorRecipes?: boolean): Promise<Array<any>>;
|
|
525
|
-
resolveFieldValueAsync(entityId: string, fieldPath: string, entity?: string): Promise<any>;
|
|
526
|
-
getEntityMetadataAsync(entityId: string): Promise<any>;
|
|
527
|
-
getSlotContainersAsync(): Promise<Array<any>>;
|
|
528
|
-
getSlotAssignmentsAsync(containerId: string): Promise<Array<any>>;
|
|
529
|
-
assignItemToSlotAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
530
|
-
removeItemFromSlotAsync(containerId: string, slotId: string): Promise<any>;
|
|
531
|
-
getAvailableItemsAsync(containerId: string, slotId: string): Promise<Array<any>>;
|
|
532
|
-
calculatePowerPreviewAsync(containerId: string, slotId: string, candidateItemId: string): Promise<any>;
|
|
533
|
-
validateSlotAssignmentAsync(containerId: string, slotId: string, itemId: string): Promise<any>;
|
|
534
|
-
executeBatchOperationsAsync(operations: Array<any>, validateOnly?: boolean): Promise<any>;
|
|
535
|
-
sumContributions(contributions: Record<string, any>): Record<string, number>;
|
|
536
|
-
}
|
|
537
|
-
interface VenusConfig {
|
|
538
|
-
user?: {
|
|
539
|
-
id: string;
|
|
540
|
-
username?: string;
|
|
541
|
-
languageCode: string;
|
|
542
|
-
locale: string;
|
|
543
|
-
};
|
|
544
|
-
profile?: {
|
|
545
|
-
id: string;
|
|
546
|
-
username: string;
|
|
547
|
-
avatarUrl?: string;
|
|
548
|
-
};
|
|
549
|
-
device?: {
|
|
550
|
-
screenSize: {
|
|
551
|
-
width: number;
|
|
552
|
-
height: number;
|
|
553
|
-
};
|
|
554
|
-
viewportSize: {
|
|
555
|
-
width: number;
|
|
556
|
-
height: number;
|
|
557
|
-
};
|
|
558
|
-
orientation: string;
|
|
559
|
-
hapticsEnabled: boolean;
|
|
560
|
-
};
|
|
561
|
-
theme?: Record<string, any>;
|
|
562
|
-
environment?: {
|
|
563
|
-
isDevelopment: boolean;
|
|
564
|
-
platform: string;
|
|
565
|
-
platformVersion: string;
|
|
566
|
-
browserInfo?: {
|
|
567
|
-
browser: string;
|
|
568
|
-
isMobile: boolean;
|
|
569
|
-
};
|
|
570
|
-
};
|
|
571
|
-
ui: {
|
|
572
|
-
safeArea: {
|
|
573
|
-
top: number;
|
|
574
|
-
left: number;
|
|
575
|
-
right: number;
|
|
576
|
-
bottom: number;
|
|
577
|
-
};
|
|
578
|
-
controls: Record<string, any>;
|
|
579
|
-
};
|
|
580
|
-
}
|
|
581
|
-
interface ActionSheetOption {
|
|
582
|
-
label: string;
|
|
583
|
-
icon?: string;
|
|
584
|
-
id?: string;
|
|
585
|
-
}
|
|
586
|
-
interface Profile {
|
|
587
|
-
id: string;
|
|
588
|
-
name: string;
|
|
589
|
-
username: string;
|
|
590
|
-
}
|
|
591
|
-
interface VenusAPI {
|
|
592
|
-
config: VenusConfig;
|
|
593
|
-
_mock: any;
|
|
594
|
-
_bootstrap: {
|
|
595
|
-
apiInjected: boolean;
|
|
596
|
-
venus: any;
|
|
597
|
-
};
|
|
598
|
-
initializeAsync(options?: {
|
|
599
|
-
helpText?: string;
|
|
600
|
-
hardDisableMock?: boolean;
|
|
601
|
-
mock?: Record<string, any>;
|
|
602
|
-
}): Promise<boolean>;
|
|
603
|
-
simulation: VenusSimulationAPI;
|
|
604
|
-
log(message: string, ...args: any[]): void;
|
|
605
|
-
error(message: string, ...args: any[]): void;
|
|
606
|
-
isAvailable(): boolean;
|
|
607
|
-
isMobile(): boolean;
|
|
608
|
-
isWeb(): boolean;
|
|
609
|
-
isMock(): boolean;
|
|
610
|
-
/**
|
|
611
|
-
* @deprecated Please use the new analytics API. VenusAPI.analytics
|
|
612
|
-
* @param options
|
|
613
|
-
*/
|
|
614
|
-
logCustomEvent(options: {
|
|
615
|
-
eventName: string;
|
|
616
|
-
params?: Record<string, any>;
|
|
617
|
-
}): Promise<void>;
|
|
618
|
-
getExperiment(options: {
|
|
619
|
-
experimentName: string;
|
|
620
|
-
}): Promise<any>;
|
|
621
|
-
getFeatureFlag(options: {
|
|
622
|
-
flagName: string;
|
|
623
|
-
}): Promise<any>;
|
|
624
|
-
getFeatureGate(options: {
|
|
625
|
-
gateName: string;
|
|
626
|
-
}): Promise<any>;
|
|
627
|
-
getCurrentProfile(): Profile;
|
|
628
|
-
/**
|
|
629
|
-
* @deprecated Please use the popups API. (e.g, VenusAPI.popups)
|
|
630
|
-
*/
|
|
631
|
-
showToast(message: string | {
|
|
632
|
-
message: string;
|
|
633
|
-
duration?: number;
|
|
634
|
-
variant?: string;
|
|
635
|
-
action?: {
|
|
636
|
-
label: string;
|
|
637
|
-
};
|
|
638
|
-
}): Promise<boolean>;
|
|
639
|
-
/**
|
|
640
|
-
* @deprecated Please use the popups API. (e.g, VenusAPI.popups)
|
|
641
|
-
*/
|
|
642
|
-
showAlert(options: {
|
|
643
|
-
title: string;
|
|
644
|
-
message: string;
|
|
645
|
-
buttonText?: string;
|
|
646
|
-
}): Promise<void>;
|
|
647
|
-
/**
|
|
648
|
-
* @deprecated Please use the popups API. (e.g, VenusAPI.popups)
|
|
649
|
-
*/
|
|
650
|
-
showConfirm(options: {
|
|
651
|
-
title: string;
|
|
652
|
-
message: string;
|
|
653
|
-
confirmText?: string;
|
|
654
|
-
cancelText?: string;
|
|
655
|
-
}): Promise<boolean>;
|
|
656
|
-
/**
|
|
657
|
-
* @deprecated Please use the popups API. (e.g, VenusAPI.popups)
|
|
658
|
-
*/
|
|
659
|
-
showActionSheet(options: {
|
|
660
|
-
title: string;
|
|
661
|
-
message?: string;
|
|
662
|
-
options: ActionSheetOption[];
|
|
663
|
-
cancelButtonText?: string;
|
|
664
|
-
disableCancel?: boolean;
|
|
665
|
-
}): Promise<string | number | null>;
|
|
666
|
-
triggerHapticAsync(style: HapticFeedbackStyle): Promise<void>;
|
|
667
|
-
deviceCache: {
|
|
668
|
-
setItem(key: string, value: string): Promise<void>;
|
|
669
|
-
getItem(key: string): Promise<string | null>;
|
|
670
|
-
removeItem(key: string): Promise<void>;
|
|
671
|
-
clear(): Promise<void>;
|
|
672
|
-
length(): Promise<number>;
|
|
673
|
-
key(index: number): Promise<string | null>;
|
|
674
|
-
};
|
|
675
|
-
appStorage: {
|
|
676
|
-
setItem(key: string, value: string): Promise<void>;
|
|
677
|
-
getItem(key: string): Promise<string | null>;
|
|
678
|
-
removeItem(key: string): Promise<void>;
|
|
679
|
-
clear(): Promise<void>;
|
|
680
|
-
length(): Promise<number>;
|
|
681
|
-
key(index: number): Promise<string | null>;
|
|
682
|
-
getAllItems(): Promise<string[]>;
|
|
683
|
-
setMultipleItems(items: {
|
|
684
|
-
key: string;
|
|
685
|
-
value: string;
|
|
686
|
-
}[]): Promise<void>;
|
|
687
|
-
removeMultipleItems(keys: string[]): Promise<void>;
|
|
688
|
-
};
|
|
689
|
-
globalStorage: {
|
|
690
|
-
setItem(key: string, value: string): Promise<void>;
|
|
691
|
-
getItem(key: string): Promise<string | null>;
|
|
692
|
-
removeItem(key: string): Promise<void>;
|
|
693
|
-
clear(): Promise<void>;
|
|
694
|
-
length(): Promise<number>;
|
|
695
|
-
key(index: number): Promise<string | null>;
|
|
696
|
-
};
|
|
697
|
-
onShow(handler: (context?: ShowContext) => void): void;
|
|
698
|
-
onPlay(handler: (context?: PlayContext) => void): void;
|
|
699
|
-
onPause(handler: () => void): void;
|
|
700
|
-
onResume(handler: () => void): void;
|
|
701
|
-
onQuit(handler: () => void): void;
|
|
702
|
-
onHide(handler: (context?: any) => void): void;
|
|
703
|
-
onCleanup(handler: () => void): void;
|
|
704
|
-
requestPopOrQuit(options?: QuitOptions): Promise<boolean>;
|
|
705
|
-
getPostInteractionsAsync(): Promise<any>;
|
|
706
|
-
getPostInteractions(): Promise<any>;
|
|
707
|
-
toggleLikeAsync(): Promise<any>;
|
|
708
|
-
toggleFollowAsync(): Promise<any>;
|
|
709
|
-
openCommentsAsync(options?: any): Promise<void>;
|
|
710
|
-
sharePostAsync(options: {
|
|
711
|
-
message: string;
|
|
712
|
-
title?: string;
|
|
713
|
-
additionalInfo?: any;
|
|
714
|
-
}): Promise<void>;
|
|
715
|
-
/**
|
|
716
|
-
* @deprecated Please use the ads API. (e.g, VenusAPI.ads)
|
|
717
|
-
*/
|
|
718
|
-
isRewardedAdReadyAsync(): Promise<boolean>;
|
|
719
|
-
/**
|
|
720
|
-
* @deprecated Please use the ads API. (e.g, VenusAPI.ads)
|
|
721
|
-
*/
|
|
722
|
-
showRewardedAdAsync(): Promise<boolean>;
|
|
723
|
-
requestTimeAsync(): Promise<{
|
|
724
|
-
serverTime: number;
|
|
725
|
-
}>;
|
|
726
|
-
getFutureTimeAsync(options: {
|
|
727
|
-
days?: number;
|
|
728
|
-
hours?: number;
|
|
729
|
-
minutes?: number;
|
|
730
|
-
timeOfDay?: any;
|
|
731
|
-
timezone?: string;
|
|
732
|
-
}): Promise<number>;
|
|
733
|
-
formatTime(timestamp: number, options?: any): string;
|
|
734
|
-
formatNumber(value: number, options?: any): string;
|
|
735
|
-
/**
|
|
736
|
-
* @deprecated Please use the cdn API. VenusAPI.cdn
|
|
737
|
-
*/
|
|
738
|
-
fetchFromCdn(url: string, options?: RequestInit): Promise<Response>;
|
|
739
|
-
/**
|
|
740
|
-
* @deprecated Please use the cdn API. VenusAPI.cdn
|
|
741
|
-
*/
|
|
742
|
-
resolveAssetUrl(path: string): string;
|
|
743
|
-
/**
|
|
744
|
-
* @deprecated Please use the cdn API. VenusAPI.cdn
|
|
745
|
-
*/
|
|
746
|
-
resolveAvatarAssetUrl(path: string): string;
|
|
747
|
-
/**
|
|
748
|
-
* @deprecated Please use the cdn API. VenusAPI.cdn
|
|
749
|
-
*/
|
|
750
|
-
resolveSharedLibUrl(path: string): string;
|
|
751
|
-
/**
|
|
752
|
-
* @deprecated Please use the cdn API. VenusAPI.cdn
|
|
753
|
-
*/
|
|
754
|
-
getAssetCdnBaseUrl(): string;
|
|
755
|
-
loadAsset(url: string, options?: {
|
|
756
|
-
type?: string;
|
|
757
|
-
streaming?: boolean;
|
|
758
|
-
cache?: boolean;
|
|
759
|
-
timeout?: number;
|
|
760
|
-
isOptional?: boolean;
|
|
761
|
-
}): Promise<string>;
|
|
762
|
-
preloadAssets(assets: Array<string | {
|
|
763
|
-
url: string;
|
|
764
|
-
isOptional?: boolean;
|
|
765
|
-
}>, options?: {
|
|
766
|
-
onProgress?: (progress: number, info: any) => void;
|
|
767
|
-
}): Promise<Array<{
|
|
768
|
-
success: boolean;
|
|
769
|
-
isOptional?: boolean;
|
|
770
|
-
}>>;
|
|
771
|
-
cleanupAssets(): void;
|
|
772
|
-
assetLoader?: {
|
|
773
|
-
getCached(url: string): string | null;
|
|
774
|
-
};
|
|
775
|
-
scheduleLocalNotifAsync(options: {
|
|
776
|
-
title: string;
|
|
777
|
-
body: string;
|
|
778
|
-
timeFromNow?: number;
|
|
779
|
-
trigger?: NotificationTriggerInput;
|
|
780
|
-
priority?: number;
|
|
781
|
-
groupId?: string;
|
|
782
|
-
payload?: any;
|
|
783
|
-
data?: any;
|
|
784
|
-
sound?: string;
|
|
785
|
-
badge?: number;
|
|
786
|
-
}): Promise<string>;
|
|
787
|
-
cancelLocalNotifAsync(notificationId: string): Promise<void>;
|
|
788
|
-
getAllLocalNotifsAsync(): Promise<ScheduleLocalNotification[]>;
|
|
789
|
-
isLocalNotifEnabledAsync(): Promise<boolean>;
|
|
790
|
-
setLocalNotifEnabledAsync(enabled: boolean): Promise<void>;
|
|
791
|
-
showAvatar3dEditorAsync(options: {
|
|
792
|
-
currentAvatar?: any;
|
|
793
|
-
contextData?: any;
|
|
794
|
-
}): Promise<Avatar3dEdits>;
|
|
795
|
-
loadAvatar3dAsync(avatarId?: string): Promise<any>;
|
|
796
|
-
saveAvatar3dAsync(config: any): Promise<string>;
|
|
797
|
-
deleteAvatar3dAsync(): Promise<void>;
|
|
798
|
-
downloadAvatar3dAssetPathsAsync(): Promise<Record<string, string[]>>;
|
|
799
|
-
downloadAvatar3dManifestAsync(): Promise<AssetManifest>;
|
|
800
|
-
pushAppAsync(appId: string, options?: {
|
|
801
|
-
contextData?: any;
|
|
802
|
-
appParams?: any;
|
|
803
|
-
}): Promise<any>;
|
|
804
|
-
popAppAsync(): Promise<void>;
|
|
805
|
-
getStackInfo(): {
|
|
806
|
-
isInStack: boolean;
|
|
807
|
-
stackPosition: number;
|
|
808
|
-
};
|
|
809
|
-
rooms: {
|
|
810
|
-
create(options: any): Promise<any>;
|
|
811
|
-
join(roomId: string): Promise<any>;
|
|
812
|
-
joinOrCreate(options: any): Promise<any>;
|
|
813
|
-
};
|
|
814
|
-
createRoom(options: any): Promise<any>;
|
|
815
|
-
joinRoom(roomId: string): Promise<any>;
|
|
816
|
-
joinOrCreateRoom(options: any): Promise<any>;
|
|
817
|
-
listPublicRooms(gameType?: string, limit?: number): Promise<any>;
|
|
818
|
-
searchRooms(searchQuery: string, gameType?: string, limit?: number): Promise<any>;
|
|
819
|
-
joinRoomByCode(roomCode: string): Promise<any>;
|
|
820
|
-
getUserRooms(appId: string, includeArchived?: boolean): Promise<any>;
|
|
821
|
-
quickMatch(gameType: string): Promise<any>;
|
|
822
|
-
isRoomSystemEnabled(): boolean;
|
|
823
|
-
createGameRoom(options: any): Promise<any>;
|
|
824
|
-
subscribeToGameEvents(roomId: string, callback: (event: any) => void): () => void;
|
|
825
|
-
notifyCleanupComplete(): void;
|
|
826
|
-
RoomEvents: {
|
|
827
|
-
OPTIMISTIC_GAME_STATE_UPDATED: string;
|
|
828
|
-
PROPOSED_MOVE_VALIDATION_UPDATED: string;
|
|
829
|
-
};
|
|
830
|
-
numbers?: {
|
|
831
|
-
normalize(value: string | number): string;
|
|
832
|
-
};
|
|
833
|
-
iap: IapApi;
|
|
834
|
-
cdn: CdnApi;
|
|
835
|
-
ads: AdsApi;
|
|
836
|
-
ai: AiApi;
|
|
837
|
-
popups: PopupsApi;
|
|
838
|
-
analytics: AnalyticsApi;
|
|
839
|
-
sharedAssets: SharedAssetsApi;
|
|
840
|
-
}
|
|
841
|
-
|
|
842
|
-
interface AdsApi {
|
|
843
|
-
/**
|
|
844
|
-
* @deprecated This is no longer needed. Do not use
|
|
845
|
-
*/
|
|
846
|
-
isRewardedAdReadyAsync(): Promise<boolean>;
|
|
847
|
-
showRewardedAdAsync(): Promise<boolean>;
|
|
848
|
-
showInterstitialAd(): Promise<boolean>;
|
|
849
|
-
}
|
|
850
|
-
|
|
851
|
-
export { MockAvatarApi as $, type AnalyticsApi as A, type RecipeRequirementResult as B, type SpendCurrencyOptions as C, type LoadEmbeddedAssetsResponse as D, type SharedAssetsApi as E, type AdsApi as F, type Avatar3dApi as G, type HapticsApi as H, type IapApi as I, type CdnApi as J, type AssetManifest as K, type LifecycleApi as L, type Avatar3dConfig as M, type NavigationApi as N, type OnCleanupCallback as O, type PushAppOptions as P, type QuitOptions as Q, type RpcRequest as R, type ScheduleLocalNotification as S, type ShowEditorOptions as T, type Avatar3dEdits as U, type VenusAPI as V, type SubPath as W, type FetchBlobOptions as X, type AiMessage as Y, type Asset as Z, type Category as _, type RpcResponse as a, type Insets as a0, type PostInfo as a1, type TimeIntervalTriggerInput as a2, type DateTriggerInput as a3, type CalendarTriggerInput as a4, type DailyTriggerInput as a5, type WeeklyTriggerInput as a6, type MonthlyTriggerInput as a7, type YearlyTriggerInput as a8, type NotificationTriggerInput as a9, type Subscription as aa, type OnRequestCallback as ab, type OnResponseCallback as ac, type OnNotificationCallback as ad, type RpcTransport as ae, RpcSharedAssetsApi as af, type LoadEmbeddedAssetsRequest as ag, type VenusSimulationState as ah, type VenusSimulationEffect as ai, type VenusSimulationRecipe as aj, type RecipeRequirementQuery as ak, type BatchRecipeRequirementsResult as al, type VenusSimulationAPI as am, type VenusConfig as an, type ActionSheetOption as ao, type RpcNotification as b, RpcClient as c, type NavigationStackInfo as d, type NotificationsApi as e, type ScheduleLocalNotificationOptions as f, type PopupsApi as g, type ActionSheetItem as h, type ShowActionSheetOptions as i, type ShowAlertOptions as j, type ShowConfirmOptions as k, type ShowToastOptions as l, type Profile as m, type AiApi as n, type AiChatCompletionRequest as o, type AiChatCompletionData as p, HapticFeedbackStyle as q, type OnShowCallback as r, type OnHideCallback as s, type OnPauseCallback as t, type OnPlayCallback as u, type OnQuitCallback as v, type OnResumeCallback as w, type PlayContext as x, type ShowContext as y, type VenusSimulationConfig as z };
|