diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts index dfd85e9b0..6e77ba20c 100644 --- a/packages/astro/src/@types/astro.ts +++ b/packages/astro/src/@types/astro.ts @@ -869,8 +869,6 @@ export type Params = Record; export type Props = Record; -type Body = string; - export interface AstroAdapter { name: string; serverEntrypoint?: string; @@ -878,16 +876,18 @@ export interface AstroAdapter { args?: any; } +type Body = string; + export interface APIContext { params: Params; request: Request; } -export interface EndpointOutput { - body: Output; +export interface EndpointOutput { + body: Body; } -export type APIRoute = (context: APIContext) => EndpointOutput | Response; +export type APIRoute = (context: APIContext) => EndpointOutput | Response | Promise; export interface EndpointHandler { [method: string]: APIRoute | ((params: Params, request: Request) => EndpointOutput | Response);