@angular-wave/angular.ts 0.9.9 → 0.11.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 +24 -11
- package/@types/animations/animate-css-driver.d.ts +0 -1
- package/@types/animations/animate-css.d.ts +0 -1
- package/@types/animations/animate-js-driver.d.ts +1 -7
- package/@types/animations/animate-js.d.ts +1 -4
- package/@types/animations/animate-queue.d.ts +2 -4
- package/@types/animations/animate-swap.d.ts +2 -4
- package/@types/animations/animate.d.ts +24 -24
- package/@types/animations/animation.d.ts +2 -2
- package/@types/animations/interface.d.ts +12 -0
- package/@types/animations/raf-scheduler.d.ts +4 -4
- package/@types/animations/runner/animate-runner.d.ts +99 -0
- package/@types/animations/shared.d.ts +30 -2
- package/@types/core/compile/attributes.d.ts +5 -8
- package/@types/core/compile/compile.d.ts +4 -4
- package/@types/core/controller/controller.d.ts +1 -1
- package/@types/core/di/ng-module.d.ts +14 -14
- package/@types/core/filter/filter.d.ts +2 -2
- package/@types/core/scope/interface.d.ts +18 -0
- package/@types/core/scope/scope.d.ts +19 -95
- package/@types/directive/aria/aria.d.ts +11 -13
- package/@types/directive/attrs/attrs.d.ts +2 -2
- package/@types/directive/class/class.d.ts +3 -3
- package/@types/directive/events/events.d.ts +0 -2
- package/@types/directive/http/http.d.ts +4 -22
- package/@types/directive/if/if.d.ts +2 -4
- package/@types/directive/include/include.d.ts +2 -2
- package/@types/directive/inject/inject.d.ts +2 -2
- package/@types/directive/input/input.d.ts +10 -10
- package/@types/directive/messages/messages.d.ts +4 -4
- package/@types/directive/observe/observe.d.ts +2 -5
- package/@types/directive/worker/worker.d.ts +15 -0
- package/@types/interface.d.ts +40 -11
- package/@types/namespace.d.ts +11 -1
- package/@types/ng.d.ts +3 -5
- package/@types/router/directives/view-directive.d.ts +2 -2
- package/@types/router/params/interface.d.ts +0 -25
- package/@types/router/path/path-utils.d.ts +2 -2
- package/@types/router/state/interface.d.ts +0 -9
- package/@types/router/state/state-object.d.ts +6 -6
- package/@types/router/state/state-service.d.ts +3 -3
- package/@types/router/template-factory.d.ts +1 -1
- package/@types/router/transition/hook-builder.d.ts +1 -1
- package/@types/router/transition/interface.d.ts +0 -44
- package/@types/router/transition/transition-hook.d.ts +31 -0
- package/@types/router/transition/transition-service.d.ts +1 -1
- package/@types/router/transition/transition.d.ts +2 -2
- package/@types/services/pubsub/pubsub.d.ts +2 -2
- package/@types/services/sse/interface.d.ts +27 -1
- package/@types/services/sse/sse.d.ts +4 -3
- package/@types/services/worker/interface.d.ts +12 -0
- package/@types/services/worker/worker.d.ts +31 -0
- package/@types/shared/dom.d.ts +4 -5
- package/@types/shared/url-utils/url-utils.d.ts +14 -14
- package/README.md +1 -1
- package/dist/angular-ts.esm.js +1517 -1125
- package/dist/angular-ts.umd.js +1517 -1125
- package/dist/angular-ts.umd.min.js +1 -1
- package/dist/angular.css +1 -1
- package/package.json +1 -2
- package/@types/animations/animate-runner.d.ts +0 -31
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { CompiledExpression } from "../parse/interface.ts";
|
|
2
|
+
import { Scope } from "./scope.js";
|
|
3
|
+
export interface AsyncQueueTask {
|
|
4
|
+
handler: Scope;
|
|
5
|
+
fn: (...args: any[]) => any;
|
|
6
|
+
locals: Record<string, any>;
|
|
7
|
+
}
|
|
8
|
+
export type ListenerFunction = (newValue: any, originalTarget: object) => void;
|
|
9
|
+
export interface Listener {
|
|
10
|
+
originalTarget: object;
|
|
11
|
+
listenerFn: ListenerFunction;
|
|
12
|
+
watchFn: CompiledExpression;
|
|
13
|
+
id: number;
|
|
14
|
+
scopeId: number;
|
|
15
|
+
property: string[];
|
|
16
|
+
watchProp?: string;
|
|
17
|
+
foreignListener?: ProxyConstructor;
|
|
18
|
+
}
|
|
@@ -10,41 +10,21 @@ export function nextId(): number;
|
|
|
10
10
|
*/
|
|
11
11
|
export function createScope(target?: any, context?: Scope): Scope;
|
|
12
12
|
/**
|
|
13
|
-
* @
|
|
14
|
-
* @
|
|
15
|
-
* @property {Function} fn
|
|
16
|
-
* @property {Object} locals
|
|
13
|
+
* @param {any} target
|
|
14
|
+
* @returns {boolean}
|
|
17
15
|
*/
|
|
16
|
+
export function isUnsafeGlobal(target: any): boolean;
|
|
18
17
|
export const $postUpdateQueue: any[];
|
|
19
18
|
export class RootScopeProvider {
|
|
20
19
|
rootScope: Scope;
|
|
21
20
|
$get: (
|
|
22
21
|
| string
|
|
23
22
|
| ((
|
|
24
|
-
exceptionHandler:
|
|
25
|
-
parse:
|
|
23
|
+
exceptionHandler: ng.ExceptionHandlerService,
|
|
24
|
+
parse: ng.ParseService,
|
|
26
25
|
) => Scope)
|
|
27
26
|
)[];
|
|
28
27
|
}
|
|
29
|
-
/**
|
|
30
|
-
* Listener function definition.
|
|
31
|
-
* @typedef {Object} Listener
|
|
32
|
-
* @property {Object} originalTarget - The original target object.
|
|
33
|
-
* @property {ListenerFunction} listenerFn - The function invoked when changes are detected.
|
|
34
|
-
* @property {import("../parse/interface.ts").CompiledExpression} watchFn
|
|
35
|
-
* @property {number} id - Deregistration id
|
|
36
|
-
* @property {number} scopeId - The scope that created the Listener
|
|
37
|
-
* @property {string[]} property
|
|
38
|
-
* @property {string} [watchProp] - The original property to watch if different from observed key
|
|
39
|
-
* @property {Proxy} [foreignListener]
|
|
40
|
-
*
|
|
41
|
-
*/
|
|
42
|
-
/**
|
|
43
|
-
* Listener function type.
|
|
44
|
-
* @callback ListenerFunction
|
|
45
|
-
* @param {*} newValue - The new value of the changed property.
|
|
46
|
-
* @param {Object} originalTarget - The original target object.
|
|
47
|
-
*/
|
|
48
28
|
/**
|
|
49
29
|
* Decorator for excluding objects from scope observability
|
|
50
30
|
*/
|
|
@@ -64,12 +44,12 @@ export class Scope {
|
|
|
64
44
|
*/
|
|
65
45
|
constructor(context?: Scope, parent?: Scope);
|
|
66
46
|
context: Scope;
|
|
67
|
-
/** @type {Map<string, Array<Listener>>} Watch listeners */
|
|
68
|
-
watchers: Map<string, Array<Listener>>;
|
|
47
|
+
/** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners */
|
|
48
|
+
watchers: Map<string, Array<import("./interface.ts").Listener>>;
|
|
69
49
|
/** @type {Map<String, Function[]>} Event listeners */
|
|
70
50
|
$$listeners: Map<string, Function[]>;
|
|
71
|
-
/** @type {Map<string, Array<Listener>>} Watch listeners from other proxies */
|
|
72
|
-
foreignListeners: Map<string, Array<Listener>>;
|
|
51
|
+
/** @type {Map<string, Array<import('./interface.ts').Listener>>} Watch listeners from other proxies */
|
|
52
|
+
foreignListeners: Map<string, Array<import("./interface.ts").Listener>>;
|
|
73
53
|
/** @type {Set<ProxyConstructor>} */
|
|
74
54
|
foreignProxies: Set<ProxyConstructor>;
|
|
75
55
|
/** @type {WeakMap<Object, Array<string>>} */
|
|
@@ -103,12 +83,14 @@ export class Scope {
|
|
|
103
83
|
*/
|
|
104
84
|
$root: Scope;
|
|
105
85
|
$parent: Scope;
|
|
106
|
-
/** @type {AsyncQueueTask[]} */
|
|
107
|
-
$$asyncQueue: AsyncQueueTask[];
|
|
86
|
+
/** @type {import('./interface.ts').AsyncQueueTask[]} */
|
|
87
|
+
$$asyncQueue: import("./interface.ts").AsyncQueueTask[];
|
|
108
88
|
filters: any[];
|
|
109
89
|
/** @type {boolean} */
|
|
110
90
|
$$destroyed: boolean;
|
|
111
91
|
scheduled: any[];
|
|
92
|
+
/** @private */
|
|
93
|
+
private propertyMap;
|
|
112
94
|
/**
|
|
113
95
|
* Intercepts and handles property assignments on the target object. If a new value is
|
|
114
96
|
* an object, it will be recursively proxied.
|
|
@@ -140,56 +122,34 @@ export class Scope {
|
|
|
140
122
|
property: string | number | symbol,
|
|
141
123
|
proxy: ProxyConstructor,
|
|
142
124
|
): any;
|
|
143
|
-
propertyMap: {
|
|
144
|
-
$watch: any;
|
|
145
|
-
$new: any;
|
|
146
|
-
$newIsolate: any;
|
|
147
|
-
$destroy: any;
|
|
148
|
-
$eval: any;
|
|
149
|
-
$apply: any;
|
|
150
|
-
$postUpdate: any;
|
|
151
|
-
$isRoot: any;
|
|
152
|
-
$target: any;
|
|
153
|
-
$proxy: any;
|
|
154
|
-
$on: any;
|
|
155
|
-
$emit: any;
|
|
156
|
-
$broadcast: any;
|
|
157
|
-
$transcluded: any;
|
|
158
|
-
$handler: Scope;
|
|
159
|
-
$parent: Scope;
|
|
160
|
-
$root: Scope;
|
|
161
|
-
$children: Scope[];
|
|
162
|
-
$id: number;
|
|
163
|
-
$merge: any;
|
|
164
|
-
$getById: any;
|
|
165
|
-
};
|
|
166
125
|
deleteProperty(target: any, property: any): boolean;
|
|
167
126
|
/**
|
|
168
127
|
* Registers a watcher for a property along with a listener function. The listener
|
|
169
128
|
* function is invoked when changes to that property are detected.
|
|
170
129
|
*
|
|
171
130
|
* @param {string} watchProp - An expression to be watched in the context of this model.
|
|
172
|
-
* @param {ListenerFunction} [listenerFn] - A function to execute when changes are detected on watched context.
|
|
131
|
+
* @param {import('./interface.ts').ListenerFunction} [listenerFn] - A function to execute when changes are detected on watched context.
|
|
173
132
|
* @param {boolean} [lazy] - A flag to indicate if the listener should be invoked immediately. Defaults to false.
|
|
174
133
|
*/
|
|
175
134
|
$watch(
|
|
176
135
|
watchProp: string,
|
|
177
|
-
listenerFn?: ListenerFunction,
|
|
136
|
+
listenerFn?: import("./interface.ts").ListenerFunction,
|
|
178
137
|
lazy?: boolean,
|
|
179
138
|
): () => void;
|
|
180
139
|
$new(childInstance: any): any;
|
|
181
140
|
$newIsolate(instance: any): any;
|
|
182
141
|
$transcluded(parentInstance: any): any;
|
|
142
|
+
deregisterForeignKey(key: any, id: any): boolean;
|
|
183
143
|
$eval(expr: any, locals: any): any;
|
|
184
144
|
/**
|
|
185
145
|
* @param {Object} newTarget
|
|
186
146
|
*/
|
|
187
147
|
$merge(newTarget: any): void;
|
|
188
148
|
/**
|
|
189
|
-
* @param {import('../../interface.
|
|
149
|
+
* @param {import('../../interface.ts').Expression} expr
|
|
190
150
|
* @returns {any}
|
|
191
151
|
*/
|
|
192
|
-
$apply(expr: import("../../interface.
|
|
152
|
+
$apply(expr: import("../../interface.ts").Expression): any;
|
|
193
153
|
/**
|
|
194
154
|
* @param {string} name
|
|
195
155
|
* @param {Function} listener
|
|
@@ -213,6 +173,7 @@ export class Scope {
|
|
|
213
173
|
*/
|
|
214
174
|
$postUpdate(fn: Function): void;
|
|
215
175
|
$destroy(): void;
|
|
176
|
+
$flushQueue(): void;
|
|
216
177
|
/**
|
|
217
178
|
* Searches the scope instance
|
|
218
179
|
*
|
|
@@ -222,40 +183,3 @@ export class Scope {
|
|
|
222
183
|
$getById(id: string | number): Scope | undefined;
|
|
223
184
|
#private;
|
|
224
185
|
}
|
|
225
|
-
export type AsyncQueueTask = {
|
|
226
|
-
handler: Scope;
|
|
227
|
-
fn: Function;
|
|
228
|
-
locals: any;
|
|
229
|
-
};
|
|
230
|
-
/**
|
|
231
|
-
* Listener function definition.
|
|
232
|
-
*/
|
|
233
|
-
export type Listener = {
|
|
234
|
-
/**
|
|
235
|
-
* - The original target object.
|
|
236
|
-
*/
|
|
237
|
-
originalTarget: any;
|
|
238
|
-
/**
|
|
239
|
-
* - The function invoked when changes are detected.
|
|
240
|
-
*/
|
|
241
|
-
listenerFn: ListenerFunction;
|
|
242
|
-
watchFn: import("../parse/interface.ts").CompiledExpression;
|
|
243
|
-
/**
|
|
244
|
-
* - Deregistration id
|
|
245
|
-
*/
|
|
246
|
-
id: number;
|
|
247
|
-
/**
|
|
248
|
-
* - The scope that created the Listener
|
|
249
|
-
*/
|
|
250
|
-
scopeId: number;
|
|
251
|
-
property: string[];
|
|
252
|
-
/**
|
|
253
|
-
* - The original property to watch if different from observed key
|
|
254
|
-
*/
|
|
255
|
-
watchProp?: string;
|
|
256
|
-
foreignListener?: ProxyConstructor;
|
|
257
|
-
};
|
|
258
|
-
/**
|
|
259
|
-
* Listener function type.
|
|
260
|
-
*/
|
|
261
|
-
export type ListenerFunction = (newValue: any, originalTarget: any) => any;
|
|
@@ -36,21 +36,19 @@ export namespace ngShowAriaDirective {
|
|
|
36
36
|
let $inject_1: string[];
|
|
37
37
|
export { $inject_1 as $inject };
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
39
|
+
/**
|
|
40
|
+
* @return {ng.Directive}
|
|
41
|
+
*/
|
|
42
|
+
export function ngMessagesAriaDirective(): ng.Directive;
|
|
43
|
+
/**
|
|
44
|
+
* @param $aria
|
|
45
|
+
* @param {ng.ParseService} $parse
|
|
46
|
+
* @return {ng.Directive}
|
|
47
|
+
*/
|
|
44
48
|
export function ngClickAriaDirective(
|
|
45
49
|
$aria: any,
|
|
46
|
-
$parse:
|
|
47
|
-
):
|
|
48
|
-
restrict: string;
|
|
49
|
-
compile(
|
|
50
|
-
_elem: any,
|
|
51
|
-
attr: any,
|
|
52
|
-
): (scope: any, elem: Element, attr: any) => void;
|
|
53
|
-
};
|
|
50
|
+
$parse: ng.ParseService,
|
|
51
|
+
): ng.Directive;
|
|
54
52
|
export namespace ngClickAriaDirective {
|
|
55
53
|
let $inject_2: string[];
|
|
56
54
|
export { $inject_2 as $inject };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const REGEX_STRING_REGEXP: RegExp;
|
|
2
2
|
/**
|
|
3
|
-
* @type {Record<string, import("../../interface.
|
|
3
|
+
* @type {Record<string, import("../../interface.ts").DirectiveFactory>}
|
|
4
4
|
*/
|
|
5
5
|
export const ngAttributeAliasDirectives: Record<
|
|
6
6
|
string,
|
|
7
|
-
import("../../interface.
|
|
7
|
+
import("../../interface.ts").DirectiveFactory
|
|
8
8
|
>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const ngClassDirective:
|
|
2
|
-
export const ngClassOddDirective:
|
|
3
|
-
export const ngClassEvenDirective:
|
|
1
|
+
export const ngClassDirective: import("../../interface.ts").DirectiveFactory;
|
|
2
|
+
export const ngClassOddDirective: import("../../interface.ts").DirectiveFactory;
|
|
3
|
+
export const ngClassEvenDirective: import("../../interface.ts").DirectiveFactory;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
*
|
|
3
3
|
* @param {ng.ParseService} $parse
|
|
4
4
|
* @param {ng.ExceptionHandlerService} $exceptionHandler
|
|
5
|
-
* @param {ng.WindowService} $window
|
|
6
5
|
* @param {string} directiveName
|
|
7
6
|
* @param {string} eventName
|
|
8
7
|
* @returns {ng.Directive}
|
|
@@ -10,7 +9,6 @@
|
|
|
10
9
|
export function createEventDirective(
|
|
11
10
|
$parse: ng.ParseService,
|
|
12
11
|
$exceptionHandler: ng.ExceptionHandlerService,
|
|
13
|
-
$window: ng.WindowService,
|
|
14
12
|
directiveName: string,
|
|
15
13
|
eventName: string,
|
|
16
14
|
): ng.Directive;
|
|
@@ -1,29 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {"click" | "change" | "submit"} EventType
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* Selects DOM event to listen for based on the element type.
|
|
6
3
|
*
|
|
7
4
|
* @param {Element} element - The DOM element to inspect.
|
|
8
|
-
* @returns {
|
|
9
|
-
*/
|
|
10
|
-
export function getEventNameForElement(element: Element): EventType;
|
|
11
|
-
/**
|
|
12
|
-
* Handles DOM manipulation based on a swap strategy and server-rendered HTML.
|
|
13
|
-
*
|
|
14
|
-
* @param {string} html - The HTML string returned from the server.
|
|
15
|
-
* @param {import("./interface.ts").SwapModeType} swap
|
|
16
|
-
* @param {Element} target - The target DOM element to apply the swap to.
|
|
17
|
-
* @param {ng.Scope} scope
|
|
18
|
-
* @param {ng.CompileService} $compile
|
|
5
|
+
* @returns {"click" | "change" | "submit"} The name of the event to listen for.
|
|
19
6
|
*/
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
target: Element,
|
|
24
|
-
scope: ng.Scope,
|
|
25
|
-
$compile: ng.CompileService,
|
|
26
|
-
): void;
|
|
7
|
+
export function getEventNameForElement(
|
|
8
|
+
element: Element,
|
|
9
|
+
): "click" | "change" | "submit";
|
|
27
10
|
/**
|
|
28
11
|
* Creates an HTTP directive factory that supports GET, DELETE, POST, PUT.
|
|
29
12
|
*
|
|
@@ -45,4 +28,3 @@ export const ngPostDirective: ng.DirectiveFactory;
|
|
|
45
28
|
export const ngPutDirective: ng.DirectiveFactory;
|
|
46
29
|
/** @type {ng.DirectiveFactory} */
|
|
47
30
|
export const ngSseDirective: ng.DirectiveFactory;
|
|
48
|
-
export type EventType = "click" | "change" | "submit";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {*} $animate
|
|
3
|
-
* @returns {
|
|
3
|
+
* @returns {ng.Directive}
|
|
4
4
|
*/
|
|
5
|
-
export function ngIfDirective(
|
|
6
|
-
$animate: any,
|
|
7
|
-
): import("../../interface.ts").Directive;
|
|
5
|
+
export function ngIfDirective($animate: any): ng.Directive;
|
|
8
6
|
export namespace ngIfDirective {
|
|
9
7
|
let $inject: string[];
|
|
10
8
|
}
|
|
@@ -4,14 +4,14 @@
|
|
|
4
4
|
* @param {import("../../services/anchor-scroll/anchor-scroll.js").AnchorScrollFunction} $anchorScroll
|
|
5
5
|
* @param {*} $animate
|
|
6
6
|
* @param {import('../../services/exception/interface.ts').ErrorHandler} $exceptionHandler
|
|
7
|
-
* @returns {import('../../interface.
|
|
7
|
+
* @returns {import('../../interface.ts').Directive}
|
|
8
8
|
*/
|
|
9
9
|
export function ngIncludeDirective(
|
|
10
10
|
$templateRequest: any,
|
|
11
11
|
$anchorScroll: import("../../services/anchor-scroll/anchor-scroll.js").AnchorScrollFunction,
|
|
12
12
|
$animate: any,
|
|
13
13
|
$exceptionHandler: import("../../services/exception/interface.ts").ErrorHandler,
|
|
14
|
-
): import("../../interface.
|
|
14
|
+
): import("../../interface.ts").Directive;
|
|
15
15
|
export namespace ngIncludeDirective {
|
|
16
16
|
let $inject: string[];
|
|
17
17
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {ng.LogService} $log
|
|
3
3
|
* @param {ng.InjectorService} $injector
|
|
4
|
-
* @returns {
|
|
4
|
+
* @returns {ng.Directive}
|
|
5
5
|
*/
|
|
6
6
|
export function ngInjectDirective(
|
|
7
7
|
$log: ng.LogService,
|
|
8
8
|
$injector: ng.InjectorService,
|
|
9
|
-
):
|
|
9
|
+
): ng.Directive;
|
|
10
10
|
export namespace ngInjectDirective {
|
|
11
11
|
let $inject: string[];
|
|
12
12
|
}
|
|
@@ -45,25 +45,25 @@ export function rangeInputType(
|
|
|
45
45
|
ctrl: any,
|
|
46
46
|
): void;
|
|
47
47
|
/**
|
|
48
|
-
* @param {
|
|
49
|
-
* @param {
|
|
50
|
-
* @returns {
|
|
48
|
+
* @param {ng.FilterService} $filter
|
|
49
|
+
* @param {ng.ParseService} $parse
|
|
50
|
+
* @returns {ng.Directive}
|
|
51
51
|
*/
|
|
52
52
|
export function inputDirective(
|
|
53
|
-
$filter:
|
|
54
|
-
$parse:
|
|
55
|
-
):
|
|
53
|
+
$filter: ng.FilterService,
|
|
54
|
+
$parse: ng.ParseService,
|
|
55
|
+
): ng.Directive;
|
|
56
56
|
export namespace inputDirective {
|
|
57
57
|
let $inject: string[];
|
|
58
58
|
}
|
|
59
59
|
/**
|
|
60
|
-
* @returns {
|
|
60
|
+
* @returns {ng.Directive}
|
|
61
61
|
*/
|
|
62
|
-
export function hiddenInputBrowserCacheDirective():
|
|
62
|
+
export function hiddenInputBrowserCacheDirective(): ng.Directive;
|
|
63
63
|
/**
|
|
64
|
-
* @returns {
|
|
64
|
+
* @returns {ng.Directive}
|
|
65
65
|
*/
|
|
66
|
-
export function ngValueDirective():
|
|
66
|
+
export function ngValueDirective(): ng.Directive;
|
|
67
67
|
export const ISO_DATE_REGEXP: RegExp;
|
|
68
68
|
export const URL_REGEXP: RegExp;
|
|
69
69
|
export const EMAIL_REGEXP: RegExp;
|
|
@@ -20,13 +20,13 @@ export namespace ngMessagesIncludeDirective {
|
|
|
20
20
|
}
|
|
21
21
|
export const ngMessageDirective: (
|
|
22
22
|
any: any,
|
|
23
|
-
) => import("../../interface.
|
|
23
|
+
) => import("../../interface.ts").Directive;
|
|
24
24
|
export const ngMessageExpDirective: (
|
|
25
25
|
any: any,
|
|
26
|
-
) => import("../../interface.
|
|
26
|
+
) => import("../../interface.ts").Directive;
|
|
27
27
|
export const ngMessageDefaultDirective: (
|
|
28
28
|
any: any,
|
|
29
|
-
) => import("../../interface.
|
|
29
|
+
) => import("../../interface.ts").Directive;
|
|
30
30
|
declare class NgMessageCtrl {
|
|
31
31
|
/**
|
|
32
32
|
* @param {Element} $element
|
|
@@ -41,7 +41,7 @@ declare class NgMessageCtrl {
|
|
|
41
41
|
$animate: any,
|
|
42
42
|
);
|
|
43
43
|
$element: Element;
|
|
44
|
-
$scope: import("../../
|
|
44
|
+
$scope: import("../../interface.ts").Scope;
|
|
45
45
|
$attrs: any;
|
|
46
46
|
$animate: any;
|
|
47
47
|
latestKey: number;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @param {string} source - the name of the attribute to be observed
|
|
3
3
|
* @param {string} prop - the scope property to be updated with attribute value
|
|
4
|
-
* @returns {
|
|
4
|
+
* @returns {ng.Directive}
|
|
5
5
|
*/
|
|
6
|
-
export function ngObserveDirective(
|
|
7
|
-
source: string,
|
|
8
|
-
prop: string,
|
|
9
|
-
): import("../../interface.ts").Directive;
|
|
6
|
+
export function ngObserveDirective(source: string, prop: string): ng.Directive;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ngWorker directive factory
|
|
3
|
+
* Usage: <div ng-worker="workerName" data-params="{{ expression }}" data-on-result="callback($result)"></div>
|
|
4
|
+
*/
|
|
5
|
+
export function ngWorkerDirective(
|
|
6
|
+
$worker: any,
|
|
7
|
+
$parse: any,
|
|
8
|
+
$log: any,
|
|
9
|
+
): {
|
|
10
|
+
restrict: string;
|
|
11
|
+
link(scope: any, element: any, attrs: any): void;
|
|
12
|
+
};
|
|
13
|
+
export namespace ngWorkerDirective {
|
|
14
|
+
let $inject: string[];
|
|
15
|
+
}
|
package/@types/interface.d.ts
CHANGED
|
@@ -6,6 +6,9 @@ export * from "./services/location/location.js";
|
|
|
6
6
|
export * from "./services/pubsub/pubsub.js";
|
|
7
7
|
export * from "./services/template-cache/template-cache.js";
|
|
8
8
|
export * from "./index.js";
|
|
9
|
+
export * from "./angular.js";
|
|
10
|
+
export * from "./core/di/internal-injector.js";
|
|
11
|
+
export * from "./core/scope/scope.js";
|
|
9
12
|
import { Attributes } from "./core/compile/attributes.js";
|
|
10
13
|
import { Scope } from "./core/scope/scope.js";
|
|
11
14
|
/**
|
|
@@ -129,7 +132,7 @@ export interface Provider {
|
|
|
129
132
|
*/
|
|
130
133
|
value(name: string, val: any): Provider;
|
|
131
134
|
/**
|
|
132
|
-
* Register a constant value (
|
|
135
|
+
* Register a constant service, such as a string, a number, an array, an object or a function, with the $injector. Unlike value it can be injected into a module configuration function (see config) and it cannot be overridden by an Angular decorator.
|
|
133
136
|
* @param name - The name of the constant.
|
|
134
137
|
* @param val - The constant value.
|
|
135
138
|
*/
|
|
@@ -144,7 +147,9 @@ export interface Provider {
|
|
|
144
147
|
/**
|
|
145
148
|
* A controller constructor function used in AngularTS.
|
|
146
149
|
*/
|
|
147
|
-
export type ControllerConstructor =
|
|
150
|
+
export type ControllerConstructor =
|
|
151
|
+
| (new (...args: any[]) => Controller)
|
|
152
|
+
| ((...args: any[]) => void | Controller);
|
|
148
153
|
/**
|
|
149
154
|
* Describes the changes in component bindings during `$onChanges`.
|
|
150
155
|
*/
|
|
@@ -160,17 +165,41 @@ export interface ChangesObject<T = any> {
|
|
|
160
165
|
export type OnChangesObject = Record<string, ChangesObject>;
|
|
161
166
|
/**
|
|
162
167
|
* AngularTS component lifecycle interface.
|
|
168
|
+
* Directive controllers have a well-defined lifecycle. Each controller can implement "lifecycle hooks". These are methods that
|
|
169
|
+
* will be called by Angular at certain points in the life cycle of the directive.
|
|
170
|
+
* https://docs.angularjs.org/api/ng/service/$compile#life-cycle-hooks
|
|
171
|
+
* https://docs.angularjs.org/guide/component
|
|
163
172
|
*/
|
|
164
173
|
export interface Controller {
|
|
174
|
+
[s: string]: any;
|
|
165
175
|
/** Optional controller name (used in debugging) */
|
|
166
176
|
name?: string;
|
|
167
|
-
/**
|
|
177
|
+
/**
|
|
178
|
+
* Called on each controller after all the controllers on an element have been constructed and had their bindings
|
|
179
|
+
* initialized (and before the pre & post linking functions for the directives on this element). This is a good
|
|
180
|
+
* place to put initialization code for your controller.
|
|
181
|
+
*/
|
|
168
182
|
$onInit?: () => void;
|
|
169
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* Called whenever one-way bindings are updated. The onChangesObj is a hash whose keys are the names of the bound
|
|
185
|
+
* properties that have changed, and the values are an {@link IChangesObject} object of the form
|
|
186
|
+
* { currentValue, previousValue, isFirstChange() }. Use this hook to trigger updates within a component such as
|
|
187
|
+
* cloning the bound value to prevent accidental mutation of the outer value.
|
|
188
|
+
*/
|
|
170
189
|
$onChanges?: (changes: OnChangesObject) => void;
|
|
171
|
-
/**
|
|
190
|
+
/**
|
|
191
|
+
* Called on a controller when its containing scope is destroyed. Use this hook for releasing external resources,
|
|
192
|
+
* watches and event handlers.
|
|
193
|
+
*/
|
|
172
194
|
$onDestroy?: () => void;
|
|
173
|
-
/**
|
|
195
|
+
/**
|
|
196
|
+
* Called after this controller's element and its children have been linked. Similar to the post-link function this
|
|
197
|
+
* hook can be used to set up DOM event handlers and do direct DOM manipulation. Note that child elements that contain
|
|
198
|
+
* templateUrl directives will not have been compiled and linked since they are waiting for their template to load
|
|
199
|
+
* asynchronously and their own compilation and linking has been suspended until that occurs. This hook can be considered
|
|
200
|
+
* analogous to the ngAfterViewInit and ngAfterContentInit hooks in Angular 2. Since the compilation process is rather
|
|
201
|
+
* different in Angular 1 there is no direct mapping and care should be taken when upgrading.
|
|
202
|
+
*/
|
|
174
203
|
$postLink?: () => void;
|
|
175
204
|
}
|
|
176
205
|
/**
|
|
@@ -256,7 +285,7 @@ export interface DirectivePrePost {
|
|
|
256
285
|
export type DirectiveLinkFn = (
|
|
257
286
|
scope: Scope,
|
|
258
287
|
element: HTMLElement,
|
|
259
|
-
attrs: Attributes,
|
|
288
|
+
attrs: Attributes & Record<string, any>,
|
|
260
289
|
controller?: TController,
|
|
261
290
|
transclude?: (...args: any[]) => any,
|
|
262
291
|
) => void;
|
|
@@ -264,9 +293,9 @@ export type DirectiveLinkFn = (
|
|
|
264
293
|
* A compile function used to prepare directives before linking.
|
|
265
294
|
*/
|
|
266
295
|
export type DirectiveCompileFn = (
|
|
267
|
-
templateElement
|
|
268
|
-
templateAttributes
|
|
269
|
-
transclude
|
|
296
|
+
templateElement?: HTMLElement,
|
|
297
|
+
templateAttributes?: Attributes & Record<string, any>,
|
|
298
|
+
transclude?: (...args: any[]) => any,
|
|
270
299
|
) => void | DirectiveLinkFn | DirectivePrePost;
|
|
271
300
|
/**
|
|
272
301
|
* Defines the structure of an AngularTS directive.
|
|
@@ -275,7 +304,7 @@ export type DirectiveCompileFn = (
|
|
|
275
304
|
export interface Directive {
|
|
276
305
|
/** Optional name (usually inferred) */
|
|
277
306
|
name?: string;
|
|
278
|
-
/** Restrict option: 'A' and/or 'E'. Defaults to 'EA' */
|
|
307
|
+
/** Restrict option: 'A' and/or 'E'. Defaults to 'EA' if not defined */
|
|
279
308
|
restrict?: string;
|
|
280
309
|
/** Compile function for the directive */
|
|
281
310
|
compile?: DirectiveCompileFn;
|
package/@types/namespace.d.ts
CHANGED
|
@@ -52,13 +52,19 @@ import {
|
|
|
52
52
|
LinkFnMapping as TLinkFnMapping,
|
|
53
53
|
CompositeLinkFn as TCompositeLinkFn,
|
|
54
54
|
} from "./core/compile/inteface.ts";
|
|
55
|
+
import {
|
|
56
|
+
WorkerConnection as TWorkerConnection,
|
|
57
|
+
WorkerConfig as TWorkerConfig,
|
|
58
|
+
} from "./services/worker/interface.ts";
|
|
59
|
+
import { Provider as TProvideService } from "./interface.ts";
|
|
60
|
+
import { Location as TLocationService } from "./services/location/location.js";
|
|
55
61
|
declare global {
|
|
56
62
|
interface Function {
|
|
57
63
|
$inject?: readonly string[] | undefined;
|
|
58
64
|
}
|
|
59
65
|
export namespace ng {
|
|
60
66
|
type Angular = TAngular;
|
|
61
|
-
type Attributes = TAttributes
|
|
67
|
+
type Attributes = TAttributes & Record<string, any>;
|
|
62
68
|
type Directive = TDirective;
|
|
63
69
|
type DirectiveFactory = TDirectiveFactory;
|
|
64
70
|
type Component = TComponent;
|
|
@@ -88,8 +94,10 @@ declare global {
|
|
|
88
94
|
type HttpService = THttpService;
|
|
89
95
|
type InterpolateService = TInterpolateService;
|
|
90
96
|
type InjectorService = TInjectorService;
|
|
97
|
+
type LocationService = TLocationService;
|
|
91
98
|
type LogService = TLogService;
|
|
92
99
|
type ParseService = TParseService;
|
|
100
|
+
type ProvideService = TProvideService;
|
|
93
101
|
type PubSubService = TPubSub;
|
|
94
102
|
type RootElementService = Element;
|
|
95
103
|
type RootScopeService = TScope;
|
|
@@ -101,5 +109,7 @@ declare global {
|
|
|
101
109
|
type ErrorHandlingConfig = TErrorHandlingConfig;
|
|
102
110
|
type WindowService = Window;
|
|
103
111
|
type DocumentService = Document;
|
|
112
|
+
type WorkerConfig = TWorkerConfig;
|
|
113
|
+
type WorkerConnection = TWorkerConnection;
|
|
104
114
|
}
|
|
105
115
|
}
|
package/@types/ng.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Initializes core `ng` module.
|
|
3
|
-
* @param {
|
|
4
|
-
* @returns {
|
|
3
|
+
* @param {ng.Angular} angular
|
|
4
|
+
* @returns {ng.NgModule} `ng` module
|
|
5
5
|
*/
|
|
6
|
-
export function registerNgModule(
|
|
7
|
-
angular: import("./angular.js").Angular,
|
|
8
|
-
): import("./core/di/ng-module.js").NgModule;
|
|
6
|
+
export function registerNgModule(angular: ng.Angular): ng.NgModule;
|
|
@@ -134,5 +134,5 @@ export namespace $ViewDirectiveFill {
|
|
|
134
134
|
* });
|
|
135
135
|
* ```
|
|
136
136
|
*/
|
|
137
|
-
/** @type {import("../../interface.
|
|
138
|
-
export let ngView: import("../../interface.
|
|
137
|
+
/** @type {import("../../interface.ts").AnnotatedDirectiveFactory} */
|
|
138
|
+
export let ngView: import("../../interface.ts").AnnotatedDirectiveFactory;
|
|
@@ -211,31 +211,6 @@ export interface ParamDeclaration {
|
|
|
211
211
|
* Default: If squash is not set, it uses the configured default squash policy. (See [[defaultSquashPolicy]]())
|
|
212
212
|
*/
|
|
213
213
|
squash?: boolean | string;
|
|
214
|
-
/**
|
|
215
|
-
* @internal
|
|
216
|
-
*
|
|
217
|
-
* An array of [[Replace]] objects.
|
|
218
|
-
*
|
|
219
|
-
* When creating a Transition, defines how to handle certain special values, such as `undefined`, `null`,
|
|
220
|
-
* or empty string `""`. If the transition is started, and the parameter value is equal to one of the "to"
|
|
221
|
-
* values, then the parameter value is replaced with the "from" value.
|
|
222
|
-
*
|
|
223
|
-
* #### Example:
|
|
224
|
-
* ```js
|
|
225
|
-
* replace: [
|
|
226
|
-
* { from: undefined, to: null },
|
|
227
|
-
* { from: "", to: null }
|
|
228
|
-
* ]
|
|
229
|
-
* ```
|
|
230
|
-
*/
|
|
231
|
-
replace?: Replace[];
|
|
232
|
-
/**
|
|
233
|
-
* @internal
|
|
234
|
-
* @internal
|
|
235
|
-
*
|
|
236
|
-
* This is not part of the declaration; it is a calculated value depending on if a default value was specified or not.
|
|
237
|
-
*/
|
|
238
|
-
isOptional?: boolean;
|
|
239
214
|
/**
|
|
240
215
|
* Dynamic flag
|
|
241
216
|
*
|