import { APIResource } from '../api';
import { MakeswiftClient } from '../client';
import { type ReactRuntimeCore } from '../runtimes/react/react-runtime-core';
import { redirectLiveHandler } from './handlers/redirect-live';
import { elementTreeHandler } from './handlers/element-tree';
import { fontsHandler, type Font, type GetFonts } from './handlers/fonts';
import { manifestHandler, type Manifest } from './handlers/manifest';
import { mergeTranslatedDataHandler } from './handlers/merge-translated-data';
import { revalidateHandler } from './handlers/revalidate';
import { translatableDataHandler } from './handlers/translatable-data';
import { webhookHandler } from './handlers/webhook';
import { type OnPublish } from './handlers/webhook/types';
import { type ApiRequest, type ErrorResponseBody, ApiResponse } from './request-response';
export type { Manifest, Font };
type Events = {
    onPublish: OnPublish;
};
export type ApiHandlerUserConfig = {
    runtime: ReactRuntimeCore;
    appOrigin?: string;
    apiOrigin?: string;
    getFonts?: GetFonts;
    events?: Events;
};
export type ApiHandlerInternalConfig = {
    client: MakeswiftClient;
    manifest?: Partial<Manifest>;
    revalidationHandler: (path?: string) => Promise<void>;
    previewCookieNames: string[];
};
type ApiHandlerConfig = ApiHandlerUserConfig & ApiHandlerInternalConfig;
type ResponseType = Awaited<ReturnType<typeof redirectLiveHandler> | ReturnType<typeof elementTreeHandler> | ReturnType<typeof fontsHandler> | ReturnType<typeof manifestHandler> | ReturnType<typeof mergeTranslatedDataHandler> | ReturnType<typeof revalidateHandler> | ReturnType<typeof translatableDataHandler> | ReturnType<typeof webhookHandler>> | ApiResponse<APIResource> | ApiResponse<ErrorResponseBody> | Response;
type ApiHandler = (req: ApiRequest, route: string) => Promise<ResponseType>;
export declare function createApiHandler(apiKey: string, { runtime, appOrigin, getFonts, events, client, manifest, revalidationHandler, previewCookieNames, }: ApiHandlerConfig): ApiHandler;
//# sourceMappingURL=index.d.ts.map