From fa246955671f32bf773a819b18c7dce689860571 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 18 Nov 2022 23:16:23 +0100 Subject: [PATCH] [fix] adjust interfaces to fix type errors --- .changeset/wicked-kiwis-burn.md | 5 +++++ packages/kit/src/runtime/control.js | 2 +- packages/kit/types/index.d.ts | 6 +++--- 3 files changed, 9 insertions(+), 4 deletions(-) create mode 100644 .changeset/wicked-kiwis-burn.md diff --git a/.changeset/wicked-kiwis-burn.md b/.changeset/wicked-kiwis-burn.md new file mode 100644 index 000000000000..027eaba66240 --- /dev/null +++ b/.changeset/wicked-kiwis-burn.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': patch +--- + +[fix] adjust interfaces to fix type errors diff --git a/packages/kit/src/runtime/control.js b/packages/kit/src/runtime/control.js index d4322714136f..2bcf963985a2 100644 --- a/packages/kit/src/runtime/control.js +++ b/packages/kit/src/runtime/control.js @@ -21,7 +21,7 @@ export class HttpError { export class Redirect { /** - * @param {number} status + * @param {300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308} status * @param {string} location */ constructor(status, location) { diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index d9671dd9c619..0462f2a5c0b8 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -747,11 +747,11 @@ export function error( /** * The object returned by the `error` function */ -export interface HttpError extends UniqueInterface { +export interface HttpError { /** The HTTP status code */ status: number; /** The error message */ - body: { message: string } extends App.Error ? App.Error | string | undefined : App.Error; + body: App.Error; } /** @@ -766,7 +766,7 @@ export function redirect( /** * The object returned by the `redirect` function */ -export interface Redirect extends UniqueInterface { +export interface Redirect { /** The HTTP status code */ status: 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | 308; /** The location to redirect to */