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