@angular-wave/angular.ts 0.14.2 → 0.15.0

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 (85) hide show
  1. package/@types/angular.d.ts +28 -25
  2. package/@types/animations/animate-cache.d.ts +46 -2
  3. package/@types/animations/animate-children-directive.d.ts +4 -4
  4. package/@types/animations/animate-js.d.ts +1 -10
  5. package/@types/animations/animate.d.ts +6 -1
  6. package/@types/animations/interface.d.ts +17 -2
  7. package/@types/animations/queue/animate-queue.d.ts +0 -1
  8. package/@types/animations/raf-scheduler.d.ts +3 -3
  9. package/@types/animations/runner/animate-runner.d.ts +81 -57
  10. package/@types/animations/shared.d.ts +0 -16
  11. package/@types/core/compile/attributes.d.ts +13 -10
  12. package/@types/core/compile/compile.d.ts +2 -2
  13. package/@types/core/controller/controller.d.ts +1 -1
  14. package/@types/core/di/ng-module/ng-module.d.ts +8 -7
  15. package/@types/core/filter/filter.d.ts +1 -1
  16. package/@types/core/interpolate/interface.d.ts +1 -0
  17. package/@types/core/parse/ast/ast.d.ts +30 -39
  18. package/@types/core/parse/ast-type.d.ts +16 -16
  19. package/@types/core/parse/interface.d.ts +1 -1
  20. package/@types/core/parse/interpreter.d.ts +6 -29
  21. package/@types/core/parse/lexer/lexer.d.ts +19 -19
  22. package/@types/core/parse/parser/parser.d.ts +4 -9
  23. package/@types/core/scope/interface.d.ts +0 -6
  24. package/@types/core/scope/scope.d.ts +13 -13
  25. package/@types/directive/attrs/attrs.d.ts +2 -5
  26. package/@types/directive/class/class.d.ts +3 -3
  27. package/@types/directive/controller/controller.d.ts +2 -2
  28. package/@types/directive/form/form.d.ts +4 -4
  29. package/@types/directive/include/include.d.ts +4 -4
  30. package/@types/directive/messages/messages.d.ts +9 -8
  31. package/@types/directive/model/model.d.ts +5 -5
  32. package/@types/directive/ref/ref.d.ts +5 -8
  33. package/@types/directive/repeat/repeat.d.ts +2 -4
  34. package/@types/directive/script/script.d.ts +2 -2
  35. package/@types/directive/select/select.d.ts +7 -8
  36. package/@types/directive/validators/validators.d.ts +2 -2
  37. package/@types/injection-tokens.d.ts +3 -2
  38. package/@types/interface.d.ts +50 -22
  39. package/@types/namespace.d.ts +42 -6
  40. package/@types/router/common/trace.d.ts +5 -5
  41. package/@types/router/directives/state-directives.d.ts +26 -24
  42. package/@types/router/directives/view-directive.d.ts +27 -131
  43. package/@types/router/glob/glob.d.ts +2 -6
  44. package/@types/router/params/interface.d.ts +2 -2
  45. package/@types/router/params/param.d.ts +3 -3
  46. package/@types/router/router.d.ts +1 -1
  47. package/@types/router/scroll/interface.d.ts +3 -0
  48. package/@types/router/scroll/view-scroll.d.ts +8 -0
  49. package/@types/router/state/interface.d.ts +25 -126
  50. package/@types/router/state/state-builder.d.ts +4 -1
  51. package/@types/router/state/state-object.d.ts +2 -2
  52. package/@types/router/state/state-queue-manager.d.ts +4 -4
  53. package/@types/router/state/state-registry.d.ts +16 -11
  54. package/@types/router/state/state-service.d.ts +18 -12
  55. package/@types/router/template-factory.d.ts +2 -2
  56. package/@types/router/transition/interface.d.ts +9 -9
  57. package/@types/router/transition/reject-factory.d.ts +5 -5
  58. package/@types/router/transition/transition-hook.d.ts +22 -23
  59. package/@types/router/transition/transition-service.d.ts +12 -5
  60. package/@types/router/transition/transition.d.ts +17 -13
  61. package/@types/router/url/url-rule.d.ts +12 -9
  62. package/@types/router/url/url-service.d.ts +14 -10
  63. package/@types/router/view/view.d.ts +4 -4
  64. package/@types/services/anchor-scroll/anchor-scroll.d.ts +2 -17
  65. package/@types/services/anchor-scroll/interface.d.ts +15 -0
  66. package/@types/services/cookie/cookie.d.ts +6 -4
  67. package/@types/services/exception/interface.d.ts +3 -3
  68. package/@types/services/http/http.d.ts +8 -7
  69. package/@types/services/log/log.d.ts +7 -3
  70. package/@types/services/pubsub/pubsub.d.ts +18 -14
  71. package/@types/services/rest/rest.d.ts +12 -10
  72. package/@types/services/sce/sce.d.ts +9 -1
  73. package/@types/services/sse/sse.d.ts +1 -1
  74. package/@types/shared/node.d.ts +8 -0
  75. package/@types/shared/noderef.d.ts +11 -14
  76. package/@types/shared/strings.d.ts +18 -6
  77. package/@types/shared/utils.d.ts +111 -73
  78. package/@types/shared/validate.d.ts +49 -0
  79. package/dist/angular-ts.esm.js +2581 -2619
  80. package/dist/angular-ts.umd.js +2581 -2619
  81. package/dist/angular-ts.umd.min.js +2 -1
  82. package/dist/angular-ts.umd.min.js.gz +0 -0
  83. package/dist/angular-ts.umd.min.js.map +1 -0
  84. package/package.json +1 -1
  85. package/@types/router/view-scroll.d.ts +0 -12
@@ -4,20 +4,21 @@
4
4
  export class UrlService {
5
5
  static $inject: string[];
6
6
  /**
7
- * @param {import("../../services/location/location").LocationProvider} $locationProvider
7
+ * @param {ng.LocationProvider} $locationProvider
8
8
  * @param {import("../../router/state/state-service.js").StateProvider} stateService
9
- * @param {import("../router.js").Router} globals
9
+ * @param {import("../router.js").RouterProvider} globals
10
10
  * @param {import("../../router/url/url-config.js").UrlConfigProvider} urlConfigProvider
11
11
  */
12
12
  constructor(
13
- $locationProvider: any,
13
+ $locationProvider: ng.LocationProvider,
14
14
  stateService: import("../../router/state/state-service.js").StateProvider,
15
- globals: import("../router.js").Router,
15
+ globals: import("../router.js").RouterProvider,
16
16
  urlConfigProvider: import("../../router/url/url-config.js").UrlConfigProvider,
17
17
  );
18
- /** @type {import("../../services/location/location").Location} */
19
- $location: any;
20
- $locationProvider: any;
18
+ /** @type {ng.LocationService} */
19
+ $location: ng.LocationService;
20
+ /** @private */
21
+ private _locationProvider;
21
22
  stateService: import("../../router/state/state-service.js").StateProvider;
22
23
  /** Provides services related to the URL */
23
24
  urlRuleFactory: UrlRuleFactory;
@@ -60,7 +61,10 @@ export class UrlService {
60
61
  getHash(): string;
61
62
  $get: (
62
63
  | string
63
- | (($location: ng.LocationService, $rootScope: ng.Scope) => UrlService)
64
+ | ((
65
+ $location: ng.LocationService,
66
+ $rootScope: ng.RootScopeService,
67
+ ) => ng.UrlService)
64
68
  )[];
65
69
  /**
66
70
  * @returns {string}
@@ -118,7 +122,7 @@ export class UrlService {
118
122
  *
119
123
  * @return the url (after potentially being processed)
120
124
  */
121
- url(newUrl?: string, state?: any): any;
125
+ url(newUrl?: string, state?: any): string;
122
126
  /**
123
127
  * @private
124
128
  *
@@ -196,7 +200,7 @@ export class UrlService {
196
200
  */
197
201
  match(url: any): any;
198
202
  update(read: any): void;
199
- location: any;
203
+ location: string;
200
204
  /**
201
205
  * Internal API.
202
206
  *
@@ -4,20 +4,20 @@ export class ViewService {
4
4
  _listeners: any[];
5
5
  $get: () => this;
6
6
  /**
7
- * @param {?import('../state/state-object.js').StateObject} context
7
+ * @param {?import('../state/state-object.js').StateObject} [context]
8
8
  * @return {?import('../state/state-object.js').StateObject}
9
9
  */
10
10
  rootViewContext(
11
- context: import("../state/state-object.js").StateObject | null,
11
+ context?: import("../state/state-object.js").StateObject | null,
12
12
  ): import("../state/state-object.js").StateObject | null;
13
13
  _rootContext: any;
14
- viewConfigFactory(factory: any): void;
14
+ _viewConfigFactory(factory: any): void;
15
15
  /**
16
16
  * @param path
17
17
  * @param decl
18
18
  * @return {import("../state/views.js").ViewConfig}
19
19
  */
20
- createViewConfig(
20
+ _createViewConfig(
21
21
  path: any,
22
22
  decl: any,
23
23
  ): import("../state/views.js").ViewConfig;
@@ -1,25 +1,10 @@
1
- /**
2
- * @typedef {Object} AnchorScrollObject
3
- * @property {number|function|Element} yOffset
4
- */
5
- /**
6
- * @typedef {(string) => void} AnchorScrollFunction
7
- */
8
- /**
9
- * @typedef {AnchorScrollFunction | AnchorScrollObject} AnchorScrollService
10
- */
11
1
  export class AnchorScrollProvider {
12
2
  autoScrollingEnabled: boolean;
13
3
  $get: (
14
4
  | string
15
5
  | ((
16
- $location: import("../../services/location/location.js").Location,
6
+ $location: ng.LocationService,
17
7
  $rootScope: ng.Scope,
18
- ) => AnchorScrollFunction)
8
+ ) => import("./interface.ts").AnchorScrollFunction)
19
9
  )[];
20
10
  }
21
- export type AnchorScrollObject = {
22
- yOffset: number | Function | Element;
23
- };
24
- export type AnchorScrollFunction = (string: any) => void;
25
- export type AnchorScrollService = AnchorScrollFunction | AnchorScrollObject;
@@ -0,0 +1,15 @@
1
+ export interface AnchorScrollObject {
2
+ /**
3
+ * Vertical scroll offset.
4
+ * Can be a number, a function returning a number,
5
+ * or an Element whose offsetTop will be used.
6
+ */
7
+ yOffset?: number | (() => number) | Element;
8
+ }
9
+ export type AnchorScrollFunction = (hash?: string) => void;
10
+ /**
11
+ * AngularJS $anchorScroll service
12
+ *
13
+ * Callable as a function and also exposes properties.
14
+ */
15
+ export type AnchorScrollService = AnchorScrollFunction | AnchorScrollObject;
@@ -3,7 +3,8 @@
3
3
  * @type {ng.ServiceProvider}
4
4
  */
5
5
  export class CookieProvider {
6
- defaults: {};
6
+ /** @type {ng.CookieOptions} */
7
+ defaults: ng.CookieOptions;
7
8
  $get: (
8
9
  | string
9
10
  | (($exceptionHandler: ng.ExceptionHandlerService) => CookieService)
@@ -26,9 +27,10 @@ export class CookieService {
26
27
  defaults: ng.CookieOptions,
27
28
  $exceptionHandler: ng.ExceptionHandlerService,
28
29
  );
29
- /** @type {ng.CookieOptions} */
30
- defaults: ng.CookieOptions;
31
- $exceptionHandler: import("../exception/interface.ts").ExceptionHandler;
30
+ /** @private @type {ng.CookieOptions} */
31
+ private _defaults;
32
+ /** @private @type {ng.ExceptionHandlerService} */
33
+ private _$exceptionHandler;
32
34
  /**
33
35
  * Retrieves a raw cookie value.
34
36
  *
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * A callback type for handling errors.
3
3
  *
4
- * @param {Error} exception - The exception associated with the error.
5
- * @throws {Error}
4
+ * @param {unknown} exception - The exception associated with the error.
5
+ * @throws {unknown}
6
6
  */
7
- export type ExceptionHandler = (exception: Error) => never;
7
+ export type ExceptionHandler = (exception: unknown) => never;
@@ -171,10 +171,11 @@ export function http(
171
171
  eventHandlers?: Record<string, EventListener>,
172
172
  uploadEventHandlers?: Record<string, EventListener>,
173
173
  ): void;
174
- export const Http: Readonly<{
175
- OK: 200;
176
- MultipleChoices: 300;
177
- BadRequest: 400;
178
- NotFound: 404;
179
- ErrorMax: 599;
180
- }>;
174
+ export type Http = number;
175
+ export namespace Http {
176
+ let _OK: number;
177
+ let _MultipleChoices: number;
178
+ let _BadRequest: number;
179
+ let _NotFound: number;
180
+ let _ErrorMax: number;
181
+ }
@@ -11,13 +11,17 @@ export class LogProvider {
11
11
  * @param {import("./interface.ts").LogServiceFactory} fn
12
12
  */
13
13
  setLogger(fn: import("./interface.ts").LogServiceFactory): void;
14
- /** @private */
15
- private formatError;
14
+ /**
15
+ * @private
16
+ * @param {unknown} arg
17
+ *
18
+ */
19
+ private _formatError;
16
20
  /**
17
21
  * @private
18
22
  * @param {string} type
19
23
  */
20
- private consoleLog;
24
+ private _consoleLog;
21
25
  /**
22
26
  * @returns {ng.LogService}
23
27
  */
@@ -1,24 +1,34 @@
1
- /** @typedef {import('../../interface.ts').ServiceProvider} ServiceProvider
2
-
3
1
  /**
4
2
  * Configurable provider for an injectable event bus
5
- * @extends {ServiceProvider}
3
+ * @implements {ng.ServiceProvider}
6
4
  */
7
- export class PubSubProvider {
5
+ export class PubSubProvider implements ng.ServiceProvider {
6
+ static $inject: string[];
7
+ /**
8
+ * @param {ng.ExceptionHandlerProvider} $exceptionHandler
9
+ * @param {ng.ServiceProvider} angularProvider
10
+ */
11
+ constructor(
12
+ $exceptionHandler: ng.ExceptionHandlerProvider,
13
+ angularProvider: ng.ServiceProvider,
14
+ );
8
15
  /**
9
16
  * @type {PubSub}
10
17
  */
11
18
  eventBus: PubSub;
12
- $get: any[];
13
- $exceptionHandler: import("../exception/interface.ts").ExceptionHandler;
19
+ $get: () => PubSub;
14
20
  }
15
21
  export class PubSub {
22
+ /**
23
+ * @param {ng.ExceptionHandlerService} $exceptionHandler
24
+ */
25
+ constructor($exceptionHandler: ng.ExceptionHandlerService);
16
26
  /** @private {Object<string, Array<{fn: Function, context: any}>>} */
17
27
  private _topics;
18
28
  /** @private */
19
29
  private _disposed;
20
- /** @type {ng.ExceptionHandlerService} */
21
- $exceptionHandler: ng.ExceptionHandlerService;
30
+ /** @public @type {ng.ExceptionHandlerService} */
31
+ public $exceptionHandler: ng.ExceptionHandlerService;
22
32
  /**
23
33
  * Set instance to initial state
24
34
  */
@@ -73,9 +83,3 @@ export class PubSub {
73
83
  */
74
84
  publish(topic: string, ...args: any[]): boolean;
75
85
  }
76
- export const EventBus: PubSub;
77
- /**
78
- * /**
79
- * Configurable provider for an injectable event bus
80
- */
81
- export type ServiceProvider = import("../../interface.ts").ServiceProvider;
@@ -19,13 +19,13 @@ export class RestService<T, ID> {
19
19
  options?: any,
20
20
  );
21
21
  /** @private */
22
- private $http;
22
+ private _$http;
23
23
  /** @private */
24
- private baseUrl;
24
+ private _baseUrl;
25
25
  /** @private */
26
- private entityClass;
26
+ private _entityClass;
27
27
  /** @private */
28
- private options;
28
+ private _options;
29
29
  /**
30
30
  * Build full URL from template and parameters
31
31
  * @param {string} template
@@ -72,7 +72,7 @@ export class RestService<T, ID> {
72
72
  */
73
73
  export class RestProvider {
74
74
  /** @private @type {ng.RestDefinition<any>[]} */
75
- private definitions;
75
+ private _definitions;
76
76
  /**
77
77
  * Register a REST resource at config phase
78
78
  * @template T
@@ -97,10 +97,12 @@ export class RestProvider {
97
97
  */
98
98
  $get: (
99
99
  | string
100
- | (($http: any) => {
101
- (baseUrl: any, entityClass: any, options?: {}): RestService<any, any>;
102
- get(name: any): any;
103
- listNames(): any[];
104
- })
100
+ | ((
101
+ $http: ng.HttpService,
102
+ ) => (
103
+ baseUrl: string,
104
+ entityClass?: ng.EntityClass<T>,
105
+ options?: object,
106
+ ) => RestService<T, ID>)
105
107
  )[];
106
108
  }
@@ -1,5 +1,13 @@
1
1
  export function escapeForRegexp(str: any): any;
2
- export function adjustMatcher(matcher: any): any;
2
+ /**
3
+ * Adjusts a matcher string or RegExp into a proper RegExp.
4
+ *
5
+ * @param {string | RegExp | "self"} matcher
6
+ * @returns {RegExp | "self"}
7
+ */
8
+ export function adjustMatcher(
9
+ matcher: string | RegExp | "self",
10
+ ): RegExp | "self";
3
11
  export function SceProvider(): void;
4
12
  export class SceProvider {
5
13
  /**
@@ -18,6 +18,6 @@ export class SseProvider {
18
18
  */
19
19
  defaults: ng.SseConfig;
20
20
  $get: (string | ((log: ng.LogService) => ng.SseService))[];
21
- $log: import("../log/interface.ts").LogService;
21
+ _$log: import("../log/interface.ts").LogService;
22
22
  #private;
23
23
  }
@@ -0,0 +1,8 @@
1
+ export type NodeType = number;
2
+ export namespace NodeType {
3
+ let _ELEMENT_NODE: 1;
4
+ let _DOCUMENT_NODE: 9;
5
+ let _TEXT_NODE: 3;
6
+ let _COMMENT_NODE: 8;
7
+ let _DOCUMENT_FRAGMENT_NODE: 11;
8
+ }
@@ -9,17 +9,14 @@ export class NodeRef {
9
9
  * @throws {Error} If the argument is invalid or cannot be wrapped properly.
10
10
  */
11
11
  constructor(element: Node | Element | string | NodeList | Node[]);
12
- initial: string | Node | NodeList | Node[];
13
12
  /** @private @type {Node | ChildNode | null} */
14
13
  private _node;
15
- /** @private @type {Element | undefined} */
16
- private _element;
17
- /** @private @type {Array<Node>} a stable list on nodes */
14
+ /** @type {Element | undefined} */
15
+ _element: Element | undefined;
16
+ /** @private @type {Array<Node> | undefined} a stable list on nodes */
18
17
  private _nodes;
19
18
  /** @type {boolean} */
20
- linked: boolean;
21
- /** @type {boolean} */
22
- isList: boolean;
19
+ _isList: boolean;
23
20
  /** @param {Element} el */
24
21
  set element(el: Element);
25
22
  /** @returns {Element} */
@@ -39,24 +36,24 @@ export class NodeRef {
39
36
  /** @returns {number} */
40
37
  get size(): number;
41
38
  /** @returns {Element | Node | ChildNode} */
42
- getAny(): Element | Node | ChildNode;
39
+ _getAny(): Element | Node | ChildNode;
43
40
  /** @returns {Element | Array<Node> | Node | ChildNode} */
44
- getAll(): Element | Array<Node> | Node | ChildNode;
41
+ _getAll(): Element | Array<Node> | Node | ChildNode;
45
42
  /** @returns {Array<Element> | Array<Node>} */
46
- collection(): Array<Element> | Array<Node>;
43
+ _collection(): Array<Element> | Array<Node>;
47
44
  /**
48
45
  * @param {number} index
49
46
  * @returns {Element | Node | ChildNode}
50
47
  */
51
- getIndex(index: number): Element | Node | ChildNode;
48
+ _getIndex(index: number): Element | Node | ChildNode;
52
49
  /**
53
50
  * @param {number} index
54
51
  * @param {Element | Node | ChildNode} node
55
52
  */
56
- setIndex(index: number, node: Element | Node | ChildNode): void;
53
+ _setIndex(index: number, node: Element | Node | ChildNode): void;
57
54
  /**
58
55
  * @returns {NodeRef}
59
56
  */
60
- clone(): NodeRef;
61
- isElement(): boolean;
57
+ _clone(): NodeRef;
58
+ _isElement(): boolean;
62
59
  }
@@ -15,13 +15,25 @@ export function maxLength(max: number, str: string): string;
15
15
  * If the string is already longer than the desired length, return the string.
16
16
  * Else returns the string, with extra spaces on the end, such that it reaches `length` characters.
17
17
  *
18
- * @param length the desired length of the string to return
19
- * @param str the input string
18
+ * @param {number} length the desired length of the string to return
19
+ * @param {string} str the input string
20
+ */
21
+ export function padString(length: number, str: string): string;
22
+ /**
23
+ * @param {string} camelCase
24
+ * @returns {string}
25
+ */
26
+ export function kebobString(camelCase: string): string;
27
+ /**
28
+ * @param {Function} fn
29
+ * @returns {string}
30
+ */
31
+ export function functionToString(fn: Function): string;
32
+ /**
33
+ * @param {[]|Function} fn
34
+ * @returns {string}
20
35
  */
21
- export function padString(length: any, str: any): any;
22
- export function kebobString(camelCase: any): any;
23
- export function functionToString(fn: any): any;
24
- export function fnToString(fn: any): any;
36
+ export function fnToString(fn: [] | Function): string;
25
37
  export function stringify(value: any): any;
26
38
  /**
27
39
  * Splits on a delimiter, but returns the delimiters in the array