Skip to content

Commit 37b47c2

Browse files
committed
route always exists on LoadEvent and ServerLoadEvent
1 parent 48ae497 commit 37b47c2

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

packages/kit/types/index.d.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,15 @@ export interface LoadEvent<
359359
* ```
360360
*/
361361
depends(...deps: string[]): void;
362+
/**
363+
* Info about the current route
364+
*/
365+
route: {
366+
/**
367+
* The route ID of the current page - e.g. for `src/routes/blog/[slug]`, it would be `blog/[slug]`
368+
*/
369+
id: string;
370+
};
362371
}
363372

364373
export interface NavigationEvent<
@@ -369,7 +378,7 @@ export interface NavigationEvent<
369378
*/
370379
params: Params;
371380
/**
372-
* More info about the route in question
381+
* Info about the current route
373382
*/
374383
route: {
375384
/**
@@ -616,6 +625,15 @@ export interface ServerLoadEvent<
616625
* ```
617626
*/
618627
depends(...deps: string[]): void;
628+
/**
629+
* Info about the current route
630+
*/
631+
route: {
632+
/**
633+
* The route ID of the current page - e.g. for `src/routes/blog/[slug]`, it would be `blog/[slug]`
634+
*/
635+
id: string;
636+
};
619637
}
620638

621639
export interface Action<

0 commit comments

Comments
 (0)