import type { REDOCLY_ROUTE_RBAC, REDOCLY_TEAMS_RBAC } from '@redocly/config';
import type { JSX } from 'react';
import type { JSONSchemaType } from '@redocly/ajv';
import type { Node } from '@markdoc/markdoc';
import type { ProductConfig } from '@redocly/theme/config';
import type { SearchFacet } from '@redocly/theme/core/types';
import type { GlobalData, Feature } from '../../../types/index.js';
import type { SearchDocument } from '../../types';
import type { RbacScopeItems, RedirectConfig, RedoclyConfig, ServerPropsContext, ServerPropsRequest, PageProps, PageStaticData, NavItem, ResolvedNavItem, Version, MdOptions, KvService } from '@redocly/config';
import type { LoaderFn } from '../fs';
import type { BundledDefinition } from '../../plugins/openapi-docs/load-definition';
import type { BundledDefinition as GraphqlBundledDefinition } from '../../plugins/graphql-docs/graphql-doc-loader';
import type { Cache } from '../../fs/cache';
import type { ContentFs } from '../../fs/content-fs';
import type { SearchEngine } from '../../plugins/search/engines/search-engine';
import type { Logger } from '../../tools/notifiers/logger.js';
import type { AiDocumentsStore } from '../../plugins/search/types';
import type { ParseMarkdocOpts } from '../../types/plugins/markdown';
import type { MarkdocConfigProps } from '../../plugins/markdown/compiler';
import type { ToolAnnotations } from '@redocly/mcp-typescript-sdk/types.js';
export type ResolveItemsOptions = {
    groupCustomSidebars?: boolean;
    locale?: string;
    ignoredRoutes?: Set<string>;
    ref?: string;
    ignoreCustomSidebar?: boolean;
    navFile: string;
    excludedFromLinkCheckerPatterns?: {
        apiFunctions: RegExp[];
        catalog: RegExp[];
    };
};
export type MarkdocOptions = Partial<Omit<MarkdocConfigProps, 'relativePath'>> & {
    themeConfig?: RedoclyConfig['markdown'];
};
export type GetStaticDataContext = {
    getRouteByFsPath: (relativePath: string) => PageRouteDetails<PageStaticData, PageProps> | undefined;
    getRouteBySlug: (relativePath: string, opts?: {
        followRedirect: boolean;
    }) => PageRouteDetails<PageStaticData, PageProps> | undefined;
    getGlobalConfig<T = unknown>(key: string): T | undefined;
    getGlobalData: () => GlobalData;
    getConfig: () => RedoclyConfig;
    getAllRoutes: () => PageRouteDetails<PageStaticData, PageProps>[];
    getAllApiRoutes: () => ApiRoute[];
    parseMarkdoc: (opts: Omit<ParseMarkdocOpts, 'deps'>) => Promise<{
        ast: Node;
        info: Record<string, unknown>;
        compoundHash: string;
    }>;
    getAllRoutesForLocale: (locale?: string) => PageRouteDetails<PageStaticData, PageProps>[];
    contentDir: string;
    outdir: string;
};
export type GetStaticDataFn<TRoute, TData> = (route: TRoute, context: GetStaticDataContext) => Promise<TData>;
export type GetServerPropsContext = {
    getConfig: () => RedoclyConfig;
    getGlobalConfig<T = unknown>(key: string): T | undefined;
    getGlobalData: () => GlobalData;
    getRouteSharedDataByFsPath: (routeFsPath: string) => Record<string, string> | undefined;
    getPartialsForRoute?: (slug: string) => Record<string, Node>;
    serverOutDir: string;
};
export type GetServerPropsFn<TData extends PageStaticData = PageStaticData, TProps extends PageProps = PageProps> = (route: PageRouteDetails<TData, TProps>, data: TData, mdOptions: MdOptions, actions: GetServerPropsContext) => Promise<TProps>;
export type GetPagePropsFn<TData extends PageStaticData = PageStaticData, TProps extends PageProps = PageProps> = (data: TData, request: ServerPropsRequest, context: ServerPropsContext) => Promise<TProps>;
export type RouteDetails<TRoute = any, TData extends PageStaticData = PageStaticData> = {
    slug: string;
    fsPath?: string;
    [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
    [REDOCLY_ROUTE_RBAC]?: {
        slug?: string;
        fsPath?: string;
    };
    getStaticData?: GetStaticDataFn<TRoute, TData>;
    metadata?: Record<string, unknown>;
    getNavText?: () => Promise<string> | string;
};
type PageRouteDetailsForward<TData extends PageStaticData = PageStaticData, TProps extends PageProps = PageProps> = {
    slug: string;
    fsPath: string;
    baseSlug: string;
    templateId: string;
    hasClientRoutes?: boolean;
    versions?: Version[];
    product?: ProductConfig;
    httpVerb?: string;
    path?: string;
    params?: string[];
    queries?: Record<string, string>;
    excludeFromSearch?: boolean;
    getStaticData?: GetStaticDataFn<PageRouteDetailsForward<TData, TProps>, TData>;
    metadata?: Record<string, unknown>;
    getNavText?: () => Promise<string> | string;
    getSidebar?(route: PageRouteDetailsForward<TData, TProps>, item?: NavItem): ResolvedNavItem[];
    getSearchDocuments?(route: PageRouteDetailsForward<TData, TProps>, staticData: TData, actions: AfterRoutesCreatedActions): Promise<SearchDocument[]>;
    getAiDocumentsStore?(route: PageRouteDetailsForward<TData, TProps>, staticData: TData, context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions): Promise<AiDocumentsStore | undefined>;
    serverPropsGetterIds?: string[];
    excludeFromSidebar?: boolean;
    [REDOCLY_TEAMS_RBAC]?: RbacScopeItems;
    [REDOCLY_ROUTE_RBAC]?: {
        slug?: string;
        fsPath?: string;
    };
};
export type PageRouteDetails<TData extends PageStaticData = PageStaticData, TProps extends PageProps = PageProps> = PageRouteDetailsForward<TData, TProps>;
export type PageRouteInit = Omit<PageRouteDetails<PageStaticData, PageProps>, 'versions' | 'slug' | 'product' | 'baseSlug' | typeof REDOCLY_ROUTE_RBAC> & {
    slug?: string;
    duplicateInAllLocales?: boolean;
    slugSuffix?: string;
    sharedData?: Array<{
        id: string;
        key: string;
    }>;
    redirectFrom?: Array<{
        type: number;
        from: string;
    }>;
};
export type ApiRouteMethod = 'get' | 'post' | 'put' | 'delete' | 'patch' | 'all';
export type ApiRoute = RouteDetails & {
    httpMethod: ApiRouteMethod;
    requestHandlerId: string;
};
export type McpToolSchema = {
    name: string;
    description: string;
    schema: Record<string, unknown>;
    outputSchema?: Record<string, unknown>;
    annotations?: ToolAnnotations;
};
export type McpToolRegistration = McpToolSchema & {
    importPath: string;
};
export type MiddlewareDetails = {
    id: string;
    importPath: string;
};
export type PathVersionInfo = {
    version: string;
    isDefault: boolean;
    versionFolderId: string;
};
export type RedirectOptions = {
    trackOriginalSource?: boolean;
};
export type ProcessContentActions = {
    createSharedData(id: string, data: unknown, hash?: string): Promise<string>;
    addRouteSharedData(slug: string, dataKey: string, dataId: string): void;
    addRouteSharedDataToAllLocales(slug: string, dataKey: string, dataId: string): void;
    loadOpenApiDefinitions(context: LifecycleContext): Promise<BundledDefinition[]>;
    loadGraphqlDefinitions(context: LifecycleContext): Promise<GraphqlBundledDefinition[]>;
    setGlobalConfig: (data: Record<string, unknown>) => void;
    setGlobalData: (data: GlobalData) => void;
    getConfig: () => RedoclyConfig;
    parseMarkdoc: (opt: ParseMarkdocOpts) => Promise<{
        ast: Node;
        info: Record<string, unknown>;
        compoundHash: string;
    }>;
    setSearchFacets: (facets: Map<string, SearchFacet>) => void;
    getSearchFacets: () => Map<string, SearchFacet>;
    addRoute: (route: PageRouteInit) => void;
    addApiRoute: (route: ApiRoute) => void;
    addMcpTools: (importPath: string, tools: McpToolSchema[]) => void;
    getMcpTools: () => McpToolRegistration[];
    createRequestHandler: (id: string, importPath: string) => void;
    clearRequestHandlersByPrefix: (prefix: string) => void;
    addRedirect: (from: string, to: RedirectConfig, options?: RedirectOptions) => void;
    createTemplate: (id: string, importPath: string) => string;
    addBrowserPlugin: (importPath: string) => void;
    registerServerPropsGetter: (id: string, importPath: string) => string;
    registerPagePropsGetter: (id: string, importPath: string) => void;
    addSsrComponents: (components: JSX.Element[] | string[], position: 'head' | 'preBody' | 'postBody') => void;
    getKv: () => Promise<KvService>;
    serverOutDir: string;
    contentDir: string;
    outdir: string;
};
export type AfterRoutesCreatedActions = {
    createSharedData(id: string, data: unknown, hash?: string): Promise<string>;
    addRouteSharedData(routeSlug: string, dataKey: string, dataId: string): void;
    getRouteByFsPath: (relativePath: string) => PageRouteDetails<PageStaticData, PageProps> | undefined;
    getRouteBySlug: (relativePath: string, opts?: {
        followRedirect: boolean;
    }) => PageRouteDetails<PageStaticData, PageProps> | undefined;
    getConfig: () => RedoclyConfig;
    getGlobalConfig<T = unknown>(key: string): T | undefined;
    getAllRoutes: () => PageRouteDetails<PageStaticData, PageProps>[];
    getAllRoutesForLocale: (locale?: string) => PageRouteDetails<PageStaticData, PageProps>[];
    getAllApiRoutes: () => ApiRoute[];
    setGlobalData: (data: GlobalData) => void;
    getGlobalData: () => GlobalData;
    setGlobalConfig: (data: Record<string, unknown>) => void;
    parseMarkdoc: (opts: ParseMarkdocOpts) => Promise<{
        ast: Node;
        info: Record<string, unknown>;
        compoundHash: string;
    }>;
    setSearchFacets: (facets: Map<string, SearchFacet>) => void;
    getSearchFacets: () => Map<string, SearchFacet>;
    setSearchEngine: (engine: SearchEngine) => void;
    addRedirect: (from: string, to: RedirectConfig, options?: RedirectOptions) => void;
    contentDir: string;
    outdir: string;
    serverOutDir: string;
    hasSitemap: boolean;
    addBrowserPlugin: (importPath: string) => void;
    addSsrComponents: (components: JSX.Element[] | string[], position: 'head' | 'preBody' | 'postBody') => void;
    addApiRoute: (route: ApiRoute) => void;
    loadOpenApiDefinitions(context: LifecycleContext): Promise<BundledDefinition[]>;
    getRouteSharedDataByFsPath: (routeFsPath: string) => Record<string, string> | undefined;
    getKv: () => Promise<KvService>;
    setResourceResponseHeaders: (resourcePath: string, headers: NonNullable<RedoclyConfig['responseHeaders']>[string]) => void;
    markdocOptions: MarkdocOptions;
};
export type LifecycleContext = {
    fs: ContentFs;
    cache: Cache;
    getConfig: (dirPath?: string) => Promise<RedoclyConfig & {
        configPath?: string;
        realConfigPath?: string;
    }>;
    isPathIgnored: (relativePath: string) => Promise<boolean>;
    withPathPrefix: (url: string) => string;
    logger: Logger;
};
export type AfterRoutesCreatedLifecycleContext = LifecycleContext & {
    slugify: (relativePath: string) => string;
};
export type MarkdownParseInput = {
    relativePath: string;
    isVirtual?: boolean;
    content?: string;
};
type ProcessContentFn = (actions: ProcessContentActions, context: LifecycleContext) => Promise<void> | void;
type AfterRoutesCreatedFn = (actions: AfterRoutesCreatedActions, context: AfterRoutesCreatedLifecycleContext) => Promise<void> | void;
export type ExternalPlugin = {
    id: string;
    processContent?: ProcessContentFn;
    afterRoutesCreated?: AfterRoutesCreatedFn;
    loaders?: Record<string, LoaderFn>;
    requiredEntitlements?: Feature[];
    ssoConfigSchema?: JSONSchemaType<any>;
    redoclyConfigSchema?: JSONSchemaType<any>;
    ejectIgnore?: string[];
};
export type DeprecatedCliPlugin = {
    default: {
        id: string;
    };
};
export type ImportedPlugin = {
    default?: ExternalPluginCreator | {
        default?: ExternalPluginCreator;
    };
} | DeprecatedCliPlugin;
export type ExternalPluginCreator = (options: PluginOptions) => ExternalPlugin | Promise<ExternalPlugin>;
export type LifecyclePluginInstance = {
    id: string;
    processContent?: ProcessContentFn;
    afterRoutesCreated?: AfterRoutesCreatedFn;
    loaders?: Record<string, LoaderFn>;
    requiredEntitlements?: Feature[];
};
export type DynamicLifecyclePluginCreator = {
    importPath: string;
    loadCondition: () => boolean;
};
export type LifecyclePluginCreator = (options: PluginOptions) => Promise<LifecyclePluginInstance> | LifecyclePluginInstance;
export type LifecyclePlugin = DynamicLifecyclePluginCreator | LifecyclePluginCreator;
export type PluginDefaultOptions = {
    contentDir: string;
};
export type PluginOptions = PluginDefaultOptions & {
    [k: string]: unknown;
};
export type CookieOptions = {
    domain?: string;
    expires?: Date;
    httpOnly?: boolean;
    maxAge?: number;
    path?: string;
    secure?: boolean;
    signed?: boolean;
    sameSite?: 'Strict' | 'Lax' | 'None';
};
export type FrontmatterKeywords = {
    includes?: string[];
    excludes?: string[];
};
export {};
//# sourceMappingURL=common.d.ts.map