@angular-wave/angular.ts 0.10.0 → 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 +22 -9
- 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 -3
- package/@types/animations/animate.d.ts +22 -22
- package/@types/animations/animation.d.ts +2 -2
- package/@types/animations/interface.d.ts +12 -0
- package/@types/animations/runner/animate-runner.d.ts +99 -0
- package/@types/core/filter/filter.d.ts +2 -2
- package/@types/core/scope/scope.d.ts +5 -0
- package/@types/directive/class/class.d.ts +3 -3
- 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 +1 -1
- package/@types/interface.d.ts +35 -6
- package/@types/namespace.d.ts +4 -0
- package/@types/ng.d.ts +3 -5
- package/@types/router/params/interface.d.ts +0 -25
- package/@types/router/state/interface.d.ts +0 -9
- package/@types/router/template-factory.d.ts +1 -1
- package/@types/router/transition/interface.d.ts +0 -33
- package/@types/shared/dom.d.ts +4 -5
- package/dist/angular-ts.esm.js +425 -318
- package/dist/angular-ts.umd.js +425 -318
- 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
package/@types/angular.d.ts
CHANGED
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
export class Angular {
|
|
2
2
|
$cache: Map<number, import("./interface.ts").ExpandoStore>;
|
|
3
|
-
/** @type {
|
|
4
|
-
$eventBus:
|
|
3
|
+
/** @type {ng.PubSubService} */
|
|
4
|
+
$eventBus: ng.PubSubService;
|
|
5
5
|
/**
|
|
6
6
|
* @type {string} `version` from `package.json`
|
|
7
7
|
*/
|
|
8
8
|
version: string;
|
|
9
9
|
/** @type {!Array<string|any>} */
|
|
10
10
|
bootsrappedModules: Array<string | any>;
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Gets the controller instance for a given element, if exists. Defaults to "ngControllerController"
|
|
13
|
+
*
|
|
14
|
+
* @type {(element: Element, name: string?) => ng.Scope|undefined}
|
|
15
|
+
*/
|
|
16
|
+
getController: (
|
|
17
|
+
element: Element,
|
|
18
|
+
name: string | null,
|
|
19
|
+
) => ng.Scope | undefined;
|
|
20
|
+
/**
|
|
21
|
+
* Return instance of InjectorService attached to element
|
|
22
|
+
* @type {(Element) => ng.InjectorService}
|
|
23
|
+
*/
|
|
24
|
+
getInjector: (Element: any) => ng.InjectorService;
|
|
25
|
+
/**
|
|
26
|
+
* Gets scope for a given element.
|
|
27
|
+
* @type {(Element) => *}
|
|
28
|
+
*/
|
|
29
|
+
getScope: (Element: any) => any;
|
|
14
30
|
errorHandlingConfig: typeof errorHandlingConfig;
|
|
15
31
|
$t: Readonly<Record<string, string>>;
|
|
16
32
|
/**
|
|
@@ -61,7 +77,7 @@ export class Angular {
|
|
|
61
77
|
modules?: Array<string | any>,
|
|
62
78
|
config?: import("./interface.ts").AngularBootstrapConfig,
|
|
63
79
|
): import("./core/di/internal-injector.js").InjectorService;
|
|
64
|
-
$injector: import("./
|
|
80
|
+
$injector: import("./interface.ts").InjectorService;
|
|
65
81
|
/**
|
|
66
82
|
* @param {any[]} modules
|
|
67
83
|
* @param {boolean?} strictDi
|
|
@@ -128,8 +144,5 @@ export class Angular {
|
|
|
128
144
|
configFn?: import("./interface.ts").Injectable<any>,
|
|
129
145
|
): NgModule;
|
|
130
146
|
}
|
|
131
|
-
import { getController } from "./shared/dom.js";
|
|
132
|
-
import { getInjector } from "./shared/dom.js";
|
|
133
|
-
import { getScope } from "./shared/dom.js";
|
|
134
147
|
import { errorHandlingConfig } from "./shared/utils.js";
|
|
135
148
|
import { NgModule } from "./core/di/ng-module.js";
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
export function AnimateJsDriverProvider($$animationProvider: any): void;
|
|
2
2
|
export class AnimateJsDriverProvider {
|
|
3
3
|
constructor($$animationProvider: any);
|
|
4
|
-
$get: (
|
|
5
|
-
| string
|
|
6
|
-
| ((
|
|
7
|
-
$$animateJs: any,
|
|
8
|
-
$$AnimateRunner: any,
|
|
9
|
-
) => (animationDetails: any) => any)
|
|
10
|
-
)[];
|
|
4
|
+
$get: (string | (($$animateJs: any) => (animationDetails: any) => any))[];
|
|
11
5
|
}
|
|
12
6
|
export namespace AnimateJsDriverProvider {
|
|
13
7
|
let $inject: string[];
|
|
@@ -9,10 +9,9 @@ export class AnimateQueueProvider {
|
|
|
9
9
|
$get: (
|
|
10
10
|
| string
|
|
11
11
|
| ((
|
|
12
|
-
$rootScope:
|
|
13
|
-
$injector:
|
|
12
|
+
$rootScope: ng.RootScopeService,
|
|
13
|
+
$injector: ng.InjectorService,
|
|
14
14
|
$$animation: any,
|
|
15
|
-
$$AnimateRunner: any,
|
|
16
15
|
$templateRequest: any,
|
|
17
16
|
) => {
|
|
18
17
|
on(event: any, container: any, callback: any): void;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
/** @param {
|
|
2
|
-
export function AnimateProvider(
|
|
3
|
-
$provide: import("../interface.ts").Provider,
|
|
4
|
-
): void;
|
|
1
|
+
/** @param {ng.ProvideService} $provide */
|
|
2
|
+
export function AnimateProvider($provide: ng.ProvideService): void;
|
|
5
3
|
export class AnimateProvider {
|
|
6
|
-
/** @param {
|
|
7
|
-
constructor($provide:
|
|
4
|
+
/** @param {ng.ProvideService} $provide */
|
|
5
|
+
constructor($provide: ng.ProvideService);
|
|
8
6
|
$$registeredAnimations: any;
|
|
9
7
|
/**
|
|
10
8
|
* Registers a new injectable animation factory function. The factory function produces the
|
|
@@ -218,7 +216,7 @@ export class AnimateProvider {
|
|
|
218
216
|
* Note that this does not cancel the underlying operation, e.g. the setting of classes or
|
|
219
217
|
* adding the element to the DOM.
|
|
220
218
|
*
|
|
221
|
-
* @param {import('./animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
|
|
219
|
+
* @param {import('./runner/animate-runner.js').AnimateRunner} runner An animation runner returned by an $animate function.
|
|
222
220
|
*
|
|
223
221
|
* @example
|
|
224
222
|
<example module="animationExample" deps="angular-animate.js" animations="true" name="animate-cancel">
|
|
@@ -282,7 +280,9 @@ export class AnimateProvider {
|
|
|
282
280
|
</file>
|
|
283
281
|
</example>
|
|
284
282
|
*/
|
|
285
|
-
cancel(
|
|
283
|
+
cancel(
|
|
284
|
+
runner: import("./runner/animate-runner.js").AnimateRunner,
|
|
285
|
+
): void;
|
|
286
286
|
/**
|
|
287
287
|
* Inserts the element into the DOM either after the `after` element (if provided) or
|
|
288
288
|
* as the first child within the `parent` element and then triggers an animation.
|
|
@@ -293,14 +293,14 @@ export class AnimateProvider {
|
|
|
293
293
|
* @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
|
|
294
294
|
* @param {Element} [after] - after the sibling element after which the element will be appended
|
|
295
295
|
* @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
|
|
296
|
-
* @returns {import('./animate-runner.js').AnimateRunner} the animation runner
|
|
296
|
+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
|
|
297
297
|
*/
|
|
298
298
|
enter(
|
|
299
299
|
element: Element,
|
|
300
300
|
parent: Element,
|
|
301
301
|
after?: Element,
|
|
302
302
|
options?: AnimationOptions,
|
|
303
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
303
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
304
304
|
/**
|
|
305
305
|
* Inserts (moves) the element into its new position in the DOM either after
|
|
306
306
|
* the `after` element (if provided) or as the first child within the `parent` element
|
|
@@ -311,14 +311,14 @@ export class AnimateProvider {
|
|
|
311
311
|
* @param {Element} parent - the parent element which will append the element as a child (so long as the after element is not present)
|
|
312
312
|
* @param {Element} after - after the sibling element after which the element will be appended
|
|
313
313
|
* @param {AnimationOptions} [options] - an optional collection of options/styles that will be applied to the element.
|
|
314
|
-
* @returns {import('./animate-runner.js').AnimateRunner} the animation runner
|
|
314
|
+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
|
|
315
315
|
*/
|
|
316
316
|
move(
|
|
317
317
|
element: Element,
|
|
318
318
|
parent: Element,
|
|
319
319
|
after: Element,
|
|
320
320
|
options?: AnimationOptions,
|
|
321
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
321
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
322
322
|
/**
|
|
323
323
|
* Triggers an animation and then removes the element from the DOM.
|
|
324
324
|
* When the function is called a promise is returned that will be resolved during the next
|
|
@@ -326,12 +326,12 @@ export class AnimateProvider {
|
|
|
326
326
|
*
|
|
327
327
|
* @param {Element} element the element which will be removed from the DOM
|
|
328
328
|
* @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
|
|
329
|
-
* @returns {import('./animate-runner.js').AnimateRunner} the animation runner
|
|
329
|
+
* @returns {import('./runner/animate-runner.js').AnimateRunner} the animation runner
|
|
330
330
|
*/
|
|
331
331
|
leave(
|
|
332
332
|
element: Element,
|
|
333
333
|
options?: AnimationOptions,
|
|
334
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
334
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
335
335
|
/**
|
|
336
336
|
* Triggers an addClass animation surrounding the addition of the provided CSS class(es). Upon
|
|
337
337
|
* execution, the addClass operation will only be handled after the next digest and it will not trigger an
|
|
@@ -343,13 +343,13 @@ export class AnimateProvider {
|
|
|
343
343
|
* @param {Element} element the element which the CSS classes will be applied to
|
|
344
344
|
* @param {string} className the CSS class(es) that will be added (multiple classes are separated via spaces)
|
|
345
345
|
* @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element.
|
|
346
|
-
* @return {import('./animate-runner.js').AnimateRunner}} animationRunner the animation runner
|
|
346
|
+
* @return {import('./runner/animate-runner.js').AnimateRunner}} animationRunner the animation runner
|
|
347
347
|
*/
|
|
348
348
|
addClass(
|
|
349
349
|
element: Element,
|
|
350
350
|
className: string,
|
|
351
351
|
options?: AnimationOptions,
|
|
352
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
352
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
353
353
|
/**
|
|
354
354
|
* Triggers a removeClass animation surrounding the removal of the provided CSS class(es). Upon
|
|
355
355
|
* execution, the removeClass operation will only be handled after the next digest and it will not trigger an
|
|
@@ -361,13 +361,13 @@ export class AnimateProvider {
|
|
|
361
361
|
* @param {Element} element the element which the CSS classes will be applied to
|
|
362
362
|
* @param {string} className the CSS class(es) that will be removed (multiple classes are separated via spaces)
|
|
363
363
|
* @param {AnimationOptions} [options] an optional collection of options/styles that will be applied to the element. *
|
|
364
|
-
* @return {import('./animate-runner.js').AnimateRunner} animationRunner the animation runner
|
|
364
|
+
* @return {import('./runner/animate-runner.js').AnimateRunner} animationRunner the animation runner
|
|
365
365
|
*/
|
|
366
366
|
removeClass(
|
|
367
367
|
element: Element,
|
|
368
368
|
className: string,
|
|
369
369
|
options?: AnimationOptions,
|
|
370
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
370
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
371
371
|
/**
|
|
372
372
|
* Performs both the addition and removal of a CSS classes on an element and (during the process)
|
|
373
373
|
* triggers an animation surrounding the class addition/removal. Much like `$animate.addClass` and
|
|
@@ -381,14 +381,14 @@ export class AnimateProvider {
|
|
|
381
381
|
* @param {string} remove the CSS class(es) that will be removed (multiple classes are separated via spaces)
|
|
382
382
|
* @param {object=} options an optional collection of options/styles that will be applied to the element.
|
|
383
383
|
*
|
|
384
|
-
* @return {import('./animate-runner.js').AnimateRunner} the animation runner
|
|
384
|
+
* @return {import('./runner/animate-runner.js').AnimateRunner} the animation runner
|
|
385
385
|
*/
|
|
386
386
|
setClass(
|
|
387
387
|
element: Element,
|
|
388
388
|
add: string,
|
|
389
389
|
remove: string,
|
|
390
390
|
options?: object | undefined,
|
|
391
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
391
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
392
392
|
/**
|
|
393
393
|
* Performs an inline animation on the element which applies the provided to and from CSS styles to the element.
|
|
394
394
|
* If any detected CSS transition, keyframe or JavaScript matches the provided className value, then the animation will take
|
|
@@ -408,7 +408,7 @@ export class AnimateProvider {
|
|
|
408
408
|
* }
|
|
409
409
|
* });
|
|
410
410
|
* ```
|
|
411
|
-
* @return {import('./animate-runner.js').AnimateRunner} the animation runner
|
|
411
|
+
* @return {import('./runner/animate-runner.js').AnimateRunner} the animation runner
|
|
412
412
|
*/
|
|
413
413
|
animate(
|
|
414
414
|
element: any,
|
|
@@ -416,7 +416,7 @@ export class AnimateProvider {
|
|
|
416
416
|
to: any,
|
|
417
417
|
className: any,
|
|
418
418
|
options: any,
|
|
419
|
-
): import("./animate-runner.js").AnimateRunner;
|
|
419
|
+
): import("./runner/animate-runner.js").AnimateRunner;
|
|
420
420
|
})
|
|
421
421
|
)[];
|
|
422
422
|
}
|
|
@@ -6,9 +6,9 @@ export class AnimationProvider {
|
|
|
6
6
|
| ((
|
|
7
7
|
$rootScope: ng.RootScopeService,
|
|
8
8
|
$injector: any,
|
|
9
|
-
$$AnimateRunner: any,
|
|
10
9
|
$$rAFScheduler: any,
|
|
11
10
|
$$animateCache: any,
|
|
12
|
-
) => (element: any, event: any, options: any) =>
|
|
11
|
+
) => (element: any, event: any, options: any) => AnimateRunner)
|
|
13
12
|
)[];
|
|
14
13
|
}
|
|
14
|
+
import { AnimateRunner } from "./runner/animate-runner.js";
|
|
@@ -15,3 +15,15 @@ export type RafScheduler = {
|
|
|
15
15
|
*/
|
|
16
16
|
waitUntilQuiet(fn: () => void): void;
|
|
17
17
|
};
|
|
18
|
+
export interface AnimationHost {
|
|
19
|
+
/** Pause animation. */
|
|
20
|
+
pause?: () => void;
|
|
21
|
+
/** Resume animation. */
|
|
22
|
+
resume?: () => void;
|
|
23
|
+
/** End animation. */
|
|
24
|
+
end?: () => void;
|
|
25
|
+
/** Cancel animation. */
|
|
26
|
+
cancel?: () => void;
|
|
27
|
+
/** Report animation progress. */
|
|
28
|
+
progress?: (...args: any[]) => void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Schedule a callback to run on the next animation frame.
|
|
3
|
+
* Multiple calls within the same frame are batched together.
|
|
4
|
+
*
|
|
5
|
+
* @param {VoidFunction} fn - The callback to execute.
|
|
6
|
+
*/
|
|
7
|
+
export function schedule(fn: VoidFunction): void;
|
|
8
|
+
/**
|
|
9
|
+
* Represents an asynchronous animation operation.
|
|
10
|
+
* Provides both callback-based and promise-based completion APIs.
|
|
11
|
+
*/
|
|
12
|
+
export class AnimateRunner {
|
|
13
|
+
/**
|
|
14
|
+
* Run an array of animation runners in sequence.
|
|
15
|
+
* Each runner waits for the previous one to complete.
|
|
16
|
+
*
|
|
17
|
+
* @param {AnimateRunner[]} runners - Runners to execute in order.
|
|
18
|
+
* @param {(ok: boolean) => void} callback - Invoked when all complete or one fails.
|
|
19
|
+
*/
|
|
20
|
+
static chain(runners: AnimateRunner[], callback: (ok: boolean) => void): void;
|
|
21
|
+
/**
|
|
22
|
+
* Waits for all animation runners to complete before invoking the callback.
|
|
23
|
+
*
|
|
24
|
+
* @param {AnimateRunner[]} runners - Active runners to wait for.
|
|
25
|
+
* @param {(ok: boolean) => void} callback - Called when all runners complete.
|
|
26
|
+
*/
|
|
27
|
+
static all(runners: AnimateRunner[], callback: (ok: boolean) => void): void;
|
|
28
|
+
/**
|
|
29
|
+
* @param {import("../interface.ts").AnimationHost} [host] - Optional animation host.
|
|
30
|
+
*/
|
|
31
|
+
constructor(host?: import("../interface.ts").AnimationHost);
|
|
32
|
+
/** @type {import("../interface.ts").AnimationHost} */
|
|
33
|
+
host: import("../interface.ts").AnimationHost;
|
|
34
|
+
/** @type {Array<(ok: boolean) => void>} */
|
|
35
|
+
_doneCallbacks: Array<(ok: boolean) => void>;
|
|
36
|
+
/** @type {RunnerState} */
|
|
37
|
+
_state: RunnerState;
|
|
38
|
+
/** @type {Promise<void>|null} */
|
|
39
|
+
_promise: Promise<void> | null;
|
|
40
|
+
/** @type {(fn: VoidFunction) => void} */
|
|
41
|
+
_schedule: (fn: VoidFunction) => void;
|
|
42
|
+
/**
|
|
43
|
+
* Sets or updates the animation host.
|
|
44
|
+
* @param {import("../interface.ts").AnimationHost} host - The host object.
|
|
45
|
+
*/
|
|
46
|
+
setHost(host: import("../interface.ts").AnimationHost): void;
|
|
47
|
+
/**
|
|
48
|
+
* Registers a callback to be called once the animation completes.
|
|
49
|
+
* If the animation is already complete, it's called immediately.
|
|
50
|
+
*
|
|
51
|
+
* @param {(ok: boolean) => void} fn - Completion callback.
|
|
52
|
+
*/
|
|
53
|
+
done(fn: (ok: boolean) => void): void;
|
|
54
|
+
/**
|
|
55
|
+
* Notifies the host of animation progress.
|
|
56
|
+
* @param {...any} args - Progress arguments.
|
|
57
|
+
*/
|
|
58
|
+
progress(...args: any[]): void;
|
|
59
|
+
/** Pauses the animation, if supported by the host. */
|
|
60
|
+
pause(): void;
|
|
61
|
+
/** Resumes the animation, if supported by the host. */
|
|
62
|
+
resume(): void;
|
|
63
|
+
/** Ends the animation successfully. */
|
|
64
|
+
end(): void;
|
|
65
|
+
/** Cancels the animation. */
|
|
66
|
+
cancel(): void;
|
|
67
|
+
/**
|
|
68
|
+
* Marks the animation as complete on the next animation frame.
|
|
69
|
+
* @param {boolean} [status=true] - True if successful, false if canceled.
|
|
70
|
+
*/
|
|
71
|
+
complete(status?: boolean): void;
|
|
72
|
+
/**
|
|
73
|
+
* Returns a promise that resolves or rejects when the animation completes.
|
|
74
|
+
* @returns {Promise<void>} Promise resolved on success or rejected on cancel.
|
|
75
|
+
*/
|
|
76
|
+
getPromise(): Promise<void>;
|
|
77
|
+
/** @inheritdoc */
|
|
78
|
+
then(onFulfilled: any, onRejected: any): Promise<void>;
|
|
79
|
+
/** @inheritdoc */
|
|
80
|
+
catch(onRejected: any): Promise<void>;
|
|
81
|
+
/** @inheritdoc */
|
|
82
|
+
finally(onFinally: any): Promise<void>;
|
|
83
|
+
/**
|
|
84
|
+
* Completes the animation and invokes all done callbacks.
|
|
85
|
+
* @private
|
|
86
|
+
* @param {boolean} status - True if completed successfully, false if canceled.
|
|
87
|
+
*/
|
|
88
|
+
private _finish;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Internal runner states.
|
|
92
|
+
*/
|
|
93
|
+
type RunnerState = number;
|
|
94
|
+
declare namespace RunnerState {
|
|
95
|
+
let INITIAL: number;
|
|
96
|
+
let PENDING: number;
|
|
97
|
+
let DONE: number;
|
|
98
|
+
}
|
|
99
|
+
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export class FilterProvider {
|
|
2
2
|
static $inject: string[];
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {ng.ProvideService} $provide
|
|
5
5
|
*/
|
|
6
|
-
constructor($provide:
|
|
6
|
+
constructor($provide: ng.ProvideService);
|
|
7
7
|
$provide: import("../../interface.ts").Provider;
|
|
8
8
|
/**
|
|
9
9
|
* @param {string|Record<string, ng.FilterFn>} name
|
|
@@ -9,6 +9,11 @@ export function nextId(): number;
|
|
|
9
9
|
* or the original value if the target is not an object.
|
|
10
10
|
*/
|
|
11
11
|
export function createScope(target?: any, context?: Scope): Scope;
|
|
12
|
+
/**
|
|
13
|
+
* @param {any} target
|
|
14
|
+
* @returns {boolean}
|
|
15
|
+
*/
|
|
16
|
+
export function isUnsafeGlobal(target: any): boolean;
|
|
12
17
|
export const $postUpdateQueue: any[];
|
|
13
18
|
export class RootScopeProvider {
|
|
14
19
|
rootScope: Scope;
|
|
@@ -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;
|
|
@@ -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;
|
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
|
/**
|
package/@types/namespace.d.ts
CHANGED
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
WorkerConnection as TWorkerConnection,
|
|
57
57
|
WorkerConfig as TWorkerConfig,
|
|
58
58
|
} from "./services/worker/interface.ts";
|
|
59
|
+
import { Provider as TProvideService } from "./interface.ts";
|
|
60
|
+
import { Location as TLocationService } from "./services/location/location.js";
|
|
59
61
|
declare global {
|
|
60
62
|
interface Function {
|
|
61
63
|
$inject?: readonly string[] | undefined;
|
|
@@ -92,8 +94,10 @@ declare global {
|
|
|
92
94
|
type HttpService = THttpService;
|
|
93
95
|
type InterpolateService = TInterpolateService;
|
|
94
96
|
type InjectorService = TInjectorService;
|
|
97
|
+
type LocationService = TLocationService;
|
|
95
98
|
type LogService = TLogService;
|
|
96
99
|
type ParseService = TParseService;
|
|
100
|
+
type ProvideService = TProvideService;
|
|
97
101
|
type PubSubService = TPubSub;
|
|
98
102
|
type RootElementService = Element;
|
|
99
103
|
type RootScopeService = TScope;
|
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;
|
|
@@ -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
|
*
|
|
@@ -385,15 +385,6 @@ export interface StateDeclaration {
|
|
|
385
385
|
* ```
|
|
386
386
|
*/
|
|
387
387
|
parent?: string | StateDeclaration;
|
|
388
|
-
/**
|
|
389
|
-
* Gets the internal State object API
|
|
390
|
-
*
|
|
391
|
-
* Gets the *internal API* for a registered state.
|
|
392
|
-
*
|
|
393
|
-
* Note: the internal [[StateObject]] API is subject to change without notice
|
|
394
|
-
* @internal
|
|
395
|
-
*/
|
|
396
|
-
$$state?: () => StateObject;
|
|
397
388
|
/**
|
|
398
389
|
* Resolve - a mechanism to asynchronously fetch data, participating in the Transition lifecycle
|
|
399
390
|
*
|
|
@@ -21,7 +21,7 @@ export class TemplateFactoryProvider {
|
|
|
21
21
|
$templateRequest: any;
|
|
22
22
|
$http: import("../interface.ts").HttpService;
|
|
23
23
|
$templateCache: ng.TemplateCacheService;
|
|
24
|
-
$injector: import("../
|
|
24
|
+
$injector: import("../interface.ts").InjectorService;
|
|
25
25
|
/**
|
|
26
26
|
* Forces the provider to use $http service directly
|
|
27
27
|
* @param {boolean} value
|