diff --git a/packages/core/src/types.ts b/packages/core/src/types.ts index 956a058..95322a4 100644 --- a/packages/core/src/types.ts +++ b/packages/core/src/types.ts @@ -213,21 +213,23 @@ export type Adapter = | WebrouteAdapter | OtherAdapter; export type RuntimeAdapter = Runtime & Adapter; +export type RuntimeAdapterTarget = T extends string ? Runtime & Extract : RuntimeAdapter; export type UniversalMiddleware< InContext extends Universal.Context = Universal.Context, OutContext extends Universal.Context = Universal.Context, + Target = unknown, > = ( request: Request, context: InContext, - runtime: RuntimeAdapter, + runtime: RuntimeAdapterTarget, // biome-ignore lint/suspicious/noConfusingVoidType: ) => Awaitable Awaitable) | void | undefined>; -export type UniversalHandler = ( +export type UniversalHandler = ( request: Request, context: InContext, - runtime: RuntimeAdapter, + runtime: RuntimeAdapterTarget, ) => Awaitable; export type Get = (...args: T) => U;