1 | interface Obj extends Object {
|
2 | [key: string]: any
|
3 |
|
4 | [key: number]: any
|
5 | }
|
6 |
|
7 | declare type UnexpectType =
|
8 | | undefined
|
9 | | null
|
10 | | string
|
11 | | number
|
12 | | boolean
|
13 | | Date
|
14 | | Error
|
15 | | RegExp
|
16 | | FileList
|
17 | | File
|
18 | | Element
|
19 | | Window
|
20 | | Document
|
21 | declare type ReferencedPath = string
|
22 | declare type QuotePath = string
|
23 | declare type CircularStructurePaths = [ReferencedPath, QuotePath]
|
24 |
|
25 | interface CopyDomOptions {
|
26 | |
27 |
|
28 |
|
29 |
|
30 |
|
31 | clearSelect?: boolean
|
32 | |
33 |
|
34 |
|
35 |
|
36 |
|
37 | cut?: boolean
|
38 | }
|
39 |
|
40 |
|
41 |
|
42 |
|
43 |
|
44 |
|
45 | declare function copyDom(dom: Element, options?: CopyDomOptions): boolean
|
46 |
|
47 | /**
|
48 | * @param {String} text
|
49 | * @return {Promise<boolean>}
|
50 | * */
|
51 | declare function copyText(text: string): Promise<true>
|
52 |
|
53 | /**
|
54 | * @description Deep copy, has the ability to deal nested loop
|
55 | * */
|
56 | declare function objectDeepCopy<T extends Obj = Obj>(obj: T): T
|
57 |
|
58 | /**
|
59 | * @description Deep copy, cannot deal nested loop
|
60 | * */
|
61 | declare function objectSimpleCopy(obj: Obj): any
|
62 |
|
63 | /**
|
64 | * @description Deep merge, cannot deal nested loop
|
65 | * @return The first parameter object which has been merged
|
66 | * */
|
67 | declare function objectDeepMerge<T extends Obj = Obj>(
|
68 | target: T,
|
69 | ...rest: T[]
|
70 | ): any
|
71 |
|
72 | /**
|
73 | * @description Returns the start dimension of the nested loop
|
74 | * */
|
75 | declare function isCircularStructure(obj: Obj): CircularStructurePaths | null
|
76 |
|
77 | export {
|
78 | CircularStructurePaths,
|
79 | CopyDomOptions,
|
80 | Obj,
|
81 | QuotePath,
|
82 | ReferencedPath,
|
83 | UnexpectType,
|
84 | copyDom,
|
85 | copyText,
|
86 | isCircularStructure,
|
87 | objectDeepCopy,
|
88 | objectDeepMerge,
|
89 | objectSimpleCopy,
|
90 | }
|
91 |
|
\ | No newline at end of file |