Skip to content

Commit

Permalink
fix(router): Use correct return type for provideRoutes function (#46941)
Browse files Browse the repository at this point in the history
The provideRoutes function of the Router returns a Provider array and should not be typed as 'any'

PR Close #46941
  • Loading branch information
atscott authored and AndrewKushnir committed Aug 1, 2022
1 parent 8600732 commit f364378
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion goldens/public-api/router/index.md
Expand Up @@ -492,7 +492,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' | '';
Expand Down
4 changes: 2 additions & 2 deletions packages/router/src/router_module.ts
Expand Up @@ -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: ROUTES, multi: true, useValue: routes},
];
Expand Down Expand Up @@ -249,7 +249,7 @@ function provideInitialNavigation(config: Pick<ExtraOptions, 'initialNavigation'
];
}

function provideRouterInitializer(): ReadonlyArray<Provider> {
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.
Expand Down

0 comments on commit f364378

Please sign in to comment.