From 6a2e3e2b2cadb518dc488e2e673ea04872bcdb75 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Mon, 24 May 2021 10:39:22 -0700 Subject: [PATCH] docs: change Navigation from type to interface (#42281) Navigation type should be interface so it can be documented on aio site. fixes #37384 PR Close #42281 --- goldens/public-api/router/router.d.ts | 12 ++++++------ packages/router/src/router.ts | 10 +++++----- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/goldens/public-api/router/router.d.ts b/goldens/public-api/router/router.d.ts index a8bd2ceadf..89c5e9d704 100644 --- a/goldens/public-api/router/router.d.ts +++ b/goldens/public-api/router/router.d.ts @@ -169,15 +169,15 @@ export declare type LoadChildren = LoadChildrenCallback | DeprecatedLoadChildren export declare type LoadChildrenCallback = () => Type | NgModuleFactory | Observable> | Promise | Type | any>; -export declare type Navigation = { +export declare interface Navigation { + extractedUrl: UrlTree; + extras: NavigationExtras; + finalUrl?: UrlTree; id: number; initialUrl: string | UrlTree; - extractedUrl: UrlTree; - finalUrl?: UrlTree; - trigger: 'imperative' | 'popstate' | 'hashchange'; - extras: NavigationExtras; previousNavigation: Navigation | null; -}; + trigger: 'imperative' | 'popstate' | 'hashchange'; +} export declare interface NavigationBehaviorOptions { replaceUrl?: boolean; diff --git a/packages/router/src/router.ts b/packages/router/src/router.ts index 8fa4819b11..eee17c9061 100644 --- a/packages/router/src/router.ts +++ b/packages/router/src/router.ts @@ -260,7 +260,7 @@ export type RestoredState = { * * @publicApi */ -export type Navigation = { +export interface Navigation { /** * The unique identifier of the current navigation. */ @@ -269,7 +269,7 @@ export type Navigation = { * The target URL passed into the `Router#navigateByUrl()` call before navigation. This is * the value before the router has parsed or applied redirects to it. */ - initialUrl: string | UrlTree; + initialUrl: string|UrlTree; /** * The initial target URL after being parsed with `UrlSerializer.extract()`. */ @@ -287,7 +287,7 @@ export type Navigation = { * * 'popstate'--Triggered by a popstate event. * * 'hashchange'--Triggered by a hashchange event. */ - trigger: 'imperative' | 'popstate' | 'hashchange'; + trigger: 'imperative'|'popstate'|'hashchange'; /** * Options that controlled the strategy used for this navigation. * See `NavigationExtras`. @@ -298,8 +298,8 @@ export type Navigation = { * is available, therefore this previous `Navigation` object has a `null` value * for its own `previousNavigation`. */ - previousNavigation: Navigation | null; -}; + previousNavigation: Navigation|null; +} export type NavigationTransition = { id: number,