fix(common): add PopStateEvent interface (#13400)
Closes #13378 PR Close #13400
This commit is contained in:
parent
f89d004c51
commit
fe441186e7
|
@ -10,6 +10,12 @@ import {EventEmitter, Injectable} from '@angular/core';
|
||||||
|
|
||||||
import {LocationStrategy} from './location_strategy';
|
import {LocationStrategy} from './location_strategy';
|
||||||
|
|
||||||
|
/** @experimental */
|
||||||
|
export interface PopStateEvent {
|
||||||
|
pop?: boolean;
|
||||||
|
type?: string;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @whatItDoes `Location` is a service that applications can use to interact with a browser's URL.
|
* @whatItDoes `Location` is a service that applications can use to interact with a browser's URL.
|
||||||
|
@ -122,7 +128,7 @@ export class Location {
|
||||||
* Subscribe to the platform's `popState` events.
|
* Subscribe to the platform's `popState` events.
|
||||||
*/
|
*/
|
||||||
subscribe(
|
subscribe(
|
||||||
onNext: (value: any) => void, onThrow: (exception: any) => void = null,
|
onNext: (value: PopStateEvent) => void, onThrow: (exception: any) => void = null,
|
||||||
onReturn: () => void = null): Object {
|
onReturn: () => void = null): Object {
|
||||||
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
|
return this._subject.subscribe({next: onNext, error: onThrow, complete: onReturn});
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ export declare class Location {
|
||||||
path(includeHash?: boolean): string;
|
path(includeHash?: boolean): string;
|
||||||
prepareExternalUrl(url: string): string;
|
prepareExternalUrl(url: string): string;
|
||||||
replaceState(path: string, query?: string): void;
|
replaceState(path: string, query?: string): void;
|
||||||
subscribe(onNext: (value: any) => void, onThrow?: (exception: any) => void, onReturn?: () => void): Object;
|
subscribe(onNext: (value: PopStateEvent) => void, onThrow?: (exception: any) => void, onReturn?: () => void): Object;
|
||||||
static joinWithSlash(start: string, end: string): string;
|
static joinWithSlash(start: string, end: string): string;
|
||||||
static normalizeQueryParams(params: string): string;
|
static normalizeQueryParams(params: string): string;
|
||||||
static stripTrailingSlash(url: string): string;
|
static stripTrailingSlash(url: string): string;
|
||||||
|
@ -239,6 +239,13 @@ export declare abstract class PlatformLocation {
|
||||||
abstract replaceState(state: any, title: string, url: string): void;
|
abstract replaceState(state: any, title: string, url: string): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @experimental */
|
||||||
|
export interface PopStateEvent {
|
||||||
|
pop?: boolean;
|
||||||
|
type?: string;
|
||||||
|
url?: string;
|
||||||
|
}
|
||||||
|
|
||||||
/** @stable */
|
/** @stable */
|
||||||
export declare class SlicePipe implements PipeTransform {
|
export declare class SlicePipe implements PipeTransform {
|
||||||
transform(value: any, start: number, end?: number): any;
|
transform(value: any, start: number, end?: number): any;
|
||||||
|
|
Loading…
Reference in New Issue