@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,8 +1,8 @@
|
|
|
1
|
-
import { Param } from
|
|
2
|
-
import { ParamTypes } from
|
|
3
|
-
import { RawParams } from
|
|
4
|
-
import { UrlMatcherCompileConfig } from
|
|
5
|
-
import { ParamFactory } from
|
|
1
|
+
import { Param } from "../params/param";
|
|
2
|
+
import { ParamTypes } from "../params/paramTypes";
|
|
3
|
+
import { RawParams } from "../params/interface";
|
|
4
|
+
import { UrlMatcherCompileConfig } from "./interface";
|
|
5
|
+
import { ParamFactory } from "./urlMatcherFactory";
|
|
6
6
|
/**
|
|
7
7
|
* Matches URLs against patterns.
|
|
8
8
|
*
|
|
@@ -55,126 +55,131 @@ import { ParamFactory } from './urlMatcherFactory';
|
|
|
55
55
|
*
|
|
56
56
|
*/
|
|
57
57
|
export declare class UrlMatcher {
|
|
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
|
-
|
|
58
|
+
/** @internal */
|
|
59
|
+
static nameValidator: RegExp;
|
|
60
|
+
/** @internal */
|
|
61
|
+
private _cache;
|
|
62
|
+
/** @internal */
|
|
63
|
+
private _children;
|
|
64
|
+
/** @internal */
|
|
65
|
+
private _params;
|
|
66
|
+
/** @internal */
|
|
67
|
+
private _segments;
|
|
68
|
+
/** @internal */
|
|
69
|
+
private _compiled;
|
|
70
|
+
/** @internal */
|
|
71
|
+
private readonly config;
|
|
72
|
+
/** The pattern that was passed into the constructor */
|
|
73
|
+
pattern: string;
|
|
74
|
+
/** @internal */
|
|
75
|
+
static encodeDashes(str: string): string;
|
|
76
|
+
/** @internal Given a matcher, return an array with the matcher's path segments and path params, in order */
|
|
77
|
+
static pathSegmentsAndParams(matcher: UrlMatcher): any;
|
|
78
|
+
/** @internal Given a matcher, return an array with the matcher's query params */
|
|
79
|
+
static queryParams(matcher: UrlMatcher): Param[];
|
|
80
|
+
/**
|
|
81
|
+
* Compare two UrlMatchers
|
|
82
|
+
*
|
|
83
|
+
* This comparison function converts a UrlMatcher into static and dynamic path segments.
|
|
84
|
+
* Each static path segment is a static string between a path separator (slash character).
|
|
85
|
+
* Each dynamic segment is a path parameter.
|
|
86
|
+
*
|
|
87
|
+
* The comparison function sorts static segments before dynamic ones.
|
|
88
|
+
*/
|
|
89
|
+
static compare(a: UrlMatcher, b: UrlMatcher): number;
|
|
90
|
+
/**
|
|
91
|
+
* @param pattern The pattern to compile into a matcher.
|
|
92
|
+
* @param paramTypes The [[ParamTypes]] registry
|
|
93
|
+
* @param paramFactory A [[ParamFactory]] object
|
|
94
|
+
* @param config A [[UrlMatcherCompileConfig]] configuration object
|
|
95
|
+
*/
|
|
96
|
+
constructor(
|
|
97
|
+
pattern: string,
|
|
98
|
+
paramTypes: ParamTypes,
|
|
99
|
+
paramFactory: ParamFactory,
|
|
100
|
+
config?: UrlMatcherCompileConfig,
|
|
101
|
+
);
|
|
102
|
+
/**
|
|
103
|
+
* Creates a new concatenated UrlMatcher
|
|
104
|
+
*
|
|
105
|
+
* Builds a new UrlMatcher by appending another UrlMatcher to this one.
|
|
106
|
+
*
|
|
107
|
+
* @param url A `UrlMatcher` instance to append as a child of the current `UrlMatcher`.
|
|
108
|
+
*/
|
|
109
|
+
append(url: UrlMatcher): UrlMatcher;
|
|
110
|
+
/** @internal */
|
|
111
|
+
isRoot(): boolean;
|
|
112
|
+
/** Returns the input pattern string */
|
|
113
|
+
toString(): string;
|
|
114
|
+
private _getDecodedParamValue;
|
|
115
|
+
/**
|
|
116
|
+
* Tests the specified url/path against this matcher.
|
|
117
|
+
*
|
|
118
|
+
* Tests if the given url matches this matcher's pattern, and returns an object containing the captured
|
|
119
|
+
* parameter values. Returns null if the path does not match.
|
|
120
|
+
*
|
|
121
|
+
* The returned object contains the values
|
|
122
|
+
* of any search parameters that are mentioned in the pattern, but their value may be null if
|
|
123
|
+
* they are not present in `search`. This means that search parameters are always treated
|
|
124
|
+
* as optional.
|
|
125
|
+
*
|
|
126
|
+
* #### Example:
|
|
127
|
+
* ```js
|
|
128
|
+
* new UrlMatcher('/user/{id}?q&r').exec('/user/bob', {
|
|
129
|
+
* x: '1', q: 'hello'
|
|
130
|
+
* });
|
|
131
|
+
* // returns { id: 'bob', q: 'hello', r: null }
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @param path The URL path to match, e.g. `$location.path()`.
|
|
135
|
+
* @param search URL search parameters, e.g. `$location.search()`.
|
|
136
|
+
* @param hash URL hash e.g. `$location.hash()`.
|
|
137
|
+
* @param options
|
|
138
|
+
*
|
|
139
|
+
* @returns The captured parameter values.
|
|
140
|
+
*/
|
|
141
|
+
exec(path: string, search?: any, hash?: string, options?: any): RawParams;
|
|
142
|
+
/**
|
|
143
|
+
* @internal
|
|
144
|
+
* Returns all the [[Param]] objects of all path and search parameters of this pattern in order of appearance.
|
|
145
|
+
*
|
|
146
|
+
* @returns {Array.<Param>} An array of [[Param]] objects. Must be treated as read-only. If the
|
|
147
|
+
* pattern has no parameters, an empty array is returned.
|
|
148
|
+
*/
|
|
149
|
+
parameters(opts?: any): Param[];
|
|
150
|
+
/**
|
|
151
|
+
* @internal
|
|
152
|
+
* Returns a single parameter from this UrlMatcher by id
|
|
153
|
+
*
|
|
154
|
+
* @param id
|
|
155
|
+
* @param opts
|
|
156
|
+
* @returns {T|Param|any|boolean|UrlMatcher|null}
|
|
157
|
+
*/
|
|
158
|
+
parameter(id: string, opts?: any): Param;
|
|
159
|
+
/**
|
|
160
|
+
* Validates the input parameter values against this UrlMatcher
|
|
161
|
+
*
|
|
162
|
+
* Checks an object hash of parameters to validate their correctness according to the parameter
|
|
163
|
+
* types of this `UrlMatcher`.
|
|
164
|
+
*
|
|
165
|
+
* @param params The object hash of parameters to validate.
|
|
166
|
+
* @returns Returns `true` if `params` validates, otherwise `false`.
|
|
167
|
+
*/
|
|
168
|
+
validates(params: RawParams): boolean;
|
|
169
|
+
/**
|
|
170
|
+
* Given a set of parameter values, creates a URL from this UrlMatcher.
|
|
171
|
+
*
|
|
172
|
+
* Creates a URL that matches this pattern by substituting the specified values
|
|
173
|
+
* for the path and search parameters.
|
|
174
|
+
*
|
|
175
|
+
* #### Example:
|
|
176
|
+
* ```js
|
|
177
|
+
* new UrlMatcher('/user/{id}?q').format({ id:'bob', q:'yes' });
|
|
178
|
+
* // returns '/user/bob?q=yes'
|
|
179
|
+
* ```
|
|
180
|
+
*
|
|
181
|
+
* @param values the values to substitute for the parameters in this pattern.
|
|
182
|
+
* @returns the formatted URL (path and optionally search part).
|
|
183
|
+
*/
|
|
184
|
+
format(values?: RawParams): string;
|
|
180
185
|
}
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { UrlMatcher } from
|
|
2
|
-
import { Param, ParamType, ParamTypeDefinition } from
|
|
3
|
-
import { UrlMatcherCompileConfig } from
|
|
4
|
-
import { StateDeclaration } from
|
|
5
|
-
import { UIRouter } from
|
|
1
|
+
import { UrlMatcher } from "./urlMatcher";
|
|
2
|
+
import { Param, ParamType, ParamTypeDefinition } from "../params";
|
|
3
|
+
import { UrlMatcherCompileConfig } from "./interface";
|
|
4
|
+
import { StateDeclaration } from "../state";
|
|
5
|
+
import { UIRouter } from "../router";
|
|
6
6
|
export declare class ParamFactory {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
private router;
|
|
8
|
+
fromConfig(id: string, type: ParamType, state: StateDeclaration): Param;
|
|
9
|
+
fromPath(id: string, type: ParamType, state: StateDeclaration): Param;
|
|
10
|
+
fromSearch(id: string, type: ParamType, state: StateDeclaration): Param;
|
|
11
|
+
constructor(router: UIRouter);
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
14
|
* Factory for [[UrlMatcher]] instances.
|
|
@@ -17,36 +17,40 @@ export declare class ParamFactory {
|
|
|
17
17
|
* `$urlMatcherFactory` or ng1 providers as `$urlMatcherFactoryProvider`.
|
|
18
18
|
*/
|
|
19
19
|
export declare class UrlMatcherFactory {
|
|
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
|
-
|
|
20
|
+
private router;
|
|
21
|
+
/** Creates a new [[Param]] for a given location (DefType) */
|
|
22
|
+
paramFactory: ParamFactory;
|
|
23
|
+
UrlMatcher: typeof UrlMatcher;
|
|
24
|
+
Param: typeof Param;
|
|
25
|
+
constructor(/** @internal */ router: UIRouter);
|
|
26
|
+
/**
|
|
27
|
+
* Creates a [[UrlMatcher]] for the specified pattern.
|
|
28
|
+
*
|
|
29
|
+
* @param pattern The URL pattern.
|
|
30
|
+
* @param config The config object hash.
|
|
31
|
+
* @returns The UrlMatcher.
|
|
32
|
+
*/
|
|
33
|
+
compile(pattern: string, config?: UrlMatcherCompileConfig): UrlMatcher;
|
|
34
|
+
/**
|
|
35
|
+
* Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
|
|
36
|
+
*
|
|
37
|
+
* @param object The object to perform the type check against.
|
|
38
|
+
* @returns `true` if the object matches the `UrlMatcher` interface, by
|
|
39
|
+
* implementing all the same methods.
|
|
40
|
+
*/
|
|
41
|
+
isMatcher(object: any): boolean;
|
|
42
|
+
/** @internal */
|
|
43
|
+
$get(): this;
|
|
44
|
+
/** @deprecated use [[UrlConfig.caseInsensitive]] */
|
|
45
|
+
caseInsensitive: (value?: boolean) => boolean;
|
|
46
|
+
/** @deprecated use [[UrlConfig.defaultSquashPolicy]] */
|
|
47
|
+
defaultSquashPolicy: (value?: boolean | string) => string | boolean;
|
|
48
|
+
/** @deprecated use [[UrlConfig.strictMode]] */
|
|
49
|
+
strictMode: (value?: boolean) => boolean;
|
|
50
|
+
/** @deprecated use [[UrlConfig.type]] */
|
|
51
|
+
type: (
|
|
52
|
+
name: string,
|
|
53
|
+
definition?: ParamTypeDefinition,
|
|
54
|
+
definitionFn?: () => ParamTypeDefinition,
|
|
55
|
+
) => any;
|
|
52
56
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { UrlMatcher } from
|
|
2
|
-
import { RawParams } from
|
|
3
|
-
import { UIRouter } from
|
|
4
|
-
import { UrlRuleFactory } from
|
|
5
|
-
import { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from
|
|
6
|
-
import { TargetState, TargetStateDef } from
|
|
1
|
+
import { UrlMatcher } from "./urlMatcher";
|
|
2
|
+
import { RawParams } from "../params";
|
|
3
|
+
import { UIRouter } from "../router";
|
|
4
|
+
import { UrlRuleFactory } from "./urlRule";
|
|
5
|
+
import { MatchResult, UrlParts, UrlRule, UrlRuleHandlerFn } from "./interface";
|
|
6
|
+
import { TargetState, TargetStateDef } from "../state";
|
|
7
7
|
/**
|
|
8
8
|
* Updates URL and responds to URL changes
|
|
9
9
|
*
|
|
@@ -13,73 +13,89 @@ import { TargetState, TargetStateDef } from '../state';
|
|
|
13
13
|
* For configuring URL rules, use the [[UrlRules]] which can be found as [[UrlService.rules]].
|
|
14
14
|
*/
|
|
15
15
|
export declare class UrlRouter {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
16
|
+
private router;
|
|
17
|
+
/** used to create [[UrlRule]] objects for common cases */
|
|
18
|
+
urlRuleFactory: UrlRuleFactory;
|
|
19
|
+
/** @internal */ private location;
|
|
20
|
+
/** @internal */
|
|
21
|
+
constructor(/** @internal */ router: UIRouter);
|
|
22
|
+
/** Internal API. */
|
|
23
|
+
update(read?: boolean): void;
|
|
24
|
+
/**
|
|
25
|
+
* Internal API.
|
|
26
|
+
*
|
|
27
|
+
* Pushes a new location to the browser history.
|
|
28
|
+
*
|
|
29
|
+
* @internal
|
|
30
|
+
* @param urlMatcher
|
|
31
|
+
* @param params
|
|
32
|
+
* @param options
|
|
33
|
+
*/
|
|
34
|
+
push(
|
|
35
|
+
urlMatcher: UrlMatcher,
|
|
36
|
+
params?: RawParams,
|
|
37
|
+
options?: {
|
|
38
|
+
replace?: string | boolean;
|
|
39
|
+
},
|
|
40
|
+
): void;
|
|
41
|
+
/**
|
|
42
|
+
* Builds and returns a URL with interpolated parameters
|
|
43
|
+
*
|
|
44
|
+
* #### Example:
|
|
45
|
+
* ```js
|
|
46
|
+
* matcher = $umf.compile("/about/:person");
|
|
47
|
+
* params = { person: "bob" };
|
|
48
|
+
* $bob = $urlRouter.href(matcher, params);
|
|
49
|
+
* // $bob == "/about/bob";
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
|
|
53
|
+
* @param params An object of parameter values to fill the matcher's required parameters.
|
|
54
|
+
* @param options Options object. The options are:
|
|
55
|
+
*
|
|
56
|
+
* - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
|
|
57
|
+
*
|
|
58
|
+
* @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
|
|
59
|
+
*/
|
|
60
|
+
href(
|
|
61
|
+
urlMatcher: UrlMatcher,
|
|
62
|
+
params?: any,
|
|
63
|
+
options?: {
|
|
64
|
+
absolute: boolean;
|
|
65
|
+
},
|
|
66
|
+
): string;
|
|
67
|
+
/** @deprecated use [[UrlService.sync]]*/
|
|
68
|
+
sync: (evt?: any) => void;
|
|
69
|
+
/** @deprecated use [[UrlService.listen]]*/
|
|
70
|
+
listen: (enabled?: boolean) => Function;
|
|
71
|
+
/** @deprecated use [[UrlService.deferIntercept]]*/
|
|
72
|
+
deferIntercept: (defer?: boolean) => void;
|
|
73
|
+
/** @deprecated use [[UrlService.interceptDeferred]]*/
|
|
74
|
+
interceptDeferred: boolean;
|
|
75
|
+
/** @deprecated use [[UrlService.match]]*/
|
|
76
|
+
match: (urlParts: UrlParts) => MatchResult;
|
|
77
|
+
/** @deprecated use [[UrlRules.initial]]*/
|
|
78
|
+
initial: (
|
|
79
|
+
handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef,
|
|
80
|
+
) => void;
|
|
81
|
+
/** @deprecated use [[UrlRules.otherwise]]*/
|
|
82
|
+
otherwise: (
|
|
83
|
+
handler: string | UrlRuleHandlerFn | TargetState | TargetStateDef,
|
|
84
|
+
) => void;
|
|
85
|
+
/** @deprecated use [[UrlRules.removeRule]]*/
|
|
86
|
+
removeRule: (rule: UrlRule) => void;
|
|
87
|
+
/** @deprecated use [[UrlRules.rule]]*/
|
|
88
|
+
rule: (rule: UrlRule) => Function;
|
|
89
|
+
/** @deprecated use [[UrlRules.rules]]*/
|
|
90
|
+
rules: () => UrlRule[];
|
|
91
|
+
/** @deprecated use [[UrlRules.sort]]*/
|
|
92
|
+
sort: (compareFn?: (a: UrlRule, b: UrlRule) => number) => void;
|
|
93
|
+
/** @deprecated use [[UrlRules.when]]*/
|
|
94
|
+
when: (
|
|
95
|
+
matcher: RegExp | UrlMatcher | string,
|
|
96
|
+
handler: string | UrlRuleHandlerFn,
|
|
97
|
+
options?: {
|
|
98
|
+
priority: number;
|
|
99
|
+
},
|
|
100
|
+
) => UrlRule;
|
|
85
101
|
}
|