UNPKG

1.53 kBTypeScriptView Raw
1/** @publicapi @module ng1 */ /** */
2import { LocationConfig, LocationServices, UIRouter } from '@uirouter/core';
3import { ILocationService, ILocationProvider, IWindowService } from 'angular';
4/**
5 * Implements UI-Router LocationServices and LocationConfig using Angular 1's $location service
6 * @internalapi
7 */
8export declare class Ng1LocationServices implements LocationConfig, LocationServices {
9 private $locationProvider;
10 private $location;
11 private $sniffer;
12 private $browser;
13 private $window;
14 path: any;
15 search: any;
16 hash: any;
17 hashPrefix: any;
18 port: any;
19 protocol: any;
20 host: any;
21 private _baseHref;
22 private _urlListeners;
23 /**
24 * Applys ng1-specific path parameter encoding
25 *
26 * The Angular 1 `$location` service is a bit weird.
27 * It doesn't allow slashes to be encoded/decoded bi-directionally.
28 *
29 * See the writeup at https://github.com/angular-ui/ui-router/issues/2598
30 *
31 * This code patches the `path` parameter type so it encoded/decodes slashes as ~2F
32 *
33 * @param router
34 */
35 static monkeyPatchPathParameterType(router: UIRouter): void;
36 dispose(): void;
37 constructor($locationProvider: ILocationProvider);
38 onChange(callback: Function): () => Function[];
39 html5Mode(): any;
40 baseHref(): any;
41 url(newUrl?: string, replace?: boolean, state?: any): string;
42 _runtimeServices($rootScope: any, $location: ILocationService, $sniffer: any, $browser: any, $window: IWindowService): void;
43}