@zhongguo168a/yxeditor-common 0.0.1 → 0.0.8
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 +706 -3297
- package/dist/index.esm.js +3749 -12426
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler,
|
|
1
|
+
import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, Vec2, Vec3, Vec4, AssetManager, SpriteAtlas } from 'cc';
|
|
2
2
|
|
|
3
3
|
interface error {
|
|
4
4
|
isCancel(): boolean;
|
|
@@ -206,386 +206,22 @@ declare class Timer {
|
|
|
206
206
|
dispose(): void;
|
|
207
207
|
}
|
|
208
208
|
|
|
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"
|
|
209
|
+
declare class ControllerSet {
|
|
210
|
+
constructor(mod: IModule);
|
|
211
|
+
has(name: string): boolean;
|
|
212
|
+
add(controller: IController): void;
|
|
213
|
+
createAndEnable(name: string, ...args: any[]): void;
|
|
214
|
+
create(name: string, ...args: any[]): void;
|
|
215
|
+
remove(name: string): void;
|
|
216
|
+
disable(name: string): void;
|
|
217
|
+
enable(name: string): void;
|
|
218
|
+
enableAll(): void;
|
|
219
|
+
disableAll(): void;
|
|
220
|
+
dispose(): void;
|
|
221
|
+
registerCreator(name: string, creator: (...args: any[]) => IController): void;
|
|
222
|
+
protected _creator: {};
|
|
223
|
+
protected _mod: IModule;
|
|
224
|
+
private data;
|
|
589
225
|
}
|
|
590
226
|
|
|
591
227
|
/**
|
|
@@ -730,671 +366,466 @@ declare class EventManager implements IEventManager {
|
|
|
730
366
|
*/
|
|
731
367
|
declare const eventmgr: EventManager;
|
|
732
368
|
|
|
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;
|
|
369
|
+
/**
|
|
370
|
+
* 一个简单的功能/库模块
|
|
371
|
+
*/
|
|
372
|
+
interface IModuleSample {
|
|
373
|
+
}
|
|
374
|
+
interface IModule {
|
|
375
|
+
controllers: ControllerSet;
|
|
376
|
+
}
|
|
377
|
+
declare class Module extends EventManager implements IModule {
|
|
378
|
+
constructor();
|
|
379
|
+
get controllers(): ControllerSet;
|
|
380
|
+
private _controllers;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
interface IController {
|
|
384
|
+
get name(): string;
|
|
385
|
+
get module(): IModule;
|
|
386
|
+
init(core: IModule): any;
|
|
387
|
+
enable(): any;
|
|
388
|
+
disable(): any;
|
|
389
|
+
dispose(): any;
|
|
390
|
+
}
|
|
391
|
+
declare class Controller {
|
|
392
|
+
constructor(name: string);
|
|
393
|
+
init(core: IModule): void;
|
|
394
|
+
enable(): void;
|
|
395
|
+
disable(): void;
|
|
762
396
|
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;
|
|
397
|
+
get name(): string;
|
|
398
|
+
get module(): IModule;
|
|
399
|
+
get isEnable(): boolean;
|
|
400
|
+
protected _module: IModule;
|
|
401
|
+
protected _name: string;
|
|
402
|
+
protected _enabled: boolean;
|
|
786
403
|
}
|
|
787
404
|
|
|
788
|
-
interface
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
405
|
+
interface IModel {
|
|
406
|
+
get module(): IModule;
|
|
407
|
+
}
|
|
408
|
+
declare class SimpleModel {
|
|
409
|
+
constructor(mod: IModule);
|
|
410
|
+
get core(): IModule;
|
|
411
|
+
protected _mod: any;
|
|
412
|
+
}
|
|
413
|
+
declare class Model extends EventManager {
|
|
414
|
+
constructor(core?: IModule);
|
|
415
|
+
get module(): IModule;
|
|
416
|
+
protected _module: any;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
interface IExtend {
|
|
420
|
+
get module(): IModule;
|
|
800
421
|
}
|
|
801
422
|
|
|
802
|
-
declare class
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
423
|
+
declare class Factory {
|
|
424
|
+
_controllers: {
|
|
425
|
+
[key: string]: (mod: IModule) => IController;
|
|
426
|
+
};
|
|
427
|
+
_extends: {
|
|
428
|
+
[key: string]: (mod: IModule, ...args: any) => IExtend;
|
|
429
|
+
};
|
|
430
|
+
registerController(name: string, creator: (mod: IModule, ...args: any) => IController): void;
|
|
431
|
+
registerExtend(name: string, creator: (mod: IModule, ...args: any) => IExtend): void;
|
|
432
|
+
createController(name: string, mod: IModule): IController;
|
|
433
|
+
createExtend(name: string, mod: IModule, ...args: any[]): IExtend;
|
|
806
434
|
}
|
|
807
|
-
|
|
808
|
-
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* 视图的路由值, 保存视图的信息
|
|
438
|
+
* 规则: path/search
|
|
439
|
+
* path = /a/b/c
|
|
440
|
+
* search = ?key=val&key=val
|
|
441
|
+
*/
|
|
442
|
+
declare class Route {
|
|
443
|
+
constructor(route: string);
|
|
444
|
+
recycle(): void;
|
|
809
445
|
/**
|
|
810
|
-
*
|
|
811
|
-
*
|
|
812
|
-
* @param key
|
|
813
|
-
* @param addr
|
|
446
|
+
* 获取调用链
|
|
447
|
+
* 例如 a/b/c,返回 a/b/c -> a/b -> a
|
|
814
448
|
*/
|
|
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;
|
|
449
|
+
getLink(): Route[];
|
|
450
|
+
protected static data: any;
|
|
451
|
+
static getData(route: string): Route;
|
|
452
|
+
toLoaction(): Location;
|
|
835
453
|
/**
|
|
836
|
-
*
|
|
454
|
+
* @constructor
|
|
837
455
|
*/
|
|
838
|
-
|
|
456
|
+
NewRoute(): Route;
|
|
839
457
|
/**
|
|
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
|
|
458
|
+
* @constructor
|
|
859
459
|
*/
|
|
860
|
-
|
|
460
|
+
NewRoutePath(): Route;
|
|
861
461
|
/**
|
|
862
|
-
*
|
|
863
|
-
* @param
|
|
864
|
-
* @param creator
|
|
462
|
+
* 新建一个带参数的路由
|
|
463
|
+
* @param params
|
|
865
464
|
*/
|
|
866
|
-
|
|
465
|
+
NewRouteParam(params: any): Route;
|
|
466
|
+
toString(): string;
|
|
467
|
+
get path(): string;
|
|
468
|
+
get parentPath(): string;
|
|
469
|
+
get params(): any;
|
|
470
|
+
get search(): string;
|
|
471
|
+
set search(value: string);
|
|
472
|
+
get name(): string;
|
|
867
473
|
/**
|
|
868
|
-
*
|
|
869
|
-
* @param group
|
|
870
|
-
* @param id
|
|
474
|
+
* path/search
|
|
871
475
|
*/
|
|
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;
|
|
476
|
+
get key(): string;
|
|
477
|
+
private _path;
|
|
478
|
+
private _parentPath;
|
|
479
|
+
private _search;
|
|
480
|
+
private _name;
|
|
481
|
+
private _params;
|
|
482
|
+
protected _route: string;
|
|
896
483
|
}
|
|
897
|
-
declare var netmgr: NetManager;
|
|
898
484
|
|
|
899
|
-
declare class
|
|
900
|
-
|
|
485
|
+
declare class TreeIterator {
|
|
486
|
+
break(): void;
|
|
487
|
+
isBreak(): boolean;
|
|
488
|
+
protected _isBreak: any;
|
|
489
|
+
}
|
|
490
|
+
interface ITreeListItem {
|
|
901
491
|
/**
|
|
902
|
-
*
|
|
492
|
+
* 路径
|
|
903
493
|
*/
|
|
904
|
-
|
|
494
|
+
path: string;
|
|
905
495
|
/**
|
|
906
|
-
*
|
|
496
|
+
* 自定义数据
|
|
907
497
|
*/
|
|
908
|
-
|
|
498
|
+
data?: any;
|
|
909
499
|
/**
|
|
910
|
-
*
|
|
500
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
911
501
|
*/
|
|
912
|
-
|
|
502
|
+
tags?: {
|
|
503
|
+
[key: string]: any;
|
|
504
|
+
};
|
|
913
505
|
/**
|
|
914
|
-
*
|
|
506
|
+
* 是否树叶
|
|
915
507
|
*/
|
|
916
|
-
|
|
508
|
+
isLeaf: boolean;
|
|
509
|
+
}
|
|
510
|
+
declare class TreeNode<T = any> {
|
|
511
|
+
get root(): TreeRoot;
|
|
917
512
|
/**
|
|
918
|
-
*
|
|
513
|
+
* 根节点
|
|
919
514
|
*/
|
|
920
|
-
|
|
515
|
+
protected _root: TreeRoot;
|
|
921
516
|
/**
|
|
922
|
-
*
|
|
517
|
+
* 编号
|
|
923
518
|
*/
|
|
924
|
-
|
|
519
|
+
uuid: string;
|
|
925
520
|
/**
|
|
926
|
-
*
|
|
927
|
-
* 本次请求返回的数据,数据类型根据responseType设置的值确定。
|
|
521
|
+
* 编号
|
|
928
522
|
*/
|
|
929
|
-
|
|
523
|
+
id: string;
|
|
930
524
|
/**
|
|
931
|
-
*
|
|
525
|
+
* 自定义数据
|
|
932
526
|
*/
|
|
933
|
-
|
|
527
|
+
data: T;
|
|
934
528
|
/**
|
|
935
|
-
*
|
|
936
|
-
* 设置返回的数据格式,请使用 HttpResponseType 里定义的枚举值。设置非法的值或不设置,都将使用HttpResponseType.TEXT。
|
|
529
|
+
* 是否树叶
|
|
937
530
|
*/
|
|
938
|
-
|
|
939
|
-
set responseType(value: HttpResponseType);
|
|
531
|
+
isLeaf: boolean;
|
|
940
532
|
/**
|
|
941
|
-
*
|
|
533
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
942
534
|
*/
|
|
943
|
-
|
|
535
|
+
tags: {
|
|
536
|
+
[key: string]: any;
|
|
537
|
+
};
|
|
944
538
|
/**
|
|
945
|
-
*
|
|
946
|
-
* 表明在进行跨站(cross-site)的访问控制(Access-Control)请求时,是否使用认证信息(例如cookie或授权的header)。 默认为 false。(这个标志不会影响同站的请求)
|
|
539
|
+
* 深度
|
|
947
540
|
*/
|
|
948
|
-
get
|
|
949
|
-
|
|
541
|
+
get depth(): number;
|
|
542
|
+
private _depth;
|
|
950
543
|
/**
|
|
951
|
-
*
|
|
544
|
+
* 父节点
|
|
952
545
|
*/
|
|
953
|
-
|
|
954
|
-
private _method;
|
|
546
|
+
parent: TreeNode;
|
|
955
547
|
/**
|
|
956
|
-
*
|
|
957
|
-
*
|
|
958
|
-
* @returns
|
|
548
|
+
* 子节点
|
|
959
549
|
*/
|
|
960
|
-
|
|
550
|
+
children: TreeNode[];
|
|
961
551
|
/**
|
|
962
|
-
*
|
|
963
|
-
*
|
|
964
|
-
* @param url 该请求所要访问的URL该请求所要访问的URL
|
|
965
|
-
* @param method 请求所使用的HTTP方法, 请使用 HttpMethod 定义的枚举值.
|
|
552
|
+
* 设置根
|
|
553
|
+
* @param val
|
|
966
554
|
*/
|
|
967
|
-
|
|
555
|
+
setRoot(val: TreeRoot): void;
|
|
556
|
+
getTags(): {
|
|
557
|
+
[key: string]: any;
|
|
558
|
+
};
|
|
559
|
+
getTag(name: string): any;
|
|
560
|
+
removeTag(name: string): void;
|
|
561
|
+
setTag(name: string, value: any): void;
|
|
562
|
+
constructor(id: string, isLeaf?: boolean);
|
|
563
|
+
addChild(val: TreeNode): void;
|
|
564
|
+
getChildIndex(val: TreeNode): number;
|
|
565
|
+
insertChild(val: TreeNode, index: number): void;
|
|
566
|
+
removeChild(val: TreeNode): void;
|
|
567
|
+
removeChildren(): void;
|
|
568
|
+
get name(): string;
|
|
569
|
+
setDepth(val: number): void;
|
|
570
|
+
containsById(id: string): boolean;
|
|
968
571
|
/**
|
|
969
|
-
*
|
|
970
|
-
*
|
|
971
|
-
* @param data 需要发送的数据
|
|
572
|
+
* 通过编号获取子节点
|
|
573
|
+
* @param id
|
|
972
574
|
*/
|
|
973
|
-
|
|
575
|
+
getChildById(id: string): TreeNode;
|
|
974
576
|
/**
|
|
975
|
-
*
|
|
976
|
-
* 如果请求已经被发送,则立刻中止请求.
|
|
577
|
+
* 返回相邻的上一个节点
|
|
977
578
|
*/
|
|
978
|
-
|
|
579
|
+
prevNode(): TreeNode;
|
|
979
580
|
/**
|
|
980
|
-
*
|
|
981
|
-
* 返回所有响应头信息(响应头名和值), 如果响应头还没接受,则返回"".
|
|
581
|
+
* 返回相邻的下一个节点
|
|
982
582
|
*/
|
|
983
|
-
|
|
984
|
-
private headerObj;
|
|
583
|
+
nextNode(): TreeNode;
|
|
985
584
|
/**
|
|
986
|
-
*
|
|
987
|
-
*
|
|
988
|
-
* @param header 将要被赋值的请求头名称.
|
|
989
|
-
* @param value 给指定的请求头赋的值.
|
|
585
|
+
* 如果返回true则删除节点,包含当前节点
|
|
586
|
+
* @param f
|
|
990
587
|
*/
|
|
991
|
-
|
|
588
|
+
walkRemove(f: (node: TreeNode) => boolean): void;
|
|
589
|
+
private _walkRemove;
|
|
992
590
|
/**
|
|
993
|
-
*
|
|
994
|
-
*
|
|
995
|
-
* @param
|
|
591
|
+
* 如果返回true则继续,包含当前节点
|
|
592
|
+
* @param f
|
|
593
|
+
* @param inChild
|
|
996
594
|
*/
|
|
997
|
-
|
|
595
|
+
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
596
|
+
private _walk;
|
|
998
597
|
/**
|
|
999
|
-
*
|
|
598
|
+
* 从当前节点(包括)遍历父节点链,包含当前节点
|
|
599
|
+
* @param f
|
|
1000
600
|
*/
|
|
1001
|
-
|
|
1002
|
-
private callOnError;
|
|
1003
|
-
private callOnProgress;
|
|
1004
|
-
private callOnComplete;
|
|
601
|
+
walkParent(f: (node: TreeNode) => boolean): boolean;
|
|
1005
602
|
/**
|
|
1006
|
-
*
|
|
603
|
+
* 从当前节点往前遍历(深度),包含当前节点
|
|
604
|
+
* @param f
|
|
605
|
+
* @param inChild
|
|
1007
606
|
*/
|
|
1008
|
-
|
|
607
|
+
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): any;
|
|
608
|
+
private _walkPrev;
|
|
609
|
+
dump(): void;
|
|
1009
610
|
/**
|
|
1010
|
-
*
|
|
611
|
+
* 遍历节点,查找指定编号的节点
|
|
1011
612
|
*/
|
|
1012
|
-
|
|
613
|
+
findById(id: string): TreeNode;
|
|
1013
614
|
/**
|
|
1014
|
-
*
|
|
615
|
+
* 如果返回true则继续
|
|
616
|
+
* @param f
|
|
1015
617
|
*/
|
|
1016
|
-
|
|
618
|
+
findOne(f: (node: TreeNode) => boolean): TreeNode;
|
|
619
|
+
private _findOne;
|
|
1017
620
|
/**
|
|
1018
|
-
*
|
|
621
|
+
* 通过路径获取节点
|
|
622
|
+
* 格式为 /path1/path2/...
|
|
623
|
+
* 如果 path == "/",则返回自身
|
|
624
|
+
* @param path
|
|
1019
625
|
*/
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
626
|
+
getNodeByPath(path: string): TreeNode;
|
|
627
|
+
protected getNodeByPathArr(pathArr: string[]): TreeNode;
|
|
628
|
+
getName(): string;
|
|
629
|
+
getPath(): string;
|
|
1023
630
|
/**
|
|
1024
|
-
*
|
|
631
|
+
* 如果返回true则继续
|
|
632
|
+
* @param f
|
|
1025
633
|
*/
|
|
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;
|
|
634
|
+
find(f: (node: TreeNode) => boolean): TreeNode[];
|
|
635
|
+
private _find;
|
|
636
|
+
toRoot(): TreeRoot;
|
|
637
|
+
clone(): TreeNode;
|
|
638
|
+
protected cloneChildrenTo(node: TreeNode): void;
|
|
639
|
+
fixDepthAndRoot(depth: number, root: TreeRoot): void;
|
|
640
|
+
toString(): string;
|
|
1038
641
|
}
|
|
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 {
|
|
642
|
+
declare class TreeRoot<NODE = any> extends EventManager {
|
|
1053
643
|
/**
|
|
1054
|
-
*
|
|
644
|
+
* 添加数据节点
|
|
645
|
+
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
1055
646
|
*/
|
|
1056
|
-
static
|
|
647
|
+
static EVENT_ADD: string;
|
|
1057
648
|
/**
|
|
1058
|
-
*
|
|
649
|
+
* 移除数据节点
|
|
650
|
+
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
1059
651
|
*/
|
|
1060
|
-
static
|
|
1061
|
-
private _writeMessage;
|
|
1062
|
-
private _readMessage;
|
|
1063
|
-
private _connected;
|
|
1064
|
-
private _connecting;
|
|
1065
|
-
private _socket;
|
|
1066
|
-
private _url;
|
|
652
|
+
static EVENT_REMOVE: string;
|
|
1067
653
|
/**
|
|
1068
|
-
*
|
|
654
|
+
* 插入数据节点
|
|
655
|
+
* dispatchParams = {node:TreeNode, before:TreeNode}
|
|
1069
656
|
*/
|
|
1070
|
-
|
|
657
|
+
static EVENT_INSERT: string;
|
|
1071
658
|
/**
|
|
1072
|
-
*
|
|
1073
|
-
*
|
|
659
|
+
* 刷新数据节点
|
|
660
|
+
* dispatchParams = {node:TreeNode}
|
|
1074
661
|
*/
|
|
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;
|
|
662
|
+
static EVENT_REFRESH: string;
|
|
1084
663
|
/**
|
|
1085
|
-
*
|
|
1086
|
-
*
|
|
664
|
+
* 设置数据时触发
|
|
665
|
+
* dispatchParams = {node:TreeNode}
|
|
1087
666
|
*/
|
|
1088
|
-
|
|
667
|
+
static EVENT_DATA_SET: string;
|
|
1089
668
|
/**
|
|
1090
|
-
*
|
|
669
|
+
* 设置数据时触发
|
|
670
|
+
* dispatchParams = {node:TreeNode, tag:string, value:any}
|
|
1091
671
|
*/
|
|
1092
|
-
|
|
672
|
+
static EVENT_TAGS_SET: string;
|
|
673
|
+
static create(): TreeRoot<any>;
|
|
1093
674
|
/**
|
|
1094
|
-
*
|
|
675
|
+
* 通过列表生成一个树结构
|
|
676
|
+
* @param items
|
|
677
|
+
* @param existed 列表将添加的已经存在的树结构
|
|
1095
678
|
*/
|
|
1096
|
-
|
|
1097
|
-
|
|
679
|
+
static createByList(items: ITreeListItem[], existed?: TreeRoot): TreeRoot;
|
|
680
|
+
static sortChildrenByName(node: TreeNode, des?: boolean): void;
|
|
681
|
+
constructor();
|
|
682
|
+
setNodeData(node: TreeNode, data: any): void;
|
|
683
|
+
setNodeTags(node: TreeNode, tag: string, value: any, force?: boolean): void;
|
|
684
|
+
getNodeByPath(path: string): TreeNode;
|
|
685
|
+
makeNodeByPath(path: string): TreeNode;
|
|
1098
686
|
/**
|
|
1099
|
-
*
|
|
1100
|
-
* @param
|
|
687
|
+
* 添加节点,按照 node.path 添加到正确的位置
|
|
688
|
+
* @param node
|
|
689
|
+
* @param parentPath 如果父节点路径为 "", 则添加到起源节点
|
|
690
|
+
* @param autoCreateParent 如果父节点不存在,自动创建
|
|
1101
691
|
*/
|
|
1102
|
-
|
|
692
|
+
addNode(node: TreeNode, parentPath?: string, autoCreateParent?: boolean): void;
|
|
693
|
+
removeNode(node: TreeNode): void;
|
|
694
|
+
removeChildren(node: TreeNode): void;
|
|
695
|
+
insertNode(node: TreeNode, before: TreeNode, resetId?: boolean): void;
|
|
696
|
+
walk(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
697
|
+
walkPrev(f: (node: TreeNode) => boolean, inChild?: (node: TreeNode) => boolean): void;
|
|
1103
698
|
/**
|
|
1104
|
-
*
|
|
1105
|
-
* @
|
|
699
|
+
* 派发 refresh 消息
|
|
700
|
+
* @param node
|
|
1106
701
|
*/
|
|
1107
|
-
|
|
1108
|
-
private _readByte;
|
|
1109
|
-
private _writeByte;
|
|
1110
|
-
private _bytesWrite;
|
|
702
|
+
refresh(node: TreeNode): void;
|
|
1111
703
|
/**
|
|
1112
|
-
*
|
|
1113
|
-
*
|
|
1114
|
-
*
|
|
1115
|
-
* @param bytes 要从中读取数据的 ByteArray 对象
|
|
1116
|
-
* @param offset ByteArray 对象中从零开始的偏移量,应由此开始执行数据写入
|
|
1117
|
-
* @param length 要写入的字节数。默认值 0 导致从 offset 参数指定的值开始写入整个缓冲区
|
|
1118
|
-
|
|
704
|
+
* 克隆当前的树结
|
|
705
|
+
* * 新的tags克隆旧的data
|
|
706
|
+
* * 新的data指向旧的data
|
|
1119
707
|
*/
|
|
1120
|
-
|
|
708
|
+
clone(): TreeRoot;
|
|
709
|
+
toString(): string;
|
|
710
|
+
createNode(id: string, isLeaf?: boolean): TreeNode;
|
|
1121
711
|
/**
|
|
1122
|
-
*
|
|
1123
|
-
* @param bytes 要将数据读入的 ByteArray 对象
|
|
1124
|
-
* @param offset 数据读取的偏移量应从该字节数组中开始
|
|
1125
|
-
* @param length 要读取的字节数。默认值 0 导致读取所有可用的数据
|
|
712
|
+
* origin的第一个child
|
|
1126
713
|
*/
|
|
1127
|
-
|
|
714
|
+
get firstNode(): TreeNode;
|
|
715
|
+
origin: TreeNode;
|
|
716
|
+
}
|
|
717
|
+
declare class TreeRootPlugin {
|
|
718
|
+
root: TreeRoot;
|
|
719
|
+
}
|
|
720
|
+
declare class TreeNodePlugin {
|
|
721
|
+
node: TreeNode;
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
interface IListItem {
|
|
1128
725
|
/**
|
|
1129
|
-
*
|
|
726
|
+
* 编号
|
|
1130
727
|
*/
|
|
1131
|
-
|
|
728
|
+
id: string;
|
|
1132
729
|
/**
|
|
1133
|
-
*
|
|
730
|
+
* 自定义数据
|
|
1134
731
|
*/
|
|
1135
|
-
|
|
732
|
+
data?: any;
|
|
1136
733
|
/**
|
|
1137
|
-
*
|
|
734
|
+
* 功能性标签,用于开发组件时,记录组件的状态。例如title, icon, 显示树的组件,需要 expanded,selected标签
|
|
1138
735
|
*/
|
|
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;
|
|
736
|
+
tags?: {
|
|
737
|
+
[key: string]: any;
|
|
1167
738
|
};
|
|
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
739
|
}
|
|
1202
|
-
|
|
1203
|
-
|
|
740
|
+
declare class ListNode {
|
|
741
|
+
static create(id: string, data?: any): ListNode;
|
|
742
|
+
constructor();
|
|
743
|
+
root: ListSource;
|
|
744
|
+
uuid: string;
|
|
1204
745
|
id: string;
|
|
1205
|
-
seq: number;
|
|
1206
|
-
serialMode: number;
|
|
1207
|
-
token: string;
|
|
1208
746
|
data: any;
|
|
1209
|
-
|
|
747
|
+
tags: {};
|
|
748
|
+
getTags(): {
|
|
749
|
+
[key: string]: any;
|
|
750
|
+
};
|
|
751
|
+
setTags(tags: {
|
|
752
|
+
[key: string]: any;
|
|
753
|
+
}): void;
|
|
754
|
+
getTag(name: string): any;
|
|
755
|
+
setTag(name: string, value: any): void;
|
|
1210
756
|
}
|
|
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;
|
|
757
|
+
declare class ListSource extends EventManager {
|
|
1282
758
|
/**
|
|
1283
|
-
*
|
|
1284
|
-
* @param
|
|
759
|
+
* 通过数组创建 ListSource。ListSource的id自动生成。如果需要指定编号,可设置 idCreator
|
|
760
|
+
* @param arr
|
|
761
|
+
* @param idCreator
|
|
1285
762
|
*/
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
reverse(): void;
|
|
1289
|
-
clear(): void;
|
|
763
|
+
static createByArray(arr: any[], idCreator?: (item: any) => string): ListSource;
|
|
764
|
+
static createByListItem(arr: IListItem[], target?: ListSource): any;
|
|
1290
765
|
/**
|
|
1291
|
-
*
|
|
1292
|
-
*
|
|
766
|
+
* 设置数据时触发
|
|
767
|
+
* dispatchParams = {node:ListNode}
|
|
1293
768
|
*/
|
|
1294
|
-
|
|
1295
|
-
get length(): number;
|
|
1296
|
-
insertAt(index: number, ...item: T[]): void;
|
|
769
|
+
static EVENT_ADD: string;
|
|
1297
770
|
/**
|
|
1298
|
-
*
|
|
1299
|
-
*
|
|
771
|
+
* 设置数据时触发
|
|
772
|
+
* dispatchParams = {node:ListNode, index:number}
|
|
1300
773
|
*/
|
|
1301
|
-
|
|
774
|
+
static EVENT_REMOVE: string;
|
|
1302
775
|
/**
|
|
1303
|
-
*
|
|
1304
|
-
* @param item
|
|
776
|
+
* 设置数据时触发
|
|
1305
777
|
*/
|
|
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;
|
|
778
|
+
static EVENT_REMOVE_ALL: string;
|
|
1312
779
|
/**
|
|
1313
|
-
*
|
|
1314
|
-
*
|
|
780
|
+
* 刷新数据节点
|
|
781
|
+
* dispatchParams = {node:ListNode}
|
|
1315
782
|
*/
|
|
1316
|
-
|
|
1317
|
-
getData(): T[];
|
|
1318
|
-
resetData(val: T[]): void;
|
|
783
|
+
static EVENT_REFRESH: string;
|
|
1319
784
|
/**
|
|
1320
|
-
*
|
|
1321
|
-
*
|
|
1322
|
-
* @param enableRepeat 允许重复
|
|
1323
|
-
* @param target
|
|
785
|
+
* 设置数据时触发
|
|
786
|
+
* dispatchParams = nodes: [ListNode], indexs: [number]
|
|
1324
787
|
*/
|
|
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;
|
|
788
|
+
static EVENT_SWAP: string;
|
|
1346
789
|
/**
|
|
790
|
+
* 设置数据时触发
|
|
791
|
+
* dispatchParams = {node:ListNode, data:any}
|
|
1347
792
|
*/
|
|
1348
|
-
|
|
793
|
+
static EVENT_DATA_SET: string;
|
|
1349
794
|
/**
|
|
1350
|
-
*
|
|
1351
|
-
*
|
|
795
|
+
* 设置数据时触发
|
|
796
|
+
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
1352
797
|
*/
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
798
|
+
static EVENT_TAGS_SET: string;
|
|
799
|
+
protected _identFunc: (node: ListNode) => boolean;
|
|
800
|
+
at(index: number): ListNode;
|
|
801
|
+
first(): ListNode;
|
|
802
|
+
last(): ListNode;
|
|
803
|
+
length(): number;
|
|
1357
804
|
/**
|
|
1358
|
-
*
|
|
1359
|
-
* @param
|
|
1360
|
-
* @param
|
|
805
|
+
* 添加项,无法添加相同的项
|
|
806
|
+
* @param node
|
|
807
|
+
* @param enableDispatch 默认为true
|
|
1361
808
|
*/
|
|
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;
|
|
809
|
+
add(node: ListNode, enableDispatch?: boolean): void;
|
|
810
|
+
getById(id: string): ListNode;
|
|
811
|
+
remove(node: ListNode): void;
|
|
812
|
+
removeAll(): void;
|
|
813
|
+
swap(a: ListNode, b: ListNode): void;
|
|
814
|
+
contains(node: ListNode): boolean;
|
|
815
|
+
containsById(id: string): boolean;
|
|
816
|
+
indexOf(node: ListNode): number;
|
|
817
|
+
indexOfById(id: string): number;
|
|
818
|
+
setData(node: ListNode, data: any): void;
|
|
819
|
+
setNodeTags(node: ListNode, tag: string, value: any): void;
|
|
1381
820
|
/**
|
|
1382
|
-
*
|
|
1383
|
-
* @param
|
|
1384
|
-
* @param subIdent 子编号
|
|
821
|
+
* 派发 refresh 消息
|
|
822
|
+
* @param node
|
|
1385
823
|
*/
|
|
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;
|
|
824
|
+
refresh(node: ListNode): void;
|
|
825
|
+
walk(f: (node: ListNode) => boolean): boolean;
|
|
826
|
+
walkPrev(node: ListNode, f: (node: ListNode) => boolean): boolean;
|
|
827
|
+
get data(): any[];
|
|
828
|
+
private _data;
|
|
1398
829
|
}
|
|
1399
830
|
|
|
1400
831
|
declare class DictIterator {
|
|
@@ -1478,2358 +909,445 @@ declare class Dictionary<K = string, V = any> {
|
|
|
1478
909
|
private _onDeleteCaller;
|
|
1479
910
|
}
|
|
1480
911
|
|
|
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;
|
|
912
|
+
declare class DictNode {
|
|
913
|
+
static create(id: string, data?: any): DictNode;
|
|
914
|
+
constructor();
|
|
915
|
+
uuid: string;
|
|
916
|
+
id: string;
|
|
917
|
+
data: any;
|
|
918
|
+
tags: {};
|
|
919
|
+
getTags(): {
|
|
920
|
+
[key: string]: any;
|
|
921
|
+
};
|
|
922
|
+
getTag(name: string): any;
|
|
923
|
+
setTag(name: string, value: any): void;
|
|
1499
924
|
/**
|
|
1500
|
-
*
|
|
1501
|
-
* @param eventType 事件类型
|
|
1502
|
-
* @param params 事件参数
|
|
925
|
+
* 清理【data】和【tags】
|
|
1503
926
|
*/
|
|
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>>;
|
|
927
|
+
clean(): void;
|
|
1511
928
|
}
|
|
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;
|
|
929
|
+
declare class DictSource extends Dictionary<string, DictNode> {
|
|
1535
930
|
/**
|
|
1536
|
-
*
|
|
931
|
+
* 刷新数据节点
|
|
932
|
+
* dispatchParams = {node:ListNode}
|
|
1537
933
|
*/
|
|
1538
|
-
|
|
934
|
+
static EVENT_REFRESH: string;
|
|
1539
935
|
/**
|
|
1540
|
-
*
|
|
1541
|
-
*
|
|
936
|
+
* 设置数据时触发
|
|
937
|
+
* dispatchParams = {node:ListNode, tag:string, value:any}
|
|
1542
938
|
*/
|
|
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>;
|
|
939
|
+
static EVENT_TAGS_SET: string;
|
|
940
|
+
setNodeTags(node: DictNode, tag: string, value: any): void;
|
|
941
|
+
refreshNode(node: DictNode): void;
|
|
942
|
+
get dispatcher(): EventManager;
|
|
943
|
+
protected _dispatcher: EventManager;
|
|
1582
944
|
}
|
|
1583
945
|
|
|
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;
|
|
946
|
+
declare class ListIterator {
|
|
947
|
+
break(): void;
|
|
948
|
+
isBreak(): boolean;
|
|
949
|
+
protected _isBreak: any;
|
|
1618
950
|
}
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
951
|
+
declare class List<T = any> {
|
|
952
|
+
constructor();
|
|
953
|
+
onSet(caller: any, handler: (value: T) => void): void;
|
|
954
|
+
onDelete(caller: any, handler: (value: T) => void): void;
|
|
955
|
+
firstByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
956
|
+
lastByCondition(conf: (index: number, item: T) => boolean): [number, T];
|
|
957
|
+
forEach(handler: (index: number, item: T, iterator: ListIterator) => void): ListIterator;
|
|
1625
958
|
/**
|
|
1626
|
-
*
|
|
1627
|
-
* @param
|
|
1628
|
-
* @param
|
|
959
|
+
* 移除符合条件的项, 从后往前遍历
|
|
960
|
+
* @param cond 可以使用【iterator】中断遍历
|
|
961
|
+
* @param removedList 设置后,可获得被移除的项
|
|
1629
962
|
*/
|
|
1630
|
-
|
|
1631
|
-
enable(): void;
|
|
1632
|
-
disable(): void;
|
|
1633
|
-
destroy(): void;
|
|
963
|
+
removeByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, removedList?: List): this;
|
|
1634
964
|
/**
|
|
1635
|
-
*
|
|
965
|
+
* 查找符合条件的项保存到【target】对象中,并返回【target】对象
|
|
966
|
+
* @param cond 可以使用【iterator】中断遍历
|
|
967
|
+
* @param target 存到目标对象中
|
|
1636
968
|
*/
|
|
1637
|
-
|
|
969
|
+
findByCondition(cond: (index: number, val: T, iterator: ListIterator) => boolean, target: List): this;
|
|
970
|
+
pop(): T;
|
|
971
|
+
shift(): T;
|
|
972
|
+
first(): T;
|
|
973
|
+
last(): T;
|
|
974
|
+
removeAt(index: number): void;
|
|
975
|
+
remove(item: T): void;
|
|
1638
976
|
/**
|
|
1639
|
-
*
|
|
977
|
+
* 把【other】的项合并到自身
|
|
978
|
+
* @param other
|
|
1640
979
|
*/
|
|
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;
|
|
980
|
+
removeList(other: List<T>): void;
|
|
981
|
+
sort(compareFn?: (a: T, b: T) => number): void;
|
|
982
|
+
reverse(): void;
|
|
983
|
+
clear(): void;
|
|
1651
984
|
/**
|
|
1652
|
-
*
|
|
1653
|
-
* @param
|
|
985
|
+
* 克隆自身所有项到【target】对象,并返回【target】对象
|
|
986
|
+
* @param target
|
|
1654
987
|
*/
|
|
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;
|
|
988
|
+
clone(target: this): this;
|
|
989
|
+
get length(): number;
|
|
990
|
+
insertAt(index: number, ...item: T[]): void;
|
|
1686
991
|
/**
|
|
1687
|
-
*
|
|
1688
|
-
* @param
|
|
1689
|
-
* @param destroyGroup
|
|
992
|
+
* @param beforeItem
|
|
993
|
+
* @param item
|
|
1690
994
|
*/
|
|
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;
|
|
995
|
+
insertBefore(beforeItem: T, ...item: T[]): void;
|
|
1706
996
|
/**
|
|
1707
|
-
*
|
|
1708
|
-
* @param
|
|
997
|
+
* @param afterItem
|
|
998
|
+
* @param item
|
|
1709
999
|
*/
|
|
1710
|
-
|
|
1711
|
-
|
|
1000
|
+
insertAfter(afterItem: T, ...item: T[]): void;
|
|
1001
|
+
at(index: number): T;
|
|
1002
|
+
set(index: number, item: T): void;
|
|
1003
|
+
indexOf(item: T): number;
|
|
1004
|
+
has(item: T): boolean;
|
|
1005
|
+
push(item: T): void;
|
|
1712
1006
|
/**
|
|
1713
|
-
*
|
|
1714
|
-
* @param
|
|
1007
|
+
* 把【other】的项合并到自身
|
|
1008
|
+
* @param other
|
|
1715
1009
|
*/
|
|
1716
|
-
|
|
1010
|
+
pushList(other: List<T>): void;
|
|
1011
|
+
getData(): T[];
|
|
1012
|
+
resetData(val: T[]): void;
|
|
1717
1013
|
/**
|
|
1718
|
-
*
|
|
1719
|
-
* @param
|
|
1014
|
+
* 随机获取【count】个项,并返回【target】对象
|
|
1015
|
+
* @param count
|
|
1016
|
+
* @param enableRepeat 允许重复
|
|
1017
|
+
* @param target
|
|
1720
1018
|
*/
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
protected
|
|
1019
|
+
random(count: number, enableRepeat?: boolean, target?: List<T>): List<T>;
|
|
1020
|
+
protected callPush(value: any): void;
|
|
1021
|
+
protected callRemove(value: any): void;
|
|
1022
|
+
protected _data: any[];
|
|
1023
|
+
private _onSet;
|
|
1024
|
+
private _onDelete;
|
|
1025
|
+
private _onSetCaller;
|
|
1026
|
+
private _onDeleteCaller;
|
|
1725
1027
|
}
|
|
1726
1028
|
|
|
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;
|
|
1029
|
+
declare class UIObjectDict extends Dictionary<string, any | List> {
|
|
1739
1030
|
/**
|
|
1740
|
-
*
|
|
1741
|
-
* @param
|
|
1742
|
-
* @param rangeOut 点击除去目标的区域时触发
|
|
1031
|
+
* 获取唯一的
|
|
1032
|
+
* @param prefab
|
|
1743
1033
|
*/
|
|
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;
|
|
1034
|
+
uniqueObject(prefab: Prefab): Node;
|
|
1035
|
+
removeObject(prefab: Prefab): void;
|
|
1036
|
+
popObject(prefab: Prefab): any;
|
|
1037
|
+
backObject(object: Node): void;
|
|
1038
|
+
protected getList(key: any): List;
|
|
1795
1039
|
}
|
|
1040
|
+
declare var uidict: UIObjectDict;
|
|
1796
1041
|
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1042
|
+
declare class ViewController extends Component {
|
|
1043
|
+
constructor(name: string);
|
|
1044
|
+
open(...args: any[]): void;
|
|
1045
|
+
close(): void;
|
|
1046
|
+
get objectDict(): UIObjectDict;
|
|
1047
|
+
protected _objectDict: UIObjectDict;
|
|
1801
1048
|
}
|
|
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;
|
|
1049
|
+
declare class ControllerDict extends Dictionary<string, ViewController> {
|
|
1050
|
+
getByName(name: string): ViewController;
|
|
1051
|
+
register(controller: ViewController): void;
|
|
1816
1052
|
}
|
|
1053
|
+
declare var ctrlrepo: ControllerDict;
|
|
1817
1054
|
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
protected
|
|
1825
|
-
protected
|
|
1826
|
-
protected
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1055
|
+
declare class PageController extends ViewController {
|
|
1056
|
+
constructor(routeName: string, config?: {
|
|
1057
|
+
layer?: string;
|
|
1058
|
+
tags?: string[];
|
|
1059
|
+
enableHistory?: boolean;
|
|
1060
|
+
});
|
|
1061
|
+
protected onOpening(page: Page): void;
|
|
1062
|
+
protected onOpened(page: Page): void;
|
|
1063
|
+
protected onClosing(page: Page): void;
|
|
1064
|
+
protected onClosed(page: Page): void;
|
|
1065
|
+
protected onRefresh(page: Page): void;
|
|
1066
|
+
openByRoute(route: Route): Page;
|
|
1067
|
+
private openPage;
|
|
1068
|
+
openComplete(page: Page): void;
|
|
1069
|
+
closeByRoute(route?: Route): Page;
|
|
1070
|
+
private closePage;
|
|
1071
|
+
closeComplete(page: Page): void;
|
|
1072
|
+
refresh(): void;
|
|
1073
|
+
get layer(): string;
|
|
1074
|
+
hasTags(tags: string[]): boolean;
|
|
1075
|
+
setLayer(name: string): this;
|
|
1076
|
+
setTags(tags: string[]): this;
|
|
1077
|
+
get lastPage(): Page;
|
|
1078
|
+
get route(): Route;
|
|
1079
|
+
get enableHistory(): boolean;
|
|
1080
|
+
protected _enableHistory: boolean;
|
|
1081
|
+
protected _route: Route;
|
|
1082
|
+
protected _lastPage: Page;
|
|
1083
|
+
protected _tags: {};
|
|
1084
|
+
protected _layer: string;
|
|
1832
1085
|
}
|
|
1833
1086
|
|
|
1834
|
-
declare
|
|
1835
|
-
break(): void;
|
|
1836
|
-
isBreak(): boolean;
|
|
1837
|
-
protected _isBreak: any;
|
|
1838
|
-
}
|
|
1839
|
-
interface ITreeListItem {
|
|
1087
|
+
declare enum PageState {
|
|
1840
1088
|
/**
|
|
1841
|
-
*
|
|
1089
|
+
* 关闭
|
|
1842
1090
|
*/
|
|
1843
|
-
|
|
1091
|
+
Closed = 0,
|
|
1844
1092
|
/**
|
|
1845
|
-
*
|
|
1093
|
+
* 正在打开
|
|
1846
1094
|
*/
|
|
1847
|
-
|
|
1095
|
+
Opening = 1,
|
|
1848
1096
|
/**
|
|
1849
|
-
*
|
|
1097
|
+
* 已打开
|
|
1850
1098
|
*/
|
|
1851
|
-
|
|
1852
|
-
[key: string]: any;
|
|
1853
|
-
};
|
|
1099
|
+
Opened = 2,
|
|
1854
1100
|
/**
|
|
1855
|
-
*
|
|
1101
|
+
* 正在关闭
|
|
1856
1102
|
*/
|
|
1857
|
-
|
|
1103
|
+
Closeing = 3
|
|
1858
1104
|
}
|
|
1859
|
-
declare
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
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
|
|
2056
|
-
*/
|
|
2057
|
-
clone(): TreeRoot;
|
|
2058
|
-
toString(): string;
|
|
2059
|
-
createNode(id: string, isLeaf?: boolean): TreeNode;
|
|
2060
|
-
/**
|
|
2061
|
-
* origin的第一个child
|
|
2062
|
-
*/
|
|
2063
|
-
get firstNode(): TreeNode;
|
|
2064
|
-
origin: TreeNode;
|
|
2065
|
-
}
|
|
2066
|
-
declare class TreeRootPlugin {
|
|
2067
|
-
root: TreeRoot;
|
|
2068
|
-
}
|
|
2069
|
-
declare class TreeNodePlugin {
|
|
2070
|
-
node: TreeNode;
|
|
2071
|
-
}
|
|
2072
|
-
|
|
2073
|
-
interface IListItem {
|
|
2074
|
-
/**
|
|
2075
|
-
* 编号
|
|
2076
|
-
*/
|
|
2077
|
-
id: string;
|
|
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;
|
|
3628
|
-
/**
|
|
3629
|
-
* @param 配置
|
|
3630
|
-
* @param enableDispatch
|
|
3631
|
-
* @see ConfigSet.EVENT_ADD
|
|
3632
|
-
*/
|
|
3633
|
-
添加配置(配置: Config, enableDispatch?: boolean): error;
|
|
3634
|
-
删除配置集(set: ConfigSet, enableDispatch?: boolean): error;
|
|
3635
|
-
/**
|
|
3636
|
-
*
|
|
3637
|
-
* @param 编号
|
|
3638
|
-
* @param enableDispatch
|
|
3639
|
-
* @see ConfigSet.EVENT_DELETE
|
|
3640
|
-
*/
|
|
3641
|
-
删除配置(编号: string, enableDispatch?: boolean): error;
|
|
1105
|
+
declare enum PageEvent {
|
|
1106
|
+
Opening = "opening",
|
|
1107
|
+
Opened = "opened",
|
|
1108
|
+
Closeing = "closeing",
|
|
1109
|
+
Closed = "closed",
|
|
1110
|
+
Stop = "stop"
|
|
1111
|
+
}
|
|
1112
|
+
declare class Page extends EventManager {
|
|
1113
|
+
constructor(controller: PageController, route: Route);
|
|
3642
1114
|
/**
|
|
3643
|
-
*
|
|
3644
|
-
* @param 配置
|
|
3645
|
-
* @param 新编号
|
|
1115
|
+
* 等待打开完成指令
|
|
3646
1116
|
*/
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
1117
|
+
waitOpenComplete(): void;
|
|
1118
|
+
waitCloseComplete(): void;
|
|
1119
|
+
openComplete(): void;
|
|
1120
|
+
closeComplete(): void;
|
|
1121
|
+
stop(reason: LinkError): void;
|
|
3650
1122
|
/**
|
|
3651
|
-
*
|
|
3652
|
-
*
|
|
3653
|
-
* @param 配置
|
|
3654
|
-
* @param path
|
|
3655
|
-
* @param value
|
|
1123
|
+
* 等待发送的结果
|
|
1124
|
+
* 如果返回 null,表示主动取消 [cancel]
|
|
3656
1125
|
*/
|
|
3657
|
-
|
|
3658
|
-
|
|
3659
|
-
|
|
3660
|
-
|
|
3661
|
-
|
|
1126
|
+
wait(): Promise<this>;
|
|
1127
|
+
toString(): string;
|
|
1128
|
+
get objectDict(): UIObjectDict;
|
|
1129
|
+
protected _objectDict: UIObjectDict;
|
|
1130
|
+
protected _waitOpenComplete: boolean;
|
|
1131
|
+
protected _waitCloseComplete: boolean;
|
|
1132
|
+
get controller(): PageController;
|
|
1133
|
+
get route(): Route;
|
|
1134
|
+
cache: {};
|
|
1135
|
+
tags: {};
|
|
1136
|
+
layer: string;
|
|
1137
|
+
state: PageState;
|
|
1138
|
+
protected _controller: PageController;
|
|
1139
|
+
protected _route: Route;
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
/**
|
|
1143
|
+
* 视图管理器
|
|
1144
|
+
* 打开一个视图的时候,可能会听过加载资源,读取数据,调整布局,切换特效等处理,所以使用视图模式封装视图打开关闭的逻辑
|
|
1145
|
+
*/
|
|
1146
|
+
declare class PageLayer {
|
|
1147
|
+
name: string;
|
|
1148
|
+
constructor(name: string);
|
|
1149
|
+
close(): void;
|
|
3662
1150
|
/**
|
|
3663
|
-
*
|
|
1151
|
+
* 当前的页面
|
|
3664
1152
|
*/
|
|
3665
|
-
|
|
3666
|
-
[key: string]: any;
|
|
3667
|
-
};
|
|
3668
|
-
toKeys(): string[];
|
|
1153
|
+
currentPage: Page;
|
|
3669
1154
|
}
|
|
3670
1155
|
|
|
3671
|
-
declare class
|
|
3672
|
-
_default: ConfigSet;
|
|
3673
|
-
get default(): ConfigSet;
|
|
3674
|
-
registerCascader(key: string, root: TreeRoot): void;
|
|
3675
|
-
getCascader(path: string): TreeRoot;
|
|
3676
|
-
_cascader: {
|
|
3677
|
-
[key: string]: TreeRoot;
|
|
3678
|
-
};
|
|
1156
|
+
declare class PageList extends List<Page> {
|
|
3679
1157
|
}
|
|
3680
|
-
declare
|
|
3681
|
-
|
|
3682
|
-
|
|
3683
|
-
getBy编号(编号: string): Config;
|
|
3684
|
-
findByCondition(cond: (key: string, val: Config, iterator: DictIterator) => boolean): this;
|
|
3685
|
-
getBy模版(编号: string): Config;
|
|
3686
|
-
listBy文件(指定文件?: string): ConfigDict;
|
|
3687
|
-
listBy目录(指定目录?: string): ConfigDict;
|
|
3688
|
-
listBy分类(指定分类?: string): ConfigDict;
|
|
3689
|
-
listBy类型(指定类型?: string): ConfigDict;
|
|
3690
|
-
list所有分类(): string[];
|
|
3691
|
-
list所有类型(): string[];
|
|
3692
|
-
list所有文件(): string[];
|
|
1158
|
+
declare class PageRepo extends PageList {
|
|
1159
|
+
constructor();
|
|
1160
|
+
openByString(route: string): Page;
|
|
3693
1161
|
/**
|
|
3694
|
-
*
|
|
3695
|
-
*
|
|
3696
|
-
* @param
|
|
1162
|
+
* 打开页面
|
|
1163
|
+
* 一个路由代表一个页面
|
|
1164
|
+
* @param route
|
|
3697
1165
|
*/
|
|
3698
|
-
|
|
1166
|
+
open(route: Route): Page;
|
|
1167
|
+
close(route: Route): void;
|
|
3699
1168
|
/**
|
|
3700
|
-
*
|
|
3701
|
-
* @param
|
|
3702
|
-
* @param 路径名和标题处理器 默认使用[item.编号, item.名称]
|
|
1169
|
+
* 如果页面存在,则刷新
|
|
1170
|
+
* @param route
|
|
3703
1171
|
*/
|
|
3704
|
-
|
|
1172
|
+
refresh(route: Route): void;
|
|
3705
1173
|
/**
|
|
3706
|
-
*
|
|
1174
|
+
* 历史记录
|
|
3707
1175
|
*/
|
|
3708
|
-
|
|
1176
|
+
getHistory(): Route[];
|
|
1177
|
+
back(): void;
|
|
1178
|
+
getByRoute(route: Route): Page;
|
|
1179
|
+
listByTags(tags: string[]): PageList;
|
|
1180
|
+
getLayerMain(): PageLayer;
|
|
3709
1181
|
/**
|
|
3710
|
-
*
|
|
3711
|
-
* @param 指定属性
|
|
1182
|
+
* @param name
|
|
3712
1183
|
*/
|
|
3713
|
-
|
|
1184
|
+
getLayer(name: string): PageLayer;
|
|
1185
|
+
protected getOrNewLayer(name: string): PageLayer;
|
|
1186
|
+
getController(route: Route): PageController;
|
|
1187
|
+
get objectDict(): UIObjectDict;
|
|
1188
|
+
protected _objectDict: UIObjectDict;
|
|
1189
|
+
protected _indexLayer: {};
|
|
1190
|
+
protected _indexRoute: {};
|
|
1191
|
+
protected _history: Route[];
|
|
1192
|
+
}
|
|
1193
|
+
declare const pagerepo: PageRepo;
|
|
1194
|
+
|
|
1195
|
+
/**
|
|
1196
|
+
* 事件字符串分隔符
|
|
1197
|
+
*/
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* 回调列表
|
|
1201
|
+
*/
|
|
1202
|
+
declare class CallbackList<PARAMS = any> {
|
|
1203
|
+
constructor();
|
|
1204
|
+
addListener(listener: Listener): void;
|
|
1205
|
+
removeListener(listener: Listener): void;
|
|
3714
1206
|
/**
|
|
3715
|
-
* 用于复制文件时使用,不触发事件,不修改缓存
|
|
3716
|
-
* @param 配置
|
|
3717
|
-
* @param 新编号
|
|
3718
1207
|
*/
|
|
3719
|
-
|
|
1208
|
+
create(): Listener<PARAMS>;
|
|
3720
1209
|
/**
|
|
3721
|
-
*
|
|
1210
|
+
* 如果监听器已经不存在,则创建
|
|
1211
|
+
* @param ident
|
|
3722
1212
|
*/
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
1213
|
+
createByIdent(ident: any): Listener<PARAMS>;
|
|
1214
|
+
removeByIdent(ident: any): void;
|
|
1215
|
+
removeByCaller(caller: any): void;
|
|
1216
|
+
getByIdent(ident: any): Listener;
|
|
3726
1217
|
/**
|
|
3727
|
-
*
|
|
3728
|
-
*
|
|
1218
|
+
* 派发事件
|
|
1219
|
+
* @param params 事件参数
|
|
1220
|
+
* @param subIdent
|
|
3729
1221
|
*/
|
|
3730
|
-
|
|
3731
|
-
|
|
1222
|
+
dispatch(params?: PARAMS, subIdent?: string): void;
|
|
1223
|
+
protected _data: List<Listener<any>>;
|
|
1224
|
+
protected _indexIdent: {};
|
|
1225
|
+
}
|
|
1226
|
+
|
|
1227
|
+
declare class Listener<PARAMS = any> {
|
|
1228
|
+
static create(ident?: string): Listener<any>;
|
|
1229
|
+
constructor(ident?: string);
|
|
1230
|
+
getCaller(): any;
|
|
1231
|
+
setCaller(caller: any): this;
|
|
1232
|
+
setSubIdent(val: string): this;
|
|
1233
|
+
setCondition(condition: (listener: Listener<PARAMS>) => boolean): this;
|
|
1234
|
+
setHandler(handler: (listener: Listener<PARAMS>) => void): this;
|
|
1235
|
+
setOnParams(val: any): this;
|
|
1236
|
+
getIdent(): string;
|
|
1237
|
+
on(): this;
|
|
1238
|
+
off(): this;
|
|
1239
|
+
isOn(): boolean;
|
|
1240
|
+
remove(): void;
|
|
3732
1241
|
/**
|
|
3733
|
-
*
|
|
3734
|
-
*
|
|
1242
|
+
* 内部使用
|
|
1243
|
+
* @param params
|
|
1244
|
+
* @param subIdent 子编号
|
|
3735
1245
|
*/
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
|
|
3741
|
-
|
|
3742
|
-
protected
|
|
1246
|
+
_dispatch(params: PARAMS, subIdent?: string): void;
|
|
1247
|
+
getOnParams(): any;
|
|
1248
|
+
getParams(): PARAMS;
|
|
1249
|
+
protected onParams: any;
|
|
1250
|
+
protected params: PARAMS;
|
|
1251
|
+
protected ident: string;
|
|
1252
|
+
protected _subIdent: string;
|
|
1253
|
+
protected source: CallbackList;
|
|
1254
|
+
protected _handler: (any: any) => void;
|
|
1255
|
+
protected _condition: (any: any) => boolean;
|
|
1256
|
+
protected caller: any;
|
|
1257
|
+
protected _isOn: boolean;
|
|
3743
1258
|
}
|
|
3744
1259
|
|
|
3745
|
-
|
|
3746
|
-
|
|
3747
|
-
|
|
3748
|
-
|
|
3749
|
-
|
|
3750
|
-
|
|
3751
|
-
|
|
1260
|
+
/**
|
|
1261
|
+
* 事件字符串分隔符
|
|
1262
|
+
*/
|
|
1263
|
+
|
|
1264
|
+
/**
|
|
1265
|
+
* 事件派发器
|
|
1266
|
+
*/
|
|
1267
|
+
declare class Dispatcher implements ISchedulable {
|
|
1268
|
+
constructor(name?: string);
|
|
1269
|
+
dispose(): void;
|
|
1270
|
+
create(type: string, listener: Listener): void;
|
|
1271
|
+
remove(type: string, listener: Listener): void;
|
|
1272
|
+
getByIdent(type: string, ident: string): Listener;
|
|
3752
1273
|
/**
|
|
3753
|
-
*
|
|
3754
|
-
* @param
|
|
1274
|
+
* @param type
|
|
1275
|
+
* @param ident
|
|
3755
1276
|
*/
|
|
3756
|
-
|
|
1277
|
+
createByIdent(type: string, ident: string): Listener;
|
|
3757
1278
|
/**
|
|
3758
|
-
*
|
|
1279
|
+
* 派发事件
|
|
1280
|
+
* @param eventType 事件类型
|
|
1281
|
+
* @param params 事件参数
|
|
3759
1282
|
*/
|
|
3760
|
-
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
|
|
3767
|
-
|
|
3768
|
-
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
|
|
1283
|
+
dispatch(eventType: string, params?: any): void;
|
|
1284
|
+
protected getList(type: string): CallbackList;
|
|
1285
|
+
id?: string;
|
|
1286
|
+
uuid?: string;
|
|
1287
|
+
name: string;
|
|
1288
|
+
protected isDispose: boolean;
|
|
1289
|
+
protected typeToList: Dictionary<string, CallbackList<any>>;
|
|
1290
|
+
}
|
|
1291
|
+
|
|
1292
|
+
type CreatorFunction = (...args: any[]) => {};
|
|
1293
|
+
/**
|
|
1294
|
+
* 回收的方法
|
|
1295
|
+
* 使用回收方法的原因是,某些对象没有recycle函数,由不方便实现recycle函数
|
|
1296
|
+
*/
|
|
1297
|
+
type RecycleFunction = (item: any, ...args: any[]) => void;
|
|
1298
|
+
/**
|
|
1299
|
+
* 释放的方法
|
|
1300
|
+
*/
|
|
1301
|
+
type DisposeFunction = (item: any, ...args: any[]) => void;
|
|
1302
|
+
/**
|
|
1303
|
+
* 对象池
|
|
1304
|
+
*/
|
|
1305
|
+
declare class Pool {
|
|
1306
|
+
creatorFunction: CreatorFunction;
|
|
1307
|
+
recycleFunction: RecycleFunction;
|
|
1308
|
+
disposeFunction: DisposeFunction;
|
|
1309
|
+
name: string;
|
|
1310
|
+
list: any[];
|
|
1311
|
+
constructor(config: {
|
|
1312
|
+
creatorFunction: CreatorFunction;
|
|
1313
|
+
recycleFunction?: RecycleFunction;
|
|
1314
|
+
disposeFunction?: DisposeFunction;
|
|
1315
|
+
name?: string;
|
|
1316
|
+
});
|
|
3778
1317
|
/**
|
|
3779
|
-
*
|
|
3780
|
-
* @param 编号
|
|
3781
|
-
* @param enableDispatch
|
|
3782
|
-
* @see ConfigSet.EVENT_DELETE
|
|
1318
|
+
* 获取一个对象
|
|
3783
1319
|
*/
|
|
3784
|
-
|
|
3785
|
-
removeBy文件(路径: string): void;
|
|
3786
|
-
reset文件(fromPath: any, toPath: string): void;
|
|
1320
|
+
getObject(...args: any[]): any;
|
|
3787
1321
|
/**
|
|
3788
|
-
*
|
|
3789
|
-
*
|
|
3790
|
-
* @param 配置
|
|
3791
|
-
* @param path
|
|
3792
|
-
* @param value
|
|
1322
|
+
* 回收一个对象
|
|
1323
|
+
* @param obj
|
|
3793
1324
|
*/
|
|
3794
|
-
|
|
1325
|
+
recycleObject(obj: any): void;
|
|
3795
1326
|
/**
|
|
3796
|
-
*
|
|
3797
|
-
* @param
|
|
1327
|
+
* 释放一个对象
|
|
1328
|
+
* @param obj
|
|
3798
1329
|
*/
|
|
3799
|
-
|
|
1330
|
+
disposeObject(obj: any): void;
|
|
3800
1331
|
/**
|
|
3801
|
-
*
|
|
3802
|
-
* @param config
|
|
1332
|
+
* 释放对象池
|
|
3803
1333
|
*/
|
|
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;
|
|
1334
|
+
dispose(): void;
|
|
3817
1335
|
}
|
|
3818
|
-
|
|
3819
|
-
|
|
3820
|
-
|
|
3821
|
-
|
|
3822
|
-
|
|
3823
|
-
|
|
3824
|
-
static EVENT_ADD: string;
|
|
1336
|
+
/**
|
|
1337
|
+
* 对象池
|
|
1338
|
+
*/
|
|
1339
|
+
declare class SamplePool {
|
|
1340
|
+
list: any[];
|
|
1341
|
+
constructor();
|
|
3825
1342
|
/**
|
|
3826
|
-
*
|
|
1343
|
+
* 获取一个对象
|
|
3827
1344
|
*/
|
|
3828
|
-
|
|
1345
|
+
get(): any;
|
|
3829
1346
|
/**
|
|
3830
|
-
*
|
|
1347
|
+
* 回收一个对象
|
|
1348
|
+
* @param obj
|
|
3831
1349
|
*/
|
|
3832
|
-
|
|
1350
|
+
put(obj: any): void;
|
|
3833
1351
|
}
|
|
3834
1352
|
|
|
3835
1353
|
declare class ConvertUtil {
|
|
@@ -4242,114 +1760,5 @@ declare const pathutil: PathUtil;
|
|
|
4242
1760
|
declare function parsePlist(plist: any, texture: any): SpriteAtlas;
|
|
4243
1761
|
declare function loadAtlas(url: any, callback: any): void;
|
|
4244
1762
|
|
|
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 };
|
|
1763
|
+
export { ArrayUtil, 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, XEvent, arrayutil, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, maputil, mathutil, netutil, pagerepo, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timeutil, uidict, uimgr, uiutil };
|
|
1764
|
+
export type { CreatorFunction, DisposeFunction, IController, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction, error };
|