@worldfirst/worldfirst-js 0.0.1 → 0.0.1775118337-dev.7

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,694 @@
1
+ import type * as CSS_2 from 'csstype';
2
+
3
+ declare interface Appearance<Props extends Partial<DefaultAppearanceProps> = DefaultAppearanceProps> {
4
+ theme?: Props['theme'];
5
+ variables?: PartialSpeKey<Props['variables'], string>;
6
+ rules?: PartialSpeKey<Props['rules'], CSS_2.Properties<string, number>>;
7
+ displaySetting?: PartialSpeKey<Props['displaySetting'], boolean>;
8
+ layout?: Props['layout'];
9
+ }
10
+
11
+ /**
12
+ * @description 内置基础的桥接事件映射类型
13
+ */
14
+ declare interface BaseBridgeEventMap<AppConfig extends Record<string, any> = Record<string, any>, SubmitReplay extends Record<string, any> = Record<string, any>, SubmitParams extends Record<string, any> = Record<string, any>, AppErrorCodes extends string = string, OpenModalConfig extends BaseOpenModalConfig = BaseOpenModalConfig> {
15
+ error: ErrorPayload<AppErrorCodes>;
16
+ /**
17
+ * @internal 内部事件 不暴露给商户
18
+ */
19
+ "OPENSDK@HANDSHAKE": AppConfig;
20
+ /**
21
+ * @internal 内部事件 不暴露给商户
22
+ */
23
+ "OPENSDK@UPDATE_CONFIG": {
24
+ merged: AppConfig;
25
+ updated: Partial<AppConfig>;
26
+ };
27
+ /**
28
+ * @internal 内部事件 不暴露给商户
29
+ */
30
+ "OPENSDK@HANDSHAKE_ACK": {
31
+ version: string;
32
+ };
33
+ /**
34
+ * @internal 内部事件 不暴露给商户
35
+ */
36
+ "OPENSDK@SUBMIT": SubmitParams;
37
+ /**
38
+ * @internal 内部事件 不暴露给商户
39
+ */
40
+ "OPENSDK@SUBMIT_REPLY": SubmitReplay;
41
+ /**
42
+ * @internal 内部事件 不暴露给商户,OPEN_MODAL作为全局事件
43
+ */
44
+ "OPENSDK@OPEN_MODAL": OpenModalConfig;
45
+ /**
46
+ * @internal 内部事件 不暴露给商户,OPEN_MODAL_ERROR作为全局事件
47
+ */
48
+ "OPENSDK@OPEN_MODAL_ERROR": ErrorPayload;
49
+ /**
50
+ * @internal 内部事件 不暴露给商户,CLOSE_MODAL作为全局事件
51
+ */
52
+ "OPENSDK@CLOSE_MODAL": void;
53
+ /**
54
+ * @internal 内部事件 不暴露给商户,REDIRECT作为全局事件
55
+ */
56
+ "OPENSDK@REDIRECT": RedirectOption;
57
+ /**
58
+ * @internal 内部事件 不暴露给商户
59
+ */
60
+ "OPENSDK@TRANSFER_MODAL_PORT": string;
61
+ /**
62
+ * @internal 内部事件 不暴露给商户
63
+ */
64
+ "OPENSDK@TRANSFER_MODAL_APPEARANCE": Appearance;
65
+ /**
66
+ * @internal 内部事件 不暴露给商户
67
+ */
68
+ "OPENSDK@TRANSFER_APP_PORT": string;
69
+ /**
70
+ * @internal 内部事件 不暴露给商户
71
+ */
72
+ "OPENSDK@ERROR": ErrorPayload<AppErrorCodes>;
73
+ /**
74
+ * @internal 内部事件 不暴露给商户
75
+ */
76
+ "OPENSDK@TRANSFER_RECEIVE_PORT": string;
77
+ /**
78
+ * @internal 内部事件 不暴露给商户
79
+ */
80
+ "OPENSDK@TRANSFER_SEND_PORT": string;
81
+ /**
82
+ * @internal 内部事件 不暴露给商户
83
+ */
84
+ "OPENSDK@MESSAGE": {
85
+ type: 'INFO' | 'WARN';
86
+ message: string;
87
+ };
88
+ /**
89
+ * @internal 内部高度变化,同步到sdk更新iframe
90
+ */
91
+ "OPENSDK@HEIGHT_UPDATE": number;
92
+ }
93
+
94
+ declare interface BaseConfig {
95
+ /**
96
+ * @description 透传参数
97
+ */
98
+ targetOrigin: string;
99
+ /**
100
+ * @description 是否开启debug
101
+ */
102
+ debug?: boolean;
103
+ /**
104
+ * @description 当前的环境
105
+ */
106
+ env: 'sandbox' | 'prod';
107
+ /**
108
+ * @description 多语言
109
+ */
110
+ locale?: string;
111
+ /**
112
+ * @description 版本号
113
+ * @internal 不透出到用户
114
+ */
115
+ version: string;
116
+ }
117
+
118
+ /**
119
+ * @description 基础组件/页面
120
+ */
121
+ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElementConfig, EventMap extends BaseBridgeEventMap<Config['appConfig']> = BaseBridgeEventMap<Config['appConfig']>> {
122
+ static elementType: string;
123
+ /**
124
+ * @description 当前元素名称,预留用于保存判断当前元素
125
+ * @internal 外部不要访问
126
+ */
127
+ name: string;
128
+ /**
129
+ * @description 元素模式
130
+ * @internal 外部不要访问
131
+ */
132
+ private _elementMode;
133
+ /**
134
+ * @description 是否主元素
135
+ * @internal 外部不要访问
136
+ */
137
+ private _isMainElement;
138
+ /**
139
+ * @description 元素配置
140
+ * @internal 内部属性不暴露给商户
141
+ */
142
+ protected config: WithAppURL<Config>;
143
+ /**
144
+ * @description 通信桥
145
+ * @internal 外部不要访问
146
+ */
147
+ private bridge;
148
+ /**
149
+ * @description 钩子函数集合
150
+ * @internal 外部不要访问
151
+ */
152
+ private hooks;
153
+ /**
154
+ * @description iframe实例
155
+ * @internal 内部使用
156
+ */
157
+ iframe: HTMLIFrameElement | null;
158
+ status: 'initialized' | 'mounting' | 'mounted' | 'ready' | 'destroyed' | 'unmounted';
159
+ /**
160
+ * @description 等待发送的时间
161
+ * @internal 外部不要访问
162
+ */
163
+ private cachedSend;
164
+ constructor(name: string, config: WithAppURL<Config>);
165
+ /**
166
+ * @internal 外部不能直接调用
167
+ */
168
+ protected submit(_params?: EventMap['OPENSDK@SUBMIT']): Promise<EventMap['OPENSDK@SUBMIT_REPLY']>;
169
+ /**
170
+ * 挂载前的配置准备,可以用来发请求,该方法报错,则会卸载元素
171
+ * @internal 外部不能直接调用
172
+ */
173
+ setup(): Promise<Partial<BaseElementAppConfig> | undefined>;
174
+ /**
175
+ * @param {string | HTMLElement} containerId 如果给字符串id不要带#号
176
+ */
177
+ mount(containerId: HTMLElement): Promise<void>;
178
+ /**
179
+ * @description 内部使用,挂载iframe
180
+ * @internal 外部不能直接调用
181
+ */
182
+ private _mount;
183
+ /**
184
+ * 更新webapp配置
185
+ * @param {Partial<BaseElementAppConfig>} newConfig
186
+ */
187
+ updateConfig(newConfig: Partial<Config['appConfig']>): void;
188
+ /**
189
+ * 卸载元素
190
+ */
191
+ umount(): void;
192
+ /**
193
+ * 独立模式,需要实现submit
194
+ * @internal 内部属性不暴露给商户
195
+ */
196
+ protected get isSingleMode(): boolean;
197
+ /**
198
+ * 监听消息
199
+ */
200
+ on<T extends keyof EventMap>(event: T, handler: (payload: EventMap[T]) => void): void;
201
+ /**
202
+ * 监听消息,默认为保护方法,如果要暴露,请在子类中重写
203
+ * @internal 外部不能直接调用
204
+ */
205
+ protected send<T extends keyof EventMap>(event: T, payload?: EventMap[T]): void;
206
+ /**
207
+ * @description 内部使用
208
+ * @internal 外部不能直接调用
209
+ */
210
+ _addPort(port: MessagePort[]): void;
211
+ /**
212
+ * @description 内部使用
213
+ * @internal 外部不能直接调用
214
+ */
215
+ _transferReceivePort(port: ReceivePort): void;
216
+ /**
217
+ * @description 内部使用
218
+ * @internal 外部不能直接调用
219
+ */
220
+ _transferSendPort(port: SendPort): void;
221
+ /**
222
+ * 发送提交信息给WEBAPP, 同时接收回复
223
+ * @mode HOST独有
224
+ * @param data 额外提交的信息
225
+ * @internal 外部不能直接调用
226
+ */
227
+ protected _submit(data?: EventMap['OPENSDK@SUBMIT']): Promise<EventMap['OPENSDK@SUBMIT_REPLY']>;
228
+ destroy(): void;
229
+ get isMainElement(): boolean;
230
+ /**
231
+ * 对于独立的input需要实现
232
+ */
233
+ protected abstract focus(): void;
234
+ /**
235
+ * 对于独立的input需要实现
236
+ */
237
+ protected abstract blur(): void;
238
+ /**
239
+ * 对于独立的input需要实现
240
+ */
241
+ protected abstract clear(): void;
242
+ /**
243
+ * @param hookName 钩子名称
244
+ * @param fn 构建回调
245
+ * @internal
246
+ */
247
+ _addHook(hookName: 'ondestroy', fn: () => void): () => void;
248
+ }
249
+
250
+ declare interface BaseElementAppConfig {
251
+ locale?: string;
252
+ /**
253
+ * @internal 不透出给商户
254
+ */
255
+ env?: 'sandbox' | 'prod';
256
+ /**
257
+ * @description 商户的唯一标识
258
+ * @internal 不透出到用户
259
+ */
260
+ merchantId?: string;
261
+ [key: string]: any;
262
+ }
263
+
264
+ declare interface BaseElementConfig<T extends BaseElementAppConfig = Record<string, any>> extends BaseConfig {
265
+ appConfig: T;
266
+ elementMode: ElementMode;
267
+ }
268
+
269
+ declare abstract class BaseFactory {
270
+ /**
271
+ * @description 工厂配置
272
+ * @internal
273
+ */
274
+ protected config: BaseFactoryConfig;
275
+ /**
276
+ * @description 是否已初始化
277
+ * @internal
278
+ */
279
+ private isInit;
280
+ /**
281
+ * @description 当前版本号
282
+ * 用于日志上报
283
+ */
284
+ version: string;
285
+ /**
286
+ * @internal
287
+ */
288
+ protected elementMode: ElementMode;
289
+ /**
290
+ * @description 已创建的元素实例列表
291
+ * @internal
292
+ */
293
+ private _elements;
294
+ /**
295
+ * @internal
296
+ * 用于和webapp通讯的全局bridge
297
+ */
298
+ private globalBridgeForWebApp;
299
+ /**
300
+ * @internal
301
+ * 用于和modal通讯的全局bridge
302
+ */
303
+ private globalBridgeForModal;
304
+ /**
305
+ * @internal
306
+ * openModal返回的handle
307
+ */
308
+ private openModalHandle;
309
+ /**
310
+ * @description 工厂可用的元素类列表
311
+ * @internal
312
+ */
313
+ protected elementClasses: Record<string, iBaseElementClass | undefined>;
314
+ /**
315
+ * @param config 配置
316
+ */
317
+ constructor(config: BaseFactoryConfig);
318
+ protected openModal(payload: BaseBridgeEventMap['OPENSDK@OPEN_MODAL']): Promise<OpenModalHandle>;
319
+ /**
320
+ * @description 子类必须实现此方法,返回工厂可用的元素类列表
321
+ * @internal
322
+ */
323
+ protected abstract canUseElements(): Array<ElementListItemType>;
324
+ /**
325
+ * @description 无需手动调用
326
+ */
327
+ init(): Promise<this>;
328
+ /**
329
+ * @description 默认情况下,生成元素的key为elementType,如有特殊需求,可重写此方法
330
+ * @internal
331
+ */
332
+ protected generateElementKey(elementType: string, _options?: Partial<BaseElementAppConfig>): string;
333
+ /**
334
+ * @description 更新工厂配置 locale debug env
335
+ * @param config
336
+ */
337
+ updateConfig(config: Partial<BaseFactoryConfig>): void;
338
+ /**
339
+ * @description 销毁所有元素实例
340
+ */
341
+ destroy(): void;
342
+ /**
343
+ * @internal
344
+ */
345
+ protected _generateElementKey(elementType: string, options?: Partial<BaseElementAppConfig>): string;
346
+ /**
347
+ * 创建element实例
348
+ * @param {string} elementType 类型
349
+ * @param {BaseElementConfig} options 选项
350
+ */
351
+ abstract createElement(elementType: string, options?: BaseElementAppConfig): BaseElement;
352
+ /**
353
+ * 获取element实例
354
+ * @param {string} elementType 类型
355
+ * @param {BaseElementConfig} options 选项
356
+ */
357
+ abstract getElement(elementType: string, options?: BaseElementAppConfig): BaseElement;
358
+ /**
359
+ * 内部实际创建element实例的方法
360
+ * @param {string} elementType 类型
361
+ * @param {BaseElementConfig} options 选项
362
+ * @returns {BaseElement}
363
+ * @internal
364
+ */
365
+ protected _createElement(elementType: string, options?: BaseElementAppConfig): BaseElement;
366
+ /**
367
+ * @description 新增元素实例
368
+ * @param {string} elementType 类型
369
+ * @param {BaseElement} element 元素实例
370
+ * @param {BaseElementConfig} options 选项
371
+ * @internal
372
+ */
373
+ protected _addElement(elementType: string, element: BaseElement, options?: BaseElementAppConfig): void;
374
+ /**
375
+ * @description 删除元素实例
376
+ * @param {string} elementType 类型
377
+ * @param {BaseElementConfig} options 选项
378
+ * @internal
379
+ */
380
+ protected _removeElement(elementType: string, options?: BaseElementAppConfig): void;
381
+ /**
382
+ * @description 获取元素实例
383
+ * @param {string} elementType 类型
384
+ * @param {BaseElementConfig} options 选项
385
+ * @returns {BaseElement | undefined}
386
+ * @internal
387
+ */
388
+ protected _getElement(elementType: string, options?: BaseElementAppConfig): BaseElement | undefined;
389
+ /**
390
+ * @description 获取已创建的元素实例数量
391
+ * @returns {number}
392
+ * @internal
393
+ */
394
+ protected _getElementSize(): number;
395
+ }
396
+
397
+ declare interface BaseFactoryConfig extends BaseConfig {
398
+ /**
399
+ * @description 用于日志上报使用的marmot code
400
+ * @internal 不透出到用户
401
+ */
402
+ trackerCode?: string;
403
+ }
404
+
405
+ declare interface BaseOpenModalConfig {
406
+ /**
407
+ * 无需手动传递,app的唯一scope
408
+ */
409
+ scope?: string;
410
+ /**
411
+ * @description 是否展示关闭按钮
412
+ */
413
+ showClose?: boolean;
414
+ /**
415
+ * @description 配合showClose使用,在加载完成后是否隐藏按钮
416
+ */
417
+ hideCloseWhenLoaded?: boolean;
418
+ /**
419
+ * @description 是否展示loading
420
+ */
421
+ showLoading?: boolean;
422
+ /**
423
+ * @description 点击关闭按钮时的回调
424
+ */
425
+ onClose?: () => void;
426
+ url: string;
427
+ /**
428
+ * 关闭时,是否需要app页面二次确认,默认为false,即直接关闭
429
+ */
430
+ closeConfirm?: boolean;
431
+ appearance?: Appearance;
432
+ }
433
+
434
+ declare interface DefaultAppearanceProps {
435
+ theme: string;
436
+ variables: string;
437
+ displaySetting: string;
438
+ layout: string;
439
+ rules: string;
440
+ }
441
+
442
+ /**
443
+ * @description 元素列表项类型
444
+ */
445
+ declare type ElementListItemType = iBaseElementClass | {
446
+ ElementClass: iBaseElementClass;
447
+ config?: Partial<BaseElementConfig>;
448
+ };
449
+
450
+ declare type ElementMode = 'SINGLE' | 'GROUP';
451
+
452
+ declare interface ErrorPayload<Code extends string = string> {
453
+ source: ErrorSource;
454
+ code: Code;
455
+ message: string;
456
+ reason: string;
457
+ traceId?: string;
458
+ stack?: string;
459
+ }
460
+
461
+ declare type ErrorSource = ErrorSource_2;
462
+
463
+ declare type ErrorSource_2 = 'SDK_INTERNAL' | 'SDK_USAGE' | 'APP_RUNTIME' | 'SERVER_API' | 'SYSTEM';
464
+
465
+ declare type GetI18nQueryParam = string | {
466
+ /**
467
+ * 多语言文案的 key
468
+ */
469
+ id: string;
470
+ /**
471
+ * 多语言文案的默认值
472
+ */
473
+ dm?: string;
474
+ /**
475
+ * 多语言文案的默认值,defaultMessage 和 dm 只需要一个就行
476
+ * 推荐使用 dm
477
+ * defaultMessage 是为了兼容中后台原来的开发习惯
478
+ */
479
+ defaultMessage?: string;
480
+ };
481
+
482
+ declare type GlobalOptions = {
483
+ i18n?: SimpleI18n;
484
+ i18nPrefix: string;
485
+ getDefaultMessage?: () => string;
486
+ };
487
+
488
+ declare interface iBaseElementClass {
489
+ new (name: string, config: BaseElementConfig): BaseElement;
490
+ elementType: string;
491
+ }
492
+
493
+ /**
494
+ * @description OpenModal的返回值类型
495
+ */
496
+ declare type OpenModalHandle = {
497
+ destroy: () => void;
498
+ onLoadedSuccess: (onLoadSuccess: () => void) => void;
499
+ getContentWindow: () => Window | null;
500
+ };
501
+
502
+ declare class OpenSDKError<Code extends string = string> extends Error {
503
+ code: Code | OpenSDKInternalErrorCodes;
504
+ name: string;
505
+ /**
506
+ * @internal
507
+ */
508
+ protected _openSDKErrorFlag: string;
509
+ source: ErrorSource;
510
+ traceId?: string;
511
+ /**
512
+ * @description 用于存储原始错误信息的,给内部调试
513
+ */
514
+ reason: string;
515
+ static isError(error: any): error is OpenSDKError;
516
+ /**
517
+ * @description 统一转换error为OpenSDKError
518
+ */
519
+ static unificationError(error: unknown, source?: ErrorSource): OpenSDKError;
520
+ static initConfig(config: Partial<GlobalOptions>): void;
521
+ constructor(_message: string | {
522
+ message: string;
523
+ params?: Record<string, any>;
524
+ }, code: Code | OpenSDKInternalErrorCodes, source: ErrorSource, _traceId?: string, serverAPIWithoutI18n?: boolean);
525
+ toJSON(): ErrorPayload<Code | OpenSDKInternalErrorCodes>;
526
+ }
527
+
528
+ declare const OpenSDKInternalErrorCodes: {
529
+ /**
530
+ * @description 未知错误
531
+ */
532
+ readonly UNKNOWN_ERROR: "UNKNOWN_ERROR";
533
+ /**
534
+ * @description 无端口错误,通常发生在模态通信中,SDK期望接收一个MessagePort但未收到
535
+ */
536
+ readonly NO_PORTS_ERROR: "NO_PORTS_ERROR";
537
+ /**
538
+ * @description 非法的URL
539
+ */
540
+ readonly INVALID_REDIRECT_URL: "INVALID_REDIRECT_URL";
541
+ };
542
+
543
+ declare type OpenSDKInternalErrorCodes = (typeof OpenSDKInternalErrorCodes)[keyof typeof OpenSDKInternalErrorCodes];
544
+
545
+ declare type PartialSpeKey<T, V> = Partial<T extends infer K extends string ? Record<K, V> : Record<string, V>>;
546
+
547
+ declare interface PreLoadConfig {
548
+ /**
549
+ * @description 预加载参数,可选配置。
550
+ * 传入需要使用的 element 类型列表,SDK 将提前加载对应资源以优化性能。
551
+ * 每个值与 createElement 的 type 参数一致,如 'Onboard'、'Vaulting'。
552
+ */
553
+ elements?: string[];
554
+ }
555
+
556
+ /**
557
+ * @description 用于收集所有其他元素的值
558
+ */
559
+ declare class ReceivePort {
560
+ targetPorts: Array<MessagePort>;
561
+ name: string;
562
+ constructor(name: string);
563
+ addPort(port: readonly MessagePort[]): void;
564
+ removePort(port: MessagePort): void;
565
+ getValues(config?: {
566
+ timeout: number;
567
+ }): Promise<Record<string, any> | undefined>;
568
+ }
569
+
570
+ declare interface RedirectOption {
571
+ url: string;
572
+ mode?: 'redirect' | 'replace';
573
+ /**
574
+ * @description 是否重定向后销毁实例,默认为true
575
+ */
576
+ destory?: boolean;
577
+ }
578
+
579
+ /**
580
+ * @description 其他元素,用于发送value到主元素
581
+ */
582
+ declare class SendPort<T extends Record<string, any> = Record<string, any>> {
583
+ targetPort: MessagePort;
584
+ name: string;
585
+ constructor(name: string, port: MessagePort);
586
+ /**
587
+ * @description 用于监听发送消息节点
588
+ */
589
+ onSendRequest(fn: () => void): void;
590
+ send(values?: T): void;
591
+ }
592
+
593
+ declare type SimpleI18n = {
594
+ get(id: GetI18nQueryParam, variable?: Record<string, any>, localeCode?: string): string;
595
+ };
596
+
597
+ /**
598
+ * @description submit return type
599
+ */
600
+ export declare interface SubmitResult {
601
+ [key: string]: any;
602
+ }
603
+
604
+ declare type WithAppURL<T> = T & {
605
+ appUrl: string;
606
+ isMainElement: boolean;
607
+ };
608
+
609
+ /**
610
+ * @public
611
+ * @description load config type
612
+ */
613
+ export declare interface WorldFirstLoadConfig extends Omit<BaseFactoryConfig, 'trackerCode' | 'targetOrigin' | 'version'>, PreLoadConfig {
614
+ }
615
+
616
+ export declare class WorldFirstSDK extends BaseFactory {
617
+ /**
618
+ * SDK 版本号
619
+ */
620
+ static version: string;
621
+ constructor(config: WorldFirstSDKConfig);
622
+ /**
623
+ * 实现 BaseFactory 的 canUseElements 抽象方法
624
+ * 返回工厂可用的元素类列表
625
+ */
626
+ protected canUseElements(): Array<ElementListItemType>;
627
+ /**
628
+ * 实现 BaseElementsFactory 的 elements 方法
629
+ * 创建并返回元素集合
630
+ * 当前用不上该方法
631
+ */
632
+ /**
633
+ * 实现 BaseElementsFactory 的 createElement 方法
634
+ * 创建单个元素
635
+ */
636
+ createElement(type: string, options?: any): any;
637
+ /**
638
+ * 实现 BaseElementsFactory 的 getElement 方法
639
+ * 获取已创建的元素
640
+ */
641
+ getElement(type: string, options?: any): any;
642
+ }
643
+
644
+ /**
645
+ * @description sdk config type
646
+ */
647
+ export declare interface WorldFirstSDKConfig extends Omit<BaseFactoryConfig, 'version' | 'targetOrigin'>, PreLoadConfig {
648
+ version?: string;
649
+ }
650
+
651
+ /**
652
+ * @description SDK element events map type
653
+ */
654
+ export declare type WorldFirstSDKElementEventsMap<AppConfig extends Record<string, any> = Record<string, any>, SubmitParams extends Record<string, any> = Record<string, any>> = BaseBridgeEventMap<AppConfig, SubmitResult, SubmitParams, string /**, OpenModalParams */>;
655
+
656
+ /**
657
+ * @description SDK Error
658
+ */
659
+ export declare class WorldFirstSDKError extends OpenSDKError<WorldFirstSDKErrorCodes> {
660
+ name: string;
661
+ }
662
+
663
+ /**
664
+ * @description SDK error codes
665
+ */
666
+ declare const WorldFirstSDKErrorCodes: {
667
+ readonly GENERATE_ELEMENT_KEY_FAILED: "GENERATE_ELEMENT_KEY_FAILED";
668
+ readonly ELEMENT_INIT_FAILED: "ELEMENT_INIT_FAILED";
669
+ readonly MOUNT_TIMEOUT: "MOUNT_TIMEOUT";
670
+ readonly MOUNT_MISSING_CONTAINER: "MOUNT_MISSING_CONTAINER";
671
+ readonly MOUNT_IFRAME_LOAD_ERROR: "MOUNT_IFRAME_LOAD_ERROR";
672
+ readonly MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE: "MOUNT_NOT_MAINELEMENT_WITH_SINGLE_MODE";
673
+ readonly MOUNT_NOT_SUPPORT: "MOUNT_NOT_SUPPORT";
674
+ readonly MOUNT_INITIAL_FAILED: "MOUNT_INITIAL_FAILED";
675
+ readonly ELEMENT_INSTANCE_DESTROYED: "ELEMENT_INSTANCE_DESTROYED";
676
+ readonly ELEMENT_DEFINE_ERROR: "ELEMENT_DEFINE_ERROR";
677
+ readonly ELEMENT_ALREADY_REGISTERED: "ELEMENT_ALREADY_REGISTERED";
678
+ readonly CANNOT_CREATE_SAME_ELEMENT_TWICE: "CANNOT_CREATE_SAME_ELEMENT_TWICE";
679
+ readonly GROUPS_ONLY_ONE_MAIN_ELEMENT: "GROUPS_ONLY_ONE_MAIN_ELEMENT";
680
+ readonly GROUPS_NOT_FOUND_MAIN_ELEMENT: "GROUPS_NOT_FOUND_MAIN_ELEMENT";
681
+ readonly NOT_SUPPORT_ELEMENT: "NOT_SUPPORT_ELEMENT";
682
+ readonly NOT_SUPPORT_SUBMIT: "NOT_SUPPORT_SUBMIT";
683
+ readonly INVALID_MODAL_URL: "INVALID_MODAL_URL";
684
+ readonly LOAD_DEBUGGER_FAILED: "LOAD_DEBUGGER_FAILED";
685
+ };
686
+
687
+ declare type WorldFirstSDKErrorCodes = (typeof WorldFirstSDKErrorCodes)[keyof typeof WorldFirstSDKErrorCodes];
688
+
689
+ /**
690
+ * @description SDK theme
691
+ */
692
+ export declare type WorldFirstTheme = 'dark' | 'light';
693
+
694
+ export { }
package/index.js DELETED
@@ -1 +0,0 @@
1
- // TODO