2019-07-17 20:49:16 -04:00
|
|
|
export declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformLocationConfig>;
|
2019-04-25 10:36:49 -04:00
|
|
|
|
2016-07-20 20:51:21 -04:00
|
|
|
export declare class MockLocationStrategy extends LocationStrategy {
|
|
|
|
internalBaseHref: string;
|
|
|
|
internalPath: string;
|
|
|
|
internalTitle: string;
|
|
|
|
urlChanges: string[];
|
|
|
|
constructor();
|
|
|
|
back(): void;
|
|
|
|
forward(): void;
|
|
|
|
getBaseHref(): string;
|
2019-02-06 17:42:57 -05:00
|
|
|
getState(): unknown;
|
2016-07-20 20:51:21 -04:00
|
|
|
onPopState(fn: (value: any) => void): void;
|
|
|
|
path(includeHash?: boolean): string;
|
|
|
|
prepareExternalUrl(internal: string): string;
|
|
|
|
pushState(ctx: any, title: string, path: string, query: string): void;
|
|
|
|
replaceState(ctx: any, title: string, path: string, query: string): void;
|
|
|
|
simulatePopState(url: string): void;
|
|
|
|
}
|
|
|
|
|
2019-04-23 10:16:08 -04:00
|
|
|
export declare class MockPlatformLocation implements PlatformLocation {
|
2019-11-09 13:36:22 -05:00
|
|
|
get hash(): string;
|
|
|
|
get hostname(): string;
|
|
|
|
get href(): string;
|
|
|
|
get pathname(): string;
|
|
|
|
get port(): string;
|
|
|
|
get protocol(): string;
|
|
|
|
get search(): string;
|
|
|
|
get state(): unknown;
|
|
|
|
get url(): string;
|
2019-04-23 10:16:08 -04:00
|
|
|
constructor(config?: MockPlatformLocationConfig);
|
|
|
|
back(): void;
|
|
|
|
forward(): void;
|
|
|
|
getBaseHrefFromDOM(): string;
|
|
|
|
getState(): unknown;
|
|
|
|
onHashChange(fn: LocationChangeListener): void;
|
|
|
|
onPopState(fn: LocationChangeListener): void;
|
|
|
|
pushState(state: any, title: string, newUrl: string): void;
|
|
|
|
replaceState(state: any, title: string, newUrl: string): void;
|
|
|
|
}
|
|
|
|
|
2020-02-26 12:09:35 -05:00
|
|
|
export declare interface MockPlatformLocationConfig {
|
2019-04-25 10:36:49 -04:00
|
|
|
appBaseHref?: string;
|
|
|
|
startUrl?: string;
|
|
|
|
}
|
|
|
|
|
2019-04-23 17:53:38 -04:00
|
|
|
export declare class SpyLocation implements Location {
|
2016-06-22 17:56:10 -04:00
|
|
|
urlChanges: string[];
|
2016-06-23 21:19:32 -04:00
|
|
|
back(): void;
|
|
|
|
forward(): void;
|
2019-02-06 17:42:57 -05:00
|
|
|
getState(): unknown;
|
2018-01-24 12:19:59 -05:00
|
|
|
go(path: string, query?: string, state?: any): void;
|
2016-06-22 17:56:10 -04:00
|
|
|
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
2016-06-23 21:19:32 -04:00
|
|
|
normalize(url: string): string;
|
2019-04-23 10:16:08 -04:00
|
|
|
onUrlChange(fn: (url: string, state: unknown) => void): void;
|
2016-06-23 21:19:32 -04:00
|
|
|
path(): string;
|
2016-06-22 17:56:10 -04:00
|
|
|
prepareExternalUrl(url: string): string;
|
2018-01-24 12:19:59 -05:00
|
|
|
replaceState(path: string, query?: string, state?: any): void;
|
2016-06-23 21:19:32 -04:00
|
|
|
setBaseHref(url: string): void;
|
|
|
|
setInitialPath(url: string): void;
|
|
|
|
simulateHashChange(pathname: string): void;
|
|
|
|
simulateUrlPop(pathname: string): void;
|
2018-02-27 17:06:06 -05:00
|
|
|
subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
|
2016-06-22 17:56:10 -04:00
|
|
|
}
|