From be452eafe1abecf0c274f0926d098ced3435ecc9 Mon Sep 17 00:00:00 2001 From: Scott Wu Date: Fri, 14 Mar 2025 20:42:04 +0800 Subject: [PATCH 1/3] . --- packages/kit/types/index.d.ts | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index af14891d66d3..10a8be474f2e 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 the router fails to match a route. */ id: RouteId; }; @@ -994,8 +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 the router fails to match a route. + */ + id: string | null; + }; /** * The URL that is navigated to */ url: URL; @@ -1111,7 +1115,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 the router fails to match a route. */ id: RouteId; }; @@ -1187,7 +1191,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 the router fails to match a route. */ id: RouteId; }; @@ -2033,7 +2037,7 @@ declare module '@sveltejs/kit' { export type NumericRange = Exclude, LessThan>; export const VERSION: string; class HttpError_1 { - + constructor(status: number, body: { message: string; } extends App.Error ? (App.Error | string | undefined) : App.Error); @@ -2042,7 +2046,7 @@ declare module '@sveltejs/kit' { toString(): string; } class Redirect_1 { - + constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string); status: 301 | 302 | 303 | 307 | 308 | 300 | 304 | 305 | 306; location: string; @@ -2477,11 +2481,11 @@ declare module '$app/state' { declare module '$app/stores' { export function getStores(): { - + page: typeof page; - + navigating: typeof navigating; - + updated: typeof updated; }; /** @@ -2596,4 +2600,4 @@ declare module '$service-worker' { export const version: string; } -//# sourceMappingURL=index.d.ts.map \ No newline at end of file +//# sourceMappingURL=index.d.ts.map From eef97b9d9c6a9645ee83174a033b67b099638e1a Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 14 Mar 2025 16:05:37 -0400 Subject: [PATCH 2/3] Revert "." This reverts commit be452eafe1abecf0c274f0926d098ced3435ecc9. --- packages/kit/types/index.d.ts | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index 10a8be474f2e..af14891d66d3 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]`. It is null when the router fails to match a route. + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]` */ id: RouteId; }; @@ -994,12 +994,8 @@ declare module '@sveltejs/kit' { /** * Info about the target route */ - route: { - /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is null when the router fails to match a route. - */ - id: string | null; - }; /** + route: { id: string | null }; + /** * The URL that is navigated to */ url: URL; @@ -1115,7 +1111,7 @@ declare module '@sveltejs/kit' { */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is null when the router fails to match a route. + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. */ id: RouteId; }; @@ -1191,7 +1187,7 @@ declare module '@sveltejs/kit' { */ route: { /** - * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. It is null when the router fails to match a route. + * The ID of the current route - e.g. for `src/routes/blog/[slug]`, it would be `/blog/[slug]`. */ id: RouteId; }; @@ -2037,7 +2033,7 @@ declare module '@sveltejs/kit' { export type NumericRange = Exclude, LessThan>; export const VERSION: string; class HttpError_1 { - + constructor(status: number, body: { message: string; } extends App.Error ? (App.Error | string | undefined) : App.Error); @@ -2046,7 +2042,7 @@ declare module '@sveltejs/kit' { toString(): string; } class Redirect_1 { - + constructor(status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308, location: string); status: 301 | 302 | 303 | 307 | 308 | 300 | 304 | 305 | 306; location: string; @@ -2481,11 +2477,11 @@ declare module '$app/state' { declare module '$app/stores' { export function getStores(): { - + page: typeof page; - + navigating: typeof navigating; - + updated: typeof updated; }; /** @@ -2600,4 +2596,4 @@ declare module '$service-worker' { export const version: string; } -//# sourceMappingURL=index.d.ts.map +//# sourceMappingURL=index.d.ts.map \ No newline at end of file From addd6b8103a81fb3e37a92b5093eff342246a21d Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Fri, 14 Mar 2025 16:09:42 -0400 Subject: [PATCH 3/3] update public.d.ts --- packages/kit/src/exports/public.d.ts | 13 +++++++++---- packages/kit/types/index.d.ts | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) 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; };