@angular-wave/angular.ts 0.15.0 → 0.15.2

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.
Files changed (62) hide show
  1. package/@types/angular.d.ts +4 -1
  2. package/@types/core/compile/attributes.d.ts +28 -4
  3. package/@types/core/compile/inteface.d.ts +5 -1
  4. package/@types/core/di/inteface.d.ts +11 -0
  5. package/@types/core/parse/ast/ast-node.d.ts +2 -0
  6. package/@types/core/parse/parse.d.ts +4 -1
  7. package/@types/core/scope/interface.d.ts +26 -0
  8. package/@types/core/scope/scope.d.ts +16 -24
  9. package/@types/directive/bind/bind.d.ts +5 -7
  10. package/@types/directive/form/form.d.ts +12 -9
  11. package/@types/directive/init/init.d.ts +2 -2
  12. package/@types/directive/input/input.d.ts +8 -24
  13. package/@types/directive/listener/listener.d.ts +4 -0
  14. package/@types/directive/model/interface.d.ts +18 -0
  15. package/@types/directive/model/model.d.ts +20 -18
  16. package/@types/directive/non-bindable/non-bindable.d.ts +2 -2
  17. package/@types/directive/select/select.d.ts +2 -2
  18. package/@types/directive/setter/setter.d.ts +2 -2
  19. package/@types/directive/show-hide/show-hide.d.ts +3 -4
  20. package/@types/directive/switch/switch.d.ts +4 -4
  21. package/@types/interface.d.ts +22 -1
  22. package/@types/namespace.d.ts +16 -2
  23. package/@types/router/router.d.ts +5 -3
  24. package/@types/router/scroll/interface.d.ts +1 -1
  25. package/@types/router/state/interface.d.ts +5 -0
  26. package/@types/router/state/state-builder.d.ts +10 -6
  27. package/@types/router/state/state-matcher.d.ts +11 -3
  28. package/@types/router/state/state-object.d.ts +3 -5
  29. package/@types/router/state/state-queue-manager.d.ts +14 -8
  30. package/@types/router/state/state-registry.d.ts +12 -3
  31. package/@types/router/state/state-service.d.ts +8 -2
  32. package/@types/router/transition/hook-registry.d.ts +15 -5
  33. package/@types/router/transition/transition.d.ts +4 -2
  34. package/@types/router/url/url-rules.d.ts +3 -84
  35. package/@types/router/url/url-service.d.ts +9 -8
  36. package/@types/services/cookie/cookie.d.ts +3 -11
  37. package/@types/services/http/http.d.ts +6 -31
  38. package/@types/services/http/interface.d.ts +22 -7
  39. package/@types/services/location/location.d.ts +14 -13
  40. package/@types/services/sce/interface.d.ts +25 -0
  41. package/@types/services/sse/interface.d.ts +8 -1
  42. package/@types/services/sse/sse.d.ts +10 -18
  43. package/@types/services/storage/storage.d.ts +6 -6
  44. package/@types/services/stream/interface.d.ts +1 -1
  45. package/@types/services/stream/stream.d.ts +98 -0
  46. package/@types/services/template-request/interface.d.ts +2 -9
  47. package/@types/services/template-request/template-request.d.ts +7 -40
  48. package/@types/shared/common.d.ts +2 -2
  49. package/@types/shared/dom.d.ts +21 -42
  50. package/@types/shared/hof.d.ts +27 -37
  51. package/@types/shared/noderef.d.ts +2 -2
  52. package/@types/shared/strings.d.ts +13 -4
  53. package/@types/shared/utils.d.ts +123 -76
  54. package/@types/shared/validate.d.ts +7 -0
  55. package/dist/angular-ts.esm.js +1129 -1407
  56. package/dist/angular-ts.umd.js +1129 -1407
  57. package/dist/angular-ts.umd.min.js +1 -1
  58. package/dist/angular-ts.umd.min.js.gz +0 -0
  59. package/dist/angular-ts.umd.min.js.map +1 -1
  60. package/package.json +1 -1
  61. package/@types/router/state-filters.d.ts +0 -39
  62. package/@types/shared/cache.d.ts +0 -7
@@ -68,7 +68,7 @@ export function isArray<T>(array: any): array is T[];
68
68
  * @param {new (...args: any[]) => T} type The constructor to test against
69
69
  * @returns {val is T}
70
70
  */
71
- export function isIntanceOf<T>(
71
+ export function isInstanceOf<T>(
72
72
  val: any,
73
73
  type: new (...args: any[]) => T,
74
74
  ): val is T;
@@ -90,11 +90,10 @@ export function isObject<T>(value: T): value is T & object;
90
90
  export function isBlankObject(value: any): boolean;
91
91
  /**
92
92
  * Determines if a reference is a `string`.
93
- *
94
- * @param value - The value to check.
93
+ * @param {unknown} value - The value to check.
95
94
  * @returns {value is string} True if `value` is a string.
96
95
  */
97
- export function isString(value: any): value is string;
96
+ export function isString(value: unknown): value is string;
98
97
  /**
99
98
  * Determines if a reference is a null.
100
99
  *
@@ -196,28 +195,28 @@ export function isBoolean(value: any): boolean;
196
195
  * @returns {boolean}
197
196
  */
198
197
  export function isPromiseLike(obj: any): boolean;
199
- /**
200
- * @param {*} value
201
- * @returns {boolean}
202
- */
203
- export function isTypedArray(value: any): boolean;
204
- /**
205
- * @param {*} obj
206
- * @returns {boolean}
207
- */
208
- export function isArrayBuffer(obj: any): boolean;
209
198
  /**
210
199
  * @param {*} value
211
200
  * @returns {string | *}
212
201
  */
213
202
  export function trim(value: any): string | any;
214
- export function snakeCase(name: any, separator: any): any;
203
+ /**
204
+ * @param {string} name
205
+ * @param {string} separator
206
+ */
207
+ export function snakeCase(name: string, separator: string): string;
215
208
  /**
216
209
  * Set or clear the hashkey for an object.
217
- * @param obj object
218
- * @param hashkey the hashkey (!truthy to delete the hashkey)
210
+ * @param {{ [x: string]: any; _hashKey?: any; }} obj object
211
+ * @param {any} hashkey the hashkey (!truthy to delete the hashkey)
219
212
  */
220
- export function setHashKey(obj: any, hashkey: any): void;
213
+ export function setHashKey(
214
+ obj: {
215
+ [x: string]: any;
216
+ _hashKey?: any;
217
+ },
218
+ hashkey: any,
219
+ ): void;
221
220
  /**
222
221
  * Deeply extends a destination object with one or more source objects.
223
222
  * Safely handles Dates, RegExps, DOM nodes, arrays, and nested objects.
@@ -262,17 +261,25 @@ export function isNumberNaN(num: any): boolean;
262
261
  * @returns {Object}
263
262
  */
264
263
  export function inherit(parent: any, extra: any): any;
265
- export function hasCustomToString(obj: any): boolean;
264
+ /**
265
+ * @param {{ toString: () => string; }} obj
266
+ * @returns {boolean}
267
+ */
268
+ export function hasCustomToString(obj: { toString: () => string }): boolean;
266
269
  /**
267
270
  * Returns a string appropriate for the type of node.
268
271
  *
269
272
  * [MDN Reference](https://developer.mozilla.org/docs/Web/API/Node/nodeName)
270
273
  *
271
274
  * @param {Element} element
272
- * @returns
275
+ * @returns {string}
273
276
  */
274
277
  export function getNodeName(element: Element): string;
275
- export function includes(array: any, obj: any): boolean;
278
+ /**
279
+ * @param {any} array
280
+ * @param {string} obj
281
+ */
282
+ export function includes(array: any, obj: string): boolean;
276
283
  /**
277
284
  * Removes the first occurrence of a specified value from an array.
278
285
  *
@@ -282,7 +289,11 @@ export function includes(array: any, obj: any): boolean;
282
289
  * @returns {number} - The index of the removed value, or -1 if the value was not found.
283
290
  */
284
291
  export function arrayRemove<T>(array: Array<T>, value: T): number;
285
- export function simpleCompare(val1: any, val2: any): boolean;
292
+ /**
293
+ * @param {unknown} val1
294
+ * @param {unknown} val2
295
+ */
296
+ export function simpleCompare(val1: unknown, val2: unknown): boolean;
286
297
  /**
287
298
  * Determines if two objects or two values are equivalent. Supports value types, regular
288
299
  * expressions, arrays and objects.
@@ -347,14 +358,34 @@ export function equals(o1: any, o2: any): boolean;
347
358
  * @param {string} context the context in which the name is used, such as module or directive
348
359
  */
349
360
  export function assertNotHasOwnProperty(name: string, context: string): void;
350
- export function stringify(value: any): any;
361
+ /**
362
+ * @param {unknown} value
363
+ * @returns {string | unknown}
364
+ */
365
+ export function stringify(value: unknown): string | unknown;
351
366
  /**
352
367
  * @param {Number} maxDepth
353
368
  * @return {boolean}
354
369
  */
355
370
  export function isValidObjectMaxDepth(maxDepth: number): boolean;
356
- export function concat(array1: any, array2: any, index: any): any;
357
- export function sliceArgs(args: any, startIndex: any): any;
371
+ /**
372
+ * @param {any[]} array1
373
+ * @param {IArguments | any[] | NodeListOf<ChildNode>} array2
374
+ * @param {number | undefined} [index]
375
+ */
376
+ export function concat(
377
+ array1: any[],
378
+ array2: IArguments | any[] | NodeListOf<ChildNode>,
379
+ index?: number | undefined,
380
+ ): any[];
381
+ /**
382
+ * @param {IArguments | [string, ...any[]]} args
383
+ * @param {number} startIndex
384
+ */
385
+ export function sliceArgs(
386
+ args: IArguments | [string, ...any[]],
387
+ startIndex: number,
388
+ ): any;
358
389
  /**
359
390
  * Returns a function which calls function `fn` bound to `self` (`self` becomes the `this` for
360
391
  * `fn`). You can supply optional `args` that are prebound to the function. This feature is also
@@ -367,62 +398,53 @@ export function sliceArgs(args: any, startIndex: any): any;
367
398
  */
368
399
  export function bind(context: any, fn: any, ...args: any[]): Function;
369
400
  /**
370
- * Serializes input into a JSON-formatted string. Properties with leading $$ characters will be
371
- * stripped since AngularTS uses this notation internally.
372
- *
373
- * @param {Object|Array|Date|string|number|boolean} obj Input to be serialized into JSON.
374
- * @param {boolean|number} [pretty=2] If set to true, the JSON output will contain newlines and whitespace.
375
- * If set to an integer, the JSON output will contain that many spaces per indentation.
376
- * @returns {string|undefined} JSON-ified string representing `obj`.
377
- * @knownIssue
378
- *
379
- * The Safari browser throws a `RangeError` instead of returning `null` when it tries to stringify a `Date`
380
- * object with an invalid date value. The only reliable way to prevent this is to monkeypatch the
381
- * `Date.prototype.toJSON` method as follows:
382
- *
383
- * ```
384
- * let _DatetoJSON = Date.prototype.toJSON;
385
- * Date.prototype.toJSON = function() {
386
- * try {
387
- * return _DatetoJSON.call(this);
388
- * } catch(e) {
389
- * if (e instanceof RangeError) {
390
- * return null;
391
- * }
392
- * throw e;
393
- * }
394
- * };
395
- * ```
396
- *
397
- * See https://github.com/angular/angular.js/pull/14221 for more information.
401
+ * Serializes input into a JSON-formatted string. Properties with leading `$$` characters
402
+ * will be stripped since AngularTS uses this notation internally.
403
+ *
404
+ * @param {Object|Array<any>|Date|string|number|boolean} obj
405
+ * Input to be serialized into JSON.
406
+ * @param {boolean|number} [pretty=2]
407
+ * If `true`, the JSON output will contain newlines and whitespace (2 spaces).
408
+ * If a number, the JSON output will contain that many spaces per indentation.
409
+ * @returns {string|undefined}
410
+ * JSON-ified string representing `obj`, or `undefined` if `obj` is undefined.
398
411
  */
399
412
  export function toJson(
400
- obj: any | any[] | Date | string | number | boolean,
413
+ obj: any | Array<any> | Date | string | number | boolean,
401
414
  pretty?: boolean | number,
402
415
  ): string | undefined;
403
416
  /**
404
417
  * Deserializes a JSON string.
405
418
  *
406
419
  * @param {string} json JSON string to deserialize.
407
- * @returns {Object|Array|string|number} Deserialized JSON string.
420
+ * @returns {Object|Array<any>|string|number} Deserialized JSON string.
421
+ */
422
+ export function fromJson(json: string): any | Array<any> | string | number;
423
+ /**
424
+ * @param {Date} date
425
+ * @param {number} minutes
408
426
  */
409
- export function fromJson(json: string): any | any[] | string | number;
410
- export function timezoneToOffset(timezone: any, fallback: any): any;
411
- export function addDateMinutes(date: any, minutes: any): Date;
412
- export function convertTimezoneToLocal(
413
- date: any,
414
- timezone: any,
415
- reverse: any,
416
- ): Date;
427
+ export function addDateMinutes(date: Date, minutes: number): Date;
417
428
  /**
418
429
  * Parses an escaped url query string into key-value pairs.
419
430
  * @param {string} keyValue
420
- * @returns {Object.<string,boolean|Array>}
431
+ * @returns {Object.<string,boolean|Array<any>>}
421
432
  */
422
433
  export function parseKeyValue(keyValue: string): {
423
434
  [x: string]: boolean | any[];
424
435
  };
425
- export function toKeyValue(obj: any): string;
436
+ /**
437
+ * @param {string | { [s: string]: any; } | ArrayLike<any> | null} obj
438
+ */
439
+ export function toKeyValue(
440
+ obj:
441
+ | string
442
+ | {
443
+ [s: string]: any;
444
+ }
445
+ | ArrayLike<any>
446
+ | null,
447
+ ): string;
426
448
  /**
427
449
  * Tries to decode the URI component without throwing an exception.
428
450
  *
@@ -453,14 +475,27 @@ export function encodeUriSegment(val: string): string;
453
475
  * pct-encoded = "%" HEXDIG HEXDIG
454
476
  * sub-delims = "!" / "$" / "&" / "'" / "(" / ")"
455
477
  * / "*" / "+" / "," / ";" / "="
478
+ * @param {string | number | boolean} val
479
+ * @param {boolean | undefined} [pctEncodeSpaces]
456
480
  */
457
- export function encodeUriQuery(val: any, pctEncodeSpaces: any): string;
481
+ export function encodeUriQuery(
482
+ val: string | number | boolean,
483
+ pctEncodeSpaces?: boolean | undefined,
484
+ ): string;
458
485
  /**
459
- * Creates a shallow copy of an object, an array or a primitive.
486
+ * Creates a shallow copy of an object, an array, or returns primitives as-is.
487
+ *
488
+ * Assumes there are no proto properties.
460
489
  *
461
- * Assumes that there are no proto properties for objects.
490
+ * @template T
491
+ * @param {T} src
492
+ * @param {T extends any[] ? T : Record<string, unknown>} [dst]
493
+ * @returns {T}
462
494
  */
463
- export function shallowCopy(src: any, dst: any): any;
495
+ export function shallowCopy<T>(
496
+ src: T,
497
+ dst?: T extends any[] ? T : Record<string, unknown>,
498
+ ): T;
464
499
  /**
465
500
  * Throw error if the argument is false
466
501
  * @param {boolean} argument
@@ -469,13 +504,25 @@ export function shallowCopy(src: any, dst: any): any;
469
504
  export function assert(argument: boolean, errorMsg?: string): void;
470
505
  /**
471
506
  * Throw error if the argument is falsy.
507
+ * @param {string | boolean | Object} arg
508
+ * @param {string} name
509
+ * @param {string | undefined} [reason]
510
+ */
511
+ export function assertArg(
512
+ arg: string | boolean | any,
513
+ name: string,
514
+ reason?: string | undefined,
515
+ ): any;
516
+ /**
517
+ * @param {string | Function | any[]} arg
518
+ * @param {string} name
519
+ * @param {boolean | undefined} [acceptArrayAnnotation]
472
520
  */
473
- export function assertArg(arg: any, name: any, reason: any): any;
474
521
  export function assertArgFn(
475
- arg: any,
476
- name: any,
477
- acceptArrayAnnotation: any,
478
- ): any;
522
+ arg: string | Function | any[],
523
+ name: string,
524
+ acceptArrayAnnotation?: boolean | undefined,
525
+ ): string | Function | any[];
479
526
  /**
480
527
  * Configure several aspects of error handling if used as a setter or return the
481
528
  * current configuration if used as a getter.
@@ -527,8 +574,8 @@ export function toDebugString<T>(obj: T | ng.Scope): string;
527
574
  * Hash of a:
528
575
  * string is string
529
576
  * number is number as string
530
- * object is either result of calling $$hashKey function on the object or uniquely generated id,
531
- * that is also assigned to the $$hashKey property of the object.
577
+ * object is either result of calling _hashKey function on the object or uniquely generated id,
578
+ * that is also assigned to the _hashKey property of the object.
532
579
  *
533
580
  * @param {*} obj
534
581
  * @returns {string} hash string such that the same input will have the same hash string.
@@ -31,6 +31,13 @@ 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;
34
41
  /**
35
42
  * @template T
36
43
  * @param {unknown} arg - The value to validate.