@angular-wave/angular.ts 0.17.0 → 0.19.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 (113) hide show
  1. package/@types/angular.d.ts +18 -6
  2. package/@types/animations/animate-css-driver.d.ts +2 -2
  3. package/@types/animations/animate-js-driver.d.ts +21 -3
  4. package/@types/animations/animate-js.d.ts +10 -2
  5. package/@types/animations/animate-swap.d.ts +4 -1
  6. package/@types/animations/animate.d.ts +11 -5
  7. package/@types/animations/animation.d.ts +8 -2
  8. package/@types/animations/css/animate-css.d.ts +16 -0
  9. package/@types/animations/interface.d.ts +315 -21
  10. package/@types/animations/queue/animate-queue.d.ts +17 -8
  11. package/@types/animations/queue/interface.d.ts +14 -7
  12. package/@types/animations/shared.d.ts +1 -1
  13. package/@types/core/compile/attributes.d.ts +5 -5
  14. package/@types/core/compile/compile.d.ts +28 -18
  15. package/@types/core/compile/interface.d.ts +209 -34
  16. package/@types/core/controller/controller.d.ts +30 -38
  17. package/@types/core/controller/interface.d.ts +12 -3
  18. package/@types/core/interpolate/interpolate.d.ts +1 -1
  19. package/@types/core/parse/interface.d.ts +2 -2
  20. package/@types/core/parse/interpreter.d.ts +110 -58
  21. package/@types/core/scope/interface.d.ts +6 -0
  22. package/@types/core/scope/scope.d.ts +2 -1
  23. package/@types/directive/aria/aria.d.ts +67 -27
  24. package/@types/directive/aria/interface.d.ts +9 -0
  25. package/@types/directive/class/class.d.ts +31 -0
  26. package/@types/directive/form/form.d.ts +54 -18
  27. package/@types/directive/input/input.d.ts +59 -18
  28. package/@types/directive/input/interface.d.ts +10 -0
  29. package/@types/directive/messages/messages.d.ts +73 -22
  30. package/@types/directive/model/interface.d.ts +19 -0
  31. package/@types/directive/model/model.d.ts +70 -33
  32. package/@types/directive/model-options/model-options.d.ts +1 -23
  33. package/@types/directive/repeat/repeat.d.ts +2 -3
  34. package/@types/directive/validators/validators.d.ts +1 -5
  35. package/@types/directive/worker/interface.d.ts +9 -0
  36. package/@types/docs.d.ts +24 -0
  37. package/@types/filters/json.d.ts +4 -0
  38. package/@types/interface.d.ts +22 -70
  39. package/@types/namespace.d.ts +73 -53
  40. package/@types/router/common/trace.d.ts +150 -42
  41. package/@types/router/directives/state-directives.d.ts +4 -4
  42. package/@types/router/directives/view-directive.d.ts +4 -7
  43. package/@types/router/hooks/core-resolvables.d.ts +11 -2
  44. package/@types/router/hooks/ignored-transition.d.ts +3 -1
  45. package/@types/router/hooks/invalid-transition.d.ts +3 -1
  46. package/@types/router/hooks/lazy-load.d.ts +17 -13
  47. package/@types/router/hooks/on-enter-exit-retain.d.ts +9 -3
  48. package/@types/router/hooks/redirect-to.d.ts +3 -3
  49. package/@types/router/hooks/resolve.d.ts +11 -3
  50. package/@types/router/hooks/views.d.ts +6 -4
  51. package/@types/router/params/interface.d.ts +3 -2
  52. package/@types/router/params/param-factory.d.ts +24 -3
  53. package/@types/router/params/param-type.d.ts +47 -11
  54. package/@types/router/params/param-types.d.ts +52 -0
  55. package/@types/router/params/param.d.ts +52 -28
  56. package/@types/router/params/state-params.d.ts +5 -3
  57. package/@types/router/path/interface.d.ts +3 -0
  58. package/@types/router/path/path-node.d.ts +34 -14
  59. package/@types/router/path/path-utils.d.ts +75 -25
  60. package/@types/router/resolve/resolvable.d.ts +34 -7
  61. package/@types/router/resolve/resolve-context.d.ts +52 -34
  62. package/@types/router/router.d.ts +10 -12
  63. package/@types/router/state/interface.d.ts +194 -31
  64. package/@types/router/state/state-builder.d.ts +29 -29
  65. package/@types/router/state/state-matcher.d.ts +29 -11
  66. package/@types/router/state/state-object.d.ts +68 -22
  67. package/@types/router/state/state-queue-manager.d.ts +19 -10
  68. package/@types/router/state/state-registry.d.ts +80 -28
  69. package/@types/router/state/state-service.d.ts +182 -123
  70. package/@types/router/state/target-state.d.ts +36 -27
  71. package/@types/router/state/views.d.ts +48 -19
  72. package/@types/router/template-factory.d.ts +8 -15
  73. package/@types/router/transition/hook-builder.d.ts +17 -6
  74. package/@types/router/transition/hook-registry.d.ts +80 -46
  75. package/@types/router/transition/interface.d.ts +138 -118
  76. package/@types/router/transition/reject-factory.d.ts +58 -22
  77. package/@types/router/transition/transition-event-type.d.ts +19 -8
  78. package/@types/router/transition/transition-hook.d.ts +50 -29
  79. package/@types/router/transition/transition-service.d.ts +186 -30
  80. package/@types/router/transition/transition.d.ts +201 -70
  81. package/@types/router/url/interface.d.ts +140 -0
  82. package/@types/router/url/url-config.d.ts +19 -16
  83. package/@types/router/url/url-matcher.d.ts +66 -46
  84. package/@types/router/url/url-rule.d.ts +58 -35
  85. package/@types/router/url/url-rules.d.ts +38 -28
  86. package/@types/router/url/url-service.d.ts +68 -41
  87. package/@types/router/view/interface.d.ts +10 -30
  88. package/@types/router/view/view.d.ts +35 -21
  89. package/@types/services/anchor-scroll/anchor-scroll.d.ts +1 -1
  90. package/@types/services/anchor-scroll/interface.d.ts +5 -8
  91. package/@types/services/http/http.d.ts +20 -23
  92. package/@types/services/http/interface.d.ts +11 -23
  93. package/@types/services/location/interface.d.ts +1 -4
  94. package/@types/services/location/location.d.ts +14 -14
  95. package/@types/services/sce/interface.d.ts +2 -2
  96. package/@types/services/sce/sce.d.ts +16 -10
  97. package/@types/services/template-request/template-request.d.ts +21 -4
  98. package/@types/shared/common.d.ts +5 -32
  99. package/@types/shared/dom.d.ts +10 -5
  100. package/@types/shared/interface.d.ts +4 -0
  101. package/@types/shared/utils.d.ts +17 -6
  102. package/dist/angular-ts.esm.js +6643 -3107
  103. package/dist/angular-ts.umd.js +6643 -3107
  104. package/dist/angular-ts.umd.min.js +1 -1
  105. package/dist/angular-ts.umd.min.js.gz +0 -0
  106. package/dist/angular-ts.umd.min.js.map +1 -1
  107. package/package.json +1 -2
  108. package/@types/animations/animate-css.d.ts +0 -11
  109. package/@types/filters/filters.d.ts +0 -38
  110. package/@types/router/hooks/update-globals.d.ts +0 -1
  111. package/@types/router/hooks/url.d.ts +0 -5
  112. package/@types/router/scroll/interface.d.ts +0 -3
  113. package/@types/router/scroll/view-scroll.d.ts +0 -8
@@ -86,9 +86,20 @@ export class Angular extends EventTarget {
86
86
  configFn?: ng.Injectable<any>,
87
87
  ): NgModule;
88
88
  /**
89
- * @param {CustomEvent} event
89
+ * @param {CustomEvent<string | ng.InvocationDetail>} event
90
90
  */
91
- dispatchEvent(event: CustomEvent): boolean;
91
+ dispatchEvent(event: CustomEvent<string | ng.InvocationDetail>): boolean;
92
+ /**
93
+ * Fire-and-forget. Accepts a single string: "<target>.<expression>"
94
+ * @param {string} input
95
+ */
96
+ emit(input: string): void;
97
+ /**
98
+ * Await result. Accepts a single string: "<target>.<expression>"
99
+ * @param {string} input
100
+ * @returns {Promise<any>}
101
+ */
102
+ call(input: string): Promise<any>;
92
103
  /**
93
104
  * Use this function to manually start up AngularTS application.
94
105
  *
@@ -124,7 +135,7 @@ export class Angular extends EventTarget {
124
135
  * </html>
125
136
  * ```
126
137
  *
127
- * @param {string | Element | Document} element DOM element which is the root of AngularTS application.
138
+ * @param {string | HTMLElement | HTMLDocument} element DOM element which is the root of AngularTS application.
128
139
  * @param {Array<String|any>} [modules] an array of modules to load into the application.
129
140
  * Each item in the array should be the name of a predefined module or a (DI annotated)
130
141
  * function that will be invoked by the injector as a `config` block.
@@ -133,7 +144,7 @@ export class Angular extends EventTarget {
133
144
  * @returns {ng.InjectorService} The created injector instance for this application.
134
145
  */
135
146
  bootstrap(
136
- element: string | Element | Document,
147
+ element: string | HTMLElement | HTMLDocument,
137
148
  modules?: Array<string | any>,
138
149
  config?: import("./interface.ts").AngularBootstrapConfig,
139
150
  ): ng.InjectorService;
@@ -145,9 +156,9 @@ export class Angular extends EventTarget {
145
156
  */
146
157
  injector(modules: any[], strictDi?: boolean): ng.InjectorService;
147
158
  /**
148
- * @param {Element|Document} element
159
+ * @param {HTMLElement|HTMLDocument} element
149
160
  */
150
- init(element: Element | Document): void;
161
+ init(element: HTMLElement | HTMLDocument): void;
151
162
  /**
152
163
  * Retrieves a scope by its registered name and returns its Proxy wrapper.
153
164
  *
@@ -160,6 +171,7 @@ export class Angular extends EventTarget {
160
171
  * @returns {Proxy<ng.Scope>|undefined}
161
172
  */
162
173
  getScopeByName(name: string): ProxyConstructor | undefined;
174
+ #private;
163
175
  }
164
176
  export type ModuleRegistry = {
165
177
  [x: string]: NgModule;
@@ -16,8 +16,8 @@ export class AnimateCssDriverProvider {
16
16
  | string
17
17
  | ((
18
18
  $animateCss: any,
19
- $rootElement: Element,
20
- ) => (animationDetails: any) => any)
19
+ $rootElement: HTMLElement,
20
+ ) => (animationDetails: import("./interface.ts").AnimationDetails) => any)
21
21
  )[];
22
22
  }
23
23
  export namespace AnimateCssDriverProvider {
@@ -1,8 +1,26 @@
1
- export function AnimateJsDriverProvider($$animationProvider: any): void;
1
+ /**
2
+ * @param {import("./animation.js").AnimationProvider} $$animationProvider
3
+ */
4
+ export function AnimateJsDriverProvider(
5
+ $$animationProvider: import("./animation.js").AnimationProvider,
6
+ ): void;
2
7
  export class AnimateJsDriverProvider {
3
- constructor($$animationProvider: any);
4
- $get: (string | (($$animateJs: any) => (animationDetails: any) => any))[];
8
+ /**
9
+ * @param {import("./animation.js").AnimationProvider} $$animationProvider
10
+ */
11
+ constructor($$animationProvider: import("./animation.js").AnimationProvider);
12
+ $get: (
13
+ | string
14
+ | (($$animateJs: import("./interface.ts").AnimateJsFn) => (
15
+ animationDetails: import("./interface.ts").AnimationDetails,
16
+ ) =>
17
+ | import("./interface.ts").Animator
18
+ | {
19
+ start(): AnimateRunner;
20
+ })
21
+ )[];
5
22
  }
6
23
  export namespace AnimateJsDriverProvider {
7
24
  let $inject: string[];
8
25
  }
26
+ import { AnimateRunner } from "./runner/animate-runner.js";
@@ -1,6 +1,14 @@
1
- export function AnimateJsProvider($animateProvider: any): void;
1
+ /**
2
+ * @param {import("./animate.js").AnimateProvider} $animateProvider
3
+ */
4
+ export function AnimateJsProvider(
5
+ $animateProvider: import("./animate.js").AnimateProvider,
6
+ ): void;
2
7
  export class AnimateJsProvider {
3
- constructor($animateProvider: any);
8
+ /**
9
+ * @param {import("./animate.js").AnimateProvider} $animateProvider
10
+ */
11
+ constructor($animateProvider: import("./animate.js").AnimateProvider);
4
12
  $get: (
5
13
  | string
6
14
  | (($injector: ng.InjectorService) => import("./interface.ts").AnimateJsFn)
@@ -1,7 +1,10 @@
1
1
  /**
2
+ * @param {ng.AnimateService} $animate
2
3
  * @returns {ng.Directive}
3
4
  */
4
- export function ngAnimateSwapDirective($animate: any): ng.Directive;
5
+ export function ngAnimateSwapDirective(
6
+ $animate: ng.AnimateService,
7
+ ): ng.Directive;
5
8
  export namespace ngAnimateSwapDirective {
6
9
  let $inject: string[];
7
10
  }
@@ -3,7 +3,7 @@ export function AnimateProvider($provide: ng.ProvideService): void;
3
3
  export class AnimateProvider {
4
4
  /** @param {ng.ProvideService} $provide */
5
5
  constructor($provide: ng.ProvideService);
6
- $$registeredAnimations: any;
6
+ _registeredAnimations: Record<string, any>;
7
7
  /**
8
8
  * Registers a new injectable animation factory function. The factory function produces the
9
9
  * animation object which contains callback functions for each event that is expected to be
@@ -74,9 +74,12 @@ export class AnimateProvider {
74
74
  * - **event** `{String}` - The name of the animation event (e.g. `enter`, `leave`, `addClass`
75
75
  * etc).
76
76
  * - **options** `{Object}` - A collection of options/styles used for the animation.
77
- * @return {Function} The current filter function or `null` if there is none set.
77
+ * @return {Function | null} The current filter function or `null` if there is none set.
78
78
  */
79
- customFilter: (filterFn?: Function | undefined, ...args: any[]) => Function;
79
+ customFilter: (
80
+ filterFn?: Function | undefined,
81
+ ...args: any[]
82
+ ) => Function | null;
80
83
  /**
81
84
  * Sets and/or returns the CSS class regular expression that is checked when performing
82
85
  * an animation. Upon bootstrap the classNameFilter value is not set at all and will
@@ -90,9 +93,12 @@ export class AnimateProvider {
90
93
  * false, `classNameFilter` will not be checked.
91
94
  *
92
95
  * @param {RegExp=} expression The className expression which will be checked against all animations
93
- * @return {RegExp} The current CSS className expression value. If null then there is no expression value
96
+ * @return {RegExp | null} The current CSS className expression value. If null then there is no expression value
94
97
  */
95
- classNameFilter: (expression?: RegExp | undefined, ...args: any[]) => RegExp;
98
+ classNameFilter: (
99
+ expression?: RegExp | undefined,
100
+ ...args: any[]
101
+ ) => RegExp | null;
96
102
  $get: (
97
103
  | string
98
104
  | ((
@@ -6,7 +6,13 @@ export class AnimationProvider {
6
6
  | ((
7
7
  $rootScope: ng.RootScopeService,
8
8
  $injector: ng.InjectorService,
9
- ) => (elementParam: any, event: any, options: any) => AnimateRunner)
9
+ ) => import("./interface.ts").AnimationService)
10
10
  )[];
11
11
  }
12
- import { AnimateRunner } from "./runner/animate-runner.js";
12
+ export type SortedAnimationEntry =
13
+ import("./interface.ts").SortedAnimationEntry;
14
+ export type AnimationOptions = import("./interface.ts").AnimationOptions;
15
+ export type AnimationDetails = import("./interface.ts").AnimationDetails;
16
+ export type AnimationEntry = import("./interface.ts").AnimationEntry;
17
+ export type AnchorRef = import("./interface.ts").AnchorRef;
18
+ export type AnchorRefEntry = import("./interface.ts").AnchorRefEntry;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Parse a CSS time value (or comma-separated list of values) and return the maximum duration.
3
+ *
4
+ * Accepts values expressed in seconds (`s`) or milliseconds (`ms`) as returned by `getComputedStyle()`,
5
+ * e.g. `"0.2s"`, `"150ms"`, or `"0.2s, 150ms"`. Milliseconds are converted to seconds before comparison.
6
+ *
7
+ * Invalid tokens are ignored. If no valid numeric token is found, the result is `0`.
8
+ *
9
+ * @param {string} str A CSS time string (optionally comma-separated).
10
+ * @returns {number} The maximum time value, expressed in **seconds**.
11
+ */
12
+ export function parseMaxTime(str: string): number;
13
+ export function AnimateCssProvider(): void;
14
+ export class AnimateCssProvider {
15
+ $get: (() => ng.AnimateCssService)[];
16
+ }
@@ -1,73 +1,172 @@
1
1
  import { AnimateRunner } from "./runner/animate-runner.js";
2
2
  import { QueuePhase } from "./queue/interface.ts";
3
+ /**
4
+ * Low-level animation executor used by the animation queue.
5
+ *
6
+ * This is the “engine” entry point: given a concrete element, an event name,
7
+ * and normalized options, it starts an animation and returns an {@link AnimateRunner}
8
+ * that represents the running work.
9
+ *
10
+ * Notes:
11
+ * - `event` is intentionally `string` to support custom/internal events beyond the
12
+ * built-in set (e.g. driver-specific events).
13
+ * - Callers typically pass normalized {@link AnimationOptions}.
14
+ */
15
+ export type AnimationService = (
16
+ element: HTMLElement,
17
+ event: string,
18
+ options?: AnimationOptions,
19
+ ) => AnimateRunner;
20
+ /**
21
+ * Optional host controls that may be provided by a concrete animation runner implementation.
22
+ *
23
+ * A runner host represents the underlying “real” animation (CSS/JS/driver-based) and
24
+ * exposes lifecycle controls. The queue/runner wrapper can forward calls to this host.
25
+ */
3
26
  export interface AnimationHost {
4
27
  /** Pause animation. */
5
28
  pause?: () => void;
6
29
  /** Resume animation. */
7
30
  resume?: () => void;
8
- /** End animation. */
31
+ /** End animation (finish immediately). */
9
32
  end?: () => void;
10
- /** Cancel animation. */
33
+ /** Cancel animation (abort and rollback if applicable). */
11
34
  cancel?: () => void;
12
- /** Report animation progress. */
35
+ /** Report animation progress; signature is driver-dependent. */
13
36
  progress?: (...args: any[]) => void;
14
37
  }
38
+ /**
39
+ * Public-facing animation orchestration API.
40
+ *
41
+ * This is the service used by higher-level code to:
42
+ * - register lifecycle callbacks (`on`/`off`)
43
+ * - issue animations (`enter`, `leave`, `addClass`, `animate`, …)
44
+ * - control global/element-level enabling
45
+ * - cancel running work
46
+ *
47
+ * The service returns {@link AnimateRunner} instances for all animation requests.
48
+ */
15
49
  export interface AnimateService {
50
+ /**
51
+ * Register an animation callback for a given event name on a container.
52
+ *
53
+ * Callbacks fire for matching descendant elements during queue execution phases.
54
+ */
16
55
  on(
17
56
  event: string,
18
57
  container: Element,
19
- callback: (
58
+ callback?: (
20
59
  element: Element,
21
60
  phase: QueuePhase,
22
- data: {
23
- addClass?: string | null;
24
- removeClass?: string | null;
25
- from?: Record<string, any> | null;
26
- to?: Record<string, any> | null;
27
- },
61
+ data: AnimationEventData,
28
62
  ) => void,
29
63
  ): void;
64
+ /**
65
+ * Remove a previously registered callback.
66
+ *
67
+ * If only `event` is provided, removes all callbacks for that event.
68
+ * If `container` and/or `callback` are provided, filters removals accordingly.
69
+ */
30
70
  off(event: string, container?: Element, callback?: Function): void;
71
+ /**
72
+ * Pin an element to a host parent for animation ancestry checks.
73
+ *
74
+ * This is used when the DOM parent relationship is not the effective “animation host”
75
+ * relationship (e.g. transclusion/moves).
76
+ */
31
77
  pin(element: Element, parentElement: Element): void;
78
+ /**
79
+ * Enable/disable animations globally or for a specific element.
80
+ *
81
+ * - Called with no args: returns global enabled state.
82
+ * - Called with element: returns enabled state for that element.
83
+ * - Called with element + boolean: sets enabled state for that element.
84
+ */
32
85
  enabled(element?: Element, enabled?: boolean): boolean;
86
+ /**
87
+ * Cancel a running animation by runner.
88
+ */
33
89
  cancel(runner: AnimateRunner): void;
90
+ /**
91
+ * Structural animation: insert `element` into the DOM.
92
+ */
34
93
  enter(
35
94
  element: Element,
36
- parent: Element,
95
+ parent?: Element | null,
37
96
  after?: Element,
38
97
  options?: AnimationOptions,
39
98
  ): AnimateRunner;
99
+ /**
100
+ * Structural animation: move `element` within the DOM.
101
+ */
40
102
  move(
41
103
  element: Element,
42
- parent: Element,
104
+ parent: Element | null,
43
105
  after?: Element,
44
106
  options?: AnimationOptions,
45
107
  ): AnimateRunner;
108
+ /**
109
+ * Structural animation: remove `element` from the DOM.
110
+ */
46
111
  leave(element: Element, options?: AnimationOptions): AnimateRunner;
112
+ /**
113
+ * Class-based animation: add classes to `element`.
114
+ */
47
115
  addClass(
48
116
  element: Element,
49
117
  className: string,
50
118
  options?: AnimationOptions,
51
119
  ): AnimateRunner;
120
+ /**
121
+ * Class-based animation: remove classes from `element`.
122
+ */
52
123
  removeClass(
53
124
  element: Element,
54
125
  className: string,
55
126
  options?: AnimationOptions,
56
127
  ): AnimateRunner;
128
+ /**
129
+ * Class-based animation: add and remove classes as a single atomic operation.
130
+ */
57
131
  setClass(
58
132
  element: Element,
59
133
  add: string,
60
134
  remove: string,
61
135
  options?: AnimationOptions,
62
136
  ): AnimateRunner;
137
+ /**
138
+ * Inline-style animation: animate from `from` styles to `to` styles.
139
+ *
140
+ * `className` may be applied during the animation to help CSS-based drivers.
141
+ */
63
142
  animate(
64
143
  element: Element,
65
- from: Record<string, any>,
66
- to: Record<string, any>,
144
+ from: Record<string, string | number>,
145
+ to: Record<string, string | number>,
67
146
  className?: string,
68
147
  options?: AnimationOptions,
69
148
  ): AnimateRunner;
70
149
  }
150
+ /**
151
+ * Data payload delivered to animation event callbacks (`AnimateService.on`).
152
+ *
153
+ * This is intentionally a small subset of animation information: it tells listeners
154
+ * which classes are being added/removed and which style maps are being applied.
155
+ *
156
+ * Values may be `null` when not applicable.
157
+ */
158
+ export interface AnimationEventData {
159
+ addClass?: string | null;
160
+ removeClass?: string | null;
161
+ from?: Record<string, any> | null;
162
+ to?: Record<string, any> | null;
163
+ }
164
+ /**
165
+ * Built-in animation method names used by the queue and drivers.
166
+ *
167
+ * These correspond to the public API methods on {@link AnimateService} that are
168
+ * class-based or structural.
169
+ */
71
170
  export type AnimationMethod =
72
171
  | "enter"
73
172
  | "leave"
@@ -75,43 +174,238 @@ export type AnimationMethod =
75
174
  | "addClass"
76
175
  | "setClass"
77
176
  | "removeClass";
177
+ /**
178
+ * Normalized animation options and (in some cases) internal queue state.
179
+ *
180
+ * This type is used widely in the animation subsystem:
181
+ * - As the normalized options object passed down to drivers.
182
+ * - As the mutable “details/state” object stored on active animations (queue internals).
183
+ *
184
+ * Note: This interface currently includes both user-facing options (e.g. `duration`,
185
+ * `easing`, `addClass`) and internal fields (e.g. `state`, `counter`, `runner`).
186
+ * If stronger separation is desired, consider splitting into `AnimationOptions`
187
+ * (public config) + `AnimationState` (internal runtime fields).
188
+ */
78
189
  export interface AnimationOptions {
190
+ /** Target element for the animation (internal convenience). */
191
+ element?: HTMLElement;
192
+ /** Space-separated or list of CSS classes involved in the animation. */
193
+ classes?: string | string[];
194
+ /** Space-separated CSS classes to add to element. */
79
195
  addClass?: string;
196
+ /** CSS properties & values at the beginning of animation. */
80
197
  from?: Record<string, string | number>;
81
- removeClass?: string;
198
+ /** CSS properties & values at end of animation. */
82
199
  to?: Record<string, string | number>;
83
- tempClasses: string | string[];
84
- /** Optional DOM operation callback executed before animation */
200
+ /** Space-separated CSS classes to remove from element. */
201
+ removeClass?: string;
202
+ /** CSS classes applied temporarily during animation. */
203
+ tempClasses?: string | string[];
204
+ /** Optional DOM operation callback executed before animation. */
85
205
  domOperation?: () => void;
206
+ /** Optional completion callback (driver/queue dependent). */
86
207
  onDone?: () => void;
208
+ /** Internal flag: whether domOperation has fired. */
87
209
  _domOperationFired?: boolean;
88
- $$prepared?: boolean;
89
- $$skipPreparationClasses?: boolean;
210
+ /** Internal flag: whether preparation has been performed. */
211
+ _prepared?: boolean;
212
+ /** Internal flag: skip preparation classes. */
213
+ _skipPreparationClasses?: boolean;
214
+ /** Whether to clean up styles after animation completes. */
90
215
  cleanupStyles?: boolean;
216
+ /** Generated preparation classes applied before animation start. */
91
217
  preparationClasses?: string;
218
+ /** Generated active classes applied while animation runs. */
92
219
  activeClasses?: string;
220
+ /** Duration override (seconds/ms string or number depending on implementation). */
93
221
  duration?: number | string;
222
+ /** Event name(s) for multi-event animations (internal). */
94
223
  event?: string | string[];
224
+ /** Easing override for the animation. */
95
225
  easing?: string;
226
+ /** Delay override (string as parsed from computed styles is common). */
96
227
  delay?: string;
228
+ /** Whether this is a structural animation (enter/leave/move). */
97
229
  structural?: boolean;
230
+ /** Driver-specific transition style key. */
98
231
  transitionStyle?: string;
232
+ /** Stagger index for staggered sequences (internal). */
99
233
  staggerIndex?: number;
234
+ /** Whether to skip blocking behavior (internal/driver). */
100
235
  skipBlocking?: boolean;
236
+ /** Stagger duration or configuration. */
101
237
  stagger?: number | string;
238
+ /** Driver-specific keyframe style key. */
102
239
  keyframeStyle?: string;
240
+ /** Whether to apply classes before measuring styles (driver/queue). */
103
241
  applyClassesEarly?: boolean;
242
+ /** Internal: queue state marker (e.g. PRE_DIGEST/RUNNING). */
243
+ state?: number;
244
+ /** Internal: monotonically increasing counter for queued/cancelled animations. */
245
+ counter?: number;
246
+ /** Internal: close handler for queued animations. */
247
+ close?: (reject?: boolean | undefined) => void;
248
+ /** Internal: nested options/details reference used during merges. */
249
+ options?: AnimationOptions;
250
+ /** Internal: runner associated with this animation. */
251
+ runner?: AnimateRunner;
252
+ /** Internal: hook invoked before driver start to apply classes/styles. */
253
+ beforeStart?: () => void;
104
254
  }
255
+ /**
256
+ * Concrete animation description passed into drivers.
257
+ *
258
+ * `AnimationDetails` is a normalized execution plan:
259
+ * - includes the target element
260
+ * - the resolved event name
261
+ * - whether it is structural
262
+ * - normalized options
263
+ * - optional anchor pairs for shared-element transitions
264
+ */
265
+ export interface AnimationDetails {
266
+ /** Nested details describing the "from" side (used for anchor/shared transitions). */
267
+ from?: AnimationDetails;
268
+ /** Nested details describing the "to" side (used for anchor/shared transitions). */
269
+ to?: AnimationDetails;
270
+ /** Anchor element pairs for shared element transitions. */
271
+ anchors?: Array<{
272
+ out: HTMLElement;
273
+ in: HTMLElement;
274
+ }>;
275
+ /** Target element for the animation. */
276
+ element: HTMLElement;
277
+ /** Animation method / event name. */
278
+ event: AnimationMethod | string;
279
+ /** Space-delimited CSS classes involved in the animation. */
280
+ classes?: string | null;
281
+ /** Whether the animation is structural (enter / leave / move). */
282
+ structural: boolean;
283
+ /** Normalized animation options. */
284
+ options: AnimationOptions;
285
+ }
286
+ /**
287
+ * Driver return type for JS-based animations.
288
+ *
289
+ * Some JS drivers expose a "runner-like" object with explicit `start()` and
290
+ * `end()` methods that return an {@link AnimateRunner}.
291
+ */
105
292
  export interface AnimateJsRunner {
106
- $$willAnimate: true;
293
+ _willAnimate: true;
107
294
  start: () => AnimateRunner;
108
295
  end: () => AnimateRunner;
109
296
  }
297
+ /**
298
+ * Signature for a JavaScript animation factory function.
299
+ *
300
+ * Given an element + event (+ optional classes/options), returns an {@link Animator}
301
+ * handle when it intends to animate, or `undefined` when it cannot handle the request.
302
+ */
110
303
  export interface AnimateJsFn {
111
304
  (
112
305
  element: HTMLElement,
113
306
  event: string,
114
307
  classes?: string | null,
115
308
  options?: AnimationOptions,
116
- ): AnimateJsRunner;
309
+ ): Animator | undefined;
310
+ }
311
+ /**
312
+ * Handle returned by an animation factory (CSS or JS) that can be started or ended.
313
+ *
314
+ * `start()` begins the animation and returns a runner.
315
+ * `end()` forces completion (may be synchronous depending on driver).
316
+ */
317
+ export interface Animator {
318
+ /** Whether this handle is expected to perform a real animation. */
319
+ _willAnimate: boolean;
320
+ /** Start the animation and return a runner you can control/cancel. */
321
+ start(): AnimateRunner;
322
+ /** Force-finish the animation (may be sync). */
323
+ end(): void;
324
+ }
325
+ /**
326
+ * Variant of {@link Animator} where `end()` returns the runner for chaining.
327
+ *
328
+ * Useful when callers rely on runner semantics after forcing completion.
329
+ */
330
+ export interface AnimatorWithEndRunner extends Animator {
331
+ end(): AnimateRunner;
332
+ }
333
+ /**
334
+ * Normalized animation factory signature used by the animation subsystem.
335
+ *
336
+ * Unlike {@link AnimateJsFn}, this always returns an {@link Animator} (never `undefined`),
337
+ * typically because it represents the selected driver pipeline.
338
+ */
339
+ export type AnimateFn = (
340
+ element: HTMLElement,
341
+ event: string,
342
+ classes?: string | null,
343
+ options?: AnimationOptions,
344
+ ) => Animator;
345
+ /**
346
+ * Signature for the CSS-based animation service.
347
+ *
348
+ * This typically returns an {@link Animator} that wraps CSS detection and timing.
349
+ */
350
+ export type AnimateCssService = (
351
+ element: HTMLElement,
352
+ options?: ng.AnimationOptions,
353
+ ) => Animator;
354
+ /**
355
+ * Tuple representation of an inline style entry (`[property, value]`).
356
+ *
357
+ * Used by style application utilities to preserve order while iterating.
358
+ */
359
+ export type InlineStyleEntry = [string, string];
360
+ /**
361
+ * Internal entry used for parent-to-child sorting before scheduling with RAF.
362
+ *
363
+ * The queue sorts animation start functions by DOM ancestry to ensure:
364
+ * - parent preparation classes are applied before children start
365
+ * - child animations don't observe incorrect computed styles
366
+ */
367
+ export interface SortedAnimationEntry {
368
+ /** DOM node used to compute parent/child relationships (often the same as `element`). */
369
+ domNode: Node;
370
+ /** The element being animated. */
371
+ element: Element;
372
+ /** Function that triggers the animation start for this element. */
373
+ fn: () => void;
374
+ /** Children entries in the sort graph. */
375
+ children: SortedAnimationEntry[];
376
+ /** Internal marker to avoid processing nodes multiple times. */
377
+ processed?: boolean;
378
+ }
379
+ /**
380
+ * Internal queue entry representing an animation that will be driven.
381
+ *
382
+ * Extends {@link AnimationDetails} with lifecycle hooks used by the queue:
383
+ * - `beforeStart()` applies preparation classes/styles before driver detection
384
+ * - `close()` finalizes the animation state and resolves/rejects the runner
385
+ */
386
+ export type AnimationEntry = AnimationDetails & {
387
+ beforeStart: () => void;
388
+ close: (reject?: boolean) => void;
389
+ };
390
+ /**
391
+ * Reference to a structural animation participating in an anchor (shared element) pair.
392
+ *
393
+ * Stores the index into the current animation list and the anchor element node.
394
+ */
395
+ export interface AnchorRef {
396
+ animationID: number;
397
+ element: Element;
398
+ }
399
+ /**
400
+ * Pairing information for anchor animations.
401
+ *
402
+ * During grouping, an anchor key may map to:
403
+ * - `from`: the leaving element
404
+ * - `to`: the entering element
405
+ *
406
+ * If either side is missing, the animation falls back to non-anchor behavior.
407
+ */
408
+ export interface AnchorRefEntry {
409
+ from?: AnchorRef;
410
+ to?: AnchorRef;
117
411
  }
@@ -1,20 +1,29 @@
1
- export function AnimateQueueProvider($animateProvider: any): void;
1
+ /** @typedef {import("../interface.ts").AnimationOptions} AnimationOptions */
2
+ /**
3
+ * @param {import("../animate.js").AnimateProvider} $animateProvider
4
+ * @constructor
5
+ */
6
+ export function AnimateQueueProvider(
7
+ $animateProvider: import("../animate.js").AnimateProvider,
8
+ ): void;
2
9
  export class AnimateQueueProvider {
3
- constructor($animateProvider: any);
4
- rules: {
5
- skip: any[];
6
- cancel: any[];
7
- join: any[];
8
- };
10
+ /** @typedef {import("../interface.ts").AnimationOptions} AnimationOptions */
11
+ /**
12
+ * @param {import("../animate.js").AnimateProvider} $animateProvider
13
+ * @constructor
14
+ */
15
+ constructor($animateProvider: import("../animate.js").AnimateProvider);
16
+ rules: import("../../shared/interface.ts").Dict<any>;
9
17
  $get: (
10
18
  | string
11
19
  | ((
12
20
  $rootScope: ng.RootScopeService,
13
21
  $injector: ng.InjectorService,
14
- $$animation: any,
22
+ $$animation: import("../interface.ts").AnimationService,
15
23
  ) => import("../queue/interface.ts").AnimateQueueService)
16
24
  )[];
17
25
  }
18
26
  export namespace AnimateQueueProvider {
19
27
  let $inject: string[];
20
28
  }
29
+ export type AnimationOptions = import("../interface.ts").AnimationOptions;