import type { JSX } from 'react';
import type { Plugin } from 'esbuild';
import type { CommonError, GlobalData } from '../types/index.js';
import type { MiddlewareDetails, PageRouteInit, PageRouteDetails, RouteDetails, LifecycleContext, MarkdownParseInput, ApiFunctionRoute, MarkdocDeps } from './types';
import type { RedoclyConfig, RedirectConfig, CompilationError, PageStaticData } from '@redocly/config';
import type { SearchFacet } from '@redocly/theme';
import type { BundledDefinition } from './plugins/openapi-docs/load-definition.js';
import type { SearchEngine } from './plugins/search/engines/search-engine.js';
export declare const MARKDOC_PARTIALS_DATA_KEY = "markdown/partials";
export declare const USER_DEFINED_API_FUNCTIONS_COUNTER_KEY = "userDefinedApiFunctions";
type LifecycleEventType = 'template-updated' | 'global-data-updated' | 'shared-data-updated' | 'routes-updated' | 'build-updated' | 'build-started' | 'errors-updated' | 'pages-updated';
export type StoreOptions = {
    contentDir: string;
    outdir: string;
    serverOutDir: string;
    serverMode?: boolean;
};
export interface ComputedRedoclyConfig {
    configFilePath: string;
    linkTags?: string;
    headScriptTags?: string;
    postBodyScriptTags?: string;
    preBodyScriptTags?: string;
    [key: string]: unknown;
}
export declare class Store {
    routesBySlug: Map<string, PageRouteDetails>;
    replacedEnvVars: Record<string, {
        original: string;
        replaced: string;
    }>;
    lifecycleContext: LifecycleContext | undefined;
    newRoutes: PageRouteInit[];
    _sharedDataHashes: Record<string, string>;
    routesByFsPath: Map<string, string>;
    apiRoutes: ApiFunctionRoute[];
    middleware: MiddlewareDetails[];
    routesSharedData: Map<string, Record<string, string>>;
    sharedDataDeps: Map<string, Set<string>>;
    sharedDataMarkdocComponents: Map<string, Set<string>>;
    routesDynamicComponents: Map<string, Set<string>>;
    ssr: {
        preBodyTags: string[];
        postBodyTags: string[];
        headTags: string[];
    };
    searchFacets: Map<string, SearchFacet>;
    searchEngine: SearchEngine | undefined;
    templates: Map<string, string>;
    browserPlugins: Set<string>;
    loginUrls: Record<string, string>;
    apiRequestHandlers: Map<string, string>;
    serverPropsGetters: Map<string, string>;
    pagePropsGetters: Map<string, string>;
    esbuildPlugins: Plugin[];
    listeners: Map<string, Set<(...args: any[]) => void>>;
    globalData: GlobalData;
    cliOptions: Record<string, string>;
    private _markdocOptions;
    config: WithRequired<RedoclyConfig, 'redirects'> & ComputedRedoclyConfig;
    _contentDir: string;
    serverMode: boolean;
    serverOutDir: string;
    outdir: string;
    buildRevision: number;
    hasSitemap: boolean;
    compilationErrors: CompilationError[];
    private _resolveUserCodeReady;
    userCodeReady: Promise<boolean>;
    private _pluginsRunning;
    private _resolvePluginsRunning;
    private _queuedLifecycleEvents;
    constructor({ outdir, contentDir, serverMode, serverOutDir }: StoreOptions);
    on(type: 'routes-updated', cb: () => void): void;
    on(type: 'template-updated', cb: () => void): void;
    on(type: 'build-updated', cb: () => void): void;
    on(type: 'build-started', cb: () => void): void;
    on(type: 'shared-data-updated', cb: (id: string, data: unknown) => void): void;
    on(type: 'errors-updated', cb: (errors: CommonError[]) => void): void;
    on(type: 'pages-updated', cb: (pages: number) => void): void;
    on(type: 'global-data-updated', cb: (data: Record<string, unknown>) => void): void;
    queueEvent: <T extends Array<unknown>>(type: LifecycleEventType, id?: string, ...args: T) => void;
    runListeners: <T extends Array<unknown>>(type: LifecycleEventType, id?: string, ...args: T) => void;
    startPluginsRun(): void;
    waitForPluginsLifecycle(): Promise<void>;
    finishPluginsRun(): void;
    get contentDir(): string;
    addEsbuildPlugin(plugin: Plugin): void;
    markUserCodeReady(): void;
    reloadMarkdocOptions(): Promise<void>;
    get markdocOptions(): {
        partials: any;
        themeConfig: {
            frontMatterKeysToResolve?: string[] | undefined;
            partialsFolders?: string[] | undefined;
            lastUpdatedBlock?: {
                format?: "timeago" | "iso" | "long" | "short" | undefined;
                hide?: boolean | undefined;
                locale?: string | undefined;
            } | undefined;
            toc?: {
                hide?: boolean | undefined;
                header?: string | undefined;
                depth?: number | undefined;
            } | undefined;
            editPage?: {
                hide?: boolean | undefined;
                baseUrl?: string | undefined;
            } | undefined;
        } | undefined;
        tags?: any;
        variables?: Record<string, any> | undefined;
        nodes?: any;
        functions?: Record<string, import("@markdoc/markdoc").ConfigFunction> | undefined;
        validation?: {
            parents?: import("@markdoc/markdoc").Node[];
            validateFunctions?: boolean;
            environment?: string;
        };
    };
    setGlobalData: (data: GlobalData) => void;
    getGlobalData: () => GlobalData;
    parseMarkdoc: (input: MarkdownParseInput, context: LifecycleContext, deps?: MarkdocDeps) => Promise<{
        info: {
            sharedDataDeps?: Set<string>;
            dynamicMarkdocComponents?: string[];
            tagList?: string[];
            htmlTagsList?: string[];
            tagOccurrence?: Record<string, number>;
        };
        ast: import("@markdoc/markdoc").Node;
        compoundHash: string;
    }>;
    loadOpenApiDefinitions(context: LifecycleContext): Promise<BundledDefinition[]>;
    setSearchEngine(engine: SearchEngine): void;
    setSearchFacets: (searchFacets: Map<string, SearchFacet>) => void;
    setCliOptions(data: Record<string, string>): void;
    setGlobalConfig: (data: Partial<RedoclyConfig>) => void;
    getConfig: () => RedoclyConfig;
    getGlobalConfig: <T = unknown>(key: string) => T;
    getSearchFacets: () => Map<string, SearchFacet>;
    addRedirect(from: string, to: RedirectConfig): void;
    createSharedData: (id: string, data: unknown, hash?: string) => Promise<string>;
    addRouteSharedData: (routeSlug: string, dataKey: string, dataId: string) => void;
    addRoute: (route: PageRouteInit) => void;
    addRouteSharedDataToAllLocales: (slug: string, dataKey: string, dataId: string) => void;
    addApiRoute: (route: ApiFunctionRoute) => void;
    addMiddleware: (middleware: MiddlewareDetails) => void;
    getLoginUrls: () => Record<string, string>;
    getRouteByFsPath: (relativePath: string) => PageRouteDetails | undefined;
    getRouteBySlug: (slug: string, opts?: {
        followRedirect?: boolean;
    }) => PageRouteDetails | undefined;
    getRoutesByTemplateId: (templateId: string) => PageRouteInit[];
    getAllRoutesForLocale: (locale?: string) => PageRouteDetails<PageStaticData, import("@redocly/config").PageProps>[];
    getAllRoutes: () => PageRouteDetails<PageStaticData, import("@redocly/config").PageProps>[];
    getAllApiRoutes: () => ApiFunctionRoute[];
    getAllMiddleware: () => MiddlewareDetails[];
    getTemplate: (id: string) => string | undefined;
    getRequestHandler: (id: string) => string | undefined;
    createTemplate: (id: string, importPath: string) => string;
    addBrowserPlugin: (importPath: string) => void;
    createRequestHandler: (id: string, importPath: string) => string;
    registerServerPropsGetter: (id: string, importPath: string) => string;
    registerPagePropsGetter: (id: string, importPath: string) => void;
    writeRouteStaticData(route: RouteDetails, context: LifecycleContext): Promise<void>;
    resolveRouteStaticData(route: RouteDetails, _context?: LifecycleContext, skipLastModified?: boolean): Promise<PageStaticData>;
    addSsrComponents(components: JSX.Element[] | string[], position: 'head' | 'preBody' | 'postBody'): void;
    clear: () => void;
    toJson(): {
        [k: string]: any;
    };
    static fromJson(json: Record<string, unknown>, options: StoreOptions): Store;
    getConfigWithEnvPlaceholders(): RedoclyConfig;
    private _reportUnsetEnvVars;
}
export {};
//# sourceMappingURL=store.d.ts.map