@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.
Files changed (128) hide show
  1. package/Makefile +1 -1
  2. package/README.md +3 -3
  3. package/TODO.md +14 -0
  4. package/dist/angular-ts.esm.js +1 -1
  5. package/dist/angular-ts.umd.js +1 -1
  6. package/index.html +2 -1
  7. package/package.json +1 -1
  8. package/src/animations/animate-css-driver.js +2 -2
  9. package/src/animations/animate-css.js +15 -6
  10. package/src/animations/animate-js.js +1 -1
  11. package/src/animations/animate-queue.js +1 -1
  12. package/src/animations/shared.js +0 -14
  13. package/src/core/compile.js +6 -3
  14. package/src/core/q.js +9 -9
  15. package/src/core/sanitize-uri.js +1 -1
  16. package/src/core/sce.js +1 -1
  17. package/src/directive/if.js +0 -79
  18. package/src/directive/if.md +80 -0
  19. package/src/directive/include.js +0 -82
  20. package/src/directive/include.md +86 -0
  21. package/src/directive/repeat.js +0 -1
  22. package/src/loader.js +0 -1
  23. package/src/public.js +0 -2
  24. package/src/router/common/trace.js +1 -1
  25. package/src/router/directives/stateDirectives.js +16 -14
  26. package/src/router/directives/viewDirective.js +2 -2
  27. package/src/router/hooks/resolve.js +3 -4
  28. package/src/router/hooks/views.js +3 -2
  29. package/src/router/state/stateService.js +1 -2
  30. package/src/router/transition/interface.js +14 -14
  31. package/src/router/transition/rejectFactory.js +29 -20
  32. package/src/router/transition/transitionHook.js +5 -5
  33. package/src/router/url/urlMatcher.js +1 -2
  34. package/src/router/url/urlRule.js +1 -1
  35. package/src/router/url/urlRules.js +1 -1
  36. package/src/shared/common.js +0 -1
  37. package/test/module-test.html +44 -12
  38. package/test/router/services.spec.js +71 -0
  39. package/test/router/state-directives.spec.js +1208 -0
  40. package/types/angular.d.ts +132 -124
  41. package/types/index.d.ts +2350 -2187
  42. package/types/jqlite.d.ts +463 -418
  43. package/types/router/core/common/common.d.ts +70 -24
  44. package/types/router/core/common/coreservices.d.ts +30 -32
  45. package/types/router/core/common/glob.d.ts +9 -9
  46. package/types/router/core/common/hof.d.ts +12 -4
  47. package/types/router/core/common/index.d.ts +8 -8
  48. package/types/router/core/common/predicates.d.ts +1 -1
  49. package/types/router/core/common/queue.d.ts +13 -13
  50. package/types/router/core/common/safeConsole.d.ts +3 -3
  51. package/types/router/core/common/strings.d.ts +4 -2
  52. package/types/router/core/common/trace.d.ts +94 -82
  53. package/types/router/core/globals.d.ts +37 -37
  54. package/types/router/core/hooks/coreResolvables.d.ts +5 -3
  55. package/types/router/core/hooks/ignoredTransition.d.ts +4 -2
  56. package/types/router/core/hooks/invalidTransition.d.ts +4 -2
  57. package/types/router/core/hooks/lazyLoad.d.ts +10 -5
  58. package/types/router/core/hooks/onEnterExitRetain.d.ts +10 -4
  59. package/types/router/core/hooks/redirectTo.d.ts +4 -2
  60. package/types/router/core/hooks/resolve.d.ts +10 -4
  61. package/types/router/core/hooks/updateGlobals.d.ts +4 -2
  62. package/types/router/core/hooks/url.d.ts +4 -2
  63. package/types/router/core/hooks/views.d.ts +7 -3
  64. package/types/router/core/index.d.ts +11 -12
  65. package/types/router/core/interface.d.ts +83 -81
  66. package/types/router/core/params/index.d.ts +5 -5
  67. package/types/router/core/params/interface.d.ts +439 -439
  68. package/types/router/core/params/param.d.ts +72 -60
  69. package/types/router/core/params/paramType.d.ts +40 -40
  70. package/types/router/core/params/paramTypes.d.ts +169 -165
  71. package/types/router/core/params/stateParams.d.ts +13 -13
  72. package/types/router/core/path/index.d.ts +2 -2
  73. package/types/router/core/path/pathNode.d.ts +49 -49
  74. package/types/router/core/path/pathUtils.d.ts +100 -74
  75. package/types/router/core/resolve/index.d.ts +3 -3
  76. package/types/router/core/resolve/interface.d.ts +137 -137
  77. package/types/router/core/resolve/resolvable.d.ts +60 -54
  78. package/types/router/core/resolve/resolveContext.d.ts +84 -79
  79. package/types/router/core/router.d.ts +95 -86
  80. package/types/router/core/state/index.d.ts +8 -8
  81. package/types/router/core/state/interface.d.ts +667 -643
  82. package/types/router/core/state/stateBuilder.d.ts +41 -38
  83. package/types/router/core/state/stateMatcher.d.ts +11 -9
  84. package/types/router/core/state/stateObject.d.ts +154 -139
  85. package/types/router/core/state/stateQueueManager.d.ts +26 -21
  86. package/types/router/core/state/stateRegistry.d.ts +124 -121
  87. package/types/router/core/state/stateService.d.ts +380 -343
  88. package/types/router/core/state/targetState.d.ts +74 -69
  89. package/types/router/core/transition/hookBuilder.d.ts +34 -30
  90. package/types/router/core/transition/hookRegistry.d.ts +96 -74
  91. package/types/router/core/transition/index.d.ts +8 -8
  92. package/types/router/core/transition/interface.d.ts +652 -609
  93. package/types/router/core/transition/rejectFactory.d.ts +97 -97
  94. package/types/router/core/transition/transition.d.ts +565 -517
  95. package/types/router/core/transition/transitionEventType.d.ts +20 -11
  96. package/types/router/core/transition/transitionHook.d.ts +90 -82
  97. package/types/router/core/transition/transitionService.d.ts +228 -161
  98. package/types/router/core/url/index.d.ts +8 -8
  99. package/types/router/core/url/interface.d.ts +100 -87
  100. package/types/router/core/url/urlConfig.d.ts +130 -126
  101. package/types/router/core/url/urlMatcher.d.ts +132 -127
  102. package/types/router/core/url/urlMatcherFactory.d.ts +46 -42
  103. package/types/router/core/url/urlRouter.d.ts +91 -75
  104. package/types/router/core/url/urlRule.d.ts +123 -100
  105. package/types/router/core/url/urlRules.d.ts +240 -232
  106. package/types/router/core/url/urlService.d.ts +201 -201
  107. package/types/router/core/view/index.d.ts +2 -2
  108. package/types/router/core/view/interface.d.ts +26 -26
  109. package/types/router/core/view/view.d.ts +152 -143
  110. package/types/router/directives/viewDirective.d.ts +12 -11
  111. package/types/router/index.d.ts +11 -12
  112. package/types/router/interface.d.ts +361 -351
  113. package/types/router/legacy/resolveService.d.ts +44 -40
  114. package/types/router/legacy/stateEvents.d.ts +1 -1
  115. package/types/router/locationServices.d.ts +45 -37
  116. package/types/router/services.d.ts +9 -9
  117. package/types/router/stateFilters.d.ts +3 -3
  118. package/types/router/stateProvider.d.ts +240 -235
  119. package/types/router/statebuilders/onEnterExitRetain.d.ts +4 -2
  120. package/types/router/statebuilders/views.d.ts +35 -22
  121. package/types/router/templateFactory.d.ts +99 -79
  122. package/types/router/viewScroll.d.ts +7 -7
  123. package/src/directive/a.js +0 -37
  124. package/test/directive/a.spec.js +0 -192
  125. package/types/router/angular.d.ts +0 -1
  126. package/types/router/core/vanilla.d.ts +0 -1
  127. package/types/router/directives/stateDirectives.d.ts +0 -3
  128. package/types/router/injectables.d.ts +0 -1
@@ -8,54 +8,58 @@
8
8
  * @packageDocumentation
9
9
  * @preferred
10
10
  */
11
- import { LocationConfig } from '../common';
12
- import { UIRouter } from '../router';
13
- import { StateDeclaration, StateObject, TargetState, TargetStateDef } from '../state';
14
- import { UrlMatcher } from './urlMatcher';
15
- import { UrlConfig } from './urlConfig';
16
- import { UrlRules } from './urlRules';
17
- import { UrlService } from './urlService';
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
- state?: StateDeclaration;
20
- strict?: boolean;
21
- caseInsensitive?: boolean;
22
- decodeParams?: boolean;
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
- /** See: [[UrlConfig.caseInsensitive]] */ caseInsensitive: UrlConfig['caseInsensitive'];
30
- /** See: [[UrlConfig.strictMode]] */ strictMode: UrlConfig['strictMode'];
31
- /** See: [[UrlConfig.defaultSquashPolicy]] */ defaultSquashPolicy: UrlConfig['defaultSquashPolicy'];
32
- /** See: [[UrlConfig.type]] */ type: UrlConfig['type'];
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
- /** See: [[UrlService.sync]] */ sync: UrlService['sync'];
37
- /** See: [[UrlService.listen]] */ listen: UrlService['listen'];
38
- /** See: [[UrlService.deferIntercept]] */ deferIntercept: UrlService['deferIntercept'];
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
- /** See: [[UrlRules.sort]] */ sort: UrlRules['sort'];
43
- /** See: [[UrlRules.when]] */ when: UrlRules['when'];
44
- /** See: [[UrlRules.otherwise]] */ otherwise: UrlRules['otherwise'];
45
- /** See: [[UrlRules.initial]] */ initial: UrlRules['initial'];
46
- /** See: [[UrlRules.rules]] */ rules: UrlRules['rules'];
47
- /** See: [[UrlRules.rule]] */ rule: UrlRules['rule'];
48
- /** See: [[UrlRules.removeRule]] */ removeRule: UrlRules['removeRule'];
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
- path: string;
55
- search?: {
56
- [key: string]: any;
57
- };
58
- hash?: string;
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
- /** The matched value from a [[UrlRule]] */
67
- match: any;
68
- /** The rule that matched */
69
- rule: UrlRule;
70
- /** The match result weight */
71
- weight: number;
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
- (url?: UrlParts, router?: UIRouter): any;
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
- (matchValue?: any, url?: UrlParts, router?: UIRouter): string | TargetState | TargetStateDef | void;
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 = 'STATE' | 'URLMATCHER' | 'REGEXP' | 'RAW' | 'OTHER';
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
- * The rule's ID.
106
- *
107
- * IDs are auto-assigned when the rule is registered, in increasing order.
108
- */
109
- $id: number;
110
- /**
111
- * The rule's priority (defaults to 0).
112
- *
113
- * This can be used to explicitly modify the rule's priority.
114
- * Higher numbers are higher priority.
115
- */
116
- priority: number;
117
- /** @internal */
118
- _group: number;
119
- /** The type of the rule */
120
- type: UrlRuleType;
121
- /**
122
- * This function should match the url and return the match details
123
- *
124
- * See [[UrlRuleMatchFn]] for details
125
- */
126
- match: UrlRuleMatchFn;
127
- /**
128
- * This function is called if the rule matched, and was selected as the "best match".
129
- * This function handles the rule match event.
130
- *
131
- * See [[UrlRuleHandlerFn]] for details
132
- */
133
- handler: UrlRuleHandlerFn;
134
- /**
135
- * The priority of a given match.
136
- *
137
- * Sometimes more than one UrlRule might have matched.
138
- * This method is used to choose the best match.
139
- *
140
- * If multiple rules matched, each rule's `matchPriority` is called with the value from [[match]].
141
- * The rule with the highest `matchPriority` has its [[handler]] called.
142
- */
143
- matchPriority(match: any): number;
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
- type: 'URLMATCHER' | 'STATE';
147
- urlMatcher: UrlMatcher;
159
+ type: "URLMATCHER" | "STATE";
160
+ urlMatcher: UrlMatcher;
148
161
  }
149
162
  export interface StateRule extends MatcherUrlRule {
150
- type: 'STATE';
151
- state: StateObject;
163
+ type: "STATE";
164
+ state: StateObject;
152
165
  }
153
166
  export interface RegExpRule extends UrlRule {
154
- type: 'REGEXP';
155
- regexp: RegExp;
167
+ type: "REGEXP";
168
+ regexp: RegExp;
156
169
  }
@@ -1,6 +1,6 @@
1
- import { Disposable } from '../interface';
2
- import { UIRouter } from '../router';
3
- import { ParamTypeDefinition, ParamTypes } from '../params';
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
- 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(name: string, definition?: ParamTypeDefinition, definitionFn?: () => ParamTypeDefinition): any;
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
  }