@zhongguo168a/yxeditor-common 0.0.2 → 0.0.9
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.d.ts +792 -3291
- package/dist/index.esm.js +4206 -12376
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler,
|
|
1
|
+
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, SpriteAtlas, Vec2, Vec3, Vec4 } from 'cc';
|
|
2
|
+
import { Dispatcher as Dispatcher$1 } from 'db://assets/core/libs/event';
|
|
3
|
+
import { List as List$1 } from 'db://assets/core/libs/ds';
|
|
4
|
+
import { AssetURI as AssetURI$1 } from 'db://assets/core/libs/loader/AssetManager';
|
|
2
5
|
|
|
3
6
|
interface error {
|
|
4
7
|
isCancel(): boolean;
|
|
@@ -206,386 +209,22 @@ declare class Timer {
|
|
|
206
209
|
dispose(): void;
|
|
207
210
|
}
|
|
208
211
|
|
|
209
|
-
declare
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
static BIG_ENDIAN: string;
|
|
226
|
-
}
|
|
227
|
-
declare const enum EndianConst {
|
|
228
|
-
LITTLE_ENDIAN = 0,
|
|
229
|
-
BIG_ENDIAN = 1
|
|
230
|
-
}
|
|
231
|
-
/**
|
|
232
|
-
* ByteArray 类提供用于优化读取、写入以及处理二进制数据的方法和属性。
|
|
233
|
-
* 注意:ByteArray 类适用于需要在字节层访问数据的高级开发人员。
|
|
234
|
-
*/
|
|
235
|
-
declare class ByteArray {
|
|
236
|
-
/**
|
|
237
|
-
* @private
|
|
238
|
-
*/
|
|
239
|
-
protected bufferExtSize: number;
|
|
240
|
-
protected data: DataView;
|
|
241
|
-
protected _bytes: Uint8Array;
|
|
242
|
-
/**
|
|
243
|
-
* @private
|
|
244
|
-
*/
|
|
245
|
-
protected _position: number;
|
|
246
|
-
/**
|
|
247
|
-
*
|
|
248
|
-
* 已经使用的字节偏移量
|
|
249
|
-
*/
|
|
250
|
-
protected write_position: number;
|
|
251
|
-
/**
|
|
252
|
-
* 更改或读取数据的字节顺序;egret.EndianConst.BIG_ENDIAN 或 egret.EndianConst.LITTLE_ENDIAN。
|
|
253
|
-
*/
|
|
254
|
-
get endian(): string;
|
|
255
|
-
set endian(value: string);
|
|
256
|
-
protected $endian: EndianConst;
|
|
257
|
-
constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number);
|
|
258
|
-
/**
|
|
259
|
-
* @deprecated
|
|
260
|
-
* @version Egret 2.4
|
|
261
|
-
* @platform Web,Native
|
|
262
|
-
*/
|
|
263
|
-
setArrayBuffer(buffer: ArrayBuffer): void;
|
|
264
|
-
/**
|
|
265
|
-
* 可读的剩余字节数
|
|
266
|
-
* @returns
|
|
267
|
-
*/
|
|
268
|
-
get readAvailable(): number;
|
|
269
|
-
get buffer(): ArrayBuffer;
|
|
270
|
-
get rawBuffer(): ArrayBuffer;
|
|
271
|
-
/**
|
|
272
|
-
* @private
|
|
273
|
-
*/
|
|
274
|
-
set buffer(value: ArrayBuffer);
|
|
275
|
-
get bytes(): Uint8Array;
|
|
276
|
-
/**
|
|
277
|
-
* @private
|
|
278
|
-
*/
|
|
279
|
-
get dataPage(): DataView;
|
|
280
|
-
/**
|
|
281
|
-
* @private
|
|
282
|
-
*/
|
|
283
|
-
set dataPage(value: DataView);
|
|
284
|
-
/**
|
|
285
|
-
* @private
|
|
286
|
-
*/
|
|
287
|
-
get bufferOffset(): number;
|
|
288
|
-
/**
|
|
289
|
-
* 将文件指针的当前位置(以字节为单位)移动或返回到 ByteArray 对象中。下一次调用读取方法时将在此位置开始读取,或者下一次调用写入方法时将在此位置开始写入。
|
|
290
|
-
*/
|
|
291
|
-
get position(): number;
|
|
292
|
-
set position(value: number);
|
|
293
|
-
/**
|
|
294
|
-
* ByteArray 对象的长度(以字节为单位)。
|
|
295
|
-
* 如果将长度设置为大于当前长度的值,则用零填充字节数组的右侧。
|
|
296
|
-
* 如果将长度设置为小于当前长度的值,将会截断该字节数组。
|
|
297
|
-
*/
|
|
298
|
-
get length(): number;
|
|
299
|
-
set length(value: number);
|
|
300
|
-
protected _validateBuffer(value: number): void;
|
|
301
|
-
/**
|
|
302
|
-
* 可从字节数组的当前位置到数组末尾读取的数据的字节数。
|
|
303
|
-
* 每次访问 ByteArray 对象时,将 bytesAvailable 属性与读取方法结合使用,以确保读取有效的数据。
|
|
304
|
-
*/
|
|
305
|
-
get bytesAvailable(): number;
|
|
306
|
-
/**
|
|
307
|
-
* 清除字节数组的内容,并将 length 和 position 属性重置为 0。
|
|
308
|
-
*/
|
|
309
|
-
clear(): void;
|
|
310
|
-
/**
|
|
311
|
-
* 从字节流中读取布尔值。读取单个字节,如果字节非零,则返回 true,否则返回 false
|
|
312
|
-
* @return 如果字节不为零,则返回 true,否则返回 false
|
|
313
|
-
*/
|
|
314
|
-
readBool(): boolean;
|
|
315
|
-
/**
|
|
316
|
-
* 从字节流中读取带符号的字节
|
|
317
|
-
* @return 介于 -128 和 127 之间的整数
|
|
318
|
-
*/
|
|
319
|
-
readByte(): number;
|
|
320
|
-
/**
|
|
321
|
-
* 从字节流中读取 length 参数指定的数据字节数。从 offset 指定的位置开始,将字节读入 bytes 参数指定的 ByteArray 对象中,并将字节写入目标 ByteArray 中
|
|
322
|
-
* @param bytes 要将数据读入的 ByteArray 对象
|
|
323
|
-
* @param offset bytes 中的偏移(位置),应从该位置写入读取的数据
|
|
324
|
-
* @param length 要读取的字节数。默认值 0 导致读取所有可用的数据
|
|
325
|
-
*/
|
|
326
|
-
readBytes(bytes: ByteArray, offset?: number, length?: number): void;
|
|
327
|
-
/**
|
|
328
|
-
* 从字节流中读取一个 IEEE 754 双精度(64 位)浮点数
|
|
329
|
-
* @return 双精度(64 位)浮点数
|
|
330
|
-
*/
|
|
331
|
-
readFloat64(): number;
|
|
332
|
-
/**
|
|
333
|
-
* 从字节流中读取一个 IEEE 754 单精度(32 位)浮点数
|
|
334
|
-
* @return 单精度(32 位)浮点数
|
|
335
|
-
*/
|
|
336
|
-
readFloat32(): number;
|
|
337
|
-
/**
|
|
338
|
-
* 从字节流中读取一个带符号的 32 位整数
|
|
339
|
-
* @return 介于 -2147483648 和 2147483647 之间的 32 位带符号整数
|
|
340
|
-
*/
|
|
341
|
-
readInt32(): number;
|
|
342
|
-
/**
|
|
343
|
-
* 从字节流中读取一个带符号的 32 位整数数组
|
|
344
|
-
*/
|
|
345
|
-
readInt32Array(): number[];
|
|
346
|
-
/**
|
|
347
|
-
* 从字节流中读取一个带符号的 16 位整数
|
|
348
|
-
* @return 介于 -32768 和 32767 之间的 16 位带符号整数
|
|
349
|
-
*/
|
|
350
|
-
readInt16(): number;
|
|
351
|
-
/**
|
|
352
|
-
* 从字节流中读取无符号的字节
|
|
353
|
-
* @return 介于 0 和 255 之间的无符号整数
|
|
354
|
-
*/
|
|
355
|
-
readInt8(): number;
|
|
356
|
-
/**
|
|
357
|
-
* 从字节流中读取无符号的字节
|
|
358
|
-
* @return 介于 0 和 255 之间的无符号整数
|
|
359
|
-
*/
|
|
360
|
-
readUint8(): number;
|
|
361
|
-
/**
|
|
362
|
-
* 从字节流中读取一个无符号的 32 位整数
|
|
363
|
-
* @return 介于 0 和 4294967295 之间的 32 位无符号整数
|
|
364
|
-
*/
|
|
365
|
-
readUint32(): number;
|
|
366
|
-
/**
|
|
367
|
-
* 从字节流中读取一个无符号的 16 位整数
|
|
368
|
-
* @return 介于 0 和 65535 之间的 16 位无符号整数
|
|
369
|
-
*/
|
|
370
|
-
readUint16(): number;
|
|
371
|
-
/**
|
|
372
|
-
* 从字节流中读取一个 UTF-8 字符串。假定字符串的前缀是无符号的短整型(以字节表示长度)
|
|
373
|
-
* @return UTF-8 编码的字符串
|
|
374
|
-
*/
|
|
375
|
-
readUTF(): string;
|
|
376
|
-
/**
|
|
377
|
-
* 从字节流中读取一个由 length 参数指定的 UTF-8 字节序列,并返回一个字符串
|
|
378
|
-
* @param length 指明 UTF-8 字节长度的无符号短整型数
|
|
379
|
-
* @return 由指定长度的 UTF-8 字节组成的字符串
|
|
380
|
-
*/
|
|
381
|
-
readUTFBytes(length: number): string;
|
|
382
|
-
/**
|
|
383
|
-
* 写入布尔值。根据 value 参数写入单个字节。如果为 true,则写入 1,如果为 false,则写入 0
|
|
384
|
-
* @param value 确定写入哪个字节的布尔值。如果该参数为 true,则该方法写入 1;如果该参数为 false,则该方法写入 0
|
|
385
|
-
*/
|
|
386
|
-
writeBool(value: boolean): void;
|
|
387
|
-
/**
|
|
388
|
-
* 在字节流中写入一个字节
|
|
389
|
-
* 使用参数的低 8 位。忽略高 24 位
|
|
390
|
-
* @param value 一个 32 位整数。低 8 位将被写入字节流
|
|
391
|
-
*/
|
|
392
|
-
writeByte(value: number): void;
|
|
393
|
-
/**
|
|
394
|
-
* 将指定字节数组 bytes(起始偏移量为 offset,从零开始的索引)中包含 length 个字节的字节序列写入字节流
|
|
395
|
-
* 如果省略 length 参数,则使用默认长度 0;该方法将从 offset 开始写入整个缓冲区。如果还省略了 offset 参数,则写入整个缓冲区
|
|
396
|
-
* 如果 offset 或 length 超出范围,它们将被锁定到 bytes 数组的开头和结尾
|
|
397
|
-
* @param bytes ByteArray 对象
|
|
398
|
-
* @param offset 从 0 开始的索引,表示在数组中开始写入的位置
|
|
399
|
-
* @param length 一个无符号整数,表示在缓冲区中的写入范围
|
|
400
|
-
*/
|
|
401
|
-
writeBytes(bytes: ByteArray, offset?: number, length?: number): void;
|
|
402
|
-
/**
|
|
403
|
-
* 在字节流中写入一个 IEEE 754 双精度(64 位)浮点数
|
|
404
|
-
* @param value 双精度(64 位)浮点数
|
|
405
|
-
*/
|
|
406
|
-
writeDouble(value: number): void;
|
|
407
|
-
/**
|
|
408
|
-
* 在字节流中写入一个 IEEE 754 单精度(32 位)浮点数
|
|
409
|
-
* @param value 单精度(32 位)浮点数
|
|
410
|
-
*/
|
|
411
|
-
writeFloat(value: number): void;
|
|
412
|
-
/**
|
|
413
|
-
* 在字节流中写入一个带符号的 32 位整数
|
|
414
|
-
* @param value 要写入字节流的整数
|
|
415
|
-
*/
|
|
416
|
-
writeInt(value: number): void;
|
|
417
|
-
/**
|
|
418
|
-
* 在字节流中写入一个 16 位整数。使用参数的低 16 位。忽略高 16 位
|
|
419
|
-
* @param value 32 位整数,该整数的低 16 位将被写入字节流
|
|
420
|
-
*/
|
|
421
|
-
writeShort(value: number): void;
|
|
422
|
-
/**
|
|
423
|
-
* 在字节流中写入一个无符号的 32 位整数
|
|
424
|
-
* @param value 要写入字节流的无符号整数
|
|
425
|
-
*/
|
|
426
|
-
writeUnsignedInt(value: number): void;
|
|
427
|
-
/**
|
|
428
|
-
* 在字节流中写入一个无符号的 16 位整数
|
|
429
|
-
* @param value 要写入字节流的无符号整数
|
|
430
|
-
*/
|
|
431
|
-
writeUnsignedShort(value: number): void;
|
|
432
|
-
/**
|
|
433
|
-
* 将 UTF-8 字符串写入字节流。先写入以字节表示的 UTF-8 字符串长度(作为 16 位整数),然后写入表示字符串字符的字节
|
|
434
|
-
* @param value 要写入的字符串值
|
|
435
|
-
*/
|
|
436
|
-
writeUTF(value: string): void;
|
|
437
|
-
/**
|
|
438
|
-
* 将 UTF-8 字符串写入字节流。类似于 writeUTF() 方法,但 writeUTFBytes() 不使用 16 位长度的词为字符串添加前缀
|
|
439
|
-
* @param value 要写入的字符串值
|
|
440
|
-
*/
|
|
441
|
-
writeUTFBytes(value: string): void;
|
|
442
|
-
/**
|
|
443
|
-
* @returns
|
|
444
|
-
*/
|
|
445
|
-
toString(): string;
|
|
446
|
-
/**
|
|
447
|
-
* @private
|
|
448
|
-
* 将 Uint8Array 写入字节流
|
|
449
|
-
* @param bytes 要写入的Uint8Array
|
|
450
|
-
* @param validateBuffer
|
|
451
|
-
*/
|
|
452
|
-
_writeUint8Array(bytes: Uint8Array | ArrayLike<number>, validateBuffer?: boolean): void;
|
|
453
|
-
/**
|
|
454
|
-
* @param len
|
|
455
|
-
* @returns
|
|
456
|
-
*/
|
|
457
|
-
validate(len: number): boolean;
|
|
458
|
-
/**********************/
|
|
459
|
-
/**********************/
|
|
460
|
-
/**
|
|
461
|
-
* @private
|
|
462
|
-
* @param len
|
|
463
|
-
* @param needReplace
|
|
464
|
-
*/
|
|
465
|
-
protected validateBuffer(len: number): void;
|
|
466
|
-
/**
|
|
467
|
-
* @private
|
|
468
|
-
* UTF-8 Encoding/Decoding
|
|
469
|
-
*/
|
|
470
|
-
private encodeUTF8;
|
|
471
|
-
/**
|
|
472
|
-
* @private
|
|
473
|
-
*
|
|
474
|
-
* @param data
|
|
475
|
-
* @returns
|
|
476
|
-
*/
|
|
477
|
-
private decodeUTF8;
|
|
478
|
-
/**
|
|
479
|
-
* @private
|
|
480
|
-
*
|
|
481
|
-
* @param code_point
|
|
482
|
-
*/
|
|
483
|
-
private encoderError;
|
|
484
|
-
/**
|
|
485
|
-
* @private
|
|
486
|
-
*
|
|
487
|
-
* @param fatal
|
|
488
|
-
* @param opt_code_point
|
|
489
|
-
* @returns
|
|
490
|
-
*/
|
|
491
|
-
private decoderError;
|
|
492
|
-
/**
|
|
493
|
-
* @private
|
|
494
|
-
*/
|
|
495
|
-
private EOF_byte;
|
|
496
|
-
/**
|
|
497
|
-
* @private
|
|
498
|
-
*/
|
|
499
|
-
private EOF_code_point;
|
|
500
|
-
/**
|
|
501
|
-
* @private
|
|
502
|
-
*
|
|
503
|
-
* @param a
|
|
504
|
-
* @param min
|
|
505
|
-
* @param max
|
|
506
|
-
*/
|
|
507
|
-
private inRange;
|
|
508
|
-
/**
|
|
509
|
-
* @private
|
|
510
|
-
*
|
|
511
|
-
* @param n
|
|
512
|
-
* @param d
|
|
513
|
-
*/
|
|
514
|
-
private div;
|
|
515
|
-
/**
|
|
516
|
-
* @private
|
|
517
|
-
*
|
|
518
|
-
* @param string
|
|
519
|
-
*/
|
|
520
|
-
private stringToCodePoints;
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
declare enum ConnectState {
|
|
524
|
-
Wait = 0,
|
|
525
|
-
Closed = 1,
|
|
526
|
-
Connecting = 2,
|
|
527
|
-
Connected = 3
|
|
528
|
-
}
|
|
529
|
-
declare enum ValidState {
|
|
530
|
-
Unknown = 0,
|
|
531
|
-
Validing = 1,
|
|
532
|
-
Valid = 2
|
|
533
|
-
}
|
|
534
|
-
declare enum NetIdent {
|
|
535
|
-
Send = "Send"
|
|
536
|
-
}
|
|
537
|
-
declare enum NetSub {
|
|
538
|
-
All = 0,
|
|
539
|
-
NotConnected = 1,
|
|
540
|
-
Invalid = 2
|
|
541
|
-
}
|
|
542
|
-
declare enum ResponseSub {
|
|
543
|
-
All = 0,
|
|
544
|
-
Succeed = 1,
|
|
545
|
-
Failed = 2,
|
|
546
|
-
Timeout = 3
|
|
547
|
-
}
|
|
548
|
-
declare enum SerializeMode {
|
|
549
|
-
JSON = 0,
|
|
550
|
-
JSON_REF = 1,
|
|
551
|
-
BYTE = 2
|
|
552
|
-
}
|
|
553
|
-
declare enum PushTag {
|
|
554
|
-
Unknown = 0,
|
|
555
|
-
Response = 1,
|
|
556
|
-
Push = 2,
|
|
557
|
-
Event = 3,
|
|
558
|
-
Command = 4,
|
|
559
|
-
SyncCreate = 5,
|
|
560
|
-
SyncUpdate = 6,
|
|
561
|
-
SyncDelete = 7
|
|
562
|
-
}
|
|
563
|
-
declare enum HttpResponseType {
|
|
564
|
-
/**
|
|
565
|
-
* 返回字符串。HttpRequest.responseType属性的默认值。
|
|
566
|
-
*/
|
|
567
|
-
TEXT = "text",
|
|
568
|
-
/**
|
|
569
|
-
* 返回二进制的ArrayBuffer对象。
|
|
570
|
-
*/
|
|
571
|
-
ARRAY_BUFFER = "arraybuffer",
|
|
572
|
-
BLOB = "blob",
|
|
573
|
-
DOCUMENT = "document",
|
|
574
|
-
JSON = "json"
|
|
575
|
-
}
|
|
576
|
-
declare enum HttpMethod {
|
|
577
|
-
GET = "GET",
|
|
578
|
-
POST = "POST"
|
|
579
|
-
}
|
|
580
|
-
declare enum WebSocketType {
|
|
581
|
-
/**
|
|
582
|
-
* 以字符串格式发送和接收数据
|
|
583
|
-
*/
|
|
584
|
-
STRING = "webSocketTypeString",
|
|
585
|
-
/**
|
|
586
|
-
* 以二进制格式发送和接收数据
|
|
587
|
-
*/
|
|
588
|
-
BINARY = "webSocketTypeBinary"
|
|
212
|
+
declare class ControllerSet {
|
|
213
|
+
constructor(mod: IModule);
|
|
214
|
+
has(name: string): boolean;
|
|
215
|
+
add(controller: IController): void;
|
|
216
|
+
createAndEnable(name: string, ...args: any[]): void;
|
|
217
|
+
create(name: string, ...args: any[]): void;
|
|
218
|
+
remove(name: string): void;
|
|
219
|
+
disable(name: string): void;
|
|
220
|
+
enable(name: string): void;
|
|
221
|
+
enableAll(): void;
|
|
222
|
+
disableAll(): void;
|
|
223
|
+
dispose(): void;
|
|
224
|
+
registerCreator(name: string, creator: (...args: any[]) => IController): void;
|
|
225
|
+
protected _creator: {};
|
|
226
|
+
protected _mod: IModule;
|
|
227
|
+
private data;
|
|
589
228
|
}
|
|
590
229
|
|
|
591
230
|
/**
|
|
@@ -730,671 +369,466 @@ declare class EventManager implements IEventManager {
|
|
|
730
369
|
*/
|
|
731
370
|
declare const eventmgr: EventManager;
|
|
732
371
|
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
response(data: any, err: LinkError): void;
|
|
761
|
-
cancel(): void;
|
|
372
|
+
/**
|
|
373
|
+
* 一个简单的功能/库模块
|
|
374
|
+
*/
|
|
375
|
+
interface IModuleSample {
|
|
376
|
+
}
|
|
377
|
+
interface IModule {
|
|
378
|
+
controllers: ControllerSet;
|
|
379
|
+
}
|
|
380
|
+
declare class Module extends EventManager implements IModule {
|
|
381
|
+
constructor();
|
|
382
|
+
get controllers(): ControllerSet;
|
|
383
|
+
private _controllers;
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
interface IController {
|
|
387
|
+
get name(): string;
|
|
388
|
+
get module(): IModule;
|
|
389
|
+
init(core: IModule): any;
|
|
390
|
+
enable(): any;
|
|
391
|
+
disable(): any;
|
|
392
|
+
dispose(): any;
|
|
393
|
+
}
|
|
394
|
+
declare class Controller {
|
|
395
|
+
constructor(name: string);
|
|
396
|
+
init(core: IModule): void;
|
|
397
|
+
enable(): void;
|
|
398
|
+
disable(): void;
|
|
762
399
|
dispose(): void;
|
|
763
|
-
|
|
764
|
-
get
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
protected
|
|
769
|
-
/**
|
|
770
|
-
* 无需验证
|
|
771
|
-
*/
|
|
772
|
-
protected _noValid: boolean;
|
|
773
|
-
protected _onSimulate: Function;
|
|
774
|
-
protected _argsGetter: Function | any;
|
|
775
|
-
protected _argsCondition: Function;
|
|
776
|
-
private _hasResponse;
|
|
777
|
-
protected _seq: number;
|
|
778
|
-
/**
|
|
779
|
-
* 消息额参数
|
|
780
|
-
*/
|
|
781
|
-
args: ARGS;
|
|
782
|
-
result: RESULT;
|
|
783
|
-
error: LinkError;
|
|
784
|
-
get timeout(): number;
|
|
785
|
-
protected _timeout: number;
|
|
400
|
+
get name(): string;
|
|
401
|
+
get module(): IModule;
|
|
402
|
+
get isEnable(): boolean;
|
|
403
|
+
protected _module: IModule;
|
|
404
|
+
protected _name: string;
|
|
405
|
+
protected _enabled: boolean;
|
|
786
406
|
}
|
|
787
407
|
|
|
788
|
-
interface
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
408
|
+
interface IModel {
|
|
409
|
+
get module(): IModule;
|
|
410
|
+
}
|
|
411
|
+
declare class SimpleModel {
|
|
412
|
+
constructor(mod: IModule);
|
|
413
|
+
get core(): IModule;
|
|
414
|
+
protected _mod: any;
|
|
415
|
+
}
|
|
416
|
+
declare class Model extends EventManager {
|
|
417
|
+
constructor(core?: IModule);
|
|
418
|
+
get module(): IModule;
|
|
419
|
+
protected _module: any;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
interface IExtend {
|
|
423
|
+
get module(): IModule;
|
|
800
424
|
}
|
|
801
425
|
|
|
802
|
-
declare class
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
426
|
+
declare class Factory {
|
|
427
|
+
_controllers: {
|
|
428
|
+
[key: string]: (mod: IModule) => IController;
|
|
429
|
+
};
|
|
430
|
+
_extends: {
|
|
431
|
+
[key: string]: (mod: IModule, ...args: any) => IExtend;
|
|
432
|
+
};
|
|
433
|
+
registerController(name: string, creator: (mod: IModule, ...args: any) => IController): void;
|
|
434
|
+
registerExtend(name: string, creator: (mod: IModule, ...args: any) => IExtend): void;
|
|
435
|
+
createController(name: string, mod: IModule): IController;
|
|
436
|
+
createExtend(name: string, mod: IModule, ...args: any[]): IExtend;
|
|
806
437
|
}
|
|
807
|
-
|
|
808
|
-
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* 视图的路由值, 保存视图的信息
|
|
441
|
+
* 规则: path/search
|
|
442
|
+
* path = /a/b/c
|
|
443
|
+
* search = ?key=val&key=val
|
|
444
|
+
*/
|
|
445
|
+
declare class Route {
|
|
446
|
+
constructor(route: string);
|
|
447
|
+
recycle(): void;
|
|
809
448
|
/**
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
* @param key
|
|
813
|
-
* @param addr
|
|
449
|
+
* 获取调用链
|
|
450
|
+
* 例如 a/b/c,返回 a/b/c -> a/b -> a
|
|
814
451
|
*/
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
* @param key
|
|
820
|
-
* @param addr
|
|
821
|
-
*/
|
|
822
|
-
createHttp(key: string, addr: string): IConn;
|
|
823
|
-
/**
|
|
824
|
-
* 设置默认的链接
|
|
825
|
-
* ctrlz.SendMessageAction默认使用此链接
|
|
826
|
-
* 一个游戏可能包括多个链接:主socket,战斗socket,聊天socket,功能http
|
|
827
|
-
* @param key
|
|
828
|
-
*/
|
|
829
|
-
setDefault(key: string): void;
|
|
830
|
-
/**
|
|
831
|
-
* 获取链接
|
|
832
|
-
* @param key
|
|
833
|
-
*/
|
|
834
|
-
getConn(key: string): IConn;
|
|
452
|
+
getLink(): Route[];
|
|
453
|
+
protected static data: any;
|
|
454
|
+
static getData(route: string): Route;
|
|
455
|
+
toLoaction(): Location;
|
|
835
456
|
/**
|
|
836
|
-
*
|
|
457
|
+
* @constructor
|
|
837
458
|
*/
|
|
838
|
-
|
|
459
|
+
NewRoute(): Route;
|
|
839
460
|
/**
|
|
840
|
-
*
|
|
841
|
-
* 通常在打开界面的时候注册
|
|
842
|
-
* ```
|
|
843
|
-
* netmgr.register(this.uuid, rg_opt.Http.S数据表创建, ()=>{
|
|
844
|
-
* return new Caller(rg_opt.Http.S数据表读取)
|
|
845
|
-
* .argsGetter((caller?) => {
|
|
846
|
-
* return null;
|
|
847
|
-
* })
|
|
848
|
-
* .argsCondition((caller) => {
|
|
849
|
-
* return null;
|
|
850
|
-
* })
|
|
851
|
-
* .onResponse((caller) => {
|
|
852
|
-
*
|
|
853
|
-
* })
|
|
854
|
-
* })
|
|
855
|
-
* ```
|
|
856
|
-
* @param group
|
|
857
|
-
* @param id
|
|
858
|
-
* @param creator
|
|
461
|
+
* @constructor
|
|
859
462
|
*/
|
|
860
|
-
|
|
463
|
+
NewRoutePath(): Route;
|
|
861
464
|
/**
|
|
862
|
-
*
|
|
863
|
-
* @param
|
|
864
|
-
* @param creator
|
|
465
|
+
* 新建一个带参数的路由
|
|
466
|
+
* @param params
|
|
865
467
|
*/
|
|
866
|
-
|
|
468
|
+
NewRouteParam(params: any): Route;
|
|
469
|
+
toString(): string;
|
|
470
|
+
get path(): string;
|
|
471
|
+
get parentPath(): string;
|
|
472
|
+
get params(): any;
|
|
473
|
+
get search(): string;
|
|
474
|
+
set search(value: string);
|
|
475
|
+
get name(): string;
|
|
867
476
|
/**
|
|
868
|
-
*
|
|
869
|
-
* @param group
|
|
870
|
-
* @param id
|
|
477
|
+
* path/search
|
|
871
478
|
*/
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
registerCommand(cmd: string, handler: (args: any) => void): void;
|
|
880
|
-
executeCommand(key: string, args: any): void;
|
|
881
|
-
registerSyncHandler(handler: SyncHandler): void;
|
|
882
|
-
useSimulate(): void;
|
|
883
|
-
isSimulate(): boolean;
|
|
884
|
-
protected _syncHandler: SyncHandler;
|
|
885
|
-
protected _cmdHandlers: {
|
|
886
|
-
[key: string]: (args: any) => void;
|
|
887
|
-
};
|
|
888
|
-
protected _cmdPriority: Function;
|
|
889
|
-
protected _callerCreator: any[];
|
|
890
|
-
protected _simulate: boolean;
|
|
891
|
-
conns: {
|
|
892
|
-
[key: string]: IConn;
|
|
893
|
-
};
|
|
894
|
-
defaultKey: string;
|
|
895
|
-
serialMode: SerializeMode;
|
|
479
|
+
get key(): string;
|
|
480
|
+
private _path;
|
|
481
|
+
private _parentPath;
|
|
482
|
+
private _search;
|
|
483
|
+
private _name;
|
|
484
|
+
private _params;
|
|
485
|
+
protected _route: string;
|
|
896
486
|
}
|
|
897
|
-
declare var netmgr: NetManager;
|
|
898
487
|
|
|
899
|
-
declare class
|
|
900
|
-
|
|
488
|
+
declare class TreeIterator {
|
|
489
|
+
break(): void;
|
|
490
|
+
isBreak(): boolean;
|
|
491
|
+
protected _isBreak: any;
|
|
492
|
+
}
|
|
493
|
+
interface ITreeListItem {
|
|
901
494
|
/**
|
|
902
|
-
*
|
|
495
|
+
* 路径
|
|
903
496
|
*/
|
|
904
|
-
|
|
497
|
+
path: string;
|
|
905
498
|
/**
|
|
906
|
-
*
|
|
499
|
+
* 自定义数据
|
|
907
500
|
*/
|
|
908
|
-
|
|
501
|
+
data?: any;
|
|
909
502
|
/**
|
|
910
|
-
*
|
|
503
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
911
504
|
*/
|
|
912
|
-
|
|
505
|
+
tags?: {
|
|
506
|
+
[key: string]: any;
|
|
507
|
+
};
|
|
913
508
|
/**
|
|
914
|
-
*
|
|
509
|
+
* 是否树叶
|
|
915
510
|
*/
|
|
916
|
-
|
|
511
|
+
isLeaf: boolean;
|
|
512
|
+
}
|
|
513
|
+
declare class TreeNode<T = any> {
|
|
514
|
+
get root(): TreeRoot;
|
|
917
515
|
/**
|
|
918
|
-
*
|
|
516
|
+
* 根节点
|
|
919
517
|
*/
|
|
920
|
-
|
|
518
|
+
protected _root: TreeRoot;
|
|
921
519
|
/**
|
|
922
|
-
*
|
|
520
|
+
* 编号
|
|
923
521
|
*/
|
|
924
|
-
|
|
522
|
+
uuid: string;
|
|
925
523
|
/**
|
|
926
|
-
*
|
|
927
|
-
* 本次请求返回的数据,数据类型根据responseType设置的值确定。
|
|
524
|
+
* 编号
|
|
928
525
|
*/
|
|
929
|
-
|
|
526
|
+
id: string;
|
|
930
527
|
/**
|
|
931
|
-
*
|
|
528
|
+
* 自定义数据
|
|
932
529
|
*/
|
|
933
|
-
|
|
530
|
+
data: T;
|
|
934
531
|
/**
|
|
935
|
-
*
|
|
936
|
-
* 设置返回的数据格式,请使用 HttpResponseType 里定义的枚举值。设置非法的值或不设置,都将使用HttpResponseType.TEXT。
|
|
532
|
+
* 是否树叶
|
|
937
533
|
*/
|
|
938
|
-
|
|
939
|
-
set responseType(value: HttpResponseType);
|
|
534
|
+
isLeaf: boolean;
|
|
940
535
|
/**
|
|
941
|
-
*
|
|
536
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
942
537
|
*/
|
|
943
|
-
|
|
538
|
+
tags: {
|
|
539
|
+
[key: string]: any;
|
|
540
|
+
};
|
|
944
541
|
/**
|
|
945
|
-
*
|
|
946
|
-
* 表明在进行跨站(cross-site)的访问控制(Access-Control)请求时,是否使用认证信息(例如cookie或授权的header)。 默认为 false。(这个标志不会影响同站的请求)
|
|
542
|
+
* 深度
|
|
947
543
|
*/
|
|
948
|
-
get
|
|
949
|
-
|
|
544
|
+
get depth(): number;
|
|
545
|
+
private _depth;
|
|
950
546
|
/**
|
|
951
|
-
*
|
|
547
|
+
* 父节点
|
|
952
548
|
*/
|
|
953
|
-
|
|
954
|
-
private _method;
|
|
549
|
+
parent: TreeNode;
|
|
955
550
|
/**
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
* @returns
|
|
551
|
+
* 子节点
|
|
959
552
|
*/
|
|
960
|
-
|
|
553
|
+
children: TreeNode[];
|
|
961
554
|
/**
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
* @param url 该请求所要访问的URL该请求所要访问的URL
|
|
965
|
-
* @param method 请求所使用的HTTP方法, 请使用 HttpMethod 定义的枚举值.
|
|
555
|
+
* 设置根
|
|
556
|
+
* @param val
|
|
966
557
|
*/
|
|
967
|
-
|
|
558
|
+
setRoot(val: TreeRoot): void;
|
|
559
|
+
getTags(): {
|
|
560
|
+
[key: string]: any;
|
|
561
|
+
};
|
|
562
|
+
getTag(name: string): any;
|
|
563
|
+
removeTag(name: string): void;
|
|
564
|
+
setTag(name: string, value: any): void;
|
|
565
|
+
constructor(id: string, isLeaf?: boolean);
|
|
566
|
+
addChild(val: TreeNode): void;
|
|
567
|
+
getChildIndex(val: TreeNode): number;
|
|
568
|
+
insertChild(val: TreeNode, index: number): void;
|
|
569
|
+
removeChild(val: TreeNode): void;
|
|
570
|
+
removeChildren(): void;
|
|
571
|
+
get name(): string;
|
|
572
|
+
setDepth(val: number): void;
|
|
573
|
+
containsById(id: string): boolean;
|
|
968
574
|
/**
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
* @param data 需要发送的数据
|
|
575
|
+
* 通过编号获取子节点
|
|
576
|
+
* @param id
|
|
972
577
|
*/
|
|
973
|
-
|
|
578
|
+
getChildById(id: string): TreeNode;
|
|
974
579
|
/**
|
|
975
|
-
*
|
|
976
|
-
* 如果请求已经被发送,则立刻中止请求.
|
|
580
|
+
* 返回相邻的上一个节点
|
|
977
581
|
*/
|
|
978
|
-
|
|
582
|
+
prevNode(): TreeNode;
|
|
979
583
|
/**
|
|
980
|
-
*
|
|
981
|
-
* 返回所有响应头信息(响应头名和值), 如果响应头还没接受,则返回"".
|
|
584
|
+
* 返回相邻的下一个节点
|
|
982
585
|
*/
|
|
983
|
-
|
|
984
|
-
private headerObj;
|
|
586
|
+
nextNode(): TreeNode;
|
|
985
587
|
/**
|
|
986
|
-
*
|
|
987
|
-
*
|
|
988
|
-
* @param header 将要被赋值的请求头名称.
|
|
989
|
-
* @param value 给指定的请求头赋的值.
|
|
588
|
+
* 如果返回true则删除节点,包含当前节点
|
|
589
|
+
* @param f
|
|
990
590
|
*/
|
|
991
|
-
|
|
591
|
+
walkRemove(f: (node: TreeNode) => boolean): void;
|
|
592
|
+
private _walkRemove;
|
|
992
593
|
/**
|
|
993
|
-
*
|
|
994
|
-
*
|
|
995
|
-
* @param
|
|
594
|
+
* 如果返回true则继续,包含当前节点
|
|
595
|
+
* @param f
|
|
596
|
+
* @param inChild
|
|
996
597
|
*/
|
|
997
|
-
|
|
598
|
+
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
599
|
+
private _walk;
|
|
998
600
|
/**
|
|
999
|
-
*
|
|
601
|
+
* 从当前节点(包括)遍历父节点链,包含当前节点
|
|
602
|
+
* @param f
|
|
1000
603
|
*/
|
|
1001
|
-
|
|
1002
|
-
private callOnError;
|
|
1003
|
-
private callOnProgress;
|
|
1004
|
-
private callOnComplete;
|
|
604
|
+
walkParent(f: (node: TreeNode) => boolean): boolean;
|
|
1005
605
|
/**
|
|
1006
|
-
*
|
|
606
|
+
* 从当前节点往前遍历(深度),包含当前节点
|
|
607
|
+
* @param f
|
|
608
|
+
* @param inChild
|
|
1007
609
|
*/
|
|
1008
|
-
|
|
610
|
+
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): any;
|
|
611
|
+
private _walkPrev;
|
|
612
|
+
dump(): void;
|
|
1009
613
|
/**
|
|
1010
|
-
*
|
|
614
|
+
* 遍历节点,查找指定编号的节点
|
|
1011
615
|
*/
|
|
1012
|
-
|
|
616
|
+
findById(id: string): TreeNode;
|
|
1013
617
|
/**
|
|
1014
|
-
*
|
|
618
|
+
* 如果返回true则继续
|
|
619
|
+
* @param f
|
|
1015
620
|
*/
|
|
1016
|
-
|
|
621
|
+
findOne(f: (node: TreeNode) => boolean): TreeNode;
|
|
622
|
+
private _findOne;
|
|
1017
623
|
/**
|
|
1018
|
-
*
|
|
624
|
+
* 通过路径获取节点
|
|
625
|
+
* 格式为 /path1/path2/...
|
|
626
|
+
* 如果 path == "/",则返回自身
|
|
627
|
+
* @param path
|
|
1019
628
|
*/
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
629
|
+
getNodeByPath(path: string): TreeNode;
|
|
630
|
+
protected getNodeByPathArr(pathArr: string[]): TreeNode;
|
|
631
|
+
getName(): string;
|
|
632
|
+
getPath(): string;
|
|
1023
633
|
/**
|
|
1024
|
-
*
|
|
634
|
+
* 如果返回true则继续
|
|
635
|
+
* @param f
|
|
1025
636
|
*/
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
constructor();
|
|
1034
|
-
isValid(): boolean;
|
|
1035
|
-
send(caller: Caller): Caller<any, any>;
|
|
1036
|
-
update(): void;
|
|
1037
|
-
get connected(): boolean;
|
|
637
|
+
find(f: (node: TreeNode) => boolean): TreeNode[];
|
|
638
|
+
private _find;
|
|
639
|
+
toRoot(): TreeRoot;
|
|
640
|
+
clone(): TreeNode;
|
|
641
|
+
protected cloneChildrenTo(node: TreeNode): void;
|
|
642
|
+
fixDepthAndRoot(depth: number, root: TreeRoot): void;
|
|
643
|
+
toString(): string;
|
|
1038
644
|
}
|
|
1039
|
-
|
|
1040
|
-
declare function parseData(mode: number, data: any | ByteArray, route?: string): [any, error];
|
|
1041
|
-
declare function receiveData(conn: IConn, ba: ByteArray, endian: string): void;
|
|
1042
|
-
|
|
1043
|
-
/**
|
|
1044
|
-
*
|
|
1045
|
-
*/
|
|
1046
|
-
|
|
1047
|
-
/**
|
|
1048
|
-
* egret.WebSocket 类启用代码以建立传输控制协议 (TCP) 套接字连接,用于发送和接收字符串或二进制数据。
|
|
1049
|
-
* 要使用 egret.WebSocket 类的方法,请先使用构造函数 new egret.WebSocket 创建一个 egret.WebSocket 对象。
|
|
1050
|
-
* 套接字以异步方式传输和接收数据。
|
|
1051
|
-
*/
|
|
1052
|
-
declare class FrameWebSocket {
|
|
645
|
+
declare class TreeRoot<NODE = any> extends EventManager {
|
|
1053
646
|
/**
|
|
1054
|
-
*
|
|
647
|
+
* 添加数据节点
|
|
648
|
+
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
1055
649
|
*/
|
|
1056
|
-
static
|
|
650
|
+
static EVENT_ADD: string;
|
|
1057
651
|
/**
|
|
1058
|
-
*
|
|
652
|
+
* 移除数据节点
|
|
653
|
+
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
1059
654
|
*/
|
|
1060
|
-
static
|
|
1061
|
-
private _writeMessage;
|
|
1062
|
-
private _readMessage;
|
|
1063
|
-
private _connected;
|
|
1064
|
-
private _connecting;
|
|
1065
|
-
private _socket;
|
|
1066
|
-
private _url;
|
|
655
|
+
static EVENT_REMOVE: string;
|
|
1067
656
|
/**
|
|
1068
|
-
*
|
|
657
|
+
* 插入数据节点
|
|
658
|
+
* dispatchParams = {node:TreeNode, before:TreeNode}
|
|
1069
659
|
*/
|
|
1070
|
-
|
|
660
|
+
static EVENT_INSERT: string;
|
|
1071
661
|
/**
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
662
|
+
* 刷新数据节点
|
|
663
|
+
* dispatchParams = {node:TreeNode}
|
|
1074
664
|
*/
|
|
1075
|
-
|
|
1076
|
-
onOpen: (socket: FrameWebSocket) => void;
|
|
1077
|
-
onClose: (socket: FrameWebSocket) => void;
|
|
1078
|
-
onMessage: (socket: FrameWebSocket) => void;
|
|
1079
|
-
onError: (socket: FrameWebSocket) => void;
|
|
1080
|
-
private callOnOpen;
|
|
1081
|
-
private callOnClose;
|
|
1082
|
-
private callOnMessage;
|
|
1083
|
-
private callOnError;
|
|
665
|
+
static EVENT_REFRESH: string;
|
|
1084
666
|
/**
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
667
|
+
* 设置数据时触发
|
|
668
|
+
* dispatchParams = {node:TreeNode}
|
|
1087
669
|
*/
|
|
1088
|
-
|
|
670
|
+
static EVENT_DATA_SET: string;
|
|
1089
671
|
/**
|
|
1090
|
-
*
|
|
672
|
+
* 设置数据时触发
|
|
673
|
+
* dispatchParams = {node:TreeNode, tag:string, value:any}
|
|
1091
674
|
*/
|
|
1092
|
-
|
|
675
|
+
static EVENT_TAGS_SET: string;
|
|
676
|
+
static create(): TreeRoot<any>;
|
|
1093
677
|
/**
|
|
1094
|
-
*
|
|
678
|
+
* 通过列表生成一个树结构
|
|
679
|
+
* @param items
|
|
680
|
+
* @param existed 列表将添加的已经存在的树结构
|
|
1095
681
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
682
|
+
static createByList(items: ITreeListItem[], existed?: TreeRoot): TreeRoot;
|
|
683
|
+
static sortChildrenByName(node: TreeNode, des?: boolean): void;
|
|
684
|
+
constructor();
|
|
685
|
+
setNodeData(node: TreeNode, data: any): void;
|
|
686
|
+
setNodeTags(node: TreeNode, tag: string, value: any, force?: boolean): void;
|
|
687
|
+
getNodeByPath(path: string): TreeNode;
|
|
688
|
+
makeNodeByPath(path: string): TreeNode;
|
|
1098
689
|
/**
|
|
1099
|
-
*
|
|
1100
|
-
* @param
|
|
690
|
+
* 添加节点,按照 node.path 添加到正确的位置
|
|
691
|
+
* @param node
|
|
692
|
+
* @param parentPath 如果父节点路径为 "", 则添加到起源节点
|
|
693
|
+
* @param autoCreateParent 如果父节点不存在,自动创建
|
|
1101
694
|
*/
|
|
1102
|
-
|
|
695
|
+
addNode(node: TreeNode, parentPath?: string, autoCreateParent?: boolean): void;
|
|
696
|
+
removeNode(node: TreeNode): void;
|
|
697
|
+
removeChildren(node: TreeNode): void;
|
|
698
|
+
insertNode(node: TreeNode, before: TreeNode, resetId?: boolean): void;
|
|
699
|
+
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
700
|
+
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
1103
701
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
* @
|
|
702
|
+
* 派发 refresh 消息
|
|
703
|
+
* @param node
|
|
1106
704
|
*/
|
|
1107
|
-
|
|
1108
|
-
private _readByte;
|
|
1109
|
-
private _writeByte;
|
|
1110
|
-
private _bytesWrite;
|
|
705
|
+
refresh(node: TreeNode): void;
|
|
1111
706
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1115
|
-
* @param bytes 要从中读取数据的 ByteArray 对象
|
|
1116
|
-
* @param offset ByteArray 对象中从零开始的偏移量,应由此开始执行数据写入
|
|
1117
|
-
* @param length 要写入的字节数。默认值 0 导致从 offset 参数指定的值开始写入整个缓冲区
|
|
1118
|
-
|
|
707
|
+
* 克隆当前的树结
|
|
708
|
+
* * 新的tags克隆旧的data
|
|
709
|
+
* * 新的data指向旧的data
|
|
1119
710
|
*/
|
|
1120
|
-
|
|
711
|
+
clone(): TreeRoot;
|
|
712
|
+
toString(): string;
|
|
713
|
+
createNode(id: string, isLeaf?: boolean): TreeNode;
|
|
1121
714
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
* @param bytes 要将数据读入的 ByteArray 对象
|
|
1124
|
-
* @param offset 数据读取的偏移量应从该字节数组中开始
|
|
1125
|
-
* @param length 要读取的字节数。默认值 0 导致读取所有可用的数据
|
|
715
|
+
* origin的第一个child
|
|
1126
716
|
*/
|
|
1127
|
-
|
|
717
|
+
get firstNode(): TreeNode;
|
|
718
|
+
origin: TreeNode;
|
|
719
|
+
}
|
|
720
|
+
declare class TreeRootPlugin {
|
|
721
|
+
root: TreeRoot;
|
|
722
|
+
}
|
|
723
|
+
declare class TreeNodePlugin {
|
|
724
|
+
node: TreeNode;
|
|
725
|
+
}
|
|
726
|
+
|
|
727
|
+
interface IListItem {
|
|
1128
728
|
/**
|
|
1129
|
-
*
|
|
729
|
+
* 编号
|
|
1130
730
|
*/
|
|
1131
|
-
|
|
731
|
+
id: string;
|
|
1132
732
|
/**
|
|
1133
|
-
*
|
|
733
|
+
* 自定义数据
|
|
1134
734
|
*/
|
|
1135
|
-
|
|
735
|
+
data?: any;
|
|
1136
736
|
/**
|
|
1137
|
-
*
|
|
737
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
1138
738
|
*/
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
static URI: "ws://" | "wss://";
|
|
1142
|
-
}
|
|
1143
|
-
declare class NetSocket extends EventManager {
|
|
1144
|
-
static EVENT_CONNECTED: string;
|
|
1145
|
-
static EVENT_CLOSED: string;
|
|
1146
|
-
static EVENT_TIMEOUT: string;
|
|
1147
|
-
/**
|
|
1148
|
-
* 连接校验失败,并超过重试次数
|
|
1149
|
-
*/
|
|
1150
|
-
static EVENT_VALID_FAIL: string;
|
|
1151
|
-
/**
|
|
1152
|
-
* 连接校验成功
|
|
1153
|
-
*/
|
|
1154
|
-
static EVENT_VALID: string;
|
|
1155
|
-
key: string;
|
|
1156
|
-
protected reconnectMax: number;
|
|
1157
|
-
protected reconnectCount: number;
|
|
1158
|
-
protected reconnectSpace: number;
|
|
1159
|
-
addr: string;
|
|
1160
|
-
state: ConnectState;
|
|
1161
|
-
valid: ValidState;
|
|
1162
|
-
private lastReconnectTime;
|
|
1163
|
-
lastSeqSend: number;
|
|
1164
|
-
lastSeqResp: number;
|
|
1165
|
-
seqToCaller: {
|
|
1166
|
-
[key: string]: Caller;
|
|
739
|
+
tags?: {
|
|
740
|
+
[key: string]: any;
|
|
1167
741
|
};
|
|
1168
|
-
endian: string;
|
|
1169
|
-
protected _socket: FrameWebSocket;
|
|
1170
|
-
token: string;
|
|
1171
|
-
serialMode: SerializeMode;
|
|
1172
|
-
constructor();
|
|
1173
|
-
get connected(): boolean;
|
|
1174
|
-
isValid(): boolean;
|
|
1175
|
-
update(): void;
|
|
1176
|
-
protected createVerifyConnectionCaller(): Caller;
|
|
1177
|
-
protected createHeartBeatCaller(): Caller;
|
|
1178
|
-
protected updateValid(): void;
|
|
1179
|
-
protected _validCaller: Caller;
|
|
1180
|
-
protected _validMax: number;
|
|
1181
|
-
protected _validCount: number;
|
|
1182
|
-
getReconnectSpace(): number;
|
|
1183
|
-
reconnect(): void;
|
|
1184
|
-
connect(): void;
|
|
1185
|
-
close(): void;
|
|
1186
|
-
waitConnect(): Promise<boolean>;
|
|
1187
|
-
waitValid(): Promise<boolean>;
|
|
1188
|
-
/**
|
|
1189
|
-
*
|
|
1190
|
-
* @param caller
|
|
1191
|
-
*/
|
|
1192
|
-
send(caller: Caller): Caller;
|
|
1193
|
-
protected _onOpen(e: any): void;
|
|
1194
|
-
protected _流量: number;
|
|
1195
|
-
reset流量(): void;
|
|
1196
|
-
protected _流量时间: number;
|
|
1197
|
-
protected _count: number;
|
|
1198
|
-
protected _onMessage(): void;
|
|
1199
|
-
protected _onClose(e: any): void;
|
|
1200
|
-
protected _onError(e: any): void;
|
|
1201
742
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
743
|
+
declare class ListNode {
|
|
744
|
+
static create(id: string, data?: any): ListNode;
|
|
745
|
+
constructor();
|
|
746
|
+
root: ListSource;
|
|
747
|
+
uuid: string;
|
|
1204
748
|
id: string;
|
|
1205
|
-
seq: number;
|
|
1206
|
-
serialMode: number;
|
|
1207
|
-
token: string;
|
|
1208
749
|
data: any;
|
|
1209
|
-
|
|
750
|
+
tags: {};
|
|
751
|
+
getTags(): {
|
|
752
|
+
[key: string]: any;
|
|
753
|
+
};
|
|
754
|
+
setTags(tags: {
|
|
755
|
+
[key: string]: any;
|
|
756
|
+
}): void;
|
|
757
|
+
getTag(name: string): any;
|
|
758
|
+
setTag(name: string, value: any): void;
|
|
1210
759
|
}
|
|
1211
|
-
declare class
|
|
1212
|
-
seq: number;
|
|
1213
|
-
serialMode: number;
|
|
1214
|
-
error: string;
|
|
1215
|
-
data: ByteArray;
|
|
1216
|
-
unpack(reader: ByteArray, endian: string): void;
|
|
1217
|
-
}
|
|
1218
|
-
declare class PushProtocol {
|
|
1219
|
-
serialMode: number;
|
|
1220
|
-
data: any;
|
|
1221
|
-
unpack(reader: ByteArray): void;
|
|
1222
|
-
}
|
|
1223
|
-
declare class CreateProtocol {
|
|
1224
|
-
key: string;
|
|
1225
|
-
serialMode: number;
|
|
1226
|
-
data: any;
|
|
1227
|
-
unpack(reader: ByteArray): void;
|
|
1228
|
-
}
|
|
1229
|
-
declare class UpdateProtocol {
|
|
1230
|
-
key: string;
|
|
1231
|
-
serialMode: number;
|
|
1232
|
-
data: any;
|
|
1233
|
-
unpack(reader: ByteArray): void;
|
|
1234
|
-
}
|
|
1235
|
-
declare class DeleteProtocol {
|
|
1236
|
-
key: string;
|
|
1237
|
-
unpack(reader: ByteArray): void;
|
|
1238
|
-
}
|
|
1239
|
-
declare class EventProtocol {
|
|
1240
|
-
key: string;
|
|
1241
|
-
serialMode: number;
|
|
1242
|
-
data: any;
|
|
1243
|
-
unpack(reader: ByteArray): void;
|
|
1244
|
-
}
|
|
1245
|
-
declare class CommandProtocol {
|
|
1246
|
-
key: string;
|
|
1247
|
-
serialMode: number;
|
|
1248
|
-
data: any;
|
|
1249
|
-
unpack(reader: ByteArray): void;
|
|
1250
|
-
}
|
|
1251
|
-
|
|
1252
|
-
declare class ListIterator {
|
|
1253
|
-
break(): void;
|
|
1254
|
-
isBreak(): boolean;
|
|
1255
|
-
protected _isBreak: any;
|
|
1256
|
-
}
|
|
1257
|
-
declare class List<T = any> {
|
|
1258
|
-
constructor();
|
|
1259
|
-
onSet(caller: any, handler: (value: T) => void): void;
|
|
1260
|
-
onDelete(caller: any, handler: (value: T) => void): void;
|
|
1261
|
-
firstByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
1262
|
-
lastByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
1263
|
-
forEach(handler: (index: number, item: T, iterator: ListIterator) => void): ListIterator;
|
|
1264
|
-
/**
|
|
1265
|
-
* 移除符合条件的项, 从后往前遍历
|
|
1266
|
-
* @param cond 可以使用【iterator】中断遍历
|
|
1267
|
-
* @param removedList 设置后,可获得被移除的项
|
|
1268
|
-
*/
|
|
1269
|
-
removeByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, removedList?: List): this;
|
|
1270
|
-
/**
|
|
1271
|
-
* 查找符合条件的项保存到【target】对象中,并返回【target】对象
|
|
1272
|
-
* @param cond 可以使用【iterator】中断遍历
|
|
1273
|
-
* @param target 存到目标对象中
|
|
1274
|
-
*/
|
|
1275
|
-
findByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, target: List): this;
|
|
1276
|
-
pop(): T;
|
|
1277
|
-
shift(): T;
|
|
1278
|
-
first(): T;
|
|
1279
|
-
last(): T;
|
|
1280
|
-
removeAt(index: number): void;
|
|
1281
|
-
remove(item: T): void;
|
|
760
|
+
declare class ListSource extends EventManager {
|
|
1282
761
|
/**
|
|
1283
|
-
*
|
|
1284
|
-
* @param
|
|
762
|
+
* 通过数组创建 ListSource。ListSource的id自动生成。如果需要指定编号,可设置 idCreator
|
|
763
|
+
* @param arr
|
|
764
|
+
* @param idCreator
|
|
1285
765
|
*/
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
reverse(): void;
|
|
1289
|
-
clear(): void;
|
|
766
|
+
static createByArray(arr: any[], idCreator?: (item: any) => string): ListSource;
|
|
767
|
+
static createByListItem(arr: IListItem[], target?: ListSource): any;
|
|
1290
768
|
/**
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
769
|
+
* 设置数据时触发
|
|
770
|
+
* dispatchParams = {node:ListNode}
|
|
1293
771
|
*/
|
|
1294
|
-
|
|
1295
|
-
get length(): number;
|
|
1296
|
-
insertAt(index: number, ...item: T[]): void;
|
|
772
|
+
static EVENT_ADD: string;
|
|
1297
773
|
/**
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
774
|
+
* 设置数据时触发
|
|
775
|
+
* dispatchParams = {node:ListNode, index:number}
|
|
1300
776
|
*/
|
|
1301
|
-
|
|
777
|
+
static EVENT_REMOVE: string;
|
|
1302
778
|
/**
|
|
1303
|
-
*
|
|
1304
|
-
* @param item
|
|
779
|
+
* 设置数据时触发
|
|
1305
780
|
*/
|
|
1306
|
-
|
|
1307
|
-
at(index: number): T;
|
|
1308
|
-
set(index: number, item: T): void;
|
|
1309
|
-
indexOf(item: T): number;
|
|
1310
|
-
has(item: T): boolean;
|
|
1311
|
-
push(item: T): void;
|
|
781
|
+
static EVENT_REMOVE_ALL: string;
|
|
1312
782
|
/**
|
|
1313
|
-
*
|
|
1314
|
-
*
|
|
783
|
+
* 刷新数据节点
|
|
784
|
+
* dispatchParams = {node:ListNode}
|
|
1315
785
|
*/
|
|
1316
|
-
|
|
1317
|
-
getData(): T[];
|
|
1318
|
-
resetData(val: T[]): void;
|
|
786
|
+
static EVENT_REFRESH: string;
|
|
1319
787
|
/**
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
* @param enableRepeat 允许重复
|
|
1323
|
-
* @param target
|
|
788
|
+
* 设置数据时触发
|
|
789
|
+
* dispatchParams = nodes: [ListNode], indexs: [number]
|
|
1324
790
|
*/
|
|
1325
|
-
|
|
1326
|
-
protected callPush(value: any): void;
|
|
1327
|
-
protected callRemove(value: any): void;
|
|
1328
|
-
protected _data: any[];
|
|
1329
|
-
private _onSet;
|
|
1330
|
-
private _onDelete;
|
|
1331
|
-
private _onSetCaller;
|
|
1332
|
-
private _onDeleteCaller;
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
/**
|
|
1336
|
-
* 事件字符串分隔符
|
|
1337
|
-
*/
|
|
1338
|
-
|
|
1339
|
-
/**
|
|
1340
|
-
* 回调列表
|
|
1341
|
-
*/
|
|
1342
|
-
declare class CallbackList<PARAMS = any> {
|
|
1343
|
-
constructor();
|
|
1344
|
-
addListener(listener: Listener): void;
|
|
1345
|
-
removeListener(listener: Listener): void;
|
|
791
|
+
static EVENT_SWAP: string;
|
|
1346
792
|
/**
|
|
793
|
+
* 设置数据时触发
|
|
794
|
+
* dispatchParams = {node:ListNode, data:any}
|
|
1347
795
|
*/
|
|
1348
|
-
|
|
796
|
+
static EVENT_DATA_SET: string;
|
|
1349
797
|
/**
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
798
|
+
* 设置数据时触发
|
|
799
|
+
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
1352
800
|
*/
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
801
|
+
static EVENT_TAGS_SET: string;
|
|
802
|
+
protected _identFunc: (node: ListNode) => boolean;
|
|
803
|
+
at(index: number): ListNode;
|
|
804
|
+
first(): ListNode;
|
|
805
|
+
last(): ListNode;
|
|
806
|
+
length(): number;
|
|
1357
807
|
/**
|
|
1358
|
-
*
|
|
1359
|
-
* @param
|
|
1360
|
-
* @param
|
|
808
|
+
* 添加项,无法添加相同的项
|
|
809
|
+
* @param node
|
|
810
|
+
* @param enableDispatch 默认为true
|
|
1361
811
|
*/
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
setCondition(condition: (listener: Listener<PARAMS>) => boolean): this;
|
|
1374
|
-
setHandler(handler: (listener: Listener<PARAMS>) => void): this;
|
|
1375
|
-
setOnParams(val: any): this;
|
|
1376
|
-
getIdent(): string;
|
|
1377
|
-
on(): this;
|
|
1378
|
-
off(): this;
|
|
1379
|
-
isOn(): boolean;
|
|
1380
|
-
remove(): void;
|
|
812
|
+
add(node: ListNode, enableDispatch?: boolean): void;
|
|
813
|
+
getById(id: string): ListNode;
|
|
814
|
+
remove(node: ListNode): void;
|
|
815
|
+
removeAll(): void;
|
|
816
|
+
swap(a: ListNode, b: ListNode): void;
|
|
817
|
+
contains(node: ListNode): boolean;
|
|
818
|
+
containsById(id: string): boolean;
|
|
819
|
+
indexOf(node: ListNode): number;
|
|
820
|
+
indexOfById(id: string): number;
|
|
821
|
+
setData(node: ListNode, data: any): void;
|
|
822
|
+
setNodeTags(node: ListNode, tag: string, value: any): void;
|
|
1381
823
|
/**
|
|
1382
|
-
*
|
|
1383
|
-
* @param
|
|
1384
|
-
* @param subIdent 子编号
|
|
824
|
+
* 派发 refresh 消息
|
|
825
|
+
* @param node
|
|
1385
826
|
*/
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
protected ident: string;
|
|
1392
|
-
protected _subIdent: string;
|
|
1393
|
-
protected source: CallbackList;
|
|
1394
|
-
protected _handler: (any: any) => void;
|
|
1395
|
-
protected _condition: (any: any) => boolean;
|
|
1396
|
-
protected caller: any;
|
|
1397
|
-
protected _isOn: boolean;
|
|
827
|
+
refresh(node: ListNode): void;
|
|
828
|
+
walk(f: (node: ListNode) => boolean): boolean;
|
|
829
|
+
walkPrev(node: ListNode, f: (node: ListNode) => boolean): boolean;
|
|
830
|
+
get data(): any[];
|
|
831
|
+
private _data;
|
|
1398
832
|
}
|
|
1399
833
|
|
|
1400
834
|
declare class DictIterator {
|
|
@@ -1478,2358 +912,534 @@ declare class Dictionary<K = string, V = any> {
|
|
|
1478
912
|
private _onDeleteCaller;
|
|
1479
913
|
}
|
|
1480
914
|
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
getByIdent(type: string, ident: string): Listener;
|
|
1494
|
-
/**
|
|
1495
|
-
* @param type
|
|
1496
|
-
* @param ident
|
|
1497
|
-
*/
|
|
1498
|
-
createByIdent(type: string, ident: string): Listener;
|
|
915
|
+
declare class DictNode {
|
|
916
|
+
static create(id: string, data?: any): DictNode;
|
|
917
|
+
constructor();
|
|
918
|
+
uuid: string;
|
|
919
|
+
id: string;
|
|
920
|
+
data: any;
|
|
921
|
+
tags: {};
|
|
922
|
+
getTags(): {
|
|
923
|
+
[key: string]: any;
|
|
924
|
+
};
|
|
925
|
+
getTag(name: string): any;
|
|
926
|
+
setTag(name: string, value: any): void;
|
|
1499
927
|
/**
|
|
1500
|
-
*
|
|
1501
|
-
* @param eventType 事件类型
|
|
1502
|
-
* @param params 事件参数
|
|
928
|
+
* 清理【data】和【tags】
|
|
1503
929
|
*/
|
|
1504
|
-
|
|
1505
|
-
protected getList(type: string): CallbackList;
|
|
1506
|
-
id?: string;
|
|
1507
|
-
uuid?: string;
|
|
1508
|
-
name: string;
|
|
1509
|
-
protected isDispose: boolean;
|
|
1510
|
-
protected typeToList: Dictionary<string, CallbackList<any>>;
|
|
930
|
+
clean(): void;
|
|
1511
931
|
}
|
|
1512
|
-
|
|
1513
|
-
interface ITriggerEvent extends ISchedulable {
|
|
1514
|
-
/**
|
|
1515
|
-
*
|
|
1516
|
-
* @param val
|
|
1517
|
-
*/
|
|
1518
|
-
callback(val: (event: this) => void): this;
|
|
1519
|
-
/**
|
|
1520
|
-
* 执行触发器
|
|
1521
|
-
*/
|
|
1522
|
-
execute(): any;
|
|
1523
|
-
/**
|
|
1524
|
-
* 允许触发器
|
|
1525
|
-
*/
|
|
1526
|
-
enable(): any;
|
|
1527
|
-
/**
|
|
1528
|
-
* 禁止触发器
|
|
1529
|
-
*/
|
|
1530
|
-
disable(): any;
|
|
1531
|
-
/**
|
|
1532
|
-
* 重置触发器
|
|
1533
|
-
*/
|
|
1534
|
-
reset(): any;
|
|
932
|
+
declare class DictSource extends Dictionary<string, DictNode> {
|
|
1535
933
|
/**
|
|
1536
|
-
*
|
|
934
|
+
* 刷新数据节点
|
|
935
|
+
* dispatchParams = {node:ListNode}
|
|
1537
936
|
*/
|
|
1538
|
-
|
|
937
|
+
static EVENT_REFRESH: string;
|
|
1539
938
|
/**
|
|
1540
|
-
*
|
|
1541
|
-
*
|
|
939
|
+
* 设置数据时触发
|
|
940
|
+
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
1542
941
|
*/
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
*/
|
|
1549
|
-
declare class TriggerEvent implements ITriggerEvent {
|
|
1550
|
-
id?: string;
|
|
1551
|
-
uuid?: string;
|
|
1552
|
-
protected _enable: boolean;
|
|
1553
|
-
protected _callback: Function;
|
|
1554
|
-
protected _args: any | Function;
|
|
1555
|
-
protected _ident: string;
|
|
1556
|
-
protected _condition: Function;
|
|
1557
|
-
private _isNextFrame;
|
|
1558
|
-
constructor();
|
|
1559
|
-
reset(): void;
|
|
1560
|
-
setCondition(val: (event: this) => boolean): this;
|
|
1561
|
-
/**
|
|
1562
|
-
* 可通过ident直接控制触发器
|
|
1563
|
-
*/
|
|
1564
|
-
setIdent(ident?: string): this;
|
|
1565
|
-
/**
|
|
1566
|
-
* 设置触发后,下一帧再执行
|
|
1567
|
-
* @param val
|
|
1568
|
-
*/
|
|
1569
|
-
setCallLater(val: boolean): this;
|
|
1570
|
-
/**
|
|
1571
|
-
* @param val
|
|
1572
|
-
*/
|
|
1573
|
-
callback(val: (event: this) => void): this;
|
|
1574
|
-
execute(): void;
|
|
1575
|
-
enable(): void;
|
|
1576
|
-
disable(): void;
|
|
1577
|
-
dispose(): void;
|
|
1578
|
-
/**
|
|
1579
|
-
* 用于异步函数, 等待事件
|
|
1580
|
-
*/
|
|
1581
|
-
wait(): Promise<ITriggerEvent>;
|
|
942
|
+
static EVENT_TAGS_SET: string;
|
|
943
|
+
setNodeTags(node: DictNode, tag: string, value: any): void;
|
|
944
|
+
refreshNode(node: DictNode): void;
|
|
945
|
+
get dispatcher(): EventManager;
|
|
946
|
+
protected _dispatcher: EventManager;
|
|
1582
947
|
}
|
|
1583
948
|
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
/**
|
|
1590
|
-
* 触发器-监听框架的事件
|
|
1591
|
-
*/
|
|
1592
|
-
declare class FrameEvent extends TriggerEvent {
|
|
1593
|
-
dispatcher: IEventManager;
|
|
1594
|
-
eventName: string;
|
|
1595
|
-
static create(dispatcher: IEventManager, eventName: string): FrameEvent;
|
|
1596
|
-
/**
|
|
1597
|
-
* 数据发生变化时使用,默认参数为 集合的编号
|
|
1598
|
-
* 可通过 event.dispatchParams 获取发生变化的配置
|
|
1599
|
-
*/
|
|
1600
|
-
static MAP_CHANGE: string;
|
|
1601
|
-
/**
|
|
1602
|
-
*
|
|
1603
|
-
*/
|
|
1604
|
-
static DATA_CHANGE: string;
|
|
1605
|
-
/**
|
|
1606
|
-
*
|
|
1607
|
-
*/
|
|
1608
|
-
static CHANGED: string;
|
|
1609
|
-
/**
|
|
1610
|
-
* 派发的事件;
|
|
1611
|
-
*/
|
|
1612
|
-
event: XEvent;
|
|
1613
|
-
constructor(dispatcher: IEventManager, eventName: string);
|
|
1614
|
-
enable(): void;
|
|
1615
|
-
protected handler(event: XEvent): void;
|
|
1616
|
-
disable(): void;
|
|
1617
|
-
dispose(): void;
|
|
949
|
+
declare class ListIterator {
|
|
950
|
+
break(): void;
|
|
951
|
+
isBreak(): boolean;
|
|
952
|
+
protected _isBreak: any;
|
|
1618
953
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
954
|
+
declare class List<T = any> {
|
|
955
|
+
constructor();
|
|
956
|
+
onSet(caller: any, handler: (value: T) => void): void;
|
|
957
|
+
onDelete(caller: any, handler: (value: T) => void): void;
|
|
958
|
+
firstByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
959
|
+
lastByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
960
|
+
forEach(handler: (index: number, item: T, iterator: ListIterator) => void): ListIterator;
|
|
1625
961
|
/**
|
|
1626
|
-
*
|
|
1627
|
-
* @param
|
|
1628
|
-
* @param
|
|
962
|
+
* 移除符合条件的项, 从后往前遍历
|
|
963
|
+
* @param cond 可以使用【iterator】中断遍历
|
|
964
|
+
* @param removedList 设置后,可获得被移除的项
|
|
1629
965
|
*/
|
|
1630
|
-
|
|
1631
|
-
enable(): void;
|
|
1632
|
-
disable(): void;
|
|
1633
|
-
destroy(): void;
|
|
966
|
+
removeByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, removedList?: List): this;
|
|
1634
967
|
/**
|
|
1635
|
-
*
|
|
968
|
+
* 查找符合条件的项保存到【target】对象中,并返回【target】对象
|
|
969
|
+
* @param cond 可以使用【iterator】中断遍历
|
|
970
|
+
* @param target 存到目标对象中
|
|
1636
971
|
*/
|
|
1637
|
-
|
|
972
|
+
findByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, target: List): this;
|
|
973
|
+
pop(): T;
|
|
974
|
+
shift(): T;
|
|
975
|
+
first(): T;
|
|
976
|
+
last(): T;
|
|
977
|
+
removeAt(index: number): void;
|
|
978
|
+
remove(item: T): void;
|
|
1638
979
|
/**
|
|
1639
|
-
*
|
|
980
|
+
* 把【other】的项合并到自身
|
|
981
|
+
* @param other
|
|
1640
982
|
*/
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
protected callback(event: ITriggerEvent): void;
|
|
1646
|
-
protected _when(val: ITriggerEvent, callback: (event: ITriggerEvent) => void): this;
|
|
1647
|
-
action(val: (trigger: Trigger) => void | Promise<any>): this;
|
|
1648
|
-
once(): this;
|
|
1649
|
-
protected _isOnce: boolean;
|
|
1650
|
-
protected executeNextAction(): void;
|
|
983
|
+
removeList(other: List<T>): void;
|
|
984
|
+
sort(compareFn?: (a: T, b: T) => number): void;
|
|
985
|
+
reverse(): void;
|
|
986
|
+
clear(): void;
|
|
1651
987
|
/**
|
|
1652
|
-
*
|
|
1653
|
-
* @param
|
|
988
|
+
* 克隆自身所有项到【target】对象,并返回【target】对象
|
|
989
|
+
* @param target
|
|
1654
990
|
*/
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
get lastEvent(): ITriggerEvent;
|
|
1659
|
-
get group(): string;
|
|
1660
|
-
get ident(): string;
|
|
1661
|
-
protected _disposed: boolean;
|
|
1662
|
-
private _ident;
|
|
1663
|
-
protected _events: ITriggerEvent[];
|
|
1664
|
-
protected _actions: (Function | Promise<any>)[];
|
|
1665
|
-
protected _actionExectuingIndex: number;
|
|
1666
|
-
protected _actionWaiting: boolean;
|
|
1667
|
-
protected _actionExecuting: any;
|
|
1668
|
-
protected _onCompleteHandler: Function;
|
|
1669
|
-
protected _runing: boolean;
|
|
1670
|
-
private _lastEvent;
|
|
1671
|
-
private _group;
|
|
1672
|
-
protected _nodeEvent: FrameEvent;
|
|
1673
|
-
id?: string;
|
|
1674
|
-
uuid?: string;
|
|
1675
|
-
}
|
|
1676
|
-
|
|
1677
|
-
declare class TriggerManager extends EventManager {
|
|
1678
|
-
triggers: Trigger[];
|
|
1679
|
-
constructor();
|
|
1680
|
-
enable(group: string, ident: any): void;
|
|
1681
|
-
disable(group: string, ident: any): void;
|
|
1682
|
-
remove(group: string, ident: any): void;
|
|
1683
|
-
removeTrigger(trigger: Trigger): void;
|
|
1684
|
-
removeGroup(name: string): void;
|
|
1685
|
-
removeAll(): void;
|
|
991
|
+
clone(target: this): this;
|
|
992
|
+
get length(): number;
|
|
993
|
+
insertAt(index: number, ...item: T[]): void;
|
|
1686
994
|
/**
|
|
1687
|
-
*
|
|
1688
|
-
* @param
|
|
1689
|
-
* @param destroyGroup
|
|
995
|
+
* @param beforeItem
|
|
996
|
+
* @param item
|
|
1690
997
|
*/
|
|
1691
|
-
|
|
1692
|
-
register(trigger: Trigger): void;
|
|
1693
|
-
getById(group: string, ident: any): Trigger;
|
|
1694
|
-
}
|
|
1695
|
-
declare const triggermgr: TriggerManager;
|
|
1696
|
-
|
|
1697
|
-
/**
|
|
1698
|
-
* 触发器-定时器
|
|
1699
|
-
*/
|
|
1700
|
-
declare class TimerEvent extends TriggerEvent {
|
|
1701
|
-
protected _updateAtStart: boolean;
|
|
1702
|
-
protected _count: number;
|
|
1703
|
-
protected _countLimit: number;
|
|
1704
|
-
protected _internal: number;
|
|
1705
|
-
protected _handler: Function;
|
|
998
|
+
insertBefore(beforeItem: T, ...item: T[]): void;
|
|
1706
999
|
/**
|
|
1707
|
-
*
|
|
1708
|
-
* @param
|
|
1000
|
+
* @param afterItem
|
|
1001
|
+
* @param item
|
|
1709
1002
|
*/
|
|
1710
|
-
|
|
1711
|
-
|
|
1003
|
+
insertAfter(afterItem: T, ...item: T[]): void;
|
|
1004
|
+
at(index: number): T;
|
|
1005
|
+
set(index: number, item: T): void;
|
|
1006
|
+
indexOf(item: T): number;
|
|
1007
|
+
has(item: T): boolean;
|
|
1008
|
+
push(item: T): void;
|
|
1712
1009
|
/**
|
|
1713
|
-
*
|
|
1714
|
-
* @param
|
|
1010
|
+
* 把【other】的项合并到自身
|
|
1011
|
+
* @param other
|
|
1715
1012
|
*/
|
|
1716
|
-
|
|
1013
|
+
pushList(other: List<T>): void;
|
|
1014
|
+
getData(): T[];
|
|
1015
|
+
resetData(val: T[]): void;
|
|
1717
1016
|
/**
|
|
1718
|
-
*
|
|
1719
|
-
* @param
|
|
1017
|
+
* 随机获取【count】个项,并返回【target】对象
|
|
1018
|
+
* @param count
|
|
1019
|
+
* @param enableRepeat 允许重复
|
|
1020
|
+
* @param target
|
|
1720
1021
|
*/
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
protected
|
|
1022
|
+
random(count: number, enableRepeat?: boolean, target?: List<T>): List<T>;
|
|
1023
|
+
protected callPush(value: any): void;
|
|
1024
|
+
protected callRemove(value: any): void;
|
|
1025
|
+
protected _data: any[];
|
|
1026
|
+
private _onSet;
|
|
1027
|
+
private _onDelete;
|
|
1028
|
+
private _onSetCaller;
|
|
1029
|
+
private _onDeleteCaller;
|
|
1725
1030
|
}
|
|
1726
1031
|
|
|
1727
|
-
|
|
1728
|
-
* 点击目标区域后触发事件
|
|
1729
|
-
*/
|
|
1730
|
-
declare class ClickEvent extends TriggerEvent {
|
|
1731
|
-
get target(): Node;
|
|
1732
|
-
static create(target: Node, rangeOut?: boolean): ClickEvent;
|
|
1733
|
-
get position(): Vec2;
|
|
1734
|
-
private _target;
|
|
1735
|
-
protected _openTime: number;
|
|
1736
|
-
protected _rangeOut: boolean;
|
|
1737
|
-
private _position;
|
|
1738
|
-
private _isButton;
|
|
1032
|
+
declare class UIObjectDict extends Dictionary<string, any | List> {
|
|
1739
1033
|
/**
|
|
1740
|
-
*
|
|
1741
|
-
* @param
|
|
1742
|
-
* @param rangeOut 点击除去目标的区域时触发
|
|
1034
|
+
* 获取唯一的
|
|
1035
|
+
* @param prefab
|
|
1743
1036
|
*/
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
1747
|
-
|
|
1748
|
-
|
|
1749
|
-
offTarget(): void;
|
|
1750
|
-
onCanvas(): void;
|
|
1751
|
-
offCanvas(): void;
|
|
1752
|
-
protected onTargetDestroyedHandler(): void;
|
|
1753
|
-
protected _parentChanged(): void;
|
|
1754
|
-
protected onCanvasTouchEndHandler(evt: EventTouch): void;
|
|
1755
|
-
protected onCanvasMouseDownHandler(evt: EventMouse): void;
|
|
1756
|
-
protected hitTest(loc: Vec2): void;
|
|
1757
|
-
protected onMouseDownHandler(e: EventMouse): void;
|
|
1758
|
-
protected onMouseUpHandler(e: EventMouse): void;
|
|
1759
|
-
protected onTouchStartHandler(e: EventTouch): void;
|
|
1760
|
-
protected onTouchEndHandler(e: EventTouch): void;
|
|
1761
|
-
protected setLastEventMouse(e: EventMouse): void;
|
|
1762
|
-
get lastEventMouse(): EventMouse;
|
|
1763
|
-
protected _lastEventMouse: EventMouse;
|
|
1764
|
-
protected setLastEventTouch(e: EventTouch): void;
|
|
1765
|
-
get lastEventTouch(): EventTouch;
|
|
1766
|
-
protected _lastEventTouch: EventTouch;
|
|
1767
|
-
get lastLocation(): Vec2;
|
|
1768
|
-
protected _lastLocation: Vec2;
|
|
1769
|
-
protected _downTarget: any;
|
|
1770
|
-
get lastTarget(): Node;
|
|
1771
|
-
protected _lastTarget: Node;
|
|
1772
|
-
get canvas(): Node;
|
|
1773
|
-
private _canvas;
|
|
1774
|
-
}
|
|
1775
|
-
|
|
1776
|
-
/**
|
|
1777
|
-
* 事件触发器
|
|
1778
|
-
* 注意: 列表项中监听全局的事件容易导致所有项都进行了监听.
|
|
1779
|
-
*/
|
|
1780
|
-
|
|
1781
|
-
/**
|
|
1782
|
-
* 触发器-事件派发器
|
|
1783
|
-
*/
|
|
1784
|
-
declare class NodeEvent extends TriggerEvent {
|
|
1785
|
-
dispatcher: Node;
|
|
1786
|
-
event: string;
|
|
1787
|
-
static create(dispatcher: Node, event: string): NodeEvent;
|
|
1788
|
-
args: any[];
|
|
1789
|
-
constructor(dispatcher: Node, event: string);
|
|
1790
|
-
enable(): void;
|
|
1791
|
-
protected onHandler(...args: any): void;
|
|
1792
|
-
disable(): void;
|
|
1793
|
-
dispose(): void;
|
|
1794
|
-
protected onTargetDestroyedHandler(): void;
|
|
1037
|
+
uniqueObject(prefab: Prefab): Node;
|
|
1038
|
+
removeObject(prefab: Prefab): void;
|
|
1039
|
+
popObject(prefab: Prefab): any;
|
|
1040
|
+
backObject(object: Node): void;
|
|
1041
|
+
protected getList(key: any): List;
|
|
1795
1042
|
}
|
|
1043
|
+
declare var uidict: UIObjectDict;
|
|
1796
1044
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1045
|
+
declare class ViewController extends Component {
|
|
1046
|
+
constructor(name: string);
|
|
1047
|
+
open(...args: any[]): void;
|
|
1048
|
+
close(): void;
|
|
1049
|
+
get objectDict(): UIObjectDict;
|
|
1050
|
+
protected _objectDict: UIObjectDict;
|
|
1801
1051
|
}
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
*/
|
|
1806
|
-
declare class ResponseEvent extends TriggerEvent {
|
|
1807
|
-
static create(msgName: string, sub?: ResponseSub): ResponseEvent;
|
|
1808
|
-
sub: ResponseSub;
|
|
1809
|
-
msgName: string;
|
|
1810
|
-
constructor(msgName: string, sub?: ResponseSub);
|
|
1811
|
-
protected get listener(): IEventManager;
|
|
1812
|
-
enable(): void;
|
|
1813
|
-
disable(): void;
|
|
1814
|
-
dispose(): void;
|
|
1815
|
-
protected onHandler(event: XEvent): void;
|
|
1052
|
+
declare class ControllerDict extends Dictionary<string, ViewController> {
|
|
1053
|
+
getByName(name: string): ViewController;
|
|
1054
|
+
register(controller: ViewController): void;
|
|
1816
1055
|
}
|
|
1056
|
+
declare var ctrlrepo: ControllerDict;
|
|
1817
1057
|
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
protected
|
|
1825
|
-
protected
|
|
1826
|
-
protected
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1058
|
+
declare class PageController extends ViewController {
|
|
1059
|
+
constructor(routeName: string, config?: {
|
|
1060
|
+
layer?: string;
|
|
1061
|
+
tags?: string[];
|
|
1062
|
+
enableHistory?: boolean;
|
|
1063
|
+
});
|
|
1064
|
+
protected onOpening(page: Page): void;
|
|
1065
|
+
protected onOpened(page: Page): void;
|
|
1066
|
+
protected onClosing(page: Page): void;
|
|
1067
|
+
protected onClosed(page: Page): void;
|
|
1068
|
+
protected onRefresh(page: Page): void;
|
|
1069
|
+
openByRoute(route: Route): Page;
|
|
1070
|
+
private openPage;
|
|
1071
|
+
openComplete(page: Page): void;
|
|
1072
|
+
closeByRoute(route?: Route): Page;
|
|
1073
|
+
private closePage;
|
|
1074
|
+
closeComplete(page: Page): void;
|
|
1075
|
+
refresh(): void;
|
|
1076
|
+
get layer(): string;
|
|
1077
|
+
hasTags(tags: string[]): boolean;
|
|
1078
|
+
setLayer(name: string): this;
|
|
1079
|
+
setTags(tags: string[]): this;
|
|
1080
|
+
get lastPage(): Page;
|
|
1081
|
+
get route(): Route;
|
|
1082
|
+
get enableHistory(): boolean;
|
|
1083
|
+
protected _enableHistory: boolean;
|
|
1084
|
+
protected _route: Route;
|
|
1085
|
+
protected _lastPage: Page;
|
|
1086
|
+
protected _tags: {};
|
|
1087
|
+
protected _layer: string;
|
|
1832
1088
|
}
|
|
1833
1089
|
|
|
1834
|
-
declare
|
|
1835
|
-
break(): void;
|
|
1836
|
-
isBreak(): boolean;
|
|
1837
|
-
protected _isBreak: any;
|
|
1838
|
-
}
|
|
1839
|
-
interface ITreeListItem {
|
|
1090
|
+
declare enum PageState {
|
|
1840
1091
|
/**
|
|
1841
|
-
*
|
|
1092
|
+
* 关闭
|
|
1842
1093
|
*/
|
|
1843
|
-
|
|
1094
|
+
Closed = 0,
|
|
1844
1095
|
/**
|
|
1845
|
-
*
|
|
1096
|
+
* 正在打开
|
|
1846
1097
|
*/
|
|
1847
|
-
|
|
1098
|
+
Opening = 1,
|
|
1848
1099
|
/**
|
|
1849
|
-
*
|
|
1100
|
+
* 已打开
|
|
1850
1101
|
*/
|
|
1851
|
-
|
|
1852
|
-
[key: string]: any;
|
|
1853
|
-
};
|
|
1102
|
+
Opened = 2,
|
|
1854
1103
|
/**
|
|
1855
|
-
*
|
|
1104
|
+
* 正在关闭
|
|
1856
1105
|
*/
|
|
1857
|
-
|
|
1106
|
+
Closeing = 3
|
|
1858
1107
|
}
|
|
1859
|
-
declare
|
|
1860
|
-
|
|
1108
|
+
declare enum PageEvent {
|
|
1109
|
+
Opening = "opening",
|
|
1110
|
+
Opened = "opened",
|
|
1111
|
+
Closeing = "closeing",
|
|
1112
|
+
Closed = "closed",
|
|
1113
|
+
Stop = "stop"
|
|
1114
|
+
}
|
|
1115
|
+
declare class Page extends EventManager {
|
|
1116
|
+
constructor(controller: PageController, route: Route);
|
|
1861
1117
|
/**
|
|
1862
|
-
*
|
|
1118
|
+
* 等待打开完成指令
|
|
1863
1119
|
*/
|
|
1864
|
-
|
|
1120
|
+
waitOpenComplete(): void;
|
|
1121
|
+
waitCloseComplete(): void;
|
|
1122
|
+
openComplete(): void;
|
|
1123
|
+
closeComplete(): void;
|
|
1124
|
+
stop(reason: LinkError): void;
|
|
1865
1125
|
/**
|
|
1866
|
-
*
|
|
1867
|
-
|
|
1868
|
-
uuid: string;
|
|
1869
|
-
/**
|
|
1870
|
-
* 编号
|
|
1871
|
-
*/
|
|
1872
|
-
id: string;
|
|
1873
|
-
/**
|
|
1874
|
-
* 自定义数据
|
|
1875
|
-
*/
|
|
1876
|
-
data: T;
|
|
1877
|
-
/**
|
|
1878
|
-
* 是否树叶
|
|
1879
|
-
*/
|
|
1880
|
-
isLeaf: boolean;
|
|
1881
|
-
/**
|
|
1882
|
-
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
1883
|
-
*/
|
|
1884
|
-
tags: {
|
|
1885
|
-
[key: string]: any;
|
|
1886
|
-
};
|
|
1887
|
-
/**
|
|
1888
|
-
* 深度
|
|
1889
|
-
*/
|
|
1890
|
-
get depth(): number;
|
|
1891
|
-
private _depth;
|
|
1892
|
-
/**
|
|
1893
|
-
* 父节点
|
|
1894
|
-
*/
|
|
1895
|
-
parent: TreeNode;
|
|
1896
|
-
/**
|
|
1897
|
-
* 子节点
|
|
1898
|
-
*/
|
|
1899
|
-
children: TreeNode[];
|
|
1900
|
-
/**
|
|
1901
|
-
* 设置根
|
|
1902
|
-
* @param val
|
|
1903
|
-
*/
|
|
1904
|
-
setRoot(val: TreeRoot): void;
|
|
1905
|
-
getTags(): {
|
|
1906
|
-
[key: string]: any;
|
|
1907
|
-
};
|
|
1908
|
-
getTag(name: string): any;
|
|
1909
|
-
removeTag(name: string): void;
|
|
1910
|
-
setTag(name: string, value: any): void;
|
|
1911
|
-
constructor(id: string, isLeaf?: boolean);
|
|
1912
|
-
addChild(val: TreeNode): void;
|
|
1913
|
-
getChildIndex(val: TreeNode): number;
|
|
1914
|
-
insertChild(val: TreeNode, index: number): void;
|
|
1915
|
-
removeChild(val: TreeNode): void;
|
|
1916
|
-
removeChildren(): void;
|
|
1917
|
-
get name(): string;
|
|
1918
|
-
setDepth(val: number): void;
|
|
1919
|
-
containsById(id: string): boolean;
|
|
1920
|
-
/**
|
|
1921
|
-
* 通过编号获取子节点
|
|
1922
|
-
* @param id
|
|
1923
|
-
*/
|
|
1924
|
-
getChildById(id: string): TreeNode;
|
|
1925
|
-
/**
|
|
1926
|
-
* 返回相邻的上一个节点
|
|
1927
|
-
*/
|
|
1928
|
-
prevNode(): TreeNode;
|
|
1929
|
-
/**
|
|
1930
|
-
* 返回相邻的下一个节点
|
|
1931
|
-
*/
|
|
1932
|
-
nextNode(): TreeNode;
|
|
1933
|
-
/**
|
|
1934
|
-
* 如果返回true则删除节点,包含当前节点
|
|
1935
|
-
* @param f
|
|
1936
|
-
*/
|
|
1937
|
-
walkRemove(f: (node: TreeNode) => boolean): void;
|
|
1938
|
-
private _walkRemove;
|
|
1939
|
-
/**
|
|
1940
|
-
* 如果返回true则继续,包含当前节点
|
|
1941
|
-
* @param f
|
|
1942
|
-
* @param inChild
|
|
1943
|
-
*/
|
|
1944
|
-
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
1945
|
-
private _walk;
|
|
1946
|
-
/**
|
|
1947
|
-
* 从当前节点(包括)遍历父节点链,包含当前节点
|
|
1948
|
-
* @param f
|
|
1949
|
-
*/
|
|
1950
|
-
walkParent(f: (node: TreeNode) => boolean): boolean;
|
|
1951
|
-
/**
|
|
1952
|
-
* 从当前节点往前遍历(深度),包含当前节点
|
|
1953
|
-
* @param f
|
|
1954
|
-
* @param inChild
|
|
1955
|
-
*/
|
|
1956
|
-
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): any;
|
|
1957
|
-
private _walkPrev;
|
|
1958
|
-
dump(): void;
|
|
1959
|
-
/**
|
|
1960
|
-
* 遍历节点,查找指定编号的节点
|
|
1961
|
-
*/
|
|
1962
|
-
findById(id: string): TreeNode;
|
|
1963
|
-
/**
|
|
1964
|
-
* 如果返回true则继续
|
|
1965
|
-
* @param f
|
|
1966
|
-
*/
|
|
1967
|
-
findOne(f: (node: TreeNode) => boolean): TreeNode;
|
|
1968
|
-
private _findOne;
|
|
1969
|
-
/**
|
|
1970
|
-
* 通过路径获取节点
|
|
1971
|
-
* 格式为 /path1/path2/...
|
|
1972
|
-
* 如果 path == "/",则返回自身
|
|
1973
|
-
* @param path
|
|
1974
|
-
*/
|
|
1975
|
-
getNodeByPath(path: string): TreeNode;
|
|
1976
|
-
protected getNodeByPathArr(pathArr: string[]): TreeNode;
|
|
1977
|
-
getName(): string;
|
|
1978
|
-
getPath(): string;
|
|
1979
|
-
/**
|
|
1980
|
-
* 如果返回true则继续
|
|
1981
|
-
* @param f
|
|
1982
|
-
*/
|
|
1983
|
-
find(f: (node: TreeNode) => boolean): TreeNode[];
|
|
1984
|
-
private _find;
|
|
1985
|
-
toRoot(): TreeRoot;
|
|
1986
|
-
clone(): TreeNode;
|
|
1987
|
-
protected cloneChildrenTo(node: TreeNode): void;
|
|
1988
|
-
fixDepthAndRoot(depth: number, root: TreeRoot): void;
|
|
1989
|
-
toString(): string;
|
|
1990
|
-
}
|
|
1991
|
-
declare class TreeRoot<NODE = any> extends EventManager {
|
|
1992
|
-
/**
|
|
1993
|
-
* 添加数据节点
|
|
1994
|
-
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
1995
|
-
*/
|
|
1996
|
-
static EVENT_ADD: string;
|
|
1997
|
-
/**
|
|
1998
|
-
* 移除数据节点
|
|
1999
|
-
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
2000
|
-
*/
|
|
2001
|
-
static EVENT_REMOVE: string;
|
|
2002
|
-
/**
|
|
2003
|
-
* 插入数据节点
|
|
2004
|
-
* dispatchParams = {node:TreeNode, before:TreeNode}
|
|
2005
|
-
*/
|
|
2006
|
-
static EVENT_INSERT: string;
|
|
2007
|
-
/**
|
|
2008
|
-
* 刷新数据节点
|
|
2009
|
-
* dispatchParams = {node:TreeNode}
|
|
2010
|
-
*/
|
|
2011
|
-
static EVENT_REFRESH: string;
|
|
2012
|
-
/**
|
|
2013
|
-
* 设置数据时触发
|
|
2014
|
-
* dispatchParams = {node:TreeNode}
|
|
2015
|
-
*/
|
|
2016
|
-
static EVENT_DATA_SET: string;
|
|
2017
|
-
/**
|
|
2018
|
-
* 设置数据时触发
|
|
2019
|
-
* dispatchParams = {node:TreeNode, tag:string, value:any}
|
|
2020
|
-
*/
|
|
2021
|
-
static EVENT_TAGS_SET: string;
|
|
2022
|
-
static create(): TreeRoot<any>;
|
|
2023
|
-
/**
|
|
2024
|
-
* 通过列表生成一个树结构
|
|
2025
|
-
* @param items
|
|
2026
|
-
* @param existed 列表将添加的已经存在的树结构
|
|
2027
|
-
*/
|
|
2028
|
-
static createByList(items: ITreeListItem[], existed?: TreeRoot): TreeRoot;
|
|
2029
|
-
static sortChildrenByName(node: TreeNode, des?: boolean): void;
|
|
2030
|
-
constructor();
|
|
2031
|
-
setNodeData(node: TreeNode, data: any): void;
|
|
2032
|
-
setNodeTags(node: TreeNode, tag: string, value: any, force?: boolean): void;
|
|
2033
|
-
getNodeByPath(path: string): TreeNode;
|
|
2034
|
-
makeNodeByPath(path: string): TreeNode;
|
|
2035
|
-
/**
|
|
2036
|
-
* 添加节点,按照 node.path 添加到正确的位置
|
|
2037
|
-
* @param node
|
|
2038
|
-
* @param parentPath 如果父节点路径为 "", 则添加到起源节点
|
|
2039
|
-
* @param autoCreateParent 如果父节点不存在,自动创建
|
|
2040
|
-
*/
|
|
2041
|
-
addNode(node: TreeNode, parentPath?: string, autoCreateParent?: boolean): void;
|
|
2042
|
-
removeNode(node: TreeNode): void;
|
|
2043
|
-
removeChildren(node: TreeNode): void;
|
|
2044
|
-
insertNode(node: TreeNode, before: TreeNode, resetId?: boolean): void;
|
|
2045
|
-
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
2046
|
-
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
2047
|
-
/**
|
|
2048
|
-
* 派发 refresh 消息
|
|
2049
|
-
* @param node
|
|
2050
|
-
*/
|
|
2051
|
-
refresh(node: TreeNode): void;
|
|
2052
|
-
/**
|
|
2053
|
-
* 克隆当前的树结
|
|
2054
|
-
* * 新的tags克隆旧的data
|
|
2055
|
-
* * 新的data指向旧的data
|
|
1126
|
+
* 等待发送的结果
|
|
1127
|
+
* 如果返回 null,表示主动取消 [cancel]
|
|
2056
1128
|
*/
|
|
2057
|
-
|
|
1129
|
+
wait(): Promise<this>;
|
|
2058
1130
|
toString(): string;
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
get
|
|
2064
|
-
|
|
2065
|
-
}
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
data?: any;
|
|
2082
|
-
/**
|
|
2083
|
-
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
2084
|
-
*/
|
|
2085
|
-
tags?: {
|
|
2086
|
-
[key: string]: any;
|
|
2087
|
-
};
|
|
2088
|
-
}
|
|
2089
|
-
declare class ListNode {
|
|
2090
|
-
static create(id: string, data?: any): ListNode;
|
|
2091
|
-
constructor();
|
|
2092
|
-
root: ListSource;
|
|
2093
|
-
uuid: string;
|
|
2094
|
-
id: string;
|
|
2095
|
-
data: any;
|
|
2096
|
-
tags: {};
|
|
2097
|
-
getTags(): {
|
|
2098
|
-
[key: string]: any;
|
|
2099
|
-
};
|
|
2100
|
-
setTags(tags: {
|
|
2101
|
-
[key: string]: any;
|
|
2102
|
-
}): void;
|
|
2103
|
-
getTag(name: string): any;
|
|
2104
|
-
setTag(name: string, value: any): void;
|
|
2105
|
-
}
|
|
2106
|
-
declare class ListSource extends EventManager {
|
|
2107
|
-
/**
|
|
2108
|
-
* 通过数组创建 ListSource。ListSource的id自动生成。如果需要指定编号,可设置 idCreator
|
|
2109
|
-
* @param arr
|
|
2110
|
-
* @param idCreator
|
|
2111
|
-
*/
|
|
2112
|
-
static createByArray(arr: any[], idCreator?: (item: any) => string): ListSource;
|
|
2113
|
-
static createByListItem(arr: IListItem[], target?: ListSource): any;
|
|
2114
|
-
/**
|
|
2115
|
-
* 设置数据时触发
|
|
2116
|
-
* dispatchParams = {node:ListNode}
|
|
2117
|
-
*/
|
|
2118
|
-
static EVENT_ADD: string;
|
|
2119
|
-
/**
|
|
2120
|
-
* 设置数据时触发
|
|
2121
|
-
* dispatchParams = {node:ListNode, index:number}
|
|
2122
|
-
*/
|
|
2123
|
-
static EVENT_REMOVE: string;
|
|
2124
|
-
/**
|
|
2125
|
-
* 设置数据时触发
|
|
2126
|
-
*/
|
|
2127
|
-
static EVENT_REMOVE_ALL: string;
|
|
2128
|
-
/**
|
|
2129
|
-
* 刷新数据节点
|
|
2130
|
-
* dispatchParams = {node:ListNode}
|
|
2131
|
-
*/
|
|
2132
|
-
static EVENT_REFRESH: string;
|
|
2133
|
-
/**
|
|
2134
|
-
* 设置数据时触发
|
|
2135
|
-
* dispatchParams = nodes: [ListNode], indexs: [number]
|
|
2136
|
-
*/
|
|
2137
|
-
static EVENT_SWAP: string;
|
|
2138
|
-
/**
|
|
2139
|
-
* 设置数据时触发
|
|
2140
|
-
* dispatchParams = {node:ListNode, data:any}
|
|
2141
|
-
*/
|
|
2142
|
-
static EVENT_DATA_SET: string;
|
|
2143
|
-
/**
|
|
2144
|
-
* 设置数据时触发
|
|
2145
|
-
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
2146
|
-
*/
|
|
2147
|
-
static EVENT_TAGS_SET: string;
|
|
2148
|
-
protected _identFunc: (node: ListNode) => boolean;
|
|
2149
|
-
at(index: number): ListNode;
|
|
2150
|
-
first(): ListNode;
|
|
2151
|
-
last(): ListNode;
|
|
2152
|
-
length(): number;
|
|
2153
|
-
/**
|
|
2154
|
-
* 添加项,无法添加相同的项
|
|
2155
|
-
* @param node
|
|
2156
|
-
* @param enableDispatch 默认为true
|
|
2157
|
-
*/
|
|
2158
|
-
add(node: ListNode, enableDispatch?: boolean): void;
|
|
2159
|
-
getById(id: string): ListNode;
|
|
2160
|
-
remove(node: ListNode): void;
|
|
2161
|
-
removeAll(): void;
|
|
2162
|
-
swap(a: ListNode, b: ListNode): void;
|
|
2163
|
-
contains(node: ListNode): boolean;
|
|
2164
|
-
containsById(id: string): boolean;
|
|
2165
|
-
indexOf(node: ListNode): number;
|
|
2166
|
-
indexOfById(id: string): number;
|
|
2167
|
-
setData(node: ListNode, data: any): void;
|
|
2168
|
-
setNodeTags(node: ListNode, tag: string, value: any): void;
|
|
2169
|
-
/**
|
|
2170
|
-
* 派发 refresh 消息
|
|
2171
|
-
* @param node
|
|
2172
|
-
*/
|
|
2173
|
-
refresh(node: ListNode): void;
|
|
2174
|
-
walk(f: (node: ListNode) => boolean): boolean;
|
|
2175
|
-
walkPrev(node: ListNode, f: (node: ListNode) => boolean): boolean;
|
|
2176
|
-
get data(): any[];
|
|
2177
|
-
private _data;
|
|
2178
|
-
}
|
|
2179
|
-
|
|
2180
|
-
declare class DictNode {
|
|
2181
|
-
static create(id: string, data?: any): DictNode;
|
|
2182
|
-
constructor();
|
|
2183
|
-
uuid: string;
|
|
2184
|
-
id: string;
|
|
2185
|
-
data: any;
|
|
2186
|
-
tags: {};
|
|
2187
|
-
getTags(): {
|
|
2188
|
-
[key: string]: any;
|
|
2189
|
-
};
|
|
2190
|
-
getTag(name: string): any;
|
|
2191
|
-
setTag(name: string, value: any): void;
|
|
2192
|
-
/**
|
|
2193
|
-
* 清理【data】和【tags】
|
|
2194
|
-
*/
|
|
2195
|
-
clean(): void;
|
|
2196
|
-
}
|
|
2197
|
-
declare class DictSource extends Dictionary<string, DictNode> {
|
|
2198
|
-
/**
|
|
2199
|
-
* 刷新数据节点
|
|
2200
|
-
* dispatchParams = {node:ListNode}
|
|
2201
|
-
*/
|
|
2202
|
-
static EVENT_REFRESH: string;
|
|
2203
|
-
/**
|
|
2204
|
-
* 设置数据时触发
|
|
2205
|
-
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
2206
|
-
*/
|
|
2207
|
-
static EVENT_TAGS_SET: string;
|
|
2208
|
-
setNodeTags(node: DictNode, tag: string, value: any): void;
|
|
2209
|
-
refreshNode(node: DictNode): void;
|
|
2210
|
-
get dispatcher(): EventManager;
|
|
2211
|
-
protected _dispatcher: EventManager;
|
|
2212
|
-
}
|
|
2213
|
-
|
|
2214
|
-
interface IDecl {
|
|
2215
|
-
Name: string;
|
|
2216
|
-
Namespace: string;
|
|
2217
|
-
Tags: any;
|
|
2218
|
-
Alias: string;
|
|
2219
|
-
}
|
|
2220
|
-
declare class EnumDecl implements IDecl {
|
|
2221
|
-
Name: string;
|
|
2222
|
-
Kind: Kind;
|
|
2223
|
-
Value: string;
|
|
2224
|
-
Fields: Field[];
|
|
2225
|
-
constructor(Name?: string, Kind?: Kind, Value?: string, Fields?: Field[]);
|
|
2226
|
-
firstValue(): number;
|
|
2227
|
-
NameToValue(name: string): any;
|
|
2228
|
-
ValueToName(value: any): string;
|
|
2229
|
-
GetAllField(): Field[];
|
|
2230
|
-
Alias: string;
|
|
2231
|
-
Namespace: string;
|
|
2232
|
-
Tags: any;
|
|
2233
|
-
Comments: string[];
|
|
2234
|
-
}
|
|
2235
|
-
declare class ClassDecl implements IDecl {
|
|
2236
|
-
Name: string;
|
|
2237
|
-
Parent: string;
|
|
2238
|
-
Fields: Field[];
|
|
2239
|
-
constructor(Name?: string, Parent?: string, Fields?: Field[], tags?: any);
|
|
2240
|
-
getIdent(): string;
|
|
2241
|
-
get Alias(): string;
|
|
2242
|
-
getParent(): ClassDecl;
|
|
2243
|
-
getField(name: string): Field;
|
|
2244
|
-
walkField(handler: (field: Field) => void): void;
|
|
2245
|
-
protected _lastObject: any;
|
|
2246
|
-
/**
|
|
2247
|
-
* @param f
|
|
2248
|
-
* @param sourceObject
|
|
2249
|
-
*/
|
|
2250
|
-
walkFieldType(f: (field: Field, type: IType, obj?: {} | undefined, value?: any) => void, sourceObject?: any): void;
|
|
2251
|
-
protected _walkFieldType(f: (field: Field, type: IType, obj?: {} | undefined, value?: any) => void, sourceObject: any): void;
|
|
2252
|
-
Namespace: string;
|
|
2253
|
-
Tags: any;
|
|
2254
|
-
Comments: string[];
|
|
2255
|
-
}
|
|
2256
|
-
|
|
2257
|
-
declare class Field {
|
|
2258
|
-
Name: string;
|
|
2259
|
-
Type: IType;
|
|
2260
|
-
Value: string;
|
|
2261
|
-
Tags: any;
|
|
2262
|
-
/**
|
|
2263
|
-
* 如果Type=ClassType, 可通过设置{}建立新对象, 否则默认为nil
|
|
2264
|
-
* 如果Type=MapType, 可通过设置{}建立新对象, 否则默认为nil
|
|
2265
|
-
* 如果Type=BasicType/EnumType, Value为初始值
|
|
2266
|
-
* Value: string = "";
|
|
2267
|
-
* @param Name
|
|
2268
|
-
* @param Type
|
|
2269
|
-
* @param Value
|
|
2270
|
-
* @param Tags
|
|
2271
|
-
*/
|
|
2272
|
-
constructor(Name?: string, Type?: IType, Value?: string, Tags?: any);
|
|
2273
|
-
getTag(name: string): string;
|
|
2274
|
-
convertToJsonValue(dataValue: any): any;
|
|
2275
|
-
/**
|
|
2276
|
-
* 默认值
|
|
2277
|
-
* 获取转化后的Field.Value
|
|
2278
|
-
*/
|
|
2279
|
-
getValue(): any;
|
|
2280
|
-
/**
|
|
2281
|
-
*
|
|
2282
|
-
*/
|
|
2283
|
-
getValueBasicKind(): Kind;
|
|
2284
|
-
Comments: string[];
|
|
2285
|
-
decl: IDecl;
|
|
2286
|
-
}
|
|
2287
|
-
|
|
2288
|
-
interface IType {
|
|
2289
|
-
name: TypeName;
|
|
2290
|
-
}
|
|
2291
|
-
declare enum TypeName {
|
|
2292
|
-
/**
|
|
2293
|
-
* {_type:TypeName.Class, Decl:"类型声明的编号"}
|
|
2294
|
-
*/
|
|
2295
|
-
Class = "class",
|
|
2296
|
-
Func = "func",
|
|
2297
|
-
/**
|
|
2298
|
-
* {_type: TypeName.Map, Key: {_type:TypeName.Basic,Kind: Kind.String}, Value:{_type:TypeName.Basic,Kind: Kind.String}}
|
|
2299
|
-
*/
|
|
2300
|
-
Map = "map",
|
|
2301
|
-
/**
|
|
2302
|
-
* {_type:TypeName.Enum, Decl:"枚举声明的编号"}
|
|
2303
|
-
*/
|
|
2304
|
-
Enum = "enum",
|
|
2305
|
-
/**
|
|
2306
|
-
* {_type: TypeName.Array, Elem: {_type:TypeName.Basic,Kind: Kind.String}}
|
|
2307
|
-
*/
|
|
2308
|
-
Array = "array",
|
|
2309
|
-
/**
|
|
2310
|
-
* {_type:TypeName.Basic,Kind: Kind.String}
|
|
2311
|
-
*/
|
|
2312
|
-
Basic = "basic",
|
|
2313
|
-
Any = "any"
|
|
2314
|
-
}
|
|
2315
|
-
declare class MapType {
|
|
2316
|
-
Key: IType;
|
|
2317
|
-
Value: IType;
|
|
2318
|
-
name: TypeName;
|
|
2319
|
-
constructor(Key?: IType, Value?: IType);
|
|
2320
|
-
}
|
|
2321
|
-
declare class ClassType {
|
|
2322
|
-
Decl: string;
|
|
2323
|
-
name: TypeName;
|
|
2324
|
-
constructor(Decl?: string);
|
|
2325
|
-
}
|
|
2326
|
-
declare class EnumType {
|
|
2327
|
-
Decl: string;
|
|
2328
|
-
name: TypeName;
|
|
2329
|
-
constructor(Decl?: string);
|
|
2330
|
-
}
|
|
2331
|
-
declare class ArrayType {
|
|
2332
|
-
Elem: IType;
|
|
2333
|
-
name: TypeName;
|
|
2334
|
-
constructor(Elem?: IType);
|
|
2335
|
-
}
|
|
2336
|
-
declare class BasicType {
|
|
2337
|
-
Kind: Kind;
|
|
2338
|
-
name: TypeName;
|
|
2339
|
-
constructor(Kind?: Kind);
|
|
2340
|
-
}
|
|
2341
|
-
declare class AnyType {
|
|
2342
|
-
name: TypeName;
|
|
2343
|
-
constructor();
|
|
2344
|
-
}
|
|
2345
|
-
declare enum Kind {
|
|
2346
|
-
Invalid = 0,
|
|
2347
|
-
Bool = 1,
|
|
2348
|
-
Int8 = 2,
|
|
2349
|
-
Int16 = 3,
|
|
2350
|
-
Int32 = 4,
|
|
2351
|
-
Int64 = 5,
|
|
2352
|
-
Uint8 = 6,
|
|
2353
|
-
Uint16 = 7,
|
|
2354
|
-
Uint32 = 8,
|
|
2355
|
-
Uint64 = 9,
|
|
2356
|
-
Float32 = 10,
|
|
2357
|
-
Float64 = 11,
|
|
2358
|
-
String = 12,
|
|
2359
|
-
Bytes = 13
|
|
2360
|
-
}
|
|
2361
|
-
|
|
2362
|
-
declare function setClassCreator(key: string, creator: (data: any) => ICacheObject): void;
|
|
2363
|
-
declare function getClassCreator(key: string): (data: any) => ICacheObject;
|
|
2364
|
-
declare function newCacheObject(data: any): ICacheObject;
|
|
2365
|
-
declare function newObjectByType(obj: CacheObject, objectType: IType, data: any): ICacheObject;
|
|
2366
|
-
declare enum CacheModifyMode {
|
|
2367
|
-
修正结构 = 0,
|
|
2368
|
-
修正字典 = 1
|
|
2369
|
-
}
|
|
2370
|
-
declare class ModifyField {
|
|
2371
|
-
modify: IModify;
|
|
2372
|
-
modifyFieldOrItemType: number;
|
|
2373
|
-
modifyFieldOrItemSchema: IType;
|
|
2374
|
-
}
|
|
2375
|
-
declare class CacheObject extends EventManager implements ICacheObject {
|
|
2376
|
-
static EVENT_CHANGED: string;
|
|
2377
|
-
private data;
|
|
2378
|
-
schema: IType;
|
|
2379
|
-
schemaDecl: ClassDecl;
|
|
2380
|
-
schemaField: Field;
|
|
2381
|
-
classId: string;
|
|
2382
|
-
protected className: string;
|
|
2383
|
-
private versions;
|
|
2384
|
-
protected modifyUsed: boolean;
|
|
2385
|
-
protected modifyMode: CacheModifyMode;
|
|
2386
|
-
protected modifyFieldDict: {
|
|
2387
|
-
[key: string]: ModifyField;
|
|
2388
|
-
};
|
|
2389
|
-
protected modifyMapOrArray: IModify;
|
|
2390
|
-
protected modifyFieldOrItemType: number;
|
|
2391
|
-
protected modifyFieldOrItemschema: IType;
|
|
2392
|
-
protected modifyContext: any;
|
|
2393
|
-
protected modifyItem0: any;
|
|
2394
|
-
refSetClassId(val: string): void;
|
|
2395
|
-
refSetClassName(val: string): void;
|
|
2396
|
-
refClassId(): string;
|
|
2397
|
-
refClassType(): string;
|
|
2398
|
-
refClassName(): string;
|
|
2399
|
-
/**
|
|
2400
|
-
* 打开修正功能后,需要设置上下文,提供给修正函数
|
|
2401
|
-
* @param modifyContext
|
|
2402
|
-
*/
|
|
2403
|
-
refSetContext(modifyContext: any): void;
|
|
2404
|
-
/**
|
|
2405
|
-
* 如果元素为对象,会自动创建一个空的ICacheObject
|
|
2406
|
-
* @param modify
|
|
2407
|
-
*/
|
|
2408
|
-
refModifyMap(modify: IModify): void;
|
|
2409
|
-
/**
|
|
2410
|
-
* 如果字段为对象,会自动创建一个空的ICacheObject
|
|
2411
|
-
* @param modify
|
|
2412
|
-
* @param field
|
|
2413
|
-
*/
|
|
2414
|
-
refModifyClass(modify: IModify, field: string): void;
|
|
2415
|
-
refAnyType(): string;
|
|
2416
|
-
_refGet(field: string): any;
|
|
2417
|
-
refIsChanged(field: string, time: number): boolean;
|
|
2418
|
-
refGetChangedFields(time: number): string[];
|
|
2419
|
-
refGet(field: string): any;
|
|
2420
|
-
refHas(field: string): boolean;
|
|
2421
|
-
refGetUint(field: string): number;
|
|
2422
|
-
refGetInt(field: string): number;
|
|
2423
|
-
refGetBool(field: string): boolean;
|
|
2424
|
-
refGetFloat64(field: string): number;
|
|
2425
|
-
refFloat64(field: string): number;
|
|
2426
|
-
refGetString(field: string): string;
|
|
2427
|
-
refIsObject(field: string): boolean;
|
|
2428
|
-
refGetObject(field: string): ICacheObject;
|
|
2429
|
-
refNew(): this;
|
|
2430
|
-
refNewIfNil(): this;
|
|
2431
|
-
refIsNil(): boolean;
|
|
2432
|
-
refGetArray(field: string): ICacheObject;
|
|
2433
|
-
refReplace(data: {
|
|
2434
|
-
[key: string]: any;
|
|
2435
|
-
}): void;
|
|
2436
|
-
refUpdate(data: {
|
|
2437
|
-
[key: string]: any;
|
|
2438
|
-
}): void;
|
|
2439
|
-
refSet(field: string, val: any): void;
|
|
2440
|
-
_refSet(sdata: {
|
|
2441
|
-
[key: string]: any;
|
|
2442
|
-
}, field: string, fieldVal: any): error;
|
|
2443
|
-
protected createSchemaClass(classTyp: ClassType, fieldVal: any): ICacheObject;
|
|
2444
|
-
protected createClassObject(typ: any, data: any): any;
|
|
2445
|
-
protected createSchemaAny(fieldVal: any): any;
|
|
2446
|
-
refRemove(field: string): void;
|
|
2447
|
-
refSetNil(): this;
|
|
2448
|
-
refLength(): number;
|
|
2449
|
-
refFields(): string[];
|
|
2450
|
-
refNewByMap(data: {
|
|
2451
|
-
[key: string]: any;
|
|
2452
|
-
}): void;
|
|
2453
|
-
refLinkData(target: ICacheObject): void;
|
|
2454
|
-
refGetData(): {
|
|
2455
|
-
[key: string]: any;
|
|
2456
|
-
};
|
|
2457
|
-
toMap(): {
|
|
2458
|
-
[key: string]: any;
|
|
2459
|
-
};
|
|
2460
|
-
toList(): any[];
|
|
2461
|
-
toMapByField(fieldMap: {
|
|
2462
|
-
[key: string]: any;
|
|
2463
|
-
}): {
|
|
2464
|
-
[key: string]: any;
|
|
2465
|
-
};
|
|
2466
|
-
_toMapByField(fieldMap: {
|
|
2467
|
-
[key: string]: any;
|
|
2468
|
-
}, toMap: {
|
|
2469
|
-
[key: string]: any;
|
|
2470
|
-
}): void;
|
|
2471
|
-
refSetObject(field: string, val: ICacheObject): void;
|
|
2472
|
-
}
|
|
2473
|
-
|
|
2474
|
-
declare namespace cachex {
|
|
2475
|
-
function getObjectByPath(object: ICacheObject, path: string): ICacheObject;
|
|
2476
|
-
function getObjectFieldByPath(object: ICacheObject, path: string): [ICacheObject, string];
|
|
2477
|
-
function getFieldByPath(object: ICacheObject, path: string): any;
|
|
2478
|
-
function contains(obj: ICacheObject, value: any): boolean;
|
|
2479
|
-
}
|
|
2480
|
-
|
|
2481
|
-
interface IModify {
|
|
2482
|
-
/**
|
|
2483
|
-
* 修正是否生效
|
|
2484
|
-
* @param ctx
|
|
2485
|
-
* @param field
|
|
2486
|
-
*/
|
|
2487
|
-
valid(ctx: any, field: string): boolean;
|
|
2488
|
-
/**
|
|
2489
|
-
* 返回修正后的值
|
|
2490
|
-
* @param ctx
|
|
2491
|
-
* @param field
|
|
2492
|
-
* @param origin
|
|
2493
|
-
* @param item0 用于数组,配置文件中,数组的第一个元素,通常作为修正的基础模版
|
|
2494
|
-
*/
|
|
2495
|
-
value(ctx: any, field: string, origin: any, item0?: any): any;
|
|
2496
|
-
/**
|
|
2497
|
-
* 返回修正后的长度
|
|
2498
|
-
* 用于数组类型
|
|
2499
|
-
* @param ctx
|
|
2500
|
-
* @param origin
|
|
2501
|
-
*/
|
|
2502
|
-
length(ctx: any, origin: number): number;
|
|
2503
|
-
}
|
|
2504
|
-
interface ICacheObject {
|
|
2505
|
-
refSetClassId(classId: string): any;
|
|
2506
|
-
refSetClassName(className: string): any;
|
|
2507
|
-
refClassId(): string;
|
|
2508
|
-
refClassType(): string;
|
|
2509
|
-
refClassName(): string;
|
|
2510
|
-
refSetContext(modifyContext: any): any;
|
|
2511
|
-
refModifyMap(modify: IModify): any;
|
|
2512
|
-
refModifyClass(modify: IModify, field: string): any;
|
|
2513
|
-
/**
|
|
2514
|
-
* 当类型为any时,获取【_type】的值
|
|
2515
|
-
*/
|
|
2516
|
-
refAnyType(): any;
|
|
2517
|
-
refGet(field: string): any;
|
|
2518
|
-
refGetUint(field: string): number;
|
|
2519
|
-
refGetInt(field: string): number;
|
|
2520
|
-
refGetFloat64(field: string): number;
|
|
2521
|
-
refGetString(field: string): string;
|
|
2522
|
-
refGetBool(field: string): boolean;
|
|
2523
|
-
refGetObject(field: string): ICacheObject;
|
|
2524
|
-
refGetArray(field: string): ICacheObject;
|
|
2525
|
-
refSet(field: string, val: any): any;
|
|
2526
|
-
refSetObject(field: string, val: ICacheObject): void;
|
|
2527
|
-
refIsObject(field: string): boolean;
|
|
2528
|
-
refHas(field: string): boolean;
|
|
2529
|
-
refIsNil(): boolean;
|
|
2530
|
-
refSetNil(): this;
|
|
2531
|
-
refNewIfNil(): this;
|
|
2532
|
-
refNew(): this;
|
|
2533
|
-
/**
|
|
2534
|
-
* 获取所有字段的名字列表
|
|
2535
|
-
*/
|
|
2536
|
-
refFields(): string[];
|
|
2537
|
-
refGetData(): any;
|
|
2538
|
-
refLinkData(target: ICacheObject): void;
|
|
2539
|
-
toMap(): any;
|
|
2540
|
-
/**
|
|
2541
|
-
* 如果当前对象是数组, 把数据转化成数组
|
|
2542
|
-
*/
|
|
2543
|
-
toList(): any[];
|
|
2544
|
-
toMapByField(fieldMap: any): any;
|
|
2545
|
-
_toMapByField(fieldMap: {
|
|
2546
|
-
[key: string]: any;
|
|
2547
|
-
}, toMap: {
|
|
2548
|
-
[key: string]: any;
|
|
2549
|
-
}): any;
|
|
2550
|
-
refLength(): number;
|
|
2551
|
-
refNewByMap(data: {
|
|
2552
|
-
[key: string]: any;
|
|
2553
|
-
}): void;
|
|
2554
|
-
refUpdate(data: {
|
|
2555
|
-
[key: string]: any;
|
|
2556
|
-
}): void;
|
|
2557
|
-
refReplace(data: {
|
|
2558
|
-
[key: string]: any;
|
|
2559
|
-
}): void;
|
|
2560
|
-
refRemove(field: string): void;
|
|
2561
|
-
}
|
|
2562
|
-
|
|
2563
|
-
interface IDatabase {
|
|
2564
|
-
}
|
|
2565
|
-
interface IDBObject {
|
|
2566
|
-
/**
|
|
2567
|
-
* 返回模型的数据库对象
|
|
2568
|
-
* @constructor
|
|
2569
|
-
*/
|
|
2570
|
-
DBObject(): ICacheObject;
|
|
2571
|
-
DBPath(): string;
|
|
2572
|
-
}
|
|
2573
|
-
interface IDBOnCreate {
|
|
2574
|
-
/**
|
|
2575
|
-
* 当创建完成后
|
|
2576
|
-
*/
|
|
2577
|
-
DBOnCreate(): any;
|
|
2578
|
-
}
|
|
2579
|
-
interface IDBOnUpdate {
|
|
2580
|
-
/**
|
|
2581
|
-
* 当创建完成后
|
|
2582
|
-
*/
|
|
2583
|
-
DBOnUpdate(): any;
|
|
2584
|
-
}
|
|
2585
|
-
interface IDBOnRemove {
|
|
2586
|
-
/**
|
|
2587
|
-
* 当创建完成后
|
|
2588
|
-
*/
|
|
2589
|
-
DBOnRemove(): any;
|
|
2590
|
-
}
|
|
2591
|
-
interface IDBTable {
|
|
2592
|
-
DBCreate(ident: any, data: any): IDBObject;
|
|
2593
|
-
DBGet(key: string): IDBObject;
|
|
2594
|
-
DBSet(key: string, val: IDBObject): any;
|
|
2595
|
-
DBDelete(key: string): any;
|
|
2596
|
-
}
|
|
2597
|
-
/**
|
|
2598
|
-
* event.OnParams的类型
|
|
2599
|
-
*/
|
|
2600
|
-
interface IDBEventDispatchParams {
|
|
2601
|
-
action: DBAction;
|
|
2602
|
-
object: IDBObject;
|
|
2603
|
-
table: IDBTable;
|
|
2604
|
-
/**
|
|
2605
|
-
* 输入的数据
|
|
2606
|
-
*/
|
|
2607
|
-
data: any;
|
|
2608
|
-
}
|
|
2609
|
-
declare enum DBAction {
|
|
2610
|
-
Create = 0,
|
|
2611
|
-
Update = 1,
|
|
2612
|
-
Remove = 2,
|
|
2613
|
-
/**
|
|
2614
|
-
* 主动触发刷新的时间
|
|
2615
|
-
*/
|
|
2616
|
-
Refresh = 3
|
|
2617
|
-
}
|
|
2618
|
-
|
|
2619
|
-
/**
|
|
2620
|
-
* 触发器-缓存中的数据集合
|
|
2621
|
-
*/
|
|
2622
|
-
declare class DBEvent extends TriggerEvent {
|
|
2623
|
-
static create(objectId: string): DBEvent;
|
|
2624
|
-
constructor(objectId: string);
|
|
2625
|
-
enable(): void;
|
|
2626
|
-
disable(): void;
|
|
2627
|
-
dispose(): void;
|
|
2628
|
-
protected onHandler(event: XEvent): void;
|
|
2629
|
-
event: string;
|
|
2630
|
-
eventParams: IDBEventDispatchParams;
|
|
2631
|
-
}
|
|
2632
|
-
|
|
2633
|
-
declare class ControllerSet {
|
|
2634
|
-
constructor(mod: IModule);
|
|
2635
|
-
has(name: string): boolean;
|
|
2636
|
-
add(controller: IController): void;
|
|
2637
|
-
createAndEnable(name: string, ...args: any[]): void;
|
|
2638
|
-
create(name: string, ...args: any[]): void;
|
|
2639
|
-
remove(name: string): void;
|
|
2640
|
-
disable(name: string): void;
|
|
2641
|
-
enable(name: string): void;
|
|
2642
|
-
enableAll(): void;
|
|
2643
|
-
disableAll(): void;
|
|
2644
|
-
dispose(): void;
|
|
2645
|
-
registerCreator(name: string, creator: (...args: any[]) => IController): void;
|
|
2646
|
-
protected _creator: {};
|
|
2647
|
-
protected _mod: IModule;
|
|
2648
|
-
private data;
|
|
2649
|
-
}
|
|
2650
|
-
|
|
2651
|
-
/**
|
|
2652
|
-
* 一个简单的功能/库模块
|
|
2653
|
-
*/
|
|
2654
|
-
interface IModuleSample {
|
|
2655
|
-
}
|
|
2656
|
-
interface IModule {
|
|
2657
|
-
controllers: ControllerSet;
|
|
2658
|
-
}
|
|
2659
|
-
declare class Module extends EventManager implements IModule {
|
|
2660
|
-
constructor();
|
|
2661
|
-
get controllers(): ControllerSet;
|
|
2662
|
-
private _controllers;
|
|
2663
|
-
}
|
|
2664
|
-
|
|
2665
|
-
interface IController {
|
|
2666
|
-
get name(): string;
|
|
2667
|
-
get module(): IModule;
|
|
2668
|
-
init(core: IModule): any;
|
|
2669
|
-
enable(): any;
|
|
2670
|
-
disable(): any;
|
|
2671
|
-
dispose(): any;
|
|
2672
|
-
}
|
|
2673
|
-
declare class Controller {
|
|
2674
|
-
constructor(name: string);
|
|
2675
|
-
init(core: IModule): void;
|
|
2676
|
-
enable(): void;
|
|
2677
|
-
disable(): void;
|
|
2678
|
-
dispose(): void;
|
|
2679
|
-
get name(): string;
|
|
2680
|
-
get module(): IModule;
|
|
2681
|
-
get isEnable(): boolean;
|
|
2682
|
-
protected _module: IModule;
|
|
2683
|
-
protected _name: string;
|
|
2684
|
-
protected _enabled: boolean;
|
|
2685
|
-
}
|
|
2686
|
-
|
|
2687
|
-
interface IModel {
|
|
2688
|
-
get module(): IModule;
|
|
2689
|
-
}
|
|
2690
|
-
declare class SimpleModel {
|
|
2691
|
-
constructor(mod: IModule);
|
|
2692
|
-
get core(): IModule;
|
|
2693
|
-
protected _mod: any;
|
|
2694
|
-
}
|
|
2695
|
-
declare class Model extends EventManager {
|
|
2696
|
-
constructor(core?: IModule);
|
|
2697
|
-
get module(): IModule;
|
|
2698
|
-
protected _module: any;
|
|
2699
|
-
}
|
|
2700
|
-
|
|
2701
|
-
interface IExtend {
|
|
2702
|
-
get module(): IModule;
|
|
2703
|
-
}
|
|
2704
|
-
|
|
2705
|
-
declare class Factory {
|
|
2706
|
-
_controllers: {
|
|
2707
|
-
[key: string]: (mod: IModule) => IController;
|
|
2708
|
-
};
|
|
2709
|
-
_extends: {
|
|
2710
|
-
[key: string]: (mod: IModule, ...args: any) => IExtend;
|
|
2711
|
-
};
|
|
2712
|
-
registerController(name: string, creator: (mod: IModule, ...args: any) => IController): void;
|
|
2713
|
-
registerExtend(name: string, creator: (mod: IModule, ...args: any) => IExtend): void;
|
|
2714
|
-
createController(name: string, mod: IModule): IController;
|
|
2715
|
-
createExtend(name: string, mod: IModule, ...args: any[]): IExtend;
|
|
2716
|
-
}
|
|
2717
|
-
|
|
2718
|
-
/**
|
|
2719
|
-
* 视图的路由值, 保存视图的信息
|
|
2720
|
-
* 规则: path/search
|
|
2721
|
-
* path = /a/b/c
|
|
2722
|
-
* search = ?key=val&key=val
|
|
2723
|
-
*/
|
|
2724
|
-
declare class Route {
|
|
2725
|
-
constructor(route: string);
|
|
2726
|
-
recycle(): void;
|
|
2727
|
-
/**
|
|
2728
|
-
* 获取调用链
|
|
2729
|
-
* 例如 a/b/c,返回 a/b/c -> a/b -> a
|
|
2730
|
-
*/
|
|
2731
|
-
getLink(): Route[];
|
|
2732
|
-
protected static data: any;
|
|
2733
|
-
static getData(route: string): Route;
|
|
2734
|
-
toLoaction(): Location;
|
|
2735
|
-
/**
|
|
2736
|
-
* @constructor
|
|
2737
|
-
*/
|
|
2738
|
-
NewRoute(): Route;
|
|
2739
|
-
/**
|
|
2740
|
-
* @constructor
|
|
2741
|
-
*/
|
|
2742
|
-
NewRoutePath(): Route;
|
|
2743
|
-
/**
|
|
2744
|
-
* 新建一个带参数的路由
|
|
2745
|
-
* @param params
|
|
2746
|
-
*/
|
|
2747
|
-
NewRouteParam(params: any): Route;
|
|
2748
|
-
toString(): string;
|
|
2749
|
-
get path(): string;
|
|
2750
|
-
get parentPath(): string;
|
|
2751
|
-
get params(): any;
|
|
2752
|
-
get search(): string;
|
|
2753
|
-
set search(value: string);
|
|
2754
|
-
get name(): string;
|
|
2755
|
-
/**
|
|
2756
|
-
* path/search
|
|
2757
|
-
*/
|
|
2758
|
-
get key(): string;
|
|
2759
|
-
private _path;
|
|
2760
|
-
private _parentPath;
|
|
2761
|
-
private _search;
|
|
2762
|
-
private _name;
|
|
2763
|
-
private _params;
|
|
2764
|
-
protected _route: string;
|
|
2765
|
-
}
|
|
2766
|
-
|
|
2767
|
-
declare class UIObjectDict extends Dictionary<string, any | List> {
|
|
2768
|
-
/**
|
|
2769
|
-
* 获取唯一的
|
|
2770
|
-
* @param prefab
|
|
2771
|
-
*/
|
|
2772
|
-
uniqueObject(prefab: Prefab): Node;
|
|
2773
|
-
removeObject(prefab: Prefab): void;
|
|
2774
|
-
popObject(prefab: Prefab): any;
|
|
2775
|
-
backObject(object: Node): void;
|
|
2776
|
-
protected getList(key: any): List;
|
|
2777
|
-
}
|
|
2778
|
-
declare var uidict: UIObjectDict;
|
|
2779
|
-
|
|
2780
|
-
declare class ViewController extends Component {
|
|
2781
|
-
constructor(name: string);
|
|
2782
|
-
open(...args: any[]): void;
|
|
2783
|
-
close(): void;
|
|
2784
|
-
get objectDict(): UIObjectDict;
|
|
2785
|
-
protected _objectDict: UIObjectDict;
|
|
2786
|
-
}
|
|
2787
|
-
declare class ControllerDict extends Dictionary<string, ViewController> {
|
|
2788
|
-
getByName(name: string): ViewController;
|
|
2789
|
-
register(controller: ViewController): void;
|
|
2790
|
-
}
|
|
2791
|
-
declare var ctrlrepo: ControllerDict;
|
|
2792
|
-
|
|
2793
|
-
declare class PageController extends ViewController {
|
|
2794
|
-
constructor(routeName: string, config?: {
|
|
2795
|
-
layer?: string;
|
|
2796
|
-
tags?: string[];
|
|
2797
|
-
enableHistory?: boolean;
|
|
2798
|
-
});
|
|
2799
|
-
protected onOpening(page: Page): void;
|
|
2800
|
-
protected onOpened(page: Page): void;
|
|
2801
|
-
protected onClosing(page: Page): void;
|
|
2802
|
-
protected onClosed(page: Page): void;
|
|
2803
|
-
protected onRefresh(page: Page): void;
|
|
2804
|
-
openByRoute(route: Route): Page;
|
|
2805
|
-
private openPage;
|
|
2806
|
-
openComplete(page: Page): void;
|
|
2807
|
-
closeByRoute(route?: Route): Page;
|
|
2808
|
-
private closePage;
|
|
2809
|
-
closeComplete(page: Page): void;
|
|
2810
|
-
refresh(): void;
|
|
2811
|
-
get layer(): string;
|
|
2812
|
-
hasTags(tags: string[]): boolean;
|
|
2813
|
-
setLayer(name: string): this;
|
|
2814
|
-
setTags(tags: string[]): this;
|
|
2815
|
-
get lastPage(): Page;
|
|
2816
|
-
get route(): Route;
|
|
2817
|
-
get enableHistory(): boolean;
|
|
2818
|
-
protected _enableHistory: boolean;
|
|
2819
|
-
protected _route: Route;
|
|
2820
|
-
protected _lastPage: Page;
|
|
2821
|
-
protected _tags: {};
|
|
2822
|
-
protected _layer: string;
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
declare enum PageState {
|
|
2826
|
-
/**
|
|
2827
|
-
* 关闭
|
|
2828
|
-
*/
|
|
2829
|
-
Closed = 0,
|
|
2830
|
-
/**
|
|
2831
|
-
* 正在打开
|
|
2832
|
-
*/
|
|
2833
|
-
Opening = 1,
|
|
2834
|
-
/**
|
|
2835
|
-
* 已打开
|
|
2836
|
-
*/
|
|
2837
|
-
Opened = 2,
|
|
2838
|
-
/**
|
|
2839
|
-
* 正在关闭
|
|
2840
|
-
*/
|
|
2841
|
-
Closeing = 3
|
|
2842
|
-
}
|
|
2843
|
-
declare enum PageEvent {
|
|
2844
|
-
Opening = "opening",
|
|
2845
|
-
Opened = "opened",
|
|
2846
|
-
Closeing = "closeing",
|
|
2847
|
-
Closed = "closed",
|
|
2848
|
-
Stop = "stop"
|
|
2849
|
-
}
|
|
2850
|
-
declare class Page extends EventManager {
|
|
2851
|
-
constructor(controller: PageController, route: Route);
|
|
2852
|
-
/**
|
|
2853
|
-
* 等待打开完成指令
|
|
2854
|
-
*/
|
|
2855
|
-
waitOpenComplete(): void;
|
|
2856
|
-
waitCloseComplete(): void;
|
|
2857
|
-
openComplete(): void;
|
|
2858
|
-
closeComplete(): void;
|
|
2859
|
-
stop(reason: LinkError): void;
|
|
2860
|
-
/**
|
|
2861
|
-
* 等待发送的结果
|
|
2862
|
-
* 如果返回 null,表示主动取消 [cancel]
|
|
2863
|
-
*/
|
|
2864
|
-
wait(): Promise<this>;
|
|
2865
|
-
toString(): string;
|
|
2866
|
-
get objectDict(): UIObjectDict;
|
|
2867
|
-
protected _objectDict: UIObjectDict;
|
|
2868
|
-
protected _waitOpenComplete: boolean;
|
|
2869
|
-
protected _waitCloseComplete: boolean;
|
|
2870
|
-
get controller(): PageController;
|
|
2871
|
-
get route(): Route;
|
|
2872
|
-
cache: {};
|
|
2873
|
-
tags: {};
|
|
2874
|
-
layer: string;
|
|
2875
|
-
state: PageState;
|
|
2876
|
-
protected _controller: PageController;
|
|
2877
|
-
protected _route: Route;
|
|
2878
|
-
}
|
|
2879
|
-
|
|
2880
|
-
/**
|
|
2881
|
-
* 视图管理器
|
|
2882
|
-
* 打开一个视图的时候,可能会听过加载资源,读取数据,调整布局,切换特效等处理,所以使用视图模式封装视图打开关闭的逻辑
|
|
2883
|
-
*/
|
|
2884
|
-
declare class PageLayer {
|
|
2885
|
-
name: string;
|
|
2886
|
-
constructor(name: string);
|
|
2887
|
-
close(): void;
|
|
2888
|
-
/**
|
|
2889
|
-
* 当前的页面
|
|
2890
|
-
*/
|
|
2891
|
-
currentPage: Page;
|
|
2892
|
-
}
|
|
2893
|
-
|
|
2894
|
-
declare class PageList extends List<Page> {
|
|
2895
|
-
}
|
|
2896
|
-
declare class PageRepo extends PageList {
|
|
2897
|
-
constructor();
|
|
2898
|
-
openByString(route: string): Page;
|
|
2899
|
-
/**
|
|
2900
|
-
* 打开页面
|
|
2901
|
-
* 一个路由代表一个页面
|
|
2902
|
-
* @param route
|
|
2903
|
-
*/
|
|
2904
|
-
open(route: Route): Page;
|
|
2905
|
-
close(route: Route): void;
|
|
2906
|
-
/**
|
|
2907
|
-
* 如果页面存在,则刷新
|
|
2908
|
-
* @param route
|
|
2909
|
-
*/
|
|
2910
|
-
refresh(route: Route): void;
|
|
2911
|
-
/**
|
|
2912
|
-
* 历史记录
|
|
2913
|
-
*/
|
|
2914
|
-
getHistory(): Route[];
|
|
2915
|
-
back(): void;
|
|
2916
|
-
getByRoute(route: Route): Page;
|
|
2917
|
-
listByTags(tags: string[]): PageList;
|
|
2918
|
-
getLayerMain(): PageLayer;
|
|
2919
|
-
/**
|
|
2920
|
-
* @param name
|
|
2921
|
-
*/
|
|
2922
|
-
getLayer(name: string): PageLayer;
|
|
2923
|
-
protected getOrNewLayer(name: string): PageLayer;
|
|
2924
|
-
getController(route: Route): PageController;
|
|
2925
|
-
get objectDict(): UIObjectDict;
|
|
2926
|
-
protected _objectDict: UIObjectDict;
|
|
2927
|
-
protected _indexLayer: {};
|
|
2928
|
-
protected _indexRoute: {};
|
|
2929
|
-
protected _history: Route[];
|
|
2930
|
-
}
|
|
2931
|
-
declare const pagerepo: PageRepo;
|
|
2932
|
-
|
|
2933
|
-
interface ISchemaTreeNode extends TreeNode {
|
|
2934
|
-
tags: {
|
|
2935
|
-
/**
|
|
2936
|
-
* Field.Name
|
|
2937
|
-
*/
|
|
2938
|
-
title: string;
|
|
2939
|
-
/**
|
|
2940
|
-
* 可获取节点对应的 Field
|
|
2941
|
-
*/
|
|
2942
|
-
field: Field;
|
|
2943
|
-
/**
|
|
2944
|
-
* 可获取节点对应的 IType
|
|
2945
|
-
*/
|
|
2946
|
-
schema: IType;
|
|
2947
|
-
/**
|
|
2948
|
-
* 当类型为ClassType时,标识是否为null
|
|
2949
|
-
*/
|
|
2950
|
-
isNull: boolean;
|
|
2951
|
-
/**
|
|
2952
|
-
* 标识是否为默认值
|
|
2953
|
-
*/
|
|
2954
|
-
isDefault: boolean;
|
|
2955
|
-
};
|
|
2956
|
-
/**
|
|
2957
|
-
* 当 Field 的类型为 BasicType 时,设置成传入对象对应的值
|
|
2958
|
-
* 否则为 null
|
|
2959
|
-
*/
|
|
2960
|
-
data: any;
|
|
2961
|
-
}
|
|
2962
|
-
declare class SchemaTreeRootCreator {
|
|
2963
|
-
static default: SchemaTreeRootCreator;
|
|
2964
|
-
constructor();
|
|
2965
|
-
createByType(root: TreeRoot, type: IType, id: string, object: any, title?: string, defaultValue?: any): TreeNode;
|
|
2966
|
-
updateByType(node: TreeNode, value: any): void;
|
|
2967
|
-
/**
|
|
2968
|
-
* 通过类的约束和类的map值,生成用于对象编辑器的树对象
|
|
2969
|
-
* @param decl
|
|
2970
|
-
* @param object
|
|
2971
|
-
*
|
|
2972
|
-
* @see ISchemaTreeNode
|
|
2973
|
-
*/
|
|
2974
|
-
createByClassDecl(decl: ClassDecl, object: any): TreeRoot;
|
|
2975
|
-
/**
|
|
2976
|
-
* 通过类的约束和类的map值,生成用于对象编辑器的树对象
|
|
2977
|
-
* @param decl
|
|
2978
|
-
*
|
|
2979
|
-
* @see ISchemaTreeNode
|
|
2980
|
-
*/
|
|
2981
|
-
createByEnumDecl(decl: EnumDecl): TreeRoot;
|
|
2982
|
-
createNode(type: IType | ClassDecl | EnumDecl, id: string): TreeNode;
|
|
2983
|
-
createOriginByClassDecl(root: TreeRoot, decl: ClassDecl, object: any): TreeNode;
|
|
2984
|
-
createOriginByEnumDecl(root: TreeRoot, decl: EnumDecl, object: any): TreeNode;
|
|
2985
|
-
protected createChildrenByEnumDecl(node: TreeNode, decl: EnumDecl, object: any): void;
|
|
2986
|
-
protected createChildrenByClassDecl(node: TreeNode, decl: ClassDecl, object: any): void;
|
|
2987
|
-
protected createChildByField(node: TreeNode, field: Field, object: any): void;
|
|
2988
|
-
protected createChildByMapType(root: TreeRoot, type: MapType, id: string, object: {
|
|
2989
|
-
[key: string]: any;
|
|
2990
|
-
}, title: string): TreeNode;
|
|
2991
|
-
protected createChildByMapType_Child(node: TreeNode, root: TreeRoot, type: IType, id: string, object: any, title: string): TreeNode;
|
|
2992
|
-
protected createChildByArrayType(root: TreeRoot, type: ArrayType, id: string, object: any[], title: string): TreeNode;
|
|
2993
|
-
protected createChildByClassType(root: TreeRoot, type: ClassType, id: string, value: any, title: string): TreeNode;
|
|
2994
|
-
protected createChildByAnyType(root: TreeRoot, type: AnyType, id: string, value: any, title: string): TreeNode;
|
|
2995
|
-
protected updateAnyType(node: TreeNode, value: any): void;
|
|
2996
|
-
protected createByEnumType(root: TreeRoot, type: EnumType, id: string, value: any, title: string, defaultValue: any): TreeNode;
|
|
2997
|
-
/**
|
|
2998
|
-
* @param root
|
|
2999
|
-
* @param type
|
|
3000
|
-
* @param id
|
|
3001
|
-
* @param value
|
|
3002
|
-
* @param title
|
|
3003
|
-
* @param defaultValue
|
|
3004
|
-
* @param ident
|
|
3005
|
-
* @param keepOrigin 保持 value 的值
|
|
3006
|
-
* @protected
|
|
3007
|
-
*/
|
|
3008
|
-
protected createByBasicType(root: TreeRoot, type: BasicType, id: string, value: any, title: string, defaultValue: any, ident?: string, keepOrigin?: boolean): TreeNode;
|
|
3009
|
-
/**
|
|
3010
|
-
* 表示是否检查约束声明中的 [hide] 标签
|
|
3011
|
-
*/
|
|
3012
|
-
disableHide(): this;
|
|
3013
|
-
disableAutoValue(): this;
|
|
3014
|
-
replaceField(classDecl: string, fieldName: string, handler: (decl: ClassDecl, object: any, field: Field) => Field): this;
|
|
3015
|
-
protected _checkHide: boolean;
|
|
3016
|
-
protected _autoValue: boolean;
|
|
3017
|
-
protected _replaceField: {};
|
|
3018
|
-
}
|
|
3019
|
-
|
|
3020
|
-
declare class SchemaValueToJson {
|
|
3021
|
-
field: Field;
|
|
3022
|
-
constructor(field: Field);
|
|
3023
|
-
toJson(treeValue: any): any;
|
|
3024
|
-
_toJson(type: IType, value: any, field?: Field): any;
|
|
3025
|
-
private toObject_ClassType;
|
|
3026
|
-
private toObject_MapType;
|
|
3027
|
-
private toObject_ArrayType;
|
|
3028
|
-
private toObject_BasicType;
|
|
3029
|
-
private toObject_ClassDecl;
|
|
3030
|
-
}
|
|
3031
|
-
|
|
3032
|
-
declare class SchemaNodeToValue {
|
|
3033
|
-
node: TreeNode;
|
|
3034
|
-
constructor(node: TreeNode);
|
|
3035
|
-
toValue(): any;
|
|
3036
|
-
_toValue(node: TreeNode): any;
|
|
3037
|
-
private toObject_ClassType;
|
|
3038
|
-
private toObject_MapType;
|
|
3039
|
-
private toObject_ArrayType;
|
|
3040
|
-
private toObject_AnyType;
|
|
3041
|
-
private toObject_BasicType;
|
|
3042
|
-
private toObject_ClassDecl;
|
|
3043
|
-
/**
|
|
3044
|
-
* 动态关联的对象转化成字符串
|
|
3045
|
-
*/
|
|
3046
|
-
setDlinkObjectToString(): this;
|
|
3047
|
-
/**
|
|
3048
|
-
* 设置移除默认的字段
|
|
3049
|
-
*/
|
|
3050
|
-
setRemoveFieldDefault(): this;
|
|
3051
|
-
protected _dlinkObjectToString: boolean;
|
|
3052
|
-
protected _removeFieldDefault: boolean;
|
|
3053
|
-
}
|
|
3054
|
-
|
|
3055
|
-
interface ISchemaType {
|
|
3056
|
-
name: string;
|
|
3057
|
-
matchType?: IType;
|
|
3058
|
-
/**
|
|
3059
|
-
* 值转换成字符串用于显示
|
|
3060
|
-
* @param configSet
|
|
3061
|
-
* @param data
|
|
3062
|
-
* @param typeValue
|
|
3063
|
-
*/
|
|
3064
|
-
valueToText: (dataNode: TreeNode, field: Field, typeValue: string) => string;
|
|
3065
|
-
/**
|
|
3066
|
-
* 转换成识别号
|
|
3067
|
-
*/
|
|
3068
|
-
valueToIdent: Function;
|
|
3069
|
-
/**
|
|
3070
|
-
* 编辑器中使用的预设体
|
|
3071
|
-
*/
|
|
3072
|
-
valueToPrefab?: (dataNode: TreeNode, field: Field, typeValue: string) => Prefab;
|
|
3073
|
-
}
|
|
3074
|
-
declare class SchemaManager extends EventManager {
|
|
3075
|
-
registerExtendType(typ: ISchemaType): void;
|
|
3076
|
-
getExtendTypeByField(field: Field): ISchemaType;
|
|
3077
|
-
/**
|
|
3078
|
-
* 通过约束树的节点获取该节点定义的扩展类型
|
|
3079
|
-
* 如果是 map/array 的子节点,则返回 map和array 中定义的扩展类型
|
|
3080
|
-
* @param node tags = {field:Field, schema:IType}
|
|
3081
|
-
*/
|
|
3082
|
-
getExtendTypeByNode(node: TreeNode): ISchemaType;
|
|
3083
|
-
getExtendType(typ: string): ISchemaType;
|
|
3084
|
-
protected _typeExtendMap: {
|
|
3085
|
-
[key: string]: ISchemaType;
|
|
3086
|
-
};
|
|
3087
|
-
/**
|
|
3088
|
-
* 通过约束树的节点获取该节点定义的字段信息
|
|
3089
|
-
* 如果是 map/array 的子节点,则返回 map和array 的字段信息
|
|
3090
|
-
* @param node
|
|
3091
|
-
*/
|
|
3092
|
-
getFieldByNode(node: TreeNode): Field;
|
|
3093
|
-
createByType(root: TreeRoot, type: IType, id: string, object: any, title?: string, defaultValue?: any): TreeNode;
|
|
3094
|
-
getDataNodeFieldTags(dataTyp: IType | Field, parentTyp: IType): any;
|
|
3095
|
-
/**
|
|
3096
|
-
* 获取节点schema中,所在Field的Tags。
|
|
3097
|
-
* @param dataNode
|
|
3098
|
-
*/
|
|
3099
|
-
getFieldTags(dataNode: TreeNode): {
|
|
3100
|
-
[key: string]: string;
|
|
3101
|
-
};
|
|
3102
|
-
}
|
|
3103
|
-
declare var schemamgr: SchemaManager;
|
|
3104
|
-
|
|
3105
|
-
/**
|
|
3106
|
-
* 解码反射值的接口
|
|
3107
|
-
*/
|
|
3108
|
-
interface IRefValue {
|
|
3109
|
-
refType(): string;
|
|
3110
|
-
}
|
|
3111
|
-
declare class MapDecoder {
|
|
3112
|
-
constructor();
|
|
3113
|
-
decodeSet(m: {
|
|
3114
|
-
[key: string]: any;
|
|
3115
|
-
}): any;
|
|
3116
|
-
decodeMap(m: {
|
|
3117
|
-
[key: string]: any;
|
|
3118
|
-
}): any;
|
|
3119
|
-
decodeObj(obj: IRefValue, m: any): void;
|
|
3120
|
-
protected parseObj(obj: any, m: any, desc: ClassDecl): void;
|
|
3121
|
-
protected parseMap(omap: any, mmap: any, typ: MapType): any;
|
|
3122
|
-
protected parseSlice(oarr: any, marr: any, typ: ArrayType): any;
|
|
3123
|
-
protected parseAny(oval: any, mval: any, typ: AnyType): any;
|
|
3124
|
-
protected parseClass(oval: any, mval: any, typ: ClassType): any;
|
|
3125
|
-
protected parseEnum(oval: any, mval: any, typ: EnumType): any;
|
|
3126
|
-
protected parseBasic(oval: any, mval: any, typ: BasicType): any;
|
|
3127
|
-
}
|
|
3128
|
-
|
|
3129
|
-
declare class ByteDecoder {
|
|
3130
|
-
decodeObj(obj: any, reader: ByteArray, desc: ClassDecl): void;
|
|
3131
|
-
protected parseMap(omap: any, reader: ByteArray, typ: MapType, value: string): any;
|
|
3132
|
-
protected parseSlice(oarr: any, reader: ByteArray, typ: ArrayType): any;
|
|
3133
|
-
protected parseAny(oval: any, reader: ByteArray, typ: AnyType, value: string): any;
|
|
3134
|
-
protected parseClass(oval: any, reader: ByteArray, typ: ClassType, value: string): any;
|
|
3135
|
-
protected parseEnum(reader: ByteArray, typ: EnumType): any;
|
|
3136
|
-
protected parseBasic(reader: ByteArray, typ: BasicType): any;
|
|
3137
|
-
protected parseKind(reader: ByteArray, kind: Kind): any;
|
|
3138
|
-
}
|
|
3139
|
-
|
|
3140
|
-
declare class SimpleModify {
|
|
3141
|
-
ctx: any;
|
|
3142
|
-
constructor(ctx: any);
|
|
3143
|
-
setValue(key: string, valueOrCreator: any | Function): void;
|
|
3144
|
-
protected _data: any[];
|
|
3145
|
-
getValue(key: string): any;
|
|
3146
|
-
}
|
|
3147
|
-
|
|
3148
|
-
type CreatorFunction = (...args: any[]) => {};
|
|
3149
|
-
/**
|
|
3150
|
-
* 回收的方法
|
|
3151
|
-
* 使用回收方法的原因是,某些对象没有recycle函数,由不方便实现recycle函数
|
|
3152
|
-
*/
|
|
3153
|
-
type RecycleFunction = (item: any, ...args: any[]) => void;
|
|
3154
|
-
/**
|
|
3155
|
-
* 释放的方法
|
|
3156
|
-
*/
|
|
3157
|
-
type DisposeFunction = (item: any, ...args: any[]) => void;
|
|
3158
|
-
/**
|
|
3159
|
-
* 对象池
|
|
3160
|
-
*/
|
|
3161
|
-
declare class Pool {
|
|
3162
|
-
creatorFunction: CreatorFunction;
|
|
3163
|
-
recycleFunction: RecycleFunction;
|
|
3164
|
-
disposeFunction: DisposeFunction;
|
|
3165
|
-
name: string;
|
|
3166
|
-
list: any[];
|
|
3167
|
-
constructor();
|
|
3168
|
-
/**
|
|
3169
|
-
* 获取一个对象
|
|
3170
|
-
*/
|
|
3171
|
-
getObject(...args: any[]): any;
|
|
3172
|
-
/**
|
|
3173
|
-
* 回收一个对象
|
|
3174
|
-
* @param obj
|
|
3175
|
-
*/
|
|
3176
|
-
recycleObject(obj: any): void;
|
|
3177
|
-
/**
|
|
3178
|
-
* 释放一个对象
|
|
3179
|
-
* @param obj
|
|
3180
|
-
*/
|
|
3181
|
-
disposeObject(obj: any): void;
|
|
3182
|
-
/**
|
|
3183
|
-
* 释放对象池
|
|
3184
|
-
*/
|
|
3185
|
-
dispose(): void;
|
|
3186
|
-
}
|
|
3187
|
-
declare class PoolSet {
|
|
3188
|
-
pools: {
|
|
3189
|
-
[key: string]: Pool;
|
|
3190
|
-
};
|
|
3191
|
-
constructor();
|
|
3192
|
-
register(poolName: string, creator: CreatorFunction, recycle?: RecycleFunction, dispose?: DisposeFunction): Pool;
|
|
3193
|
-
getOrCreatePool(poolName: any): Pool;
|
|
3194
|
-
getPool(poolName: any): Pool;
|
|
3195
|
-
disposePool(poolName: string): void;
|
|
3196
|
-
dispose(): void;
|
|
3197
|
-
}
|
|
3198
|
-
/**
|
|
3199
|
-
* 对象池
|
|
3200
|
-
*/
|
|
3201
|
-
declare class SamplePool {
|
|
3202
|
-
list: any[];
|
|
3203
|
-
constructor();
|
|
3204
|
-
/**
|
|
3205
|
-
* 获取一个对象
|
|
3206
|
-
*/
|
|
3207
|
-
get(): any;
|
|
3208
|
-
/**
|
|
3209
|
-
* 回收一个对象
|
|
3210
|
-
* @param obj
|
|
3211
|
-
*/
|
|
3212
|
-
put(obj: any): void;
|
|
3213
|
-
}
|
|
3214
|
-
/**
|
|
3215
|
-
* 对象池
|
|
3216
|
-
*/
|
|
3217
|
-
declare class SamplePoolSet {
|
|
3218
|
-
get(name: string): any;
|
|
3219
|
-
put(name: string, item: any): void;
|
|
3220
|
-
protected pools: {};
|
|
3221
|
-
}
|
|
3222
|
-
|
|
3223
|
-
declare class CallbackItem {
|
|
3224
|
-
listener: Function;
|
|
3225
|
-
caller: any;
|
|
3226
|
-
once: boolean;
|
|
3227
|
-
}
|
|
3228
|
-
declare class SampleCallbackList {
|
|
3229
|
-
constructor();
|
|
3230
|
-
dispose(): void;
|
|
3231
|
-
has(caller: any, listener: Function): boolean;
|
|
3232
|
-
protected getItem(caller: any, listener: Function): CallbackItem;
|
|
3233
|
-
/**
|
|
3234
|
-
* 监听事件,如果监听已经存在则返回
|
|
3235
|
-
* @param caller
|
|
3236
|
-
* @param listener 为了性能考虑, event使用了对象池处理。因此处理函数不应该保存event的引用。如有需要,可通过新建对象或Event.Clone()实现
|
|
3237
|
-
*/
|
|
3238
|
-
on(caller: any, listener: (ctx: this, params?: any) => void): CallbackItem;
|
|
3239
|
-
once(caller: any, listener: (ctx: this, params?: any) => void): CallbackItem;
|
|
3240
|
-
protected offItem(item: CallbackItem): void;
|
|
3241
|
-
off(caller: any, listener: Function): void;
|
|
3242
|
-
offAll(type?: string): void;
|
|
3243
|
-
offAllCaller(caller: any): void;
|
|
3244
|
-
/**
|
|
3245
|
-
* 派发事件
|
|
3246
|
-
* @param params 事件参数
|
|
3247
|
-
*/
|
|
3248
|
-
dispatch(params?: any): void;
|
|
3249
|
-
protected _callbackItems: CallbackItem[];
|
|
3250
|
-
}
|
|
3251
|
-
|
|
3252
|
-
declare enum DataValueType {
|
|
3253
|
-
Class = 0,
|
|
3254
|
-
Array = 1,
|
|
3255
|
-
String = 2,
|
|
3256
|
-
Number = 3,
|
|
3257
|
-
Boolean = 4
|
|
3258
|
-
}
|
|
3259
|
-
declare class DataValue extends SampleCallbackList {
|
|
3260
|
-
constructor(path: string, type: DataValueType);
|
|
3261
|
-
enableLocalStorage(): this;
|
|
3262
|
-
get(): any;
|
|
3263
|
-
set(value: any): void;
|
|
3264
|
-
load(): void;
|
|
3265
|
-
save(value: any): void;
|
|
3266
|
-
refresh(): void;
|
|
3267
|
-
get path(): string;
|
|
3268
|
-
get type(): DataValueType;
|
|
3269
|
-
protected _enableLocalStorage: boolean;
|
|
3270
|
-
protected _path: string;
|
|
3271
|
-
protected _type: DataValueType;
|
|
3272
|
-
protected _data: any;
|
|
3273
|
-
}
|
|
3274
|
-
|
|
3275
|
-
declare class DataDispatchParams {
|
|
3276
|
-
action: DBAction;
|
|
3277
|
-
object: {};
|
|
3278
|
-
table: IDBTable;
|
|
3279
|
-
/**
|
|
3280
|
-
* DBAction.Update时为变化的数据
|
|
3281
|
-
* DBAction.Create时为创建的数据
|
|
3282
|
-
*/
|
|
3283
|
-
data: any;
|
|
3284
|
-
}
|
|
3285
|
-
/**
|
|
3286
|
-
* tablePath 对象id@表id, 如果未设置表id,则默认为 "@alone"
|
|
3287
|
-
* propPath /prop1/prop2...
|
|
3288
|
-
*/
|
|
3289
|
-
declare class DataManager extends EventManager implements IDatabase {
|
|
3290
|
-
/**
|
|
3291
|
-
* 输入 [表id][对象id] 返回 [表id, 对象id]
|
|
3292
|
-
* @param tablePath
|
|
3293
|
-
* @private
|
|
3294
|
-
*/
|
|
3295
|
-
static $parseKey(tablePath: string): [string, string];
|
|
3296
|
-
constructor();
|
|
3297
|
-
init(): void;
|
|
3298
|
-
registerTable(name: string, table: IDBTable): IDBTable;
|
|
3299
|
-
/**
|
|
3300
|
-
* 可通过 Laya.ClassUtils.regClass("database.table.tableId") 替换默认的 DataBucket
|
|
3301
|
-
* @param name
|
|
3302
|
-
*/
|
|
3303
|
-
getTable(name: string): IDBTable;
|
|
3304
|
-
/**
|
|
3305
|
-
* 创建表对象
|
|
3306
|
-
* 需要设置表
|
|
3307
|
-
* @param tablePath
|
|
3308
|
-
* @param data
|
|
3309
|
-
*/
|
|
3310
|
-
createObject<T = IDBObject>(tablePath: string, data: any): T;
|
|
3311
|
-
updateObject(obj: IDBObject, data: {
|
|
3312
|
-
[key: string]: any;
|
|
3313
|
-
}): void;
|
|
3314
|
-
/**
|
|
3315
|
-
* 更新对象
|
|
3316
|
-
* @param tablePath
|
|
3317
|
-
* @param data 发生变化的数据
|
|
3318
|
-
*/
|
|
3319
|
-
updateByPath(tablePath: string, data: any): void;
|
|
3320
|
-
/**
|
|
3321
|
-
* 移除对象
|
|
3322
|
-
* @param tablePath
|
|
3323
|
-
*/
|
|
3324
|
-
removeObject(tablePath: string): void;
|
|
3325
|
-
/**
|
|
3326
|
-
* 获取对象
|
|
3327
|
-
* 如果设置了tableId,会保存包对应的表中
|
|
3328
|
-
* @param tablePath =“tableId/objectId” or objectId
|
|
3329
|
-
*/
|
|
3330
|
-
getObject(tablePath: string): IDBObject;
|
|
3331
|
-
getOrCreateObject(tablePath: string): IDBObject;
|
|
3332
|
-
/**
|
|
3333
|
-
* 获取属性的值
|
|
3334
|
-
* @param tablePath
|
|
3335
|
-
* @param propPath
|
|
3336
|
-
*/
|
|
3337
|
-
getObjectProp(tablePath: string, propPath?: string): any;
|
|
3338
|
-
setObjectProp(tablePath: string, propPath?: string, data?: any, enableDispatch?: boolean): void;
|
|
3339
|
-
LSKeys(): LSKeys;
|
|
3340
|
-
LSLoadOrSaveObject(tablePath: string, data: any): void;
|
|
3341
|
-
/**
|
|
3342
|
-
* 从localStorage中加载数据并初始化,如果是table,则添加到table中
|
|
3343
|
-
* @param objectPath
|
|
3344
|
-
* @return 路径指向的对象,如果不存在则创建。如果未注册,抛出异常
|
|
3345
|
-
* @return localStorage是否存在数目
|
|
3346
|
-
*/
|
|
3347
|
-
LSLoadObject<T = IDBObject>(objectPath: string): T;
|
|
3348
|
-
LSRemoveObject(tablePath: string): void;
|
|
3349
|
-
LSSaveObject(tablePath: string): void;
|
|
3350
|
-
LSLoadProp(tablePath: string, propPath: string, handler?: (data: any) => any): void;
|
|
3351
|
-
LSSaveProp(tablePath: string, propPath: string): void;
|
|
3352
|
-
getDataValue(path: string): DataValue;
|
|
3353
|
-
existDataValue(path: string, creator: (path: string) => DataValue): DataValue;
|
|
3354
|
-
setDataValue(dataObject: DataValue): void;
|
|
3355
|
-
saveObject(path: string, object: any): void;
|
|
3356
|
-
loadObject(path: string, target: any): any;
|
|
3357
|
-
saveAny(key: string, val: any): void;
|
|
3358
|
-
loadAny(key: string): any;
|
|
3359
|
-
protected object: {};
|
|
3360
|
-
private tables;
|
|
3361
|
-
}
|
|
3362
|
-
declare class LSKeys extends List<string> {
|
|
3363
|
-
add(key: string): void;
|
|
3364
|
-
dictByTable(tableName: string): List<string>;
|
|
3365
|
-
protected indexTable: {
|
|
3366
|
-
[key: string]: List<string>;
|
|
3367
|
-
};
|
|
3368
|
-
}
|
|
3369
|
-
|
|
3370
|
-
declare var datamgr: DataManager;
|
|
3371
|
-
|
|
3372
|
-
declare class IDataTableConfig {
|
|
3373
|
-
/**
|
|
3374
|
-
* 名字
|
|
3375
|
-
*/
|
|
3376
|
-
name: string;
|
|
3377
|
-
}
|
|
3378
|
-
declare class DataTableConfig {
|
|
3379
|
-
/**
|
|
3380
|
-
* 名字
|
|
3381
|
-
*/
|
|
3382
|
-
name: string;
|
|
3383
|
-
/**
|
|
3384
|
-
* 数据对象的方法
|
|
3385
|
-
*/
|
|
3386
|
-
objectCreator?: (ident: any, data: any) => IDBObject;
|
|
3387
|
-
/**
|
|
3388
|
-
* 数据集的类
|
|
3389
|
-
*/
|
|
3390
|
-
mapCreator?: () => IDBTable;
|
|
3391
|
-
constructor({ name, objectCreator, mapCreator }: DataTableConfig);
|
|
3392
|
-
}
|
|
3393
|
-
/**
|
|
3394
|
-
* 独立类型的配置表
|
|
3395
|
-
*/
|
|
3396
|
-
declare class DataTableAloneConfig {
|
|
3397
|
-
/**
|
|
3398
|
-
* 名字
|
|
3399
|
-
*/
|
|
3400
|
-
name: string;
|
|
3401
|
-
/**
|
|
3402
|
-
* 指定项的配置,用于独立模式,通常名字为alone
|
|
3403
|
-
*/
|
|
3404
|
-
items: {
|
|
3405
|
-
[key: string]: DataTableItemConfig;
|
|
3406
|
-
};
|
|
3407
|
-
constructor({ name, items }: DataTableAloneConfig);
|
|
3408
|
-
}
|
|
3409
|
-
interface DataTableItemConfig {
|
|
3410
|
-
/**
|
|
3411
|
-
* 数据对象的方法
|
|
3412
|
-
*/
|
|
3413
|
-
objectCreator: (ident: any, data: any) => IDBObject;
|
|
3414
|
-
}
|
|
3415
|
-
|
|
3416
|
-
declare class Config {
|
|
3417
|
-
static createByJSONMap(编号: string, conf: IConfigInfo): Config;
|
|
3418
|
-
static create(编号: string, 类型: string, 分类: string): Config;
|
|
3419
|
-
/**
|
|
3420
|
-
* 命名空间/类型
|
|
3421
|
-
*/
|
|
3422
|
-
get类型标识(): string;
|
|
3423
|
-
calculate最终数据(): {};
|
|
3424
|
-
/**
|
|
3425
|
-
* 配置保存的数据
|
|
3426
|
-
*/
|
|
3427
|
-
get 数据(): any;
|
|
3428
|
-
get 编辑器名称(): string;
|
|
3429
|
-
get 父对象(): Config;
|
|
3430
|
-
克隆(): Config;
|
|
3431
|
-
/**
|
|
3432
|
-
* 设置数据
|
|
3433
|
-
* @param path /p1/p2/key
|
|
3434
|
-
* @param value
|
|
3435
|
-
*/
|
|
3436
|
-
setData(path: string, value: any): void;
|
|
3437
|
-
removeData(path: string): void;
|
|
3438
|
-
getSchema(): ClassDecl;
|
|
3439
|
-
get类型(): string;
|
|
3440
|
-
/**
|
|
3441
|
-
* 转化成存储到文件的map对象的值
|
|
3442
|
-
*/
|
|
3443
|
-
toSaveObj(r: any): any;
|
|
3444
|
-
/**
|
|
3445
|
-
* 转化成存储到文件的map对象的值
|
|
3446
|
-
*/
|
|
3447
|
-
toSaveFileValue(): any;
|
|
3448
|
-
/**
|
|
3449
|
-
* 转化成存储到文件的map对象 {编号:toSaveFileValue()}
|
|
3450
|
-
*/
|
|
3451
|
-
toSaveFileObject(): any;
|
|
3452
|
-
已变化的属性路径: {
|
|
3453
|
-
[key: string]: boolean;
|
|
3454
|
-
};
|
|
3455
|
-
发生错误的属性路径: {
|
|
3456
|
-
[key: string]: boolean;
|
|
3457
|
-
};
|
|
3458
|
-
编辑器字体颜色(属性路径: string): Color;
|
|
3459
|
-
更新发生错误(path: string): void;
|
|
3460
|
-
protected 更新已更新(path: string): void;
|
|
3461
|
-
刷新已变化的属性路径(): void;
|
|
3462
|
-
刷新发生错误的属性路径(): void;
|
|
3463
|
-
protected 刷新发生错误的属性路径_class_decl(decl: ClassDecl, obj: any, path: string): void;
|
|
3464
|
-
井号to分类编号(val: string): string;
|
|
3465
|
-
分类编号to井号(val: string): string;
|
|
3466
|
-
/**
|
|
3467
|
-
* 由类型和类型编号组成
|
|
3468
|
-
* 格式为:分类编号@分类
|
|
3469
|
-
*/
|
|
3470
|
-
编号: string;
|
|
3471
|
-
/**
|
|
3472
|
-
* 父配置的编号
|
|
3473
|
-
*/
|
|
3474
|
-
父编号: string;
|
|
3475
|
-
原始数据: any;
|
|
3476
|
-
最终数据: any;
|
|
3477
|
-
/**
|
|
3478
|
-
* 私有的文件,只在文件内部可以发现
|
|
3479
|
-
* 0-文件内可见, 1-目录内可见, 2-全局可见
|
|
3480
|
-
*/
|
|
3481
|
-
导出的: number;
|
|
3482
|
-
/**
|
|
3483
|
-
* 配置所在的文件路径
|
|
3484
|
-
*/
|
|
3485
|
-
文件: string;
|
|
3486
|
-
/**
|
|
3487
|
-
* 配置的分类
|
|
3488
|
-
* 例如单位,技能,掉落
|
|
3489
|
-
*/
|
|
3490
|
-
分类: string;
|
|
3491
|
-
/**
|
|
3492
|
-
* 分类编号
|
|
3493
|
-
*/
|
|
3494
|
-
分类编号: string;
|
|
3495
|
-
/**
|
|
3496
|
-
* 配置的对象类型
|
|
3497
|
-
* 例如技能-攻击,技能-移动,技能-效果
|
|
3498
|
-
*/
|
|
3499
|
-
类型: string;
|
|
3500
|
-
命名空间: string;
|
|
3501
|
-
/**
|
|
3502
|
-
* 编辑器使用的名称
|
|
3503
|
-
*/
|
|
3504
|
-
名称: string;
|
|
3505
|
-
/**
|
|
3506
|
-
* 编辑器的数据
|
|
3507
|
-
*/
|
|
3508
|
-
编辑器数据: any;
|
|
3509
|
-
编辑器前缀: string;
|
|
3510
|
-
编辑器后缀: string;
|
|
3511
|
-
/**
|
|
3512
|
-
* 用于记录当前配置是由哪个模版创建而成
|
|
3513
|
-
*/
|
|
3514
|
-
编辑器模版: string;
|
|
3515
|
-
/**
|
|
3516
|
-
* 用于生成树结构
|
|
3517
|
-
*/
|
|
3518
|
-
编辑器路径: string;
|
|
3519
|
-
classDecl: ClassDecl;
|
|
3520
|
-
/**
|
|
3521
|
-
* 默认的配置
|
|
3522
|
-
*/
|
|
3523
|
-
默认的: boolean;
|
|
3524
|
-
/**
|
|
3525
|
-
* 在自己的分类的名称是唯一的
|
|
3526
|
-
*/
|
|
3527
|
-
唯一的: boolean;
|
|
3528
|
-
/**
|
|
3529
|
-
* 用于避免误操作
|
|
3530
|
-
*/
|
|
3531
|
-
禁止删除: boolean;
|
|
3532
|
-
/**
|
|
3533
|
-
* 用于避免误操作
|
|
3534
|
-
*/
|
|
3535
|
-
禁止编辑: boolean;
|
|
3536
|
-
}
|
|
3537
|
-
|
|
3538
|
-
declare enum ConfigSetEventSub {
|
|
3539
|
-
Add = "add",
|
|
3540
|
-
DELETE = "delete",
|
|
3541
|
-
UPDATE = "item_update1"
|
|
3542
|
-
}
|
|
3543
|
-
interface IConfigInfo {
|
|
3544
|
-
_type: string;
|
|
3545
|
-
_catalog: string;
|
|
3546
|
-
_parent: string;
|
|
3547
|
-
_export: string;
|
|
3548
|
-
_default: string;
|
|
3549
|
-
_prefix: string;
|
|
3550
|
-
_suffix: string;
|
|
3551
|
-
_name: string;
|
|
3552
|
-
_file: string;
|
|
3553
|
-
}
|
|
3554
|
-
declare class ConfigSetEvent {
|
|
3555
|
-
sub: ConfigSetEventSub;
|
|
3556
|
-
config: Config;
|
|
3557
|
-
constructor(sub: ConfigSetEventSub, config: Config);
|
|
3558
|
-
}
|
|
3559
|
-
declare class ConfigSet extends EventManager {
|
|
3560
|
-
/**
|
|
3561
|
-
* dispatchParams = {config:Config}
|
|
3562
|
-
*/
|
|
3563
|
-
static EVENT_ADD: string;
|
|
3564
|
-
/**
|
|
3565
|
-
* dispatchParams = {config:Config}
|
|
3566
|
-
*/
|
|
3567
|
-
static EVENT_DELETE: string;
|
|
3568
|
-
/**
|
|
3569
|
-
* dispatchParams = {config:Config}
|
|
3570
|
-
*/
|
|
3571
|
-
static EVENT_UPDATE: string;
|
|
3572
|
-
protected _data: Config[];
|
|
3573
|
-
protected _indexTree: TreeRoot;
|
|
3574
|
-
get data(): Config[];
|
|
3575
|
-
constructor();
|
|
3576
|
-
/**
|
|
3577
|
-
* 加载发布后的文件
|
|
3578
|
-
* @param contentObject
|
|
3579
|
-
*/
|
|
3580
|
-
loadPublish(configMap: {
|
|
3581
|
-
[key: string]: any;
|
|
3582
|
-
}): void;
|
|
3583
|
-
get indexTree(): TreeRoot;
|
|
3584
|
-
loadByFile(file: string, contentObject: any): void;
|
|
3585
|
-
loadByFileMap(files: any): void;
|
|
3586
|
-
removeAll(): void;
|
|
3587
|
-
/**
|
|
3588
|
-
* 把源对象的数据复制到目标对象
|
|
3589
|
-
* @param source
|
|
3590
|
-
* @param target
|
|
3591
|
-
* @param decl
|
|
3592
|
-
*/
|
|
3593
|
-
copyObj(source: any, target: any, decl: ClassDecl): void;
|
|
3594
|
-
查找_通过编号(编号: string): Config;
|
|
3595
|
-
查找_通过文件(文件: string): ConfigSet;
|
|
3596
|
-
查找_通过类型(类型: string): ConfigSet;
|
|
3597
|
-
查找_通过分类(分类: string): ConfigSet;
|
|
3598
|
-
获取所有分类(指定文件?: string): string[];
|
|
3599
|
-
获取所有类型(指定文件?: string): string[];
|
|
3600
|
-
获取所有文件(): string[];
|
|
3601
|
-
生成类树(): TreeRoot;
|
|
3602
|
-
protected getItemParentLink(item: Config): string;
|
|
3603
|
-
/**
|
|
3604
|
-
*
|
|
3605
|
-
* @param 当前文件 优先显示当前文件的内容
|
|
3606
|
-
*/
|
|
3607
|
-
生成类型树(当前文件?: string, 默认优先?: boolean): TreeRoot;
|
|
3608
|
-
/**
|
|
3609
|
-
* 由于树结构使用 "/" 来分隔,为避免冲突,把文件的 "/" 全替换成 $
|
|
3610
|
-
*/
|
|
3611
|
-
生成分类树(使用分类?: boolean, 使用文件?: boolean): TreeRoot;
|
|
3612
|
-
/**
|
|
3613
|
-
* 按指定属性进行分类
|
|
3614
|
-
* @param 指定属性
|
|
3615
|
-
*/
|
|
3616
|
-
生成属性树(指定属性: string): TreeRoot;
|
|
3617
|
-
/**
|
|
3618
|
-
*
|
|
3619
|
-
* @param value
|
|
3620
|
-
* @param existed
|
|
3621
|
-
*/
|
|
3622
|
-
合并(value: ConfigSet, existed?: ConfigSet): ConfigSet;
|
|
3623
|
-
创建配置_通过父配置(父配置编号: string, 编号: string, 选项: {
|
|
3624
|
-
数据?: any;
|
|
3625
|
-
信息?: IConfigInfo;
|
|
3626
|
-
继承复制的对象?: boolean;
|
|
3627
|
-
}): Config;
|
|
1131
|
+
get objectDict(): UIObjectDict;
|
|
1132
|
+
protected _objectDict: UIObjectDict;
|
|
1133
|
+
protected _waitOpenComplete: boolean;
|
|
1134
|
+
protected _waitCloseComplete: boolean;
|
|
1135
|
+
get controller(): PageController;
|
|
1136
|
+
get route(): Route;
|
|
1137
|
+
cache: {};
|
|
1138
|
+
tags: {};
|
|
1139
|
+
layer: string;
|
|
1140
|
+
state: PageState;
|
|
1141
|
+
protected _controller: PageController;
|
|
1142
|
+
protected _route: Route;
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
/**
|
|
1146
|
+
* 视图管理器
|
|
1147
|
+
* 打开一个视图的时候,可能会听过加载资源,读取数据,调整布局,切换特效等处理,所以使用视图模式封装视图打开关闭的逻辑
|
|
1148
|
+
*/
|
|
1149
|
+
declare class PageLayer {
|
|
1150
|
+
name: string;
|
|
1151
|
+
constructor(name: string);
|
|
1152
|
+
close(): void;
|
|
3628
1153
|
/**
|
|
3629
|
-
*
|
|
3630
|
-
* @param enableDispatch
|
|
3631
|
-
* @see ConfigSet.EVENT_ADD
|
|
1154
|
+
* 当前的页面
|
|
3632
1155
|
*/
|
|
3633
|
-
|
|
3634
|
-
|
|
1156
|
+
currentPage: Page;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
declare class PageList extends List<Page> {
|
|
1160
|
+
}
|
|
1161
|
+
declare class PageRepo extends PageList {
|
|
1162
|
+
constructor();
|
|
1163
|
+
openByString(route: string): Page;
|
|
3635
1164
|
/**
|
|
3636
|
-
*
|
|
3637
|
-
*
|
|
3638
|
-
* @param
|
|
3639
|
-
* @see ConfigSet.EVENT_DELETE
|
|
1165
|
+
* 打开页面
|
|
1166
|
+
* 一个路由代表一个页面
|
|
1167
|
+
* @param route
|
|
3640
1168
|
*/
|
|
3641
|
-
|
|
1169
|
+
open(route: Route): Page;
|
|
1170
|
+
close(route: Route): void;
|
|
3642
1171
|
/**
|
|
3643
|
-
*
|
|
3644
|
-
* @param
|
|
3645
|
-
* @param 新编号
|
|
1172
|
+
* 如果页面存在,则刷新
|
|
1173
|
+
* @param route
|
|
3646
1174
|
*/
|
|
3647
|
-
|
|
3648
|
-
删除_通过文件路径(路径: string): void;
|
|
3649
|
-
重置文件路径(fromPath: any, toPath: any): void;
|
|
1175
|
+
refresh(route: Route): void;
|
|
3650
1176
|
/**
|
|
3651
|
-
*
|
|
3652
|
-
* 与setData一样, 但会派发 ConfigSet.EVENT_UPDATE
|
|
3653
|
-
* @param 配置
|
|
3654
|
-
* @param path
|
|
3655
|
-
* @param value
|
|
1177
|
+
* 历史记录
|
|
3656
1178
|
*/
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
1179
|
+
getHistory(): Route[];
|
|
1180
|
+
back(): void;
|
|
1181
|
+
getByRoute(route: Route): Page;
|
|
1182
|
+
listByTags(tags: string[]): PageList;
|
|
1183
|
+
getLayerMain(): PageLayer;
|
|
3662
1184
|
/**
|
|
3663
|
-
*
|
|
1185
|
+
* @param name
|
|
3664
1186
|
*/
|
|
3665
|
-
|
|
3666
|
-
|
|
3667
|
-
|
|
3668
|
-
|
|
1187
|
+
getLayer(name: string): PageLayer;
|
|
1188
|
+
protected getOrNewLayer(name: string): PageLayer;
|
|
1189
|
+
getController(route: Route): PageController;
|
|
1190
|
+
get objectDict(): UIObjectDict;
|
|
1191
|
+
protected _objectDict: UIObjectDict;
|
|
1192
|
+
protected _indexLayer: {};
|
|
1193
|
+
protected _indexRoute: {};
|
|
1194
|
+
protected _history: Route[];
|
|
3669
1195
|
}
|
|
1196
|
+
declare const pagerepo: PageRepo;
|
|
3670
1197
|
|
|
3671
|
-
|
|
3672
|
-
|
|
3673
|
-
|
|
3674
|
-
registerCascader(key: string, root: TreeRoot): void;
|
|
3675
|
-
getCascader(path: string): TreeRoot;
|
|
3676
|
-
_cascader: {
|
|
3677
|
-
[key: string]: TreeRoot;
|
|
3678
|
-
};
|
|
3679
|
-
}
|
|
3680
|
-
declare const configmgr: ConfigManager;
|
|
1198
|
+
/**
|
|
1199
|
+
* 事件字符串分隔符
|
|
1200
|
+
*/
|
|
3681
1201
|
|
|
3682
|
-
|
|
3683
|
-
|
|
3684
|
-
|
|
3685
|
-
|
|
3686
|
-
|
|
3687
|
-
|
|
3688
|
-
|
|
3689
|
-
listBy类型(指定类型?: string): ConfigDict;
|
|
3690
|
-
list所有分类(): string[];
|
|
3691
|
-
list所有类型(): string[];
|
|
3692
|
-
list所有文件(): string[];
|
|
1202
|
+
/**
|
|
1203
|
+
* 回调列表
|
|
1204
|
+
*/
|
|
1205
|
+
declare class CallbackList<PARAMS = any> {
|
|
1206
|
+
constructor();
|
|
1207
|
+
addListener(listener: Listener): void;
|
|
1208
|
+
removeListener(listener: Listener): void;
|
|
3693
1209
|
/**
|
|
3694
|
-
* @param 当前文件 优先显示当前文件的内容
|
|
3695
|
-
* @param 默认优先
|
|
3696
|
-
* @param 路径名和标题处理器 默认使用[item.编号, item.名称]
|
|
3697
1210
|
*/
|
|
3698
|
-
create
|
|
1211
|
+
create(): Listener<PARAMS>;
|
|
3699
1212
|
/**
|
|
3700
|
-
*
|
|
3701
|
-
* @param
|
|
3702
|
-
* @param 路径名和标题处理器 默认使用[item.编号, item.名称]
|
|
1213
|
+
* 如果监听器已经不存在,则创建
|
|
1214
|
+
* @param ident
|
|
3703
1215
|
*/
|
|
3704
|
-
|
|
1216
|
+
createByIdent(ident: any): Listener<PARAMS>;
|
|
1217
|
+
removeByIdent(ident: any): void;
|
|
1218
|
+
removeByCaller(caller: any): void;
|
|
1219
|
+
getByIdent(ident: any): Listener;
|
|
3705
1220
|
/**
|
|
3706
|
-
*
|
|
1221
|
+
* 派发事件
|
|
1222
|
+
* @param params 事件参数
|
|
1223
|
+
* @param subIdent
|
|
3707
1224
|
*/
|
|
3708
|
-
|
|
1225
|
+
dispatch(params?: PARAMS, subIdent?: string): void;
|
|
1226
|
+
protected _data: List<Listener<any>>;
|
|
1227
|
+
protected _indexIdent: {};
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
declare class Listener<PARAMS = any> {
|
|
1231
|
+
static create(ident?: string): Listener<any>;
|
|
1232
|
+
constructor(ident?: string);
|
|
1233
|
+
getCaller(): any;
|
|
1234
|
+
setCaller(caller: any): this;
|
|
1235
|
+
setSubIdent(val: string): this;
|
|
1236
|
+
setCondition(condition: (listener: Listener<PARAMS>) => boolean): this;
|
|
1237
|
+
setHandler(handler: (listener: Listener<PARAMS>) => void): this;
|
|
1238
|
+
setOnParams(val: any): this;
|
|
1239
|
+
getIdent(): string;
|
|
1240
|
+
on(): this;
|
|
1241
|
+
off(): this;
|
|
1242
|
+
isOn(): boolean;
|
|
1243
|
+
remove(): void;
|
|
3709
1244
|
/**
|
|
3710
|
-
*
|
|
3711
|
-
* @param
|
|
1245
|
+
* 内部使用
|
|
1246
|
+
* @param params
|
|
1247
|
+
* @param subIdent 子编号
|
|
3712
1248
|
*/
|
|
3713
|
-
|
|
1249
|
+
_dispatch(params: PARAMS, subIdent?: string): void;
|
|
1250
|
+
getOnParams(): any;
|
|
1251
|
+
getParams(): PARAMS;
|
|
1252
|
+
protected onParams: any;
|
|
1253
|
+
protected params: PARAMS;
|
|
1254
|
+
protected ident: string;
|
|
1255
|
+
protected _subIdent: string;
|
|
1256
|
+
protected source: CallbackList;
|
|
1257
|
+
protected _handler: (any: any) => void;
|
|
1258
|
+
protected _condition: (any: any) => boolean;
|
|
1259
|
+
protected caller: any;
|
|
1260
|
+
protected _isOn: boolean;
|
|
1261
|
+
}
|
|
1262
|
+
|
|
1263
|
+
/**
|
|
1264
|
+
* 事件字符串分隔符
|
|
1265
|
+
*/
|
|
1266
|
+
|
|
1267
|
+
/**
|
|
1268
|
+
* 事件派发器
|
|
1269
|
+
*/
|
|
1270
|
+
declare class Dispatcher implements ISchedulable {
|
|
1271
|
+
constructor(name?: string);
|
|
1272
|
+
dispose(): void;
|
|
1273
|
+
create(type: string, listener: Listener): void;
|
|
1274
|
+
remove(type: string, listener: Listener): void;
|
|
1275
|
+
getByIdent(type: string, ident: string): Listener;
|
|
3714
1276
|
/**
|
|
3715
|
-
*
|
|
3716
|
-
* @param
|
|
3717
|
-
* @param 新编号
|
|
1277
|
+
* @param type
|
|
1278
|
+
* @param ident
|
|
3718
1279
|
*/
|
|
3719
|
-
|
|
1280
|
+
createByIdent(type: string, ident: string): Listener;
|
|
3720
1281
|
/**
|
|
3721
|
-
*
|
|
1282
|
+
* 派发事件
|
|
1283
|
+
* @param eventType 事件类型
|
|
1284
|
+
* @param params 事件参数
|
|
3722
1285
|
*/
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
1286
|
+
dispatch(eventType: string, params?: any): void;
|
|
1287
|
+
protected getList(type: string): CallbackList;
|
|
1288
|
+
id?: string;
|
|
1289
|
+
uuid?: string;
|
|
1290
|
+
name: string;
|
|
1291
|
+
protected isDispose: boolean;
|
|
1292
|
+
protected typeToList: Dictionary<string, CallbackList<any>>;
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
declare class LoaderItem {
|
|
1296
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1297
|
+
callHandler(err: any, asset: any): void;
|
|
1298
|
+
getBundle(): AssetManager.Bundle;
|
|
1299
|
+
type: string;
|
|
1300
|
+
bundle: AssetManager.Bundle;
|
|
1301
|
+
uri: AssetURI$1;
|
|
1302
|
+
preload: boolean;
|
|
1303
|
+
error: any;
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* uri格式:path, uuid://uuid, https://url
|
|
1307
|
+
*/
|
|
1308
|
+
declare class AssetLoader extends Dispatcher$1 {
|
|
3726
1309
|
/**
|
|
3727
|
-
* 重置索引树
|
|
3728
1310
|
*
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
1311
|
+
* @param bundleName
|
|
1312
|
+
* @param otherConfig preload:是预加载-否-加载, 包中的资源
|
|
1313
|
+
*/
|
|
1314
|
+
loadBundle(bundleName: string, otherConfig?: {
|
|
1315
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1316
|
+
preload?: boolean;
|
|
1317
|
+
}): this;
|
|
1318
|
+
/**
|
|
1319
|
+
* @param uri
|
|
1320
|
+
* @param otherConfig
|
|
1321
|
+
*/
|
|
1322
|
+
loadAtlas(uri: string, otherConfig?: {
|
|
1323
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1324
|
+
preload?: boolean;
|
|
1325
|
+
}): this;
|
|
1326
|
+
loadPrefab(uri: string, otherConfig?: {
|
|
1327
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1328
|
+
preload?: boolean;
|
|
1329
|
+
}): this;
|
|
1330
|
+
loadConfig(uri: string): this;
|
|
1331
|
+
loadSpriteFrame(uri: string, otherConfig?: {
|
|
1332
|
+
onComplete?: (err: any, asset: any) => void;
|
|
1333
|
+
uuid?: string;
|
|
1334
|
+
}): this;
|
|
1335
|
+
loadImageAsset(uri: string, otherConfig?: {
|
|
1336
|
+
onHandler?: (err: any, asset: any) => void;
|
|
1337
|
+
}): this;
|
|
1338
|
+
protected _loadSpriteFrameByBundle(uri: string, bundle: AssetManager.Bundle): void;
|
|
3732
1339
|
/**
|
|
3733
|
-
*
|
|
3734
|
-
*
|
|
1340
|
+
* 等待发送的结果
|
|
1341
|
+
* 如果返回 null,表示主动取消 [cancel]
|
|
3735
1342
|
*/
|
|
3736
|
-
|
|
1343
|
+
wait(): Promise<this>;
|
|
1344
|
+
start(): this;
|
|
1345
|
+
onComplete(val: (loader: AssetLoader) => void): this;
|
|
1346
|
+
onProgress(val: (loader: AssetLoader) => void): this;
|
|
1347
|
+
isComplete(): boolean;
|
|
1348
|
+
protected validComplete(): void;
|
|
1349
|
+
protected parseBundleToAssetsLoader(bundle: AssetManager.Bundle, loaderItem: LoaderItem): AssetLoader;
|
|
1350
|
+
protected handleAtlas(item: LoaderItem, atlasAsset: Asset): void;
|
|
1351
|
+
protected _loadByItem(item: LoaderItem, type: any, onComplate: (err: any, asset: any) => void): void;
|
|
1352
|
+
getLoaded(): number;
|
|
1353
|
+
getTotle(): number;
|
|
1354
|
+
getSucceed(): number;
|
|
1355
|
+
getFail(): number;
|
|
1356
|
+
getFailList(): List$1<LoaderItem>;
|
|
1357
|
+
protected _handleFailList(err: any, item: any): void;
|
|
1358
|
+
stop(): void;
|
|
1359
|
+
protected _stop: boolean;
|
|
1360
|
+
protected _onCompleteHandler: Function;
|
|
1361
|
+
protected _onProgressHandler: Function;
|
|
1362
|
+
protected _loaded: number;
|
|
1363
|
+
protected _loaderList: any;
|
|
1364
|
+
protected _failList: any;
|
|
3737
1365
|
}
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
|
|
1366
|
+
|
|
1367
|
+
declare class AssetURI {
|
|
1368
|
+
name: string;
|
|
1369
|
+
constructor(name: string);
|
|
1370
|
+
loadType: number;
|
|
1371
|
+
uuid: string;
|
|
1372
|
+
path: string;
|
|
1373
|
+
bundle: string;
|
|
3743
1374
|
}
|
|
1375
|
+
declare class XAssetManager {
|
|
1376
|
+
getAsset(uri: string): any;
|
|
1377
|
+
getAssetByUUID(uuid: string): any;
|
|
1378
|
+
getRoot(): AssetManager;
|
|
1379
|
+
}
|
|
1380
|
+
declare let assetx: XAssetManager;
|
|
3744
1381
|
|
|
3745
|
-
declare
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3755
|
-
|
|
3756
|
-
|
|
3757
|
-
|
|
3758
|
-
|
|
3759
|
-
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
* @param 配置
|
|
3773
|
-
* @param enableDispatch
|
|
3774
|
-
* @see ConfigSet.EVENT_ADD
|
|
3775
|
-
*/
|
|
3776
|
-
add(配置: Config, enableDispatch?: boolean): error;
|
|
3777
|
-
removeDict(dict: ConfigDict, enableDispatch?: boolean): error;
|
|
1382
|
+
declare function parseAtlas(name: any, plist: any, texture: any): SpriteAtlas;
|
|
1383
|
+
|
|
1384
|
+
type CreatorFunction = (...args: any[]) => {};
|
|
1385
|
+
/**
|
|
1386
|
+
* 回收的方法
|
|
1387
|
+
* 使用回收方法的原因是,某些对象没有recycle函数,由不方便实现recycle函数
|
|
1388
|
+
*/
|
|
1389
|
+
type RecycleFunction = (item: any, ...args: any[]) => void;
|
|
1390
|
+
/**
|
|
1391
|
+
* 释放的方法
|
|
1392
|
+
*/
|
|
1393
|
+
type DisposeFunction = (item: any, ...args: any[]) => void;
|
|
1394
|
+
/**
|
|
1395
|
+
* 对象池
|
|
1396
|
+
*/
|
|
1397
|
+
declare class Pool {
|
|
1398
|
+
creatorFunction: CreatorFunction;
|
|
1399
|
+
recycleFunction: RecycleFunction;
|
|
1400
|
+
disposeFunction: DisposeFunction;
|
|
1401
|
+
name: string;
|
|
1402
|
+
list: any[];
|
|
1403
|
+
constructor(config: {
|
|
1404
|
+
creatorFunction: CreatorFunction;
|
|
1405
|
+
recycleFunction?: RecycleFunction;
|
|
1406
|
+
disposeFunction?: DisposeFunction;
|
|
1407
|
+
name?: string;
|
|
1408
|
+
});
|
|
3778
1409
|
/**
|
|
3779
|
-
*
|
|
3780
|
-
* @param 编号
|
|
3781
|
-
* @param enableDispatch
|
|
3782
|
-
* @see ConfigSet.EVENT_DELETE
|
|
1410
|
+
* 获取一个对象
|
|
3783
1411
|
*/
|
|
3784
|
-
|
|
3785
|
-
removeBy文件(路径: string): void;
|
|
3786
|
-
reset文件(fromPath: any, toPath: string): void;
|
|
1412
|
+
getObject(...args: any[]): any;
|
|
3787
1413
|
/**
|
|
3788
|
-
*
|
|
3789
|
-
*
|
|
3790
|
-
* @param 配置
|
|
3791
|
-
* @param path
|
|
3792
|
-
* @param value
|
|
1414
|
+
* 回收一个对象
|
|
1415
|
+
* @param obj
|
|
3793
1416
|
*/
|
|
3794
|
-
|
|
1417
|
+
recycleObject(obj: any): void;
|
|
3795
1418
|
/**
|
|
3796
|
-
*
|
|
3797
|
-
* @param
|
|
1419
|
+
* 释放一个对象
|
|
1420
|
+
* @param obj
|
|
3798
1421
|
*/
|
|
3799
|
-
|
|
1422
|
+
disposeObject(obj: any): void;
|
|
3800
1423
|
/**
|
|
3801
|
-
*
|
|
3802
|
-
* @param config
|
|
1424
|
+
* 释放对象池
|
|
3803
1425
|
*/
|
|
3804
|
-
|
|
3805
|
-
registerCascader(key: string, root: TreeRoot): void;
|
|
3806
|
-
getCascader(path: string): TreeRoot;
|
|
3807
|
-
get dispatcher(): EventManager;
|
|
3808
|
-
_cascader: {
|
|
3809
|
-
[key: string]: TreeRoot;
|
|
3810
|
-
};
|
|
3811
|
-
_dispatcher: EventManager;
|
|
3812
|
-
index_文件: Dictionary<string, ConfigDict>;
|
|
3813
|
-
index_分类: Dictionary<string, ClassConfigDict>;
|
|
3814
|
-
index_类型: Dictionary<string, ConfigDict>;
|
|
3815
|
-
index_功能: Dictionary<string, ConfigDict>;
|
|
3816
|
-
index_tree: TreeRoot;
|
|
1426
|
+
dispose(): void;
|
|
3817
1427
|
}
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
static EVENT_ADD: string;
|
|
1428
|
+
/**
|
|
1429
|
+
* 对象池
|
|
1430
|
+
*/
|
|
1431
|
+
declare class SamplePool {
|
|
1432
|
+
list: any[];
|
|
1433
|
+
constructor();
|
|
3825
1434
|
/**
|
|
3826
|
-
*
|
|
1435
|
+
* 获取一个对象
|
|
3827
1436
|
*/
|
|
3828
|
-
|
|
1437
|
+
get(): any;
|
|
3829
1438
|
/**
|
|
3830
|
-
*
|
|
1439
|
+
* 回收一个对象
|
|
1440
|
+
* @param obj
|
|
3831
1441
|
*/
|
|
3832
|
-
|
|
1442
|
+
put(obj: any): void;
|
|
3833
1443
|
}
|
|
3834
1444
|
|
|
3835
1445
|
declare class ConvertUtil {
|
|
@@ -4242,114 +1852,5 @@ declare const pathutil: PathUtil;
|
|
|
4242
1852
|
declare function parsePlist(plist: any, texture: any): SpriteAtlas;
|
|
4243
1853
|
declare function loadAtlas(url: any, callback: any): void;
|
|
4244
1854
|
|
|
4245
|
-
|
|
4246
|
-
|
|
4247
|
-
}
|
|
4248
|
-
declare const debugmgr: DebugManager;
|
|
4249
|
-
|
|
4250
|
-
declare enum LogLevel {
|
|
4251
|
-
DEBUG = 0,
|
|
4252
|
-
INFO = 1,
|
|
4253
|
-
WARNING = 2,
|
|
4254
|
-
ERROR = 3
|
|
4255
|
-
}
|
|
4256
|
-
declare class Logger {
|
|
4257
|
-
name: string;
|
|
4258
|
-
level: LogLevel;
|
|
4259
|
-
ignoreRegexp: any[];
|
|
4260
|
-
ignoreString: any[];
|
|
4261
|
-
protected _enable: boolean;
|
|
4262
|
-
disable(): void;
|
|
4263
|
-
canLogByLevel(level: LogLevel): boolean;
|
|
4264
|
-
canLog(msg: string, level: LogLevel): boolean;
|
|
4265
|
-
debug(msg: string, ...data: any[]): void;
|
|
4266
|
-
info(msg: string, ...data: any[]): void;
|
|
4267
|
-
infof(msgCreator: () => string): void;
|
|
4268
|
-
warning(msg: string, ...data: any[]): void;
|
|
4269
|
-
error(msg: string, ...data: any[]): void;
|
|
4270
|
-
}
|
|
4271
|
-
|
|
4272
|
-
declare const LOGGER_EVENT = "Event";
|
|
4273
|
-
declare class LogManager {
|
|
4274
|
-
/**
|
|
4275
|
-
* 获取事件的日志管理
|
|
4276
|
-
* 日志的group为事件类型
|
|
4277
|
-
*/
|
|
4278
|
-
getEventLogger(): Logger;
|
|
4279
|
-
/**
|
|
4280
|
-
* 获取日志管理
|
|
4281
|
-
*/
|
|
4282
|
-
getLogger(name: string): Logger;
|
|
4283
|
-
protected _loggers: {};
|
|
4284
|
-
/**
|
|
4285
|
-
* 是否开启日志
|
|
4286
|
-
*/
|
|
4287
|
-
enable: boolean;
|
|
4288
|
-
protected ignores: any[];
|
|
4289
|
-
/**
|
|
4290
|
-
* 忽视包含指定字符串的日志
|
|
4291
|
-
* @param val
|
|
4292
|
-
*/
|
|
4293
|
-
ignoreString(val: string): void;
|
|
4294
|
-
/**
|
|
4295
|
-
* 取消指定的日志
|
|
4296
|
-
* @param val
|
|
4297
|
-
*/
|
|
4298
|
-
ignoreStringCancel(val: string): void;
|
|
4299
|
-
/**
|
|
4300
|
-
* 是否可以输出日志
|
|
4301
|
-
* @param type
|
|
4302
|
-
* @private
|
|
4303
|
-
*/
|
|
4304
|
-
canLog(type: string): boolean;
|
|
4305
|
-
disableSystemConsole(): void;
|
|
4306
|
-
}
|
|
4307
|
-
declare const logmgr: LogManager;
|
|
4308
|
-
|
|
4309
|
-
interface CommandInfo {
|
|
4310
|
-
/**
|
|
4311
|
-
* 默认的
|
|
4312
|
-
*/
|
|
4313
|
-
caller?: any;
|
|
4314
|
-
name: string;
|
|
4315
|
-
handler: Function;
|
|
4316
|
-
group?: string;
|
|
4317
|
-
global: boolean;
|
|
4318
|
-
}
|
|
4319
|
-
declare class CommandManager extends EventManager {
|
|
4320
|
-
protected _infos: any[];
|
|
4321
|
-
register(info: CommandInfo): void;
|
|
4322
|
-
execute(name: string, ...args: any): any;
|
|
4323
|
-
removeGroup(group: string): void;
|
|
4324
|
-
}
|
|
4325
|
-
declare const cmdmgr: CommandManager;
|
|
4326
|
-
|
|
4327
|
-
declare class XDate extends Date {
|
|
4328
|
-
static parseString(val: string): XDate;
|
|
4329
|
-
add(year?: number, month?: number, date?: number, hour?: number, minute?: number, second?: number): XDate;
|
|
4330
|
-
/**
|
|
4331
|
-
* 获取当月总共天数函数
|
|
4332
|
-
*/
|
|
4333
|
-
getMonthDay(): number;
|
|
4334
|
-
getQuarter(): number;
|
|
4335
|
-
startOfYear(): XDate;
|
|
4336
|
-
endOfYear(): XDate;
|
|
4337
|
-
startOfQuarter(): XDate;
|
|
4338
|
-
endOfQuarter(): XDate;
|
|
4339
|
-
startOfMonth(): XDate;
|
|
4340
|
-
endOfMonth(): XDate;
|
|
4341
|
-
startOfWeek(): XDate;
|
|
4342
|
-
endOfWeek(): XDate;
|
|
4343
|
-
startOfDay(): XDate;
|
|
4344
|
-
endOfDay(): XDate;
|
|
4345
|
-
startOfHour(): XDate;
|
|
4346
|
-
endOfHour(): XDate;
|
|
4347
|
-
startOfMinute(): XDate;
|
|
4348
|
-
endOfMinute(): XDate;
|
|
4349
|
-
startOfSecond(): XDate;
|
|
4350
|
-
endOfSecond(): XDate;
|
|
4351
|
-
clone(): XDate;
|
|
4352
|
-
}
|
|
4353
|
-
|
|
4354
|
-
export { ArrayUtil, BitUtil, ByteArray, ByteDecoder, CacheModifyMode, CacheObject, CacheObjectEvent, CallbackList, Caller, ClassConfigDict, ClickEvent, CommandManager, CommandProtocol, Config, ConfigDict, ConfigEvent, ConfigManager, ConfigRepo, ConfigSet, ConfigSetEvent, ConfigSetEventSub, ConnectState, Controller, ControllerDict, ControllerSet, ConvertUtil, CreateProtocol, DBAction, DBEvent, DataDispatchParams, DataManager, DataTableAloneConfig, DataTableConfig, DebugManager, DeleteProtocol, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, Endian, EndianConst, ErrorUtil, EventItem, EventManager, EventProtocol, EventUtil, Factory, FloatUtil, FrameEvent, FrameWebSocket, GeometryUtil, HttpMethod, HttpRequest, HttpResponseType, IDataTableConfig, IdentUtil, LOGGER_EVENT, LSKeys, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapDecoder, MapUtil, MathUtil, Model, Module, NetHttp, NetIdent, NetManager, NetSocket, NetSub, NetUtil, NodeEvent, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, PoolSet, PushProtocol, PushTag, RandUtil, RequestProtocol, ResponseEvent, ResponseProtocol, ResponseSub, Route, SamplePool, SamplePoolSet, ScaleUtil, SchemaManager, SchemaNodeToValue, SchemaTreeRootCreator, SchemaValueToJson, SerializeMode, SimpleModel, SimpleModify, StringUtil, SyncHandler, TimeUtil, TimerEvent, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, Trigger, TriggerEvent, TriggerManager, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, UpdateProtocol, ValidState, ViewController, WaitEvent, WebSocketType, XDate, XEvent, arrayutil, bitutil, cachex, cmdmgr, configRepo, configmgr, convertutil, ctrlrepo, datamgr, debugmgr, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, getClassCreator, identutil, loadAtlas, logmgr, maputil, mathutil, netmgr, netutil, newCacheObject, newObjectByType, pagerepo, parseData, parsePlist, pathutil, randutil, receiveData, resutil, scaleutil, schemamgr, setClassCreator, stringutil, timer, timeutil, triggermgr, uidict, uimgr, uiutil };
|
|
4355
|
-
export type { CommandInfo, CreatorFunction, DataTableItemConfig, DisposeFunction, ICacheObject, IConfigInfo, IController, IDBEventDispatchParams, IDBObject, IDBOnCreate, IDBOnRemove, IDBOnUpdate, IDBTable, IDatabase, IEventManager, IExtend, IListItem, IModel, IModify, IModule, IModuleSample, IRefValue, ISchemaTreeNode, ISchemaType, ITreeListItem, ITriggerEvent, RecycleFunction, error };
|
|
1855
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LinkError, List, ListIterator, ListNode, ListSource, Listener, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timeutil, uidict, uimgr, uiutil };
|
|
1856
|
+
export type { CreatorFunction, DisposeFunction, IController, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction, error };
|