import type { Node } from '@markdoc/markdoc';
import type { JSX } from 'react';
import type { CommonError, GlobalData } from '../types/index.js';
import type { MiddlewareDetails, PageRouteInit, PageRouteDetails, RouteDetails, LifecycleContext, ApiRoute, ParseMarkdocOpts, WildcardRedirectsTree, RedirectOptions, McpToolRegistration, McpToolSchema, MarkdocOptions } from './types';
import type { RedoclyConfig, RedirectConfig, CompilationError, PageStaticData } from '@redocly/config';
import type { SearchFacet } from '@redocly/theme/core/types';
import type { BundledDefinition as OpenApiBundledDefinition } from './plugins/openapi-docs/load-definition.js';
import type { BundledDefinition as AsyncApiBundledDefinition } from './plugins/asyncapi-docs/asyncapi-doc-loader.js';
import type { BundledDefinition as GraphqlBundledDefinition } from './plugins/graphql-docs/graphql-doc-loader.js';
import type { SearchEngine } from './plugins/search/engines/search-engine.js';
import { KvService } from './persistence/kv/services/kv-service.js';
export declare const USER_DEFINED_API_FUNCTIONS_COUNTER_KEY = "userDefinedApiFunctions";
type LifecycleEventType = '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 type ComputedRedoclyConfig = {
    configFilePath: string;
    linkTags?: string;
    headScriptTags?: string;
    postBodyScriptTags?: string;
    preBodyScriptTags?: string;
    wildcardRedirectsTree: WildcardRedirectsTree;
    [key: string]: unknown;
};
export declare class Store {
    #private;
    routesBySlug: Map<string, PageRouteDetails>;
    replacedEnvVars: Record<string, {
        original: string;
        replaced: string;
    }>;
    unsetEnvVars: Set<string>;
    lifecycleContext: LifecycleContext | undefined;
    newRoutes: PageRouteInit[];
    routesByFsPath: Map<string, string>;
    apiRoutes: ApiRoute[];
    middleware: MiddlewareDetails[];
    routesSharedData: Map<string, Record<string, string>>;
    sharedDataDeps: Map<string, Set<string>>;
    sharedDataMarkdocComponents: Map<string, Set<string>>;
    routesDynamicComponents: Map<string, Set<string>>;
    routesPartials: Map<string, string[]>;
    ssr: {
        preBodyTags: string[];
        postBodyTags: string[];
        headTags: string[];
    };
    searchFacets: Map<string, SearchFacet>;
    searchEngine: SearchEngine | undefined;
    templates: Map<string, string>;
    browserPlugins: Set<string>;
    apiRoutesRequestHandlers: Map<string, string>;
    mcpToolHandlers: Map<string, McpToolRegistration>;
    serverPropsGetters: Map<string, string>;
    pagePropsGetters: Map<string, string>;
    listeners: Map<string, Set<(...args: any[]) => void>>;
    globalData: GlobalData;
    config: WithRequired<RedoclyConfig, 'redirects'> & ComputedRedoclyConfig;
    serverMode: boolean;
    serverOutDir: string;
    outdir: string;
    buildRevision: number;
    hasSitemap: boolean;
    compilationErrors: CompilationError[];
    userCodeReady: Promise<boolean>;
    constructor({ outdir, contentDir, serverMode, serverOutDir }: StoreOptions);
    on(type: 'routes-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, void, void]>;
    waitForPluginsRun(): Promise<void>;
    finishPluginsRun(): void;
    startEsbuildRun(): void;
    finishEsbuildRun(): void;
    markRequestHandlersEntryOutdated(): void;
    noteRequestHandlersEntryBuildStart(): void;
    markRequestHandlersEntryUpdated(): void;
    get contentDir(): string;
    markUserCodeReady(): void;
    reloadMarkdocOptions(): Promise<void>;
    get markdocOptions(): MarkdocOptions;
    setGlobalData: (data: GlobalData) => void;
    getGlobalData: () => GlobalData;
    getKv: () => Promise<KvService>;
    parseMarkdoc: ({ input, context, deps, resource }: ParseMarkdocOpts) => Promise<{
        info: {
            sharedDataDeps?: Set<string>;
            dynamicMarkdocComponents?: string[];
            partials?: string[];
            tagList?: string[];
            htmlTagsList?: string[];
            tagOccurrence?: Record<string, number>;
            codeSnippetLanguages?: Record<string, number>;
            codeWalkthroughLanguages?: Record<string, number>;
        };
        ast: Node;
        compoundHash: string;
    }>;
    loadOpenApiDefinitions(context: LifecycleContext): Promise<OpenApiBundledDefinition[]>;
    loadAsyncApiDefinitions(context: LifecycleContext): Promise<AsyncApiBundledDefinition[]>;
    loadGraphqlDefinitions(context: LifecycleContext): Promise<GraphqlBundledDefinition[]>;
    setSearchEngine(engine: SearchEngine): void;
    setSearchFacets: (searchFacets: Map<string, SearchFacet>) => void;
    setGlobalConfig: (data: Partial<RedoclyConfig>) => void;
    getConfig: () => RedoclyConfig;
    getGlobalConfig: <T = unknown>(key: string) => T;
    getSearchFacets: () => Map<string, SearchFacet>;
    addRedirect: (from: string, to: RedirectConfig, options?: RedirectOptions) => void;
    getRedirect: (from: string) => WithRequired<RedirectConfig, 'to'> | null;
    createSharedData: (id: string, data: unknown, hash?: string) => Promise<string>;
    addRouteSharedData: (routeSlug: string, dataKey: string, dataId: string) => void;
    getRouteSharedDataByFsPath: (fsPath: string) => Record<string, string>;
    getPartialsForRoute: (slug: string) => Record<string, Node>;
    addRoute: (route: PageRouteInit) => void;
    addRouteSharedDataToAllLocales: (slug: string, dataKey: string, dataId: string) => void;
    addApiRoute: (route: ApiRoute) => void;
    addMcpTools: (importPath: string, tools: McpToolSchema[]) => void;
    getMcpTools: () => McpToolRegistration[];
    addMiddleware: (middleware: MiddlewareDetails) => void;
    setResourceResponseHeaders: (resourcePath: string, headers: NonNullable<RedoclyConfig['responseHeaders']>[string]) => void;
    getRouteByFsPath: (relativePath: string) => PageRouteDetails | undefined;
    getRouteBySlug: (slug: string, opts?: {
        followRedirect?: boolean;
    }) => PageRouteDetails | undefined;
    hasRouteOrRedirectBySlug: (slug: string) => boolean;
    getRoutesByTemplateId: (templateId: string) => PageRouteInit[];
    getAllRoutesForLocale: (locale?: string) => PageRouteDetails[];
    getAllRoutes: () => PageRouteDetails[];
    getAllApiRoutes: () => ApiRoute[];
    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;
    clearRequestHandlersByPrefix: (prefix: string) => void;
    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(): Promise<{
        [k: string]: unknown;
    }>;
    static fromJson(json: Record<string, unknown>, options: StoreOptions): Store;
    getConfigWithEnvPlaceholders(): Promise<RedoclyConfig>;
    reportUnsetEnvVars(): Promise<void>;
}
export {};
//# sourceMappingURL=store.d.ts.map