@angular-wave/angular.ts 0.0.20 → 0.0.22
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/Makefile +1 -1
- package/README.md +3 -3
- package/TODO.md +14 -0
- package/dist/angular-ts.esm.js +1 -1
- package/dist/angular-ts.umd.js +1 -1
- package/index.html +2 -1
- package/package.json +1 -1
- package/src/animations/animate-css-driver.js +2 -2
- package/src/animations/animate-css.js +15 -6
- package/src/animations/animate-js.js +1 -1
- package/src/animations/animate-queue.js +1 -1
- package/src/animations/shared.js +0 -14
- package/src/core/compile.js +6 -3
- package/src/core/q.js +9 -9
- package/src/core/sanitize-uri.js +1 -1
- package/src/core/sce.js +1 -1
- package/src/directive/if.js +0 -79
- package/src/directive/if.md +80 -0
- package/src/directive/include.js +0 -82
- package/src/directive/include.md +86 -0
- package/src/directive/repeat.js +0 -1
- package/src/loader.js +0 -1
- package/src/public.js +0 -2
- package/src/router/common/trace.js +1 -1
- package/src/router/directives/stateDirectives.js +16 -14
- package/src/router/directives/viewDirective.js +2 -2
- package/src/router/hooks/resolve.js +3 -4
- package/src/router/hooks/views.js +3 -2
- package/src/router/state/stateService.js +1 -2
- package/src/router/transition/interface.js +14 -14
- package/src/router/transition/rejectFactory.js +29 -20
- package/src/router/transition/transitionHook.js +5 -5
- package/src/router/url/urlMatcher.js +1 -2
- package/src/router/url/urlRule.js +1 -1
- package/src/router/url/urlRules.js +1 -1
- package/src/shared/common.js +0 -1
- package/test/module-test.html +44 -12
- package/test/router/services.spec.js +71 -0
- package/test/router/state-directives.spec.js +1208 -0
- package/types/angular.d.ts +132 -124
- package/types/index.d.ts +2350 -2187
- package/types/jqlite.d.ts +463 -418
- package/types/router/core/common/common.d.ts +70 -24
- package/types/router/core/common/coreservices.d.ts +30 -32
- package/types/router/core/common/glob.d.ts +9 -9
- package/types/router/core/common/hof.d.ts +12 -4
- package/types/router/core/common/index.d.ts +8 -8
- package/types/router/core/common/predicates.d.ts +1 -1
- package/types/router/core/common/queue.d.ts +13 -13
- package/types/router/core/common/safeConsole.d.ts +3 -3
- package/types/router/core/common/strings.d.ts +4 -2
- package/types/router/core/common/trace.d.ts +94 -82
- package/types/router/core/globals.d.ts +37 -37
- package/types/router/core/hooks/coreResolvables.d.ts +5 -3
- package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
- package/types/router/core/hooks/invalidTransition.d.ts +4 -2
- package/types/router/core/hooks/lazyLoad.d.ts +10 -5
- package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
- package/types/router/core/hooks/redirectTo.d.ts +4 -2
- package/types/router/core/hooks/resolve.d.ts +10 -4
- package/types/router/core/hooks/updateGlobals.d.ts +4 -2
- package/types/router/core/hooks/url.d.ts +4 -2
- package/types/router/core/hooks/views.d.ts +7 -3
- package/types/router/core/index.d.ts +11 -12
- package/types/router/core/interface.d.ts +83 -81
- package/types/router/core/params/index.d.ts +5 -5
- package/types/router/core/params/interface.d.ts +439 -439
- package/types/router/core/params/param.d.ts +72 -60
- package/types/router/core/params/paramType.d.ts +40 -40
- package/types/router/core/params/paramTypes.d.ts +169 -165
- package/types/router/core/params/stateParams.d.ts +13 -13
- package/types/router/core/path/index.d.ts +2 -2
- package/types/router/core/path/pathNode.d.ts +49 -49
- package/types/router/core/path/pathUtils.d.ts +100 -74
- package/types/router/core/resolve/index.d.ts +3 -3
- package/types/router/core/resolve/interface.d.ts +137 -137
- package/types/router/core/resolve/resolvable.d.ts +60 -54
- package/types/router/core/resolve/resolveContext.d.ts +84 -79
- package/types/router/core/router.d.ts +95 -86
- package/types/router/core/state/index.d.ts +8 -8
- package/types/router/core/state/interface.d.ts +667 -643
- package/types/router/core/state/stateBuilder.d.ts +41 -38
- package/types/router/core/state/stateMatcher.d.ts +11 -9
- package/types/router/core/state/stateObject.d.ts +154 -139
- package/types/router/core/state/stateQueueManager.d.ts +26 -21
- package/types/router/core/state/stateRegistry.d.ts +124 -121
- package/types/router/core/state/stateService.d.ts +380 -343
- package/types/router/core/state/targetState.d.ts +74 -69
- package/types/router/core/transition/hookBuilder.d.ts +34 -30
- package/types/router/core/transition/hookRegistry.d.ts +96 -74
- package/types/router/core/transition/index.d.ts +8 -8
- package/types/router/core/transition/interface.d.ts +652 -609
- package/types/router/core/transition/rejectFactory.d.ts +97 -97
- package/types/router/core/transition/transition.d.ts +565 -517
- package/types/router/core/transition/transitionEventType.d.ts +20 -11
- package/types/router/core/transition/transitionHook.d.ts +90 -82
- package/types/router/core/transition/transitionService.d.ts +228 -161
- package/types/router/core/url/index.d.ts +8 -8
- package/types/router/core/url/interface.d.ts +100 -87
- package/types/router/core/url/urlConfig.d.ts +130 -126
- package/types/router/core/url/urlMatcher.d.ts +132 -127
- package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
- package/types/router/core/url/urlRouter.d.ts +91 -75
- package/types/router/core/url/urlRule.d.ts +123 -100
- package/types/router/core/url/urlRules.d.ts +240 -232
- package/types/router/core/url/urlService.d.ts +201 -201
- package/types/router/core/view/index.d.ts +2 -2
- package/types/router/core/view/interface.d.ts +26 -26
- package/types/router/core/view/view.d.ts +152 -143
- package/types/router/directives/viewDirective.d.ts +12 -11
- package/types/router/index.d.ts +11 -12
- package/types/router/interface.d.ts +361 -351
- package/types/router/legacy/resolveService.d.ts +44 -40
- package/types/router/legacy/stateEvents.d.ts +1 -1
- package/types/router/locationServices.d.ts +45 -37
- package/types/router/services.d.ts +9 -9
- package/types/router/stateFilters.d.ts +3 -3
- package/types/router/stateProvider.d.ts +240 -235
- package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
- package/types/router/statebuilders/views.d.ts +35 -22
- package/types/router/templateFactory.d.ts +99 -79
- package/types/router/viewScroll.d.ts +7 -7
- package/src/directive/a.js +0 -37
- package/test/directive/a.spec.js +0 -192
- package/types/router/angular.d.ts +0 -1
- package/types/router/core/vanilla.d.ts +0 -1
- package/types/router/directives/stateDirectives.d.ts +0 -3
- package/types/router/injectables.d.ts +0 -1
|
@@ -1,17 +1,26 @@
|
|
|
1
|
-
import { TransitionHookPhase, PathType } from
|
|
2
|
-
import { GetErrorHandler, GetResultHandler } from
|
|
1
|
+
import { TransitionHookPhase, PathType } from "./interface";
|
|
2
|
+
import { GetErrorHandler, GetResultHandler } from "./transitionHook";
|
|
3
3
|
/**
|
|
4
4
|
* This class defines a type of hook, such as `onBefore` or `onEnter`.
|
|
5
5
|
* Plugins can define custom hook types, such as sticky states does for `onInactive`.
|
|
6
6
|
*/
|
|
7
7
|
export declare class TransitionEventType {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
name: string;
|
|
9
|
+
hookPhase: TransitionHookPhase;
|
|
10
|
+
hookOrder: number;
|
|
11
|
+
criteriaMatchPath: PathType;
|
|
12
|
+
reverseSort: boolean;
|
|
13
|
+
getResultHandler: GetResultHandler;
|
|
14
|
+
getErrorHandler: GetErrorHandler;
|
|
15
|
+
synchronous: boolean;
|
|
16
|
+
constructor(
|
|
17
|
+
name: string,
|
|
18
|
+
hookPhase: TransitionHookPhase,
|
|
19
|
+
hookOrder: number,
|
|
20
|
+
criteriaMatchPath: PathType,
|
|
21
|
+
reverseSort?: boolean,
|
|
22
|
+
getResultHandler?: GetResultHandler,
|
|
23
|
+
getErrorHandler?: GetErrorHandler,
|
|
24
|
+
synchronous?: boolean,
|
|
25
|
+
);
|
|
17
26
|
}
|
|
@@ -1,88 +1,96 @@
|
|
|
1
|
-
import { TransitionHookOptions, HookResult } from
|
|
2
|
-
import { Transition } from
|
|
3
|
-
import { TransitionEventType } from
|
|
4
|
-
import { RegisteredHook } from
|
|
5
|
-
import { StateDeclaration } from
|
|
1
|
+
import { TransitionHookOptions, HookResult } from "./interface";
|
|
2
|
+
import { Transition } from "./transition";
|
|
3
|
+
import { TransitionEventType } from "./transitionEventType";
|
|
4
|
+
import { RegisteredHook } from "./hookRegistry";
|
|
5
|
+
import { StateDeclaration } from "../state/interface";
|
|
6
6
|
export declare type GetResultHandler = (hook: TransitionHook) => ResultHandler;
|
|
7
7
|
export declare type GetErrorHandler = (hook: TransitionHook) => ErrorHandler;
|
|
8
8
|
export declare type ResultHandler = (result: HookResult) => Promise<HookResult>;
|
|
9
9
|
export declare type ErrorHandler = (error: any) => Promise<any>;
|
|
10
10
|
export declare class TransitionHook {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
11
|
+
private transition;
|
|
12
|
+
private stateContext;
|
|
13
|
+
private registeredHook;
|
|
14
|
+
private options;
|
|
15
|
+
type: TransitionEventType;
|
|
16
|
+
/**
|
|
17
|
+
* These GetResultHandler(s) are used by [[invokeHook]] below
|
|
18
|
+
* Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
|
|
19
|
+
*/
|
|
20
|
+
static HANDLE_RESULT: GetResultHandler;
|
|
21
|
+
/**
|
|
22
|
+
* If the result is a promise rejection, log it.
|
|
23
|
+
* Otherwise, ignore the result.
|
|
24
|
+
*/
|
|
25
|
+
static LOG_REJECTED_RESULT: GetResultHandler;
|
|
26
|
+
/**
|
|
27
|
+
* These GetErrorHandler(s) are used by [[invokeHook]] below
|
|
28
|
+
* Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
|
|
29
|
+
*/
|
|
30
|
+
static LOG_ERROR: GetErrorHandler;
|
|
31
|
+
static REJECT_ERROR: GetErrorHandler;
|
|
32
|
+
static THROW_ERROR: GetErrorHandler;
|
|
33
|
+
/**
|
|
34
|
+
* Chains together an array of TransitionHooks.
|
|
35
|
+
*
|
|
36
|
+
* Given a list of [[TransitionHook]] objects, chains them together.
|
|
37
|
+
* Each hook is invoked after the previous one completes.
|
|
38
|
+
*
|
|
39
|
+
* #### Example:
|
|
40
|
+
* ```js
|
|
41
|
+
* var hooks: TransitionHook[] = getHooks();
|
|
42
|
+
* let promise: Promise<any> = TransitionHook.chain(hooks);
|
|
43
|
+
*
|
|
44
|
+
* promise.then(handleSuccess, handleError);
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @param hooks the list of hooks to chain together
|
|
48
|
+
* @param waitFor if provided, the chain is `.then()`'ed off this promise
|
|
49
|
+
* @returns a `Promise` for sequentially invoking the hooks (in order)
|
|
50
|
+
*/
|
|
51
|
+
static chain(hooks: TransitionHook[], waitFor?: Promise<any>): Promise<any>;
|
|
52
|
+
/**
|
|
53
|
+
* Invokes all the provided TransitionHooks, in order.
|
|
54
|
+
* Each hook's return value is checked.
|
|
55
|
+
* If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.
|
|
56
|
+
* If no hook returns a promise, then all hooks are processed synchronously.
|
|
57
|
+
*
|
|
58
|
+
* @param hooks the list of TransitionHooks to invoke
|
|
59
|
+
* @param doneCallback a callback that is invoked after all the hooks have successfully completed
|
|
60
|
+
*
|
|
61
|
+
* @returns a promise for the async result, or the result of the callback
|
|
62
|
+
*/
|
|
63
|
+
static invokeHooks<T>(
|
|
64
|
+
hooks: TransitionHook[],
|
|
65
|
+
doneCallback: (result?: HookResult) => T,
|
|
66
|
+
): Promise<any> | T;
|
|
67
|
+
/**
|
|
68
|
+
* Run all TransitionHooks, ignoring their return value.
|
|
69
|
+
*/
|
|
70
|
+
static runAllHooks(hooks: TransitionHook[]): void;
|
|
71
|
+
constructor(
|
|
72
|
+
transition: Transition,
|
|
73
|
+
stateContext: StateDeclaration,
|
|
74
|
+
registeredHook: RegisteredHook,
|
|
75
|
+
options: TransitionHookOptions,
|
|
76
|
+
);
|
|
77
|
+
private isSuperseded;
|
|
78
|
+
logError(err: any): any;
|
|
79
|
+
invokeHook(): Promise<HookResult> | void;
|
|
80
|
+
/**
|
|
81
|
+
* This method handles the return value of a Transition Hook.
|
|
82
|
+
*
|
|
83
|
+
* A hook can return false (cancel), a TargetState (redirect),
|
|
84
|
+
* or a promise (which may later resolve to false or a redirect)
|
|
85
|
+
*
|
|
86
|
+
* This also handles "transition superseded" -- when a new transition
|
|
87
|
+
* was started while the hook was still running
|
|
88
|
+
*/
|
|
89
|
+
handleHookResult(result: HookResult): Promise<HookResult>;
|
|
90
|
+
/**
|
|
91
|
+
* Return a Rejection promise if the transition is no longer current due
|
|
92
|
+
* to a stopped router (disposed), or a new transition has started and superseded this one.
|
|
93
|
+
*/
|
|
94
|
+
private getNotCurrentRejection;
|
|
95
|
+
toString(): string;
|
|
88
96
|
}
|
|
@@ -1,13 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import {
|
|
2
|
+
IHookRegistry,
|
|
3
|
+
TransitionOptions,
|
|
4
|
+
TransitionHookScope,
|
|
5
|
+
TransitionHookPhase,
|
|
6
|
+
TransitionCreateHookFn,
|
|
7
|
+
HookMatchCriteria,
|
|
8
|
+
HookRegOptions,
|
|
9
|
+
PathTypes,
|
|
10
|
+
PathType,
|
|
11
|
+
RegisteredHooks,
|
|
12
|
+
TransitionHookFn,
|
|
13
|
+
TransitionStateHookFn,
|
|
14
|
+
} from "./interface";
|
|
15
|
+
import { Transition } from "./transition";
|
|
16
|
+
import { RegisteredHook } from "./hookRegistry";
|
|
17
|
+
import { TargetState } from "../state/targetState";
|
|
18
|
+
import { PathNode } from "../path/pathNode";
|
|
19
|
+
import { ViewService } from "../view/view";
|
|
20
|
+
import { UIRouter } from "../router";
|
|
21
|
+
import { TransitionEventType } from "./transitionEventType";
|
|
22
|
+
import { GetResultHandler, GetErrorHandler } from "./transitionHook";
|
|
23
|
+
import { Disposable } from "../interface";
|
|
11
24
|
/**
|
|
12
25
|
* The default [[Transition]] options.
|
|
13
26
|
*
|
|
@@ -20,34 +33,43 @@ export declare let defaultTransOpts: TransitionOptions;
|
|
|
20
33
|
* Plugin API for Transition Service
|
|
21
34
|
*/
|
|
22
35
|
export interface TransitionServicePluginAPI {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Adds a Path to be used as a criterion against a TreeChanges path
|
|
38
|
+
*
|
|
39
|
+
* For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.
|
|
40
|
+
* It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`
|
|
41
|
+
* Each state in the exiting path is checked against the criteria and returned as part of the match.
|
|
42
|
+
*
|
|
43
|
+
* Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.
|
|
44
|
+
* It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`
|
|
45
|
+
* Only the tail of the `to` path is checked against the criteria and returned as part of the match.
|
|
46
|
+
*/
|
|
47
|
+
_definePathType(name: string, hookScope: TransitionHookScope): any;
|
|
48
|
+
/**
|
|
49
|
+
* Gets a Path definition used as a criterion against a TreeChanges path
|
|
50
|
+
*/
|
|
51
|
+
_getPathTypes(): PathTypes;
|
|
52
|
+
/**
|
|
53
|
+
* Defines a transition hook type and returns a transition hook registration
|
|
54
|
+
* function (which can then be used to register hooks of this type).
|
|
55
|
+
*/
|
|
56
|
+
_defineEvent(
|
|
57
|
+
name: string,
|
|
58
|
+
hookPhase: TransitionHookPhase,
|
|
59
|
+
hookOrder: number,
|
|
60
|
+
criteriaMatchPath: PathType,
|
|
61
|
+
reverseSort?: boolean,
|
|
62
|
+
getResultHandler?: GetResultHandler,
|
|
63
|
+
getErrorHandler?: GetErrorHandler,
|
|
64
|
+
rejectIfSuperseded?: boolean,
|
|
65
|
+
): any;
|
|
66
|
+
/**
|
|
67
|
+
* Returns the known event types, such as `onBefore`
|
|
68
|
+
* If a phase argument is provided, returns only events for the given phase.
|
|
69
|
+
*/
|
|
70
|
+
_getEvents(phase?: TransitionHookPhase): TransitionEventType[];
|
|
71
|
+
/** Returns the hooks registered for the given hook name */
|
|
72
|
+
getHooks(hookName: string): RegisteredHook[];
|
|
51
73
|
}
|
|
52
74
|
/**
|
|
53
75
|
* This class provides services related to Transitions.
|
|
@@ -61,127 +83,172 @@ export interface TransitionServicePluginAPI {
|
|
|
61
83
|
* This API is located at `router.transitionService` ([[UIRouter.transitionService]])
|
|
62
84
|
*/
|
|
63
85
|
export declare class TransitionService implements IHookRegistry, Disposable {
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
86
|
+
/** @internal */
|
|
87
|
+
_transitionCount: number;
|
|
88
|
+
/** @internal */
|
|
89
|
+
$view: ViewService;
|
|
90
|
+
/** The transition hook types, such as `onEnter`, `onStart`, etc */
|
|
91
|
+
private _eventTypes;
|
|
92
|
+
/** @internal The registered transition hooks */
|
|
93
|
+
_registeredHooks: RegisteredHooks;
|
|
94
|
+
/** The paths on a criteria object */
|
|
95
|
+
private _criteriaPaths;
|
|
96
|
+
private _router;
|
|
97
|
+
/** @internal */
|
|
98
|
+
_pluginapi: TransitionServicePluginAPI;
|
|
99
|
+
/**
|
|
100
|
+
* This object has hook de-registration functions for the built-in hooks.
|
|
101
|
+
* This can be used by third parties libraries that wish to customize the behaviors
|
|
102
|
+
*
|
|
103
|
+
* @internal
|
|
104
|
+
*/
|
|
105
|
+
_deregisterHookFns: {
|
|
106
|
+
addCoreResolves: Function;
|
|
107
|
+
ignored: Function;
|
|
108
|
+
invalid: Function;
|
|
109
|
+
redirectTo: Function;
|
|
110
|
+
onExit: Function;
|
|
111
|
+
onRetain: Function;
|
|
112
|
+
onEnter: Function;
|
|
113
|
+
eagerResolve: Function;
|
|
114
|
+
lazyResolve: Function;
|
|
115
|
+
resolveAll: Function;
|
|
116
|
+
loadViews: Function;
|
|
117
|
+
activateViews: Function;
|
|
118
|
+
updateGlobals: Function;
|
|
119
|
+
updateUrl: Function;
|
|
120
|
+
lazyLoad: Function;
|
|
121
|
+
};
|
|
122
|
+
/** @internal */
|
|
123
|
+
constructor(_router: UIRouter);
|
|
124
|
+
/**
|
|
125
|
+
* Registers a [[TransitionHookFn]], called *while a transition is being constructed*.
|
|
126
|
+
*
|
|
127
|
+
* Registers a transition lifecycle hook, which is invoked during transition construction.
|
|
128
|
+
*
|
|
129
|
+
* This low level hook should only be used by plugins.
|
|
130
|
+
* This can be a useful time for plugins to add resolves or mutate the transition as needed.
|
|
131
|
+
* The Sticky States plugin uses this hook to modify the treechanges.
|
|
132
|
+
*
|
|
133
|
+
* ### Lifecycle
|
|
134
|
+
*
|
|
135
|
+
* `onCreate` hooks are invoked *while a transition is being constructed*.
|
|
136
|
+
*
|
|
137
|
+
* ### Return value
|
|
138
|
+
*
|
|
139
|
+
* The hook's return value is ignored
|
|
140
|
+
*
|
|
141
|
+
* @internal
|
|
142
|
+
* @param criteria defines which Transitions the Hook should be invoked for.
|
|
143
|
+
* @param callback the hook function which will be invoked.
|
|
144
|
+
* @param options the registration options
|
|
145
|
+
* @returns a function which deregisters the hook.
|
|
146
|
+
*/
|
|
147
|
+
onCreate(
|
|
148
|
+
criteria: HookMatchCriteria,
|
|
149
|
+
callback: TransitionCreateHookFn,
|
|
150
|
+
options?: HookRegOptions,
|
|
151
|
+
): Function;
|
|
152
|
+
/** @inheritdoc */
|
|
153
|
+
onBefore(
|
|
154
|
+
criteria: HookMatchCriteria,
|
|
155
|
+
callback: TransitionHookFn,
|
|
156
|
+
options?: HookRegOptions,
|
|
157
|
+
): Function;
|
|
158
|
+
/** @inheritdoc */
|
|
159
|
+
onStart(
|
|
160
|
+
criteria: HookMatchCriteria,
|
|
161
|
+
callback: TransitionHookFn,
|
|
162
|
+
options?: HookRegOptions,
|
|
163
|
+
): Function;
|
|
164
|
+
/** @inheritdoc */
|
|
165
|
+
onExit(
|
|
166
|
+
criteria: HookMatchCriteria,
|
|
167
|
+
callback: TransitionStateHookFn,
|
|
168
|
+
options?: HookRegOptions,
|
|
169
|
+
): Function;
|
|
170
|
+
/** @inheritdoc */
|
|
171
|
+
onRetain(
|
|
172
|
+
criteria: HookMatchCriteria,
|
|
173
|
+
callback: TransitionStateHookFn,
|
|
174
|
+
options?: HookRegOptions,
|
|
175
|
+
): Function;
|
|
176
|
+
/** @inheritdoc */
|
|
177
|
+
onEnter(
|
|
178
|
+
criteria: HookMatchCriteria,
|
|
179
|
+
callback: TransitionStateHookFn,
|
|
180
|
+
options?: HookRegOptions,
|
|
181
|
+
): Function;
|
|
182
|
+
/** @inheritdoc */
|
|
183
|
+
onFinish(
|
|
184
|
+
criteria: HookMatchCriteria,
|
|
185
|
+
callback: TransitionHookFn,
|
|
186
|
+
options?: HookRegOptions,
|
|
187
|
+
): Function;
|
|
188
|
+
/** @inheritdoc */
|
|
189
|
+
onSuccess(
|
|
190
|
+
criteria: HookMatchCriteria,
|
|
191
|
+
callback: TransitionHookFn,
|
|
192
|
+
options?: HookRegOptions,
|
|
193
|
+
): Function;
|
|
194
|
+
/** @inheritdoc */
|
|
195
|
+
onError(
|
|
196
|
+
criteria: HookMatchCriteria,
|
|
197
|
+
callback: TransitionHookFn,
|
|
198
|
+
options?: HookRegOptions,
|
|
199
|
+
): Function;
|
|
200
|
+
/**
|
|
201
|
+
* dispose
|
|
202
|
+
* @internal
|
|
203
|
+
*/
|
|
204
|
+
dispose(router: UIRouter): void;
|
|
205
|
+
/**
|
|
206
|
+
* Creates a new [[Transition]] object
|
|
207
|
+
*
|
|
208
|
+
* This is a factory function for creating new Transition objects.
|
|
209
|
+
* It is used internally by the [[StateService]] and should generally not be called by application code.
|
|
210
|
+
*
|
|
211
|
+
* @internal
|
|
212
|
+
* @param fromPath the path to the current state (the from state)
|
|
213
|
+
* @param targetState the target state (destination)
|
|
214
|
+
* @returns a Transition
|
|
215
|
+
*/
|
|
216
|
+
create(fromPath: PathNode[], targetState: TargetState): Transition;
|
|
217
|
+
/** @internal */
|
|
218
|
+
private _defineCoreEvents;
|
|
219
|
+
/** @internal */
|
|
220
|
+
private _defineCorePaths;
|
|
221
|
+
/** @internal */
|
|
222
|
+
_defineEvent(
|
|
223
|
+
name: string,
|
|
224
|
+
hookPhase: TransitionHookPhase,
|
|
225
|
+
hookOrder: number,
|
|
226
|
+
criteriaMatchPath: PathType,
|
|
227
|
+
reverseSort?: boolean,
|
|
228
|
+
getResultHandler?: GetResultHandler,
|
|
229
|
+
getErrorHandler?: GetErrorHandler,
|
|
230
|
+
synchronous?: boolean,
|
|
231
|
+
): void;
|
|
232
|
+
/** @internal */
|
|
233
|
+
private _getEvents;
|
|
234
|
+
/**
|
|
235
|
+
* Adds a Path to be used as a criterion against a TreeChanges path
|
|
236
|
+
*
|
|
237
|
+
* For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.
|
|
238
|
+
* It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`
|
|
239
|
+
* Each state in the exiting path is checked against the criteria and returned as part of the match.
|
|
240
|
+
*
|
|
241
|
+
* Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.
|
|
242
|
+
* It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`
|
|
243
|
+
* Only the tail of the `to` path is checked against the criteria and returned as part of the match.
|
|
244
|
+
*
|
|
245
|
+
* @internal
|
|
246
|
+
*/
|
|
247
|
+
private _definePathType;
|
|
248
|
+
/** @internal */
|
|
249
|
+
private _getPathTypes;
|
|
250
|
+
/** @internal */
|
|
251
|
+
getHooks(hookName: string): RegisteredHook[];
|
|
252
|
+
/** @internal */
|
|
253
|
+
private _registerCoreTransitionHooks;
|
|
187
254
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export * from
|
|
6
|
-
export * from
|
|
7
|
-
export { UrlRules } from
|
|
8
|
-
export { UrlConfig } from
|
|
1
|
+
export * from "./interface";
|
|
2
|
+
export * from "./urlMatcher";
|
|
3
|
+
export * from "./urlMatcherFactory";
|
|
4
|
+
export * from "./urlRouter";
|
|
5
|
+
export * from "./urlRule";
|
|
6
|
+
export * from "./urlService";
|
|
7
|
+
export { UrlRules } from "./urlRules";
|
|
8
|
+
export { UrlConfig } from "./urlConfig";
|