@worldfirst/worldfirst-js 0.0.1775118337-dev.9 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -49
- package/lib/index.cjs +1 -1
- package/lib/index.js +758 -14
- package/package.json +1 -1
- package/types.d.ts +48 -4
- package/types.untrimmed.d.ts +48 -4
package/package.json
CHANGED
package/types.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElemen
|
|
|
86
86
|
/**
|
|
87
87
|
* 卸载元素
|
|
88
88
|
*/
|
|
89
|
-
|
|
89
|
+
unmount(): void;
|
|
90
90
|
/* Excluded from this release type: isSingleMode */
|
|
91
91
|
/**
|
|
92
92
|
* 监听消息
|
|
@@ -236,6 +236,10 @@ declare interface DefaultAppearanceProps {
|
|
|
236
236
|
rules: string;
|
|
237
237
|
}
|
|
238
238
|
|
|
239
|
+
declare const ELEMENT_TYPE: {
|
|
240
|
+
ONBOARD: string;
|
|
241
|
+
};
|
|
242
|
+
|
|
239
243
|
/**
|
|
240
244
|
* @description 元素列表项类型
|
|
241
245
|
*/
|
|
@@ -246,6 +250,8 @@ declare type ElementListItemType = iBaseElementClass | {
|
|
|
246
250
|
|
|
247
251
|
declare type ElementMode = 'SINGLE' | 'GROUP';
|
|
248
252
|
|
|
253
|
+
export declare type ElementTypes = keyof typeof ELEMENT_TYPE;
|
|
254
|
+
|
|
249
255
|
declare interface ErrorPayload<Code extends string = string> {
|
|
250
256
|
source: ErrorSource;
|
|
251
257
|
code: Code;
|
|
@@ -332,13 +338,51 @@ declare type OnboardElementConfig = BaseElementConfig<OnboardAppConfig>;
|
|
|
332
338
|
/**
|
|
333
339
|
* @description Onboard element events
|
|
334
340
|
*/
|
|
335
|
-
export declare
|
|
341
|
+
export declare interface OnboardElementEvents extends WorldFirstBridgeEventMap<OnboardAppConfig, OnboardSubmitParams> {
|
|
342
|
+
stepChange: {
|
|
343
|
+
hasNext: boolean;
|
|
344
|
+
hasPre: boolean;
|
|
345
|
+
hasTemporaryStorage: boolean;
|
|
346
|
+
hasSubmit: boolean;
|
|
347
|
+
nodeId: string;
|
|
348
|
+
/**
|
|
349
|
+
* 是否是上一步
|
|
350
|
+
*/
|
|
351
|
+
stepBack: boolean;
|
|
352
|
+
};
|
|
353
|
+
updateTheme: Record<string, string>;
|
|
354
|
+
}
|
|
336
355
|
|
|
337
356
|
/**
|
|
338
|
-
* @description
|
|
357
|
+
* @description submit params
|
|
339
358
|
*/
|
|
340
359
|
export declare interface OnboardSubmitParams {
|
|
341
|
-
|
|
360
|
+
/**
|
|
361
|
+
* @description 提交是否成功
|
|
362
|
+
*/
|
|
363
|
+
success: boolean;
|
|
364
|
+
/**
|
|
365
|
+
* @description 返回的数据
|
|
366
|
+
*/
|
|
367
|
+
data?: Record<string, any>;
|
|
368
|
+
/**
|
|
369
|
+
* @description 错误信息
|
|
370
|
+
*/
|
|
371
|
+
error?: {
|
|
372
|
+
source: string;
|
|
373
|
+
code: string;
|
|
374
|
+
message: string;
|
|
375
|
+
reason: string;
|
|
376
|
+
traceId?: string;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* @description 兼容旧版本的 result 字段
|
|
380
|
+
*/
|
|
381
|
+
result?: 'success' | 'fail';
|
|
382
|
+
/**
|
|
383
|
+
* @description 兼容旧版本的 errorMessage 字段
|
|
384
|
+
*/
|
|
385
|
+
errorMessage?: string;
|
|
342
386
|
}
|
|
343
387
|
|
|
344
388
|
/**
|
package/types.untrimmed.d.ts
CHANGED
|
@@ -192,7 +192,7 @@ declare abstract class BaseElement<Config extends BaseElementConfig = BaseElemen
|
|
|
192
192
|
/**
|
|
193
193
|
* 卸载元素
|
|
194
194
|
*/
|
|
195
|
-
|
|
195
|
+
unmount(): void;
|
|
196
196
|
/**
|
|
197
197
|
* 独立模式,需要实现submit
|
|
198
198
|
* @internal 内部属性不暴露给商户
|
|
@@ -462,6 +462,10 @@ declare interface DefaultAppearanceProps {
|
|
|
462
462
|
rules: string;
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
+
declare const ELEMENT_TYPE: {
|
|
466
|
+
ONBOARD: string;
|
|
467
|
+
};
|
|
468
|
+
|
|
465
469
|
/**
|
|
466
470
|
* @description 元素列表项类型
|
|
467
471
|
*/
|
|
@@ -472,6 +476,8 @@ declare type ElementListItemType = iBaseElementClass | {
|
|
|
472
476
|
|
|
473
477
|
declare type ElementMode = 'SINGLE' | 'GROUP';
|
|
474
478
|
|
|
479
|
+
export declare type ElementTypes = keyof typeof ELEMENT_TYPE;
|
|
480
|
+
|
|
475
481
|
declare interface ErrorPayload<Code extends string = string> {
|
|
476
482
|
source: ErrorSource;
|
|
477
483
|
code: Code;
|
|
@@ -558,13 +564,51 @@ declare type OnboardElementConfig = BaseElementConfig<OnboardAppConfig>;
|
|
|
558
564
|
/**
|
|
559
565
|
* @description Onboard element events
|
|
560
566
|
*/
|
|
561
|
-
export declare
|
|
567
|
+
export declare interface OnboardElementEvents extends WorldFirstBridgeEventMap<OnboardAppConfig, OnboardSubmitParams> {
|
|
568
|
+
stepChange: {
|
|
569
|
+
hasNext: boolean;
|
|
570
|
+
hasPre: boolean;
|
|
571
|
+
hasTemporaryStorage: boolean;
|
|
572
|
+
hasSubmit: boolean;
|
|
573
|
+
nodeId: string;
|
|
574
|
+
/**
|
|
575
|
+
* 是否是上一步
|
|
576
|
+
*/
|
|
577
|
+
stepBack: boolean;
|
|
578
|
+
};
|
|
579
|
+
updateTheme: Record<string, string>;
|
|
580
|
+
}
|
|
562
581
|
|
|
563
582
|
/**
|
|
564
|
-
* @description
|
|
583
|
+
* @description submit params
|
|
565
584
|
*/
|
|
566
585
|
export declare interface OnboardSubmitParams {
|
|
567
|
-
|
|
586
|
+
/**
|
|
587
|
+
* @description 提交是否成功
|
|
588
|
+
*/
|
|
589
|
+
success: boolean;
|
|
590
|
+
/**
|
|
591
|
+
* @description 返回的数据
|
|
592
|
+
*/
|
|
593
|
+
data?: Record<string, any>;
|
|
594
|
+
/**
|
|
595
|
+
* @description 错误信息
|
|
596
|
+
*/
|
|
597
|
+
error?: {
|
|
598
|
+
source: string;
|
|
599
|
+
code: string;
|
|
600
|
+
message: string;
|
|
601
|
+
reason: string;
|
|
602
|
+
traceId?: string;
|
|
603
|
+
};
|
|
604
|
+
/**
|
|
605
|
+
* @description 兼容旧版本的 result 字段
|
|
606
|
+
*/
|
|
607
|
+
result?: 'success' | 'fail';
|
|
608
|
+
/**
|
|
609
|
+
* @description 兼容旧版本的 errorMessage 字段
|
|
610
|
+
*/
|
|
611
|
+
errorMessage?: string;
|
|
568
612
|
}
|
|
569
613
|
|
|
570
614
|
/**
|