@angular-wave/angular.ts 0.14.3 → 0.15.1
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/@types/angular.d.ts +27 -25
- package/@types/animations/animate-cache.d.ts +46 -2
- package/@types/animations/animate-children-directive.d.ts +4 -4
- package/@types/animations/animate-js.d.ts +1 -10
- package/@types/animations/animate.d.ts +6 -1
- package/@types/animations/interface.d.ts +15 -0
- package/@types/animations/runner/animate-runner.d.ts +73 -52
- package/@types/animations/shared.d.ts +0 -16
- package/@types/core/compile/attributes.d.ts +40 -10
- package/@types/core/compile/compile.d.ts +1 -1
- package/@types/core/compile/inteface.d.ts +5 -1
- package/@types/core/controller/controller.d.ts +1 -1
- package/@types/core/di/inteface.d.ts +11 -0
- package/@types/core/interpolate/interface.d.ts +1 -0
- package/@types/core/parse/ast/ast-node.d.ts +2 -0
- package/@types/core/parse/interface.d.ts +1 -1
- package/@types/core/parse/interpreter.d.ts +5 -3
- package/@types/core/parse/parse.d.ts +4 -1
- package/@types/core/scope/interface.d.ts +26 -0
- package/@types/core/scope/scope.d.ts +13 -13
- package/@types/directive/attrs/attrs.d.ts +2 -5
- package/@types/directive/bind/bind.d.ts +5 -7
- package/@types/directive/class/class.d.ts +3 -3
- package/@types/directive/controller/controller.d.ts +2 -2
- package/@types/directive/form/form.d.ts +16 -13
- package/@types/directive/include/include.d.ts +4 -4
- package/@types/directive/init/init.d.ts +2 -2
- package/@types/directive/input/input.d.ts +16 -0
- package/@types/directive/listener/listener.d.ts +4 -0
- package/@types/directive/messages/messages.d.ts +9 -8
- package/@types/directive/model/interface.d.ts +18 -0
- package/@types/directive/model/model.d.ts +25 -23
- package/@types/directive/non-bindable/non-bindable.d.ts +2 -2
- package/@types/directive/ref/ref.d.ts +5 -8
- package/@types/directive/repeat/repeat.d.ts +2 -4
- package/@types/directive/script/script.d.ts +2 -2
- package/@types/directive/select/select.d.ts +9 -10
- package/@types/directive/setter/setter.d.ts +2 -2
- package/@types/directive/show-hide/show-hide.d.ts +2 -4
- package/@types/directive/switch/switch.d.ts +4 -4
- package/@types/directive/validators/validators.d.ts +2 -2
- package/@types/injection-tokens.d.ts +3 -2
- package/@types/interface.d.ts +72 -23
- package/@types/namespace.d.ts +50 -6
- package/@types/router/directives/state-directives.d.ts +26 -24
- package/@types/router/directives/view-directive.d.ts +27 -131
- package/@types/router/glob/glob.d.ts +2 -6
- package/@types/router/router.d.ts +6 -4
- package/@types/router/scroll/interface.d.ts +3 -0
- package/@types/router/scroll/view-scroll.d.ts +8 -0
- package/@types/router/state/interface.d.ts +30 -126
- package/@types/router/state/state-builder.d.ts +14 -7
- package/@types/router/state/state-matcher.d.ts +11 -3
- package/@types/router/state/state-object.d.ts +5 -7
- package/@types/router/state/state-queue-manager.d.ts +14 -8
- package/@types/router/state/state-registry.d.ts +26 -12
- package/@types/router/state/state-service.d.ts +24 -12
- package/@types/router/template-factory.d.ts +2 -2
- package/@types/router/transition/hook-registry.d.ts +15 -5
- package/@types/router/transition/interface.d.ts +9 -9
- package/@types/router/transition/transition-hook.d.ts +11 -0
- package/@types/router/transition/transition-service.d.ts +12 -5
- package/@types/router/transition/transition.d.ts +20 -14
- package/@types/router/url/url-rule.d.ts +12 -9
- package/@types/router/url/url-rules.d.ts +3 -84
- package/@types/router/url/url-service.d.ts +23 -18
- package/@types/router/view/view.d.ts +4 -4
- package/@types/services/anchor-scroll/anchor-scroll.d.ts +2 -17
- package/@types/services/anchor-scroll/interface.d.ts +15 -0
- package/@types/services/cookie/cookie.d.ts +7 -13
- package/@types/services/exception/interface.d.ts +3 -3
- package/@types/services/http/http.d.ts +6 -31
- package/@types/services/http/interface.d.ts +22 -0
- package/@types/services/location/location.d.ts +14 -13
- package/@types/services/log/log.d.ts +7 -3
- package/@types/services/pubsub/pubsub.d.ts +18 -13
- package/@types/services/rest/rest.d.ts +7 -5
- package/@types/services/sce/interface.d.ts +25 -0
- package/@types/services/sce/sce.d.ts +9 -1
- package/@types/services/sse/interface.d.ts +8 -1
- package/@types/services/sse/sse.d.ts +10 -18
- package/@types/services/storage/storage.d.ts +6 -6
- package/@types/services/stream/interface.d.ts +1 -1
- package/@types/services/stream/stream.d.ts +98 -0
- package/@types/shared/common.d.ts +2 -2
- package/@types/shared/dom.d.ts +21 -42
- package/@types/shared/hof.d.ts +27 -37
- package/@types/shared/noderef.d.ts +3 -3
- package/@types/shared/strings.d.ts +31 -10
- package/@types/shared/utils.d.ts +207 -101
- package/@types/shared/validate.d.ts +20 -0
- package/dist/angular-ts.esm.js +2461 -2298
- package/dist/angular-ts.umd.js +2461 -2298
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular-ts.umd.min.js.gz +0 -0
- package/dist/angular-ts.umd.min.js.map +1 -1
- package/package.json +1 -1
- package/@types/router/state-filters.d.ts +0 -39
- package/@types/router/view-scroll.d.ts +0 -12
- package/@types/shared/cache.d.ts +0 -7
package/@types/shared/utils.d.ts
CHANGED
|
@@ -1,9 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
|
+
* @param {any} value
|
|
3
|
+
* @returns {value is Proxy<ng.Scope> | ng.Scope}
|
|
4
|
+
*/
|
|
5
|
+
export function isProxy(value: any): value is ProxyConstructor | ng.Scope;
|
|
6
|
+
/**
|
|
7
|
+
* Unwraps a proxy if the value is a proxy, otherwise returns the value as-is.
|
|
2
8
|
*
|
|
3
|
-
* @
|
|
4
|
-
* @
|
|
9
|
+
* @template T
|
|
10
|
+
* @param {T | (T & { $target: T })} val - A value that might be a proxy.
|
|
11
|
+
* @returns {T} The unproxied value.
|
|
5
12
|
*/
|
|
6
|
-
export function
|
|
13
|
+
export function deProxy<T>(
|
|
14
|
+
val:
|
|
15
|
+
| T
|
|
16
|
+
| (T & {
|
|
17
|
+
$target: T;
|
|
18
|
+
}),
|
|
19
|
+
): T;
|
|
7
20
|
/**
|
|
8
21
|
* @returns {number} an unique alpha-numeric string
|
|
9
22
|
*/
|
|
@@ -23,11 +36,11 @@ export function lowercase(string: string): string;
|
|
|
23
36
|
*/
|
|
24
37
|
export function uppercase(string: string): string;
|
|
25
38
|
/**
|
|
26
|
-
* @param {
|
|
39
|
+
* @param {unknown} obj Reference to check.
|
|
27
40
|
* @return {boolean} Returns true if `obj` is an array or array-like object (NodeList, Arguments,
|
|
28
41
|
* String ...)
|
|
29
42
|
*/
|
|
30
|
-
export function isArrayLike(obj:
|
|
43
|
+
export function isArrayLike(obj: unknown): boolean;
|
|
31
44
|
/**
|
|
32
45
|
* Determines if a reference is undefined.
|
|
33
46
|
*
|
|
@@ -36,28 +49,38 @@ export function isArrayLike(obj: any): boolean;
|
|
|
36
49
|
*/
|
|
37
50
|
export function isUndefined(value: any): boolean;
|
|
38
51
|
/**
|
|
39
|
-
* Determines if a reference is defined.
|
|
52
|
+
* Determines if a reference is defined (not `undefined`).
|
|
40
53
|
*
|
|
41
|
-
* @
|
|
42
|
-
* @
|
|
54
|
+
* @template T
|
|
55
|
+
* @param {T | undefined} value - Reference to check.
|
|
56
|
+
* @returns {value is T} True if `value` is defined.
|
|
43
57
|
*/
|
|
44
|
-
export function isDefined(value:
|
|
58
|
+
export function isDefined<T>(value: T | undefined): value is T;
|
|
45
59
|
/**
|
|
46
|
-
* Wrapper for minification
|
|
47
|
-
*
|
|
48
60
|
* @template T
|
|
49
61
|
* @param {any} array
|
|
50
62
|
* @returns {array is T[]} true if array is an Array
|
|
51
63
|
*/
|
|
52
64
|
export function isArray<T>(array: any): array is T[];
|
|
65
|
+
/**
|
|
66
|
+
* @template T
|
|
67
|
+
* @param {any} val
|
|
68
|
+
* @param {new (...args: any[]) => T} type The constructor to test against
|
|
69
|
+
* @returns {val is T}
|
|
70
|
+
*/
|
|
71
|
+
export function isInstanceOf<T>(
|
|
72
|
+
val: any,
|
|
73
|
+
type: new (...args: any[]) => T,
|
|
74
|
+
): val is T;
|
|
53
75
|
/**
|
|
54
76
|
* Determines if a reference is an `Object`. Unlike `typeof` in JavaScript, `null`s are not
|
|
55
77
|
* considered to be objects. Note that JavaScript arrays are objects.
|
|
56
78
|
*
|
|
57
|
-
* @
|
|
58
|
-
* @
|
|
79
|
+
* @template T
|
|
80
|
+
* @param {T} value - Reference to check.
|
|
81
|
+
* @returns {value is T & object} True if `value` is an `Object` but not `null`.
|
|
59
82
|
*/
|
|
60
|
-
export function isObject(value:
|
|
83
|
+
export function isObject<T>(value: T): value is T & object;
|
|
61
84
|
/**
|
|
62
85
|
* Determines if a value is an object with a null prototype
|
|
63
86
|
*
|
|
@@ -65,21 +88,26 @@ export function isObject(value: any): boolean;
|
|
|
65
88
|
* @returns {boolean} True if `value` is an `Object` with a null prototype
|
|
66
89
|
*/
|
|
67
90
|
export function isBlankObject(value: any): boolean;
|
|
68
|
-
|
|
91
|
+
/**
|
|
92
|
+
* Determines if a reference is a `string`.
|
|
93
|
+
* @param {unknown} value - The value to check.
|
|
94
|
+
* @returns {value is string} True if `value` is a string.
|
|
95
|
+
*/
|
|
96
|
+
export function isString(value: unknown): value is string;
|
|
69
97
|
/**
|
|
70
98
|
* Determines if a reference is a null.
|
|
71
99
|
*
|
|
72
|
-
* @param {
|
|
73
|
-
* @returns {
|
|
100
|
+
* @param {unknown} value Reference to check.
|
|
101
|
+
* @returns {value is null} True if `value` is a null.
|
|
74
102
|
*/
|
|
75
|
-
export function isNull(value:
|
|
103
|
+
export function isNull(value: unknown): value is null;
|
|
76
104
|
/**
|
|
77
105
|
* Determines if a reference is null or undefined.
|
|
78
106
|
*
|
|
79
|
-
* @param {
|
|
80
|
-
* @returns {
|
|
107
|
+
* @param {unknown} obj Reference to check.
|
|
108
|
+
* @returns {obj is null | undefined} True if `value` is null or undefined.
|
|
81
109
|
*/
|
|
82
|
-
export function isNullOrUndefined(obj:
|
|
110
|
+
export function isNullOrUndefined(obj: unknown): obj is null | undefined;
|
|
83
111
|
/**
|
|
84
112
|
* Determines if a reference is not null or undefined.
|
|
85
113
|
*
|
|
@@ -96,10 +124,10 @@ export function notNullOrUndefined(obj: any): boolean;
|
|
|
96
124
|
* [`isFinite'](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isFinite)
|
|
97
125
|
* method.
|
|
98
126
|
*
|
|
99
|
-
* @param {
|
|
100
|
-
* @returns {
|
|
127
|
+
* @param {unknown} value Reference to check.
|
|
128
|
+
* @returns {value is number} True if `value` is a `Number`.
|
|
101
129
|
*/
|
|
102
|
-
export function isNumber(value:
|
|
130
|
+
export function isNumber(value: unknown): value is number;
|
|
103
131
|
/**
|
|
104
132
|
*
|
|
105
133
|
* Determines if a value is a date.
|
|
@@ -113,9 +141,9 @@ export function isDate(value: any): boolean;
|
|
|
113
141
|
* Loosely based on https://www.npmjs.com/package/iserror
|
|
114
142
|
*
|
|
115
143
|
* @param {*} value Reference to check.
|
|
116
|
-
* @returns {
|
|
144
|
+
* @returns {value is Error} True if `value` is an `Error`.
|
|
117
145
|
*/
|
|
118
|
-
export function isError(value: any):
|
|
146
|
+
export function isError(value: any): value is Error;
|
|
119
147
|
/**
|
|
120
148
|
* Determines if a reference is a `Function`.
|
|
121
149
|
*
|
|
@@ -133,10 +161,10 @@ export function isRegExp(value: any): boolean;
|
|
|
133
161
|
/**
|
|
134
162
|
* Checks if `obj` is a window object.
|
|
135
163
|
*
|
|
136
|
-
* @param {
|
|
137
|
-
* @returns {
|
|
164
|
+
* @param {unknown} obj Object to check
|
|
165
|
+
* @returns {obj is Window} True if `obj` is a window obj.
|
|
138
166
|
*/
|
|
139
|
-
export function isWindow(obj:
|
|
167
|
+
export function isWindow(obj: unknown): obj is Window;
|
|
140
168
|
/**
|
|
141
169
|
* @param {*} obj
|
|
142
170
|
* @returns {boolean}
|
|
@@ -182,13 +210,23 @@ export function isArrayBuffer(obj: any): boolean;
|
|
|
182
210
|
* @returns {string | *}
|
|
183
211
|
*/
|
|
184
212
|
export function trim(value: any): string | any;
|
|
185
|
-
|
|
213
|
+
/**
|
|
214
|
+
* @param {string} name
|
|
215
|
+
* @param {string} separator
|
|
216
|
+
*/
|
|
217
|
+
export function snakeCase(name: string, separator: string): string;
|
|
186
218
|
/**
|
|
187
219
|
* Set or clear the hashkey for an object.
|
|
188
|
-
* @param obj object
|
|
189
|
-
* @param hashkey the hashkey (!truthy to delete the hashkey)
|
|
220
|
+
* @param {{ [x: string]: any; _hashKey?: any; }} obj object
|
|
221
|
+
* @param {any} hashkey the hashkey (!truthy to delete the hashkey)
|
|
190
222
|
*/
|
|
191
|
-
export function setHashKey(
|
|
223
|
+
export function setHashKey(
|
|
224
|
+
obj: {
|
|
225
|
+
[x: string]: any;
|
|
226
|
+
_hashKey?: any;
|
|
227
|
+
},
|
|
228
|
+
hashkey: any,
|
|
229
|
+
): void;
|
|
192
230
|
/**
|
|
193
231
|
* Deeply extends a destination object with one or more source objects.
|
|
194
232
|
* Safely handles Dates, RegExps, DOM nodes, arrays, and nested objects.
|
|
@@ -233,17 +271,25 @@ export function isNumberNaN(num: any): boolean;
|
|
|
233
271
|
* @returns {Object}
|
|
234
272
|
*/
|
|
235
273
|
export function inherit(parent: any, extra: any): any;
|
|
236
|
-
|
|
274
|
+
/**
|
|
275
|
+
* @param {{ toString: () => string; }} obj
|
|
276
|
+
* @returns {boolean}
|
|
277
|
+
*/
|
|
278
|
+
export function hasCustomToString(obj: { toString: () => string }): boolean;
|
|
237
279
|
/**
|
|
238
280
|
* Returns a string appropriate for the type of node.
|
|
239
281
|
*
|
|
240
282
|
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
|
|
241
283
|
*
|
|
242
284
|
* @param {Element} element
|
|
243
|
-
* @returns
|
|
285
|
+
* @returns {string}
|
|
244
286
|
*/
|
|
245
287
|
export function getNodeName(element: Element): string;
|
|
246
|
-
|
|
288
|
+
/**
|
|
289
|
+
* @param {any} array
|
|
290
|
+
* @param {string} obj
|
|
291
|
+
*/
|
|
292
|
+
export function includes(array: any, obj: string): boolean;
|
|
247
293
|
/**
|
|
248
294
|
* Removes the first occurrence of a specified value from an array.
|
|
249
295
|
*
|
|
@@ -253,7 +299,11 @@ export function includes(array: any, obj: any): boolean;
|
|
|
253
299
|
* @returns {number} - The index of the removed value, or -1 if the value was not found.
|
|
254
300
|
*/
|
|
255
301
|
export function arrayRemove<T>(array: Array<T>, value: T): number;
|
|
256
|
-
|
|
302
|
+
/**
|
|
303
|
+
* @param {unknown} val1
|
|
304
|
+
* @param {unknown} val2
|
|
305
|
+
*/
|
|
306
|
+
export function simpleCompare(val1: unknown, val2: unknown): boolean;
|
|
257
307
|
/**
|
|
258
308
|
* Determines if two objects or two values are equivalent. Supports value types, regular
|
|
259
309
|
* expressions, arrays and objects.
|
|
@@ -318,14 +368,34 @@ export function equals(o1: any, o2: any): boolean;
|
|
|
318
368
|
* @param {string} context the context in which the name is used, such as module or directive
|
|
319
369
|
*/
|
|
320
370
|
export function assertNotHasOwnProperty(name: string, context: string): void;
|
|
321
|
-
|
|
371
|
+
/**
|
|
372
|
+
* @param {unknown} value
|
|
373
|
+
* @returns {string | unknown}
|
|
374
|
+
*/
|
|
375
|
+
export function stringify(value: unknown): string | unknown;
|
|
322
376
|
/**
|
|
323
377
|
* @param {Number} maxDepth
|
|
324
378
|
* @return {boolean}
|
|
325
379
|
*/
|
|
326
380
|
export function isValidObjectMaxDepth(maxDepth: number): boolean;
|
|
327
|
-
|
|
328
|
-
|
|
381
|
+
/**
|
|
382
|
+
* @param {any[]} array1
|
|
383
|
+
* @param {IArguments | any[] | NodeListOf<ChildNode>} array2
|
|
384
|
+
* @param {number | undefined} [index]
|
|
385
|
+
*/
|
|
386
|
+
export function concat(
|
|
387
|
+
array1: any[],
|
|
388
|
+
array2: IArguments | any[] | NodeListOf<ChildNode>,
|
|
389
|
+
index?: number | undefined,
|
|
390
|
+
): any[];
|
|
391
|
+
/**
|
|
392
|
+
* @param {IArguments | [string, ...any[]]} args
|
|
393
|
+
* @param {number} startIndex
|
|
394
|
+
*/
|
|
395
|
+
export function sliceArgs(
|
|
396
|
+
args: IArguments | [string, ...any[]],
|
|
397
|
+
startIndex: number,
|
|
398
|
+
): any;
|
|
329
399
|
/**
|
|
330
400
|
* Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
|
|
331
401
|
* `fn`). You can supply optional `args` that are prebound to the function. This feature is also
|
|
@@ -338,62 +408,53 @@ export function sliceArgs(args: any, startIndex: any): any;
|
|
|
338
408
|
*/
|
|
339
409
|
export function bind(context: any, fn: any, ...args: any[]): Function;
|
|
340
410
|
/**
|
|
341
|
-
* Serializes input into a JSON-formatted string. Properties with leading
|
|
342
|
-
* stripped since AngularTS uses this notation internally.
|
|
343
|
-
*
|
|
344
|
-
* @param {Object|Array
|
|
345
|
-
*
|
|
346
|
-
*
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
*
|
|
350
|
-
*
|
|
351
|
-
* object with an invalid date value. The only reliable way to prevent this is to monkeypatch the
|
|
352
|
-
* `Date.prototype.toJSON` method as follows:
|
|
353
|
-
*
|
|
354
|
-
* ```
|
|
355
|
-
* let _DatetoJSON = Date.prototype.toJSON;
|
|
356
|
-
* Date.prototype.toJSON = function() {
|
|
357
|
-
* try {
|
|
358
|
-
* return _DatetoJSON.call(this);
|
|
359
|
-
* } catch(e) {
|
|
360
|
-
* if (e instanceof RangeError) {
|
|
361
|
-
* return null;
|
|
362
|
-
* }
|
|
363
|
-
* throw e;
|
|
364
|
-
* }
|
|
365
|
-
* };
|
|
366
|
-
* ```
|
|
367
|
-
*
|
|
368
|
-
* See https://github.com/angular/angular.js/pull/14221 for more information.
|
|
411
|
+
* Serializes input into a JSON-formatted string. Properties with leading `$$` characters
|
|
412
|
+
* will be stripped since AngularTS uses this notation internally.
|
|
413
|
+
*
|
|
414
|
+
* @param {Object|Array<any>|Date|string|number|boolean} obj
|
|
415
|
+
* Input to be serialized into JSON.
|
|
416
|
+
* @param {boolean|number} [pretty=2]
|
|
417
|
+
* If `true`, the JSON output will contain newlines and whitespace (2 spaces).
|
|
418
|
+
* If a number, the JSON output will contain that many spaces per indentation.
|
|
419
|
+
* @returns {string|undefined}
|
|
420
|
+
* JSON-ified string representing `obj`, or `undefined` if `obj` is undefined.
|
|
369
421
|
*/
|
|
370
422
|
export function toJson(
|
|
371
|
-
obj: any | any
|
|
423
|
+
obj: any | Array<any> | Date | string | number | boolean,
|
|
372
424
|
pretty?: boolean | number,
|
|
373
425
|
): string | undefined;
|
|
374
426
|
/**
|
|
375
427
|
* Deserializes a JSON string.
|
|
376
428
|
*
|
|
377
429
|
* @param {string} json JSON string to deserialize.
|
|
378
|
-
* @returns {Object|Array
|
|
430
|
+
* @returns {Object|Array<any>|string|number} Deserialized JSON string.
|
|
379
431
|
*/
|
|
380
|
-
export function fromJson(json: string): any | any
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
reverse: any,
|
|
387
|
-
): Date;
|
|
432
|
+
export function fromJson(json: string): any | Array<any> | string | number;
|
|
433
|
+
/**
|
|
434
|
+
* @param {Date} date
|
|
435
|
+
* @param {number} minutes
|
|
436
|
+
*/
|
|
437
|
+
export function addDateMinutes(date: Date, minutes: number): Date;
|
|
388
438
|
/**
|
|
389
439
|
* Parses an escaped url query string into key-value pairs.
|
|
390
440
|
* @param {string} keyValue
|
|
391
|
-
* @returns {Object.<string,boolean|Array
|
|
441
|
+
* @returns {Object.<string,boolean|Array<any>>}
|
|
392
442
|
*/
|
|
393
443
|
export function parseKeyValue(keyValue: string): {
|
|
394
444
|
[x: string]: boolean | any[];
|
|
395
445
|
};
|
|
396
|
-
|
|
446
|
+
/**
|
|
447
|
+
* @param {string | { [s: string]: any; } | ArrayLike<any> | null} obj
|
|
448
|
+
*/
|
|
449
|
+
export function toKeyValue(
|
|
450
|
+
obj:
|
|
451
|
+
| string
|
|
452
|
+
| {
|
|
453
|
+
[s: string]: any;
|
|
454
|
+
}
|
|
455
|
+
| ArrayLike<any>
|
|
456
|
+
| null,
|
|
457
|
+
): string;
|
|
397
458
|
/**
|
|
398
459
|
* Tries to decode the URI component without throwing an exception.
|
|
399
460
|
*
|
|
@@ -424,15 +485,27 @@ export function encodeUriSegment(val: string): string;
|
|
|
424
485
|
* pct-encoded = "%" HEXDIG HEXDIG
|
|
425
486
|
* sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
|
|
426
487
|
* / "*" / "+" / "," / ";" / "="
|
|
488
|
+
* @param {string | number | boolean} val
|
|
489
|
+
* @param {boolean | undefined} [pctEncodeSpaces]
|
|
427
490
|
*/
|
|
428
|
-
export function encodeUriQuery(
|
|
429
|
-
|
|
491
|
+
export function encodeUriQuery(
|
|
492
|
+
val: string | number | boolean,
|
|
493
|
+
pctEncodeSpaces?: boolean | undefined,
|
|
494
|
+
): string;
|
|
430
495
|
/**
|
|
431
|
-
* Creates a shallow copy of an object, an array or
|
|
496
|
+
* Creates a shallow copy of an object, an array, or returns primitives as-is.
|
|
497
|
+
*
|
|
498
|
+
* Assumes there are no proto properties.
|
|
432
499
|
*
|
|
433
|
-
*
|
|
500
|
+
* @template T
|
|
501
|
+
* @param {T} src
|
|
502
|
+
* @param {T extends any[] ? T : Record<string, unknown>} [dst]
|
|
503
|
+
* @returns {T}
|
|
434
504
|
*/
|
|
435
|
-
export function shallowCopy(
|
|
505
|
+
export function shallowCopy<T>(
|
|
506
|
+
src: T,
|
|
507
|
+
dst?: T extends any[] ? T : Record<string, unknown>,
|
|
508
|
+
): T;
|
|
436
509
|
/**
|
|
437
510
|
* Throw error if the argument is false
|
|
438
511
|
* @param {boolean} argument
|
|
@@ -441,13 +514,25 @@ export function shallowCopy(src: any, dst: any): any;
|
|
|
441
514
|
export function assert(argument: boolean, errorMsg?: string): void;
|
|
442
515
|
/**
|
|
443
516
|
* Throw error if the argument is falsy.
|
|
517
|
+
* @param {string | boolean | Object} arg
|
|
518
|
+
* @param {string} name
|
|
519
|
+
* @param {string | undefined} [reason]
|
|
520
|
+
*/
|
|
521
|
+
export function assertArg(
|
|
522
|
+
arg: string | boolean | any,
|
|
523
|
+
name: string,
|
|
524
|
+
reason?: string | undefined,
|
|
525
|
+
): any;
|
|
526
|
+
/**
|
|
527
|
+
* @param {string | Function | any[]} arg
|
|
528
|
+
* @param {string} name
|
|
529
|
+
* @param {boolean | undefined} [acceptArrayAnnotation]
|
|
444
530
|
*/
|
|
445
|
-
export function assertArg(arg: any, name: any, reason: any): any;
|
|
446
531
|
export function assertArgFn(
|
|
447
|
-
arg: any,
|
|
448
|
-
name:
|
|
449
|
-
acceptArrayAnnotation
|
|
450
|
-
): any;
|
|
532
|
+
arg: string | Function | any[],
|
|
533
|
+
name: string,
|
|
534
|
+
acceptArrayAnnotation?: boolean | undefined,
|
|
535
|
+
): string | Function | any[];
|
|
451
536
|
/**
|
|
452
537
|
* Configure several aspects of error handling if used as a setter or return the
|
|
453
538
|
* current configuration if used as a getter.
|
|
@@ -486,14 +571,21 @@ export function errorHandlingConfig(
|
|
|
486
571
|
* @returns {function(string, ...*): Error} minErr instance
|
|
487
572
|
*/
|
|
488
573
|
export function minErr(module: string): (arg0: string, ...args: any[]) => Error;
|
|
489
|
-
|
|
574
|
+
/**
|
|
575
|
+
* Converts a value into a simplified debug-friendly string.
|
|
576
|
+
*
|
|
577
|
+
* @template T
|
|
578
|
+
* @param {T|ng.Scope} obj
|
|
579
|
+
* @returns {string}
|
|
580
|
+
*/
|
|
581
|
+
export function toDebugString<T>(obj: T | ng.Scope): string;
|
|
490
582
|
/**
|
|
491
583
|
* Computes a hash of an 'obj'.
|
|
492
584
|
* Hash of a:
|
|
493
585
|
* string is string
|
|
494
586
|
* number is number as string
|
|
495
|
-
* object is either result of calling
|
|
496
|
-
* that is also assigned to the
|
|
587
|
+
* object is either result of calling _hashKey function on the object or uniquely generated id,
|
|
588
|
+
* that is also assigned to the _hashKey property of the object.
|
|
497
589
|
*
|
|
498
590
|
* @param {*} obj
|
|
499
591
|
* @returns {string} hash string such that the same input will have the same hash string.
|
|
@@ -565,18 +657,30 @@ export function entries<T>(
|
|
|
565
657
|
* Wraps a function so it can only be called once.
|
|
566
658
|
* Subsequent calls do nothing and return undefined.
|
|
567
659
|
*
|
|
568
|
-
* @
|
|
569
|
-
* @
|
|
660
|
+
* @template {(...args: any[]) => any} F
|
|
661
|
+
* @param {F} fn - The function to wrap.
|
|
662
|
+
* @returns {(this: ThisParameterType<F>, ...args: Parameters<F>) => ReturnType<F> | undefined}
|
|
570
663
|
*/
|
|
571
|
-
export function callBackOnce(
|
|
664
|
+
export function callBackOnce<F extends (...args: any[]) => any>(
|
|
665
|
+
fn: F,
|
|
666
|
+
): (
|
|
667
|
+
this: ThisParameterType<F>,
|
|
668
|
+
...args: Parameters<F>
|
|
669
|
+
) => ReturnType<F> | undefined;
|
|
572
670
|
/**
|
|
573
671
|
* Wraps a function so it will only be called starting from the second invocation.
|
|
574
672
|
* The first call does nothing and returns undefined.
|
|
575
673
|
*
|
|
576
|
-
* @
|
|
577
|
-
* @
|
|
674
|
+
* @template {(...args: any[]) => any} F
|
|
675
|
+
* @param {F} fn - The function to wrap.
|
|
676
|
+
* @returns {(this: ThisParameterType<F>, ...args: Parameters<F>) => ReturnType<F> | undefined}
|
|
578
677
|
*/
|
|
579
|
-
export function callBackAfterFirst(
|
|
678
|
+
export function callBackAfterFirst<F extends (...args: any[]) => any>(
|
|
679
|
+
fn: F,
|
|
680
|
+
): (
|
|
681
|
+
this: ThisParameterType<F>,
|
|
682
|
+
...args: Parameters<F>
|
|
683
|
+
) => ReturnType<F> | undefined;
|
|
580
684
|
/**
|
|
581
685
|
* Delays execution for a specified number of milliseconds.
|
|
582
686
|
*
|
|
@@ -614,10 +718,12 @@ export function startsWith(str: string, search: string): boolean;
|
|
|
614
718
|
/**
|
|
615
719
|
* Loads and instantiates a WebAssembly module.
|
|
616
720
|
* Tries streaming first, then falls back.
|
|
721
|
+
* @param {string} src
|
|
722
|
+
* @param {WebAssembly.Imports} imports
|
|
617
723
|
*/
|
|
618
724
|
export function instantiateWasm(
|
|
619
|
-
src:
|
|
620
|
-
imports?:
|
|
725
|
+
src: string,
|
|
726
|
+
imports?: WebAssembly.Imports,
|
|
621
727
|
): Promise<{
|
|
622
728
|
instance: WebAssembly.Instance;
|
|
623
729
|
exports: WebAssembly.Exports;
|
|
@@ -31,6 +31,26 @@ export function validateArray(arg: any, name: string): any;
|
|
|
31
31
|
* @throws {TypeError} If the value does not satisfy the validator.
|
|
32
32
|
*/
|
|
33
33
|
export function validateIsString(arg: any, name: string): any;
|
|
34
|
+
/**
|
|
35
|
+
* @param {*} arg - The value to validate.
|
|
36
|
+
* @param {string} name - Parameter name (included in error message).
|
|
37
|
+
* @returns {number} The validated value.
|
|
38
|
+
* @throws {TypeError} If the value is not a number.
|
|
39
|
+
*/
|
|
40
|
+
export function validateIsNumber(arg: any, name: string): number;
|
|
41
|
+
/**
|
|
42
|
+
* @template T
|
|
43
|
+
* @param {unknown} arg - The value to validate.
|
|
44
|
+
* @param {new (...args: any[]) => T} type - The constructor to check against.
|
|
45
|
+
* @param {string} name - Parameter name (included in error message).
|
|
46
|
+
* @returns {T} The validated instance.
|
|
47
|
+
* @throws {TypeError} If the value is not an instance of the specified type.
|
|
48
|
+
*/
|
|
49
|
+
export function validateInstanceOf<T>(
|
|
50
|
+
arg: unknown,
|
|
51
|
+
type: new (...args: any[]) => T,
|
|
52
|
+
name: string,
|
|
53
|
+
): T;
|
|
34
54
|
export const BADARG: "badarg";
|
|
35
55
|
export const BADARGKEY: "badarg: key";
|
|
36
56
|
export const BADARGVALUE: "badarg: value";
|