@angular-wave/angular.ts 0.0.60 → 0.0.61
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/README.md +1 -1
- package/dist/angular-ts.esm.js +2 -2
- package/dist/angular-ts.umd.js +2 -2
- package/package.json +1 -1
- package/src/core/parser/parse.js +14 -0
- package/src/core/parser/parser.js +1 -1
- package/src/core/q/q.js +46 -289
- package/src/core/q/q.md +229 -0
- package/src/core/sanitize/sanitize-uri.js +2 -3
- package/src/core/scope/scope.js +18 -8
- package/src/directive/if/if.js +6 -1
- package/src/filters/limit-to.js +5 -2
- package/src/loader.js +1 -5
- package/src/router/params/param-type.js +2 -1
- package/src/router/state/views.js +3 -0
- package/src/router/transition/reject-factory.js +1 -0
- package/src/router/url/url-rule.js +1 -1
- package/src/router/url/url-service.js +4 -4
- package/src/services/http/http.js +7 -5
- package/src/services/template-request.js +2 -7
- package/src/shared/common.js +1 -1
- package/src/shared/utils.js +1 -1
- package/src/types.js +9 -1
- package/types/core/parser/parse.d.ts +3 -4
- package/types/core/parser/parser.d.ts +1 -1
- package/types/core/q/q.d.ts +2 -2
- package/types/core/sanitize/sanitize-uri.d.ts +4 -5
- package/types/core/scope/scope.d.ts +19 -7
- package/types/loader.d.ts +0 -4
- package/types/router/params/param-type.d.ts +2 -1
- package/types/router/state/views.d.ts +2 -0
- package/types/router/transition/reject-factory.d.ts +1 -0
- package/types/router/url/url-rule.d.ts +0 -1
- package/types/router/url/url-service.d.ts +7 -7
- package/types/services/template-request.d.ts +4 -9
- package/types/types.d.ts +6 -1
- package/types-back/README.md +0 -2
- package/types-back/angular.d.ts +0 -146
- package/types-back/index.d.ts +0 -2126
- package/types-back/jqlite.d.ts +0 -374
- package/types-back/router/core/common/common.d.ts +0 -416
- package/types-back/router/core/common/coreservices.d.ts +0 -77
- package/types-back/router/core/common/glob.d.ts +0 -60
- package/types-back/router/core/common/hof.d.ts +0 -168
- package/types-back/router/core/common/index.d.ts +0 -8
- package/types-back/router/core/common/predicates.d.ts +0 -25
- package/types-back/router/core/common/queue.d.ts +0 -15
- package/types-back/router/core/common/safeConsole.d.ts +0 -5
- package/types-back/router/core/common/strings.d.ts +0 -66
- package/types-back/router/core/common/trace.d.ts +0 -126
- package/types-back/router/core/globals.d.ts +0 -43
- package/types-back/router/core/hooks/coreResolvables.d.ts +0 -6
- package/types-back/router/core/hooks/ignoredTransition.d.ts +0 -4
- package/types-back/router/core/hooks/invalidTransition.d.ts +0 -4
- package/types-back/router/core/hooks/lazyLoad.d.ts +0 -17
- package/types-back/router/core/hooks/onEnterExitRetain.d.ts +0 -10
- package/types-back/router/core/hooks/redirectTo.d.ts +0 -4
- package/types-back/router/core/hooks/resolve.d.ts +0 -11
- package/types-back/router/core/hooks/updateGlobals.d.ts +0 -4
- package/types-back/router/core/hooks/url.d.ts +0 -4
- package/types-back/router/core/hooks/views.d.ts +0 -7
- package/types-back/router/core/index.d.ts +0 -11
- package/types-back/router/core/interface.d.ts +0 -91
- package/types-back/router/core/params/index.d.ts +0 -12
- package/types-back/router/core/params/interface.d.ts +0 -606
- package/types-back/router/core/params/param.d.ts +0 -77
- package/types-back/router/core/params/paramType.d.ts +0 -65
- package/types-back/router/core/params/paramTypes.d.ts +0 -193
- package/types-back/router/core/params/stateParams.d.ts +0 -15
- package/types-back/router/core/path/index.d.ts +0 -2
- package/types-back/router/core/path/pathNode.d.ts +0 -60
- package/types-back/router/core/path/pathUtils.d.ts +0 -105
- package/types-back/router/core/resolve/index.d.ts +0 -3
- package/types-back/router/core/resolve/interface.d.ts +0 -210
- package/types-back/router/core/resolve/resolvable.d.ts +0 -75
- package/types-back/router/core/resolve/resolveContext.d.ts +0 -97
- package/types-back/router/core/router.d.ts +0 -57
- package/types-back/router/core/state/index.d.ts +0 -28
- package/types-back/router/core/state/interface.d.ts +0 -732
- package/types-back/router/core/state/stateBuilder.d.ts +0 -107
- package/types-back/router/core/state/stateMatcher.d.ts +0 -13
- package/types-back/router/core/state/stateObject.d.ts +0 -170
- package/types-back/router/core/state/stateQueueManager.d.ts +0 -27
- package/types-back/router/core/state/stateRegistry.d.ts +0 -138
- package/types-back/router/core/state/stateService.d.ts +0 -386
- package/types-back/router/core/state/targetState.d.ts +0 -105
- package/types-back/router/core/transition/hookBuilder.d.ts +0 -49
- package/types-back/router/core/transition/hookRegistry.d.ts +0 -115
- package/types-back/router/core/transition/index.d.ts +0 -20
- package/types-back/router/core/transition/interface.d.ts +0 -862
- package/types-back/router/core/transition/rejectFactory.d.ts +0 -103
- package/types-back/router/core/transition/transition.d.ts +0 -575
- package/types-back/router/core/transition/transitionEventType.d.ts +0 -26
- package/types-back/router/core/transition/transitionHook.d.ts +0 -96
- package/types-back/router/core/transition/transitionService.d.ts +0 -253
- package/types-back/router/core/url/index.d.ts +0 -8
- package/types-back/router/core/url/interface.d.ts +0 -169
- package/types-back/router/core/url/urlConfig.d.ts +0 -144
- package/types-back/router/core/url/urlMatcher.d.ts +0 -185
- package/types-back/router/core/url/urlMatcherFactory.d.ts +0 -56
- package/types-back/router/core/url/urlRouter.d.ts +0 -101
- package/types-back/router/core/url/urlRule.d.ts +0 -143
- package/types-back/router/core/url/urlRules.d.ts +0 -251
- package/types-back/router/core/url/urlService.d.ts +0 -205
- package/types-back/router/core/view/index.d.ts +0 -2
- package/types-back/router/core/view/interface.d.ts +0 -46
- package/types-back/router/core/view/view.d.ts +0 -176
- package/types-back/router/directives/viewDirective.d.ts +0 -144
- package/types-back/router/index.d.ts +0 -17
- package/types-back/router/interface.d.ts +0 -500
- package/types-back/router/legacy/resolveService.d.ts +0 -47
- package/types-back/router/legacy/stateEvents.d.ts +0 -124
- package/types-back/router/services.d.ts +0 -15
- package/types-back/router/stateFilters.d.ts +0 -10
- package/types-back/router/stateProvider.d.ts +0 -258
- package/types-back/router/statebuilders/onEnterExitRetain.d.ts +0 -13
- package/types-back/router/statebuilders/views.d.ts +0 -53
- package/types-back/router/templateFactory.d.ts +0 -104
- package/types-back/router/viewScroll.d.ts +0 -9
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Higher order functions
|
|
3
|
-
*
|
|
4
|
-
* These utility functions are exported, but are subject to change without notice.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
import { Predicate } from "./common";
|
|
9
|
-
/**
|
|
10
|
-
* Returns a new function for [Partial Application](https://en.wikipedia.org/wiki/Partial_application) of the original function.
|
|
11
|
-
*
|
|
12
|
-
* Given a function with N parameters, returns a new function that supports partial application.
|
|
13
|
-
* The new function accepts anywhere from 1 to N parameters. When that function is called with M parameters,
|
|
14
|
-
* where M is less than N, it returns a new function that accepts the remaining parameters. It continues to
|
|
15
|
-
* accept more parameters until all N parameters have been supplied.
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* This contrived example uses a partially applied function as an predicate, which returns true
|
|
19
|
-
* if an object is found in both arrays.
|
|
20
|
-
* @example
|
|
21
|
-
* ```
|
|
22
|
-
* // returns true if an object is in both of the two arrays
|
|
23
|
-
* function inBoth(array1, array2, object) {
|
|
24
|
-
* return array1.indexOf(object) !== -1 &&
|
|
25
|
-
* array2.indexOf(object) !== 1;
|
|
26
|
-
* }
|
|
27
|
-
* let obj1, obj2, obj3, obj4, obj5, obj6, obj7
|
|
28
|
-
* let foos = [obj1, obj3]
|
|
29
|
-
* let bars = [obj3, obj4, obj5]
|
|
30
|
-
*
|
|
31
|
-
* // A curried "copy" of inBoth
|
|
32
|
-
* let curriedInBoth = curry(inBoth);
|
|
33
|
-
* // Partially apply both the array1 and array2
|
|
34
|
-
* let inFoosAndBars = curriedInBoth(foos, bars);
|
|
35
|
-
*
|
|
36
|
-
* // Supply the final argument; since all arguments are
|
|
37
|
-
* // supplied, the original inBoth function is then called.
|
|
38
|
-
* let obj1InBoth = inFoosAndBars(obj1); // false
|
|
39
|
-
*
|
|
40
|
-
* // Use the inFoosAndBars as a predicate.
|
|
41
|
-
* // Filter, on each iteration, supplies the final argument
|
|
42
|
-
* let allObjs = [ obj1, obj2, obj3, obj4, obj5, obj6, obj7 ];
|
|
43
|
-
* let foundInBoth = allObjs.filter(inFoosAndBars); // [ obj3 ]
|
|
44
|
-
*
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @param fn
|
|
48
|
-
* @returns {*|function(): (*|any)}
|
|
49
|
-
*/
|
|
50
|
-
export declare function curry(fn: Function): Function;
|
|
51
|
-
/**
|
|
52
|
-
* Given a varargs list of functions, returns a function that composes the argument functions, right-to-left
|
|
53
|
-
* given: f(x), g(x), h(x)
|
|
54
|
-
* let composed = compose(f,g,h)
|
|
55
|
-
* then, composed is: f(g(h(x)))
|
|
56
|
-
*/
|
|
57
|
-
export declare function compose(): () => any;
|
|
58
|
-
/**
|
|
59
|
-
* Given a varargs list of functions, returns a function that is composes the argument functions, left-to-right
|
|
60
|
-
* given: f(x), g(x), h(x)
|
|
61
|
-
* let piped = pipe(f,g,h);
|
|
62
|
-
* then, piped is: h(g(f(x)))
|
|
63
|
-
*/
|
|
64
|
-
export declare function pipe(...funcs: Function[]): (obj: any) => any;
|
|
65
|
-
/**
|
|
66
|
-
* Given a property name, returns a function that returns that property from an object
|
|
67
|
-
* let obj = { foo: 1, name: "blarg" };
|
|
68
|
-
* let getName = prop("name");
|
|
69
|
-
* getName(obj) === "blarg"
|
|
70
|
-
*/
|
|
71
|
-
export declare const prop: (name: string) => (obj: any) => any;
|
|
72
|
-
/**
|
|
73
|
-
* Given a property name and a value, returns a function that returns a boolean based on whether
|
|
74
|
-
* the passed object has a property that matches the value
|
|
75
|
-
* let obj = { foo: 1, name: "blarg" };
|
|
76
|
-
* let getName = propEq("name", "blarg");
|
|
77
|
-
* getName(obj) === true
|
|
78
|
-
*/
|
|
79
|
-
export declare const propEq: Function;
|
|
80
|
-
/**
|
|
81
|
-
* Given a dotted property name, returns a function that returns a nested property from an object, or undefined
|
|
82
|
-
* let obj = { id: 1, nestedObj: { foo: 1, name: "blarg" }, };
|
|
83
|
-
* let getName = prop("nestedObj.name");
|
|
84
|
-
* getName(obj) === "blarg"
|
|
85
|
-
* let propNotFound = prop("this.property.doesnt.exist");
|
|
86
|
-
* propNotFound(obj) === undefined
|
|
87
|
-
*/
|
|
88
|
-
export declare const parse: (name: string) => any;
|
|
89
|
-
/**
|
|
90
|
-
* Given a function that returns a truthy or falsey value, returns a
|
|
91
|
-
* function that returns the opposite (falsey or truthy) value given the same inputs
|
|
92
|
-
*/
|
|
93
|
-
export declare const not: (fn: Predicate<any>) => Predicate<any>;
|
|
94
|
-
/**
|
|
95
|
-
* Given two functions that return truthy or falsey values, returns a function that returns truthy
|
|
96
|
-
* if both functions return truthy for the given arguments
|
|
97
|
-
*/
|
|
98
|
-
export declare function and(
|
|
99
|
-
fn1: Predicate<any>,
|
|
100
|
-
fn2: Predicate<any>,
|
|
101
|
-
): Predicate<any>;
|
|
102
|
-
/**
|
|
103
|
-
* Given two functions that return truthy or falsey values, returns a function that returns truthy
|
|
104
|
-
* if at least one of the functions returns truthy for the given arguments
|
|
105
|
-
*/
|
|
106
|
-
export declare function or(
|
|
107
|
-
fn1: Predicate<any>,
|
|
108
|
-
fn2: Predicate<any>,
|
|
109
|
-
): Predicate<any>;
|
|
110
|
-
/**
|
|
111
|
-
* Check if all the elements of an array match a predicate function
|
|
112
|
-
*
|
|
113
|
-
* @param fn1 a predicate function `fn1`
|
|
114
|
-
* @returns a function which takes an array and returns true if `fn1` is true for all elements of the array
|
|
115
|
-
*/
|
|
116
|
-
export declare const all: (fn1: Predicate<any>) => (arr: any[]) => boolean;
|
|
117
|
-
export declare const any: (fn1: Predicate<any>) => (arr: any[]) => boolean;
|
|
118
|
-
/** Given a class, returns a Predicate function that returns true if the object is of that class */
|
|
119
|
-
export declare const is: <T>(
|
|
120
|
-
ctor: new (...args: any[]) => T,
|
|
121
|
-
) => (obj: any) => obj is T;
|
|
122
|
-
/** Given a value, returns a Predicate function that returns true if another value is === equal to the original value */
|
|
123
|
-
export declare const eq: (comp: any) => Predicate<any>;
|
|
124
|
-
/** Given a value, returns a function which returns the value */
|
|
125
|
-
export declare const val: <T>(v: T) => () => T;
|
|
126
|
-
export declare function invoke(fnName: string): Function;
|
|
127
|
-
export declare function invoke(fnName: string, args: any[]): Function;
|
|
128
|
-
/**
|
|
129
|
-
* Sorta like Pattern Matching (a functional programming conditional construct)
|
|
130
|
-
*
|
|
131
|
-
* See http://c2.com/cgi/wiki?PatternMatching
|
|
132
|
-
*
|
|
133
|
-
* This is a conditional construct which allows a series of predicates and output functions
|
|
134
|
-
* to be checked and then applied. Each predicate receives the input. If the predicate
|
|
135
|
-
* returns truthy, then its matching output function (mapping function) is provided with
|
|
136
|
-
* the input and, then the result is returned.
|
|
137
|
-
*
|
|
138
|
-
* Each combination (2-tuple) of predicate + output function should be placed in an array
|
|
139
|
-
* of size 2: [ predicate, mapFn ]
|
|
140
|
-
*
|
|
141
|
-
* These 2-tuples should be put in an outer array.
|
|
142
|
-
*
|
|
143
|
-
* @example
|
|
144
|
-
* ```
|
|
145
|
-
*
|
|
146
|
-
* // Here's a 2-tuple where the first element is the isString predicate
|
|
147
|
-
* // and the second element is a function that returns a description of the input
|
|
148
|
-
* let firstTuple = [ angular.isString, (input) => `Heres your string ${input}` ];
|
|
149
|
-
*
|
|
150
|
-
* // Second tuple: predicate "isNumber", mapfn returns a description
|
|
151
|
-
* let secondTuple = [ angular.isNumber, (input) => `(${input}) That's a number!` ];
|
|
152
|
-
*
|
|
153
|
-
* let third = [ (input) => input === null, (input) => `Oh, null...` ];
|
|
154
|
-
*
|
|
155
|
-
* let fourth = [ (input) => input === undefined, (input) => `notdefined` ];
|
|
156
|
-
*
|
|
157
|
-
* let descriptionOf = pattern([ firstTuple, secondTuple, third, fourth ]);
|
|
158
|
-
*
|
|
159
|
-
* console.log(descriptionOf(undefined)); // 'notdefined'
|
|
160
|
-
* console.log(descriptionOf(55)); // '(55) That's a number!'
|
|
161
|
-
* console.log(descriptionOf("foo")); // 'Here's your string foo'
|
|
162
|
-
* ```
|
|
163
|
-
*
|
|
164
|
-
* @param struct A 2D array. Each element of the array should be an array, a 2-tuple,
|
|
165
|
-
* with a Predicate and a mapping/output function
|
|
166
|
-
* @returns {function(any): *}
|
|
167
|
-
*/
|
|
168
|
-
export declare function pattern(struct: Function[][]): Function;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Predicate } from "./common";
|
|
2
|
-
export declare const isUndefined: (x: any) => boolean;
|
|
3
|
-
export declare const isDefined: Predicate<any>;
|
|
4
|
-
export declare const isNull: (o: any) => boolean;
|
|
5
|
-
export declare const isNullOrUndefined: Predicate<any>;
|
|
6
|
-
export declare const isFunction: (x: any) => x is Function;
|
|
7
|
-
export declare const isNumber: (x: any) => x is number;
|
|
8
|
-
export declare const isString: (x: any) => x is string;
|
|
9
|
-
export declare const isObject: (x: any) => boolean;
|
|
10
|
-
export declare const isArray: (arg: any) => arg is any[];
|
|
11
|
-
export declare const isDate: (x: any) => x is Date;
|
|
12
|
-
export declare const isRegExp: (x: any) => x is RegExp;
|
|
13
|
-
/**
|
|
14
|
-
* Predicate which checks if a value is injectable
|
|
15
|
-
*
|
|
16
|
-
* A value is "injectable" if it is a function, or if it is an ng1 array-notation-style array
|
|
17
|
-
* where all the elements in the array are Strings, except the last one, which is a Function
|
|
18
|
-
*/
|
|
19
|
-
export declare function isInjectable(val: any): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Predicate which checks if a value looks like a Promise
|
|
22
|
-
*
|
|
23
|
-
* It is probably a Promise if it's an object, and it has a `then` property which is a Function
|
|
24
|
-
*/
|
|
25
|
-
export declare const isPromise: (x: any) => x is Promise<any>;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
export declare class Queue<T> {
|
|
2
|
-
private _items;
|
|
3
|
-
private _limit;
|
|
4
|
-
private _evictListeners;
|
|
5
|
-
onEvict: (val: (item: T) => void) => (item: T) => void;
|
|
6
|
-
constructor(_items?: T[], _limit?: number);
|
|
7
|
-
enqueue(item: T): T;
|
|
8
|
-
evict(): T;
|
|
9
|
-
dequeue(): T;
|
|
10
|
-
clear(): Array<T>;
|
|
11
|
-
size(): number;
|
|
12
|
-
remove(item: T): T;
|
|
13
|
-
peekTail(): T;
|
|
14
|
-
peekHead(): T;
|
|
15
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Functions that manipulate strings
|
|
3
|
-
*
|
|
4
|
-
* Although these functions are exported, they are subject to change without notice.
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation
|
|
7
|
-
*/
|
|
8
|
-
import { IInjectable } from "./common";
|
|
9
|
-
/**
|
|
10
|
-
* Returns a string shortened to a maximum length
|
|
11
|
-
*
|
|
12
|
-
* If the string is already less than the `max` length, return the string.
|
|
13
|
-
* Else return the string, shortened to `max - 3` and append three dots ("...").
|
|
14
|
-
*
|
|
15
|
-
* @param max the maximum length of the string to return
|
|
16
|
-
* @param str the input string
|
|
17
|
-
*/
|
|
18
|
-
export declare function maxLength(max: number, str: string): string;
|
|
19
|
-
/**
|
|
20
|
-
* Returns a string, with spaces added to the end, up to a desired str length
|
|
21
|
-
*
|
|
22
|
-
* If the string is already longer than the desired length, return the string.
|
|
23
|
-
* Else returns the string, with extra spaces on the end, such that it reaches `length` characters.
|
|
24
|
-
*
|
|
25
|
-
* @param length the desired length of the string to return
|
|
26
|
-
* @param str the input string
|
|
27
|
-
*/
|
|
28
|
-
export declare function padString(length: number, str: string): string;
|
|
29
|
-
export declare function kebobString(camelCase: string): string;
|
|
30
|
-
export declare function functionToString(fn: Function): any;
|
|
31
|
-
export declare function fnToString(fn: IInjectable): any;
|
|
32
|
-
export declare function stringify(o: any): string;
|
|
33
|
-
/** Returns a function that splits a string on a character or substring */
|
|
34
|
-
export declare const beforeAfterSubstr: (
|
|
35
|
-
char: string,
|
|
36
|
-
) => (str: string) => string[];
|
|
37
|
-
export declare const hostRegex: RegExp;
|
|
38
|
-
export declare const stripLastPathElement: (str: string) => string;
|
|
39
|
-
export declare const splitHash: (str: string) => string[];
|
|
40
|
-
export declare const splitQuery: (str: string) => string[];
|
|
41
|
-
export declare const splitEqual: (str: string) => string[];
|
|
42
|
-
export declare const trimHashVal: (str: string) => string;
|
|
43
|
-
/**
|
|
44
|
-
* Splits on a delimiter, but returns the delimiters in the array
|
|
45
|
-
*
|
|
46
|
-
* #### Example:
|
|
47
|
-
* ```js
|
|
48
|
-
* var splitOnSlashes = splitOnDelim('/');
|
|
49
|
-
* splitOnSlashes("/foo"); // ["/", "foo"]
|
|
50
|
-
* splitOnSlashes("/foo/"); // ["/", "foo", "/"]
|
|
51
|
-
* ```
|
|
52
|
-
*/
|
|
53
|
-
export declare function splitOnDelim(delim: string): (str: string) => string[];
|
|
54
|
-
/**
|
|
55
|
-
* Reduce fn that joins neighboring strings
|
|
56
|
-
*
|
|
57
|
-
* Given an array of strings, returns a new array
|
|
58
|
-
* where all neighboring strings have been joined.
|
|
59
|
-
*
|
|
60
|
-
* #### Example:
|
|
61
|
-
* ```js
|
|
62
|
-
* let arr = ["foo", "bar", 1, "baz", "", "qux" ];
|
|
63
|
-
* arr.reduce(joinNeighborsR, []) // ["foobar", 1, "bazqux" ]
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function joinNeighborsR(acc: any[], x: any): any[];
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import { Transition } from "../transition/transition";
|
|
2
|
-
import { ViewTuple } from "../view";
|
|
3
|
-
import { ActiveNGView, ViewConfig, ViewContext } from "../view/interface";
|
|
4
|
-
import { Resolvable } from "../resolve/resolvable";
|
|
5
|
-
import { PathNode } from "../path/pathNode";
|
|
6
|
-
import { PolicyWhen } from "../resolve/interface";
|
|
7
|
-
import { TransitionHook } from "../transition/transitionHook";
|
|
8
|
-
import { HookResult } from "../transition/interface";
|
|
9
|
-
import { StateObject } from "../state/stateObject";
|
|
10
|
-
/**
|
|
11
|
-
* Trace categories Enum
|
|
12
|
-
*
|
|
13
|
-
* Enable or disable a category using [[Trace.enable]] or [[Trace.disable]]
|
|
14
|
-
*
|
|
15
|
-
* `trace.enable(Category.TRANSITION)`
|
|
16
|
-
*
|
|
17
|
-
* These can also be provided using a matching string, or position ordinal
|
|
18
|
-
*
|
|
19
|
-
* `trace.enable("TRANSITION")`
|
|
20
|
-
*
|
|
21
|
-
* `trace.enable(1)`
|
|
22
|
-
*/
|
|
23
|
-
declare enum Category {
|
|
24
|
-
RESOLVE = 0,
|
|
25
|
-
TRANSITION = 1,
|
|
26
|
-
HOOK = 2,
|
|
27
|
-
NGVIEW = 3,
|
|
28
|
-
VIEWCONFIG = 4,
|
|
29
|
-
}
|
|
30
|
-
export { Category };
|
|
31
|
-
/**
|
|
32
|
-
* Prints Router Transition trace information to the console.
|
|
33
|
-
*/
|
|
34
|
-
export declare class Trace {
|
|
35
|
-
/** @internal */
|
|
36
|
-
approximateDigests: number;
|
|
37
|
-
/** @internal */
|
|
38
|
-
private _enabled;
|
|
39
|
-
/** @internal */
|
|
40
|
-
constructor();
|
|
41
|
-
/** @internal */
|
|
42
|
-
private _set;
|
|
43
|
-
/**
|
|
44
|
-
* Enables a trace [[Category]]
|
|
45
|
-
*
|
|
46
|
-
* ```js
|
|
47
|
-
* trace.enable("TRANSITION");
|
|
48
|
-
* ```
|
|
49
|
-
*
|
|
50
|
-
* @param categories categories to enable. If `categories` is omitted, all categories are enabled.
|
|
51
|
-
* Also takes strings (category name) or ordinal (category position)
|
|
52
|
-
*/
|
|
53
|
-
enable(...categories: (Category | string | number)[]): any;
|
|
54
|
-
/**
|
|
55
|
-
* Disables a trace [[Category]]
|
|
56
|
-
*
|
|
57
|
-
* ```js
|
|
58
|
-
* trace.disable("VIEWCONFIG");
|
|
59
|
-
* ```
|
|
60
|
-
*
|
|
61
|
-
* @param categories categories to disable. If `categories` is omitted, all categories are disabled.
|
|
62
|
-
* Also takes strings (category name) or ordinal (category position)
|
|
63
|
-
*/
|
|
64
|
-
disable(...categories: (Category | string | number)[]): any;
|
|
65
|
-
/**
|
|
66
|
-
* Retrieves the enabled stateus of a [[Category]]
|
|
67
|
-
*
|
|
68
|
-
* ```js
|
|
69
|
-
* trace.enabled("VIEWCONFIG"); // true or false
|
|
70
|
-
* ```
|
|
71
|
-
*
|
|
72
|
-
* @returns boolean true if the category is enabled
|
|
73
|
-
*/
|
|
74
|
-
enabled(category: Category | string | number): boolean;
|
|
75
|
-
/** @internal called by ui-router code */
|
|
76
|
-
traceTransitionStart(trans: Transition): void;
|
|
77
|
-
/** @internal called by ui-router code */
|
|
78
|
-
traceTransitionIgnored(trans: Transition): void;
|
|
79
|
-
/** @internal called by ui-router code */
|
|
80
|
-
traceHookInvocation(
|
|
81
|
-
step: TransitionHook,
|
|
82
|
-
trans: Transition,
|
|
83
|
-
options: any,
|
|
84
|
-
): void;
|
|
85
|
-
/** @internal called by ui-router code */
|
|
86
|
-
traceHookResult(
|
|
87
|
-
hookResult: HookResult,
|
|
88
|
-
trans: Transition,
|
|
89
|
-
transitionOptions: any,
|
|
90
|
-
): void;
|
|
91
|
-
/** @internal called by ui-router code */
|
|
92
|
-
traceResolvePath(
|
|
93
|
-
path: PathNode[],
|
|
94
|
-
when: PolicyWhen,
|
|
95
|
-
trans?: Transition,
|
|
96
|
-
): void;
|
|
97
|
-
/** @internal called by ui-router code */
|
|
98
|
-
traceResolvableResolved(resolvable: Resolvable, trans?: Transition): void;
|
|
99
|
-
/** @internal called by ui-router code */
|
|
100
|
-
traceError(reason: any, trans: Transition): void;
|
|
101
|
-
/** @internal called by ui-router code */
|
|
102
|
-
traceSuccess(finalState: StateObject, trans: Transition): void;
|
|
103
|
-
/** @internal called by ui-router code */
|
|
104
|
-
traceNGViewEvent(event: string, viewData: ActiveNGView, extra?: string): void;
|
|
105
|
-
/** @internal called by ui-router code */
|
|
106
|
-
traceNGViewConfigUpdated(viewData: ActiveNGView, context: ViewContext): void;
|
|
107
|
-
/** @internal called by ui-router code */
|
|
108
|
-
traceNGViewFill(viewData: ActiveNGView, html: string): void;
|
|
109
|
-
/** @internal called by ui-router code */
|
|
110
|
-
traceViewSync(pairs: ViewTuple[]): void;
|
|
111
|
-
/** @internal called by ui-router code */
|
|
112
|
-
traceViewServiceEvent(event: string, viewConfig: ViewConfig): void;
|
|
113
|
-
/** @internal called by ui-router code */
|
|
114
|
-
traceViewServiceNGViewEvent(event: string, viewData: ActiveNGView): void;
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* The [[Trace]] singleton
|
|
118
|
-
*
|
|
119
|
-
* #### Example:
|
|
120
|
-
* ```js
|
|
121
|
-
* import {trace} from "@uirouter/core";
|
|
122
|
-
* trace.enable(1, 5);
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
declare const trace: Trace;
|
|
126
|
-
export { trace };
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { StateParams } from "./params/stateParams";
|
|
2
|
-
import { StateDeclaration } from "./state/interface";
|
|
3
|
-
import { StateObject } from "./state/stateObject";
|
|
4
|
-
import { Transition } from "./transition/transition";
|
|
5
|
-
import { Queue } from "./common/queue";
|
|
6
|
-
/**
|
|
7
|
-
* Global router state
|
|
8
|
-
*
|
|
9
|
-
* This is where we hold the global mutable state such as current state, current
|
|
10
|
-
* params, current transition, etc.
|
|
11
|
-
*/
|
|
12
|
-
export declare class RouterGlobals {
|
|
13
|
-
/**
|
|
14
|
-
* Current parameter values
|
|
15
|
-
*
|
|
16
|
-
* The parameter values from the latest successful transition
|
|
17
|
-
*/
|
|
18
|
-
params: StateParams;
|
|
19
|
-
/**
|
|
20
|
-
* Current state
|
|
21
|
-
*
|
|
22
|
-
* The to-state from the latest successful transition
|
|
23
|
-
*/
|
|
24
|
-
current: StateDeclaration;
|
|
25
|
-
/**
|
|
26
|
-
* Current state (internal object)
|
|
27
|
-
*
|
|
28
|
-
* The to-state from the latest successful transition
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
$current: StateObject;
|
|
32
|
-
/**
|
|
33
|
-
* The current started/running transition.
|
|
34
|
-
* This transition has reached at least the onStart phase, but is not yet complete
|
|
35
|
-
*/
|
|
36
|
-
transition: Transition;
|
|
37
|
-
/** @internal */
|
|
38
|
-
lastStartedTransitionId: number;
|
|
39
|
-
/** @internal */
|
|
40
|
-
transitionHistory: Queue<Transition>;
|
|
41
|
-
/** @internal */
|
|
42
|
-
successfulTransitions: Queue<Transition>;
|
|
43
|
-
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { Transition } from "../transition/transition";
|
|
2
|
-
import { TransitionService } from "../transition/transitionService";
|
|
3
|
-
export declare const registerAddCoreResolvables: (
|
|
4
|
-
transitionService: TransitionService,
|
|
5
|
-
) => Function;
|
|
6
|
-
export declare const treeChangesCleanup: (trans: Transition) => void;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Transition } from "../transition/transition";
|
|
2
|
-
import { TransitionService } from "../transition/transitionService";
|
|
3
|
-
import { StateDeclaration, LazyLoadResult } from "../state/interface";
|
|
4
|
-
export declare const registerLazyLoadHook: (
|
|
5
|
-
transitionService: TransitionService,
|
|
6
|
-
) => Function;
|
|
7
|
-
/**
|
|
8
|
-
* Invokes a state's lazy load function
|
|
9
|
-
*
|
|
10
|
-
* @param transition a Transition context
|
|
11
|
-
* @param state the state to lazy load
|
|
12
|
-
* @returns A promise for the lazy load result
|
|
13
|
-
*/
|
|
14
|
-
export declare function lazyLoadState(
|
|
15
|
-
transition: Transition,
|
|
16
|
-
state: StateDeclaration,
|
|
17
|
-
): Promise<LazyLoadResult>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { TransitionService } from "../transition/transitionService";
|
|
2
|
-
export declare const registerOnExitHook: (
|
|
3
|
-
transitionService: TransitionService,
|
|
4
|
-
) => Function;
|
|
5
|
-
export declare const registerOnRetainHook: (
|
|
6
|
-
transitionService: TransitionService,
|
|
7
|
-
) => Function;
|
|
8
|
-
export declare const registerOnEnterHook: (
|
|
9
|
-
transitionService: TransitionService,
|
|
10
|
-
) => Function;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { TransitionService } from "../transition/transitionService";
|
|
2
|
-
export declare const RESOLVE_HOOK_PRIORITY = 1000;
|
|
3
|
-
export declare const registerEagerResolvePath: (
|
|
4
|
-
transitionService: TransitionService,
|
|
5
|
-
) => Function;
|
|
6
|
-
export declare const registerLazyResolveState: (
|
|
7
|
-
transitionService: TransitionService,
|
|
8
|
-
) => Function;
|
|
9
|
-
export declare const registerResolveRemaining: (
|
|
10
|
-
transitionService: TransitionService,
|
|
11
|
-
) => Function;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TransitionService } from "../transition/transitionService";
|
|
2
|
-
export declare const registerLoadEnteringViews: (
|
|
3
|
-
transitionService: TransitionService,
|
|
4
|
-
) => Function;
|
|
5
|
-
export declare const registerActivateViews: (
|
|
6
|
-
transitionService: TransitionService,
|
|
7
|
-
) => Function;
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export * from "./common/index";
|
|
2
|
-
export * from "./params/index";
|
|
3
|
-
export * from "./path/index";
|
|
4
|
-
export * from "./resolve/index";
|
|
5
|
-
export * from "./state/index";
|
|
6
|
-
export * from "./transition/index";
|
|
7
|
-
export * from "./url/index";
|
|
8
|
-
export * from "./view/index";
|
|
9
|
-
export * from "./globals";
|
|
10
|
-
export * from "./router";
|
|
11
|
-
export * from "./interface";
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import { Router } from "./router";
|
|
2
|
-
/**
|
|
3
|
-
* An interface for getting values from dependency injection.
|
|
4
|
-
*
|
|
5
|
-
* This is primarily used to get resolve values for a given token.
|
|
6
|
-
* An instance of the `NGInjector` can be retrieved from the current transition using [[Transition.injector]].
|
|
7
|
-
*
|
|
8
|
-
* ---
|
|
9
|
-
*
|
|
10
|
-
* If no resolve is found for a token, then it will delegate to the native injector.
|
|
11
|
-
* The native injector may be Angular 1 `$injector`, Angular 2 `Injector`, or a simple polyfill.
|
|
12
|
-
*
|
|
13
|
-
* In Angular 2, the native injector might be the root Injector,
|
|
14
|
-
* or it might be a lazy loaded `NgModule` injector scoped to a lazy load state tree.
|
|
15
|
-
*/
|
|
16
|
-
export interface NGInjector {
|
|
17
|
-
/**
|
|
18
|
-
* Gets a value from the injector.
|
|
19
|
-
*
|
|
20
|
-
* For a given token, returns the value from the injector that matches the token.
|
|
21
|
-
* If the token is for a resolve that has not yet been fetched, this throws an error.
|
|
22
|
-
*
|
|
23
|
-
* #### Example:
|
|
24
|
-
* ```js
|
|
25
|
-
* var myResolve = injector.get('myResolve');
|
|
26
|
-
* ```
|
|
27
|
-
*
|
|
28
|
-
* #### ng1 Example:
|
|
29
|
-
* ```js
|
|
30
|
-
* // Fetch StateService
|
|
31
|
-
* injector.get('$state').go('home');
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* #### ng2 Example:
|
|
35
|
-
* ```js
|
|
36
|
-
* import {StateService} from "ui-router-ng2";
|
|
37
|
-
* // Fetch StateService
|
|
38
|
-
* injector.get(StateService).go('home');
|
|
39
|
-
* ```
|
|
40
|
-
*
|
|
41
|
-
* #### Typescript Example:
|
|
42
|
-
* ```js
|
|
43
|
-
* var stringArray = injector.get<string[]>('myStringArray');
|
|
44
|
-
* ```
|
|
45
|
-
*
|
|
46
|
-
* ### `NOWAIT` policy
|
|
47
|
-
*
|
|
48
|
-
* When using [[ResolvePolicy.async]] === `NOWAIT`, the value returned from `get()` is a promise for the result.
|
|
49
|
-
* The promise is not automatically unwrapped.
|
|
50
|
-
*
|
|
51
|
-
* @param token the key for the value to get. May be a string, a class, or any arbitrary object.
|
|
52
|
-
* @return the Dependency Injection value that matches the token
|
|
53
|
-
*/
|
|
54
|
-
get(token: any): any;
|
|
55
|
-
/** Gets a value as type `T` (generics parameter) */
|
|
56
|
-
get<T>(token: any): T;
|
|
57
|
-
/**
|
|
58
|
-
* Asynchronously gets a value from the injector
|
|
59
|
-
*
|
|
60
|
-
* For a given token, returns a promise for the value from the injector that matches the token.
|
|
61
|
-
* If the token is for a resolve that has not yet been fetched, this triggers the resolve to load.
|
|
62
|
-
*
|
|
63
|
-
* #### Example:
|
|
64
|
-
* ```js
|
|
65
|
-
* return injector.getAsync('myResolve').then(value => {
|
|
66
|
-
* if (value === 'declined') return false;
|
|
67
|
-
* });
|
|
68
|
-
* ```
|
|
69
|
-
*
|
|
70
|
-
* @param token the key for the value to get. May be a string or arbitrary object.
|
|
71
|
-
* @return a Promise for the Dependency Injection value that matches the token
|
|
72
|
-
*/
|
|
73
|
-
getAsync(token: any): Promise<any>;
|
|
74
|
-
/** Asynchronously gets a value as type `T` (generics parameter) */
|
|
75
|
-
getAsync<T>(token: any): Promise<T>;
|
|
76
|
-
/**
|
|
77
|
-
* Gets a value from the native injector
|
|
78
|
-
*
|
|
79
|
-
* Returns a value from the native injector, bypassing anything in the [[ResolveContext]].
|
|
80
|
-
*
|
|
81
|
-
* Example:
|
|
82
|
-
* ```js
|
|
83
|
-
* let someThing = injector.getNative(SomeToken);
|
|
84
|
-
* ```
|
|
85
|
-
*
|
|
86
|
-
* @param token the key for the value to get. May be a string or arbitrary object.
|
|
87
|
-
* @return the Dependency Injection value that matches the token
|
|
88
|
-
*/
|
|
89
|
-
getNative(token: any): any;
|
|
90
|
-
getNative<T>(token: any): T;
|
|
91
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This module contains code for State Parameters.
|
|
3
|
-
*
|
|
4
|
-
* See [[ParamDeclaration]]
|
|
5
|
-
*
|
|
6
|
-
* @packageDocumentation @preferred
|
|
7
|
-
*/
|
|
8
|
-
export * from "./interface";
|
|
9
|
-
export * from "./param";
|
|
10
|
-
export * from "./paramTypes";
|
|
11
|
-
export * from "./stateParams";
|
|
12
|
-
export * from "./paramType";
|