Skip to content

Commit 05f3f74

Browse files
atscottAndrewKushnir
authored andcommitted
fix(router): Use correct return type for provideRoutes function (#46941)
The provideRoutes function of the Router returns a Provider array and should not be typed as 'any' PR Close #46941
1 parent 6307f35 commit 05f3f74

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

goldens/public-api/router/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ export abstract class PreloadingStrategy {
483483
export const PRIMARY_OUTLET = "primary";
484484

485485
// @public
486-
export function provideRoutes(routes: Routes): any;
486+
export function provideRoutes(routes: Routes): Provider[];
487487

488488
// @public
489489
export type QueryParamsHandling = 'merge' | 'preserve' | '';

packages/router/src/router_module.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ export function provideForRootGuard(router: Router): any {
202202
*
203203
* @publicApi
204204
*/
205-
export function provideRoutes(routes: Routes): any {
205+
export function provideRoutes(routes: Routes): Provider[] {
206206
return [
207207
{provide: ROUTES, multi: true, useValue: routes},
208208
];
@@ -249,7 +249,7 @@ function provideInitialNavigation(config: Pick<ExtraOptions, 'initialNavigation'
249249
];
250250
}
251251

252-
function provideRouterInitializer(): ReadonlyArray<Provider> {
252+
function provideRouterInitializer(): Provider[] {
253253
return [
254254
// ROUTER_INITIALIZER token should be removed. It's public API but shouldn't be. We can just
255255
// have `getBootstrapListener` directly attached to APP_BOOTSTRAP_LISTENER.

0 commit comments

Comments
 (0)