@angular-wave/angular.ts 0.0.38 → 0.0.39
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 +6 -5
- package/dist/angular-ts.esm.js +2 -1
- package/dist/angular-ts.umd.js +1 -1
- package/package.json +2 -4
- package/rollup.config.js +5 -1
- package/src/core/scope/scope.js +4 -7
- package/src/index.js +307 -1
- package/src/loader.js +13 -6
- package/src/public.js +7 -2
- package/src/src.test.js +10 -0
- package/tsconfig.json +1 -1
- package/tsconfig.types.json +11 -0
- package/types/animations/animate-cache.d.ts +7 -7
- package/types/animations/animate-children-directive.d.ts +3 -6
- package/types/animations/animate-swap.d.ts +7 -16
- package/types/animations/animation.d.ts +2 -11
- package/types/animations/raf-scheduler.d.ts +3 -3
- package/types/animations/shared.d.ts +8 -23
- package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
- package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
- package/types/core/compile/compile.d.ts +173 -0
- package/types/core/controller/controller.d.ts +32 -0
- package/types/core/exception-handler.d.ts +1 -1
- package/types/core/filter/filter.d.ts +9 -0
- package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
- package/types/core/interval/interval-factory.d.ts +4 -0
- package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
- package/types/core/location/location.d.ts +209 -0
- package/types/core/pubsub/pubsub.d.ts +156 -0
- package/types/core/q/q.d.ts +31 -0
- package/types/core/sanitize/sanitize-uri.d.ts +53 -0
- package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
- package/types/core/scope/scope.d.ts +727 -0
- package/types/core/task-tracker-factory.d.ts +29 -29
- package/types/core/timeout/timeout.d.ts +20 -0
- package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
- package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
- package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
- package/types/directive/controller/controller.d.ts +6 -0
- package/types/directive/events/events.d.ts +5 -0
- package/types/directive/form/form.d.ts +200 -0
- package/types/directive/if/if.d.ts +8 -0
- package/types/directive/include/include.d.ts +14 -0
- package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
- package/types/directive/{model.d.ts → model/model.d.ts} +256 -279
- package/types/directive/options/options.d.ts +9 -0
- package/types/directive/ref/ref.d.ts +5 -0
- package/types/directive/repeat/repeat.d.ts +8 -0
- package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
- package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
- package/types/directive/switch/switch.d.ts +17 -0
- package/types/directive/transclude/transclude.d.ts +4 -0
- package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
- package/types/filters/filters.d.ts +10 -16
- package/types/filters/order-by.d.ts +2 -4
- package/types/index.d.ts +117 -0
- package/types/injector.d.ts +12 -0
- package/types/public.d.ts +5 -0
- package/types/router/common/coreservices.d.ts +2 -2
- package/types/router/common/glob.d.ts +9 -9
- package/types/router/common/queue.d.ts +13 -13
- package/types/router/common/trace.d.ts +43 -43
- package/types/router/directives/view-directive.d.ts +13 -32
- package/types/router/globals.d.ts +20 -20
- package/types/router/hooks/lazy-load.d.ts +2 -11
- package/types/router/hooks/redirect-to.d.ts +1 -4
- package/types/router/hooks/url.d.ts +1 -5
- package/types/router/hooks/views.d.ts +1 -4
- package/types/router/params/param-factory.d.ts +5 -5
- package/types/router/params/param-type.d.ts +35 -35
- package/types/router/params/param-types.d.ts +11 -11
- package/types/router/params/param.d.ts +38 -38
- package/types/router/params/state-params.d.ts +10 -10
- package/types/router/path/path-node.d.ts +34 -34
- package/types/router/path/path-utils.d.ts +73 -77
- package/types/router/resolve/resolvable.d.ts +32 -32
- package/types/router/resolve/resolve-context.d.ts +84 -84
- package/types/router/services.d.ts +4 -9
- package/types/router/state/state-builder.d.ts +27 -27
- package/types/router/state/state-matcher.d.ts +5 -5
- package/types/router/state/state-object.d.ts +58 -58
- package/types/router/state/state-queue-manager.d.ts +10 -16
- package/types/router/state/state-registry.d.ts +100 -107
- package/types/router/state/state-service.d.ts +411 -411
- package/types/router/state/target-state.d.ts +64 -69
- package/types/router/state/views.d.ts +31 -37
- package/types/router/state-filters.d.ts +7 -7
- package/types/router/state-provider.d.ts +105 -105
- package/types/router/template-factory.d.ts +83 -112
- package/types/router/transition/hook-builder.d.ts +25 -25
- package/types/router/transition/hook-registry.d.ts +68 -83
- package/types/router/transition/interface.d.ts +7 -7
- package/types/router/transition/reject-factory.d.ts +34 -34
- package/types/router/transition/transition-event-type.d.ts +9 -18
- package/types/router/transition/transition-hook.d.ts +77 -82
- package/types/router/transition/transition-service.d.ts +82 -99
- package/types/router/transition/transition.d.ts +369 -377
- package/types/router/url/url-config.d.ts +84 -84
- package/types/router/url/url-matcher.d.ts +115 -119
- package/types/router/url/url-rule.d.ts +114 -124
- package/types/router/url/url-rules.d.ts +217 -217
- package/types/router/url/url-service.d.ts +264 -269
- package/types/router/view/view.d.ts +114 -117
- package/types/router/view-scroll.d.ts +2 -2
- package/types/services/anchor-scroll.d.ts +2 -8
- package/types/services/browser.d.ts +122 -130
- package/types/services/cache-factory.d.ts +25 -25
- package/types/services/cookie-reader.d.ts +2 -2
- package/types/services/document.d.ts +2 -2
- package/types/services/http/http.d.ts +145 -0
- package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
- package/types/services/log.d.ts +49 -49
- package/types/services/template-request.d.ts +44 -53
- package/types/shared/common.d.ts +4 -19
- package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
- package/types/shared/hof.d.ts +1 -1
- package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +11 -11
- package/types/shared/test-utils.d.ts +11 -0
- package/types/shared/utils.d.ts +7 -24
- package/types-back/global.d.ts +3 -1
- package/types-back/index.d.ts +2 -221
- package/types/core/compile.d.ts +0 -206
- package/types/core/controller.d.ts +0 -42
- package/types/core/filter.d.ts +0 -9
- package/types/core/interval-factory.d.ts +0 -21
- package/types/core/location.d.ts +0 -234
- package/types/core/pubsub.d.ts +0 -164
- package/types/core/q.d.ts +0 -33
- package/types/core/root-scope.d.ts +0 -754
- package/types/core/sanitize-uri.d.ts +0 -57
- package/types/core/timeout.d.ts +0 -31
- package/types/directive/controller.d.ts +0 -6
- package/types/directive/events.d.ts +0 -12
- package/types/directive/form.d.ts +0 -230
- package/types/directive/if.d.ts +0 -17
- package/types/directive/include.d.ts +0 -33
- package/types/directive/options.d.ts +0 -16
- package/types/directive/ref.d.ts +0 -11
- package/types/directive/repeat.d.ts +0 -23
- package/types/directive/switch.d.ts +0 -23
- package/types/directive/transclude.d.ts +0 -15
- package/types/services/http.d.ts +0 -157
- /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
- /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
- /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
- /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
- /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
- /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
- /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
- /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
- /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
|
@@ -1,86 +1,81 @@
|
|
|
1
1
|
export class TransitionHook {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
transition: any
|
|
39
|
-
stateContext: any
|
|
40
|
-
registeredHook: any
|
|
41
|
-
options: any
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
* Return a Rejection promise if the transition is no longer current due
|
|
63
|
-
* a new transition has started and superseded this one.
|
|
64
|
-
*/
|
|
65
|
-
getNotCurrentRejection(): any;
|
|
66
|
-
toString(): string;
|
|
2
|
+
/**
|
|
3
|
+
* Chains together an array of TransitionHooks.
|
|
4
|
+
*
|
|
5
|
+
* Given a list of [[TransitionHook]] objects, chains them together.
|
|
6
|
+
* Each hook is invoked after the previous one completes.
|
|
7
|
+
*
|
|
8
|
+
* #### Example:
|
|
9
|
+
* ```js
|
|
10
|
+
* var hooks: TransitionHook[] = getHooks();
|
|
11
|
+
* let promise: Promise<any> = TransitionHook.chain(hooks);
|
|
12
|
+
*
|
|
13
|
+
* promise.then(handleSuccess, handleError);
|
|
14
|
+
* ```
|
|
15
|
+
*
|
|
16
|
+
* @param hooks the list of hooks to chain together
|
|
17
|
+
* @param waitFor if provided, the chain is `.then()`'ed off this promise
|
|
18
|
+
* @returns a `Promise` for sequentially invoking the hooks (in order)
|
|
19
|
+
*/
|
|
20
|
+
static chain(hooks: any, waitFor: any): any;
|
|
21
|
+
/**
|
|
22
|
+
* Invokes all the provided TransitionHooks, in order.
|
|
23
|
+
* Each hook's return value is checked.
|
|
24
|
+
* If any hook returns a promise, then the rest of the hooks are chained off that promise, and the promise is returned.
|
|
25
|
+
* If no hook returns a promise, then all hooks are processed synchronously.
|
|
26
|
+
*
|
|
27
|
+
* @param hooks the list of TransitionHooks to invoke
|
|
28
|
+
* @param doneCallback a callback that is invoked after all the hooks have successfully completed
|
|
29
|
+
*
|
|
30
|
+
* @returns a promise for the async result, or the result of the callback
|
|
31
|
+
*/
|
|
32
|
+
static invokeHooks(hooks: any, doneCallback: any): any;
|
|
33
|
+
/**
|
|
34
|
+
* Run all TransitionHooks, ignoring their return value.
|
|
35
|
+
*/
|
|
36
|
+
static runAllHooks(hooks: any): void;
|
|
37
|
+
constructor(transition: any, stateContext: any, registeredHook: any, options: any);
|
|
38
|
+
transition: any;
|
|
39
|
+
stateContext: any;
|
|
40
|
+
registeredHook: any;
|
|
41
|
+
options: any;
|
|
42
|
+
isSuperseded: () => boolean;
|
|
43
|
+
type: any;
|
|
44
|
+
logError(err: any): void;
|
|
45
|
+
invokeHook(): any;
|
|
46
|
+
/**
|
|
47
|
+
* This method handles the return value of a Transition Hook.
|
|
48
|
+
*
|
|
49
|
+
* A hook can return false (cancel), a TargetState (redirect),
|
|
50
|
+
* or a promise (which may later resolve to false or a redirect)
|
|
51
|
+
*
|
|
52
|
+
* This also handles "transition superseded" -- when a new transition
|
|
53
|
+
* was started while the hook was still running
|
|
54
|
+
*/
|
|
55
|
+
handleHookResult(result: any): any;
|
|
56
|
+
/**
|
|
57
|
+
* Return a Rejection promise if the transition is no longer current due
|
|
58
|
+
* a new transition has started and superseded this one.
|
|
59
|
+
*/
|
|
60
|
+
getNotCurrentRejection(): any;
|
|
61
|
+
toString(): string;
|
|
67
62
|
}
|
|
68
63
|
export namespace TransitionHook {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
/**
|
|
65
|
+
* These GetResultHandler(s) are used by [[invokeHook]] below
|
|
66
|
+
* Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])
|
|
67
|
+
*/
|
|
68
|
+
function HANDLE_RESULT(hook: any): (result: any) => any;
|
|
69
|
+
/**
|
|
70
|
+
* If the result is a promise rejection, log it.
|
|
71
|
+
* Otherwise, ignore the result.
|
|
72
|
+
*/
|
|
73
|
+
function LOG_REJECTED_RESULT(hook: any): (result: any) => any;
|
|
74
|
+
/**
|
|
75
|
+
* These GetErrorHandler(s) are used by [[invokeHook]] below
|
|
76
|
+
* Each HookType chooses a GetErrorHandler (See: [[TransitionService._defineCoreEvents]])
|
|
77
|
+
*/
|
|
78
|
+
function LOG_ERROR(hook: any): (error: any) => any;
|
|
79
|
+
function REJECT_ERROR(): (error: any) => any;
|
|
80
|
+
function THROW_ERROR(): (error: any) => never;
|
|
86
81
|
}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
export namespace defaultTransOpts {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
let location: boolean;
|
|
3
|
+
let relative: any;
|
|
4
|
+
let inherit: boolean;
|
|
5
|
+
let notify: boolean;
|
|
6
|
+
let reload: boolean;
|
|
7
|
+
let supercede: boolean;
|
|
8
|
+
let custom: {};
|
|
9
|
+
function current(): any;
|
|
10
|
+
let source: string;
|
|
11
11
|
}
|
|
12
12
|
/**
|
|
13
13
|
* This class provides services related to Transitions.
|
|
@@ -21,95 +21,78 @@ export namespace defaultTransOpts {
|
|
|
21
21
|
* This API is located at `router.transitionService` ([[UIRouter.transitionService]])
|
|
22
22
|
*/
|
|
23
23
|
export class TransitionService {
|
|
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
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Adds a Path to be used as a criterion against a TreeChanges path
|
|
99
|
-
*
|
|
100
|
-
* For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.
|
|
101
|
-
* It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`
|
|
102
|
-
* Each state in the exiting path is checked against the criteria and returned as part of the match.
|
|
103
|
-
*
|
|
104
|
-
* Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.
|
|
105
|
-
* It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`
|
|
106
|
-
* Only the tail of the `to` path is checked against the criteria and returned as part of the match.
|
|
107
|
-
*
|
|
108
|
-
* @internal
|
|
109
|
-
*/
|
|
110
|
-
_definePathType(name: any, hookScope: any): void;
|
|
111
|
-
_getPathTypes(): {};
|
|
112
|
-
getHooks(hookName: any): any;
|
|
113
|
-
_registerCoreTransitionHooks(): void;
|
|
24
|
+
static $inject: string[];
|
|
25
|
+
/**
|
|
26
|
+
* @param {import('../globals').UIRouterGlobals} globals
|
|
27
|
+
*/
|
|
28
|
+
constructor(globals: import("../globals").UIRouterGlobals, viewService: any);
|
|
29
|
+
_transitionCount: number;
|
|
30
|
+
/** The transition hook types, such as `onEnter`, `onStart`, etc */
|
|
31
|
+
_eventTypes: any[];
|
|
32
|
+
/** @internal The registered transition hooks */
|
|
33
|
+
_registeredHooks: {};
|
|
34
|
+
/** The paths on a criteria object */
|
|
35
|
+
_criteriaPaths: {};
|
|
36
|
+
globals: import("../globals").UIRouterGlobals;
|
|
37
|
+
$view: any;
|
|
38
|
+
_deregisterHookFns: {};
|
|
39
|
+
_pluginapi: any;
|
|
40
|
+
$get: (string | ((stateService: any, urlService: any, stateRegistry: any, viewService: any) => this))[];
|
|
41
|
+
/**
|
|
42
|
+
* Registers a [[TransitionHookFn]], called *while a transition is being constructed*.
|
|
43
|
+
*
|
|
44
|
+
* Registers a transition lifecycle hook, which is invoked during transition construction.
|
|
45
|
+
*
|
|
46
|
+
* This low level hook should only be used by plugins.
|
|
47
|
+
* This can be a useful time for plugins to add resolves or mutate the transition as needed.
|
|
48
|
+
* The Sticky States plugin uses this hook to modify the treechanges.
|
|
49
|
+
*
|
|
50
|
+
* ### Lifecycle
|
|
51
|
+
*
|
|
52
|
+
* `onCreate` hooks are invoked *while a transition is being constructed*.
|
|
53
|
+
*
|
|
54
|
+
* ### Return value
|
|
55
|
+
*
|
|
56
|
+
* The hook's return value is ignored
|
|
57
|
+
*
|
|
58
|
+
* @internal
|
|
59
|
+
* @param criteria defines which Transitions the Hook should be invoked for.
|
|
60
|
+
* @param callback the hook function which will be invoked.
|
|
61
|
+
* @param options the registration options
|
|
62
|
+
* @returns a function which deregisters the hook.
|
|
63
|
+
*/
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new [[Transition]] object
|
|
66
|
+
*
|
|
67
|
+
* This is a factory function for creating new Transition objects.
|
|
68
|
+
* It is used internally by the [[StateService]] and should generally not be called by application code.
|
|
69
|
+
*
|
|
70
|
+
* @internal
|
|
71
|
+
* @param fromPath the path to the current state (the from state)
|
|
72
|
+
* @param targetState the target state (destination)
|
|
73
|
+
* @returns a Transition
|
|
74
|
+
*/
|
|
75
|
+
create(fromPath: any, targetState: any): Transition;
|
|
76
|
+
_defineCoreEvents(): void;
|
|
77
|
+
_defineCorePaths(): void;
|
|
78
|
+
_defineEvent(name: any, hookPhase: any, hookOrder: any, criteriaMatchPath: any, reverseSort?: boolean, getResultHandler?: (hook: any) => (result: any) => any, getErrorHandler?: () => (error: any) => any, synchronous?: boolean): void;
|
|
79
|
+
_getEvents(phase: any): any[];
|
|
80
|
+
/**
|
|
81
|
+
* Adds a Path to be used as a criterion against a TreeChanges path
|
|
82
|
+
*
|
|
83
|
+
* For example: the `exiting` path in [[HookMatchCriteria]] is a STATE scoped path.
|
|
84
|
+
* It was defined by calling `defineTreeChangesCriterion('exiting', TransitionHookScope.STATE)`
|
|
85
|
+
* Each state in the exiting path is checked against the criteria and returned as part of the match.
|
|
86
|
+
*
|
|
87
|
+
* Another example: the `to` path in [[HookMatchCriteria]] is a TRANSITION scoped path.
|
|
88
|
+
* It was defined by calling `defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION)`
|
|
89
|
+
* Only the tail of the `to` path is checked against the criteria and returned as part of the match.
|
|
90
|
+
*
|
|
91
|
+
* @internal
|
|
92
|
+
*/
|
|
93
|
+
_definePathType(name: any, hookScope: any): void;
|
|
94
|
+
_getPathTypes(): {};
|
|
95
|
+
getHooks(hookName: any): any;
|
|
96
|
+
_registerCoreTransitionHooks(): void;
|
|
114
97
|
}
|
|
115
98
|
import { Transition } from "./transition";
|