File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @sveltejs/kit " : feat
3+ ---
4+
5+ feat: add ` RouteId ` and ` RouteParams ` to NavigationTarget interface
Original file line number Diff line number Diff line change @@ -1020,20 +1020,23 @@ export interface NavigationEvent<
10201020/**
10211021 * Information about the target of a specific navigation.
10221022 */
1023- export interface NavigationTarget {
1023+ export interface NavigationTarget <
1024+ Params extends AppLayoutParams < '/' > = AppLayoutParams < '/' > ,
1025+ RouteId extends AppRouteId | null = AppRouteId | null
1026+ > {
10241027 /**
10251028 * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
10261029 * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
10271030 */
1028- params : Record < string , string > | null ;
1031+ params : Params | null ;
10291032 /**
10301033 * Info about the target route
10311034 */
10321035 route : {
10331036 /**
10341037 * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
10351038 */
1036- id : string | null ;
1039+ id : RouteId | null ;
10371040 } ;
10381041 /**
10391042 * The URL that is navigated to
Original file line number Diff line number Diff line change @@ -997,20 +997,23 @@ declare module '@sveltejs/kit' {
997997 /**
998998 * Information about the target of a specific navigation.
999999 */
1000- export interface NavigationTarget {
1000+ export interface NavigationTarget <
1001+ Params extends AppLayoutParams < '/' > = AppLayoutParams < '/' > ,
1002+ RouteId extends AppRouteId | null = AppRouteId | null
1003+ > {
10011004 /**
10021005 * Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
10031006 * Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
10041007 */
1005- params : Record < string , string > | null ;
1008+ params : Params | null ;
10061009 /**
10071010 * Info about the target route
10081011 */
10091012 route : {
10101013 /**
10111014 * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is `null` when no route is matched.
10121015 */
1013- id : string | null ;
1016+ id : RouteId | null ;
10141017 } ;
10151018 /**
10161019 * The URL that is navigated to
You can’t perform that action at this time.
0 commit comments