@zhongguo168a/yxeditor-common 0.0.86 → 0.0.88

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
@@ -778,10 +778,10 @@ declare class Dictionary<K = string, V = any> {
778
778
  groupByKey(keyCreator: (key: K, val: V) => string, ITEM_CLASS?: any): {
779
779
  [key: string]: any;
780
780
  };
781
- countByKeyList(keyCreator: (key: any, val: any) => string[]): {
781
+ countByKeyList(keyCreator: (key: K, val: V) => string[]): {
782
782
  [key: string]: number;
783
783
  };
784
- countByKey(keyCreator: (key: any, val: any) => string): {
784
+ countByKey(keyCreator: (key: K, val: V) => string): {
785
785
  [key: string]: number;
786
786
  };
787
787
  protected size: number;
@@ -1283,14 +1283,94 @@ declare class ViewHistory extends RouteList {
1283
1283
  }
1284
1284
  declare const viewhistorys: ViewHistory;
1285
1285
 
1286
+ declare class ViewModel extends EventDispatcher {
1287
+ /**
1288
+ * 视图模型的名称
1289
+ * @param name
1290
+ */
1291
+ constructor(name: string);
1292
+ /**
1293
+ * 视图模型的编号
1294
+ * 默认为视图模型的类型,表示该模型在应用中唯一
1295
+ * 如果应用中,存在多个
1296
+ * @returns
1297
+ */
1298
+ getIdent(): string;
1299
+ /**
1300
+ *
1301
+ * @param asset 通过此方法创建的节点,自动添加 RouteComponent 到节点上
1302
+ */
1303
+ createNode(asset: Prefab): void;
1304
+ /**
1305
+ * 使用route的视图模型,可以实现通过路由,操作视图
1306
+ * @param route
1307
+ * @param controller
1308
+ */
1309
+ useRoute(route: Route, controller: RouteController): void;
1310
+ open(): void;
1311
+ close(): void;
1312
+ refresh(): void;
1313
+ stop(reason?: LinkError): void;
1314
+ /**
1315
+ * 等待发送的结果
1316
+ * 如果返回 null,表示主动取消 [cancel]
1317
+ */
1318
+ wait(): Promise<this>;
1319
+ toString(): string;
1320
+ /**
1321
+ * 等待打开完成指令
1322
+ */
1323
+ waitOpenComplete(): void;
1324
+ openComplete(): void;
1325
+ waitCloseComplete(): void;
1326
+ closeComplete(): void;
1327
+ protected _waitOpenComplete: boolean;
1328
+ protected _waitCloseComplete: boolean;
1329
+ get reason(): LinkError;
1330
+ node: Node;
1331
+ datas: MapObject;
1332
+ tags: MapObject;
1333
+ enableHistory: boolean;
1334
+ layer: string;
1335
+ state: ViewState;
1336
+ protected _controller: RouteController;
1337
+ protected _route: Route;
1338
+ protected _reason: LinkError;
1339
+ protected onOpen(): void;
1340
+ protected onOpened(): void;
1341
+ protected onClose(): void;
1342
+ protected onClosed(): void;
1343
+ protected onRefresh(): void;
1344
+ /**
1345
+ * 默认执行 close();
1346
+ */
1347
+ protected onStop(): void;
1348
+ }
1349
+
1286
1350
  declare class ViewList extends List<RouteView> {
1287
1351
  }
1288
1352
  /**
1289
1353
  * 路由唯一编号->视图
1290
1354
  */
1291
- declare class ViewDict extends Dictionary<string, RouteView> {
1355
+ declare class ViewDict extends Dictionary<string, any> {
1356
+ /**
1357
+ * 关闭相斥的视图对象
1358
+ * 1. 关闭同一层的所有视图对象
1359
+ * 2. 关闭符合相斥规则的视图对象
1360
+ * @param view
1361
+ * @param validFunc 符合条件的视图对象会被关闭
1362
+ * @returns 被关闭的视图
1363
+ */
1364
+ closeExclusion(validFunc?: (existed: RouteView) => boolean): ViewList;
1365
+ listByRoutePath(path: string): ViewList;
1366
+ listByTags(tags: string[]): ViewList;
1367
+ /**
1368
+ * 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
1369
+ * @param node
1370
+ */
1371
+ tailNode(node: Node): ViewModel;
1292
1372
  }
1293
- declare class ViewRepo extends ViewDict {
1373
+ declare class RouteViewDict extends ViewDict {
1294
1374
  constructor();
1295
1375
  openByString(route: string): RouteView;
1296
1376
  /**
@@ -1301,32 +1381,14 @@ declare class ViewRepo extends ViewDict {
1301
1381
  open(route: Route): RouteView;
1302
1382
  close(route: Route): void;
1303
1383
  /**
1304
- * 关闭相斥的视图对象
1305
- * 1. 关闭同一层的所有视图对象
1306
- * 2. 关闭符合相斥规则的视图对象
1307
- * @param view
1308
- * @param validFunc 符合条件的视图对象会被关闭
1309
- * @returns 被关闭的视图
1310
- */
1311
- closeExclusion(validFunc?: (existed: RouteView) => boolean): ViewList;
1312
- /**
1313
1384
  * 如果页面存在,则刷新
1314
1385
  * @param route
1315
1386
  */
1316
1387
  refresh(route: Route): void;
1317
1388
  getByRoute(route: Route): RouteView;
1318
- listByRoutePath(path: string): ViewList;
1319
- listByTags(tags: string[]): ViewList;
1320
- /**
1321
- * 往上追踪,返回第一个包含 RouteComponent 的节点, 返回节点中的 RouteView
1322
- * @param node
1323
- */
1324
- tailNode(node: Node): RouteView;
1325
1389
  protected getController(name: string): RouteController;
1326
- protected _indexLayer: {};
1327
- protected _indexRoute: {};
1328
1390
  }
1329
- declare const viewrepo: ViewRepo;
1391
+ declare const routeviews: RouteViewDict;
1330
1392
 
1331
1393
  /**
1332
1394
  * 事件字符串分隔符
@@ -2118,5 +2180,5 @@ declare class WidgetUtil {
2118
2180
  }
2119
2181
  declare var widgetutil: WidgetUtil;
2120
2182
 
2121
- export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewRepo, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, viewrepo, widgetutil };
2183
+ export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, DirectionMode, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryDirection, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapObject, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteController, RouteList, RouteView, RouteViewDict, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectRepo, UIPoolConfig, UISingleConfig, UIUtil, ViewDict, ViewEvent, ViewHistory, ViewList, ViewModel, ViewState, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, create等距图集, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, routeviews, scaleutil, stringutil, timer, timeutil, treeutil, uimgr, uirepo, uiutil, viewhistorys, widgetutil };
2122
2184
  export type { CreatorFunction, DisposeFunction, IController, IError, IEventDispatcher, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };