@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
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { AnimateRunner } from "../runner/animate-runner.js";
|
|
2
|
+
import { AnimationEventData } from "../interface.ts";
|
|
2
3
|
export type QueuePhase =
|
|
3
4
|
| "start"
|
|
4
5
|
| "close"
|
|
@@ -6,13 +7,9 @@ export type QueuePhase =
|
|
|
6
7
|
| "progress"
|
|
7
8
|
| "dom"
|
|
8
9
|
| string;
|
|
9
|
-
export
|
|
10
|
-
addClass: string | null;
|
|
11
|
-
removeClass: string | null;
|
|
12
|
-
from: Record<string, any> | null;
|
|
13
|
-
to: Record<string, any> | null;
|
|
10
|
+
export type QueueAnimationData = AnimationEventData & {
|
|
14
11
|
[key: string]: any;
|
|
15
|
-
}
|
|
12
|
+
};
|
|
16
13
|
export interface AnimateQueueService {
|
|
17
14
|
on(
|
|
18
15
|
event: string,
|
|
@@ -24,7 +21,7 @@ export interface AnimateQueueService {
|
|
|
24
21
|
) => void,
|
|
25
22
|
): void;
|
|
26
23
|
off(
|
|
27
|
-
event: string,
|
|
24
|
+
event: string | Element,
|
|
28
25
|
container?: Element,
|
|
29
26
|
callback?: (
|
|
30
27
|
el: Element,
|
|
@@ -48,3 +45,13 @@ export interface AnimateQueueService {
|
|
|
48
45
|
domOperation?: () => void,
|
|
49
46
|
): AnimateRunner;
|
|
50
47
|
}
|
|
48
|
+
export type AnimateEventCallback = (
|
|
49
|
+
el: Element,
|
|
50
|
+
phase: QueuePhase,
|
|
51
|
+
data: QueueAnimationData,
|
|
52
|
+
) => void;
|
|
53
|
+
export interface CallbackRegistryEntry {
|
|
54
|
+
node: Element;
|
|
55
|
+
callback: AnimateEventCallback;
|
|
56
|
+
}
|
|
57
|
+
export type CallbackRegistry = Record<string, CallbackRegistryEntry[] | null>;
|
|
@@ -110,7 +110,7 @@ export class Attributes {
|
|
|
110
110
|
* @returns {Function} Returns a deregistration function for this observer.
|
|
111
111
|
*/
|
|
112
112
|
$observe<T>(key: string, fn: (value?: T) => any): Function;
|
|
113
|
-
_observers: any
|
|
113
|
+
_observers: Record<string, any>;
|
|
114
114
|
/**
|
|
115
115
|
* Sets a special (non-standard) attribute on an element.
|
|
116
116
|
*
|
|
@@ -2,11 +2,11 @@ export const DirectiveSuffix: "Directive";
|
|
|
2
2
|
export class CompileProvider {
|
|
3
3
|
static $inject: string[];
|
|
4
4
|
/**
|
|
5
|
-
* @param {
|
|
5
|
+
* @param {ng.ProvideService} $provide
|
|
6
6
|
* @param {import('../sanitize/sanitize-uri.js').SanitizeUriProvider} $sanitizeUriProvider
|
|
7
7
|
*/
|
|
8
8
|
constructor(
|
|
9
|
-
$provide:
|
|
9
|
+
$provide: ng.ProvideService,
|
|
10
10
|
$sanitizeUriProvider: import("../sanitize/sanitize-uri.js").SanitizeUriProvider,
|
|
11
11
|
);
|
|
12
12
|
/**
|
|
@@ -15,13 +15,13 @@ export class CompileProvider {
|
|
|
15
15
|
* @param {string|Object} name Name of the directive in camel-case (i.e. `ngBind` which will match
|
|
16
16
|
* as `ng-bind`), or an object map of directives where the keys are the names and the values
|
|
17
17
|
* are the factories.
|
|
18
|
-
* @param {Function|Array} directiveFactory An injectable directive factory function. See the
|
|
18
|
+
* @param {Function|Array<Function>} directiveFactory An injectable directive factory function. See the
|
|
19
19
|
* {@link guide/directive directive guide} and the {@link $compile compile API} for more info.
|
|
20
20
|
* @returns {CompileProvider} Self for chaining.
|
|
21
21
|
*/
|
|
22
22
|
directive: (
|
|
23
23
|
name: string | any,
|
|
24
|
-
directiveFactory: Function |
|
|
24
|
+
directiveFactory: Function | Array<Function>,
|
|
25
25
|
) => CompileProvider;
|
|
26
26
|
/**
|
|
27
27
|
* @param {string|Object} name Name of the component in camelCase (i.e. `myComp` which will match `<my-comp>`),
|
|
@@ -101,13 +101,16 @@ export class CompileProvider {
|
|
|
101
101
|
* the absolute url is prefixed with `'unsafe:'` string and only then is it written into the DOM.
|
|
102
102
|
*
|
|
103
103
|
* @param {RegExp=} regexp New regexp to trust urls with.
|
|
104
|
-
* @returns {RegExp|import('../sanitize/sanitize-uri.js').SanitizeUriProvider} Current RegExp if called without value or self for
|
|
104
|
+
* @returns {RegExp|import('../sanitize/sanitize-uri.js').SanitizeUriProvider | undefined} Current RegExp if called without value or self for
|
|
105
105
|
* chaining otherwise.
|
|
106
106
|
*/
|
|
107
107
|
imgSrcSanitizationTrustedUrlList: (
|
|
108
108
|
regexp?: RegExp | undefined,
|
|
109
|
-
) =>
|
|
110
|
-
|
|
109
|
+
) =>
|
|
110
|
+
| RegExp
|
|
111
|
+
| import("../sanitize/sanitize-uri.js").SanitizeUriProvider
|
|
112
|
+
| undefined;
|
|
113
|
+
strictComponentBindingsEnabled: (enabled: boolean) => boolean | this;
|
|
111
114
|
/**
|
|
112
115
|
* Defines the security context for DOM properties bound by ng-prop-*.
|
|
113
116
|
*
|
|
@@ -129,15 +132,22 @@ export class CompileProvider {
|
|
|
129
132
|
$exceptionHandler: ng.ExceptionHandlerService,
|
|
130
133
|
$templateRequest: ng.TemplateRequestService,
|
|
131
134
|
$parse: ng.ParseService,
|
|
132
|
-
$controller:
|
|
135
|
+
$controller: ng.ControllerService,
|
|
133
136
|
$sce: ng.SceService,
|
|
134
137
|
$animate: ng.AnimateService,
|
|
135
|
-
) =>
|
|
136
|
-
compileNode: string | Element | Node | ChildNode | NodeList,
|
|
137
|
-
transcludeFn?: import("./interface.ts").TranscludeFn,
|
|
138
|
-
maxPriority?: number,
|
|
139
|
-
ignoreDirective?: string,
|
|
140
|
-
previousCompileContext?: any,
|
|
141
|
-
) => import("./interface.ts").PublicLinkFn)
|
|
138
|
+
) => ng.CompileService)
|
|
142
139
|
)[];
|
|
143
140
|
}
|
|
141
|
+
export type BoundTranscludeFn = import("./interface.ts").BoundTranscludeFn;
|
|
142
|
+
export type ChildTranscludeOrLinkFn =
|
|
143
|
+
import("./interface.ts").ChildTranscludeOrLinkFn;
|
|
144
|
+
export type CloneAttachFn = import("./interface.ts").CloneAttachFn;
|
|
145
|
+
export type CompileNodesFn = import("./interface.ts").CompileNodesFn;
|
|
146
|
+
export type CompositeLinkFn = import("./interface.ts").CompositeLinkFn;
|
|
147
|
+
export type NodeLinkFn = import("./interface.ts").NodeLinkFn;
|
|
148
|
+
export type NodeLinkFnCtx = import("./interface.ts").NodeLinkFnCtx;
|
|
149
|
+
export type PreviousCompileContext =
|
|
150
|
+
import("./interface.ts").PreviousCompileContext;
|
|
151
|
+
export type PublicLinkFn = import("./interface.ts").PublicLinkFn;
|
|
152
|
+
export type TranscludedNodes = import("./interface.ts").TranscludedNodes;
|
|
153
|
+
export type InternalDirective = import("./interface.ts").InternalDirective;
|
|
@@ -1,8 +1,19 @@
|
|
|
1
1
|
import type { Scope } from "../scope/scope.js";
|
|
2
2
|
import type { NodeRef } from "../../shared/noderef.js";
|
|
3
|
-
type TranscludedNodes = Node | Node[] | NodeList | null;
|
|
4
|
-
type TranscludeFnCb = (clone?: TranscludedNodes, scope?: Scope | null) => void;
|
|
3
|
+
export type TranscludedNodes = Node | Node[] | NodeList | null;
|
|
5
4
|
export type ChildTranscludeOrLinkFn = TranscludeFn | PublicLinkFn;
|
|
5
|
+
/**
|
|
6
|
+
* Callback used when transcluded content is cloned.
|
|
7
|
+
*/
|
|
8
|
+
export type CloneAttachFn = (
|
|
9
|
+
clone?: TranscludedNodes,
|
|
10
|
+
scope?: Scope | null,
|
|
11
|
+
) => any;
|
|
12
|
+
export interface TemplateLinkingFunctionOptions {
|
|
13
|
+
_parentBoundTranscludeFn?: BoundTranscludeFn | null;
|
|
14
|
+
transcludeControllers?: unknown;
|
|
15
|
+
_futureParentElement?: Node | Element | null | undefined;
|
|
16
|
+
}
|
|
6
17
|
/**
|
|
7
18
|
* A function passed as the fifth argument to a `PublicLinkFn` link function.
|
|
8
19
|
* It behaves like a linking function, with the `scope` argument automatically created
|
|
@@ -11,35 +22,56 @@ export type ChildTranscludeOrLinkFn = TranscludeFn | PublicLinkFn;
|
|
|
11
22
|
* The function returns the DOM content to be injected (transcluded) into the directive.
|
|
12
23
|
*/
|
|
13
24
|
export type TranscludeFn = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
25
|
+
/**
|
|
26
|
+
* $transclude(cloneAttachFn, futureParentElement?, slotName?)
|
|
27
|
+
* (no explicit scope passed)
|
|
28
|
+
*/
|
|
29
|
+
(
|
|
30
|
+
cloneAttachFn: CloneAttachFn,
|
|
31
|
+
futureParentElement?: Node | Element | null,
|
|
32
|
+
slotName?: string | number,
|
|
33
|
+
): TranscludedNodes | void;
|
|
34
|
+
/**
|
|
35
|
+
* $transclude(scope?, cloneAttachFn?, futureParentElement?, slotName?)
|
|
36
|
+
* (scope-first form)
|
|
37
|
+
*/
|
|
38
|
+
(
|
|
39
|
+
scope?: Scope | null,
|
|
40
|
+
cloneAttachFn?: CloneAttachFn,
|
|
41
|
+
futureParentElement?: Node | Element | null,
|
|
42
|
+
slotName?: string | number,
|
|
43
|
+
): TranscludedNodes | void;
|
|
44
|
+
/**
|
|
45
|
+
* Internal call path that threads link options.
|
|
46
|
+
*/
|
|
47
|
+
(
|
|
48
|
+
scope?: Scope | null,
|
|
49
|
+
cloneAttachFn?: CloneAttachFn,
|
|
50
|
+
options?: TemplateLinkingFunctionOptions,
|
|
51
|
+
): TranscludedNodes | void;
|
|
52
|
+
/** Slot transclusion functions (if the parent declared slots). */
|
|
53
|
+
_slots?: Record<string | number, TranscludeFn | null>;
|
|
54
|
+
/** Added by your `controllersBoundTransclude` wrapper. */
|
|
55
|
+
isSlotFilled?: (slotName: string | number) => boolean;
|
|
56
|
+
/** Internal: unwraps to the bound transclude when threaded through link options. */
|
|
57
|
+
_boundTransclude?: BoundTranscludeFn;
|
|
17
58
|
};
|
|
18
|
-
export type CloneAttachFn = (
|
|
19
|
-
clone: Node | Element | NodeList,
|
|
20
|
-
scope?: Scope,
|
|
21
|
-
) => void;
|
|
22
59
|
/**
|
|
23
|
-
* A specialized version of `TranscludeFn` with the scope
|
|
24
|
-
*
|
|
60
|
+
* A specialized version of `TranscludeFn` with the parent scope already bound.
|
|
61
|
+
* Used internally to thread controller context and future parent elements.
|
|
25
62
|
*/
|
|
26
63
|
export interface BoundTranscludeFn {
|
|
27
64
|
(
|
|
28
|
-
|
|
65
|
+
transcludedScope?: Scope | null,
|
|
29
66
|
cloneAttachFn?: CloneAttachFn,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
):
|
|
34
|
-
_slots: Record<string,
|
|
67
|
+
controllers?: unknown,
|
|
68
|
+
futureParentElement?: Node | Element | null,
|
|
69
|
+
containingScope?: Scope,
|
|
70
|
+
): TranscludedNodes | void;
|
|
71
|
+
_slots: Record<string | number, BoundTranscludeFn | null>;
|
|
72
|
+
_boundTransclude?: BoundTranscludeFn;
|
|
35
73
|
}
|
|
36
|
-
export type SlotTranscludeFn =
|
|
37
|
-
scope?: Scope,
|
|
38
|
-
cloneAttachFn?: CloneAttachFn,
|
|
39
|
-
transcludeControllers?: unknown,
|
|
40
|
-
_futureParentElement?: Node | Element,
|
|
41
|
-
scopeToChild?: Scope,
|
|
42
|
-
) => Node | Element | NodeList;
|
|
74
|
+
export type SlotTranscludeFn = BoundTranscludeFn;
|
|
43
75
|
/**
|
|
44
76
|
* Represents a simple change in a watched value.
|
|
45
77
|
*/
|
|
@@ -53,8 +85,8 @@ export interface SimpleChange {
|
|
|
53
85
|
export type PublicLinkFn = {
|
|
54
86
|
(
|
|
55
87
|
scope: Scope,
|
|
56
|
-
|
|
57
|
-
options?:
|
|
88
|
+
cloneAttachFn?: CloneAttachFn,
|
|
89
|
+
options?: TemplateLinkingFunctionOptions,
|
|
58
90
|
): Element | Node | ChildNode | Node[];
|
|
59
91
|
pre?: any;
|
|
60
92
|
post?: any;
|
|
@@ -63,8 +95,8 @@ export type PublicLinkFn = {
|
|
|
63
95
|
* Entry point for the `$compile` service.
|
|
64
96
|
*/
|
|
65
97
|
export type CompileFn = (
|
|
66
|
-
compileNode: string | Element | Node | ChildNode | NodeList,
|
|
67
|
-
transcludeFn?:
|
|
98
|
+
compileNode: string | Element | Node | ChildNode | NodeList | null,
|
|
99
|
+
transcludeFn?: ChildTranscludeOrLinkFn | null,
|
|
68
100
|
maxPriority?: number,
|
|
69
101
|
ignoreDirective?: string,
|
|
70
102
|
previousCompileContext?: any,
|
|
@@ -75,12 +107,46 @@ export type CompileFn = (
|
|
|
75
107
|
export interface LinkFnMapping {
|
|
76
108
|
index: number;
|
|
77
109
|
nodeLinkFnCtx?: NodeLinkFnCtx;
|
|
78
|
-
childLinkFn?: CompositeLinkFn;
|
|
110
|
+
childLinkFn?: CompositeLinkFn | null;
|
|
79
111
|
}
|
|
80
112
|
/**
|
|
81
|
-
*
|
|
113
|
+
* Compiles a node (or list of nodes) into a single composite link function.
|
|
114
|
+
*
|
|
115
|
+
* For each node in `nodeRefList`:
|
|
116
|
+
* 1) Collect and sort matching directives.
|
|
117
|
+
* 2) Apply directives to produce an optional node link function/context.
|
|
118
|
+
* 3) Recursively compile child nodes (unless a terminal directive stops recursion).
|
|
119
|
+
* 4) Return a composite link function that links all nodes (and their children) in order.
|
|
120
|
+
*
|
|
121
|
+
* Notes:
|
|
122
|
+
* - `transcludeFn` is the “thing passed down” to directives as `$transclude`. Depending on phase,
|
|
123
|
+
* it may be a `TranscludeFn` (real transclusion function), a `PublicLinkFn` (compiled link fn),
|
|
124
|
+
* or `null` (no transclusion).
|
|
125
|
+
* - `previousCompileContext` carries internal bookkeeping for replace/transclusion/templateUrl and
|
|
126
|
+
* is only applied to the first node in a virtual group.
|
|
82
127
|
*/
|
|
83
|
-
export type CompileNodesFn = (
|
|
128
|
+
export type CompileNodesFn = (
|
|
129
|
+
/**
|
|
130
|
+
* NodeRef wrapping either a single Node/Element or a list (e.g. NodeList/array-like).
|
|
131
|
+
*/
|
|
132
|
+
nodeRefList: NodeRef | null,
|
|
133
|
+
/**
|
|
134
|
+
* Parent transclusion/link function passed down to directives and child compilation.
|
|
135
|
+
*/
|
|
136
|
+
transcludeFn?: ChildTranscludeOrLinkFn,
|
|
137
|
+
/**
|
|
138
|
+
* If provided, only directives with `priority < maxPriority` are applied to the first node.
|
|
139
|
+
*/
|
|
140
|
+
maxPriority?: number,
|
|
141
|
+
/**
|
|
142
|
+
* Normalized directive name to ignore on the first node (prevents re-applying the triggering directive).
|
|
143
|
+
*/
|
|
144
|
+
ignoreDirective?: string,
|
|
145
|
+
/**
|
|
146
|
+
* Internal bookkeeping used across re-compilation passes (replace, element transclusion, templateUrl).
|
|
147
|
+
*/
|
|
148
|
+
previousCompileContext?: PreviousCompileContext | null,
|
|
149
|
+
) => CompositeLinkFn | null;
|
|
84
150
|
export type ChildLinkFn = (
|
|
85
151
|
scope: Scope,
|
|
86
152
|
nodeRef: NodeRef,
|
|
@@ -90,7 +156,7 @@ export type ChildLinkFn = (
|
|
|
90
156
|
* A function used to link a specific node.
|
|
91
157
|
*/
|
|
92
158
|
export type NodeLinkFn = (
|
|
93
|
-
childLinkFn: ChildLinkFn | null,
|
|
159
|
+
childLinkFn: ChildLinkFn | CompositeLinkFn | null | undefined,
|
|
94
160
|
scope: Scope,
|
|
95
161
|
node: Node | Element,
|
|
96
162
|
boundTranscludeFn: BoundTranscludeFn | null,
|
|
@@ -116,6 +182,115 @@ export type ApplyDirectivesToNodeFn = () => NodeLinkFn;
|
|
|
116
182
|
export type CompositeLinkFn = (
|
|
117
183
|
scope: Scope,
|
|
118
184
|
$linkNode: NodeRef,
|
|
119
|
-
_parentBoundTranscludeFn?:
|
|
185
|
+
_parentBoundTranscludeFn?: BoundTranscludeFn | null,
|
|
120
186
|
) => void;
|
|
121
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Internal compile bookkeeping passed through compile/compileNodes/applyDirectivesToNode.
|
|
189
|
+
* Used to preserve state across re-compilation passes (replace, transclusion, templateUrl),
|
|
190
|
+
* and to coordinate virtual-group indexing.
|
|
191
|
+
*/
|
|
192
|
+
export interface PreviousCompileContext {
|
|
193
|
+
/** Index of the current node inside the parent NodeRef list (virtual group position). */
|
|
194
|
+
index?: number;
|
|
195
|
+
/** The parent NodeRef list that the current node belongs to (used when replaced nodes must be re-indexed). */
|
|
196
|
+
parentNodeRef?: NodeRef;
|
|
197
|
+
/**
|
|
198
|
+
* Mutable NodeRef pointing at the “current” compile node for this context.
|
|
199
|
+
* Updated when directives replace or element-transclude the node (e.g. comment anchor).
|
|
200
|
+
*/
|
|
201
|
+
ctxNodeRef?: NodeRef;
|
|
202
|
+
/**
|
|
203
|
+
* When true, linking must create a fresh scope anchor because a parent replace+transclusion
|
|
204
|
+
* removed the element that would normally hold the transclusion scope.
|
|
205
|
+
* Consumed by `publicLinkFn` to do `scope.$parent?.$new()` in that edge case.
|
|
206
|
+
*/
|
|
207
|
+
needsNewScope?: boolean;
|
|
208
|
+
/**
|
|
209
|
+
* True if an element-transcluding directive has been applied (transclude === "element").
|
|
210
|
+
* Affects how controllers/transclusion are resolved and how templateUrl linking re-attaches nodes.
|
|
211
|
+
*/
|
|
212
|
+
hasElementTranscludeDirective?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* The directive that requested “non-terminal” (non-TLB) transclusion most recently.
|
|
215
|
+
* Used to detect and throw on multiple transclusion directives on the same element
|
|
216
|
+
* (except whitelisted ones like ngIf/ngRepeat).
|
|
217
|
+
*/
|
|
218
|
+
_nonTlbTranscludeDirective?: ng.Directive | null;
|
|
219
|
+
/**
|
|
220
|
+
* A “future” parent element passed through transclusion/linking so that namespace detection
|
|
221
|
+
* and transcluded node insertion can use the correct DOM parent (especially with replace/element transclusion).
|
|
222
|
+
*/
|
|
223
|
+
_futureParentElement?: Node | Element | null;
|
|
224
|
+
/**
|
|
225
|
+
* Map of directive-name -> directive definition for directives on this element that declare controllers.
|
|
226
|
+
* Carried forward so controllers can be instantiated once and then wired during linking.
|
|
227
|
+
*/
|
|
228
|
+
_controllerDirectives?: Record<string, ng.Directive> | null;
|
|
229
|
+
/**
|
|
230
|
+
* The directive responsible for creating a new child scope on this element (scope: true).
|
|
231
|
+
* Carried forward so templates/directives can be marked to inherit scope correctly after replace/transclusion.
|
|
232
|
+
*/
|
|
233
|
+
_newScopeDirective?: ng.Directive | null;
|
|
234
|
+
/**
|
|
235
|
+
* The directive responsible for creating an isolate scope on this element (scope: {}).
|
|
236
|
+
* Carried forward so template directives can be marked and so linking can create the isolate scope once.
|
|
237
|
+
*/
|
|
238
|
+
_newIsolateScopeDirective?: ng.Directive | null;
|
|
239
|
+
/**
|
|
240
|
+
* The directive that provided the active template/templateUrl for this element.
|
|
241
|
+
* Used to prevent multiple template directives and to coordinate replace/templateUrl compilation passes.
|
|
242
|
+
*/
|
|
243
|
+
_templateDirective?: ng.Directive | null;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* An internal augmentation of a directive definition object (DDO) used by the compiler.
|
|
247
|
+
*
|
|
248
|
+
* This extends `ng.Directive` with fields that AngularTS attaches during directive registration
|
|
249
|
+
* and compilation (e.g. sorting metadata, binding caches, template bookkeeping).
|
|
250
|
+
*/
|
|
251
|
+
export interface InternalDirective extends ng.Directive {
|
|
252
|
+
/**
|
|
253
|
+
* Normalized directive name (camelCase), e.g. `ngIf`.
|
|
254
|
+
* Typically set during registration.
|
|
255
|
+
*/
|
|
256
|
+
name: string;
|
|
257
|
+
/**
|
|
258
|
+
* Directive priority used to order directive application during compilation.
|
|
259
|
+
* Higher priorities run first.
|
|
260
|
+
*/
|
|
261
|
+
priority?: number;
|
|
262
|
+
/**
|
|
263
|
+
* Registration index (used as a stable tiebreaker when priorities and names match).
|
|
264
|
+
*/
|
|
265
|
+
index?: number;
|
|
266
|
+
/**
|
|
267
|
+
* Parsed bindings metadata for isolate scope and/or bindToController.
|
|
268
|
+
* Populated by the compiler to avoid re-parsing.
|
|
269
|
+
*/
|
|
270
|
+
_bindings?: any;
|
|
271
|
+
/**
|
|
272
|
+
* Parsed isolate-scope binding definitions (e.g. `{ foo: '@', bar: '=' }` expanded form).
|
|
273
|
+
* Typically derived from `_bindings.isolateScope`.
|
|
274
|
+
*/
|
|
275
|
+
_isolateBindings?: any;
|
|
276
|
+
/**
|
|
277
|
+
* Marks that this directive (or one it was merged into) requires an isolate scope.
|
|
278
|
+
* Used for bookkeeping across template/replace/transclusion compilation passes.
|
|
279
|
+
*/
|
|
280
|
+
_isolateScope?: boolean;
|
|
281
|
+
/**
|
|
282
|
+
* Marks that this directive (or one it was merged into) requires a new child scope.
|
|
283
|
+
* Used for bookkeeping across template/replace/transclusion compilation passes.
|
|
284
|
+
*/
|
|
285
|
+
_newScope?: boolean;
|
|
286
|
+
/**
|
|
287
|
+
* When an async `templateUrl` directive is converted into a derived sync directive,
|
|
288
|
+
* this points back to the original directive.
|
|
289
|
+
*/
|
|
290
|
+
_originalDirective?: any;
|
|
291
|
+
/**
|
|
292
|
+
* Template namespace hint (e.g. `"svg"`), used when wrapping templates or compiling
|
|
293
|
+
* non-HTML content.
|
|
294
|
+
*/
|
|
295
|
+
templateNamespace?: string;
|
|
296
|
+
}
|
|
@@ -1,54 +1,46 @@
|
|
|
1
|
-
export function identifierForController(controller: any, ident: any): string;
|
|
2
1
|
/**
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* This provider allows controller registration via the
|
|
7
|
-
* {@link ng.$controllerProvider#register register} method.
|
|
2
|
+
* @param {string | InjectableController | undefined} controller
|
|
3
|
+
* @param {string} [ident]
|
|
4
|
+
* @returns {string|undefined}
|
|
8
5
|
*/
|
|
6
|
+
export function identifierForController(
|
|
7
|
+
controller: string | InjectableController | undefined,
|
|
8
|
+
ident?: string,
|
|
9
|
+
): string | undefined;
|
|
9
10
|
export class ControllerProvider {
|
|
10
|
-
/**
|
|
11
|
-
* @type {Map<string, Function|Object>}
|
|
12
|
-
* @private
|
|
13
|
-
*/
|
|
11
|
+
/** @type {Map<string, InjectableController>} @private */
|
|
14
12
|
private controllers;
|
|
15
|
-
/**
|
|
16
|
-
* Check if a controller with a given name exists.
|
|
17
|
-
*
|
|
18
|
-
* @param {string} name Controller name to check.
|
|
19
|
-
* @returns {boolean} True if the controller exists, false otherwise.
|
|
20
|
-
*/
|
|
13
|
+
/** @param {string} name @returns {boolean} */
|
|
21
14
|
has(name: string): boolean;
|
|
22
15
|
/**
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
* @param {string|Object} name Controller name, or an object map of controllers where the keys are
|
|
26
|
-
* the names and the values are the constructors.
|
|
27
|
-
* @param {Function|Array} constructor Controller constructor function (optionally decorated with DI
|
|
28
|
-
* annotations in the array notation).
|
|
16
|
+
* @param {string | Record<string, unknown>} name
|
|
17
|
+
* @param {unknown} [constructor]
|
|
29
18
|
*/
|
|
30
|
-
register(name: string |
|
|
19
|
+
register(name: string | Record<string, unknown>, constructor?: unknown): void;
|
|
31
20
|
/**
|
|
32
|
-
* $
|
|
21
|
+
* @type {import("../../interface.ts").Injectable<($injector: ng.InjectorService) => ControllerService>}
|
|
33
22
|
*/
|
|
34
|
-
$get: (
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
$injector: ng.InjectorService,
|
|
38
|
-
) => import("./interface.ts").ControllerService)
|
|
39
|
-
)[];
|
|
23
|
+
$get: import("../../interface.ts").Injectable<
|
|
24
|
+
($injector: ng.InjectorService) => ControllerService
|
|
25
|
+
>;
|
|
40
26
|
/**
|
|
41
|
-
*
|
|
42
|
-
*
|
|
43
|
-
* @param {
|
|
44
|
-
* @param {string}
|
|
45
|
-
* @param {Object} instance The controller instance.
|
|
46
|
-
* @param {string} name The name of the controller.
|
|
27
|
+
* @param {ControllerLocals | undefined} locals
|
|
28
|
+
* @param {string} identifier
|
|
29
|
+
* @param {object} instance
|
|
30
|
+
* @param {string} name
|
|
47
31
|
*/
|
|
48
32
|
addIdentifier(
|
|
49
|
-
locals:
|
|
33
|
+
locals: ControllerLocals | undefined,
|
|
50
34
|
identifier: string,
|
|
51
|
-
instance:
|
|
35
|
+
instance: object,
|
|
52
36
|
name: string,
|
|
53
37
|
): void;
|
|
54
38
|
}
|
|
39
|
+
export type ControllerConstructor =
|
|
40
|
+
import("../../interface.ts").ControllerConstructor;
|
|
41
|
+
export type InjectableController =
|
|
42
|
+
import("../../interface.ts").Injectable<ControllerConstructor>;
|
|
43
|
+
export type ControllerService = import("./interface.ts").ControllerService;
|
|
44
|
+
export type ControllerLocals = import("./interface.ts").ControllerLocals;
|
|
45
|
+
export type ControllerExpression =
|
|
46
|
+
import("./interface.ts").ControllerExpression;
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
+
import { ControllerConstructor, Injectable } from "../../interface.ts";
|
|
2
|
+
/**
|
|
3
|
+
* The minimal local definitions required by $controller(ctrl, locals) calls.
|
|
4
|
+
*/
|
|
5
|
+
export interface ControllerLocals {
|
|
6
|
+
$scope: ng.Scope;
|
|
7
|
+
$element: Element;
|
|
8
|
+
}
|
|
1
9
|
export type ControllerService = (
|
|
2
|
-
expression:
|
|
3
|
-
locals?:
|
|
10
|
+
expression: ControllerExpression,
|
|
11
|
+
locals?: ControllerLocals,
|
|
4
12
|
later?: boolean,
|
|
5
13
|
ident?: string,
|
|
6
|
-
) =>
|
|
14
|
+
) => any | (() => any);
|
|
15
|
+
export type ControllerExpression = string | Injectable<ControllerConstructor>;
|
|
@@ -19,7 +19,7 @@ export interface CompiledExpressionProps {
|
|
|
19
19
|
* Assigns a value to a context.
|
|
20
20
|
* If value is not provided, may return the getter.
|
|
21
21
|
*/
|
|
22
|
-
_assign?: (
|
|
22
|
+
_assign?: (scope: ng.Scope, value: any, locals?: object) => any;
|
|
23
23
|
}
|
|
24
24
|
/**
|
|
25
25
|
* Expression function with context and optional locals/assign.
|
|
@@ -28,7 +28,7 @@ export interface CompiledExpressionProps {
|
|
|
28
28
|
export type CompiledExpressionFunction = (
|
|
29
29
|
context?: Scope | typeof Proxy<Scope>,
|
|
30
30
|
locals?: object,
|
|
31
|
-
|
|
31
|
+
_assign?: any,
|
|
32
32
|
) => any;
|
|
33
33
|
/**
|
|
34
34
|
* A compiled expression that is both a function and includes expression metadata.
|