source: trip-planner-front/node_modules/@angular/common/testing/testing.d.ts@ b738035

Last change on this file since b738035 was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[6a3a178]1/**
[e29cc2e]2 * @license Angular v12.2.13
[6a3a178]3 * (c) 2010-2021 Google LLC. https://angular.io/
4 * License: MIT
5 */
6
7import { InjectionToken } from '@angular/core';
8import { Location as Location_2 } from '@angular/common';
9import { LocationChangeListener } from '@angular/common';
10import { LocationStrategy } from '@angular/common';
11import { PlatformLocation } from '@angular/common';
12import { SubscriptionLike } from 'rxjs';
13
14/**
15 * Provider for mock platform location config
16 *
17 * @publicApi
18 */
19export declare const MOCK_PLATFORM_LOCATION_CONFIG: InjectionToken<MockPlatformLocationConfig>;
20
21/**
22 * A mock implementation of {@link LocationStrategy} that allows tests to fire simulated
23 * location events.
24 *
25 * @publicApi
26 */
27export declare class MockLocationStrategy extends LocationStrategy {
28 internalBaseHref: string;
29 internalPath: string;
30 internalTitle: string;
31 urlChanges: string[];
32 private stateChanges;
33 constructor();
34 simulatePopState(url: string): void;
35 path(includeHash?: boolean): string;
36 prepareExternalUrl(internal: string): string;
37 pushState(ctx: any, title: string, path: string, query: string): void;
38 replaceState(ctx: any, title: string, path: string, query: string): void;
39 onPopState(fn: (value: any) => void): void;
40 getBaseHref(): string;
41 back(): void;
42 forward(): void;
43 getState(): unknown;
44}
45
46/**
47 * Mock implementation of URL state.
48 *
49 * @publicApi
50 */
51export declare class MockPlatformLocation implements PlatformLocation {
52 private baseHref;
53 private hashUpdate;
54 private urlChangeIndex;
55 private urlChanges;
56 constructor(config?: MockPlatformLocationConfig);
57 get hostname(): string;
58 get protocol(): string;
59 get port(): string;
60 get pathname(): string;
61 get search(): string;
62 get hash(): string;
63 get state(): unknown;
64 getBaseHrefFromDOM(): string;
65 onPopState(fn: LocationChangeListener): VoidFunction;
66 onHashChange(fn: LocationChangeListener): VoidFunction;
67 get href(): string;
68 get url(): string;
69 private parseChanges;
70 replaceState(state: any, title: string, newUrl: string): void;
71 pushState(state: any, title: string, newUrl: string): void;
72 forward(): void;
73 back(): void;
74 historyGo(relativePosition?: number): void;
75 getState(): unknown;
76 private scheduleHashUpdate;
77}
78
79/**
80 * Mock platform location config
81 *
82 * @publicApi
83 */
84export declare interface MockPlatformLocationConfig {
85 startUrl?: string;
86 appBaseHref?: string;
87}
88
89/**
90 * A spy for {@link Location} that allows tests to fire simulated location events.
91 *
92 * @publicApi
93 */
94export declare class SpyLocation implements Location_2 {
95 urlChanges: string[];
96 private _history;
97 private _historyIndex;
98 setInitialPath(url: string): void;
99 setBaseHref(url: string): void;
100 path(): string;
101 getState(): unknown;
102 isCurrentPathEqualTo(path: string, query?: string): boolean;
103 simulateUrlPop(pathname: string): void;
104 simulateHashChange(pathname: string): void;
105 prepareExternalUrl(url: string): string;
106 go(path: string, query?: string, state?: any): void;
107 replaceState(path: string, query?: string, state?: any): void;
108 forward(): void;
109 back(): void;
110 historyGo(relativePosition?: number): void;
111 onUrlChange(fn: (url: string, state: unknown) => void): void;
112 subscribe(onNext: (value: any) => void, onThrow?: ((error: any) => void) | null, onReturn?: (() => void) | null): SubscriptionLike;
113 normalize(url: string): string;
114}
115
116export { }
Note: See TracBrowser for help on using the repository browser.