nhanh-pure-function 1.4.0 → 2.0.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/lib/User/User.js DELETED
@@ -1,338 +0,0 @@
1
- import { _IsObject, _NotNull, _Debounce } from "../Utility/Utility";
2
-
3
- /**
4
- * 滚动结束监听器
5
- * @param {(trigger: "vertical" | "horizontal") => void} callback
6
- */
7
- export function _ScrollEndListener(callback) {
8
- const debouncedCallback = _Debounce(callback, 100);
9
- let lastScrollTop = 0;
10
- let lastScrollLeft = 0;
11
- return function (payload) {
12
- const target = payload.target;
13
- if (!target) return;
14
-
15
- const {
16
- scrollTop,
17
- scrollHeight,
18
- clientHeight,
19
- scrollLeft,
20
- scrollWidth,
21
- clientWidth,
22
- } = target;
23
- function vertical() {
24
- if (lastScrollTop == scrollTop) return;
25
- /** 向上滚动? */
26
- const isUp = lastScrollTop > scrollTop;
27
- lastScrollTop = scrollTop;
28
- if (isUp) return;
29
- const bottom = scrollHeight - scrollTop - clientHeight;
30
- if (bottom <= 1) debouncedCallback("vertical");
31
- }
32
- function horizontal() {
33
- if (lastScrollLeft == scrollLeft) return;
34
- /** 向左滚动? */
35
- const isLeft = lastScrollLeft > scrollLeft;
36
- lastScrollLeft = scrollLeft;
37
- if (isLeft) return;
38
- const right = scrollWidth - scrollLeft - clientWidth;
39
- if (right <= 1) debouncedCallback("horizontal");
40
- }
41
-
42
- vertical();
43
- horizontal();
44
- };
45
- }
46
-
47
- /**
48
- * 点击非指定dom(包含子级dom)时执行 callback
49
- * @param querySelector 允许点击的 dom 顶层祖先元素选择器
50
- * @param callback 满足条件时执行的回调
51
- *
52
- * @param options 其他配置
53
- * @param options.uiLibrary 项目使用的 ui库 , 用于排除 ui库 创建的元素 , 避免点击 ui库 创建的元素时意外的执行 callback
54
- * @param options.isClickAllowed 是否允许该点击 ( 如果不确定可以返回 undefined )
55
- */
56
- export function _CloseOnOutsideClick(querySelector, callback, options) {
57
- const { isClickAllowed, uiLibrary = ["naiveUI", "ElementPlus", "Element"] } =
58
- options || {};
59
-
60
- const UI = (function (obj) {
61
- const arr = [];
62
- for (const key in obj) {
63
- if (Object.hasOwnProperty.call(obj, key)) {
64
- if (uiLibrary.includes(key)) arr.push(...obj[key]);
65
- }
66
- }
67
- return arr;
68
- })({
69
- naiveUI: [
70
- ".v-binder-follower-container",
71
- ".n-image-preview-container",
72
- ".n-modal-container",
73
- ],
74
- ElementPlus: [".el-popper"],
75
- Element: [".el-popper"],
76
- });
77
-
78
- function end() {
79
- callback();
80
- document.removeEventListener("mousedown", mousedown);
81
- }
82
- function mousedown(event) {
83
- if (isClickAllowed) {
84
- const bool = isClickAllowed(event);
85
- if (bool) return;
86
- if (bool === false) return end();
87
- }
88
-
89
- const target = event.target;
90
-
91
- /** 元素这时可能已经被删除了 */
92
- if (!target?.closest("body")) return;
93
-
94
- const isClickable = querySelector
95
- .concat(UI)
96
- .some((className) => Boolean(target?.closest(className)));
97
-
98
- if (!isClickable) end();
99
- }
100
- requestAnimationFrame(() =>
101
- document.addEventListener("mousedown", mousedown)
102
- );
103
- }
104
-
105
- /** 拖拽dom */
106
- export class _Drag {
107
- #dom = null;
108
- #isAllowed = false;
109
- #eventFunction = {};
110
- #pageX = 0;
111
- #pageY = 0;
112
- #top = 0;
113
- #left = 0;
114
- #limit;
115
- #dragDom;
116
-
117
- init(dom, option) {
118
- this.#dom = dom;
119
- this.#limit = option?.limit;
120
- this.#dragDom = option?.dragDom;
121
- this.#eventFunction = {
122
- mousedown: this.mousedown.bind(this),
123
- mousemove: this.mousemove.bind(this),
124
- mouseup: this.mouseup.bind(this),
125
- };
126
-
127
- this.bindOrUnbindEvent("bind");
128
- }
129
- finish() {
130
- this.bindOrUnbindEvent("unbind");
131
- }
132
- bindOrUnbindEvent(type) {
133
- const EventType =
134
- type === "bind" ? "addEventListener" : "removeEventListener";
135
- if (!this.#dom) return console.error("No DOM");
136
-
137
- this.#dom[EventType]("mousedown", this.#eventFunction.mousedown);
138
- document[EventType]("mousemove", this.#eventFunction.mousemove);
139
- document[EventType]("mouseup", this.#eventFunction.mouseup);
140
- }
141
- alterLocation() {
142
- if (!this.#dom) return console.error("No DOM");
143
- if (this.#limit) {
144
- this.#top = Math.min(this.#top, this.#limit.max.top);
145
- this.#top = Math.max(this.#top, this.#limit.min.top);
146
- this.#left = Math.min(this.#left, this.#limit.max.left);
147
- this.#left = Math.max(this.#left, this.#limit.min.left);
148
- }
149
- this.#dom.style.setProperty("--top", this.#top + "px");
150
- this.#dom.style.setProperty("--left", this.#left + "px");
151
- }
152
- mousedown(event) {
153
- if (!this.#dom) return console.error("No DOM");
154
- if (this.#dragDom && event.target != this.#dragDom) return;
155
- document.body.classList.add("no-select");
156
-
157
- this.#isAllowed = true;
158
- const clientRect = this.#dom.getBoundingClientRect();
159
-
160
- const { pageX, pageY } = event;
161
- this.#pageX = pageX;
162
- this.#pageY = pageY;
163
- this.#top = clientRect.y;
164
- this.#left = clientRect.x;
165
- }
166
- mousemove(event) {
167
- const { pageX, pageY } = event;
168
- if (this.#isAllowed) {
169
- this.#top += pageY - this.#pageY;
170
- this.#left += pageX - this.#pageX;
171
- this.#pageX = pageX;
172
- this.#pageY = pageY;
173
-
174
- this.alterLocation();
175
- }
176
- }
177
- mouseup() {
178
- if (this.#isAllowed) {
179
- this.#isAllowed = false;
180
- document.body.classList.remove("no-select");
181
- }
182
- }
183
- }
184
-
185
- /** 局部拖拽 计算位置距离/百分比 */
186
- export class _LocalDrag {
187
- #parentDom = null;
188
- #isAllowed = false;
189
- #eventFunction = {};
190
- #clientRectX = 0;
191
- #clientRectY = 0;
192
- #top = 0;
193
- #left = 0;
194
- #limit;
195
- #update_move;
196
- #update_up;
197
-
198
- init(parentDom, options = {}) {
199
- this.#parentDom = parentDom;
200
- this.#limit = options.limit;
201
- this.#update_move = options.update_move;
202
- this.#update_up = options.update_up;
203
- this.#eventFunction = {
204
- mousedown: this.mousedown.bind(this),
205
- mousemove: this.mousemove.bind(this),
206
- mouseup: this.mouseup.bind(this),
207
- };
208
-
209
- this.bindOrUnbindEvent("bind");
210
- }
211
- finish() {
212
- this.bindOrUnbindEvent("unbind");
213
- }
214
- bindOrUnbindEvent(type) {
215
- const EventType =
216
- type === "bind" ? "addEventListener" : "removeEventListener";
217
- if (!this.#parentDom) return window.customize_error("No DOM");
218
-
219
- this.#parentDom[EventType]("mousedown", this.#eventFunction.mousedown);
220
- document[EventType]("mousemove", this.#eventFunction.mousemove);
221
- document[EventType]("mouseup", this.#eventFunction.mouseup);
222
- }
223
- updateValue() {
224
- const value = {
225
- top: this.#top,
226
- left: this.#left,
227
- };
228
- if (this.#limit) {
229
- const v = (type) =>
230
- this.#limit
231
- ? (value[type] - this.#limit.min[type]) /
232
- (this.#limit.max[type] - this.#limit.min[type])
233
- : 0;
234
-
235
- value.percentage = {
236
- top: v("top") || 0,
237
- left: v("left") || 0,
238
- };
239
- }
240
- return value;
241
- }
242
- alterLocation() {
243
- if (!this.#parentDom) return window.customize_error("No DOM");
244
- if (this.#limit) {
245
- this.#top = Math.min(this.#top, this.#limit.max.top);
246
- this.#top = Math.max(this.#top, this.#limit.min.top);
247
- this.#left = Math.min(this.#left, this.#limit.max.left);
248
- this.#left = Math.max(this.#left, this.#limit.min.left);
249
- }
250
- if (this.#update_move) this.#update_move(this.updateValue());
251
-
252
- this.#parentDom.style.setProperty("--top", this.#top + "px");
253
- this.#parentDom.style.setProperty("--left", this.#left + "px");
254
- }
255
- mousedown(event) {
256
- if (!this.#parentDom) return window.customize_error("No DOM");
257
- document.body.classList.add("no-select");
258
-
259
- this.#isAllowed = true;
260
- const clientRect = this.#parentDom.getBoundingClientRect();
261
- this.#clientRectY = clientRect.y;
262
- this.#clientRectX = clientRect.x;
263
-
264
- const { pageX, pageY } = event;
265
- this.#top = pageY - this.#clientRectY;
266
- this.#left = pageX - this.#clientRectX;
267
-
268
- this.alterLocation();
269
- }
270
- mousemove(event) {
271
- const { pageX, pageY } = event;
272
- if (this.#isAllowed) {
273
- this.#top = pageY - this.#clientRectY;
274
- this.#left = pageX - this.#clientRectX;
275
- this.alterLocation();
276
- }
277
- }
278
- mouseup() {
279
- if (this.#isAllowed) {
280
- this.#isAllowed = false;
281
- document.body.classList.remove("no-select");
282
- if (this.#update_up) this.#update_up(this.updateValue());
283
- }
284
- }
285
- }
286
-
287
- /** 进入全屏模式 */
288
- export function _EnterFullscreen(content) {
289
- if (!content) {
290
- return Promise.reject("No DOM: ", content);
291
- } else if (content.requestFullscreen) {
292
- return content.requestFullscreen();
293
- } else if (content.mozRequestFullScreen) {
294
- // Firefox
295
- return content.mozRequestFullScreen();
296
- } else if (content.webkitRequestFullscreen) {
297
- // Chrome, Safari and Opera
298
- return content.webkitRequestFullscreen();
299
- } else if (content.msRequestFullscreen) {
300
- // IE/Edge
301
- return content.msRequestFullscreen();
302
- }
303
- }
304
- /** 退出全屏模式 */
305
- export function _ExitFullscreen() {
306
- if (document.exitFullscreen) {
307
- return document.exitFullscreen();
308
- } else if (document.mozCancelFullScreen) {
309
- // Firefox
310
- return document.mozCancelFullScreen();
311
- } else if (document.webkitExitFullscreen) {
312
- // Chrome, Safari and Opera
313
- return document.webkitExitFullscreen();
314
- } else if (document.msExitFullscreen) {
315
- // IE/Edge
316
- return document.msExitFullscreen();
317
- }
318
- }
319
- /** 判断是否处于全屏模式 */
320
- export function _IsFullscreen() {
321
- return (
322
- document.fullscreenElement ||
323
- document.webkitFullscreenElement ||
324
- document.mozFullScreenElement ||
325
- document.msFullscreenElement
326
- );
327
- }
328
- /**
329
- * 返回一个用于切换全屏模式的函数
330
- * @param {HTMLElement} content - 需要进入全屏的元素
331
- * 该函数通过检查不同浏览器的特定方法来实现全屏切换
332
- */
333
- export function _Fullscreen(content) {
334
- return function () {
335
- if (_IsFullscreen()) _ExitFullscreen();
336
- else _EnterFullscreen(content);
337
- };
338
- }
@@ -1,356 +0,0 @@
1
- /**
2
- * 非null | undefined判断
3
- * @param value any
4
- * @returns boolean
5
- */
6
- export function _NotNull(value: any): boolean;
7
-
8
- /**
9
- * 是正常对象吗
10
- * @param {} value
11
- * @returns boolean
12
- */
13
- export function _IsObject(value: any): boolean;
14
-
15
- /**
16
- * 寻找空闲时机执行传入方法
17
- * @param callback 需执行的方法
18
- */
19
- export function _ExecuteWhenIdle(callback: Function);
20
-
21
- /**
22
- * 等待条件满足
23
- * @param conditionChecker 条件检查器
24
- * @param timeoutMillis 超时毫秒数
25
- * @returns Promise<unknown>
26
- */
27
- export function _WaitForCondition(
28
- conditionChecker: () => boolean,
29
- timeoutMillis: number
30
- ): Promise<"完成" | "超时">;
31
-
32
- /**
33
- * 排除子串
34
- * @param inputString 需裁剪字符串
35
- * @param substringToDelete 被裁减字符串
36
- * @param delimiter 分隔符
37
- * @returns 裁减后的字符串
38
- */
39
- export function _ExcludeSubstring(
40
- inputString: string,
41
- substringToDelete: string,
42
- delimiter?: string
43
- ): string;
44
-
45
- /**
46
- * 首字母大写
47
- * @param string
48
- * @returns string
49
- */
50
- export function _CapitalizeFirstLetter(string: string): string;
51
-
52
- /**
53
- * 合并对象 注意: 本函数会直接操作 A
54
- * @param {Object | Array} A
55
- * @param {Object | Array} B
56
- * @returns A&B || B
57
- */
58
- export function _MergeObjects<T, T1>(A: T, B: T1): T & T1;
59
-
60
- /**
61
- * 时间戳转换字符串
62
- * @param {Number | Date} time 时间戳或Date对象
63
- * @param {String} template 完整模板 --> YYYY MM DD hh mm ss ms
64
- * @param {Boolean} pad 补0
65
- */
66
- export function _TimeTransition(
67
- time: number | Date,
68
- template?: string,
69
- pad?: boolean
70
- ): string;
71
-
72
- /**
73
- * 读取文件
74
- * @param src 文件地址
75
- * @returns 文件的字符串内容
76
- */
77
- export function _ReadFile(src: string): Promise<string>;
78
-
79
- /**
80
- * 从给定的href中提取名称部分
81
- * 该函数旨在处理URL字符串,并返回URL路径的最后一部分,去除查询参数
82
- *
83
- * @param {string} href - 待处理的URL字符串
84
- * @param {string} [defaultName="file"] - 默认的文件名,当无法提取时使用
85
- * @returns {string} URL路径的最后一部分,不包括查询参数
86
- */
87
- export function _GetHrefName(href: string, defaultName?: string): string;
88
-
89
- /**
90
- * 下载文件
91
- * @param {string} href 文件路径
92
- * @param {string} fileName 导出文件名
93
- */
94
- export function _DownloadFile(href: string, fileName?: string): Promise<void>;
95
-
96
- /**
97
- * 获取帧率
98
- * @param {(fps , frameTime)=>void} callback callback( 帧率 , 每帧时间 )
99
- * @param {Number} referenceNode 参考节点数量
100
- */
101
- export function _GetFrameRate(
102
- callback: (fps: number, frameTime: number) => void,
103
- referenceNode: number
104
- ): void;
105
-
106
- /**
107
- * 单位转换 12** -> **px
108
- * @param {string} width
109
- * @returns 对应的单位为px的宽
110
- */
111
- export function _GetOtherSizeInPixels(width: string): string;
112
-
113
- /**
114
- * 驼峰命名
115
- * @param {字符串} str
116
- * @param {是否删除分割字符} isRemoveDelimiter
117
- * @returns 'wq1wqw-qw2qw' -> 'wq1Wqw-Qw2Qw' / 'wqWqwQwQw'
118
- */
119
- export function _ConvertToCamelCase(
120
- str: string,
121
- isRemoveDelimiter?: boolean
122
- ): string;
123
-
124
- /**
125
- * 创建文件并下载
126
- * @param {BlobPart[]} content 文件内容
127
- * @param {string} fileName 文件名称
128
- * @param {BlobPropertyBag} options Blob 配置
129
- */
130
- export function _CreateAndDownloadFile(
131
- content: BlobPart[],
132
- fileName: string,
133
- options?: BlobPropertyBag
134
- ): void;
135
-
136
- /**
137
- * 获取url参数
138
- * @param {string} url
139
- * @returns {Object}
140
- */
141
- export function _GetQueryParams(url: string): void;
142
-
143
- /**
144
- * 生成一个UUID(通用唯一标识符)字符串
145
- * 可以选择性地在UUID前面添加前缀
146
- *
147
- * @param {string} prefix - 可选参数,要添加到UUID前面的前缀
148
- * @returns {string} 一个带有可选前缀的UUID字符串
149
- */
150
- export function _GenerateUUID(prefix?: string): string;
151
-
152
- /**
153
- * 防抖
154
- * @param {Function} fn
155
- * @param {number} delay
156
- * @returns {Function}
157
- */
158
- export function _Debounce<T extends (...args: any) => any>(
159
- fn: T,
160
- delay: number
161
- ): (...args: Parameters<T>) => void;
162
-
163
- /**
164
- * 节流
165
- * @param {Function} fn
166
- * @param {number} delay
167
- * @returns {Function}
168
- */
169
- export function _Throttle<T extends (...args: any) => any>(
170
- fn: T,
171
- delay: number
172
- ): (...args: Parameters<T>) => void;
173
-
174
- /**
175
- * 数据类型
176
- * @param {any} value
177
- * @returns string
178
- */
179
- export function _DataType(
180
- value: string
181
- ):
182
- | "string"
183
- | "number"
184
- | "bigint"
185
- | "boolean"
186
- | "symbol"
187
- | "undefined"
188
- | "object"
189
- | "function"
190
- | "array"
191
- | "null";
192
-
193
- /**
194
- * 复制到剪贴板
195
- * @param {string} text
196
- */
197
- export function _CopyToClipboard(text: string): Promise<void>;
198
-
199
- /**
200
- * 格式化文件大小
201
- * @param {number} size
202
- * @returns string
203
- */
204
- export function _FormatFileSize(size: number): string;
205
-
206
- /**
207
- * 根据路径初始化目标对象
208
- * 如果路径中某个属性不存在,则会创建该属性及其所有父属性
209
- * 最终返回路径的最后一个属性对应的值或undefined(如果路径不存在)
210
- *
211
- * @param {Object} model - 要初始化的模型对象
212
- * @param {string} path - 属性路径,使用英文句点分隔
213
- * @returns {any} 路径的最后一个属性对应的值或undefined
214
- */
215
- export function _InitTargetByPath(model: any, path: string): any;
216
-
217
- /**
218
- * 根据路径获取目标对象
219
- * 该函数用于在给定的模型中,通过路径字符串来获取深层嵌套的目标对象如果路径中的某一部分不存在,则会创建一个新的对象(除非已经是路径的最后一部分)
220
- *
221
- * @param {Object} model - 包含要查询的数据的模型对象
222
- * @param {string} path - 用点分隔的路径字符串,表示要访问的对象属性路径
223
- * @returns {Object|undefined} - 返回目标对象,如果路径不存在则返回undefined
224
- */
225
- export function _GetTargetByPath(model: any, path: string): any;
226
-
227
- /**
228
- * 根据路径更新目标值
229
- *
230
- * 该函数通过一个点分隔的路径来更新一个对象中的嵌套属性值
231
- * 它使用了reduce方法来遍历路径数组,并在路径的终点设置新的值
232
- *
233
- * @param {Object} model - 包含要更新数据的模型对象
234
- * @param {string} path - 点分隔的字符串路径,指示如何到达目标属性
235
- * @param {*} value - 要设置的新值
236
- * @returns {*} - 返回更新后的模型对象中的值
237
- */
238
- export function _UpdateTargetByPath(model: any, path: string, value: any): any;
239
-
240
- /**
241
- * 使用 XMLHttpRequest 检查指定 URL 的连接状态
242
- *
243
- * 此函数通过发送一个 HEAD 请求来检查给定 URL 是否可访问 HEAD 请求仅请求文档头部信息,
244
- * 而不是整个页面,因此比 GET 或 POST 请求更快此方法常用于检查 URL 是否有效,以及服务器的响应时间等
245
- *
246
- * @param {string} url - 需要检查连接的 URL 地址
247
- * @returns {Promise} - 返回一个 Promise 对象,该对象在连接成功时解析,在连接失败时拒绝
248
- */
249
- export function _CheckConnectionWithXHR(url: string): Promise<any>;
250
-
251
- /**
252
- * 判断给定URL是否指向一个安全上下文
253
- *
254
- * 安全上下文是指通过一系列安全协议访问的资源,这些协议提供了数据的加密传输和身份验证
255
- * 本函数通过检查URL的协议前缀来判断是否属于安全上下文
256
- *
257
- * @param {string} url - 待检查的URL字符串
258
- * @returns {boolean} - 如果URL指向安全上下文,则返回true;否则返回false
259
- */
260
- export function _IsSecureContext(url: string): boolean;
261
-
262
- type FileExtensions = {
263
- image: string[];
264
- ppt: string[];
265
- word: string[];
266
- excel: string[];
267
- pdf: string[];
268
- text: string[];
269
- audio: string[];
270
- video: string[];
271
- archive: string[];
272
- code: string[];
273
- font: string[];
274
- };
275
- /**
276
- * 文件类型检查器类
277
- * 用于检查和验证文件的类型
278
- */
279
- export class _FileTypeChecker {
280
- // 定义各种文件类型的文件扩展名
281
- static fileExtensions: FileExtensions;
282
-
283
- // 缓存文件扩展名的条目,以提高性能
284
- static cachedEntries: [keyof FileExtensions, string[]][];
285
-
286
- /**
287
- * 检查给定URL的文件类型
288
- * @param {string} url - 文件的URL
289
- * @returns {keyof _FileTypeChecker['fileExtensions'] | 'unknown'} - 返回文件类型或 "unknown"
290
- */
291
- static check(url: string): keyof FileExtensions | "unknown";
292
- /**
293
- * 检查给定URL的文件类型
294
- * @param {string} url - 文件的URL
295
- * @param {keyof _FileTypeChecker['fileExtensions']} [type] - 可选参数,指定要检查的文件类型
296
- * @returns {boolean} - 返回布尔值
297
- */
298
- static check(url: string, type: keyof FileExtensions): boolean;
299
-
300
- /**
301
- * 静态方法,用于解析地址信息
302
- * 该方法接受一个URL字符串,将其解析为一个包含地址详情的对象数组
303
- * 主要用于批量处理以逗号分隔的URL列表,为每个URL生成相应的名称和类型
304
- *
305
- * @param {string} url - 以逗号分隔的URL字符串,每个URL代表一个资源的位置
306
- * @returns {Array} - 包含每个URL及其相关信息(名称和类型)的对象数组
307
- */
308
- static parseAddresses(
309
- url: string
310
- ): { url: string; name: string; type: keyof FileExtensions | "unknown" }[];
311
-
312
- /**
313
- * 检查 MIME 类型是否与指定的模式匹配
314
- * @param {string} type - 要检查的 MIME 类型(如 "image/png")
315
- * @param {string} [accept] - 可接受的 MIME 类型模式(如 "image/*, text/plain")
316
- * @returns {boolean} - 如果类型匹配,则返回 true,否则返回 false
317
- */
318
- static matchesMimeType(type: string, accept?: string): boolean;
319
-
320
- /**
321
- * 检查URL是否具有任何指定的文件扩展名
322
- * @param {string} url - 文件的URL
323
- * @param {string[]} validExtensions - 有效文件扩展名的数组
324
- * @returns {boolean} - 如果URL具有任何指定的文件扩展名,则返回true,否则返回false
325
- */
326
- private static _checkExtension(
327
- url: string,
328
- validExtensions: string[]
329
- ): boolean;
330
-
331
- /**
332
- * 检测文件URL的类型
333
- * @param {string} url - 文件的URL
334
- * @returns {keyof _FileTypeChecker['fileExtensions'] | 'unknown'} - 如果URL与任何已知类型匹配,则返回文件类型,否则返回"unknown"
335
- */
336
- private static _detectFileType(url: string): keyof FileExtensions | "unknown";
337
- }
338
-
339
- /**
340
- * 旋转列表函数
341
- *
342
- * 该函数接受一个列表作为参数,并返回一个二维数组,其中每个内部数组都是原列表的一种旋转形式
343
- * 旋转列表的原理是将原列表分割成两部分,并将这两部分重新组合,形成一个新的列表
344
- *
345
- * @param list T[] - 需要旋转的列表,列表元素类型为泛型T
346
- * @returns T[][] - 返回一个二维数组,每个内部数组代表原列表的一种旋转形式
347
- */
348
- export function _RotateList<T>(list: T[]): T[][];
349
-
350
- /**
351
- * 克隆给定值的函数
352
- * 该函数尝试使用window.structuredClone方法进行深克隆,如果失败则使用自定义方法
353
- * @param {any} val - 需要克隆的值
354
- * @returns {any} - 克隆后的值
355
- */
356
- export function _Clone<T>(val: T): T;