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<
1020
1020
/**
1021
1021
* Information about the target of a specific navigation.
1022
1022
*/
1023
- export interface NavigationTarget {
1023
+ export interface NavigationTarget <
1024
+ Params extends AppLayoutParams < '/' > = AppLayoutParams < '/' > ,
1025
+ RouteId extends AppRouteId | null = AppRouteId | null
1026
+ > {
1024
1027
/**
1025
1028
* Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
1026
1029
* Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
1027
1030
*/
1028
- params : Record < string , string > | null ;
1031
+ params : Params | null ;
1029
1032
/**
1030
1033
* Info about the target route
1031
1034
*/
1032
1035
route : {
1033
1036
/**
1034
1037
* 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.
1035
1038
*/
1036
- id : string | null ;
1039
+ id : RouteId | null ;
1037
1040
} ;
1038
1041
/**
1039
1042
* The URL that is navigated to
Original file line number Diff line number Diff line change @@ -997,20 +997,23 @@ declare module '@sveltejs/kit' {
997
997
/**
998
998
* Information about the target of a specific navigation.
999
999
*/
1000
- export interface NavigationTarget {
1000
+ export interface NavigationTarget <
1001
+ Params extends AppLayoutParams < '/' > = AppLayoutParams < '/' > ,
1002
+ RouteId extends AppRouteId | null = AppRouteId | null
1003
+ > {
1001
1004
/**
1002
1005
* Parameters of the target page - e.g. for a route like `/blog/[slug]`, a `{ slug: string }` object.
1003
1006
* Is `null` if the target is not part of the SvelteKit app (could not be resolved to a route).
1004
1007
*/
1005
- params : Record < string , string > | null ;
1008
+ params : Params | null ;
1006
1009
/**
1007
1010
* Info about the target route
1008
1011
*/
1009
1012
route : {
1010
1013
/**
1011
1014
* 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.
1012
1015
*/
1013
- id : string | null ;
1016
+ id : RouteId | null ;
1014
1017
} ;
1015
1018
/**
1016
1019
* The URL that is navigated to
You can’t perform that action at this time.
0 commit comments