From fe54b84522b1b1141ebf6fa4a6457bd666c7f82c Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 19 Sep 2023 15:57:06 +0200 Subject: [PATCH] feat: add fallback handler to auto-types #2156 --- packages/svelte2tsx/src/helpers/sveltekit.ts | 1 + packages/typescript-plugin/src/language-service/sveltekit.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/packages/svelte2tsx/src/helpers/sveltekit.ts b/packages/svelte2tsx/src/helpers/sveltekit.ts index e1141abbb..2f907f0b4 100644 --- a/packages/svelte2tsx/src/helpers/sveltekit.ts +++ b/packages/svelte2tsx/src/helpers/sveltekit.ts @@ -220,6 +220,7 @@ function upserKitRouteFile( insertApiMethod('DELETE'); insertApiMethod('OPTIONS'); insertApiMethod('HEAD'); + insertApiMethod('fallback'); return { addedCode, originalText: source.getFullText() }; } diff --git a/packages/typescript-plugin/src/language-service/sveltekit.ts b/packages/typescript-plugin/src/language-service/sveltekit.ts index bfde70bf9..9daaba238 100644 --- a/packages/typescript-plugin/src/language-service/sveltekit.ts +++ b/packages/typescript-plugin/src/language-service/sveltekit.ts @@ -425,6 +425,7 @@ export const kitExports: Record< DELETE: createApiExport('DELETE'), OPTIONS: createApiExport('OPTIONS'), HEAD: createApiExport('HEAD'), + fallback: createApiExport('fallback'), // param matching match: { allowedIn: [],