@ives_xxz/framework 2.0.9 → 2.0.11
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/manager/FWPromiseManager.ts +1 -5
- package/package.json +2 -4
- package/types/FW.d.ts +95 -171
|
@@ -53,10 +53,7 @@ export default class FWPromiseManager extends FWManager implements FW.PromiseMan
|
|
|
53
53
|
const onAbort = () => {
|
|
54
54
|
FW.Log.debug('promise abort');
|
|
55
55
|
timerSchedule?.unSchedule();
|
|
56
|
-
|
|
57
|
-
promiseProxy.status = FW.SystemDefine.FWPromiseStatus.CANCELLED;
|
|
58
|
-
this.removePromise(id);
|
|
59
|
-
}
|
|
56
|
+
this.removePromise(id);
|
|
60
57
|
};
|
|
61
58
|
|
|
62
59
|
if (abortController.signal.aborted) {
|
|
@@ -67,7 +64,6 @@ export default class FWPromiseManager extends FWManager implements FW.PromiseMan
|
|
|
67
64
|
abortController.signal.addEventListener('abort', onAbort);
|
|
68
65
|
|
|
69
66
|
const wrappedResolve = (value: T | PromiseLike<T>) => {
|
|
70
|
-
promiseProxy.status = FW.SystemDefine.FWPromiseStatus.FULFILLED;
|
|
71
67
|
abortController.signal.removeEventListener('abort', onAbort);
|
|
72
68
|
this.removePromise(id);
|
|
73
69
|
timerSchedule?.unSchedule();
|
package/package.json
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ives_xxz/framework",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.11",
|
|
4
4
|
"description": "cocoscreator 2.x mvc framework",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"123456"
|
|
8
|
-
],
|
|
6
|
+
"keywords": ["123456"],
|
|
9
7
|
"author": "ives",
|
|
10
8
|
"license": "ISC"
|
|
11
9
|
}
|
package/types/FW.d.ts
CHANGED
|
@@ -8,18 +8,13 @@ declare namespace FW {
|
|
|
8
8
|
prototype: T;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
type ServiceIdentifierData<TInstance = unknown> =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
type
|
|
18
|
-
TInstance = unknown,
|
|
19
|
-
TArgs extends unknown[] = any[]
|
|
20
|
-
> = Newable<TInstance, TArgs>;
|
|
21
|
-
type CommonServiceIdentifier<TInstance = unknown> =
|
|
22
|
-
ServiceIdentifierData<TInstance>;
|
|
11
|
+
type ServiceIdentifierData<TInstance = unknown> = string | symbol | Newable<TInstance> | Function;
|
|
12
|
+
|
|
13
|
+
type CommonNewable<TInstance = unknown, TArgs extends unknown[] = any[]> = Newable<
|
|
14
|
+
TInstance,
|
|
15
|
+
TArgs
|
|
16
|
+
>;
|
|
17
|
+
type CommonServiceIdentifier<TInstance = unknown> = ServiceIdentifierData<TInstance>;
|
|
23
18
|
|
|
24
19
|
type ServiceIdentifier<T = unknown> = CommonServiceIdentifier<T>;
|
|
25
20
|
/**
|
|
@@ -65,13 +60,13 @@ declare namespace FW {
|
|
|
65
60
|
resolve: (value: T | PromiseLike<T>) => void,
|
|
66
61
|
reject: (reason?: any) => void,
|
|
67
62
|
signal?: AbortSignal,
|
|
68
|
-
reason?: any
|
|
63
|
+
reason?: any,
|
|
69
64
|
) => void = PromiseExcutor,
|
|
70
|
-
options: PromiseExecuteOptions = {}
|
|
65
|
+
options: PromiseExecuteOptions = {},
|
|
71
66
|
): PromiseProxy<T>;
|
|
72
67
|
all<T = any>(
|
|
73
68
|
promises: FW.PromiseProxy<T>[],
|
|
74
|
-
options: FW.PromiseExecuteOptions = {}
|
|
69
|
+
options: FW.PromiseExecuteOptions = {},
|
|
75
70
|
): FW.PromiseProxy<FW.PromiseResult<T>>;
|
|
76
71
|
};
|
|
77
72
|
|
|
@@ -79,22 +74,18 @@ declare namespace FW {
|
|
|
79
74
|
registerLanguagePackageEnum(
|
|
80
75
|
bundleName: string,
|
|
81
76
|
language: any,
|
|
82
|
-
getter: (key: string, language?: string) => string
|
|
77
|
+
getter: (key: string, language?: string) => string,
|
|
83
78
|
): void;
|
|
84
79
|
getSupportedLanguages(): string[];
|
|
85
80
|
setSupportedLanguages(languages: string[]): void;
|
|
86
81
|
getBundles(): string[];
|
|
87
82
|
getLanguage(): string;
|
|
88
83
|
getLanguageIndex(): number;
|
|
89
|
-
getLanguagePackageValue(
|
|
90
|
-
bundleName: string,
|
|
91
|
-
key: string,
|
|
92
|
-
language?: string
|
|
93
|
-
): string;
|
|
84
|
+
getLanguagePackageValue(bundleName: string, key: string, language?: string): string;
|
|
94
85
|
getLanguagePackageEnumKeys(bundleName: string): string[];
|
|
95
86
|
getLanguagePackageEnumValues(bundleName: string): string[];
|
|
96
87
|
getLanguagePackageEnum<K extends keyof ILanguageBundleAccessor>(
|
|
97
|
-
bundleName: K
|
|
88
|
+
bundleName: K,
|
|
98
89
|
): ILanguageBundleAccessor[K];
|
|
99
90
|
initializeLanguage(language: string);
|
|
100
91
|
};
|
|
@@ -112,32 +103,32 @@ declare namespace FW {
|
|
|
112
103
|
createObjectPool<T extends FWObject = FWObject>(
|
|
113
104
|
node: cc.Node,
|
|
114
105
|
parent: cc.Node,
|
|
115
|
-
tag?: string
|
|
106
|
+
tag?: string,
|
|
116
107
|
): Promise<ObjectPool<T>>;
|
|
117
108
|
createObjectPool<T extends FWObject = FWObject>(
|
|
118
109
|
prefab: cc.Prefab,
|
|
119
110
|
parent: cc.Node,
|
|
120
|
-
tag?: string
|
|
111
|
+
tag?: string,
|
|
121
112
|
): Promise<ObjectPool<T>>;
|
|
122
113
|
createObjectPool<T extends FWObject = FWObject>(
|
|
123
114
|
assetProperty: FW.AssetProperty,
|
|
124
115
|
parent: cc.Node,
|
|
125
|
-
tag?: string
|
|
116
|
+
tag?: string,
|
|
126
117
|
): Promise<ObjectPool<T>>;
|
|
127
118
|
createObjectPool<T extends FWObject = FWObject>(
|
|
128
119
|
node: cc.Node,
|
|
129
120
|
parent: cc.Node,
|
|
130
|
-
type?: number
|
|
121
|
+
type?: number,
|
|
131
122
|
): Promise<ObjectPool<T>>;
|
|
132
123
|
createObjectPool<T extends FWObject = FWObject>(
|
|
133
124
|
prefab: cc.Prefab,
|
|
134
125
|
parent: cc.Node,
|
|
135
|
-
type?: number
|
|
126
|
+
type?: number,
|
|
136
127
|
): Promise<ObjectPool<T>>;
|
|
137
128
|
createObjectPool<T extends FWObject = FWObject>(
|
|
138
129
|
assetProperty: FW.AssetProperty,
|
|
139
130
|
parent: cc.Node,
|
|
140
|
-
type?: number
|
|
131
|
+
type?: number,
|
|
141
132
|
): Promise<ObjectPool<T>>;
|
|
142
133
|
/** 获取已经创建的对象池 */
|
|
143
134
|
getObjectPool(tag: string): ObjectPool;
|
|
@@ -170,7 +161,7 @@ declare namespace FW {
|
|
|
170
161
|
address: string,
|
|
171
162
|
sender: Sender,
|
|
172
163
|
handle: Handle,
|
|
173
|
-
config: SocketConfig
|
|
164
|
+
config: SocketConfig,
|
|
174
165
|
): Promise<Socket>;
|
|
175
166
|
/**
|
|
176
167
|
* 获取socket
|
|
@@ -266,7 +257,7 @@ declare namespace FW {
|
|
|
266
257
|
tag: string,
|
|
267
258
|
sender: Sender,
|
|
268
259
|
handle: SocketHandle,
|
|
269
|
-
config: SocketConfig
|
|
260
|
+
config: SocketConfig,
|
|
270
261
|
): SocketPromiseProxy;
|
|
271
262
|
};
|
|
272
263
|
|
|
@@ -301,7 +292,7 @@ declare namespace FW {
|
|
|
301
292
|
args7?: FW.EventManagerArgs,
|
|
302
293
|
args8?: FW.EventManagerArgs,
|
|
303
294
|
args9?: FW.EventManagerArgs,
|
|
304
|
-
args10?: FW.EventManagerArgs
|
|
295
|
+
args10?: FW.EventManagerArgs,
|
|
305
296
|
);
|
|
306
297
|
/**
|
|
307
298
|
* 比较目标
|
|
@@ -362,35 +353,19 @@ declare namespace FW {
|
|
|
362
353
|
/**
|
|
363
354
|
* 一次性调度器
|
|
364
355
|
*/
|
|
365
|
-
scheduleOnce(
|
|
366
|
-
cb?: () => void,
|
|
367
|
-
time?: number,
|
|
368
|
-
tag?: string
|
|
369
|
-
): FW.TimerSchedule;
|
|
356
|
+
scheduleOnce(cb?: () => void, time?: number, tag?: string): FW.TimerSchedule;
|
|
370
357
|
/**
|
|
371
358
|
* 一次性调度器
|
|
372
359
|
*/
|
|
373
|
-
scheduleOnce(
|
|
374
|
-
time?: number,
|
|
375
|
-
cb?: () => void,
|
|
376
|
-
tag?: string
|
|
377
|
-
): FW.TimerSchedule;
|
|
360
|
+
scheduleOnce(time?: number, cb?: () => void, tag?: string): FW.TimerSchedule;
|
|
378
361
|
/**
|
|
379
362
|
* 一次性调度器
|
|
380
363
|
*/
|
|
381
|
-
scheduleOnce(
|
|
382
|
-
time?: number,
|
|
383
|
-
cb?: () => void,
|
|
384
|
-
target?: any
|
|
385
|
-
): FW.TimerSchedule;
|
|
364
|
+
scheduleOnce(time?: number, cb?: () => void, target?: any): FW.TimerSchedule;
|
|
386
365
|
/**
|
|
387
366
|
* 一次性调度器
|
|
388
367
|
*/
|
|
389
|
-
scheduleOnce(
|
|
390
|
-
cb?: () => void,
|
|
391
|
-
time?: number,
|
|
392
|
-
target?: any
|
|
393
|
-
): FW.TimerSchedule;
|
|
368
|
+
scheduleOnce(cb?: () => void, time?: number, target?: any): FW.TimerSchedule;
|
|
394
369
|
/**
|
|
395
370
|
* 自定义调度器
|
|
396
371
|
* */
|
|
@@ -399,7 +374,7 @@ declare namespace FW {
|
|
|
399
374
|
time?: number,
|
|
400
375
|
repeat?: number,
|
|
401
376
|
target?: TargetType,
|
|
402
|
-
tag?: string
|
|
377
|
+
tag?: string,
|
|
403
378
|
): TimerSchedule;
|
|
404
379
|
/** 暂停调度器 */
|
|
405
380
|
pauseSchedule(tag: string): void;
|
|
@@ -450,13 +425,13 @@ declare namespace FW {
|
|
|
450
425
|
args7?: EventManagerArgs,
|
|
451
426
|
args8?: EventManagerArgs,
|
|
452
427
|
args9?: EventManagerArgs,
|
|
453
|
-
args10?: EventManagerArgs
|
|
428
|
+
args10?: EventManagerArgs,
|
|
454
429
|
) => void,
|
|
455
430
|
target: TargetType,
|
|
456
431
|
options?: {
|
|
457
432
|
priority?: FW.SystemDefine.FWPriorityOrder;
|
|
458
433
|
intercept?: boolean;
|
|
459
|
-
}
|
|
434
|
+
},
|
|
460
435
|
);
|
|
461
436
|
|
|
462
437
|
registerOnce(
|
|
@@ -471,13 +446,13 @@ declare namespace FW {
|
|
|
471
446
|
args7?: EventManagerArgs,
|
|
472
447
|
args8?: EventManagerArgs,
|
|
473
448
|
args9?: EventManagerArgs,
|
|
474
|
-
args10?: EventManagerArgs
|
|
449
|
+
args10?: EventManagerArgs,
|
|
475
450
|
) => void,
|
|
476
451
|
target: TargetType,
|
|
477
452
|
options?: {
|
|
478
453
|
priority?: number;
|
|
479
454
|
intercept?: boolean;
|
|
480
|
-
}
|
|
455
|
+
},
|
|
481
456
|
): void;
|
|
482
457
|
|
|
483
458
|
/**
|
|
@@ -511,7 +486,7 @@ declare namespace FW {
|
|
|
511
486
|
args7?: FW.EventManagerArgs,
|
|
512
487
|
args8?: FW.EventManagerArgs,
|
|
513
488
|
args9?: FW.EventManagerArgs,
|
|
514
|
-
args10?: FW.EventManagerArgs
|
|
489
|
+
args10?: FW.EventManagerArgs,
|
|
515
490
|
): void;
|
|
516
491
|
/**
|
|
517
492
|
* 注销事件
|
|
@@ -657,37 +632,29 @@ declare namespace FW {
|
|
|
657
632
|
* @param data
|
|
658
633
|
*/
|
|
659
634
|
openAsync<Ctr extends FW.LayerController = FWLayerController>(
|
|
660
|
-
data: LayerOpenArgs<Ctr
|
|
635
|
+
data: LayerOpenArgs<Ctr>,
|
|
661
636
|
): Promise<Ctr>;
|
|
662
637
|
|
|
663
638
|
/**
|
|
664
639
|
* 同步打开layer
|
|
665
640
|
* @param data
|
|
666
641
|
*/
|
|
667
|
-
openSync<Ctr extends FW.LayerController = FWLayerController>(
|
|
668
|
-
data: LayerOpenArgs<Ctr>
|
|
669
|
-
): Ctr;
|
|
642
|
+
openSync<Ctr extends FW.LayerController = FWLayerController>(data: LayerOpenArgs<Ctr>): Ctr;
|
|
670
643
|
/**
|
|
671
644
|
* 显示常驻layer
|
|
672
645
|
* @param layer
|
|
673
646
|
*/
|
|
674
|
-
displayLayer<Ctr extends FW.LayerController = FWLayerController>(
|
|
675
|
-
ctr: Ctr
|
|
676
|
-
): Ctr;
|
|
647
|
+
displayLayer<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): Ctr;
|
|
677
648
|
/**
|
|
678
649
|
* 隐藏常驻layer
|
|
679
650
|
* @param layer
|
|
680
651
|
*/
|
|
681
|
-
hideLayer<Ctr extends FW.LayerController = FWLayerController>(
|
|
682
|
-
ctr: Ctr
|
|
683
|
-
): Ctr;
|
|
652
|
+
hideLayer<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): Ctr;
|
|
684
653
|
/**
|
|
685
654
|
* 关闭layer
|
|
686
655
|
* @param layer
|
|
687
656
|
*/
|
|
688
|
-
close<Ctr extends FW.LayerController = FWLayerController>(
|
|
689
|
-
ctr: Ctr
|
|
690
|
-
): FWLayerController;
|
|
657
|
+
close<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): FWLayerController;
|
|
691
658
|
|
|
692
659
|
/**
|
|
693
660
|
* 从栈关闭
|
|
@@ -793,10 +760,7 @@ declare namespace FW {
|
|
|
793
760
|
* @param url
|
|
794
761
|
* @param cb
|
|
795
762
|
*/
|
|
796
|
-
loadRemote<T extends cc.Asset = cc.Asset>(
|
|
797
|
-
url: string,
|
|
798
|
-
cb?: (asset: cc.Asset) => T
|
|
799
|
-
): Promise<T>;
|
|
763
|
+
loadRemote<T extends cc.Asset = cc.Asset>(url: string, cb?: (asset: cc.Asset) => T): Promise<T>;
|
|
800
764
|
/**
|
|
801
765
|
* 从远程加载spine动画
|
|
802
766
|
* @param data
|
|
@@ -812,18 +776,13 @@ declare namespace FW {
|
|
|
812
776
|
* 加载资源返回数据
|
|
813
777
|
* @param assetProperty
|
|
814
778
|
*/
|
|
815
|
-
loadAssetData<T extends cc.Asset>(
|
|
816
|
-
assetProperty: AssetProperty
|
|
817
|
-
): Promise<AssetData>;
|
|
779
|
+
loadAssetData<T extends cc.Asset>(assetProperty: AssetProperty): Promise<AssetData>;
|
|
818
780
|
|
|
819
781
|
/**
|
|
820
782
|
* 加载资源
|
|
821
783
|
* @param assetProperty
|
|
822
784
|
*/
|
|
823
|
-
loadAsset<T extends cc.Asset>(
|
|
824
|
-
assetProperty: AssetProperty,
|
|
825
|
-
cb?: () => void
|
|
826
|
-
): Promise<T>;
|
|
785
|
+
loadAsset<T extends cc.Asset>(assetProperty: AssetProperty, cb?: () => void): Promise<T>;
|
|
827
786
|
|
|
828
787
|
/**
|
|
829
788
|
* 获取资源
|
|
@@ -971,10 +930,7 @@ declare namespace FW {
|
|
|
971
930
|
* @param url
|
|
972
931
|
* @param cb
|
|
973
932
|
*/
|
|
974
|
-
loadRemote<T extends cc.Asset = cc.Asset>(
|
|
975
|
-
url: string,
|
|
976
|
-
cb?: (asset: cc.Asset) => T
|
|
977
|
-
): Promise<T>;
|
|
933
|
+
loadRemote<T extends cc.Asset = cc.Asset>(url: string, cb?: (asset: cc.Asset) => T): Promise<T>;
|
|
978
934
|
/**
|
|
979
935
|
* 从远程加载spine动画
|
|
980
936
|
* @param data
|
|
@@ -1019,10 +975,10 @@ declare namespace FW {
|
|
|
1019
975
|
};
|
|
1020
976
|
|
|
1021
977
|
type EngineManager = {
|
|
1022
|
-
launchScene: string;
|
|
1023
978
|
debug: boolean;
|
|
1024
979
|
getMemory(): void;
|
|
1025
980
|
restart(): void;
|
|
981
|
+
launchScene: string;
|
|
1026
982
|
};
|
|
1027
983
|
|
|
1028
984
|
type CCEvent = {
|
|
@@ -1178,7 +1134,7 @@ declare namespace FW {
|
|
|
1178
1134
|
*/
|
|
1179
1135
|
register(
|
|
1180
1136
|
state: FW.StateMachineRegisterArgs | FW.StateMachineRegisterArgs[],
|
|
1181
|
-
stateMachineName?: string
|
|
1137
|
+
stateMachineName?: string,
|
|
1182
1138
|
);
|
|
1183
1139
|
/**
|
|
1184
1140
|
* 注销指定状态机的某个状态
|
|
@@ -1234,22 +1190,22 @@ declare namespace FW {
|
|
|
1234
1190
|
progress: Function;
|
|
1235
1191
|
easing: Function | String;
|
|
1236
1192
|
onUpdate: Function;
|
|
1237
|
-
}
|
|
1193
|
+
}>,
|
|
1238
1194
|
>(
|
|
1239
1195
|
duration: number,
|
|
1240
1196
|
props: ConstructorType<T>,
|
|
1241
|
-
opts?: OPTS
|
|
1197
|
+
opts?: OPTS,
|
|
1242
1198
|
): FW.Tween;
|
|
1243
1199
|
by<
|
|
1244
1200
|
OPTS extends Partial<{
|
|
1245
1201
|
progress: Function;
|
|
1246
1202
|
easing: Function | String;
|
|
1247
1203
|
onUpdate: Function;
|
|
1248
|
-
}
|
|
1204
|
+
}>,
|
|
1249
1205
|
>(
|
|
1250
1206
|
duration: number,
|
|
1251
1207
|
props: ConstructorType<T>,
|
|
1252
|
-
opts?: OPTS
|
|
1208
|
+
opts?: OPTS,
|
|
1253
1209
|
): FW.Tween;
|
|
1254
1210
|
set(props: ConstructorType<T>): FW.Tween;
|
|
1255
1211
|
};
|
|
@@ -1489,11 +1445,7 @@ declare namespace FW {
|
|
|
1489
1445
|
* @param volume
|
|
1490
1446
|
* @param loop
|
|
1491
1447
|
*/
|
|
1492
|
-
playMusic(
|
|
1493
|
-
assetProperty: AssetProperty,
|
|
1494
|
-
volume?: number,
|
|
1495
|
-
loop?: boolean
|
|
1496
|
-
): void;
|
|
1448
|
+
playMusic(assetProperty: AssetProperty, volume?: number, loop?: boolean): void;
|
|
1497
1449
|
/**
|
|
1498
1450
|
* 停止背景音乐
|
|
1499
1451
|
*/
|
|
@@ -1522,12 +1474,7 @@ declare namespace FW {
|
|
|
1522
1474
|
* @param volume
|
|
1523
1475
|
* @param loop
|
|
1524
1476
|
*/
|
|
1525
|
-
play(
|
|
1526
|
-
path: string,
|
|
1527
|
-
cb?: (id: number) => void,
|
|
1528
|
-
volume?: number,
|
|
1529
|
-
loop?: boolean
|
|
1530
|
-
);
|
|
1477
|
+
play(path: string, cb?: (id: number) => void, volume?: number, loop?: boolean): Promise<number>;
|
|
1531
1478
|
/**
|
|
1532
1479
|
* 播放音效
|
|
1533
1480
|
* @param audio
|
|
@@ -1538,8 +1485,8 @@ declare namespace FW {
|
|
|
1538
1485
|
audio: cc.AudioClip,
|
|
1539
1486
|
cb?: (id: number) => void,
|
|
1540
1487
|
volume?: number,
|
|
1541
|
-
loop?: boolean
|
|
1542
|
-
)
|
|
1488
|
+
loop?: boolean,
|
|
1489
|
+
): Promise<number>;
|
|
1543
1490
|
/**
|
|
1544
1491
|
* 播放音效
|
|
1545
1492
|
* @param assetProperty
|
|
@@ -1550,8 +1497,8 @@ declare namespace FW {
|
|
|
1550
1497
|
assetProperty: AssetProperty,
|
|
1551
1498
|
cb?: (id: number) => void,
|
|
1552
1499
|
volume?: number,
|
|
1553
|
-
loop?: boolean
|
|
1554
|
-
)
|
|
1500
|
+
loop?: boolean,
|
|
1501
|
+
): Promise<number>;
|
|
1555
1502
|
/**
|
|
1556
1503
|
* 暂停所有
|
|
1557
1504
|
*/
|
|
@@ -1572,11 +1519,7 @@ declare namespace FW {
|
|
|
1572
1519
|
};
|
|
1573
1520
|
|
|
1574
1521
|
type PerformanceManager = {
|
|
1575
|
-
recordOperationMetric(
|
|
1576
|
-
manager: string,
|
|
1577
|
-
operation: string,
|
|
1578
|
-
duration: number
|
|
1579
|
-
): void;
|
|
1522
|
+
recordOperationMetric(manager: string, operation: string, duration: number): void;
|
|
1580
1523
|
getModuleReport(manager: string): PerformanceReport;
|
|
1581
1524
|
getAllReports(): Map<string, FW.PerformanceReport>;
|
|
1582
1525
|
};
|
|
@@ -1875,7 +1818,7 @@ declare namespace FW {
|
|
|
1875
1818
|
abort?: (reason?: any) => void;
|
|
1876
1819
|
addAbortEventListener?: (
|
|
1877
1820
|
listener: (this: AbortSignal, ev: Event) => any,
|
|
1878
|
-
options?: boolean | AddEventListenerOptions
|
|
1821
|
+
options?: boolean | AddEventListenerOptions,
|
|
1879
1822
|
) => void;
|
|
1880
1823
|
};
|
|
1881
1824
|
|
|
@@ -1883,7 +1826,7 @@ declare namespace FW {
|
|
|
1883
1826
|
resolve: (value: T | PromiseLike<T>) => void,
|
|
1884
1827
|
reject: (reason?: any) => void,
|
|
1885
1828
|
signal: AbortSignal,
|
|
1886
|
-
reason?: any
|
|
1829
|
+
reason?: any,
|
|
1887
1830
|
) => void;
|
|
1888
1831
|
|
|
1889
1832
|
type PromiseExecuteOptions = {
|
|
@@ -1894,10 +1837,7 @@ declare namespace FW {
|
|
|
1894
1837
|
retryCondition?: (error: any, retryCount: number) => boolean;
|
|
1895
1838
|
};
|
|
1896
1839
|
|
|
1897
|
-
type Promise = (
|
|
1898
|
-
resolve: (value: any) => void,
|
|
1899
|
-
reject: (reason?: any) => void
|
|
1900
|
-
) => void;
|
|
1840
|
+
type Promise = (resolve: (value: any) => void, reject: (reason?: any) => void) => void;
|
|
1901
1841
|
|
|
1902
1842
|
type PromiseResult<T = any> = {
|
|
1903
1843
|
success: PromiseProxy<T>[];
|
|
@@ -1905,7 +1845,7 @@ declare namespace FW {
|
|
|
1905
1845
|
cancelled: number[];
|
|
1906
1846
|
};
|
|
1907
1847
|
|
|
1908
|
-
type PromiseStatus =
|
|
1848
|
+
type PromiseStatus = 'pending' | 'fulfilled' | 'rejected' | 'cancelled';
|
|
1909
1849
|
|
|
1910
1850
|
/**
|
|
1911
1851
|
* 性能管理器配置
|
|
@@ -1953,7 +1893,7 @@ declare namespace FW {
|
|
|
1953
1893
|
type PropertyDecorator = (
|
|
1954
1894
|
$class: Record<string, any>,
|
|
1955
1895
|
$propertyKey: string | symbol,
|
|
1956
|
-
$descriptorOrInitializer?: any
|
|
1896
|
+
$descriptorOrInitializer?: any,
|
|
1957
1897
|
) => void;
|
|
1958
1898
|
|
|
1959
1899
|
declare function timeScale(scale: number);
|
|
@@ -2001,10 +1941,7 @@ declare namespace FW {
|
|
|
2001
1941
|
public config?: FW.AssetConfig;
|
|
2002
1942
|
public sender?: FW.Sender;
|
|
2003
1943
|
public handle?: FW.Handle;
|
|
2004
|
-
public invoke<T>(
|
|
2005
|
-
operation: Promise<T>,
|
|
2006
|
-
operationName: string = "unknown"
|
|
2007
|
-
): Promise<T>;
|
|
1944
|
+
public invoke<T>(operation: Promise<T>, operationName: string = 'unknown'): Promise<T>;
|
|
2008
1945
|
public getLogic<T extends FW.Logic = FWLogic>();
|
|
2009
1946
|
public getData<T extends FW.Data = FWData>();
|
|
2010
1947
|
public getSender<T extends FW.Sender>();
|
|
@@ -2062,10 +1999,10 @@ declare namespace FW {
|
|
|
2062
1999
|
}
|
|
2063
2000
|
|
|
2064
2001
|
export class FWTaskStatus {
|
|
2065
|
-
static IDLE =
|
|
2066
|
-
static RUNNING =
|
|
2067
|
-
static PAUSED =
|
|
2068
|
-
static COMPLETED =
|
|
2002
|
+
static IDLE = 'IDLE';
|
|
2003
|
+
static RUNNING = 'RUNNING';
|
|
2004
|
+
static PAUSED = 'PAUSED';
|
|
2005
|
+
static COMPLETED = 'COMPLETED';
|
|
2069
2006
|
}
|
|
2070
2007
|
|
|
2071
2008
|
export class FWPriorityOrder {
|
|
@@ -2109,17 +2046,17 @@ declare namespace FW {
|
|
|
2109
2046
|
* HTTP请求类型
|
|
2110
2047
|
*/
|
|
2111
2048
|
export class FWHttpRequestType {
|
|
2112
|
-
static GET =
|
|
2113
|
-
static POST =
|
|
2049
|
+
static GET = 'GET';
|
|
2050
|
+
static POST = 'POST';
|
|
2114
2051
|
}
|
|
2115
2052
|
|
|
2116
2053
|
/**
|
|
2117
2054
|
* 动画机类型
|
|
2118
2055
|
*/
|
|
2119
2056
|
export class FWAnimationMachineType {
|
|
2120
|
-
static TWEEN =
|
|
2121
|
-
static SKELETON =
|
|
2122
|
-
static ANIMATION =
|
|
2057
|
+
static TWEEN = 'TWEEN';
|
|
2058
|
+
static SKELETON = 'SKELETON';
|
|
2059
|
+
static ANIMATION = 'ANIMATION';
|
|
2123
2060
|
}
|
|
2124
2061
|
|
|
2125
2062
|
export class FWScrollViewTemplateType {
|
|
@@ -2140,23 +2077,23 @@ declare namespace FW {
|
|
|
2140
2077
|
}
|
|
2141
2078
|
|
|
2142
2079
|
export class FWLanguageAssetType {
|
|
2143
|
-
static LABEL =
|
|
2144
|
-
static SPRITE =
|
|
2145
|
-
static SKELETON =
|
|
2080
|
+
static LABEL = 'label';
|
|
2081
|
+
static SPRITE = 'sprite';
|
|
2082
|
+
static SKELETON = 'skeleton';
|
|
2146
2083
|
}
|
|
2147
2084
|
|
|
2148
2085
|
export class FWPromiseStatus {
|
|
2149
|
-
static PENDING =
|
|
2150
|
-
static FULFILLED =
|
|
2151
|
-
static REJECTED =
|
|
2152
|
-
static CANCELLED =
|
|
2086
|
+
static PENDING = 'pending';
|
|
2087
|
+
static FULFILLED = 'fulfilled';
|
|
2088
|
+
static REJECTED = 'rejected';
|
|
2089
|
+
static CANCELLED = 'cancelled';
|
|
2153
2090
|
}
|
|
2154
2091
|
|
|
2155
2092
|
export class FWLayerState {
|
|
2156
|
-
static CLOSED =
|
|
2157
|
-
static OPENING =
|
|
2158
|
-
static OPENED =
|
|
2159
|
-
static CLOSING =
|
|
2093
|
+
static CLOSED = 'closed';
|
|
2094
|
+
static OPENING = 'opening';
|
|
2095
|
+
static OPENED = 'opened';
|
|
2096
|
+
static CLOSING = 'closing';
|
|
2160
2097
|
}
|
|
2161
2098
|
|
|
2162
2099
|
export class FWAudioType {
|
|
@@ -2167,21 +2104,21 @@ declare namespace FW {
|
|
|
2167
2104
|
namespace EventDefine {
|
|
2168
2105
|
export class LanguageEvent {
|
|
2169
2106
|
/** 语言变更 */
|
|
2170
|
-
static LANGUAGE_CHANGE =
|
|
2107
|
+
static LANGUAGE_CHANGE = 'LANGUAGE_CHANGE';
|
|
2171
2108
|
}
|
|
2172
2109
|
|
|
2173
2110
|
export class TaskEvent {
|
|
2174
|
-
static START =
|
|
2175
|
-
static PROGRESS =
|
|
2176
|
-
static COMPLETE =
|
|
2177
|
-
static YIELDED =
|
|
2178
|
-
static PAUSE =
|
|
2179
|
-
static RESUME =
|
|
2180
|
-
static FRAME_START =
|
|
2181
|
-
static FRAME_END =
|
|
2182
|
-
static QUEUE =
|
|
2183
|
-
static ALL_COMPLETE =
|
|
2184
|
-
static ERROR =
|
|
2111
|
+
static START = 'START';
|
|
2112
|
+
static PROGRESS = 'PROGRESS';
|
|
2113
|
+
static COMPLETE = 'COMPLETE';
|
|
2114
|
+
static YIELDED = 'YIELDED';
|
|
2115
|
+
static PAUSE = 'PAUSE';
|
|
2116
|
+
static RESUME = 'RESUME';
|
|
2117
|
+
static FRAME_START = 'FRAME_START';
|
|
2118
|
+
static FRAME_END = 'FRAME_END';
|
|
2119
|
+
static QUEUE = 'QUEUE';
|
|
2120
|
+
static ALL_COMPLETE = 'ALL_COMPLETE';
|
|
2121
|
+
static ERROR = 'ERROR';
|
|
2185
2122
|
}
|
|
2186
2123
|
|
|
2187
2124
|
export class SystemEvent {
|
|
@@ -2189,8 +2126,8 @@ declare namespace FW {
|
|
|
2189
2126
|
}
|
|
2190
2127
|
|
|
2191
2128
|
export class CCEvent {
|
|
2192
|
-
static ON_SHOW =
|
|
2193
|
-
static ON_HIDE =
|
|
2129
|
+
static ON_SHOW = 'ON_SHOW';
|
|
2130
|
+
static ON_HIDE = 'ON_HIDE';
|
|
2194
2131
|
}
|
|
2195
2132
|
}
|
|
2196
2133
|
export const SystemDefine: SystemDefine;
|
|
@@ -2244,19 +2181,6 @@ declare namespace FW {
|
|
|
2244
2181
|
onDisable?();
|
|
2245
2182
|
onDestroy?();
|
|
2246
2183
|
onClose?();
|
|
2247
|
-
cc(
|
|
2248
|
-
target: cc.Node,
|
|
2249
|
-
cb: (event: cc.Event) => void,
|
|
2250
|
-
responseInterval?: number,
|
|
2251
|
-
eventName?: string
|
|
2252
|
-
): this;
|
|
2253
|
-
|
|
2254
|
-
fw(
|
|
2255
|
-
eventName: string,
|
|
2256
|
-
cb: (event: cc.Event) => void,
|
|
2257
|
-
target?: cc.Node,
|
|
2258
|
-
responseInterval?: number
|
|
2259
|
-
): this;
|
|
2260
2184
|
|
|
2261
2185
|
/**
|
|
2262
2186
|
* 查找节点
|
|
@@ -2277,7 +2201,7 @@ declare namespace FW {
|
|
|
2277
2201
|
referenceNode: cc.Node,
|
|
2278
2202
|
type?: {
|
|
2279
2203
|
prototype: T;
|
|
2280
|
-
}
|
|
2204
|
+
},
|
|
2281
2205
|
): T;
|
|
2282
2206
|
registerEvent(args: RegisterArgs): void;
|
|
2283
2207
|
unRegisterEvent(args: RegisterArgs);
|