@ives_xxz/framework 2.0.3 → 2.0.5

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.
@@ -1,4 +1,4 @@
1
- export function autoInitialize() {
1
+ export function initializeFramework() {
2
2
  const WD = window as any;
3
3
  const SD = require('./define/FWSystemDefine');
4
4
  const ED = require('./define/FWEventDefine');
package/entry/FWEntry.ts CHANGED
@@ -1,22 +1,21 @@
1
- import FWUiManager from '../manager/FWUiManager';
2
- import FWAnimationManager from '../manager/FWAnimationManager';
3
- import FWAudioManager from '../manager/FWAudioManager';
4
- import FWComponentManager from '../manager/FWComponentManager';
5
- import FWEventManager from '../manager/FWEventManager';
6
- import FWLanguageManager from '../manager/FWLanguageManager';
7
- import { FWLayerManager } from '../manager/FWLayerManager';
8
- import FWObjectManager from '../manager/FWObjectManager';
9
- import { FWResManager } from '../manager/FWResManager';
10
- import FWSocketManager from '../manager/FWSocketManager';
11
- import { FWStateManager } from '../manager/FWStateManager';
12
- import { FWTimeManager } from '../manager/FWTimeManager';
13
- import FWScene from '../scene/FWScene';
14
- import { FWSocketAutoProcessPause } from '../expand/FWDecorator';
15
- import FWTaskManager from '../manager/FWTaskManager';
16
- import FWEngineManager from '../manager/FWEngineManager';
17
- import FWHotUpdateManager from '../manager/FWHotUpdateManager';
18
- import FWPromiseManager from '../manager/FWPromiseManager';
19
- import { FWPerformanceManager } from '../manager/FWPerformanceManager';
1
+ import FWUiManager from "../manager/FWUiManager";
2
+ import FWAnimationManager from "../manager/FWAnimationManager";
3
+ import FWAudioManager from "../manager/FWAudioManager";
4
+ import FWComponentManager from "../manager/FWComponentManager";
5
+ import FWEventManager from "../manager/FWEventManager";
6
+ import FWLanguageManager from "../manager/FWLanguageManager";
7
+ import { FWLayerManager } from "../manager/FWLayerManager";
8
+ import FWObjectManager from "../manager/FWObjectManager";
9
+ import { FWResManager } from "../manager/FWResManager";
10
+ import FWSocketManager from "../manager/FWSocketManager";
11
+ import { FWStateManager } from "../manager/FWStateManager";
12
+ import { FWTimeManager } from "../manager/FWTimeManager";
13
+ import { FWSocketAutoProcessPause } from "../expand/FWDecorator";
14
+ import FWTaskManager from "../manager/FWTaskManager";
15
+ import FWEngineManager from "../manager/FWEngineManager";
16
+ import FWHotUpdateManager from "../manager/FWHotUpdateManager";
17
+ import FWPromiseManager from "../manager/FWPromiseManager";
18
+ import { FWPerformanceManager } from "../manager/FWPerformanceManager";
20
19
 
21
20
  /**
22
21
  * 入口脚本
@@ -94,7 +93,7 @@ export class FWEntry implements FW.Entry {
94
93
  /**
95
94
  * 当前Scene
96
95
  */
97
- scene: FWScene;
96
+ scene: FW.Scene;
98
97
  /**
99
98
  * bundle名字
100
99
  */
@@ -140,10 +139,10 @@ export class FWEntry implements FW.Entry {
140
139
  if (!this.hasSceneName(name)) {
141
140
  try {
142
141
  cc.director.loadScene(name);
143
- this.bundleName = '';
142
+ this.bundleName = "";
144
143
  return;
145
144
  } catch (e) {
146
- FW.Log.error('launchScene failed:', name);
145
+ FW.Log.error("launchScene failed:", name);
147
146
  }
148
147
  }
149
148
 
@@ -202,11 +201,13 @@ export class FWEntry implements FW.Entry {
202
201
  return this.map.get(this.bundleName)?.sceneName || undefined;
203
202
  }
204
203
 
205
- getComponent: <T>(serviceIdentifier: FW.ServiceIdentifier<T>) => T = (serviceIdentifier) =>
206
- FW.Framework.getComponent(serviceIdentifier);
204
+ getComponent: <T>(serviceIdentifier: FW.ServiceIdentifier<T>) => T = (
205
+ serviceIdentifier
206
+ ) => FW.Framework.getComponent(serviceIdentifier);
207
207
 
208
- getComponents: <T>(serviceIdentifier?: FW.ServiceIdentifier<T>) => T[] = (serviceIdentifier) =>
209
- FW.Framework.getComponents(serviceIdentifier);
208
+ getComponents: <T>(serviceIdentifier?: FW.ServiceIdentifier<T>) => T[] = (
209
+ serviceIdentifier
210
+ ) => FW.Framework.getComponents(serviceIdentifier);
210
211
 
211
212
  update(dt: number) {
212
213
  this.timeMgr?.onUpdate(dt);
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@ives_xxz/framework",
3
- "version": "2.0.3",
3
+ "version": "2.0.5",
4
4
  "description": "cocoscreator 2.x mvc framework",
5
5
  "main": "index.js",
6
- "keywords": ["123456"],
6
+ "keywords": [
7
+ "123456"
8
+ ],
7
9
  "author": "ives",
8
10
  "license": "ISC"
9
11
  }
package/types/FW.d.ts CHANGED
@@ -8,13 +8,18 @@ declare namespace FW {
8
8
  prototype: T;
9
9
  };
10
10
 
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>;
11
+ type ServiceIdentifierData<TInstance = unknown> =
12
+ | string
13
+ | symbol
14
+ | Newable<TInstance>
15
+ | Function;
16
+
17
+ type CommonNewable<
18
+ TInstance = unknown,
19
+ TArgs extends unknown[] = any[]
20
+ > = Newable<TInstance, TArgs>;
21
+ type CommonServiceIdentifier<TInstance = unknown> =
22
+ ServiceIdentifierData<TInstance>;
18
23
 
19
24
  type ServiceIdentifier<T = unknown> = CommonServiceIdentifier<T>;
20
25
  /**
@@ -60,13 +65,13 @@ declare namespace FW {
60
65
  resolve: (value: T | PromiseLike<T>) => void,
61
66
  reject: (reason?: any) => void,
62
67
  signal?: AbortSignal,
63
- reason?: any,
68
+ reason?: any
64
69
  ) => void = PromiseExcutor,
65
- options: PromiseExecuteOptions = {},
70
+ options: PromiseExecuteOptions = {}
66
71
  ): PromiseProxy<T>;
67
72
  all<T = any>(
68
73
  promises: FW.PromiseProxy<T>[],
69
- options: FW.PromiseExecuteOptions = {},
74
+ options: FW.PromiseExecuteOptions = {}
70
75
  ): FW.PromiseProxy<FW.PromiseResult<T>>;
71
76
  };
72
77
 
@@ -74,18 +79,22 @@ declare namespace FW {
74
79
  registerLanguagePackageEnum(
75
80
  bundleName: string,
76
81
  language: any,
77
- getter: (key: string, language?: string) => string,
82
+ getter: (key: string, language?: string) => string
78
83
  ): void;
79
84
  getSupportedLanguages(): string[];
80
85
  setSupportedLanguages(languages: string[]): void;
81
86
  getBundles(): string[];
82
87
  getLanguage(): string;
83
88
  getLanguageIndex(): number;
84
- getLanguagePackageValue(bundleName: string, key: string, language?: string): string;
89
+ getLanguagePackageValue(
90
+ bundleName: string,
91
+ key: string,
92
+ language?: string
93
+ ): string;
85
94
  getLanguagePackageEnumKeys(bundleName: string): string[];
86
95
  getLanguagePackageEnumValues(bundleName: string): string[];
87
96
  getLanguagePackageEnum<K extends keyof ILanguageBundleAccessor>(
88
- bundleName: K,
97
+ bundleName: K
89
98
  ): ILanguageBundleAccessor[K];
90
99
  initializeLanguage(language: string);
91
100
  };
@@ -103,32 +112,32 @@ declare namespace FW {
103
112
  createObjectPool<T extends FWObject = FWObject>(
104
113
  node: cc.Node,
105
114
  parent: cc.Node,
106
- tag?: string,
115
+ tag?: string
107
116
  ): Promise<ObjectPool<T>>;
108
117
  createObjectPool<T extends FWObject = FWObject>(
109
118
  prefab: cc.Prefab,
110
119
  parent: cc.Node,
111
- tag?: string,
120
+ tag?: string
112
121
  ): Promise<ObjectPool<T>>;
113
122
  createObjectPool<T extends FWObject = FWObject>(
114
123
  assetProperty: FW.AssetProperty,
115
124
  parent: cc.Node,
116
- tag?: string,
125
+ tag?: string
117
126
  ): Promise<ObjectPool<T>>;
118
127
  createObjectPool<T extends FWObject = FWObject>(
119
128
  node: cc.Node,
120
129
  parent: cc.Node,
121
- type?: number,
130
+ type?: number
122
131
  ): Promise<ObjectPool<T>>;
123
132
  createObjectPool<T extends FWObject = FWObject>(
124
133
  prefab: cc.Prefab,
125
134
  parent: cc.Node,
126
- type?: number,
135
+ type?: number
127
136
  ): Promise<ObjectPool<T>>;
128
137
  createObjectPool<T extends FWObject = FWObject>(
129
138
  assetProperty: FW.AssetProperty,
130
139
  parent: cc.Node,
131
- type?: number,
140
+ type?: number
132
141
  ): Promise<ObjectPool<T>>;
133
142
  /** 获取已经创建的对象池 */
134
143
  getObjectPool(tag: string): ObjectPool;
@@ -161,7 +170,7 @@ declare namespace FW {
161
170
  address: string,
162
171
  sender: Sender,
163
172
  handle: Handle,
164
- config: SocketConfig,
173
+ config: SocketConfig
165
174
  ): Promise<Socket>;
166
175
  /**
167
176
  * 获取socket
@@ -257,7 +266,7 @@ declare namespace FW {
257
266
  tag: string,
258
267
  sender: Sender,
259
268
  handle: SocketHandle,
260
- config: SocketConfig,
269
+ config: SocketConfig
261
270
  ): SocketPromiseProxy;
262
271
  };
263
272
 
@@ -292,7 +301,7 @@ declare namespace FW {
292
301
  args7?: FW.EventManagerArgs,
293
302
  args8?: FW.EventManagerArgs,
294
303
  args9?: FW.EventManagerArgs,
295
- args10?: FW.EventManagerArgs,
304
+ args10?: FW.EventManagerArgs
296
305
  );
297
306
  /**
298
307
  * 比较目标
@@ -353,19 +362,35 @@ declare namespace FW {
353
362
  /**
354
363
  * 一次性调度器
355
364
  */
356
- scheduleOnce(cb?: () => void, time?: number, tag?: string): FW.TimerSchedule;
365
+ scheduleOnce(
366
+ cb?: () => void,
367
+ time?: number,
368
+ tag?: string
369
+ ): FW.TimerSchedule;
357
370
  /**
358
371
  * 一次性调度器
359
372
  */
360
- scheduleOnce(time?: number, cb?: () => void, tag?: string): FW.TimerSchedule;
373
+ scheduleOnce(
374
+ time?: number,
375
+ cb?: () => void,
376
+ tag?: string
377
+ ): FW.TimerSchedule;
361
378
  /**
362
379
  * 一次性调度器
363
380
  */
364
- scheduleOnce(time?: number, cb?: () => void, target?: any): FW.TimerSchedule;
381
+ scheduleOnce(
382
+ time?: number,
383
+ cb?: () => void,
384
+ target?: any
385
+ ): FW.TimerSchedule;
365
386
  /**
366
387
  * 一次性调度器
367
388
  */
368
- scheduleOnce(cb?: () => void, time?: number, target?: any): FW.TimerSchedule;
389
+ scheduleOnce(
390
+ cb?: () => void,
391
+ time?: number,
392
+ target?: any
393
+ ): FW.TimerSchedule;
369
394
  /**
370
395
  * 自定义调度器
371
396
  * */
@@ -374,7 +399,7 @@ declare namespace FW {
374
399
  time?: number,
375
400
  repeat?: number,
376
401
  target?: TargetType,
377
- tag?: string,
402
+ tag?: string
378
403
  ): TimerSchedule;
379
404
  /** 暂停调度器 */
380
405
  pauseSchedule(tag: string): void;
@@ -425,13 +450,13 @@ declare namespace FW {
425
450
  args7?: EventManagerArgs,
426
451
  args8?: EventManagerArgs,
427
452
  args9?: EventManagerArgs,
428
- args10?: EventManagerArgs,
453
+ args10?: EventManagerArgs
429
454
  ) => void,
430
455
  target: TargetType,
431
456
  options?: {
432
457
  priority?: FW.SystemDefine.FWPriorityOrder;
433
458
  intercept?: boolean;
434
- },
459
+ }
435
460
  );
436
461
 
437
462
  registerOnce(
@@ -446,13 +471,13 @@ declare namespace FW {
446
471
  args7?: EventManagerArgs,
447
472
  args8?: EventManagerArgs,
448
473
  args9?: EventManagerArgs,
449
- args10?: EventManagerArgs,
474
+ args10?: EventManagerArgs
450
475
  ) => void,
451
476
  target: TargetType,
452
477
  options?: {
453
478
  priority?: number;
454
479
  intercept?: boolean;
455
- },
480
+ }
456
481
  ): void;
457
482
 
458
483
  /**
@@ -486,7 +511,7 @@ declare namespace FW {
486
511
  args7?: FW.EventManagerArgs,
487
512
  args8?: FW.EventManagerArgs,
488
513
  args9?: FW.EventManagerArgs,
489
- args10?: FW.EventManagerArgs,
514
+ args10?: FW.EventManagerArgs
490
515
  ): void;
491
516
  /**
492
517
  * 注销事件
@@ -632,29 +657,37 @@ declare namespace FW {
632
657
  * @param data
633
658
  */
634
659
  openAsync<Ctr extends FW.LayerController = FWLayerController>(
635
- data: LayerOpenArgs<Ctr>,
660
+ data: LayerOpenArgs<Ctr>
636
661
  ): Promise<Ctr>;
637
662
 
638
663
  /**
639
664
  * 同步打开layer
640
665
  * @param data
641
666
  */
642
- openSync<Ctr extends FW.LayerController = FWLayerController>(data: LayerOpenArgs<Ctr>): Ctr;
667
+ openSync<Ctr extends FW.LayerController = FWLayerController>(
668
+ data: LayerOpenArgs<Ctr>
669
+ ): Ctr;
643
670
  /**
644
671
  * 显示常驻layer
645
672
  * @param layer
646
673
  */
647
- displayLayer<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): Ctr;
674
+ displayLayer<Ctr extends FW.LayerController = FWLayerController>(
675
+ ctr: Ctr
676
+ ): Ctr;
648
677
  /**
649
678
  * 隐藏常驻layer
650
679
  * @param layer
651
680
  */
652
- hideLayer<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): Ctr;
681
+ hideLayer<Ctr extends FW.LayerController = FWLayerController>(
682
+ ctr: Ctr
683
+ ): Ctr;
653
684
  /**
654
685
  * 关闭layer
655
686
  * @param layer
656
687
  */
657
- close<Ctr extends FW.LayerController = FWLayerController>(ctr: Ctr): FWLayerController;
688
+ close<Ctr extends FW.LayerController = FWLayerController>(
689
+ ctr: Ctr
690
+ ): FWLayerController;
658
691
 
659
692
  /**
660
693
  * 从栈关闭
@@ -760,7 +793,10 @@ declare namespace FW {
760
793
  * @param url
761
794
  * @param cb
762
795
  */
763
- loadRemote<T extends cc.Asset = cc.Asset>(url: string, cb?: (asset: cc.Asset) => T): Promise<T>;
796
+ loadRemote<T extends cc.Asset = cc.Asset>(
797
+ url: string,
798
+ cb?: (asset: cc.Asset) => T
799
+ ): Promise<T>;
764
800
  /**
765
801
  * 从远程加载spine动画
766
802
  * @param data
@@ -776,13 +812,18 @@ declare namespace FW {
776
812
  * 加载资源返回数据
777
813
  * @param assetProperty
778
814
  */
779
- loadAssetData<T extends cc.Asset>(assetProperty: AssetProperty): Promise<AssetData>;
815
+ loadAssetData<T extends cc.Asset>(
816
+ assetProperty: AssetProperty
817
+ ): Promise<AssetData>;
780
818
 
781
819
  /**
782
820
  * 加载资源
783
821
  * @param assetProperty
784
822
  */
785
- loadAsset<T extends cc.Asset>(assetProperty: AssetProperty, cb?: () => void): Promise<T>;
823
+ loadAsset<T extends cc.Asset>(
824
+ assetProperty: AssetProperty,
825
+ cb?: () => void
826
+ ): Promise<T>;
786
827
 
787
828
  /**
788
829
  * 获取资源
@@ -930,7 +971,10 @@ declare namespace FW {
930
971
  * @param url
931
972
  * @param cb
932
973
  */
933
- loadRemote<T extends cc.Asset = cc.Asset>(url: string, cb?: (asset: cc.Asset) => T): Promise<T>;
974
+ loadRemote<T extends cc.Asset = cc.Asset>(
975
+ url: string,
976
+ cb?: (asset: cc.Asset) => T
977
+ ): Promise<T>;
934
978
  /**
935
979
  * 从远程加载spine动画
936
980
  * @param data
@@ -1133,7 +1177,7 @@ declare namespace FW {
1133
1177
  */
1134
1178
  register(
1135
1179
  state: FW.StateMachineRegisterArgs | FW.StateMachineRegisterArgs[],
1136
- stateMachineName?: string,
1180
+ stateMachineName?: string
1137
1181
  );
1138
1182
  /**
1139
1183
  * 注销指定状态机的某个状态
@@ -1189,22 +1233,22 @@ declare namespace FW {
1189
1233
  progress: Function;
1190
1234
  easing: Function | String;
1191
1235
  onUpdate: Function;
1192
- }>,
1236
+ }>
1193
1237
  >(
1194
1238
  duration: number,
1195
1239
  props: ConstructorType<T>,
1196
- opts?: OPTS,
1240
+ opts?: OPTS
1197
1241
  ): FW.Tween;
1198
1242
  by<
1199
1243
  OPTS extends Partial<{
1200
1244
  progress: Function;
1201
1245
  easing: Function | String;
1202
1246
  onUpdate: Function;
1203
- }>,
1247
+ }>
1204
1248
  >(
1205
1249
  duration: number,
1206
1250
  props: ConstructorType<T>,
1207
- opts?: OPTS,
1251
+ opts?: OPTS
1208
1252
  ): FW.Tween;
1209
1253
  set(props: ConstructorType<T>): FW.Tween;
1210
1254
  };
@@ -1444,7 +1488,11 @@ declare namespace FW {
1444
1488
  * @param volume
1445
1489
  * @param loop
1446
1490
  */
1447
- playMusic(assetProperty: AssetProperty, volume?: number, loop?: boolean): void;
1491
+ playMusic(
1492
+ assetProperty: AssetProperty,
1493
+ volume?: number,
1494
+ loop?: boolean
1495
+ ): void;
1448
1496
  /**
1449
1497
  * 停止背景音乐
1450
1498
  */
@@ -1473,21 +1521,36 @@ declare namespace FW {
1473
1521
  * @param volume
1474
1522
  * @param loop
1475
1523
  */
1476
- play(path: string, cb?: (id: number) => void, volume?: number, loop?: boolean);
1524
+ play(
1525
+ path: string,
1526
+ cb?: (id: number) => void,
1527
+ volume?: number,
1528
+ loop?: boolean
1529
+ );
1477
1530
  /**
1478
1531
  * 播放音效
1479
1532
  * @param audio
1480
1533
  * @param volume
1481
1534
  * @param loop
1482
1535
  */
1483
- play(audio: cc.AudioClip, cb?: (id: number) => void, volume?: number, loop?: boolean);
1536
+ play(
1537
+ audio: cc.AudioClip,
1538
+ cb?: (id: number) => void,
1539
+ volume?: number,
1540
+ loop?: boolean
1541
+ );
1484
1542
  /**
1485
1543
  * 播放音效
1486
1544
  * @param assetProperty
1487
1545
  * @param volume
1488
1546
  * @param loop
1489
1547
  */
1490
- play(assetProperty: AssetProperty, cb?: (id: number) => void, volume?: number, loop?: boolean);
1548
+ play(
1549
+ assetProperty: AssetProperty,
1550
+ cb?: (id: number) => void,
1551
+ volume?: number,
1552
+ loop?: boolean
1553
+ );
1491
1554
  /**
1492
1555
  * 暂停所有
1493
1556
  */
@@ -1508,7 +1571,11 @@ declare namespace FW {
1508
1571
  };
1509
1572
 
1510
1573
  type PerformanceManager = {
1511
- recordOperationMetric(manager: string, operation: string, duration: number): void;
1574
+ recordOperationMetric(
1575
+ manager: string,
1576
+ operation: string,
1577
+ duration: number
1578
+ ): void;
1512
1579
  getModuleReport(manager: string): PerformanceReport;
1513
1580
  getAllReports(): Map<string, FW.PerformanceReport>;
1514
1581
  };
@@ -1807,7 +1874,7 @@ declare namespace FW {
1807
1874
  abort?: (reason?: any) => void;
1808
1875
  addAbortEventListener?: (
1809
1876
  listener: (this: AbortSignal, ev: Event) => any,
1810
- options?: boolean | AddEventListenerOptions,
1877
+ options?: boolean | AddEventListenerOptions
1811
1878
  ) => void;
1812
1879
  };
1813
1880
 
@@ -1815,7 +1882,7 @@ declare namespace FW {
1815
1882
  resolve: (value: T | PromiseLike<T>) => void,
1816
1883
  reject: (reason?: any) => void,
1817
1884
  signal: AbortSignal,
1818
- reason?: any,
1885
+ reason?: any
1819
1886
  ) => void;
1820
1887
 
1821
1888
  type PromiseExecuteOptions = {
@@ -1826,7 +1893,10 @@ declare namespace FW {
1826
1893
  retryCondition?: (error: any, retryCount: number) => boolean;
1827
1894
  };
1828
1895
 
1829
- type Promise = (resolve: (value: any) => void, reject: (reason?: any) => void) => void;
1896
+ type Promise = (
1897
+ resolve: (value: any) => void,
1898
+ reject: (reason?: any) => void
1899
+ ) => void;
1830
1900
 
1831
1901
  type PromiseResult<T = any> = {
1832
1902
  success: PromiseProxy<T>[];
@@ -1834,7 +1904,7 @@ declare namespace FW {
1834
1904
  cancelled: number[];
1835
1905
  };
1836
1906
 
1837
- type PromiseStatus = 'pending' | 'fulfilled' | 'rejected' | 'cancelled';
1907
+ type PromiseStatus = "pending" | "fulfilled" | "rejected" | "cancelled";
1838
1908
 
1839
1909
  /**
1840
1910
  * 性能管理器配置
@@ -1882,7 +1952,7 @@ declare namespace FW {
1882
1952
  type PropertyDecorator = (
1883
1953
  $class: Record<string, any>,
1884
1954
  $propertyKey: string | symbol,
1885
- $descriptorOrInitializer?: any,
1955
+ $descriptorOrInitializer?: any
1886
1956
  ) => void;
1887
1957
 
1888
1958
  declare function timeScale(scale: number);
@@ -1930,7 +2000,10 @@ declare namespace FW {
1930
2000
  public config?: FW.AssetConfig;
1931
2001
  public sender?: FW.Sender;
1932
2002
  public handle?: FW.Handle;
1933
- public invoke<T>(operation: Promise<T>, operationName: string = 'unknown'): Promise<T>;
2003
+ public invoke<T>(
2004
+ operation: Promise<T>,
2005
+ operationName: string = "unknown"
2006
+ ): Promise<T>;
1934
2007
  public getLogic<T extends FW.Logic = FWLogic>();
1935
2008
  public getData<T extends FW.Data = FWData>();
1936
2009
  public getSender<T extends FW.Sender>();
@@ -1988,10 +2061,10 @@ declare namespace FW {
1988
2061
  }
1989
2062
 
1990
2063
  export class FWTaskStatus {
1991
- static IDLE = 'IDLE';
1992
- static RUNNING = 'RUNNING';
1993
- static PAUSED = 'PAUSED';
1994
- static COMPLETED = 'COMPLETED';
2064
+ static IDLE = "IDLE";
2065
+ static RUNNING = "RUNNING";
2066
+ static PAUSED = "PAUSED";
2067
+ static COMPLETED = "COMPLETED";
1995
2068
  }
1996
2069
 
1997
2070
  export class FWPriorityOrder {
@@ -2035,17 +2108,17 @@ declare namespace FW {
2035
2108
  * HTTP请求类型
2036
2109
  */
2037
2110
  export class FWHttpRequestType {
2038
- static GET = 'GET';
2039
- static POST = 'POST';
2111
+ static GET = "GET";
2112
+ static POST = "POST";
2040
2113
  }
2041
2114
 
2042
2115
  /**
2043
2116
  * 动画机类型
2044
2117
  */
2045
2118
  export class FWAnimationMachineType {
2046
- static TWEEN = 'TWEEN';
2047
- static SKELETON = 'SKELETON';
2048
- static ANIMATION = 'ANIMATION';
2119
+ static TWEEN = "TWEEN";
2120
+ static SKELETON = "SKELETON";
2121
+ static ANIMATION = "ANIMATION";
2049
2122
  }
2050
2123
 
2051
2124
  export class FWScrollViewTemplateType {
@@ -2066,23 +2139,23 @@ declare namespace FW {
2066
2139
  }
2067
2140
 
2068
2141
  export class FWLanguageAssetType {
2069
- static LABEL = 'label';
2070
- static SPRITE = 'sprite';
2071
- static SKELETON = 'skeleton';
2142
+ static LABEL = "label";
2143
+ static SPRITE = "sprite";
2144
+ static SKELETON = "skeleton";
2072
2145
  }
2073
2146
 
2074
2147
  export class FWPromiseStatus {
2075
- static PENDING = 'pending';
2076
- static FULFILLED = 'fulfilled';
2077
- static REJECTED = 'rejected';
2078
- static CANCELLED = 'cancelled';
2148
+ static PENDING = "pending";
2149
+ static FULFILLED = "fulfilled";
2150
+ static REJECTED = "rejected";
2151
+ static CANCELLED = "cancelled";
2079
2152
  }
2080
2153
 
2081
2154
  export class FWLayerState {
2082
- static CLOSED = 'closed';
2083
- static OPENING = 'opening';
2084
- static OPENED = 'opened';
2085
- static CLOSING = 'closing';
2155
+ static CLOSED = "closed";
2156
+ static OPENING = "opening";
2157
+ static OPENED = "opened";
2158
+ static CLOSING = "closing";
2086
2159
  }
2087
2160
 
2088
2161
  export class FWAudioType {
@@ -2093,21 +2166,21 @@ declare namespace FW {
2093
2166
  namespace EventDefine {
2094
2167
  export class LanguageEvent {
2095
2168
  /** 语言变更 */
2096
- static LANGUAGE_CHANGE = 'LANGUAGE_CHANGE';
2169
+ static LANGUAGE_CHANGE = "LANGUAGE_CHANGE";
2097
2170
  }
2098
2171
 
2099
2172
  export class TaskEvent {
2100
- static START = 'START';
2101
- static PROGRESS = 'PROGRESS';
2102
- static COMPLETE = 'COMPLETE';
2103
- static YIELDED = 'YIELDED';
2104
- static PAUSE = 'PAUSE';
2105
- static RESUME = 'RESUME';
2106
- static FRAME_START = 'FRAME_START';
2107
- static FRAME_END = 'FRAME_END';
2108
- static QUEUE = 'QUEUE';
2109
- static ALL_COMPLETE = 'ALL_COMPLETE';
2110
- static ERROR = 'ERROR';
2173
+ static START = "START";
2174
+ static PROGRESS = "PROGRESS";
2175
+ static COMPLETE = "COMPLETE";
2176
+ static YIELDED = "YIELDED";
2177
+ static PAUSE = "PAUSE";
2178
+ static RESUME = "RESUME";
2179
+ static FRAME_START = "FRAME_START";
2180
+ static FRAME_END = "FRAME_END";
2181
+ static QUEUE = "QUEUE";
2182
+ static ALL_COMPLETE = "ALL_COMPLETE";
2183
+ static ERROR = "ERROR";
2111
2184
  }
2112
2185
 
2113
2186
  export class SystemEvent {
@@ -2115,8 +2188,8 @@ declare namespace FW {
2115
2188
  }
2116
2189
 
2117
2190
  export class CCEvent {
2118
- static ON_SHOW = 'ON_SHOW';
2119
- static ON_HIDE = 'ON_HIDE';
2191
+ static ON_SHOW = "ON_SHOW";
2192
+ static ON_HIDE = "ON_HIDE";
2120
2193
  }
2121
2194
  }
2122
2195
  export const SystemDefine: SystemDefine;
@@ -2170,6 +2243,19 @@ declare namespace FW {
2170
2243
  onDisable?();
2171
2244
  onDestroy?();
2172
2245
  onClose?();
2246
+ cc(
2247
+ target: cc.Node,
2248
+ cb: (event: cc.Event) => void,
2249
+ responseInterval?: number,
2250
+ eventName?: string
2251
+ ): this;
2252
+
2253
+ fw(
2254
+ eventName: string,
2255
+ cb: (event: cc.Event) => void,
2256
+ target?: cc.Node,
2257
+ responseInterval?: number
2258
+ ): this;
2173
2259
 
2174
2260
  /**
2175
2261
  * 查找节点
@@ -2190,7 +2276,7 @@ declare namespace FW {
2190
2276
  referenceNode: cc.Node,
2191
2277
  type?: {
2192
2278
  prototype: T;
2193
- },
2279
+ }
2194
2280
  ): T;
2195
2281
  registerEvent(args: RegisterArgs): void;
2196
2282
  unRegisterEvent(args: RegisterArgs);