@ives_xxz/framework 2.1.4 → 2.1.6
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/package.json +1 -1
- package/types/FW.d.ts +98 -90
- package/types/Global.d.ts +2 -2
package/package.json
CHANGED
package/types/FW.d.ts
CHANGED
|
@@ -467,24 +467,24 @@ declare namespace FW {
|
|
|
467
467
|
/**
|
|
468
468
|
* Socket配置
|
|
469
469
|
*/
|
|
470
|
-
type SocketConfig = {
|
|
470
|
+
type SocketConfig = Partial<{
|
|
471
471
|
/** 心跳间隔 */
|
|
472
|
-
heartInternal
|
|
472
|
+
heartInternal: number;
|
|
473
473
|
/** 心跳超时时间 */
|
|
474
|
-
heartTimeout
|
|
474
|
+
heartTimeout: number;
|
|
475
475
|
/** 心跳弱网时间 */
|
|
476
|
-
heartWeakTime
|
|
476
|
+
heartWeakTime: number;
|
|
477
477
|
/** 最大重连次数 */
|
|
478
|
-
maxReconnectTimes
|
|
478
|
+
maxReconnectTimes: number;
|
|
479
479
|
/** 重连间隔 */
|
|
480
|
-
reconnectInternal
|
|
480
|
+
reconnectInternal: number;
|
|
481
481
|
/** 协议符号 */
|
|
482
|
-
protocolSymbol
|
|
482
|
+
protocolSymbol: Symbol;
|
|
483
483
|
/** 协议轮询时间 */
|
|
484
|
-
protocolPollingTime
|
|
484
|
+
protocolPollingTime: number;
|
|
485
485
|
/** 证书(可选) */
|
|
486
|
-
certificate
|
|
487
|
-
}
|
|
486
|
+
certificate: cc.Asset;
|
|
487
|
+
}>;
|
|
488
488
|
|
|
489
489
|
/**
|
|
490
490
|
* 观察者
|
|
@@ -1233,15 +1233,15 @@ declare namespace FW {
|
|
|
1233
1233
|
retryHandle: () => void;
|
|
1234
1234
|
};
|
|
1235
1235
|
|
|
1236
|
-
type HotUpdatingParam = {
|
|
1237
|
-
downloadedFiles
|
|
1238
|
-
totalFiles
|
|
1239
|
-
downloadedBytes
|
|
1240
|
-
totalBytes
|
|
1241
|
-
percent
|
|
1242
|
-
convertDownloadedBytes
|
|
1243
|
-
convertTotalBytes
|
|
1244
|
-
}
|
|
1236
|
+
type HotUpdatingParam = Partial<{
|
|
1237
|
+
downloadedFiles: number;
|
|
1238
|
+
totalFiles: number;
|
|
1239
|
+
downloadedBytes: number;
|
|
1240
|
+
totalBytes: number;
|
|
1241
|
+
percent: number;
|
|
1242
|
+
convertDownloadedBytes: string;
|
|
1243
|
+
convertTotalBytes: string;
|
|
1244
|
+
}>;
|
|
1245
1245
|
|
|
1246
1246
|
type AssetManager = {
|
|
1247
1247
|
initialize();
|
|
@@ -1302,30 +1302,32 @@ declare namespace FW {
|
|
|
1302
1302
|
};
|
|
1303
1303
|
|
|
1304
1304
|
type CCEvent = {
|
|
1305
|
-
eventName?: string;
|
|
1306
1305
|
cb: (...args: any) => void;
|
|
1307
1306
|
target: TargetType;
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1307
|
+
} & Partial<{
|
|
1308
|
+
eventName: string;
|
|
1309
|
+
responseInterval: number;
|
|
1310
|
+
pause: boolean;
|
|
1311
|
+
enable: boolean;
|
|
1312
|
+
responseTime: number;
|
|
1313
|
+
lastResponseTimestamp: number;
|
|
1314
|
+
data: any;
|
|
1315
|
+
}>;
|
|
1315
1316
|
|
|
1316
1317
|
type FWEvent = {
|
|
1317
|
-
eventName?: string;
|
|
1318
1318
|
cb: (...args: any) => void;
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1319
|
+
} & Partial<{
|
|
1320
|
+
eventName: string;
|
|
1321
|
+
responseTime: number;
|
|
1322
|
+
responseInterval: number;
|
|
1323
|
+
lastResponseTimestamp: number;
|
|
1324
|
+
options: {
|
|
1323
1325
|
priority?: number;
|
|
1324
1326
|
intercept?: boolean;
|
|
1325
1327
|
pause?: boolean;
|
|
1326
1328
|
enable?: boolean;
|
|
1327
1329
|
};
|
|
1328
|
-
}
|
|
1330
|
+
}>;
|
|
1329
1331
|
|
|
1330
1332
|
type RegisterArgs = {
|
|
1331
1333
|
target?: any;
|
|
@@ -1333,7 +1335,7 @@ declare namespace FW {
|
|
|
1333
1335
|
FWEvent?: FWEvent[];
|
|
1334
1336
|
};
|
|
1335
1337
|
|
|
1336
|
-
type RegisterEventArgs = {
|
|
1338
|
+
type RegisterEventArgs = Partial<{
|
|
1337
1339
|
/** 事件名字 */
|
|
1338
1340
|
eventName?: string;
|
|
1339
1341
|
/**
|
|
@@ -1364,7 +1366,7 @@ declare namespace FW {
|
|
|
1364
1366
|
* 是否启用
|
|
1365
1367
|
*/
|
|
1366
1368
|
enable?: boolean;
|
|
1367
|
-
}
|
|
1369
|
+
}>;
|
|
1368
1370
|
|
|
1369
1371
|
/**
|
|
1370
1372
|
* 时间调度器
|
|
@@ -1683,21 +1685,21 @@ declare namespace FW {
|
|
|
1683
1685
|
/**
|
|
1684
1686
|
* spine动画参数
|
|
1685
1687
|
*/
|
|
1686
|
-
type SkeletonArgs = {
|
|
1687
|
-
loop
|
|
1688
|
-
timeScale
|
|
1689
|
-
progress
|
|
1690
|
-
cb
|
|
1691
|
-
}
|
|
1688
|
+
type SkeletonArgs = Partial<{
|
|
1689
|
+
loop: boolean;
|
|
1690
|
+
timeScale: number;
|
|
1691
|
+
progress: number;
|
|
1692
|
+
cb: () => void;
|
|
1693
|
+
}>;
|
|
1692
1694
|
/**
|
|
1693
1695
|
* tween动画参数
|
|
1694
1696
|
*/
|
|
1695
|
-
type TweenArgs = {
|
|
1696
|
-
id
|
|
1697
|
-
tag
|
|
1698
|
-
target
|
|
1699
|
-
timeScale
|
|
1700
|
-
}
|
|
1697
|
+
type TweenArgs = Partial<{
|
|
1698
|
+
id: number;
|
|
1699
|
+
tag: string;
|
|
1700
|
+
target: Component | Node;
|
|
1701
|
+
timeScale: number;
|
|
1702
|
+
}>;
|
|
1701
1703
|
|
|
1702
1704
|
/**
|
|
1703
1705
|
* 时间对象
|
|
@@ -1724,25 +1726,26 @@ declare namespace FW {
|
|
|
1724
1726
|
* 目标对象
|
|
1725
1727
|
*/
|
|
1726
1728
|
target: TargetType;
|
|
1729
|
+
|
|
1727
1730
|
/**
|
|
1728
|
-
*
|
|
1731
|
+
* 执行时间
|
|
1729
1732
|
*/
|
|
1730
|
-
|
|
1733
|
+
executeTime: number;
|
|
1734
|
+
} & Partial<{
|
|
1731
1735
|
/**
|
|
1732
|
-
*
|
|
1736
|
+
* 执行间隔
|
|
1733
1737
|
*/
|
|
1734
|
-
|
|
1735
|
-
|
|
1738
|
+
internal: number;
|
|
1736
1739
|
/**
|
|
1737
|
-
*
|
|
1740
|
+
* 标签
|
|
1738
1741
|
*/
|
|
1739
|
-
|
|
1742
|
+
tag: string;
|
|
1740
1743
|
/**
|
|
1741
1744
|
* 回调函数
|
|
1742
1745
|
* @returns
|
|
1743
1746
|
*/
|
|
1744
|
-
cb
|
|
1745
|
-
}
|
|
1747
|
+
cb: () => void;
|
|
1748
|
+
}>;
|
|
1746
1749
|
|
|
1747
1750
|
type RegisterInitialize = {
|
|
1748
1751
|
initialize();
|
|
@@ -1756,11 +1759,14 @@ declare namespace FW {
|
|
|
1756
1759
|
autoRelease?: boolean;
|
|
1757
1760
|
};
|
|
1758
1761
|
|
|
1759
|
-
type
|
|
1762
|
+
type RegisterFrameworkBundle = {
|
|
1760
1763
|
/**
|
|
1761
1764
|
* bundle名字
|
|
1762
1765
|
*/
|
|
1763
1766
|
bundleName: string;
|
|
1767
|
+
};
|
|
1768
|
+
|
|
1769
|
+
type RegisterFrameworkComponent = {
|
|
1764
1770
|
/**
|
|
1765
1771
|
* 逻辑
|
|
1766
1772
|
*/
|
|
@@ -1783,6 +1789,8 @@ declare namespace FW {
|
|
|
1783
1789
|
handle?: Newable<SocketHandle>;
|
|
1784
1790
|
};
|
|
1785
1791
|
|
|
1792
|
+
type RegisterFramework = RegisterFrameworkBundle & RegisterFrameworkComponent;
|
|
1793
|
+
|
|
1786
1794
|
/**
|
|
1787
1795
|
* 状态机
|
|
1788
1796
|
*/
|
|
@@ -2007,27 +2015,30 @@ declare namespace FW {
|
|
|
2007
2015
|
type OpacityAnimationArgs = {
|
|
2008
2016
|
target: cc.Node;
|
|
2009
2017
|
duration: number;
|
|
2010
|
-
|
|
2018
|
+
} & Partial<{
|
|
2019
|
+
initOpacity: number;
|
|
2011
2020
|
targetOpacity: number;
|
|
2012
|
-
cb
|
|
2013
|
-
}
|
|
2021
|
+
cb: () => void;
|
|
2022
|
+
}>;
|
|
2014
2023
|
|
|
2015
2024
|
type ScaleAnimationArgs = {
|
|
2016
2025
|
target: cc.Node;
|
|
2017
2026
|
duration: number;
|
|
2018
|
-
|
|
2027
|
+
} & Partial<{
|
|
2028
|
+
initScale: number;
|
|
2019
2029
|
targetScale: number;
|
|
2020
|
-
easing
|
|
2021
|
-
cb
|
|
2022
|
-
}
|
|
2030
|
+
easing: cc.Easing;
|
|
2031
|
+
cb: () => void;
|
|
2032
|
+
}>;
|
|
2023
2033
|
|
|
2024
2034
|
type PositionAnimationArgs = {
|
|
2025
2035
|
target: cc.Node;
|
|
2026
2036
|
duration: number;
|
|
2027
|
-
|
|
2037
|
+
} & Partial<{
|
|
2038
|
+
initPosition: Vec3;
|
|
2028
2039
|
targetPosition: Vec3;
|
|
2029
|
-
cb
|
|
2030
|
-
}
|
|
2040
|
+
cb: () => void;
|
|
2041
|
+
}>;
|
|
2031
2042
|
|
|
2032
2043
|
type Vec3 = {
|
|
2033
2044
|
x?: number;
|
|
@@ -2108,7 +2119,7 @@ declare namespace FW {
|
|
|
2108
2119
|
getString: <T extends string>(key: string) => T;
|
|
2109
2120
|
}
|
|
2110
2121
|
|
|
2111
|
-
type TaskOptions = {
|
|
2122
|
+
type TaskOptions = Partial<{
|
|
2112
2123
|
taskId: number;
|
|
2113
2124
|
/**
|
|
2114
2125
|
* 每帧最大执行时间(ms),默认16ms (60fps) 帧预算
|
|
@@ -2122,6 +2133,8 @@ declare namespace FW {
|
|
|
2122
2133
|
* 是否打印日志
|
|
2123
2134
|
*/
|
|
2124
2135
|
log: boolean;
|
|
2136
|
+
}> & {
|
|
2137
|
+
taskId: number;
|
|
2125
2138
|
};
|
|
2126
2139
|
|
|
2127
2140
|
type TaskEvent = {
|
|
@@ -2280,13 +2293,13 @@ declare namespace FW {
|
|
|
2280
2293
|
reason?: any,
|
|
2281
2294
|
) => void;
|
|
2282
2295
|
|
|
2283
|
-
type PromiseExecuteOptions = {
|
|
2284
|
-
reason
|
|
2285
|
-
timeout
|
|
2286
|
-
retryCount
|
|
2287
|
-
retryInterval
|
|
2288
|
-
retryCondition
|
|
2289
|
-
}
|
|
2296
|
+
type PromiseExecuteOptions = Partial<{
|
|
2297
|
+
reason: any;
|
|
2298
|
+
timeout: number;
|
|
2299
|
+
retryCount: number;
|
|
2300
|
+
retryInterval: number;
|
|
2301
|
+
retryCondition: (error: any, retryCount: number) => boolean;
|
|
2302
|
+
}>;
|
|
2290
2303
|
|
|
2291
2304
|
type PromiseAllResult<T = any> = {
|
|
2292
2305
|
success: Array<{ id: number; value: T }>;
|
|
@@ -2299,16 +2312,16 @@ declare namespace FW {
|
|
|
2299
2312
|
/**
|
|
2300
2313
|
* 性能管理器配置
|
|
2301
2314
|
*/
|
|
2302
|
-
type PerformanceModuleOptions = {
|
|
2315
|
+
type PerformanceModuleOptions = Partial<{
|
|
2303
2316
|
/** 是否自动收集性能数据 */
|
|
2304
|
-
autoCollect
|
|
2317
|
+
autoCollect: boolean;
|
|
2305
2318
|
/** 性能数据保留时间(毫秒) */
|
|
2306
|
-
dataRetentionTime
|
|
2319
|
+
dataRetentionTime: number;
|
|
2307
2320
|
/** 采样率(0-1) */
|
|
2308
|
-
samplingRate
|
|
2321
|
+
samplingRate: number;
|
|
2309
2322
|
/** 性能警告阈值(毫秒) */
|
|
2310
|
-
warningThreshold
|
|
2311
|
-
}
|
|
2323
|
+
warningThreshold: number;
|
|
2324
|
+
}>;
|
|
2312
2325
|
|
|
2313
2326
|
/**
|
|
2314
2327
|
* 性能统计报告
|
|
@@ -2332,12 +2345,12 @@ declare namespace FW {
|
|
|
2332
2345
|
timestamp: number;
|
|
2333
2346
|
};
|
|
2334
2347
|
|
|
2335
|
-
type ManagerOptions = {
|
|
2348
|
+
type ManagerOptions = Partial<{
|
|
2336
2349
|
/** 是否启用调试日志 */
|
|
2337
|
-
debug
|
|
2350
|
+
debug: boolean;
|
|
2338
2351
|
/** 管理器名称(默认使用类名) */
|
|
2339
|
-
name
|
|
2340
|
-
}
|
|
2352
|
+
name: string;
|
|
2353
|
+
}>;
|
|
2341
2354
|
|
|
2342
2355
|
type PropertyDecorator = (
|
|
2343
2356
|
$class: Record<string, any>,
|
|
@@ -2395,11 +2408,6 @@ declare namespace FW {
|
|
|
2395
2408
|
declare namespace FW {
|
|
2396
2409
|
export abstract class FrameworkBase {
|
|
2397
2410
|
public readonly entry: FW.Entry = FW.Entry;
|
|
2398
|
-
public logic?: FW.Logic;
|
|
2399
|
-
public data?: FW.Data;
|
|
2400
|
-
public config?: FW.AssetConfig;
|
|
2401
|
-
public sender?: FW.Sender;
|
|
2402
|
-
public handle?: FW.Handle;
|
|
2403
2411
|
|
|
2404
2412
|
/**
|
|
2405
2413
|
* 调用Promise函数 并捕获性能数据
|
package/types/Global.d.ts
CHANGED
|
@@ -11,12 +11,12 @@ declare namespace globalThis {
|
|
|
11
11
|
export function FWPropertyNode($opt?: ParamType): FW.PropertyDecorator;
|
|
12
12
|
export function FWPropertyNodes(...paths: string[]): FW.PropertyDecorator;
|
|
13
13
|
export function FWPropertyComponent(
|
|
14
|
-
$componentClass:
|
|
14
|
+
$componentClass: FW.Newable<cc.Component>,
|
|
15
15
|
$childName?: string,
|
|
16
16
|
$mute = false,
|
|
17
17
|
): FW.PropertyDecorator;
|
|
18
18
|
export function FWPropertyComponents(
|
|
19
|
-
$componentClass:
|
|
19
|
+
$componentClass: FW.Newable<cc.Component>,
|
|
20
20
|
$childName?: string,
|
|
21
21
|
): FW.PropertyDecorator;
|
|
22
22
|
}
|