diff --git a/packages/kit/src/exports/public.d.ts b/packages/kit/src/exports/public.d.ts index 2ff29f3571a0..5d41031b1613 100644 --- a/packages/kit/src/exports/public.d.ts +++ b/packages/kit/src/exports/public.d.ts @@ -990,7 +990,7 @@ export interface NavigationEvent< */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]` + * 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. */ id: RouteId; }; @@ -1012,7 +1012,12 @@ export interface NavigationTarget { /** * Info about the target route */ - route: { id: string | null }; + route: { + /** + * 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. + */ + id: string | null; + }; /** * The URL that is navigated to */ @@ -1129,7 +1134,7 @@ export interface Page< */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. + * 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. */ id: RouteId; }; @@ -1205,7 +1210,7 @@ export interface RequestEvent< */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. + * 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. */ id: RouteId; }; diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index af14891d66d3..deed8779b9a9 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -972,7 +972,7 @@ declare module '@sveltejs/kit' { */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]` + * 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. */ id: RouteId; }; @@ -994,7 +994,12 @@ declare module '@sveltejs/kit' { /** * Info about the target route */ - route: { id: string | null }; + route: { + /** + * 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. + */ + id: string | null; + }; /** * The URL that is navigated to */ @@ -1111,7 +1116,7 @@ declare module '@sveltejs/kit' { */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. + * 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. */ id: RouteId; }; @@ -1187,7 +1192,7 @@ declare module '@sveltejs/kit' { */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. + * 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. */ id: RouteId; };