@zhongguo168a/yxeditor-common 0.0.12 → 0.0.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  import { HorizontalTextAlignment, VerticalTextAlignment, Scheduler, Prefab, Node, Component, ISchedulable, AssetManager, Asset, SpriteAtlas, Vec2, Vec3, Vec4 } from 'cc';
2
2
 
3
- interface error {
3
+ interface IError {
4
4
  isCancel(): boolean;
5
5
  is(ident: string): boolean;
6
6
  toString(): string;
@@ -10,7 +10,7 @@ interface error {
10
10
  * 链式错误
11
11
  * err1 <argA=val&argB=val>
12
12
  */
13
- declare class LinkError {
13
+ declare class LinkError implements IError {
14
14
  next: LinkError;
15
15
  ident: string;
16
16
  args: {
@@ -40,7 +40,7 @@ declare class ErrorUtil {
40
40
  warp(err: LinkError, ident: any, args?: {
41
41
  [key: string]: any;
42
42
  }): LinkError;
43
- to(err: error): LinkError;
43
+ to(err: IError): LinkError;
44
44
  }
45
45
  declare const errorutil: ErrorUtil;
46
46
 
@@ -124,7 +124,7 @@ declare class UIManager {
124
124
  * 获取UI对象池中的一个对象
125
125
  * @param key
126
126
  */
127
- getPoolObject(key: string): [any, error];
127
+ getPoolObject(key: string): [any, IError];
128
128
  /**
129
129
  * 返回UI到对象池中
130
130
  * @param key
@@ -141,7 +141,7 @@ declare class UIManager {
141
141
  * 引用计数+1
142
142
  * @param key
143
143
  */
144
- getSingle(key: string): [any, error];
144
+ getSingle(key: string): [any, IError];
145
145
  /**
146
146
  * 返还UI对象
147
147
  * 引用计数-1,当引用计数等于0时,放入待清理列表
@@ -1408,6 +1408,65 @@ declare class AssetLoader extends Dispatcher {
1408
1408
 
1409
1409
  declare function parseAtlas(name: any, plist: any, texture: any): SpriteAtlas;
1410
1410
 
1411
+ declare enum LogLevel {
1412
+ DEBUG = 0,
1413
+ INFO = 1,
1414
+ WARNING = 2,
1415
+ ERROR = 3
1416
+ }
1417
+ declare class Logger {
1418
+ name: string;
1419
+ level: LogLevel;
1420
+ ignoreRegexp: any[];
1421
+ ignoreString: any[];
1422
+ protected _enable: boolean;
1423
+ disable(): void;
1424
+ canLogByLevel(level: LogLevel): boolean;
1425
+ canLog(msg: string, level: LogLevel): boolean;
1426
+ debug(msg: string, ...data: any[]): void;
1427
+ info(msg: string, ...data: any[]): void;
1428
+ infof(msgCreator: () => string): void;
1429
+ warning(msg: string, ...data: any[]): void;
1430
+ error(msg: string, ...data: any[]): void;
1431
+ }
1432
+
1433
+ declare const LOGGER_EVENT = "Event";
1434
+ declare class LogManager {
1435
+ /**
1436
+ * 获取事件的日志管理
1437
+ * 日志的group为事件类型
1438
+ */
1439
+ getEventLogger(): Logger;
1440
+ /**
1441
+ * 获取日志管理
1442
+ */
1443
+ getLogger(name: string): Logger;
1444
+ protected _loggers: {};
1445
+ /**
1446
+ * 是否开启日志
1447
+ */
1448
+ enable: boolean;
1449
+ protected ignores: any[];
1450
+ /**
1451
+ * 忽视包含指定字符串的日志
1452
+ * @param val
1453
+ */
1454
+ ignoreString(val: string): void;
1455
+ /**
1456
+ * 取消指定的日志
1457
+ * @param val
1458
+ */
1459
+ ignoreStringCancel(val: string): void;
1460
+ /**
1461
+ * 是否可以输出日志
1462
+ * @param type
1463
+ * @private
1464
+ */
1465
+ canLog(type: string): boolean;
1466
+ disableSystemConsole(): void;
1467
+ }
1468
+ declare const logmgr: LogManager;
1469
+
1411
1470
  type CreatorFunction = (...args: any[]) => {};
1412
1471
  /**
1413
1472
  * 回收的方法
@@ -1789,13 +1848,13 @@ declare class MathUtil {
1789
1848
  declare const mathutil: MathUtil;
1790
1849
 
1791
1850
  declare class ResUtil {
1792
- loadResource(path: string): Promise<[any, error]>;
1793
- preloadResource(path: string): Promise<[any, error]>;
1794
- loadBubble(bundle: string): Promise<[AssetManager.Bundle, error]>;
1795
- loadBubbleItem(bubble: AssetManager.Bundle, path: string, type: any): Promise<[any, error]>;
1796
- loadAtlas(path: string): Promise<[SpriteAtlas, error]>;
1851
+ loadResource(path: string): Promise<[any, IError]>;
1852
+ preloadResource(path: string): Promise<[any, IError]>;
1853
+ loadBubble(bundle: string): Promise<[AssetManager.Bundle, IError]>;
1854
+ loadBubbleItem(bubble: AssetManager.Bundle, path: string, type: any): Promise<[any, IError]>;
1855
+ loadAtlas(path: string): Promise<[SpriteAtlas, IError]>;
1797
1856
  getByPath(path: string, type: any): any;
1798
- loadByPath(path: string, type: any): Promise<[any, error]>;
1857
+ loadByPath(path: string, type: any): Promise<[any, IError]>;
1799
1858
  loadByPathCallback(path: string, type: any, callback: (any: any, error: any) => void): void;
1800
1859
  }
1801
1860
  declare var resutil: ResUtil;
@@ -1879,5 +1938,5 @@ declare const pathutil: PathUtil;
1879
1938
  declare function parsePlist(plist: any, texture: any): SpriteAtlas;
1880
1939
  declare function loadAtlas(url: any, callback: any): void;
1881
1940
 
1882
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LinkError, List, ListIterator, ListNode, ListSource, Listener, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, uidict, uimgr, uiutil };
1883
- export type { CreatorFunction, DisposeFunction, IController, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction, error };
1941
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, uidict, uimgr, uiutil };
1942
+ export type { CreatorFunction, DisposeFunction, IController, IError, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction };
package/dist/index.esm.js CHANGED
@@ -6099,5 +6099,5 @@ class PathUtil {
6099
6099
  }
6100
6100
  const pathutil = new PathUtil();
6101
6101
 
6102
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LinkError, List, ListIterator, ListNode, ListSource, Listener, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, uidict, uimgr, uiutil };
6102
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, Controller, ControllerDict, ControllerSet, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, ErrorUtil, EventItem, EventManager, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, Module, NetUtil, Page, PageController, PageEvent, PageLayer, PageList, PageRepo, PageState, PathUtil, Pool, RandUtil, Route, SampleCallbackList, SamplePool, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, XAssetManager, XEvent, arrayutil, assetx, bitutil, convertutil, ctrlrepo, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, pagerepo, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, uidict, uimgr, uiutil };
6103
6103
  //# sourceMappingURL=index.esm.js.map