feat(router): implement scrolling restoration service (#20030)
For documentation, see `RouterModule.scrollPositionRestoration` Fixes #13636 #10929 #7791 #6595 PR Close #20030
This commit is contained in:

committed by
Miško Hevery

parent
1b253e14ff
commit
49c5234c68
16
tools/public_api_guard/router/router.d.ts
vendored
16
tools/public_api_guard/router/router.d.ts
vendored
@ -108,15 +108,18 @@ export declare class DefaultUrlSerializer implements UrlSerializer {
|
||||
/** @experimental */
|
||||
export declare type DetachedRouteHandle = {};
|
||||
|
||||
export declare type Event = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd;
|
||||
export declare type Event = RouterEvent | RouteConfigLoadStart | RouteConfigLoadEnd | ChildActivationStart | ChildActivationEnd | ActivationStart | ActivationEnd | Scroll;
|
||||
|
||||
export interface ExtraOptions {
|
||||
anchorScrolling?: 'disabled' | 'enabled';
|
||||
enableTracing?: boolean;
|
||||
errorHandler?: ErrorHandler;
|
||||
initialNavigation?: InitialNavigation;
|
||||
onSameUrlNavigation?: 'reload' | 'ignore';
|
||||
paramsInheritanceStrategy?: 'emptyOnly' | 'always';
|
||||
preloadingStrategy?: any;
|
||||
scrollOffset?: [number, number] | (() => [number, number]);
|
||||
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top';
|
||||
useHash?: boolean;
|
||||
}
|
||||
|
||||
@ -465,6 +468,17 @@ export declare class RoutesRecognized extends RouterEvent {
|
||||
/** @experimental */
|
||||
export declare type RunGuardsAndResolvers = 'paramsChange' | 'paramsOrQueryParamsChange' | 'always';
|
||||
|
||||
export declare class Scroll {
|
||||
readonly anchor: string | null;
|
||||
readonly position: [number, number] | null;
|
||||
readonly routerEvent: NavigationEnd;
|
||||
constructor(
|
||||
routerEvent: NavigationEnd,
|
||||
position: [number, number] | null,
|
||||
anchor: string | null);
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/** @experimental */
|
||||
export declare abstract class UrlHandlingStrategy {
|
||||
abstract extract(url: UrlTree): UrlTree;
|
||||
|
Reference in New Issue
Block a user