@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
|
@@ -8,54 +8,58 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
* @preferred
|
|
10
10
|
*/
|
|
11
|
-
import { LocationConfig } from
|
|
12
|
-
import { UIRouter } from
|
|
13
|
-
import {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
import { LocationConfig } from "../common";
|
|
12
|
+
import { UIRouter } from "../router";
|
|
13
|
+
import {
|
|
14
|
+
StateDeclaration,
|
|
15
|
+
StateObject,
|
|
16
|
+
TargetState,
|
|
17
|
+
TargetStateDef,
|
|
18
|
+
} from "../state";
|
|
19
|
+
import { UrlMatcher } from "./urlMatcher";
|
|
20
|
+
import { UrlConfig } from "./urlConfig";
|
|
21
|
+
import { UrlRules } from "./urlRules";
|
|
22
|
+
import { UrlService } from "./urlService";
|
|
18
23
|
export interface UrlMatcherCompileConfig {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
24
|
+
state?: StateDeclaration;
|
|
25
|
+
strict?: boolean;
|
|
26
|
+
caseInsensitive?: boolean;
|
|
27
|
+
decodeParams?: boolean;
|
|
23
28
|
}
|
|
24
29
|
/** @deprecated use [[UrlConfig]] */
|
|
25
|
-
export interface UrlConfigApi extends LocationConfig, UrlMatcherConfig {
|
|
26
|
-
}
|
|
30
|
+
export interface UrlConfigApi extends LocationConfig, UrlMatcherConfig {}
|
|
27
31
|
/** @deprecated use [[UrlConfig]] */
|
|
28
32
|
export interface UrlMatcherConfig {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
/** See: [[UrlConfig.caseInsensitive]] */ caseInsensitive: UrlConfig["caseInsensitive"];
|
|
34
|
+
/** See: [[UrlConfig.strictMode]] */ strictMode: UrlConfig["strictMode"];
|
|
35
|
+
/** See: [[UrlConfig.defaultSquashPolicy]] */ defaultSquashPolicy: UrlConfig["defaultSquashPolicy"];
|
|
36
|
+
/** See: [[UrlConfig.type]] */ type: UrlConfig["type"];
|
|
33
37
|
}
|
|
34
38
|
/** @deprecated use [[UrlService]] */
|
|
35
39
|
export interface UrlSyncApi {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
40
|
+
/** See: [[UrlService.sync]] */ sync: UrlService["sync"];
|
|
41
|
+
/** See: [[UrlService.listen]] */ listen: UrlService["listen"];
|
|
42
|
+
/** See: [[UrlService.deferIntercept]] */ deferIntercept: UrlService["deferIntercept"];
|
|
39
43
|
}
|
|
40
44
|
/** @deprecated use [[UrlRules]] */
|
|
41
45
|
export interface UrlRulesApi {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
/** See: [[UrlRules.sort]] */ sort: UrlRules["sort"];
|
|
47
|
+
/** See: [[UrlRules.when]] */ when: UrlRules["when"];
|
|
48
|
+
/** See: [[UrlRules.otherwise]] */ otherwise: UrlRules["otherwise"];
|
|
49
|
+
/** See: [[UrlRules.initial]] */ initial: UrlRules["initial"];
|
|
50
|
+
/** See: [[UrlRules.rules]] */ rules: UrlRules["rules"];
|
|
51
|
+
/** See: [[UrlRules.rule]] */ rule: UrlRules["rule"];
|
|
52
|
+
/** See: [[UrlRules.removeRule]] */ removeRule: UrlRules["removeRule"];
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
51
55
|
* An object containing the three parts of a URL
|
|
52
56
|
*/
|
|
53
57
|
export interface UrlParts {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
58
|
+
path: string;
|
|
59
|
+
search?: {
|
|
60
|
+
[key: string]: any;
|
|
61
|
+
};
|
|
62
|
+
hash?: string;
|
|
59
63
|
}
|
|
60
64
|
/**
|
|
61
65
|
* A UrlRule match result
|
|
@@ -63,12 +67,12 @@ export interface UrlParts {
|
|
|
63
67
|
* The result of UrlRouter.match()
|
|
64
68
|
*/
|
|
65
69
|
export interface MatchResult {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
/** The matched value from a [[UrlRule]] */
|
|
71
|
+
match: any;
|
|
72
|
+
/** The rule that matched */
|
|
73
|
+
rule: UrlRule;
|
|
74
|
+
/** The match result weight */
|
|
75
|
+
weight: number;
|
|
72
76
|
}
|
|
73
77
|
/**
|
|
74
78
|
* A function that matches the URL for a [[UrlRule]]
|
|
@@ -79,7 +83,7 @@ export interface MatchResult {
|
|
|
79
83
|
* @return the matched value, either truthy or falsey
|
|
80
84
|
*/
|
|
81
85
|
export interface UrlRuleMatchFn {
|
|
82
|
-
|
|
86
|
+
(url?: UrlParts, router?: UIRouter): any;
|
|
83
87
|
}
|
|
84
88
|
/**
|
|
85
89
|
* Handler invoked when a rule is matched
|
|
@@ -91,66 +95,75 @@ export interface UrlRuleMatchFn {
|
|
|
91
95
|
* If the handler returns a [[TargetState]], the target state is activated.
|
|
92
96
|
*/
|
|
93
97
|
export interface UrlRuleHandlerFn {
|
|
94
|
-
|
|
98
|
+
(
|
|
99
|
+
matchValue?: any,
|
|
100
|
+
url?: UrlParts,
|
|
101
|
+
router?: UIRouter,
|
|
102
|
+
): string | TargetState | TargetStateDef | void;
|
|
95
103
|
}
|
|
96
104
|
/** @internal */
|
|
97
|
-
export declare type UrlRuleType =
|
|
105
|
+
export declare type UrlRuleType =
|
|
106
|
+
| "STATE"
|
|
107
|
+
| "URLMATCHER"
|
|
108
|
+
| "REGEXP"
|
|
109
|
+
| "RAW"
|
|
110
|
+
| "OTHER";
|
|
98
111
|
/**
|
|
99
112
|
* The interface for a URL Rule
|
|
100
113
|
*
|
|
101
114
|
* If you are creating a rule for use with [[UrlRules.rule]], it should implement this interface.
|
|
102
115
|
*/
|
|
103
116
|
export interface UrlRule {
|
|
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
|
-
|
|
117
|
+
/**
|
|
118
|
+
* The rule's ID.
|
|
119
|
+
*
|
|
120
|
+
* IDs are auto-assigned when the rule is registered, in increasing order.
|
|
121
|
+
*/
|
|
122
|
+
$id: number;
|
|
123
|
+
/**
|
|
124
|
+
* The rule's priority (defaults to 0).
|
|
125
|
+
*
|
|
126
|
+
* This can be used to explicitly modify the rule's priority.
|
|
127
|
+
* Higher numbers are higher priority.
|
|
128
|
+
*/
|
|
129
|
+
priority: number;
|
|
130
|
+
/** @internal */
|
|
131
|
+
_group: number;
|
|
132
|
+
/** The type of the rule */
|
|
133
|
+
type: UrlRuleType;
|
|
134
|
+
/**
|
|
135
|
+
* This function should match the url and return the match details
|
|
136
|
+
*
|
|
137
|
+
* See [[UrlRuleMatchFn]] for details
|
|
138
|
+
*/
|
|
139
|
+
match: UrlRuleMatchFn;
|
|
140
|
+
/**
|
|
141
|
+
* This function is called if the rule matched, and was selected as the "best match".
|
|
142
|
+
* This function handles the rule match event.
|
|
143
|
+
*
|
|
144
|
+
* See [[UrlRuleHandlerFn]] for details
|
|
145
|
+
*/
|
|
146
|
+
handler: UrlRuleHandlerFn;
|
|
147
|
+
/**
|
|
148
|
+
* The priority of a given match.
|
|
149
|
+
*
|
|
150
|
+
* Sometimes more than one UrlRule might have matched.
|
|
151
|
+
* This method is used to choose the best match.
|
|
152
|
+
*
|
|
153
|
+
* If multiple rules matched, each rule's `matchPriority` is called with the value from [[match]].
|
|
154
|
+
* The rule with the highest `matchPriority` has its [[handler]] called.
|
|
155
|
+
*/
|
|
156
|
+
matchPriority(match: any): number;
|
|
144
157
|
}
|
|
145
158
|
export interface MatcherUrlRule extends UrlRule {
|
|
146
|
-
|
|
147
|
-
|
|
159
|
+
type: "URLMATCHER" | "STATE";
|
|
160
|
+
urlMatcher: UrlMatcher;
|
|
148
161
|
}
|
|
149
162
|
export interface StateRule extends MatcherUrlRule {
|
|
150
|
-
|
|
151
|
-
|
|
163
|
+
type: "STATE";
|
|
164
|
+
state: StateObject;
|
|
152
165
|
}
|
|
153
166
|
export interface RegExpRule extends UrlRule {
|
|
154
|
-
|
|
155
|
-
|
|
167
|
+
type: "REGEXP";
|
|
168
|
+
regexp: RegExp;
|
|
156
169
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Disposable } from
|
|
2
|
-
import { UIRouter } from
|
|
3
|
-
import { ParamTypeDefinition, ParamTypes } from
|
|
1
|
+
import { Disposable } from "../interface";
|
|
2
|
+
import { UIRouter } from "../router";
|
|
3
|
+
import { ParamTypeDefinition, ParamTypes } from "../params";
|
|
4
4
|
/**
|
|
5
5
|
* An API to customize the URL behavior and retrieve URL configuration
|
|
6
6
|
*
|
|
@@ -15,127 +15,131 @@ import { ParamTypeDefinition, ParamTypes } from '../params';
|
|
|
15
15
|
* This API is found at `router.urlService.config` (see: [[UIRouter.urlService]], [[URLService.config]])
|
|
16
16
|
*/
|
|
17
17
|
export declare class UrlConfig implements Disposable {
|
|
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
|
-
|
|
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
|
-
|
|
18
|
+
private router;
|
|
19
|
+
/** @internal */ paramTypes: ParamTypes;
|
|
20
|
+
/** @internal */ _decodeParams: boolean;
|
|
21
|
+
/** @internal */ _isCaseInsensitive: boolean;
|
|
22
|
+
/** @internal */ _isStrictMode: boolean;
|
|
23
|
+
/** @internal */ _defaultSquashPolicy: boolean | string;
|
|
24
|
+
/** @internal */ constructor(/** @internal */ router: UIRouter);
|
|
25
|
+
/** @internal */ dispose: () => void;
|
|
26
|
+
/**
|
|
27
|
+
* Gets the base Href, e.g., `http://localhost/approot/`
|
|
28
|
+
*
|
|
29
|
+
* @return the application's base href
|
|
30
|
+
*/
|
|
31
|
+
baseHref: () => string;
|
|
32
|
+
/**
|
|
33
|
+
* Gets or sets the hashPrefix
|
|
34
|
+
*
|
|
35
|
+
* This only applies when not running in [[html5Mode]] (pushstate mode)
|
|
36
|
+
*
|
|
37
|
+
* If the current url is `http://localhost/app#!/uirouter/path/#anchor`, it returns `!` which is the prefix for the "hashbang" portion.
|
|
38
|
+
*
|
|
39
|
+
* @return the hash prefix
|
|
40
|
+
*/
|
|
41
|
+
hashPrefix: (newprefix?: string) => string;
|
|
42
|
+
/**
|
|
43
|
+
* Gets the host, e.g., `localhost`
|
|
44
|
+
*
|
|
45
|
+
* @return the protocol
|
|
46
|
+
*/
|
|
47
|
+
host: () => string;
|
|
48
|
+
/**
|
|
49
|
+
* Returns true when running in pushstate mode
|
|
50
|
+
*
|
|
51
|
+
* @return true when running in html5 mode (pushstate mode).
|
|
52
|
+
*/
|
|
53
|
+
html5Mode: () => boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Gets the port, e.g., `80`
|
|
56
|
+
*
|
|
57
|
+
* @return the port number
|
|
58
|
+
*/
|
|
59
|
+
port: () => number;
|
|
60
|
+
/**
|
|
61
|
+
* Gets the protocol, e.g., `http`
|
|
62
|
+
*
|
|
63
|
+
* @return the protocol
|
|
64
|
+
*/
|
|
65
|
+
protocol: () => string;
|
|
66
|
+
/**
|
|
67
|
+
* Defines whether URL matching should be case sensitive (the default behavior), or not.
|
|
68
|
+
*
|
|
69
|
+
* #### Example:
|
|
70
|
+
* ```js
|
|
71
|
+
* // Allow case insensitive url matches
|
|
72
|
+
* urlService.config.caseInsensitive(true);
|
|
73
|
+
* ```
|
|
74
|
+
*
|
|
75
|
+
* @param value `false` to match URL in a case sensitive manner; otherwise `true`;
|
|
76
|
+
* @returns the current value of caseInsensitive
|
|
77
|
+
*/
|
|
78
|
+
caseInsensitive(value?: boolean): boolean;
|
|
79
|
+
/**
|
|
80
|
+
* Sets the default behavior when generating or matching URLs with default parameter values.
|
|
81
|
+
*
|
|
82
|
+
* #### Example:
|
|
83
|
+
* ```js
|
|
84
|
+
* // Remove default parameter values from the url
|
|
85
|
+
* urlService.config.defaultSquashPolicy(true);
|
|
86
|
+
* ```
|
|
87
|
+
*
|
|
88
|
+
* @param value A string that defines the default parameter URL squashing behavior.
|
|
89
|
+
* - `nosquash`: When generating an href with a default parameter value, do not squash the parameter value from the URL
|
|
90
|
+
* - `slash`: When generating an href with a default parameter value, squash (remove) the parameter value, and, if the
|
|
91
|
+
* parameter is surrounded by slashes, squash (remove) one slash from the URL
|
|
92
|
+
* - any other string, e.g. "~": When generating an href with a default parameter value, squash (remove)
|
|
93
|
+
* the parameter value from the URL and replace it with this string.
|
|
94
|
+
* @returns the current value of defaultSquashPolicy
|
|
95
|
+
*/
|
|
96
|
+
defaultSquashPolicy(value?: boolean | string): string | boolean;
|
|
97
|
+
/**
|
|
98
|
+
* Defines whether URLs should match trailing slashes, or not (the default behavior).
|
|
99
|
+
*
|
|
100
|
+
* #### Example:
|
|
101
|
+
* ```js
|
|
102
|
+
* // Allow optional trailing slashes
|
|
103
|
+
* urlService.config.strictMode(false);
|
|
104
|
+
* ```
|
|
105
|
+
*
|
|
106
|
+
* @param value `false` to match trailing slashes in URLs, otherwise `true`.
|
|
107
|
+
* @returns the current value of strictMode
|
|
108
|
+
*/
|
|
109
|
+
strictMode(value?: boolean): boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Creates and registers a custom [[ParamType]] object
|
|
112
|
+
*
|
|
113
|
+
* A custom parameter type can be used to generate URLs with typed parameters or custom encoding/decoding.
|
|
114
|
+
*
|
|
115
|
+
* #### Note: Register custom types *before using them* in a state definition.
|
|
116
|
+
*
|
|
117
|
+
* #### Example:
|
|
118
|
+
* ```js
|
|
119
|
+
* // Encode object parameter as JSON string
|
|
120
|
+
* urlService.config.type('myjson', {
|
|
121
|
+
* encode: (obj) => JSON.stringify(obj),
|
|
122
|
+
* decode: (str) => JSON.parse(str),
|
|
123
|
+
* is: (val) => typeof(val) === 'object',
|
|
124
|
+
* pattern: /[^/]+/,
|
|
125
|
+
* equals: (a, b) => _.isEqual(a, b),
|
|
126
|
+
* });
|
|
127
|
+
* ```
|
|
128
|
+
*
|
|
129
|
+
* See [[ParamTypeDefinition]] for more examples
|
|
130
|
+
*
|
|
131
|
+
* @param name The type name.
|
|
132
|
+
* @param definition The type definition. See [[ParamTypeDefinition]] for information on the values accepted.
|
|
133
|
+
* @param definitionFn A function that is injected before the app runtime starts.
|
|
134
|
+
* The result of this function should be a [[ParamTypeDefinition]].
|
|
135
|
+
* The result is merged into the existing `definition`.
|
|
136
|
+
* See [[ParamType]] for information on the values accepted.
|
|
137
|
+
*
|
|
138
|
+
* @returns if only the `name` parameter was specified: the currently registered [[ParamType]] object, or undefined
|
|
139
|
+
*/
|
|
140
|
+
type(
|
|
141
|
+
name: string,
|
|
142
|
+
definition?: ParamTypeDefinition,
|
|
143
|
+
definitionFn?: () => ParamTypeDefinition,
|
|
144
|
+
): any;
|
|
141
145
|
}
|