forked from ConquestArrow/dtsmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclone.d.ts
84 lines (76 loc) · 2.23 KB
/
clone.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
// Type definitions for clone
// Project: [LIBRARY_URL_HERE]
// Definitions by: [YOUR_NAME_HERE] <[YOUR_URL_HERE]>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* Clones (copies) an Object using deep copying.
*
* This function supports circular references by default, but if you are certain
* there are no circular references in your object, you can save some CPU time
* by calling clone(obj, false).
*
* Caution: if `circular` is false and `parent` contains circular references,
* your program may enter an infinite loop and crash.
*
* @param `parent` - the object to be cloned
* @param `circular` - set to true if the object to be cloned may contain
* circular references. (optional - true by default)
* @param `depth` - set to a number if the object is only to be cloned to
* a particular depth. (optional - defaults to Infinity)
* @param `prototype` - sets the prototype to be used when cloning an object.
* (optional - defaults to parent prototype).
* @param `includeNonEnumerable` - set to true if the non-enumerable properties
* should be cloned as well. Non-enumerable properties on the prototype
* chain will be ignored. (optional - false by default)
* @param parent
* @param circular
* @param depth
* @param prototype
* @param includeNonEnumerable
* @return
*/
declare function clone(parent : any, circular : boolean, depth : number, prototype : any, includeNonEnumerable : any): any;
/**
*
*/
declare namespace clone{
/**
* Simple flat clone using prototype, accepts only objects, usefull for property
* override on FLAT configuration object (no nested props).
*
* USE WITH CAUTION! This may not behave as you wish if you do not know how this
* works.
* @param parent
*/
function clonePrototype(parent : any): void;
/**
* private utility functions
* @param o
* @return
*/
function __objToStr(o : any): string;
/**
*
* @param o
* @return
*/
function __isDate(o : any): boolean;
/**
*
* @param o
* @return
*/
function __isArray(o : any): boolean;
/**
*
* @param o
* @return
*/
function __isRegExp(o : any): boolean;
/**
*
* @param re
* @return
*/
function __getRegExpFlags(re : any): string;
}