@zhongguo168a/yxeditor-common 0.0.13 → 0.0.15

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时,放入待清理列表
@@ -1527,6 +1527,14 @@ declare class SamplePool {
1527
1527
  */
1528
1528
  put(obj: any): void;
1529
1529
  }
1530
+ /**
1531
+ * 对象池
1532
+ */
1533
+ declare class SamplePoolSet {
1534
+ get(name: string): any;
1535
+ put(name: string, item: any): void;
1536
+ protected pools: {};
1537
+ }
1530
1538
 
1531
1539
  declare class ConvertUtil {
1532
1540
  anyToBoolean(val: any, defaultValue?: boolean): boolean;
@@ -1848,13 +1856,13 @@ declare class MathUtil {
1848
1856
  declare const mathutil: MathUtil;
1849
1857
 
1850
1858
  declare class ResUtil {
1851
- loadResource(path: string): Promise<[any, error]>;
1852
- preloadResource(path: string): Promise<[any, error]>;
1853
- loadBubble(bundle: string): Promise<[AssetManager.Bundle, error]>;
1854
- loadBubbleItem(bubble: AssetManager.Bundle, path: string, type: any): Promise<[any, error]>;
1855
- loadAtlas(path: string): Promise<[SpriteAtlas, error]>;
1859
+ loadResource(path: string): Promise<[any, IError]>;
1860
+ preloadResource(path: string): Promise<[any, IError]>;
1861
+ loadBubble(bundle: string): Promise<[AssetManager.Bundle, IError]>;
1862
+ loadBubbleItem(bubble: AssetManager.Bundle, path: string, type: any): Promise<[any, IError]>;
1863
+ loadAtlas(path: string): Promise<[SpriteAtlas, IError]>;
1856
1864
  getByPath(path: string, type: any): any;
1857
- loadByPath(path: string, type: any): Promise<[any, error]>;
1865
+ loadByPath(path: string, type: any): Promise<[any, IError]>;
1858
1866
  loadByPathCallback(path: string, type: any, callback: (any: any, error: any) => void): void;
1859
1867
  }
1860
1868
  declare var resutil: ResUtil;
@@ -1938,5 +1946,5 @@ declare const pathutil: PathUtil;
1938
1946
  declare function parsePlist(plist: any, texture: any): SpriteAtlas;
1939
1947
  declare function loadAtlas(url: any, callback: any): void;
1940
1948
 
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, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction, error };
1949
+ 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, SamplePoolSet, 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 };
1950
+ export type { CreatorFunction, DisposeFunction, IController, IError, IEventManager, IExtend, IListItem, IModel, IModule, IModuleSample, ITreeListItem, RecycleFunction };
package/dist/index.esm.js CHANGED
@@ -851,6 +851,30 @@ class SamplePool {
851
851
  this.list.push(obj);
852
852
  }
853
853
  }
854
+ /**
855
+ * 对象池
856
+ */
857
+ class SamplePoolSet {
858
+ constructor() {
859
+ this.pools = {};
860
+ }
861
+ get(name) {
862
+ let pool = this.pools[name];
863
+ if (!pool) {
864
+ pool = new SamplePool();
865
+ this.pools[name] = pool;
866
+ }
867
+ return pool.get();
868
+ }
869
+ put(name, item) {
870
+ let pool = this.pools[name];
871
+ if (!pool) {
872
+ pool = new SamplePool();
873
+ this.pools[name] = pool;
874
+ }
875
+ pool.put(item);
876
+ }
877
+ }
854
878
 
855
879
  const log = logmgr.getEventLogger();
856
880
  /**
@@ -6099,5 +6123,5 @@ class PathUtil {
6099
6123
  }
6100
6124
  const pathutil = new PathUtil();
6101
6125
 
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 };
6126
+ 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, SamplePoolSet, 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
6127
  //# sourceMappingURL=index.esm.js.map