@angular-wave/angular.ts 0.18.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.
- package/@types/angular.d.ts +18 -6
- package/@types/animations/animate-css-driver.d.ts +2 -2
- package/@types/animations/animate-js-driver.d.ts +11 -1
- package/@types/animations/animate-js.d.ts +10 -2
- package/@types/animations/animate-swap.d.ts +4 -1
- package/@types/animations/animate.d.ts +11 -5
- package/@types/animations/animation.d.ts +7 -0
- package/@types/animations/css/animate-css.d.ts +16 -0
- package/@types/animations/interface.d.ts +308 -19
- package/@types/animations/queue/animate-queue.d.ts +16 -7
- package/@types/animations/queue/interface.d.ts +14 -7
- package/@types/core/compile/attributes.d.ts +1 -1
- package/@types/core/compile/compile.d.ts +25 -15
- package/@types/core/compile/interface.d.ts +209 -34
- package/@types/core/controller/controller.d.ts +30 -38
- package/@types/core/controller/interface.d.ts +12 -3
- package/@types/core/parse/interface.d.ts +2 -2
- package/@types/core/parse/interpreter.d.ts +110 -58
- package/@types/core/scope/interface.d.ts +6 -0
- package/@types/core/scope/scope.d.ts +2 -1
- package/@types/directive/aria/aria.d.ts +66 -26
- package/@types/directive/aria/interface.d.ts +9 -0
- package/@types/directive/class/class.d.ts +31 -0
- package/@types/directive/form/form.d.ts +54 -18
- package/@types/directive/input/input.d.ts +59 -18
- package/@types/directive/input/interface.d.ts +10 -0
- package/@types/directive/messages/messages.d.ts +63 -12
- package/@types/directive/model/interface.d.ts +19 -0
- package/@types/directive/model/model.d.ts +70 -33
- package/@types/directive/model-options/model-options.d.ts +1 -23
- package/@types/directive/repeat/repeat.d.ts +2 -3
- package/@types/directive/validators/validators.d.ts +1 -5
- package/@types/directive/worker/interface.d.ts +9 -0
- package/@types/docs.d.ts +24 -0
- package/@types/filters/json.d.ts +4 -0
- package/@types/interface.d.ts +22 -69
- package/@types/namespace.d.ts +66 -40
- package/@types/router/common/trace.d.ts +150 -42
- package/@types/router/directives/state-directives.d.ts +4 -4
- package/@types/router/directives/view-directive.d.ts +2 -5
- package/@types/router/hooks/core-resolvables.d.ts +11 -2
- package/@types/router/hooks/ignored-transition.d.ts +3 -1
- package/@types/router/hooks/invalid-transition.d.ts +3 -1
- package/@types/router/hooks/lazy-load.d.ts +17 -13
- package/@types/router/hooks/on-enter-exit-retain.d.ts +9 -3
- package/@types/router/hooks/redirect-to.d.ts +3 -3
- package/@types/router/hooks/resolve.d.ts +11 -3
- package/@types/router/hooks/views.d.ts +6 -4
- package/@types/router/params/interface.d.ts +3 -2
- package/@types/router/params/param-factory.d.ts +24 -3
- package/@types/router/params/param-type.d.ts +47 -11
- package/@types/router/params/param-types.d.ts +52 -0
- package/@types/router/params/param.d.ts +52 -28
- package/@types/router/params/state-params.d.ts +5 -3
- package/@types/router/path/interface.d.ts +3 -0
- package/@types/router/path/path-node.d.ts +34 -14
- package/@types/router/path/path-utils.d.ts +75 -25
- package/@types/router/resolve/resolvable.d.ts +34 -7
- package/@types/router/resolve/resolve-context.d.ts +52 -34
- package/@types/router/router.d.ts +10 -12
- package/@types/router/state/interface.d.ts +194 -31
- package/@types/router/state/state-builder.d.ts +29 -29
- package/@types/router/state/state-matcher.d.ts +29 -11
- package/@types/router/state/state-object.d.ts +67 -21
- package/@types/router/state/state-queue-manager.d.ts +19 -10
- package/@types/router/state/state-registry.d.ts +80 -28
- package/@types/router/state/state-service.d.ts +182 -123
- package/@types/router/state/target-state.d.ts +36 -27
- package/@types/router/state/views.d.ts +48 -19
- package/@types/router/template-factory.d.ts +8 -15
- package/@types/router/transition/hook-builder.d.ts +17 -6
- package/@types/router/transition/hook-registry.d.ts +80 -46
- package/@types/router/transition/interface.d.ts +138 -118
- package/@types/router/transition/reject-factory.d.ts +58 -22
- package/@types/router/transition/transition-event-type.d.ts +19 -8
- package/@types/router/transition/transition-hook.d.ts +50 -29
- package/@types/router/transition/transition-service.d.ts +186 -30
- package/@types/router/transition/transition.d.ts +201 -70
- package/@types/router/url/interface.d.ts +140 -0
- package/@types/router/url/url-config.d.ts +19 -16
- package/@types/router/url/url-matcher.d.ts +66 -46
- package/@types/router/url/url-rule.d.ts +58 -35
- package/@types/router/url/url-rules.d.ts +38 -28
- package/@types/router/url/url-service.d.ts +68 -41
- package/@types/router/view/interface.d.ts +10 -30
- package/@types/router/view/view.d.ts +35 -21
- package/@types/services/anchor-scroll/interface.d.ts +1 -1
- package/@types/services/http/http.d.ts +19 -22
- package/@types/services/http/interface.d.ts +11 -23
- package/@types/services/location/interface.d.ts +1 -4
- package/@types/services/location/location.d.ts +13 -13
- package/@types/services/sce/sce.d.ts +14 -8
- package/@types/services/template-request/template-request.d.ts +21 -4
- package/@types/shared/common.d.ts +5 -32
- package/@types/shared/dom.d.ts +10 -5
- package/@types/shared/interface.d.ts +4 -0
- package/@types/shared/utils.d.ts +17 -6
- package/dist/angular-ts.esm.js +6424 -2850
- package/dist/angular-ts.umd.js +6424 -2850
- 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 -2
- package/@types/animations/animate-css.d.ts +0 -11
- package/@types/filters/filters.d.ts +0 -38
- package/@types/router/hooks/update-globals.d.ts +0 -1
- package/@types/router/hooks/url.d.ts +0 -5
package/@types/angular.d.ts
CHANGED
|
@@ -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 |
|
|
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 |
|
|
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 {
|
|
159
|
+
* @param {HTMLElement|HTMLDocument} element
|
|
149
160
|
*/
|
|
150
|
-
init(element:
|
|
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:
|
|
20
|
-
) => (animationDetails:
|
|
19
|
+
$rootElement: HTMLElement,
|
|
20
|
+
) => (animationDetails: import("./interface.ts").AnimationDetails) => any)
|
|
21
21
|
)[];
|
|
22
22
|
}
|
|
23
23
|
export namespace AnimateCssDriverProvider {
|
|
@@ -9,8 +9,18 @@ export class AnimateJsDriverProvider {
|
|
|
9
9
|
* @param {import("./animation.js").AnimationProvider} $$animationProvider
|
|
10
10
|
*/
|
|
11
11
|
constructor($$animationProvider: import("./animation.js").AnimationProvider);
|
|
12
|
-
$get: (
|
|
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
|
+
)[];
|
|
13
22
|
}
|
|
14
23
|
export namespace AnimateJsDriverProvider {
|
|
15
24
|
let $inject: string[];
|
|
16
25
|
}
|
|
26
|
+
import { AnimateRunner } from "./runner/animate-runner.js";
|
|
@@ -1,6 +1,14 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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(
|
|
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: (
|
|
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: (
|
|
98
|
+
classNameFilter: (
|
|
99
|
+
expression?: RegExp | undefined,
|
|
100
|
+
...args: any[]
|
|
101
|
+
) => RegExp | null;
|
|
96
102
|
$get: (
|
|
97
103
|
| string
|
|
98
104
|
| ((
|
|
@@ -9,3 +9,10 @@ export class AnimationProvider {
|
|
|
9
9
|
) => import("./interface.ts").AnimationService)
|
|
10
10
|
)[];
|
|
11
11
|
}
|
|
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,78 +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
|
+
*/
|
|
3
15
|
export type AnimationService = (
|
|
4
16
|
element: HTMLElement,
|
|
5
17
|
event: string,
|
|
6
|
-
options?:
|
|
18
|
+
options?: AnimationOptions,
|
|
7
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
|
+
*/
|
|
8
26
|
export interface AnimationHost {
|
|
9
27
|
/** Pause animation. */
|
|
10
28
|
pause?: () => void;
|
|
11
29
|
/** Resume animation. */
|
|
12
30
|
resume?: () => void;
|
|
13
|
-
/** End animation. */
|
|
31
|
+
/** End animation (finish immediately). */
|
|
14
32
|
end?: () => void;
|
|
15
|
-
/** Cancel animation. */
|
|
33
|
+
/** Cancel animation (abort and rollback if applicable). */
|
|
16
34
|
cancel?: () => void;
|
|
17
|
-
/** Report animation progress. */
|
|
35
|
+
/** Report animation progress; signature is driver-dependent. */
|
|
18
36
|
progress?: (...args: any[]) => void;
|
|
19
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
|
+
*/
|
|
20
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
|
+
*/
|
|
21
55
|
on(
|
|
22
56
|
event: string,
|
|
23
57
|
container: Element,
|
|
24
|
-
callback
|
|
58
|
+
callback?: (
|
|
25
59
|
element: Element,
|
|
26
60
|
phase: QueuePhase,
|
|
27
|
-
data:
|
|
28
|
-
addClass?: string | null;
|
|
29
|
-
removeClass?: string | null;
|
|
30
|
-
from?: Record<string, any> | null;
|
|
31
|
-
to?: Record<string, any> | null;
|
|
32
|
-
},
|
|
61
|
+
data: AnimationEventData,
|
|
33
62
|
) => void,
|
|
34
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
|
+
*/
|
|
35
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
|
+
*/
|
|
36
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
|
+
*/
|
|
37
85
|
enabled(element?: Element, enabled?: boolean): boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Cancel a running animation by runner.
|
|
88
|
+
*/
|
|
38
89
|
cancel(runner: AnimateRunner): void;
|
|
90
|
+
/**
|
|
91
|
+
* Structural animation: insert `element` into the DOM.
|
|
92
|
+
*/
|
|
39
93
|
enter(
|
|
40
94
|
element: Element,
|
|
41
|
-
parent
|
|
95
|
+
parent?: Element | null,
|
|
42
96
|
after?: Element,
|
|
43
97
|
options?: AnimationOptions,
|
|
44
98
|
): AnimateRunner;
|
|
99
|
+
/**
|
|
100
|
+
* Structural animation: move `element` within the DOM.
|
|
101
|
+
*/
|
|
45
102
|
move(
|
|
46
103
|
element: Element,
|
|
47
|
-
parent: Element,
|
|
104
|
+
parent: Element | null,
|
|
48
105
|
after?: Element,
|
|
49
106
|
options?: AnimationOptions,
|
|
50
107
|
): AnimateRunner;
|
|
108
|
+
/**
|
|
109
|
+
* Structural animation: remove `element` from the DOM.
|
|
110
|
+
*/
|
|
51
111
|
leave(element: Element, options?: AnimationOptions): AnimateRunner;
|
|
112
|
+
/**
|
|
113
|
+
* Class-based animation: add classes to `element`.
|
|
114
|
+
*/
|
|
52
115
|
addClass(
|
|
53
116
|
element: Element,
|
|
54
117
|
className: string,
|
|
55
118
|
options?: AnimationOptions,
|
|
56
119
|
): AnimateRunner;
|
|
120
|
+
/**
|
|
121
|
+
* Class-based animation: remove classes from `element`.
|
|
122
|
+
*/
|
|
57
123
|
removeClass(
|
|
58
124
|
element: Element,
|
|
59
125
|
className: string,
|
|
60
126
|
options?: AnimationOptions,
|
|
61
127
|
): AnimateRunner;
|
|
128
|
+
/**
|
|
129
|
+
* Class-based animation: add and remove classes as a single atomic operation.
|
|
130
|
+
*/
|
|
62
131
|
setClass(
|
|
63
132
|
element: Element,
|
|
64
133
|
add: string,
|
|
65
134
|
remove: string,
|
|
66
135
|
options?: AnimationOptions,
|
|
67
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
|
+
*/
|
|
68
142
|
animate(
|
|
69
143
|
element: Element,
|
|
70
|
-
from: Record<string,
|
|
71
|
-
to: Record<string,
|
|
144
|
+
from: Record<string, string | number>,
|
|
145
|
+
to: Record<string, string | number>,
|
|
72
146
|
className?: string,
|
|
73
147
|
options?: AnimationOptions,
|
|
74
148
|
): AnimateRunner;
|
|
75
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
|
+
*/
|
|
76
170
|
export type AnimationMethod =
|
|
77
171
|
| "enter"
|
|
78
172
|
| "leave"
|
|
@@ -80,43 +174,238 @@ export type AnimationMethod =
|
|
|
80
174
|
| "addClass"
|
|
81
175
|
| "setClass"
|
|
82
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
|
+
*/
|
|
83
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. */
|
|
84
195
|
addClass?: string;
|
|
196
|
+
/** CSS properties & values at the beginning of animation. */
|
|
85
197
|
from?: Record<string, string | number>;
|
|
86
|
-
|
|
198
|
+
/** CSS properties & values at end of animation. */
|
|
87
199
|
to?: Record<string, string | number>;
|
|
88
|
-
|
|
89
|
-
|
|
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. */
|
|
90
205
|
domOperation?: () => void;
|
|
206
|
+
/** Optional completion callback (driver/queue dependent). */
|
|
91
207
|
onDone?: () => void;
|
|
208
|
+
/** Internal flag: whether domOperation has fired. */
|
|
92
209
|
_domOperationFired?: boolean;
|
|
210
|
+
/** Internal flag: whether preparation has been performed. */
|
|
93
211
|
_prepared?: boolean;
|
|
212
|
+
/** Internal flag: skip preparation classes. */
|
|
94
213
|
_skipPreparationClasses?: boolean;
|
|
214
|
+
/** Whether to clean up styles after animation completes. */
|
|
95
215
|
cleanupStyles?: boolean;
|
|
216
|
+
/** Generated preparation classes applied before animation start. */
|
|
96
217
|
preparationClasses?: string;
|
|
218
|
+
/** Generated active classes applied while animation runs. */
|
|
97
219
|
activeClasses?: string;
|
|
220
|
+
/** Duration override (seconds/ms string or number depending on implementation). */
|
|
98
221
|
duration?: number | string;
|
|
222
|
+
/** Event name(s) for multi-event animations (internal). */
|
|
99
223
|
event?: string | string[];
|
|
224
|
+
/** Easing override for the animation. */
|
|
100
225
|
easing?: string;
|
|
226
|
+
/** Delay override (string as parsed from computed styles is common). */
|
|
101
227
|
delay?: string;
|
|
228
|
+
/** Whether this is a structural animation (enter/leave/move). */
|
|
102
229
|
structural?: boolean;
|
|
230
|
+
/** Driver-specific transition style key. */
|
|
103
231
|
transitionStyle?: string;
|
|
232
|
+
/** Stagger index for staggered sequences (internal). */
|
|
104
233
|
staggerIndex?: number;
|
|
234
|
+
/** Whether to skip blocking behavior (internal/driver). */
|
|
105
235
|
skipBlocking?: boolean;
|
|
236
|
+
/** Stagger duration or configuration. */
|
|
106
237
|
stagger?: number | string;
|
|
238
|
+
/** Driver-specific keyframe style key. */
|
|
107
239
|
keyframeStyle?: string;
|
|
240
|
+
/** Whether to apply classes before measuring styles (driver/queue). */
|
|
108
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;
|
|
109
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
|
+
*/
|
|
110
292
|
export interface AnimateJsRunner {
|
|
111
293
|
_willAnimate: true;
|
|
112
294
|
start: () => AnimateRunner;
|
|
113
295
|
end: () => AnimateRunner;
|
|
114
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
|
+
*/
|
|
115
303
|
export interface AnimateJsFn {
|
|
116
304
|
(
|
|
117
305
|
element: HTMLElement,
|
|
118
306
|
event: string,
|
|
119
307
|
classes?: string | null,
|
|
120
308
|
options?: AnimationOptions,
|
|
121
|
-
):
|
|
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;
|
|
122
411
|
}
|
|
@@ -1,11 +1,19 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
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
|
| ((
|
|
@@ -18,3 +26,4 @@ export class AnimateQueueProvider {
|
|
|
18
26
|
export namespace AnimateQueueProvider {
|
|
19
27
|
let $inject: string[];
|
|
20
28
|
}
|
|
29
|
+
export type AnimationOptions = import("../interface.ts").AnimationOptions;
|