@zhongguo168a/yxeditor-common 0.0.29 → 0.0.31
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 +59 -111
- package/dist/index.esm.js +93 -150
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -298,7 +298,7 @@ interface IEventManager {
|
|
|
298
298
|
/**
|
|
299
299
|
* 事件派发器
|
|
300
300
|
*/
|
|
301
|
-
declare class
|
|
301
|
+
declare class EventDispatcher implements IEventManager {
|
|
302
302
|
constructor();
|
|
303
303
|
dispose(): void;
|
|
304
304
|
/**
|
|
@@ -347,7 +347,7 @@ declare class EventManager implements IEventManager {
|
|
|
347
347
|
/**
|
|
348
348
|
* 全局的事件派发器
|
|
349
349
|
*/
|
|
350
|
-
declare const eventmgr:
|
|
350
|
+
declare const eventmgr: EventDispatcher;
|
|
351
351
|
|
|
352
352
|
declare class TreeIterator {
|
|
353
353
|
break(): void;
|
|
@@ -507,7 +507,7 @@ declare class TreeNode<T = any> {
|
|
|
507
507
|
fixDepthAndRoot(depth: number, root: TreeRoot): void;
|
|
508
508
|
toString(): string;
|
|
509
509
|
}
|
|
510
|
-
declare class TreeRoot<NODE = any> extends
|
|
510
|
+
declare class TreeRoot<NODE = any> extends EventDispatcher {
|
|
511
511
|
/**
|
|
512
512
|
* 添加数据节点
|
|
513
513
|
* dispatchParams = {node:TreeNode, parent:TreeNode|TreeRoot}
|
|
@@ -622,7 +622,7 @@ declare class ListNode {
|
|
|
622
622
|
getTag(name: string): any;
|
|
623
623
|
setTag(name: string, value: any): void;
|
|
624
624
|
}
|
|
625
|
-
declare class ListSource extends
|
|
625
|
+
declare class ListSource extends EventDispatcher {
|
|
626
626
|
/**
|
|
627
627
|
* 通过数组创建 ListSource。ListSource的id自动生成。如果需要指定编号,可设置 idCreator
|
|
628
628
|
* @param arr
|
|
@@ -807,8 +807,8 @@ declare class DictSource extends Dictionary<string, DictNode> {
|
|
|
807
807
|
static EVENT_TAGS_SET: string;
|
|
808
808
|
setNodeTags(node: DictNode, tag: string, value: any): void;
|
|
809
809
|
refreshNode(node: DictNode): void;
|
|
810
|
-
get dispatcher():
|
|
811
|
-
protected _dispatcher:
|
|
810
|
+
get dispatcher(): EventDispatcher;
|
|
811
|
+
protected _dispatcher: EventDispatcher;
|
|
812
812
|
}
|
|
813
813
|
|
|
814
814
|
declare class ListIterator {
|
|
@@ -919,10 +919,11 @@ declare class ControllerDict extends Dictionary<string, IController> {
|
|
|
919
919
|
}
|
|
920
920
|
declare class ControllerRepo extends ControllerDict {
|
|
921
921
|
constructor();
|
|
922
|
-
|
|
922
|
+
register(controller: IController): void;
|
|
923
923
|
remove(name: string): void;
|
|
924
924
|
dispose(): void;
|
|
925
925
|
}
|
|
926
|
+
declare const ctrlrepo: ControllerRepo;
|
|
926
927
|
|
|
927
928
|
interface IModule {
|
|
928
929
|
}
|
|
@@ -935,7 +936,7 @@ declare class SimpleModel {
|
|
|
935
936
|
get core(): IModule;
|
|
936
937
|
protected _mod: any;
|
|
937
938
|
}
|
|
938
|
-
declare class Model extends
|
|
939
|
+
declare class Model extends EventDispatcher {
|
|
939
940
|
constructor(core?: IModule);
|
|
940
941
|
get module(): IModule;
|
|
941
942
|
protected _module: any;
|
|
@@ -1006,44 +1007,7 @@ declare class Route {
|
|
|
1006
1007
|
private _params;
|
|
1007
1008
|
protected _route: string;
|
|
1008
1009
|
}
|
|
1009
|
-
|
|
1010
|
-
declare class ViewController extends Controller {
|
|
1011
|
-
constructor(routeName: string, config?: {
|
|
1012
|
-
layer?: string;
|
|
1013
|
-
tags?: string[];
|
|
1014
|
-
enableHistory?: boolean;
|
|
1015
|
-
});
|
|
1016
|
-
open(...args: any[]): void;
|
|
1017
|
-
close(...args: any[]): void;
|
|
1018
|
-
protected onOpening(view: View): void;
|
|
1019
|
-
protected onOpened(view: View): void;
|
|
1020
|
-
protected onClosing(view: View): void;
|
|
1021
|
-
protected onClosed(view: View): void;
|
|
1022
|
-
protected onRefresh(view: View): void;
|
|
1023
|
-
openByRoute(route: Route): View;
|
|
1024
|
-
private openView;
|
|
1025
|
-
openComplete(view: View): void;
|
|
1026
|
-
/**
|
|
1027
|
-
* viewrepo中存在页面才会关闭
|
|
1028
|
-
* @param route
|
|
1029
|
-
* @returns
|
|
1030
|
-
*/
|
|
1031
|
-
closeByRoute(route?: Route): View;
|
|
1032
|
-
private closeView;
|
|
1033
|
-
closeComplete(view: View): void;
|
|
1034
|
-
refresh(): void;
|
|
1035
|
-
get layer(): string;
|
|
1036
|
-
hasTags(tags: string[]): boolean;
|
|
1037
|
-
setLayer(name: string): this;
|
|
1038
|
-
setTags(tags: string[]): this;
|
|
1039
|
-
get lastView(): View;
|
|
1040
|
-
get route(): Route;
|
|
1041
|
-
get enableHistory(): boolean;
|
|
1042
|
-
protected _enableHistory: boolean;
|
|
1043
|
-
protected _route: Route;
|
|
1044
|
-
protected _lastView: View;
|
|
1045
|
-
protected _tags: {};
|
|
1046
|
-
protected _layer: string;
|
|
1010
|
+
declare class RouteList extends List<Route> {
|
|
1047
1011
|
}
|
|
1048
1012
|
|
|
1049
1013
|
declare enum ViewState {
|
|
@@ -1064,23 +1028,8 @@ declare enum ViewState {
|
|
|
1064
1028
|
*/
|
|
1065
1029
|
Closeing = 3
|
|
1066
1030
|
}
|
|
1067
|
-
declare
|
|
1068
|
-
Opening = "opening",
|
|
1069
|
-
Opened = "opened",
|
|
1070
|
-
Closeing = "closeing",
|
|
1071
|
-
Closed = "closed",
|
|
1072
|
-
Stop = "stop"
|
|
1073
|
-
}
|
|
1074
|
-
declare class View extends EventManager {
|
|
1031
|
+
declare class View extends EventDispatcher {
|
|
1075
1032
|
constructor(controller: ViewController, route: Route);
|
|
1076
|
-
/**
|
|
1077
|
-
* 等待打开完成指令
|
|
1078
|
-
*/
|
|
1079
|
-
waitOpenComplete(): void;
|
|
1080
|
-
waitCloseComplete(): void;
|
|
1081
|
-
openComplete(): void;
|
|
1082
|
-
closeComplete(): void;
|
|
1083
|
-
stop(reason: LinkError): void;
|
|
1084
1033
|
/**
|
|
1085
1034
|
* 等待发送的结果
|
|
1086
1035
|
* 如果返回 null,表示主动取消 [cancel]
|
|
@@ -1099,26 +1048,6 @@ declare class View extends EventManager {
|
|
|
1099
1048
|
protected _route: Route;
|
|
1100
1049
|
}
|
|
1101
1050
|
|
|
1102
|
-
/**
|
|
1103
|
-
* 视图管理器
|
|
1104
|
-
* 打开一个视图的时候,可能会听过加载资源,读取数据,调整布局,切换特效等处理,所以使用视图模式封装视图打开关闭的逻辑
|
|
1105
|
-
*/
|
|
1106
|
-
declare class ViewLayer {
|
|
1107
|
-
name: string;
|
|
1108
|
-
constructor(name: string);
|
|
1109
|
-
close(): void;
|
|
1110
|
-
/**
|
|
1111
|
-
* 历史记录
|
|
1112
|
-
*/
|
|
1113
|
-
getHistory(): Route[];
|
|
1114
|
-
back(): void;
|
|
1115
|
-
/**
|
|
1116
|
-
* 当前的页面
|
|
1117
|
-
*/
|
|
1118
|
-
currentView: View;
|
|
1119
|
-
protected _history: Route[];
|
|
1120
|
-
}
|
|
1121
|
-
|
|
1122
1051
|
declare class UIObjectDict extends Dictionary<string, any | List> {
|
|
1123
1052
|
/**
|
|
1124
1053
|
* 获取唯一的
|
|
@@ -1134,39 +1063,58 @@ declare var uidict: UIObjectDict;
|
|
|
1134
1063
|
|
|
1135
1064
|
declare class ViewList extends List<View> {
|
|
1136
1065
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1066
|
+
|
|
1067
|
+
declare class ViewController extends Controller {
|
|
1068
|
+
constructor(routeName: string);
|
|
1140
1069
|
/**
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
*/
|
|
1070
|
+
* 当视图需要通过路由打开时,需要实现此方法
|
|
1071
|
+
* @param route
|
|
1072
|
+
*/
|
|
1145
1073
|
open(route: Route): View;
|
|
1146
|
-
|
|
1074
|
+
protected onOpening(view: View): void;
|
|
1075
|
+
protected onOpened(view: View): void;
|
|
1076
|
+
protected onClosing(view: View): void;
|
|
1077
|
+
protected onClosed(view: View): void;
|
|
1078
|
+
protected refreshView(view: View): void;
|
|
1079
|
+
protected openView(view: View): void;
|
|
1147
1080
|
/**
|
|
1148
|
-
|
|
1081
|
+
* 等待打开完成指令
|
|
1082
|
+
*/
|
|
1083
|
+
protected waitOpenComplete(view: View): void;
|
|
1084
|
+
protected openComplete(view: View): void;
|
|
1085
|
+
/**
|
|
1086
|
+
* 当视图需要通过路由关闭时,需要实现此方法
|
|
1149
1087
|
* @param route
|
|
1088
|
+
* @returns
|
|
1150
1089
|
*/
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
* @param
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1090
|
+
close(route?: Route): View;
|
|
1091
|
+
/**
|
|
1092
|
+
* 关闭相斥的视图对象
|
|
1093
|
+
* 1. 关闭同一层的所有视图对象
|
|
1094
|
+
* 2. 关闭符合相斥规则的视图对象
|
|
1095
|
+
* @param view
|
|
1096
|
+
* @param validFunc 符合条件的视图对象会被关闭
|
|
1097
|
+
* @returns 被关闭的视图
|
|
1098
|
+
*/
|
|
1099
|
+
closeExclusion(validFunc?: (existed: View) => boolean): ViewList;
|
|
1100
|
+
protected closeView(view: View): void;
|
|
1101
|
+
protected waitCloseComplete(view: View): void;
|
|
1102
|
+
protected closeComplete(view: View): void;
|
|
1103
|
+
refresh(): void;
|
|
1104
|
+
get layer(): string;
|
|
1105
|
+
hasTags(tags: string[]): boolean;
|
|
1106
|
+
setLayer(name: string): this;
|
|
1107
|
+
setTags(tags: string[]): this;
|
|
1108
|
+
useHistory(): this;
|
|
1109
|
+
get lastView(): View;
|
|
1110
|
+
get route(): Route;
|
|
1111
|
+
get enableHistory(): boolean;
|
|
1112
|
+
protected _enableHistory: boolean;
|
|
1113
|
+
protected _route: Route;
|
|
1114
|
+
protected _lastView: View;
|
|
1115
|
+
protected _tags: {};
|
|
1116
|
+
protected _layer: string;
|
|
1117
|
+
}
|
|
1170
1118
|
|
|
1171
1119
|
/**
|
|
1172
1120
|
* 事件字符串分隔符
|
|
@@ -2030,5 +1978,5 @@ declare class WidgetUtil {
|
|
|
2030
1978
|
}
|
|
2031
1979
|
declare var widgetutil: WidgetUtil;
|
|
2032
1980
|
|
|
2033
|
-
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil,
|
|
1981
|
+
export { ArrayUtil, AssetLoader, AssetURI, BitUtil, CallbackList, CameraUtil, CanvasUtil, Controller, ControllerDict, ControllerRepo, ConvertUtil, DictIterator, DictNode, DictSource, Dictionary, Dispatcher, DocUtil, ErrorUtil, EventDispatcher, EventItem, EventUtil, Factory, FloatUtil, GeometryUtil, IdentUtil, LOGGER_EVENT, LinkError, List, ListIterator, ListNode, ListSource, Listener, LogLevel, LogManager, Logger, MapUtil, MathUtil, Model, NetUtil, PathUtil, Pool, RandUtil, Route, RouteList, SampleCallbackList, SamplePool, SamplePoolSet, ScaleUtil, SimpleModel, StringUtil, TimeUtil, Timer, TreeIterator, TreeNode, TreeNodePlugin, TreeRoot, TreeRootPlugin, TreeUtil, UIManager, UIObjectDict, UIPoolConfig, UISingleConfig, UIUtil, ViewController, WidgetAlign, WidgetUtil, XAssetManager, XEvent, arrayutil, assetx, bitutil, camerautil, canvasutil, convertutil, ctrlrepo, docutil, errorutil, eventmgr, eventutil, floatutil, formatutil, geoutil, identutil, loadAtlas, logmgr, maputil, mathutil, netutil, parseAtlas, parsePlist, pathutil, randutil, resutil, scaleutil, stringutil, timer, timeutil, treeutil, uidict, uimgr, uiutil, widgetutil };
|
|
2034
1982
|
export type { CreatorFunction, DisposeFunction, IController, IError, IEventManager, IExtend, IListItem, IModel, IModule, ITreeListItem, RecycleFunction };
|