From aa8c23a352fd47094763c0cf4b3c6e4c99d379c1 Mon Sep 17 00:00:00 2001 From: Andrew Scott Date: Fri, 8 Jul 2022 13:59:56 -0700 Subject: [PATCH] fix(router): Use correct return type for provideRoutes function The provideRoutes function of the Router returns a Provider array and should not be typed as 'any' --- goldens/public-api/router/index.md | 2 +- packages/router/src/router_module.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/goldens/public-api/router/index.md b/goldens/public-api/router/index.md index 9e49908394f2f..80ff5d16b98e1 100644 --- a/goldens/public-api/router/index.md +++ b/goldens/public-api/router/index.md @@ -489,7 +489,7 @@ export abstract class PreloadingStrategy { export const PRIMARY_OUTLET = "primary"; // @public -export function provideRoutes(routes: Routes): any; +export function provideRoutes(routes: Routes): Provider[]; // @public export type QueryParamsHandling = 'merge' | 'preserve' | ''; diff --git a/packages/router/src/router_module.ts b/packages/router/src/router_module.ts index 6a3a1a7cdf5bf..0c6b5099e7453 100644 --- a/packages/router/src/router_module.ts +++ b/packages/router/src/router_module.ts @@ -202,7 +202,7 @@ export function provideForRootGuard(router: Router): any { * * @publicApi */ -export function provideRoutes(routes: Routes): any { +export function provideRoutes(routes: Routes): Provider[] { return [ {provide: ANALYZE_FOR_ENTRY_COMPONENTS, multi: true, useValue: routes}, {provide: ROUTES, multi: true, useValue: routes}, @@ -250,7 +250,7 @@ function provideInitialNavigation(config: Pick { +function provideRouterInitializer(): Provider[] { return [ // ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just // have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.