@angular-wave/angular.ts 0.0.37 → 0.0.39

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 (191) hide show
  1. package/Makefile +6 -5
  2. package/dist/angular-ts.esm.js +2 -1
  3. package/dist/angular-ts.umd.js +1 -1
  4. package/package.json +2 -4
  5. package/rollup.config.js +5 -1
  6. package/src/binding.spec.js +4 -4
  7. package/src/core/location/location.js +1 -1
  8. package/src/core/scope/scope.js +4 -7
  9. package/src/exts/aria/aria.html +1 -4
  10. package/src/exts/messages/messages.html +1 -4
  11. package/src/index.js +307 -1
  12. package/src/loader.js +13 -6
  13. package/src/public.js +7 -2
  14. package/src/router/directives/directives.test.js +19 -0
  15. package/src/router/directives/state-directives.html +21 -0
  16. package/src/router/{state-directives.spec.js → directives/state-directives.spec.js} +2 -1
  17. package/src/router/{view-directive.spec.js → directives/view-directive.spec.js} +2 -1
  18. package/src/router/directives/view-directives.html +21 -0
  19. package/src/router/router.html +22 -0
  20. package/src/router/router.test.js +11 -0
  21. package/src/router/services.spec.js +2 -2
  22. package/src/router/{state-builder.spec.js → state/state-builder.spec.js} +9 -12
  23. package/src/router/state/state.html +22 -0
  24. package/src/router/{state.spec.js → state/state.spec.js} +1 -1
  25. package/src/router/state/state.test.js +11 -0
  26. package/src/router/state-filter.spec.js +2 -2
  27. package/src/router/template-factory.spec.js +4 -4
  28. package/src/router/url/url.html +18 -0
  29. package/src/router/url/url.test.js +11 -0
  30. package/src/router/view/view.html +18 -0
  31. package/src/router/{view.spec.js → view/view.spec.js} +1 -1
  32. package/src/router/view/view.test.js +11 -0
  33. package/src/router/view-hook.spec.js +4 -4
  34. package/src/router/view-scroll.spec.js +4 -4
  35. package/src/services/http/http.html +22 -0
  36. package/src/services/http/http.test.js +11 -0
  37. package/src/services/http-backend/http-backend.html +21 -0
  38. package/src/services/http-backend/http-backend.js +1 -1
  39. package/src/services/http-backend/http-backend.spec.js +1 -1
  40. package/src/services/http-backend/http-backend.test.js +11 -0
  41. package/src/shared/common.spec.js +4 -4
  42. package/src/shared/hof.spec.js +1 -1
  43. package/src/shared/min-err.spec.js +2 -2
  44. package/src/shared/shared.html +22 -0
  45. package/src/shared/shared.test.js +11 -0
  46. package/src/shared/test-utils.js +2 -2
  47. package/src/shared/utils.spec.js +1 -1
  48. package/src/src.html +22 -0
  49. package/src/src.test.js +10 -0
  50. package/tsconfig.json +1 -1
  51. package/tsconfig.types.json +11 -0
  52. package/types/animations/animate-cache.d.ts +7 -7
  53. package/types/animations/animate-children-directive.d.ts +3 -6
  54. package/types/animations/animate-swap.d.ts +7 -16
  55. package/types/animations/animation.d.ts +2 -11
  56. package/types/animations/raf-scheduler.d.ts +3 -3
  57. package/types/animations/shared.d.ts +8 -23
  58. package/types/core/{animate-css.d.ts → animate/animate-css.d.ts} +2 -8
  59. package/types/core/{cache.d.ts → cache/cache.d.ts} +5 -5
  60. package/types/core/compile/compile.d.ts +173 -0
  61. package/types/core/controller/controller.d.ts +32 -0
  62. package/types/core/exception-handler.d.ts +1 -1
  63. package/types/core/filter/filter.d.ts +9 -0
  64. package/types/core/{interpolate.d.ts → interpolate/interpolate.d.ts} +23 -39
  65. package/types/core/interval/interval-factory.d.ts +4 -0
  66. package/types/core/{interval.d.ts → interval/interval.d.ts} +1 -1
  67. package/types/core/location/location.d.ts +209 -0
  68. package/types/core/pubsub/pubsub.d.ts +156 -0
  69. package/types/core/q/q.d.ts +31 -0
  70. package/types/core/sanitize/sanitize-uri.d.ts +53 -0
  71. package/types/core/{sce.d.ts → sce/sce.d.ts} +80 -86
  72. package/types/core/scope/scope.d.ts +727 -0
  73. package/types/core/task-tracker-factory.d.ts +29 -29
  74. package/types/core/timeout/timeout.d.ts +20 -0
  75. package/types/core/{urlUtils.d.ts → url-utils/url-utils.d.ts} +2 -7
  76. package/types/directive/{bind.d.ts → bind/bind.d.ts} +4 -10
  77. package/types/directive/{class.d.ts → class/class.d.ts} +12 -21
  78. package/types/directive/controller/controller.d.ts +6 -0
  79. package/types/directive/events/events.d.ts +5 -0
  80. package/types/directive/form/form.d.ts +200 -0
  81. package/types/directive/if/if.d.ts +8 -0
  82. package/types/directive/include/include.d.ts +14 -0
  83. package/types/directive/{input.d.ts → input/input.d.ts} +20 -69
  84. package/types/directive/{model.d.ts → model/model.d.ts} +256 -279
  85. package/types/directive/options/options.d.ts +9 -0
  86. package/types/directive/ref/ref.d.ts +5 -0
  87. package/types/directive/repeat/repeat.d.ts +8 -0
  88. package/types/directive/{script.d.ts → script/script.d.ts} +5 -8
  89. package/types/directive/{show-hide.d.ts → show-hide/show-hide.d.ts} +10 -16
  90. package/types/directive/switch/switch.d.ts +17 -0
  91. package/types/directive/transclude/transclude.d.ts +4 -0
  92. package/types/directive/{validators.d.ts → validators/validators.d.ts} +20 -35
  93. package/types/filters/filters.d.ts +10 -16
  94. package/types/filters/order-by.d.ts +2 -4
  95. package/types/index.d.ts +117 -0
  96. package/types/injector.d.ts +12 -0
  97. package/types/public.d.ts +5 -0
  98. package/types/router/common/coreservices.d.ts +2 -2
  99. package/types/router/common/glob.d.ts +9 -9
  100. package/types/router/common/queue.d.ts +13 -13
  101. package/types/router/common/trace.d.ts +43 -43
  102. package/types/router/directives/view-directive.d.ts +13 -32
  103. package/types/router/globals.d.ts +20 -20
  104. package/types/router/hooks/lazy-load.d.ts +2 -11
  105. package/types/router/hooks/redirect-to.d.ts +1 -4
  106. package/types/router/hooks/url.d.ts +1 -5
  107. package/types/router/hooks/views.d.ts +1 -4
  108. package/types/router/params/param-factory.d.ts +5 -5
  109. package/types/router/params/param-type.d.ts +35 -35
  110. package/types/router/params/param-types.d.ts +11 -11
  111. package/types/router/params/param.d.ts +38 -38
  112. package/types/router/params/state-params.d.ts +10 -10
  113. package/types/router/path/path-node.d.ts +34 -34
  114. package/types/router/path/path-utils.d.ts +73 -77
  115. package/types/router/resolve/resolvable.d.ts +32 -32
  116. package/types/router/resolve/resolve-context.d.ts +84 -84
  117. package/types/router/services.d.ts +4 -9
  118. package/types/router/state/state-builder.d.ts +27 -27
  119. package/types/router/state/state-matcher.d.ts +5 -5
  120. package/types/router/state/state-object.d.ts +58 -58
  121. package/types/router/state/state-queue-manager.d.ts +10 -16
  122. package/types/router/state/state-registry.d.ts +100 -107
  123. package/types/router/state/state-service.d.ts +411 -411
  124. package/types/router/state/target-state.d.ts +64 -69
  125. package/types/router/state/views.d.ts +31 -37
  126. package/types/router/state-filters.d.ts +7 -7
  127. package/types/router/state-provider.d.ts +105 -105
  128. package/types/router/template-factory.d.ts +83 -112
  129. package/types/router/transition/hook-builder.d.ts +25 -25
  130. package/types/router/transition/hook-registry.d.ts +68 -83
  131. package/types/router/transition/interface.d.ts +7 -7
  132. package/types/router/transition/reject-factory.d.ts +34 -34
  133. package/types/router/transition/transition-event-type.d.ts +9 -18
  134. package/types/router/transition/transition-hook.d.ts +77 -82
  135. package/types/router/transition/transition-service.d.ts +82 -99
  136. package/types/router/transition/transition.d.ts +369 -377
  137. package/types/router/url/url-config.d.ts +84 -84
  138. package/types/router/url/url-matcher.d.ts +115 -119
  139. package/types/router/url/url-rule.d.ts +114 -124
  140. package/types/router/url/url-rules.d.ts +217 -217
  141. package/types/router/url/url-service.d.ts +264 -269
  142. package/types/router/view/view.d.ts +114 -117
  143. package/types/router/view-scroll.d.ts +2 -2
  144. package/types/services/anchor-scroll.d.ts +2 -8
  145. package/types/services/browser.d.ts +122 -130
  146. package/types/services/cache-factory.d.ts +25 -25
  147. package/types/services/cookie-reader.d.ts +2 -2
  148. package/types/services/document.d.ts +2 -2
  149. package/types/services/http/http.d.ts +145 -0
  150. package/types/services/{http-backend.d.ts → http-backend/http-backend.d.ts} +3 -35
  151. package/types/services/log.d.ts +49 -49
  152. package/types/services/template-request.d.ts +44 -53
  153. package/types/shared/common.d.ts +4 -19
  154. package/types/{constants.d.ts → shared/constants.d.ts} +6 -6
  155. package/types/shared/hof.d.ts +1 -1
  156. package/types/{jqLite.d.ts → shared/jqlite/jqlite.d.ts} +11 -11
  157. package/types/shared/test-utils.d.ts +11 -0
  158. package/types/shared/utils.d.ts +7 -24
  159. package/types-back/global.d.ts +3 -1
  160. package/types-back/index.d.ts +2 -221
  161. package/types/core/compile.d.ts +0 -206
  162. package/types/core/controller.d.ts +0 -42
  163. package/types/core/filter.d.ts +0 -9
  164. package/types/core/interval-factory.d.ts +0 -21
  165. package/types/core/location.d.ts +0 -234
  166. package/types/core/pubsub.d.ts +0 -164
  167. package/types/core/q.d.ts +0 -33
  168. package/types/core/root-scope.d.ts +0 -754
  169. package/types/core/sanitize-uri.d.ts +0 -57
  170. package/types/core/timeout.d.ts +0 -31
  171. package/types/directive/controller.d.ts +0 -6
  172. package/types/directive/events.d.ts +0 -12
  173. package/types/directive/form.d.ts +0 -230
  174. package/types/directive/if.d.ts +0 -17
  175. package/types/directive/include.d.ts +0 -33
  176. package/types/directive/options.d.ts +0 -16
  177. package/types/directive/ref.d.ts +0 -11
  178. package/types/directive/repeat.d.ts +0 -23
  179. package/types/directive/switch.d.ts +0 -23
  180. package/types/directive/transclude.d.ts +0 -15
  181. package/types/services/http.d.ts +0 -157
  182. /package/src/router/{url-service.spec.js → url/url-service.spec.js} +0 -0
  183. /package/types/directive/{attrs.d.ts → attrs/attrs.d.ts} +0 -0
  184. /package/types/directive/{change.d.ts → change/change.d.ts} +0 -0
  185. /package/types/directive/{cloak.d.ts → cloak/cloak.d.ts} +0 -0
  186. /package/types/directive/{init.d.ts → init/init.d.ts} +0 -0
  187. /package/types/directive/{list.d.ts → list/list.d.ts} +0 -0
  188. /package/types/directive/{non-bindable.d.ts → non-bindable/non-bindable.d.ts} +0 -0
  189. /package/types/directive/{style.d.ts → style/style.d.ts} +0 -0
  190. /package/types/exts/{aria.d.ts → aria/aria.d.ts} +0 -0
  191. /package/types/exts/{messages.d.ts → messages/messages.d.ts} +0 -0
@@ -2,275 +2,270 @@
2
2
  * API for URL management
3
3
  */
4
4
  export class UrlService {
5
- static $inject: string[];
6
- /**
7
- * @param {angular.ILocationProvider} $locationProvider
8
- */
9
- constructor(
10
- $locationProvider: angular.ILocationProvider,
11
- stateService: any,
12
- globals: any,
13
- urlConfigProvider: any,
14
- );
15
- stateService: any;
16
- $locationProvider: angular.ILocationProvider;
17
- $location: any;
18
- $browser: any;
19
- /** @type {boolean} */
20
- interceptDeferred: boolean;
21
- /** Provides services related to the URL */
22
- urlRuleFactory: UrlRuleFactory;
23
- /**
24
- * The nested [[UrlRules]] API for managing URL rules and rewrites
25
- *
26
- * See: [[UrlRules]] for details
27
- * @type {UrlRules}
28
- */
29
- rules: UrlRules;
30
- /**
31
- * The nested [[UrlConfig]] API to configure the URL and retrieve URL information
32
- *
33
- * See: [[UrlConfig]] for details
34
- * @type {angular.UrlConfig}
35
- */
36
- config: angular.UrlConfig;
37
- /** Creates a new [[Param]] for a given location (DefType) */
38
- paramFactory: ParamFactory;
39
- /**
40
- * Gets the path part of the current url
41
- *
42
- * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`
43
- *
44
- * @return the path portion of the url
45
- */
46
- path: () => any;
47
- /**
48
- * Gets the search part of the current url as an object
49
- *
50
- * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`
51
- *
52
- * @return the search (query) portion of the url, as an object
53
- */
54
- search: () => any;
55
- /**
56
- * Gets the hash part of the current url
57
- *
58
- * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`
59
- *
60
- * @return the hash (anchor) portion of the url
61
- */
62
- hash: () => any;
63
- _urlListeners: any[];
64
- $get: (string | (($location: any, $browser: any, $rootScope: any) => this))[];
65
- html5Mode(): boolean;
66
- baseHref(): any;
67
- _baseHref: any;
68
- /**
69
- * Gets the current url, or updates the url
70
- *
71
- * ### Getting the current URL
72
- *
73
- * When no arguments are passed, returns the current URL.
74
- * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.
75
- *
76
- * For example, the URL may be stored in the hash ([[HashLocationServices]]) or
77
- * have a base HREF prepended ([[PushStateLocationServices]]).
78
- *
79
- * The raw URL in the browser might be:
80
- *
81
- * ```
82
- * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor
83
- * ```
84
- *
85
- * or
86
- *
87
- * ```
88
- * http://mysite.com/basepath/internal/path/123?param1=foo#anchor
89
- * ```
90
- *
91
- * then this method returns:
92
- *
93
- * ```
94
- * /internal/path/123?param1=foo#anchor
95
- * ```
96
- *
97
- *
98
- * #### Example:
99
- * ```js
100
- * locationServices.url(); // "/some/path?query=value#anchor"
101
- * ```
102
- *
103
- * ### Updating the URL
104
- *
105
- * When `newurl` arguments is provided, changes the URL to reflect `newurl`
106
- *
107
- * #### Example:
108
- * ```js
109
- * locationServices.url("/some/path?query=value#anchor", true);
110
- * ```
111
- *
112
- * @param {string} newUrl The new value for the URL.
113
- * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
114
- * It should not include the protocol, site, port, or base path of an absolute HREF.
115
- * @param {boolean} replace When true, replaces the current history entry (instead of appending it) with this new url
116
- * @param {any} state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
117
- *
118
- * @return the url (after potentially being processed)
119
- */
120
- url(newUrl: string, replace: boolean, state: any): any;
121
- /**
122
- * @internal
123
- *
124
- * Registers a low level url change handler
125
- *
126
- * Note: Because this is a low level handler, it's not recommended for general use.
127
- *
128
- * #### Example:
129
- * ```js
130
- * let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
131
- * ```
132
- *
133
- * @param callback a function that will be called when the url is changing
134
- * @return a function that de-registers the callback
135
- */
136
- onChange(callback: any): () => any;
137
- /**
138
- * Gets the current URL parts
139
- *
140
- * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.
141
- */
142
- parts(): {
143
- path: any;
144
- search: any;
145
- hash: any;
146
- };
147
- /**
148
- * Activates the best rule for the current URL
149
- *
150
- * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.
151
- * This method is called internally any time the URL has changed.
152
- *
153
- * This effectively activates the state (or redirect, etc) which matches the current URL.
154
- *
155
- * #### Example:
156
- * ```js
157
- * urlService.deferIntercept();
158
- *
159
- * fetch('/states.json').then(resp => resp.json()).then(data => {
160
- * data.forEach(state => $stateRegistry.register(state));
161
- * urlService.listen();
162
- * // Find the matching URL and invoke the handler.
163
- * urlService.sync();
164
- * });
165
- * ```
166
- */
167
- sync(evt: any): void;
168
- /**
169
- * Starts or stops listening for URL changes
170
- *
171
- * Call this sometime after calling [[deferIntercept]] to start monitoring the url.
172
- * This causes ng-router to start listening for changes to the URL, if it wasn't already listening.
173
- *
174
- * If called with `false`, ng-router will stop listening (call listen(true) to start listening again).
175
- *
176
- * #### Example:
177
- * ```js
178
- * urlService.deferIntercept();
179
- *
180
- * fetch('/states.json').then(resp => resp.json()).then(data => {
181
- * data.forEach(state => $stateRegistry.register(state));
182
- * // Start responding to URL changes
183
- * urlService.listen();
184
- * urlService.sync();
185
- * });
186
- * ```
187
- *
188
- * @param enabled `true` or `false` to start or stop listening to URL changes
189
- */
190
- listen(enabled: any): any;
191
- _stopListeningFn: any;
192
- /**
193
- * Disables monitoring of the URL.
194
- *
195
- * Call this method before ng-router has bootstrapped.
196
- * It will stop ng-router from performing the initial url sync.
197
- *
198
- * This can be useful to perform some asynchronous initialization before the router starts.
199
- * Once the initialization is complete, call [[listen]] to tell ng-router to start watching and synchronizing the URL.
200
- *
201
- * #### Example:
202
- * ```js
203
- * // Prevent ng-router from automatically intercepting URL changes when it starts;
204
- * urlService.deferIntercept();
205
- *
206
- * fetch('/states.json').then(resp => resp.json()).then(data => {
207
- * data.forEach(state => $stateRegistry.register(state));
208
- * urlService.listen();
209
- * urlService.sync();
210
- * });
211
- * ```
212
- *
213
- * @param defer Indicates whether to defer location change interception.
214
- * Passing no parameter is equivalent to `true`.
215
- */
216
- deferIntercept(defer: any): void;
217
- /**
218
- * Matches a URL
219
- *
220
- * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.
221
- * Return the result as a [[MatchResult]].
222
- * @returns {angular.MatchResult}
223
- */
224
- match(url: any): angular.MatchResult;
225
- update(read: any): void;
226
- location: any;
227
- /**
228
- * Internal API.
229
- *
230
- * Pushes a new location to the browser history.
231
- *
232
- * @internal
233
- * @param urlMatcher
234
- * @param params
235
- * @param options
236
- */
237
- push(urlMatcher: any, params: any, options: any): void;
238
- /**
239
- * Builds and returns a URL with interpolated parameters
240
- *
241
- * #### Example:
242
- * ```js
243
- * matcher = $umf.compile("/about/:person");
244
- * params = { person: "bob" };
245
- * $bob = $urlService.href(matcher, params);
246
- * // $bob == "/about/bob";
247
- * ```
248
- *
249
- * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
250
- * @param params An object of parameter values to fill the matcher's required parameters.
251
- * @param options Options object. The options are:
252
- *
253
- * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
254
- *
255
- * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
256
- */
257
- href(urlMatcher: any, params: any, options: any): any;
258
- /**
259
- * Creates a [[UrlMatcher]] for the specified pattern.
260
- *
261
- * @param pattern The URL pattern.
262
- * @param config The config object hash.
263
- * @returns The UrlMatcher.
264
- */
265
- compile(pattern: any, config: any): UrlMatcher;
266
- /**
267
- * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
268
- *
269
- * @param object The object to perform the type check against.
270
- * @returns `true` if the object matches the `UrlMatcher` interface, by
271
- * implementing all the same methods.
272
- */
273
- isMatcher(object: any): boolean;
5
+ static $inject: string[];
6
+ /**
7
+ * @param {angular.ILocationProvider} $locationProvider
8
+ */
9
+ constructor($locationProvider: angular.ILocationProvider, stateService: any, globals: any, urlConfigProvider: any);
10
+ stateService: any;
11
+ $locationProvider: angular.ILocationProvider;
12
+ $location: any;
13
+ $browser: any;
14
+ /** @type {boolean} */
15
+ interceptDeferred: boolean;
16
+ /** Provides services related to the URL */
17
+ urlRuleFactory: UrlRuleFactory;
18
+ /**
19
+ * The nested [[UrlRules]] API for managing URL rules and rewrites
20
+ *
21
+ * See: [[UrlRules]] for details
22
+ * @type {UrlRules}
23
+ */
24
+ rules: UrlRules;
25
+ /**
26
+ * The nested [[UrlConfig]] API to configure the URL and retrieve URL information
27
+ *
28
+ * See: [[UrlConfig]] for details
29
+ * @type {angular.UrlConfig}
30
+ */
31
+ config: angular.UrlConfig;
32
+ /** Creates a new [[Param]] for a given location (DefType) */
33
+ paramFactory: ParamFactory;
34
+ /**
35
+ * Gets the path part of the current url
36
+ *
37
+ * If the current URL is `/some/path?query=value#anchor`, this returns `/some/path`
38
+ *
39
+ * @return the path portion of the url
40
+ */
41
+ path: () => any;
42
+ /**
43
+ * Gets the search part of the current url as an object
44
+ *
45
+ * If the current URL is `/some/path?query=value#anchor`, this returns `{ query: 'value' }`
46
+ *
47
+ * @return the search (query) portion of the url, as an object
48
+ */
49
+ search: () => any;
50
+ /**
51
+ * Gets the hash part of the current url
52
+ *
53
+ * If the current URL is `/some/path?query=value#anchor`, this returns `anchor`
54
+ *
55
+ * @return the hash (anchor) portion of the url
56
+ */
57
+ hash: () => any;
58
+ _urlListeners: any[];
59
+ $get: (string | (($location: any, $browser: any, $rootScope: any) => this))[];
60
+ html5Mode(): boolean;
61
+ baseHref(): any;
62
+ _baseHref: any;
63
+ /**
64
+ * Gets the current url, or updates the url
65
+ *
66
+ * ### Getting the current URL
67
+ *
68
+ * When no arguments are passed, returns the current URL.
69
+ * The URL is normalized using the internal [[path]]/[[search]]/[[hash]] values.
70
+ *
71
+ * For example, the URL may be stored in the hash ([[HashLocationServices]]) or
72
+ * have a base HREF prepended ([[PushStateLocationServices]]).
73
+ *
74
+ * The raw URL in the browser might be:
75
+ *
76
+ * ```
77
+ * http://mysite.com/somepath/index.html#/internal/path/123?param1=foo#anchor
78
+ * ```
79
+ *
80
+ * or
81
+ *
82
+ * ```
83
+ * http://mysite.com/basepath/internal/path/123?param1=foo#anchor
84
+ * ```
85
+ *
86
+ * then this method returns:
87
+ *
88
+ * ```
89
+ * /internal/path/123?param1=foo#anchor
90
+ * ```
91
+ *
92
+ *
93
+ * #### Example:
94
+ * ```js
95
+ * locationServices.url(); // "/some/path?query=value#anchor"
96
+ * ```
97
+ *
98
+ * ### Updating the URL
99
+ *
100
+ * When `newurl` arguments is provided, changes the URL to reflect `newurl`
101
+ *
102
+ * #### Example:
103
+ * ```js
104
+ * locationServices.url("/some/path?query=value#anchor", true);
105
+ * ```
106
+ *
107
+ * @param {string} newUrl The new value for the URL.
108
+ * This url should reflect only the new internal [[path]], [[search]], and [[hash]] values.
109
+ * It should not include the protocol, site, port, or base path of an absolute HREF.
110
+ * @param {boolean} replace When true, replaces the current history entry (instead of appending it) with this new url
111
+ * @param {any} state The history's state object, i.e., pushState (if the LocationServices implementation supports it)
112
+ *
113
+ * @return the url (after potentially being processed)
114
+ */
115
+ url(newUrl: string, replace: boolean, state: any): any;
116
+ /**
117
+ * @internal
118
+ *
119
+ * Registers a low level url change handler
120
+ *
121
+ * Note: Because this is a low level handler, it's not recommended for general use.
122
+ *
123
+ * #### Example:
124
+ * ```js
125
+ * let deregisterFn = locationServices.onChange((evt) => console.log("url change", evt));
126
+ * ```
127
+ *
128
+ * @param callback a function that will be called when the url is changing
129
+ * @return a function that de-registers the callback
130
+ */
131
+ onChange(callback: any): () => any;
132
+ /**
133
+ * Gets the current URL parts
134
+ *
135
+ * This method returns the different parts of the current URL (the [[path]], [[search]], and [[hash]]) as a [[UrlParts]] object.
136
+ */
137
+ parts(): {
138
+ path: any;
139
+ search: any;
140
+ hash: any;
141
+ };
142
+ /**
143
+ * Activates the best rule for the current URL
144
+ *
145
+ * Checks the current URL for a matching [[UrlRule]], then invokes that rule's handler.
146
+ * This method is called internally any time the URL has changed.
147
+ *
148
+ * This effectively activates the state (or redirect, etc) which matches the current URL.
149
+ *
150
+ * #### Example:
151
+ * ```js
152
+ * urlService.deferIntercept();
153
+ *
154
+ * fetch('/states.json').then(resp => resp.json()).then(data => {
155
+ * data.forEach(state => $stateRegistry.register(state));
156
+ * urlService.listen();
157
+ * // Find the matching URL and invoke the handler.
158
+ * urlService.sync();
159
+ * });
160
+ * ```
161
+ */
162
+ sync(evt: any): void;
163
+ /**
164
+ * Starts or stops listening for URL changes
165
+ *
166
+ * Call this sometime after calling [[deferIntercept]] to start monitoring the url.
167
+ * This causes ng-router to start listening for changes to the URL, if it wasn't already listening.
168
+ *
169
+ * If called with `false`, ng-router will stop listening (call listen(true) to start listening again).
170
+ *
171
+ * #### Example:
172
+ * ```js
173
+ * urlService.deferIntercept();
174
+ *
175
+ * fetch('/states.json').then(resp => resp.json()).then(data => {
176
+ * data.forEach(state => $stateRegistry.register(state));
177
+ * // Start responding to URL changes
178
+ * urlService.listen();
179
+ * urlService.sync();
180
+ * });
181
+ * ```
182
+ *
183
+ * @param enabled `true` or `false` to start or stop listening to URL changes
184
+ */
185
+ listen(enabled: any): any;
186
+ _stopListeningFn: any;
187
+ /**
188
+ * Disables monitoring of the URL.
189
+ *
190
+ * Call this method before ng-router has bootstrapped.
191
+ * It will stop ng-router from performing the initial url sync.
192
+ *
193
+ * This can be useful to perform some asynchronous initialization before the router starts.
194
+ * Once the initialization is complete, call [[listen]] to tell ng-router to start watching and synchronizing the URL.
195
+ *
196
+ * #### Example:
197
+ * ```js
198
+ * // Prevent ng-router from automatically intercepting URL changes when it starts;
199
+ * urlService.deferIntercept();
200
+ *
201
+ * fetch('/states.json').then(resp => resp.json()).then(data => {
202
+ * data.forEach(state => $stateRegistry.register(state));
203
+ * urlService.listen();
204
+ * urlService.sync();
205
+ * });
206
+ * ```
207
+ *
208
+ * @param defer Indicates whether to defer location change interception.
209
+ * Passing no parameter is equivalent to `true`.
210
+ */
211
+ deferIntercept(defer: any): void;
212
+ /**
213
+ * Matches a URL
214
+ *
215
+ * Given a URL (as a [[UrlParts]] object), check all rules and determine the best matching rule.
216
+ * Return the result as a [[MatchResult]].
217
+ * @returns {angular.MatchResult}
218
+ */
219
+ match(url: any): angular.MatchResult;
220
+ update(read: any): void;
221
+ location: any;
222
+ /**
223
+ * Internal API.
224
+ *
225
+ * Pushes a new location to the browser history.
226
+ *
227
+ * @internal
228
+ * @param urlMatcher
229
+ * @param params
230
+ * @param options
231
+ */
232
+ push(urlMatcher: any, params: any, options: any): void;
233
+ /**
234
+ * Builds and returns a URL with interpolated parameters
235
+ *
236
+ * #### Example:
237
+ * ```js
238
+ * matcher = $umf.compile("/about/:person");
239
+ * params = { person: "bob" };
240
+ * $bob = $urlService.href(matcher, params);
241
+ * // $bob == "/about/bob";
242
+ * ```
243
+ *
244
+ * @param urlMatcher The [[UrlMatcher]] object which is used as the template of the URL to generate.
245
+ * @param params An object of parameter values to fill the matcher's required parameters.
246
+ * @param options Options object. The options are:
247
+ *
248
+ * - **`absolute`** - {boolean=false}, If true will generate an absolute url, e.g. "http://www.example.com/fullurl".
249
+ *
250
+ * @returns Returns the fully compiled URL, or `null` if `params` fail validation against `urlMatcher`
251
+ */
252
+ href(urlMatcher: any, params: any, options: any): any;
253
+ /**
254
+ * Creates a [[UrlMatcher]] for the specified pattern.
255
+ *
256
+ * @param pattern The URL pattern.
257
+ * @param config The config object hash.
258
+ * @returns The UrlMatcher.
259
+ */
260
+ compile(pattern: any, config: any): UrlMatcher;
261
+ /**
262
+ * Returns true if the specified object is a [[UrlMatcher]], or false otherwise.
263
+ *
264
+ * @param object The object to perform the type check against.
265
+ * @returns `true` if the object matches the `UrlMatcher` interface, by
266
+ * implementing all the same methods.
267
+ */
268
+ isMatcher(object: any): boolean;
274
269
  }
275
270
  import { UrlRuleFactory } from "./url-rule";
276
271
  import { UrlRules } from "./url-rules";