UNPKG

1.52 kBTypeScriptView Raw
1import { LocationServices } from '../common';
2import { Disposable } from '../interface';
3import { UIRouter } from '../router';
4import { HistoryLike, LocationLike } from './interface';
5/** A base `LocationServices` */
6export declare abstract class BaseLocationServices implements LocationServices, Disposable {
7 fireAfterUpdate: boolean;
8 private _listeners;
9 _location: LocationLike;
10 _history: HistoryLike;
11 _listener: (evt: any) => void;
12 constructor(router: UIRouter, fireAfterUpdate: boolean);
13 /**
14 * This should return the current internal URL representation.
15 *
16 * The internal URL includes only the portion that UI-Router matches.
17 * It does not include:
18 * - protocol
19 * - server
20 * - port
21 * - base href or hash
22 */
23 protected abstract _get(): string;
24 /**
25 * This should set the current URL.
26 *
27 * The `url` param should include only the portion that UI-Router matches on.
28 * It should not include:
29 * - protocol
30 * - server
31 * - port
32 * - base href or hash
33 *
34 * However, after this function completes, the browser URL should reflect the entire (fully qualified)
35 * HREF including those data.
36 */
37 protected abstract _set(state: any, title: string, url: string, replace: boolean): any;
38 hash: () => any;
39 path: () => any;
40 search: () => any;
41 url(url?: string, replace?: boolean): string;
42 onChange(cb: EventListener): () => Function[];
43 dispose(router: UIRouter): void;
44}