import { NextApiRequest, NextApiResponse } from "next"; export declare const TOKEN_KEY = "contentful_bearer_token"; /** * Takes a Next.js req object and returns the spaceId from the URL (if present) * * @param req * @returns */ export declare function getSpaceIdFromReq(req: NextApiRequest): string | null; declare type ProxyEndpoint = "delivery" | "preview" | "management"; export interface ProxyOptions { basePath?: string; endpoint?: ProxyEndpoint; middleware?: boolean; accessTokens: { delivery: string; preview: string; management: string; }; } /** * Forwards requests along to Contentful, but provides access to * server-side tokens and Next.js's preview data. * * Uses access tokens in this order: * - Uses delivery, preview token provided, otherwise the one sent in the client-side request headers * - Uses management stored in preview data, otherwise provided, otherwise the one sent in the client-side request headers * * @param req * @returns */ export declare function proxy(options: ProxyOptions): (req: NextApiRequest, res: NextApiResponse) => Promise>; export {};