diff --git a/packages/kit/scripts/generate-dts.js b/packages/kit/scripts/generate-dts.js index 1af5db6ae96b..e8579ec59054 100644 --- a/packages/kit/scripts/generate-dts.js +++ b/packages/kit/scripts/generate-dts.js @@ -1,5 +1,5 @@ import { createBundle } from 'dts-buddy'; -import { readFileSync, writeFileSync } from 'node:fs'; +import { readFileSync } from 'node:fs'; await createBundle({ output: 'types/index.d.ts', @@ -28,9 +28,3 @@ if (types.includes('__sveltekit/')) { types ); } - -// this is hacky as all hell but it gets the tests passing. might be a bug in dts-buddy? -// prettier-ignore -writeFileSync('./types/index.d.ts', types.replace("declare module '$app/server' {", `declare module '$app/server' { - // @ts-ignore - import { LayoutParams as AppLayoutParams, RouteId as AppRouteId } from '$app/types'`)); diff --git a/packages/kit/src/runtime/app/server/event.js b/packages/kit/src/runtime/app/server/event.js index 8351e21e9000..436d6010ac47 100644 --- a/packages/kit/src/runtime/app/server/event.js +++ b/packages/kit/src/runtime/app/server/event.js @@ -19,6 +19,7 @@ import('node:async_hooks') * * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). * @since 2.20.0 + * @returns {RequestEvent} */ export function getRequestEvent() { const event = request_event ?? als?.getStore(); diff --git a/packages/kit/types/index.d.ts b/packages/kit/types/index.d.ts index b9485d8918d4..93da0a0aa0f9 100644 --- a/packages/kit/types/index.d.ts +++ b/packages/kit/types/index.d.ts @@ -2616,8 +2616,6 @@ declare module '$app/paths' { } declare module '$app/server' { - // @ts-ignore - import { LayoutParams as AppLayoutParams, RouteId as AppRouteId } from '$app/types' import type { RequestEvent, RemoteCommand, RemoteForm, RemotePrerenderFunction, RemoteQueryFunction } from '@sveltejs/kit'; import type { StandardSchemaV1 } from '@standard-schema/spec'; /** @@ -2638,8 +2636,8 @@ declare module '$app/server' { * * In environments without [`AsyncLocalStorage`](https://nodejs.org/api/async_context.html#class-asynclocalstorage), this must be called synchronously (i.e. not after an `await`). * @since 2.20.0 - */ - export function getRequestEvent(): RequestEvent, any>; + * */ + export function getRequestEvent(): RequestEvent; /** * Creates a remote command. When called from the browser, the function will be invoked on the server via a `fetch` call. *