@@ -211,6 +211,11 @@ export class Location {
211211 * @type {string }
212212 */
213213 $$path : string ;
214+ /**
215+ * Current url
216+ * @type {string }
217+ */
218+ $$url : string ;
214219 /**
215220 * The hash string, minus the hash symbol
216221 * @type {string }
@@ -243,28 +248,6 @@ export class Location {
243248 * @return {string } url
244249 */
245250 getUrl ( ) : string ;
246- /**
247- * @deprecated
248- * This method is getter / setter.
249- *
250- * Return path of current URL when called without any parameter.
251- *
252- * Change path when called with parameter and return `$location`.
253- *
254- * Note: Path should always begin with forward slash (/), this method will add the forward slash
255- * if it is missing.
256- *
257- *
258- * ```js
259- * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo
260- * let path = $location.path();
261- * // => "/some/path"
262- * ```
263- *
264- * @param {(string|number)= } path New path
265- * @return {(string|object) } path if called with no parameters, or `$location` if called with a parameter
266- */
267- path ( path ?: ( string | number ) | undefined ) : string | object ;
268251 /**
269252 * Change path parameter and return `$location`.
270253 *
@@ -274,30 +257,11 @@ export class Location {
274257 setPath ( path : string | number ) : Location ;
275258 /**
276259 *
277- * Return path of current URL when called without any parameter.
278- *
279- * @return {(string|object) } path if called with no parameters, or `$location` if called with a parameter
280- */
281- getPath ( ) : string | object ;
282- /**
283- * @deprecated
284- * This method is getter / setter.
260+ * Return path of current URL
285261 *
286- * Returns the hash fragment when called without any parameters.
287- *
288- * Changes the hash fragment when called with a parameter and returns `$location`.
289- *
290- *
291- * ```js
292- * // given URL http://example.com/#/some/path?foo=bar&baz=xoxo#hashValue
293- * let hash = $location.getHash();
294- * // => "hashValue"
295- * ```
296- *
297- * @param {(string|number)= } hash New hash fragment
298- * @return {string|Location } hash
262+ * @return {string }
299263 */
300- hash ( hash ?: ( string | number ) | undefined ) : string | Location ;
264+ getPath ( ) : string ;
301265 /**
302266 * Changes the hash fragment when called with a parameter and returns `$location`.
303267 * @param {(string|number) } hash New hash fragment
@@ -341,25 +305,29 @@ export class Location {
341305 * @returns {Object } Search object or Location object
342306 */
343307 getSearch ( ) : any ;
344- $$url : string ;
345308 /**
346- * This method is getter / setter.
347- *
348- * Return the history state object when called without any parameter.
349- *
309+ * Compose url and update `url` and `absUrl` property
310+ * @returns {void }
311+ */
312+ $$compose ( ) : void ;
313+ /**
350314 * Change the history state object when called with one parameter and return `$location`.
351315 * The state object is later passed to `pushState` or `replaceState`.
352316 * See {@link https://developer.mozilla.org/en-US/docs/Web/API/History/pushState#state|History.state}
353317 *
354318 * NOTE: This method is supported only in HTML5 mode and only in browsers supporting
355319 * the HTML5 History API (i.e. methods `pushState` and `replaceState`). If you need to support
356320 * older browsers (like IE9 or Android < 4.0), don't use this method.
357- *
358- * @param {any } state State object for pushState or replaceState
359- * @return {any } state
321+ * @param {any } state
322+ * @returns {Location }
360323 */
361- state ( state : any , ... args : any [ ] ) : any ;
324+ setState ( state : any ) : Location ;
362325 $$state : any ;
326+ /**
327+ * Return the history state object
328+ * @returns {any }
329+ */
330+ getState ( ) : any ;
363331 /**
364332 * @param {string } url
365333 * @param {string } relHref
@@ -371,7 +339,6 @@ export class Location {
371339 * @param {string } url HTML5 URL
372340 */
373341 parse ( url : string ) : void ;
374- #private;
375342}
376343export class LocationProvider {
377344 /** @type {string } */
@@ -383,8 +350,8 @@ export class LocationProvider {
383350 urlChangeInit : boolean ;
384351 /** @type {History['state'] } */
385352 cachedState : History [ "state" ] ;
386- /** @typeof {History. state} */
387- lastHistoryState : any ;
353+ /** @type {History[' state'] } */
354+ lastHistoryState : History [ "state" ] ;
388355 /** @type {string } */
389356 lastBrowserUrl : string ;
390357 /**
0 commit comments