mazey 1.4.38 → 2.1.0
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/LICENSE +21 -21
- package/README.md +490 -317
- package/README_CN.md +335 -0
- package/index.js +3 -0
- package/lib/index.cjs.js +1 -4988
- package/lib/index.d.ts +136 -182
- package/lib/index.d.ts.map +1 -1
- package/lib/index.esm.js +1 -4935
- package/lib/mazey.min.js +1 -0
- package/package.json +84 -85
- package/src/example.html +21 -0
- package/src/example.ts +49 -0
- package/src/index.ts +1376 -1619
- package/tsconfig.json +74 -73
- package/typing.d.ts +4 -4
- package/lib/test.d.ts +0 -2
- package/lib/test.d.ts.map +0 -1
- package/src/js/data-structure/MSet.js +0 -89
- package/src/js/polyfill.js +0 -63
- package/src/js/service/common.js +0 -4
- package/src/scss/extend/index.scss +0 -149
- package/src/scss/index.scss +0 -5
- package/src/scss/mixin/index.scss +0 -41
- package/src/scss/variate/index.scss +0 -28
- package/src/test.html +0 -33
- package/src/test.ts +0 -26
package/lib/index.d.ts
CHANGED
|
@@ -1,117 +1,124 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @method calLongestCommonSubstring
|
|
3
|
-
* @description
|
|
4
|
-
* @param {
|
|
5
|
-
* @param {
|
|
6
|
-
* @return {
|
|
3
|
+
* @description Computes the longest common substring of two strings.
|
|
4
|
+
* @param {string} aStr String
|
|
5
|
+
* @param {string} bStr String
|
|
6
|
+
* @return {number} Length
|
|
7
7
|
*/
|
|
8
|
-
export declare function calLongestCommonSubstring(aStr
|
|
8
|
+
export declare function calLongestCommonSubstring(aStr?: string, bStr?: string): number;
|
|
9
9
|
/**
|
|
10
10
|
* @method calLongestCommonSubsequence
|
|
11
11
|
* @description 计算两个字符串的最长公共子序列
|
|
12
|
-
* @param {
|
|
13
|
-
* @param {
|
|
14
|
-
* @return {
|
|
12
|
+
* @param {string} aStr 字符串
|
|
13
|
+
* @param {string} bStr 字符串
|
|
14
|
+
* @return {number} 长度
|
|
15
15
|
*/
|
|
16
|
-
export declare function calLongestCommonSubsequence(aStr
|
|
16
|
+
export declare function calLongestCommonSubsequence(aStr?: string, bStr?: string): number;
|
|
17
17
|
/**
|
|
18
|
-
* @method
|
|
19
|
-
* @description
|
|
20
|
-
* @param {
|
|
21
|
-
* @
|
|
18
|
+
* @method getQueryParam
|
|
19
|
+
* @description Get the query param's value of the current Web URL(`location.search`).
|
|
20
|
+
* @param {string} param Query param.
|
|
21
|
+
* @return {string} value
|
|
22
22
|
* */
|
|
23
|
-
export declare function
|
|
23
|
+
export declare function getQueryParam(param?: string): string;
|
|
24
24
|
/**
|
|
25
|
-
* @method
|
|
26
|
-
* @description
|
|
27
|
-
* @param {
|
|
28
|
-
* @param {
|
|
29
|
-
* @
|
|
30
|
-
*/
|
|
31
|
-
export declare function
|
|
25
|
+
* @method getUrlParam
|
|
26
|
+
* @description Get the query param's value of the input URL.
|
|
27
|
+
* @param {string} url URL string.
|
|
28
|
+
* @param {string} param Query param.
|
|
29
|
+
* @return {string} value
|
|
30
|
+
* */
|
|
31
|
+
export declare function getUrlParam(url?: string, param?: string): string;
|
|
32
|
+
/**
|
|
33
|
+
* @method updateQueryParam
|
|
34
|
+
* @description Update the query param's value of the input URL.
|
|
35
|
+
* @param {string} url URL string.
|
|
36
|
+
* @param {string} param Query param.
|
|
37
|
+
* @param {string} value Param's value.
|
|
38
|
+
* @return {string} URL.
|
|
39
|
+
* */
|
|
40
|
+
export declare function updateQueryParam(url?: string, param?: string, value?: string): string;
|
|
32
41
|
/**
|
|
33
42
|
* @method getHashQueryParam
|
|
34
|
-
* @description
|
|
35
|
-
* @param {
|
|
43
|
+
* @description Get the hash query param's value of the current Web URL(`location.hash`).
|
|
44
|
+
* @param {string} param Query param.
|
|
45
|
+
* @return {string} value
|
|
36
46
|
*/
|
|
37
|
-
export declare function getHashQueryParam(param
|
|
47
|
+
export declare function getHashQueryParam(param?: string): string;
|
|
38
48
|
/**
|
|
39
|
-
* @method
|
|
40
|
-
* @description
|
|
41
|
-
* @param {
|
|
49
|
+
* @method getDomain
|
|
50
|
+
* @description Get the domain of URL, and other params.
|
|
51
|
+
* @param {string} url
|
|
52
|
+
* @param {array} rules Object.keys(location), ['href', 'protocol', 'host', 'hostname', 'port', 'pathname', 'search', 'hash'], ['hostname', 'pathname'] = 'km.mazey.net/plugins/servlet/mobile'
|
|
42
53
|
* */
|
|
43
|
-
export declare function
|
|
54
|
+
export declare function getDomain(url?: string, rules?: string[]): string;
|
|
44
55
|
/**
|
|
45
|
-
* @method
|
|
46
|
-
* @description
|
|
47
|
-
* @param {
|
|
56
|
+
* @method camelCaseToKebabCase
|
|
57
|
+
* @description Transfer CamelCase to KebabCase.
|
|
58
|
+
* @param {string} camelCase 'aBC' or 'ABC'
|
|
59
|
+
* @return {string} 'a-b-c'
|
|
48
60
|
* */
|
|
49
|
-
export declare function
|
|
61
|
+
export declare function camelCaseToKebabCase(camelCase?: string): string;
|
|
50
62
|
/**
|
|
51
|
-
* @method
|
|
52
|
-
* @description
|
|
53
|
-
* @param {
|
|
54
|
-
* @
|
|
63
|
+
* @method camelCase2Underscore
|
|
64
|
+
* @description Transfer CamelCase to Underscore.
|
|
65
|
+
* @param {string} camelCase 'aBC' or 'ABC'
|
|
66
|
+
* @return {string} 'a_b_c'
|
|
55
67
|
* */
|
|
56
|
-
export declare function
|
|
57
|
-
url?: string | undefined;
|
|
58
|
-
rules?: string[] | undefined;
|
|
59
|
-
}): string;
|
|
68
|
+
export declare function camelCase2Underscore(camelCase?: string): string;
|
|
60
69
|
/**
|
|
61
|
-
* @method
|
|
62
|
-
* @description
|
|
63
|
-
* @param {
|
|
70
|
+
* @method mTrim
|
|
71
|
+
* @description Remove leading and trailing whitespace or specified characters from string.
|
|
72
|
+
* @param {string} str The string to trim.
|
|
73
|
+
* @return {string} Trimmed string.
|
|
64
74
|
* */
|
|
65
|
-
export declare function
|
|
75
|
+
export declare function mTrim(str?: string): string;
|
|
66
76
|
/**
|
|
67
77
|
* @method newLine
|
|
68
|
-
* @description
|
|
69
|
-
* @param {
|
|
78
|
+
* @description Make a newline of HTML.
|
|
79
|
+
* @param {string} str The string to make a newline.
|
|
80
|
+
* @return {string} A newline with `<br />`.
|
|
70
81
|
* */
|
|
71
|
-
export declare function newLine(str
|
|
82
|
+
export declare function newLine(str?: string): string;
|
|
72
83
|
/**
|
|
73
84
|
* @method deepCopyObject
|
|
74
|
-
* @description
|
|
75
|
-
* @param {
|
|
76
|
-
* @return {
|
|
85
|
+
* @description Clone Object deeply.
|
|
86
|
+
* @param {object} obj The value to clone.
|
|
87
|
+
* @return {object} Returns the deep cloned value.
|
|
77
88
|
* */
|
|
78
89
|
export declare function deepCopyObject(obj: any): any;
|
|
90
|
+
/**
|
|
91
|
+
* @method isJsonString
|
|
92
|
+
* @description Check whether it is a valid JSON string.
|
|
93
|
+
* @param {string} str The string to check.
|
|
94
|
+
* @return {boolean} Return the result of checking.
|
|
95
|
+
* */
|
|
96
|
+
export declare function isJsonString(str?: string): boolean;
|
|
79
97
|
/**
|
|
80
98
|
* @method generateRndNum
|
|
81
|
-
* @description
|
|
82
|
-
* @param {
|
|
83
|
-
* @return {
|
|
99
|
+
* @description Produce a random string of number, `generateRndNum(7)` => '7658495'.
|
|
100
|
+
* @param {number} n Length
|
|
101
|
+
* @return {string} Return the random string.
|
|
84
102
|
* */
|
|
85
|
-
export declare function generateRndNum(n
|
|
103
|
+
export declare function generateRndNum(n?: number): string;
|
|
86
104
|
/**
|
|
87
105
|
* @method generateUniqueNum
|
|
88
106
|
* @description 根据时间生成唯一标志的数字 mGenerateUniqueNum() => 1538324722364123。
|
|
89
|
-
* @param {
|
|
107
|
+
* @param {number} n 随机数的长度
|
|
90
108
|
* */
|
|
91
|
-
export declare function generateUniqueNum(n
|
|
92
|
-
/**
|
|
93
|
-
* @method resetForm
|
|
94
|
-
* @description 重置表单输入值为原始(空)状态。
|
|
95
|
-
* @param {String} rest name1,name2,name3...NAME属性,可以多个。
|
|
96
|
-
* */
|
|
97
|
-
export declare function resetForm(...rest: any[]): void;
|
|
109
|
+
export declare function generateUniqueNum(n?: number): string;
|
|
98
110
|
/**
|
|
99
111
|
* @method floatToPercent
|
|
100
112
|
* @description 浮点数转为百分比 0.2 => 20%。
|
|
101
|
-
* @param {
|
|
102
|
-
* @param {
|
|
113
|
+
* @param {number} num 浮点数
|
|
114
|
+
* @param {number} fixSize 保留几位浮点数
|
|
103
115
|
* */
|
|
104
|
-
export declare function floatToPercent(num
|
|
116
|
+
export declare function floatToPercent(num?: number, fixSize?: number): string;
|
|
105
117
|
/**
|
|
106
118
|
* @method floatFixed
|
|
107
119
|
* @description 浮点数保留指定位。
|
|
108
120
|
* */
|
|
109
|
-
export declare function floatFixed(num:
|
|
110
|
-
/**
|
|
111
|
-
* @method compatibleExist
|
|
112
|
-
* @description 不存在返回 ——。
|
|
113
|
-
* */
|
|
114
|
-
export declare function compatibleExist(instance: string, replaceStr: string): string;
|
|
121
|
+
export declare function floatFixed(num: string, size?: number): string;
|
|
115
122
|
/**
|
|
116
123
|
* @method cancelBubble
|
|
117
124
|
* @description 阻止冒泡。
|
|
@@ -133,118 +140,91 @@ export declare function removeClass(obj: any, cls: string): void;
|
|
|
133
140
|
* @method throttle
|
|
134
141
|
* @description 节流。
|
|
135
142
|
* */
|
|
136
|
-
export declare function throttle(func: any, wait: number, options: any):
|
|
143
|
+
export declare function throttle(func: any, wait: number, options: any): any;
|
|
137
144
|
/**
|
|
138
145
|
* @method debounce
|
|
139
146
|
* @description 去抖。
|
|
140
147
|
* */
|
|
141
|
-
export declare function debounce(func: any, wait: number, immediate: any):
|
|
148
|
+
export declare function debounce(func: any, wait: number, immediate: any): any;
|
|
142
149
|
/**
|
|
143
150
|
* @method friendlyInterval
|
|
144
151
|
* @description 获取间隔时间。
|
|
145
|
-
* @param {
|
|
146
|
-
* @param {
|
|
147
|
-
* @type {
|
|
148
|
-
* @return {String/
|
|
152
|
+
* @param {number/Date} start 开始时间戳 1585325367122
|
|
153
|
+
* @param {number/Date} end 结束时间戳 1585325367122
|
|
154
|
+
* @type {string} type 返回类型 d: 2(天) text: 2 天 4 时...
|
|
155
|
+
* @return {String/number} 取决于 type
|
|
149
156
|
* */
|
|
150
157
|
export declare function friendlyInterval({ start, end, type }?: {
|
|
151
158
|
start?: number | undefined;
|
|
152
159
|
end?: number | undefined;
|
|
153
160
|
type?: string | undefined;
|
|
154
|
-
}):
|
|
161
|
+
}): number | string;
|
|
155
162
|
/**
|
|
156
163
|
* @method isNumber
|
|
157
164
|
* @description 判断是否有效数字
|
|
158
|
-
* @param {
|
|
159
|
-
* @param {
|
|
160
|
-
* @param {
|
|
161
|
-
* @return {
|
|
165
|
+
* @param {*} num 被判断的值
|
|
166
|
+
* @param {boolean} isNaNAsNumber 是否 NaN 算数字(默认不算)
|
|
167
|
+
* @param {boolean} isUnFiniteAsNumber 是否 无限 算数字(默认不算)
|
|
168
|
+
* @return {boolean} true 是数字
|
|
162
169
|
*/
|
|
163
170
|
export declare function isNumber(num: any, { isNaNAsNumber, isUnFiniteAsNumber }?: {
|
|
164
171
|
isNaNAsNumber?: boolean | undefined;
|
|
165
172
|
isUnFiniteAsNumber?: boolean | undefined;
|
|
166
173
|
}): boolean;
|
|
167
|
-
/**
|
|
168
|
-
* @method updateQueryStringParameter
|
|
169
|
-
* @description 替换或添加地址栏参数。
|
|
170
|
-
* */
|
|
171
|
-
export declare function updateQueryStringParameter(uri: string, key: string, value: string): string;
|
|
172
|
-
/**
|
|
173
|
-
* @method isJsonString
|
|
174
|
-
* @description 判断是否合法 JSON 字符串。
|
|
175
|
-
* */
|
|
176
|
-
export declare function isJsonString(str: string): boolean;
|
|
177
|
-
/**
|
|
178
|
-
* @method getUrlParam
|
|
179
|
-
* @description 链接参数
|
|
180
|
-
* @param {String} sUrl 链接
|
|
181
|
-
* @param {String} sKey 参数
|
|
182
|
-
* */
|
|
183
|
-
export declare function getUrlParam(sUrl: string, sKey: string): any;
|
|
184
|
-
/**
|
|
185
|
-
* @method getSearchQueryParam
|
|
186
|
-
* @description 地址栏参数。
|
|
187
|
-
* */
|
|
188
|
-
export declare function getSearchQueryParam(name: string): string | null;
|
|
189
|
-
/**
|
|
190
|
-
* @method getQueryParam
|
|
191
|
-
* @description 地址栏参数,getSearchQueryParam 的别名。
|
|
192
|
-
* */
|
|
193
|
-
export declare function getQueryParam(name: string): string | null;
|
|
194
174
|
/**
|
|
195
175
|
* @method doFn
|
|
196
176
|
* @description 执行有效函数
|
|
197
|
-
* @param {
|
|
177
|
+
* @param {function} fn 等待被执行的未知是否有效的函数
|
|
198
178
|
* */
|
|
199
179
|
export declare function doFn(fn: any, ...params: any[]): any;
|
|
200
180
|
/**
|
|
201
181
|
* @method setSessionStorage
|
|
202
182
|
* @description 存储数据到 sessionStorage
|
|
203
|
-
* @param {
|
|
204
|
-
* @param {
|
|
183
|
+
* @param {string} key 键
|
|
184
|
+
* @param {string} value 值
|
|
205
185
|
* */
|
|
206
186
|
export declare function setSessionStorage(key: string, value?: any): void;
|
|
207
187
|
/**
|
|
208
188
|
* @method getSessionStorage
|
|
209
189
|
* @description 存储数据到 sessionStorage
|
|
210
|
-
* @param {
|
|
211
|
-
* @return {
|
|
190
|
+
* @param {string} key 键
|
|
191
|
+
* @return {*} 返回值
|
|
212
192
|
* */
|
|
213
193
|
export declare function getSessionStorage(key: string): any;
|
|
214
194
|
/**
|
|
215
195
|
* @method setLocalStorage
|
|
216
196
|
* @description 存储数据到 localStorage
|
|
217
|
-
* @param {
|
|
218
|
-
* @param {
|
|
197
|
+
* @param {string} key 键
|
|
198
|
+
* @param {string} value 值
|
|
219
199
|
* */
|
|
220
200
|
export declare function setLocalStorage(key: string, value?: any): void;
|
|
221
201
|
/**
|
|
222
202
|
* @method getLocalStorage
|
|
223
203
|
* @description 存储数据到 localStorage
|
|
224
|
-
* @param {
|
|
225
|
-
* @return {
|
|
204
|
+
* @param {string} key 键
|
|
205
|
+
* @return {*} 返回值
|
|
226
206
|
* */
|
|
227
207
|
export declare function getLocalStorage(key: string): any;
|
|
228
208
|
/**
|
|
229
209
|
* @method loadCSS
|
|
230
210
|
* @description 动态加载css文件
|
|
231
|
-
* @param {
|
|
232
|
-
* @param {
|
|
233
|
-
* @return {Promise<
|
|
211
|
+
* @param {string} url -- css资源路径
|
|
212
|
+
* @param {string} id -- link标签id
|
|
213
|
+
* @return {Promise<boolean>} true -- 加载成功
|
|
234
214
|
*/
|
|
235
215
|
export declare function loadCSS({ url, id }?: {
|
|
236
216
|
url?: string | undefined;
|
|
237
217
|
id?: string | undefined;
|
|
238
|
-
}): Promise<
|
|
218
|
+
}): Promise<any>;
|
|
239
219
|
/**
|
|
240
220
|
* @method loadScript
|
|
241
221
|
* @description 动态加载js文件
|
|
242
|
-
* @param {
|
|
243
|
-
* @param {
|
|
244
|
-
* @param {
|
|
245
|
-
* @param {
|
|
246
|
-
* @param {
|
|
247
|
-
* @return {Promise<
|
|
222
|
+
* @param {string} url -- js资源路径
|
|
223
|
+
* @param {string} id -- DOM ID
|
|
224
|
+
* @param {function} callback -- 加载后回调函数
|
|
225
|
+
* @param {number} timeout -- 超时时长
|
|
226
|
+
* @param {boolean} isDefer -- 是否添加 defer 标签
|
|
227
|
+
* @return {Promise<boolean>} -- true 成功
|
|
248
228
|
*/
|
|
249
229
|
export declare function loadScript({ url, id, callback, timeout, isDefer }?: {
|
|
250
230
|
url?: string | undefined;
|
|
@@ -252,7 +232,7 @@ export declare function loadScript({ url, id, callback, timeout, isDefer }?: {
|
|
|
252
232
|
callback?: (() => void) | undefined;
|
|
253
233
|
timeout?: number | undefined;
|
|
254
234
|
isDefer?: boolean | undefined;
|
|
255
|
-
}): any
|
|
235
|
+
}): Promise<any>;
|
|
256
236
|
/**
|
|
257
237
|
* @method mNow
|
|
258
238
|
* @description 获取时间戳
|
|
@@ -267,55 +247,55 @@ export declare function setCookie(name: string, value: string, days: number, dom
|
|
|
267
247
|
* @method getCookie
|
|
268
248
|
* @description 获取 Cookie
|
|
269
249
|
*/
|
|
270
|
-
export declare function getCookie(name: string): string
|
|
250
|
+
export declare function getCookie(name: string): string;
|
|
271
251
|
/**
|
|
272
252
|
* @method getPerformance
|
|
273
253
|
* @description 获取页面加载相关的各项数据
|
|
274
|
-
* @param {
|
|
275
|
-
* @return {Promise<
|
|
254
|
+
* @param {boolean} camelCase -- true(默认) 以驼峰形式返回数据 false 以下划线形式返回数据
|
|
255
|
+
* @return {Promise<object>} 加载数据
|
|
276
256
|
*/
|
|
277
257
|
export declare function getPerformance({ camelCase }?: {
|
|
278
258
|
camelCase?: boolean | undefined;
|
|
279
|
-
}): Promise<
|
|
259
|
+
}): Promise<any>;
|
|
280
260
|
/**
|
|
281
261
|
* @method inRate
|
|
282
262
|
* @description 百分位概率
|
|
283
|
-
* @param {
|
|
284
|
-
* @return {
|
|
263
|
+
* @param {number} rate -- 0.1 ~ 1 => 1% ~ 100%
|
|
264
|
+
* @return {boolean} true 命中
|
|
285
265
|
*/
|
|
286
266
|
export declare function inRate(rate: number): boolean;
|
|
287
267
|
/**
|
|
288
268
|
* @method isSafePWAEnv
|
|
289
269
|
* @description 判断是否是安全的 PWA 环境
|
|
290
|
-
* @return {
|
|
270
|
+
* @return {boolean} true 是
|
|
291
271
|
*/
|
|
292
272
|
export declare function isSafePWAEnv(): boolean;
|
|
293
273
|
/**
|
|
294
|
-
* @method
|
|
274
|
+
* @method getBrowserInfo
|
|
295
275
|
* @description 返回浏览器信息 https://github.com/JowayYoung/juejin-code/blob/master/browser-type.js
|
|
296
|
-
* @return {
|
|
276
|
+
* @return {object} 浏览器信息
|
|
297
277
|
*/
|
|
298
|
-
export declare function
|
|
278
|
+
export declare function getBrowserInfo(): any;
|
|
299
279
|
/**
|
|
300
280
|
* @method clearHtml
|
|
301
281
|
* @description 去除HTML标签
|
|
302
|
-
* @param {
|
|
303
|
-
* @return {
|
|
282
|
+
* @param {string} string 带html标签的字符串
|
|
283
|
+
* @return {string} 字符串
|
|
304
284
|
*/
|
|
305
285
|
export declare function clearHtml(string?: string): string;
|
|
306
286
|
/**
|
|
307
287
|
* @method cutCHSString
|
|
308
288
|
* @description 截取字符串,中文算2个字节
|
|
309
|
-
* @param {
|
|
310
|
-
* @param {
|
|
311
|
-
* @param {
|
|
312
|
-
* @returns {
|
|
289
|
+
* @param {string} str 要截取的字符串
|
|
290
|
+
* @param {number} len
|
|
291
|
+
* @param {boolean} hasDot
|
|
292
|
+
* @returns {string} 返回截取后的字符串
|
|
313
293
|
*/
|
|
314
294
|
export declare function cutCHSString(str?: string, len?: number, hasDot?: boolean): string;
|
|
315
295
|
/**
|
|
316
296
|
* @method windowLoaded
|
|
317
297
|
* @description 页面加载完成
|
|
318
|
-
* @param {
|
|
298
|
+
* @param {number} timeout 超时时间 / 单位:秒
|
|
319
299
|
* @return {Promise<string>} document is loaded? 'complete' 'load' / 'timeout'
|
|
320
300
|
*/
|
|
321
301
|
export declare function windowLoaded({ timeout }?: {
|
|
@@ -324,48 +304,22 @@ export declare function windowLoaded({ timeout }?: {
|
|
|
324
304
|
/**
|
|
325
305
|
* @method addInlineStyle
|
|
326
306
|
* @description 添加内联样式
|
|
327
|
-
* @param {
|
|
328
|
-
* @param {
|
|
329
|
-
* @return {
|
|
307
|
+
* @param {string} inlineStyle 内联样式字符串
|
|
308
|
+
* @param {string} id <style> 标签的 ID
|
|
309
|
+
* @return {boolean} 添加成功/失败
|
|
330
310
|
*/
|
|
331
311
|
export declare function addInlineStyle({ inlineStyle, id }?: {
|
|
332
312
|
inlineStyle?: string | undefined;
|
|
333
313
|
id?: string | undefined;
|
|
334
314
|
}): boolean;
|
|
335
315
|
/**
|
|
336
|
-
* @method
|
|
337
|
-
* @description
|
|
338
|
-
* @param {
|
|
339
|
-
* @param {
|
|
340
|
-
* @
|
|
341
|
-
* @param {String} imgClassName 图片的类名
|
|
342
|
-
* @param {Object} imgDom 图片 Dom 对象
|
|
343
|
-
* @param {String} action 操作类型 hide 隐藏指定 `containerClassName` 滚动条
|
|
344
|
-
* @param {String} customStyle 滚动条的定制样式,会覆盖默认样式
|
|
345
|
-
* @return {Boolean} 设置成功
|
|
346
|
-
*/
|
|
347
|
-
export declare function customScrollBarForTransformEle({ containerClassName, imgBoxClassName, imgBoxDom, imgClassName, imgDom, action, customStyle }?: {
|
|
348
|
-
containerClassName?: string | undefined;
|
|
349
|
-
imgBoxClassName?: string | undefined;
|
|
350
|
-
imgBoxDom?: null | undefined;
|
|
351
|
-
imgClassName?: string | undefined;
|
|
352
|
-
imgDom?: null | undefined;
|
|
353
|
-
action?: string | undefined;
|
|
354
|
-
customStyle?: string | undefined;
|
|
355
|
-
}): boolean;
|
|
356
|
-
/**
|
|
357
|
-
* @method calcContainImageSizeAndPosition
|
|
358
|
-
* @description 计算适配容器宽度的图片的尺寸、距离顶部的距离。如果高度不足以占满容器,使其垂直居中;如果高度比容器长,由上向下铺开。
|
|
359
|
-
* @param {Number} oriImageWidth 图片原始宽度
|
|
360
|
-
* @param {Number} oriImageHeight 图片原始高度
|
|
361
|
-
* @param {Number} viewportWidth 可视窗口宽度
|
|
362
|
-
* @param {Number} viewportHeight 可视窗口高度
|
|
363
|
-
* @return {Object} 结果 {"targetImageWidth":375,"targetImageHeight":375,"top":218.5,"wPer":1.25}
|
|
316
|
+
* @method genCustomConsole
|
|
317
|
+
* @description 生成自定义控制台打印
|
|
318
|
+
* @param {string} prefix 前缀
|
|
319
|
+
* @param {function} allowFn 允许打印的判断函数
|
|
320
|
+
* @return {object} 新实例
|
|
364
321
|
*/
|
|
365
|
-
export declare function
|
|
366
|
-
|
|
367
|
-
oriImageHeight?: number | undefined;
|
|
368
|
-
viewportWidth?: number | undefined;
|
|
369
|
-
viewportHeight?: number | undefined;
|
|
322
|
+
export declare function genCustomConsole({ prefix }?: {
|
|
323
|
+
prefix?: string | undefined;
|
|
370
324
|
}): any;
|
|
371
325
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,SAAK,EAAE,IAAI,SAAK,GAAG,MAAM,CAqBtE;AAED;;;;;;GAMG;AACH,wBAAgB,2BAA2B,CAAC,IAAI,SAAK,EAAE,IAAI,SAAK,GAAG,MAAM,CA8BxE;AAED;;;;;KAKK;AACL,wBAAgB,aAAa,CAAC,KAAK,SAAK,GAAG,MAAM,CAOhD;AAED;;;;;;KAMK;AACL,wBAAgB,WAAW,CAAC,GAAG,SAAK,EAAE,KAAK,SAAK,GAAG,MAAM,CAiBxD;AAED;;;;;;;KAOK;AACJ,wBAAgB,gBAAgB,CAAC,GAAG,SAAK,EAAE,KAAK,SAAK,EAAE,KAAK,SAAK,GAAG,MAAM,CAQ1E;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAK,GAAG,MAAM,CAQpD;AAED;;;;;KAKK;AACL,wBAAgB,SAAS,CAAC,GAAG,SAAK,EAAE,KAAK,WAAe,GAAG,MAAM,CAOhE;AAED;;;;;KAKK;AACL,wBAAgB,oBAAoB,CAAC,SAAS,SAAK,GAAG,MAAM,CAG3D;AAED;;;;;KAKK;AACL,wBAAgB,oBAAoB,CAAC,SAAS,SAAK,GAAG,MAAM,CAG3D;AAED;;;;;KAKK;AACL,wBAAgB,KAAK,CAAC,GAAG,SAAK,GAAG,MAAM,CAQtC;AAED;;;;;KAKK;AACL,wBAAgB,OAAO,CAAC,GAAG,SAAK,GAAG,MAAM,CAMxC;AAED;;;;;KAKK;AACL,wBAAgB,cAAc,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAE5C;AAED;;;;;KAKK;AACL,wBAAgB,YAAY,CAAC,GAAG,SAAK,GAAG,OAAO,CAS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