///
import type { APIContext, AstroConfig, EndpointHandler, EndpointOutput, MiddlewareHandler, Params } from '../../@types/astro';
import type { Environment, RenderContext } from '../render/index';
import { AstroCookies } from '../cookies/index.js';
type EndpointCallResult = {
type: 'simple';
body: string;
encoding?: BufferEncoding;
cookies: AstroCookies;
} | {
type: 'response';
response: Response;
};
type CreateAPIContext = {
request: Request;
params: Params;
site?: string;
props: Record;
adapterName?: string;
};
/**
* 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, }: CreateAPIContext): APIContext;
export declare function callEndpoint(mod: EndpointHandler, env: Environment, ctx: RenderContext, onRequest?: MiddlewareHandler | undefined): Promise;
export declare function throwIfRedirectNotAllowed(response: Response, config: AstroConfig): void;
export {};