@@ -7,8 +7,8 @@ declare var objectPath: ObjectPathGlobal.IObjectPathStatic;
7
7
8
8
declare module ObjectPathGlobal {
9
9
10
- var Path : Array < number | string > | number | string ;
11
- var multiArray : Array < typeof Path > ;
10
+ type IPath = Array < number | string > | number | string ;
11
+ type IMultiArray = Array < IPath > ;
12
12
13
13
interface IObjectPathStatic {
14
14
/**
@@ -24,7 +24,7 @@ declare module ObjectPathGlobal {
24
24
* @param {string[]|string } path
25
25
* @return object
26
26
*/
27
- del < T extends { } > ( object : T , path : typeof Path ) : T ;
27
+ del < T extends { } > ( object : T , path : IPath ) : T ;
28
28
/**
29
29
* @see objectPath.del
30
30
*/
@@ -41,7 +41,7 @@ declare module ObjectPathGlobal {
41
41
* @param {string[]|string } path
42
42
* @return object
43
43
*/
44
- has < T extends { } > ( object : T , path : typeof Path ) : boolean ;
44
+ has < T extends { } > ( object : T , path : IPath ) : boolean ;
45
45
/**
46
46
* @see objectPath.has
47
47
*/
@@ -58,7 +58,7 @@ declare module ObjectPathGlobal {
58
58
* @param {string|string[]|number|number[] } path
59
59
* @param {* } [defaultValue=undefined]
60
60
*/
61
- get < T extends { } , TResult > ( object : T , path : typeof Path , defaultValue ?: TResult ) : TResult ;
61
+ get < T extends { } , TResult > ( object : T , path : IPath , defaultValue ?: TResult ) : TResult ;
62
62
/**
63
63
* @see objectPath.get
64
64
*/
@@ -77,7 +77,7 @@ declare module ObjectPathGlobal {
77
77
* @param {boolean } [doNotReplace=false]
78
78
* @return Any existing value on the path if any
79
79
*/
80
- set < T extends { } , TExisting > ( object : T , path : typeof Path , value : any , doNotReplace ?:boolean ) : TExisting ;
80
+ set < T extends { } , TExisting > ( object : T , path : IPath , value : any , doNotReplace ?:boolean ) : TExisting ;
81
81
/**
82
82
* @see objectPath.set
83
83
*/
@@ -92,7 +92,7 @@ declare module ObjectPathGlobal {
92
92
* Create (if path isn't an array) and push the value to it. Can push unlimited number of values
93
93
* @param {object } object
94
94
*/
95
- push < T extends { } > ( object : T , path : typeof Path , ...args :any [ ] ) :void ;
95
+ push < T extends { } > ( object : T , path : IPath , ...args :any [ ] ) :void ;
96
96
/**
97
97
* @see objectPath.push
98
98
*/
@@ -106,7 +106,7 @@ declare module ObjectPathGlobal {
106
106
* @param {* } defaultValue
107
107
* @return {* }
108
108
*/
109
- coalesce < T extends { } , TResult > ( object : T , paths : typeof multiArray , defaultValue ?: TResult ) :TResult ;
109
+ coalesce < T extends { } , TResult > ( object : T , paths : IMultiArray , defaultValue ?: TResult ) :TResult ;
110
110
111
111
/*======== Empty =========*/
112
112
/**
@@ -115,7 +115,7 @@ declare module ObjectPathGlobal {
115
115
* @param {object } object
116
116
* @param {string|string[]|number[] } path
117
117
*/
118
- empty < T extends { } , TResult > ( object : T , path : typeof Path ) :TResult ;
118
+ empty < T extends { } , TResult > ( object : T , path : IPath ) :TResult ;
119
119
/**
120
120
* @see objectPath.empty
121
121
*/
@@ -131,7 +131,7 @@ declare module ObjectPathGlobal {
131
131
* @param {object } object
132
132
* @param {string|string[]|number|number[] } path
133
133
*/
134
- ensureExists < T extends { } , TExisting > ( object : T , path : typeof Path , value : any ) :TExisting ;
134
+ ensureExists < T extends { } , TExisting > ( object : T , path : IPath , value : any ) :TExisting ;
135
135
/**
136
136
* @see objectPath.ensureExists
137
137
*/
@@ -149,7 +149,7 @@ declare module ObjectPathGlobal {
149
149
* @param {* } value
150
150
* @param {number } [at=0]
151
151
*/
152
- insert < T extends { } > ( object : T , path : typeof Path , value : any , at ?: number ) :void ;
152
+ insert < T extends { } > ( object : T , path : IPath , value : any , at ?: number ) :void ;
153
153
}
154
154
155
155
interface IObjectPathBound < T extends { } > {
@@ -158,7 +158,7 @@ declare module ObjectPathGlobal {
158
158
/**
159
159
* @see objectPath.ensureExists
160
160
*/
161
- del ( path : typeof Path ) : T ;
161
+ del ( path : IPath ) : T ;
162
162
/**
163
163
* @see objectPath.del
164
164
*/
@@ -168,7 +168,7 @@ declare module ObjectPathGlobal {
168
168
/**
169
169
* @see objectPath.ensureExists
170
170
*/
171
- has ( path : typeof Path ) : boolean ;
171
+ has ( path : IPath ) : boolean ;
172
172
/**
173
173
* @see objectPath.has
174
174
*/
@@ -178,7 +178,7 @@ declare module ObjectPathGlobal {
178
178
/**
179
179
* @see objectPath.ensureExists
180
180
*/
181
- get < TResult > ( path : typeof Path , defaultValue ?: TResult ) : TResult ;
181
+ get < TResult > ( path : IPath , defaultValue ?: TResult ) : TResult ;
182
182
/**
183
183
* @see objectPath.get
184
184
*/
@@ -188,7 +188,7 @@ declare module ObjectPathGlobal {
188
188
/**
189
189
* @see objectPath.ensureExists
190
190
*/
191
- set < TExisting > ( path : typeof Path , value : any , doNotReplace ?:boolean ) : TExisting ;
191
+ set < TExisting > ( path : IPath , value : any , doNotReplace ?:boolean ) : TExisting ;
192
192
/**
193
193
* @see objectPath.set
194
194
*/
@@ -198,7 +198,7 @@ declare module ObjectPathGlobal {
198
198
/**
199
199
* @see objectPath.ensureExists
200
200
*/
201
- push ( path : typeof Path , ...args :any [ ] ) :void ;
201
+ push ( path : IPath , ...args :any [ ] ) :void ;
202
202
/**
203
203
* @see objectPath.push
204
204
*/
@@ -208,13 +208,13 @@ declare module ObjectPathGlobal {
208
208
/**
209
209
* @see objectPath.ensureExists
210
210
*/
211
- coalesce < TResult > ( paths : typeof multiArray , defaultValue ?: TResult ) :TResult ;
211
+ coalesce < TResult > ( paths : IMultiArray , defaultValue ?: TResult ) :TResult ;
212
212
213
213
/*======== Empty =========*/
214
214
/**
215
215
* @see objectPath.ensureExists
216
216
*/
217
- empty ( path : typeof Path ) :T ;
217
+ empty ( path : IPath ) :T ;
218
218
/**
219
219
* @see objectPath.empty
220
220
*/
@@ -224,7 +224,7 @@ declare module ObjectPathGlobal {
224
224
/**
225
225
* @see objectPath.ensureExists
226
226
*/
227
- ensureExists < TExisting > ( path : typeof Path , value : any ) :TExisting ;
227
+ ensureExists < TExisting > ( path : IPath , value : any ) :TExisting ;
228
228
/**
229
229
* @see objectPath.ensureExists
230
230
*/
@@ -234,7 +234,7 @@ declare module ObjectPathGlobal {
234
234
/**
235
235
* @see objectPath.insert
236
236
*/
237
- insert ( path : typeof Path , value : any , at ?: number ) :void ;
237
+ insert ( path : IPath , value : any , at ?: number ) :void ;
238
238
}
239
239
}
240
240
0 commit comments