@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,65 +1,77 @@
|
|
|
1
|
-
import { RawParams } from
|
|
2
|
-
import { ParamType } from
|
|
3
|
-
import { StateDeclaration } from
|
|
4
|
-
import { UrlConfig } from
|
|
1
|
+
import { RawParams } from "../params/interface";
|
|
2
|
+
import { ParamType } from "./paramType";
|
|
3
|
+
import { StateDeclaration } from "../state";
|
|
4
|
+
import { UrlConfig } from "../url";
|
|
5
5
|
declare enum DefType {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
PATH = 0,
|
|
7
|
+
SEARCH = 1,
|
|
8
|
+
CONFIG = 2,
|
|
9
9
|
}
|
|
10
10
|
export { DefType };
|
|
11
11
|
export declare class Param {
|
|
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
|
-
|
|
12
|
+
id: string;
|
|
13
|
+
type: ParamType;
|
|
14
|
+
location: DefType;
|
|
15
|
+
isOptional: boolean;
|
|
16
|
+
dynamic: boolean;
|
|
17
|
+
raw: boolean;
|
|
18
|
+
squash: boolean | string;
|
|
19
|
+
replace: [
|
|
20
|
+
{
|
|
21
|
+
to: any;
|
|
22
|
+
from: any;
|
|
23
|
+
},
|
|
24
|
+
];
|
|
25
|
+
inherit: boolean;
|
|
26
|
+
array: boolean;
|
|
27
|
+
config: any;
|
|
28
|
+
/** Cache the default value if it is a static value */
|
|
29
|
+
_defaultValueCache: {
|
|
30
|
+
defaultValue: any;
|
|
31
|
+
};
|
|
32
|
+
static values(params: Param[], values?: RawParams): RawParams;
|
|
33
|
+
/**
|
|
34
|
+
* Finds [[Param]] objects which have different param values
|
|
35
|
+
*
|
|
36
|
+
* Filters a list of [[Param]] objects to only those whose parameter values differ in two param value objects
|
|
37
|
+
*
|
|
38
|
+
* @param params: The list of Param objects to filter
|
|
39
|
+
* @param values1: The first set of parameter values
|
|
40
|
+
* @param values2: the second set of parameter values
|
|
41
|
+
*
|
|
42
|
+
* @returns any Param objects whose values were different between values1 and values2
|
|
43
|
+
*/
|
|
44
|
+
static changed(
|
|
45
|
+
params: Param[],
|
|
46
|
+
values1?: RawParams,
|
|
47
|
+
values2?: RawParams,
|
|
48
|
+
): Param[];
|
|
49
|
+
/**
|
|
50
|
+
* Checks if two param value objects are equal (for a set of [[Param]] objects)
|
|
51
|
+
*
|
|
52
|
+
* @param params The list of [[Param]] objects to check
|
|
53
|
+
* @param values1 The first set of param values
|
|
54
|
+
* @param values2 The second set of param values
|
|
55
|
+
*
|
|
56
|
+
* @returns true if the param values in values1 and values2 are equal
|
|
57
|
+
*/
|
|
58
|
+
static equals(params: Param[], values1?: {}, values2?: {}): boolean;
|
|
59
|
+
/** Returns true if a the parameter values are valid, according to the Param definitions */
|
|
60
|
+
static validates(params: Param[], values?: RawParams): boolean;
|
|
61
|
+
constructor(
|
|
62
|
+
id: string,
|
|
63
|
+
type: ParamType,
|
|
64
|
+
location: DefType,
|
|
65
|
+
urlConfig: UrlConfig,
|
|
66
|
+
state: StateDeclaration,
|
|
67
|
+
);
|
|
68
|
+
isDefaultValue(value: any): boolean;
|
|
69
|
+
/**
|
|
70
|
+
* [Internal] Gets the decoded representation of a value if the value is defined, otherwise, returns the
|
|
71
|
+
* default value, which may be the result of an injectable function.
|
|
72
|
+
*/
|
|
73
|
+
value(value?: any): any;
|
|
74
|
+
isSearch(): boolean;
|
|
75
|
+
validates(value: any): boolean;
|
|
76
|
+
toString(): string;
|
|
65
77
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParamTypeDefinition } from
|
|
1
|
+
import { ParamTypeDefinition } from "./interface";
|
|
2
2
|
/**
|
|
3
3
|
* An internal class which implements [[ParamTypeDefinition]].
|
|
4
4
|
*
|
|
@@ -23,43 +23,43 @@ import { ParamTypeDefinition } from './interface';
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare class ParamType implements ParamTypeDefinition {
|
|
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
|
-
|
|
26
|
+
/** @inheritdoc */
|
|
27
|
+
pattern: RegExp;
|
|
28
|
+
/** The name/id of the parameter type */
|
|
29
|
+
name: string;
|
|
30
|
+
/** @inheritdoc */
|
|
31
|
+
raw: boolean;
|
|
32
|
+
/** @inheritdoc */
|
|
33
|
+
dynamic: boolean;
|
|
34
|
+
/** @inheritdoc */
|
|
35
|
+
inherit: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* @param def A configuration object which contains the custom type definition. The object's
|
|
38
|
+
* properties will override the default methods and/or pattern in `ParamType`'s public interface.
|
|
39
|
+
* @returns a new ParamType object
|
|
40
|
+
*/
|
|
41
|
+
constructor(def: ParamTypeDefinition);
|
|
42
|
+
/** @inheritdoc */
|
|
43
|
+
is(val: any, key?: string): boolean;
|
|
44
|
+
/** @inheritdoc */
|
|
45
|
+
encode(val: any, key?: string): string | string[];
|
|
46
|
+
/** @inheritdoc */
|
|
47
|
+
decode(val: string, key?: string): any;
|
|
48
|
+
/** @inheritdoc */
|
|
49
|
+
equals(a: any, b: any): boolean;
|
|
50
|
+
$subPattern(): string;
|
|
51
|
+
toString(): string;
|
|
52
|
+
/** Given an encoded string, or a decoded object, returns a decoded object */
|
|
53
|
+
$normalize(val: any): any;
|
|
54
|
+
/**
|
|
55
|
+
* Wraps an existing custom ParamType as an array of ParamType, depending on 'mode'.
|
|
56
|
+
* e.g.:
|
|
57
|
+
* - urlmatcher pattern "/path?{queryParam[]:int}"
|
|
58
|
+
* - url: "/path?queryParam=1&queryParam=2
|
|
59
|
+
* - $stateParams.queryParam will be [1, 2]
|
|
60
|
+
* if `mode` is "auto", then
|
|
61
|
+
* - url: "/path?queryParam=1 will create $stateParams.queryParam: 1
|
|
62
|
+
* - url: "/path?queryParam=1&queryParam=2 will create $stateParams.queryParam: [1, 2]
|
|
63
|
+
*/
|
|
64
|
+
$asArray(mode: boolean | "auto", isSearch: boolean): any;
|
|
65
65
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ParamTypeDefinition } from
|
|
1
|
+
import { ParamTypeDefinition } from "./interface";
|
|
2
2
|
/**
|
|
3
3
|
* A registry for parameter types.
|
|
4
4
|
*
|
|
@@ -23,168 +23,172 @@ import { ParamTypeDefinition } from './interface';
|
|
|
23
23
|
* ```
|
|
24
24
|
*/
|
|
25
25
|
export declare class ParamTypes {
|
|
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
|
-
|
|
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
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Built-in parameter type: `string`
|
|
28
|
+
*
|
|
29
|
+
* This parameter type coerces values to strings.
|
|
30
|
+
* It matches anything (`new RegExp(".*")`) in the URL
|
|
31
|
+
*/
|
|
32
|
+
static string: ParamTypeDefinition;
|
|
33
|
+
/**
|
|
34
|
+
* Built-in parameter type: `path`
|
|
35
|
+
*
|
|
36
|
+
* This parameter type is the default type for path parameters.
|
|
37
|
+
* A path parameter is any parameter declared in the path portion of a url
|
|
38
|
+
*
|
|
39
|
+
* - `/foo/:param1/:param2`: two path parameters
|
|
40
|
+
*
|
|
41
|
+
* This parameter type behaves exactly like the [[string]] type with one exception.
|
|
42
|
+
* When matching parameter values in the URL, the `path` type does not match forward slashes `/`.
|
|
43
|
+
*
|
|
44
|
+
* #### Angular 1 note:
|
|
45
|
+
* In ng1, this type is overridden with one that pre-encodes slashes as `~2F` instead of `%2F`.
|
|
46
|
+
* For more details about this angular 1 behavior, see: https://github.com/angular-ui/ui-router/issues/2598
|
|
47
|
+
*/
|
|
48
|
+
static path: ParamTypeDefinition;
|
|
49
|
+
/**
|
|
50
|
+
* Built-in parameter type: `query`
|
|
51
|
+
*
|
|
52
|
+
* This parameter type is the default type for query/search parameters.
|
|
53
|
+
* It behaves the same as the [[string]] parameter type.
|
|
54
|
+
*
|
|
55
|
+
* A query parameter is any parameter declared in the query/search portion of a url
|
|
56
|
+
*
|
|
57
|
+
* - `/bar?param2`: a query parameter
|
|
58
|
+
*/
|
|
59
|
+
static query: ParamTypeDefinition;
|
|
60
|
+
/**
|
|
61
|
+
* Built-in parameter type: `hash`
|
|
62
|
+
*
|
|
63
|
+
* This parameter type is used for the `#` parameter (the hash)
|
|
64
|
+
* It behaves the same as the [[string]] parameter type.
|
|
65
|
+
*/
|
|
66
|
+
static hash: ParamTypeDefinition;
|
|
67
|
+
/**
|
|
68
|
+
* Built-in parameter type: `int`
|
|
69
|
+
*
|
|
70
|
+
* This parameter type serializes javascript integers (`number`s which represent an integer) to the URL.
|
|
71
|
+
*
|
|
72
|
+
* #### Example:
|
|
73
|
+
* ```js
|
|
74
|
+
* .state({
|
|
75
|
+
* name: 'user',
|
|
76
|
+
* url: '/user/{id:int}'
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
* ```js
|
|
80
|
+
* $state.go('user', { id: 1298547 });
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* The URL will serialize to: `/user/1298547`.
|
|
84
|
+
*
|
|
85
|
+
* When the parameter value is read, it will be the `number` `1298547`, not the string `"1298547"`.
|
|
86
|
+
*/
|
|
87
|
+
static int: ParamTypeDefinition;
|
|
88
|
+
/**
|
|
89
|
+
* Built-in parameter type: `bool`
|
|
90
|
+
*
|
|
91
|
+
* This parameter type serializes `true`/`false` as `1`/`0`
|
|
92
|
+
*
|
|
93
|
+
* #### Example:
|
|
94
|
+
* ```js
|
|
95
|
+
* .state({
|
|
96
|
+
* name: 'inbox',
|
|
97
|
+
* url: '/inbox?{unread:bool}'
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
* ```js
|
|
101
|
+
* $state.go('inbox', { unread: true });
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* The URL will serialize to: `/inbox?unread=1`.
|
|
105
|
+
*
|
|
106
|
+
* Conversely, if the url is `/inbox?unread=0`, the value of the `unread` parameter will be a `false`.
|
|
107
|
+
*/
|
|
108
|
+
static bool: ParamTypeDefinition;
|
|
109
|
+
/**
|
|
110
|
+
* Built-in parameter type: `date`
|
|
111
|
+
*
|
|
112
|
+
* This parameter type can be used to serialize Javascript dates as parameter values.
|
|
113
|
+
*
|
|
114
|
+
* #### Example:
|
|
115
|
+
* ```js
|
|
116
|
+
* .state({
|
|
117
|
+
* name: 'search',
|
|
118
|
+
* url: '/search?{start:date}'
|
|
119
|
+
* });
|
|
120
|
+
* ```
|
|
121
|
+
* ```js
|
|
122
|
+
* $state.go('search', { start: new Date(2000, 0, 1) });
|
|
123
|
+
* ```
|
|
124
|
+
*
|
|
125
|
+
* The URL will serialize to: `/search?start=2000-01-01`.
|
|
126
|
+
*
|
|
127
|
+
* Conversely, if the url is `/search?start=2016-12-25`, the value of the `start` parameter will be a `Date` object where:
|
|
128
|
+
*
|
|
129
|
+
* - `date.getFullYear() === 2016`
|
|
130
|
+
* - `date.getMonth() === 11` (month is 0-based)
|
|
131
|
+
* - `date.getDate() === 25`
|
|
132
|
+
*/
|
|
133
|
+
static date: ParamTypeDefinition;
|
|
134
|
+
/**
|
|
135
|
+
* Built-in parameter type: `json`
|
|
136
|
+
*
|
|
137
|
+
* This parameter type can be used to serialize javascript objects into the URL using JSON serialization.
|
|
138
|
+
*
|
|
139
|
+
* #### Example:
|
|
140
|
+
* This example serializes an plain javascript object to the URL
|
|
141
|
+
* ```js
|
|
142
|
+
* .state({
|
|
143
|
+
* name: 'map',
|
|
144
|
+
* url: '/map/{coords:json}'
|
|
145
|
+
* });
|
|
146
|
+
* ```
|
|
147
|
+
* ```js
|
|
148
|
+
* $state.go('map', { coords: { x: 10399.2, y: 49071 });
|
|
149
|
+
* ```
|
|
150
|
+
*
|
|
151
|
+
* The URL will serialize to: `/map/%7B%22x%22%3A10399.2%2C%22y%22%3A49071%7D`
|
|
152
|
+
*/
|
|
153
|
+
static json: ParamTypeDefinition;
|
|
154
|
+
/**
|
|
155
|
+
* Built-in parameter type: `any`
|
|
156
|
+
*
|
|
157
|
+
* This parameter type is used by default for url-less parameters (parameters that do not appear in the URL).
|
|
158
|
+
* This type does not encode or decode.
|
|
159
|
+
* It is compared using a deep `equals` comparison.
|
|
160
|
+
*
|
|
161
|
+
* #### Example:
|
|
162
|
+
* This example defines a non-url parameter on a [[StateDeclaration]].
|
|
163
|
+
* ```js
|
|
164
|
+
* .state({
|
|
165
|
+
* name: 'new',
|
|
166
|
+
* url: '/new',
|
|
167
|
+
* params: {
|
|
168
|
+
* inrepyto: null
|
|
169
|
+
* }
|
|
170
|
+
* });
|
|
171
|
+
* ```
|
|
172
|
+
* ```js
|
|
173
|
+
* $state.go('new', { inreplyto: currentMessage });
|
|
174
|
+
* ```
|
|
175
|
+
*/
|
|
176
|
+
static any: ParamTypeDefinition;
|
|
177
|
+
types: any;
|
|
178
|
+
enqueue: boolean;
|
|
179
|
+
typeQueue: any[];
|
|
180
|
+
private defaultTypes;
|
|
181
|
+
constructor();
|
|
182
|
+
dispose(): void;
|
|
183
|
+
/**
|
|
184
|
+
* Registers a parameter type
|
|
185
|
+
*
|
|
186
|
+
* End users should call [[UrlMatcherFactory.type]], which delegates to this method.
|
|
187
|
+
*/
|
|
188
|
+
type(
|
|
189
|
+
name: string,
|
|
190
|
+
definition?: ParamTypeDefinition,
|
|
191
|
+
definitionFn?: () => ParamTypeDefinition,
|
|
192
|
+
): any;
|
|
193
|
+
_flushTypeQueue(): void;
|
|
190
194
|
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { Obj } from
|
|
2
|
-
import { StateObject } from
|
|
1
|
+
import { Obj } from "../common/common";
|
|
2
|
+
import { StateObject } from "../state/stateObject";
|
|
3
3
|
export declare class StateParams {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
constructor(params?: Obj);
|
|
6
|
+
/**
|
|
7
|
+
* Merges a set of parameters with all parameters inherited between the common parents of the
|
|
8
|
+
* current state and a given destination state.
|
|
9
|
+
*
|
|
10
|
+
* @param {Object} newParams The set of parameters which will be composited with inherited params.
|
|
11
|
+
* @param {Object} $current Internal definition of object representing the current state.
|
|
12
|
+
* @param {Object} $to Internal definition of object representing state to transition to.
|
|
13
|
+
*/
|
|
14
|
+
$inherit(newParams: Obj, $current: StateObject, $to: StateObject): any;
|
|
15
15
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
1
|
+
export * from "./pathNode";
|
|
2
|
+
export * from "./pathUtils";
|