@zhongguo168a/yxeditor-common 0.0.60 → 0.0.61
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 +133 -133
- package/dist/index.esm.js +2 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1010,6 +1010,137 @@ declare class Route {
|
|
|
1010
1010
|
declare class RouteList extends List<Route> {
|
|
1011
1011
|
}
|
|
1012
1012
|
|
|
1013
|
+
declare class MapObject extends Dictionary<string, MapValue> {
|
|
1014
|
+
object: {};
|
|
1015
|
+
constructor(object: {});
|
|
1016
|
+
getValue(key: string): MapValue;
|
|
1017
|
+
}
|
|
1018
|
+
declare class MapValue {
|
|
1019
|
+
obj: {};
|
|
1020
|
+
key: any;
|
|
1021
|
+
constructor(obj: {}, key: any);
|
|
1022
|
+
set(value: any): void;
|
|
1023
|
+
isUndefined(): boolean;
|
|
1024
|
+
toNumber(): number;
|
|
1025
|
+
toString(): string;
|
|
1026
|
+
toBoolean(): boolean;
|
|
1027
|
+
toAny(): any;
|
|
1028
|
+
}
|
|
1029
|
+
declare class MapUtil {
|
|
1030
|
+
/**
|
|
1031
|
+
* 获取所欲的值
|
|
1032
|
+
*/
|
|
1033
|
+
values<T = any>(m: {
|
|
1034
|
+
[key: string]: T;
|
|
1035
|
+
}): T[];
|
|
1036
|
+
/**
|
|
1037
|
+
* 获取所有的键
|
|
1038
|
+
*/
|
|
1039
|
+
keys(m: {
|
|
1040
|
+
[key: string]: any;
|
|
1041
|
+
}): string[];
|
|
1042
|
+
/**
|
|
1043
|
+
* 以字符串数字作为键值的map,转化成数组
|
|
1044
|
+
*/
|
|
1045
|
+
toList<T = any>(m: {
|
|
1046
|
+
[key: string]: T;
|
|
1047
|
+
}): T[];
|
|
1048
|
+
/**
|
|
1049
|
+
* 以字符串数字作为键值的map,转化成数组
|
|
1050
|
+
*/
|
|
1051
|
+
listToMap(list: any[]): any;
|
|
1052
|
+
/**
|
|
1053
|
+
* 转换成数字, 如果原值无效, 返回0
|
|
1054
|
+
* @constructor
|
|
1055
|
+
*/
|
|
1056
|
+
has(m: any, key: string): boolean;
|
|
1057
|
+
/**
|
|
1058
|
+
* 转换成数字, 如果原值无效, 返回0
|
|
1059
|
+
* @constructor
|
|
1060
|
+
*/
|
|
1061
|
+
number(m: any, key: string, dflt?: number): number;
|
|
1062
|
+
/**
|
|
1063
|
+
* 转换成字符串, 如果原值无效, 返回""
|
|
1064
|
+
* @constructor
|
|
1065
|
+
*/
|
|
1066
|
+
string(m: any, key: string, dflt?: string): string;
|
|
1067
|
+
/**
|
|
1068
|
+
* 转换成布尔值, 如果原值无效, 返回false
|
|
1069
|
+
* @constructor
|
|
1070
|
+
*/
|
|
1071
|
+
boolean(m: any, key: string, dflt?: boolean): boolean;
|
|
1072
|
+
/**
|
|
1073
|
+
* 转换成{}, 如果原值无效, 返回{}
|
|
1074
|
+
* @constructor
|
|
1075
|
+
*/
|
|
1076
|
+
map(m: any, key: string, dflt?: boolean | Object): any;
|
|
1077
|
+
/**
|
|
1078
|
+
* 转换成[], 如果原值无效, 返回[]
|
|
1079
|
+
* @constructor
|
|
1080
|
+
*/
|
|
1081
|
+
array(m: any, key: string, dflt?: boolean | Array<any>): any[];
|
|
1082
|
+
/**
|
|
1083
|
+
* 返回第一个符合条件的key
|
|
1084
|
+
* @param m
|
|
1085
|
+
* @param conf
|
|
1086
|
+
*/
|
|
1087
|
+
keyOfConf(m: any, conf: (key: string, item: any) => boolean): string;
|
|
1088
|
+
/**
|
|
1089
|
+
* 比较对象,并返回包含差异的对象
|
|
1090
|
+
* 如果返回 undefined 表示没有差异
|
|
1091
|
+
* @param obj
|
|
1092
|
+
* @param parent
|
|
1093
|
+
* @param removeDefault
|
|
1094
|
+
*/
|
|
1095
|
+
diff(obj: any, parent: any, removeDefault?: boolean): any;
|
|
1096
|
+
/**
|
|
1097
|
+
* 克隆对象
|
|
1098
|
+
* @param obj
|
|
1099
|
+
*/
|
|
1100
|
+
clone(obj: any): any;
|
|
1101
|
+
/**
|
|
1102
|
+
* 通过path设置属性,创建不存在的路径对象
|
|
1103
|
+
* @param obj
|
|
1104
|
+
* @param path "/key1/key2"
|
|
1105
|
+
* @param data
|
|
1106
|
+
*/
|
|
1107
|
+
setByPath(obj: any, path: string, data: any): void;
|
|
1108
|
+
/**
|
|
1109
|
+
* 通过path删除
|
|
1110
|
+
* @param obj
|
|
1111
|
+
* @param path "/key1/key2"
|
|
1112
|
+
*/
|
|
1113
|
+
removeByPath(obj: any, path: string): void;
|
|
1114
|
+
/**
|
|
1115
|
+
* 通过path获取属性
|
|
1116
|
+
* @param obj
|
|
1117
|
+
* @param path
|
|
1118
|
+
*/
|
|
1119
|
+
getByPath(obj: any, path: string): any;
|
|
1120
|
+
flat(obj: any, split?: string): any;
|
|
1121
|
+
_flat(obj: any, result: any, path: string, split?: string): any;
|
|
1122
|
+
/**
|
|
1123
|
+
* 比较两个对象,包括基础类型
|
|
1124
|
+
* @param a
|
|
1125
|
+
* @param b
|
|
1126
|
+
*/
|
|
1127
|
+
compare(a: any, b: any): boolean;
|
|
1128
|
+
/**
|
|
1129
|
+
* 从[from]对象复制到 [to]对象
|
|
1130
|
+
* 如果from字段为object并且等于null,则设置to字段为null
|
|
1131
|
+
* 如果from字段为undefined, 则不覆盖
|
|
1132
|
+
* @param from
|
|
1133
|
+
* @param to
|
|
1134
|
+
* @param tokey 如果[to]存在key才进行拷贝
|
|
1135
|
+
*/
|
|
1136
|
+
copy(from: any, to: any, tokey?: boolean): void;
|
|
1137
|
+
/**
|
|
1138
|
+
* 去掉兼职
|
|
1139
|
+
*/
|
|
1140
|
+
flatString(target: any): string;
|
|
1141
|
+
}
|
|
1142
|
+
declare const maputil: MapUtil;
|
|
1143
|
+
|
|
1013
1144
|
declare enum ViewState {
|
|
1014
1145
|
/**
|
|
1015
1146
|
* 关闭
|
|
@@ -1071,8 +1202,8 @@ declare class RouteView extends EventDispatcher {
|
|
|
1071
1202
|
onStop(value: (ctx: this) => void): this;
|
|
1072
1203
|
get reason(): LinkError;
|
|
1073
1204
|
node: Node;
|
|
1074
|
-
datas:
|
|
1075
|
-
tags:
|
|
1205
|
+
datas: MapObject;
|
|
1206
|
+
tags: MapObject;
|
|
1076
1207
|
enableHistory: boolean;
|
|
1077
1208
|
layer: string;
|
|
1078
1209
|
state: ViewState;
|
|
@@ -1690,137 +1821,6 @@ declare class IdentUtil {
|
|
|
1690
1821
|
}
|
|
1691
1822
|
declare const identutil: IdentUtil;
|
|
1692
1823
|
|
|
1693
|
-
declare class MapObject extends Dictionary<string, MapValue> {
|
|
1694
|
-
object: {};
|
|
1695
|
-
constructor(object: {});
|
|
1696
|
-
getValue(key: string): MapValue;
|
|
1697
|
-
}
|
|
1698
|
-
declare class MapValue {
|
|
1699
|
-
obj: {};
|
|
1700
|
-
key: any;
|
|
1701
|
-
constructor(obj: {}, key: any);
|
|
1702
|
-
set(value: any): void;
|
|
1703
|
-
isUndefined(): boolean;
|
|
1704
|
-
toNumber(): number;
|
|
1705
|
-
toString(): string;
|
|
1706
|
-
toBoolean(): boolean;
|
|
1707
|
-
toAny(): any;
|
|
1708
|
-
}
|
|
1709
|
-
declare class MapUtil {
|
|
1710
|
-
/**
|
|
1711
|
-
* 获取所欲的值
|
|
1712
|
-
*/
|
|
1713
|
-
values<T = any>(m: {
|
|
1714
|
-
[key: string]: T;
|
|
1715
|
-
}): T[];
|
|
1716
|
-
/**
|
|
1717
|
-
* 获取所有的键
|
|
1718
|
-
*/
|
|
1719
|
-
keys(m: {
|
|
1720
|
-
[key: string]: any;
|
|
1721
|
-
}): string[];
|
|
1722
|
-
/**
|
|
1723
|
-
* 以字符串数字作为键值的map,转化成数组
|
|
1724
|
-
*/
|
|
1725
|
-
toList<T = any>(m: {
|
|
1726
|
-
[key: string]: T;
|
|
1727
|
-
}): T[];
|
|
1728
|
-
/**
|
|
1729
|
-
* 以字符串数字作为键值的map,转化成数组
|
|
1730
|
-
*/
|
|
1731
|
-
listToMap(list: any[]): any;
|
|
1732
|
-
/**
|
|
1733
|
-
* 转换成数字, 如果原值无效, 返回0
|
|
1734
|
-
* @constructor
|
|
1735
|
-
*/
|
|
1736
|
-
has(m: any, key: string): boolean;
|
|
1737
|
-
/**
|
|
1738
|
-
* 转换成数字, 如果原值无效, 返回0
|
|
1739
|
-
* @constructor
|
|
1740
|
-
*/
|
|
1741
|
-
number(m: any, key: string, dflt?: number): number;
|
|
1742
|
-
/**
|
|
1743
|
-
* 转换成字符串, 如果原值无效, 返回""
|
|
1744
|
-
* @constructor
|
|
1745
|
-
*/
|
|
1746
|
-
string(m: any, key: string, dflt?: string): string;
|
|
1747
|
-
/**
|
|
1748
|
-
* 转换成布尔值, 如果原值无效, 返回false
|
|
1749
|
-
* @constructor
|
|
1750
|
-
*/
|
|
1751
|
-
boolean(m: any, key: string, dflt?: boolean): boolean;
|
|
1752
|
-
/**
|
|
1753
|
-
* 转换成{}, 如果原值无效, 返回{}
|
|
1754
|
-
* @constructor
|
|
1755
|
-
*/
|
|
1756
|
-
map(m: any, key: string, dflt?: boolean | Object): any;
|
|
1757
|
-
/**
|
|
1758
|
-
* 转换成[], 如果原值无效, 返回[]
|
|
1759
|
-
* @constructor
|
|
1760
|
-
*/
|
|
1761
|
-
array(m: any, key: string, dflt?: boolean | Array<any>): any[];
|
|
1762
|
-
/**
|
|
1763
|
-
* 返回第一个符合条件的key
|
|
1764
|
-
* @param m
|
|
1765
|
-
* @param conf
|
|
1766
|
-
*/
|
|
1767
|
-
keyOfConf(m: any, conf: (key: string, item: any) => boolean): string;
|
|
1768
|
-
/**
|
|
1769
|
-
* 比较对象,并返回包含差异的对象
|
|
1770
|
-
* 如果返回 undefined 表示没有差异
|
|
1771
|
-
* @param obj
|
|
1772
|
-
* @param parent
|
|
1773
|
-
* @param removeDefault
|
|
1774
|
-
*/
|
|
1775
|
-
diff(obj: any, parent: any, removeDefault?: boolean): any;
|
|
1776
|
-
/**
|
|
1777
|
-
* 克隆对象
|
|
1778
|
-
* @param obj
|
|
1779
|
-
*/
|
|
1780
|
-
clone(obj: any): any;
|
|
1781
|
-
/**
|
|
1782
|
-
* 通过path设置属性,创建不存在的路径对象
|
|
1783
|
-
* @param obj
|
|
1784
|
-
* @param path "/key1/key2"
|
|
1785
|
-
* @param data
|
|
1786
|
-
*/
|
|
1787
|
-
setByPath(obj: any, path: string, data: any): void;
|
|
1788
|
-
/**
|
|
1789
|
-
* 通过path删除
|
|
1790
|
-
* @param obj
|
|
1791
|
-
* @param path "/key1/key2"
|
|
1792
|
-
*/
|
|
1793
|
-
removeByPath(obj: any, path: string): void;
|
|
1794
|
-
/**
|
|
1795
|
-
* 通过path获取属性
|
|
1796
|
-
* @param obj
|
|
1797
|
-
* @param path
|
|
1798
|
-
*/
|
|
1799
|
-
getByPath(obj: any, path: string): any;
|
|
1800
|
-
flat(obj: any, split?: string): any;
|
|
1801
|
-
_flat(obj: any, result: any, path: string, split?: string): any;
|
|
1802
|
-
/**
|
|
1803
|
-
* 比较两个对象,包括基础类型
|
|
1804
|
-
* @param a
|
|
1805
|
-
* @param b
|
|
1806
|
-
*/
|
|
1807
|
-
compare(a: any, b: any): boolean;
|
|
1808
|
-
/**
|
|
1809
|
-
* 从[from]对象复制到 [to]对象
|
|
1810
|
-
* 如果from字段为object并且等于null,则设置to字段为null
|
|
1811
|
-
* 如果from字段为undefined, 则不覆盖
|
|
1812
|
-
* @param from
|
|
1813
|
-
* @param to
|
|
1814
|
-
* @param tokey 如果[to]存在key才进行拷贝
|
|
1815
|
-
*/
|
|
1816
|
-
copy(from: any, to: any, tokey?: boolean): void;
|
|
1817
|
-
/**
|
|
1818
|
-
* 去掉兼职
|
|
1819
|
-
*/
|
|
1820
|
-
flatString(target: any): string;
|
|
1821
|
-
}
|
|
1822
|
-
declare const maputil: MapUtil;
|
|
1823
|
-
|
|
1824
1824
|
declare class MathUtil {
|
|
1825
1825
|
version: number;
|
|
1826
1826
|
TempVec2: Vec2;
|
package/dist/index.esm.js
CHANGED
|
@@ -3893,8 +3893,8 @@ class RouteView extends EventDispatcher {
|
|
|
3893
3893
|
super();
|
|
3894
3894
|
this._waitOpenComplete = false;
|
|
3895
3895
|
this._waitCloseComplete = false;
|
|
3896
|
-
this.datas = {};
|
|
3897
|
-
this.tags = {};
|
|
3896
|
+
this.datas = new MapObject({});
|
|
3897
|
+
this.tags = new MapObject({});
|
|
3898
3898
|
this.enableHistory = false;
|
|
3899
3899
|
this.state = 0;
|
|
3900
3900
|
this._onStop = (ctx) => {
|