astro-ghostcms/.pnpm-store/v3/files/4d/634baf3e3ce467f52eb17664104...

22 lines
987 B
Plaintext

import type { APIContext, EndpointHandler, Locales, MiddlewareHandler, Params } from '../../@types/astro.js';
import { type Environment, type RenderContext } from '../render/index.js';
import type { RoutingStrategies } from '../config/schema.js';
type CreateAPIContext = {
request: Request;
params: Params;
site?: string;
props: Record<string, any>;
adapterName?: string;
locales: Locales | undefined;
routingStrategy: RoutingStrategies | undefined;
defaultLocale: string | undefined;
};
/**
* Creates a context that holds all the information needed to handle an Astro endpoint.
*
* @param {CreateAPIContext} payload
*/
export declare function createAPIContext({ request, params, site, props, adapterName, locales, routingStrategy, defaultLocale, }: CreateAPIContext): APIContext;
export declare function callEndpoint(mod: EndpointHandler, env: Environment, ctx: RenderContext, onRequest: MiddlewareHandler | undefined): Promise<Response>;
export {};