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 { 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'; export type ResolveItemsOptions = { groupCustomSidebars?: boolean; locale?: string; ignoredRoutes?: Set; ref?: string; ignoreCustomSidebar?: boolean; navFile: string; excludedFromLinkCheckerPatterns?: { apiFunctions: RegExp[]; catalog: RegExp[]; }; }; export type GetStaticDataContext = { getRouteByFsPath: (relativePath: string) => PageRouteDetails | undefined; getRouteBySlug: (relativePath: string, opts?: { followRedirect: boolean; }) => PageRouteDetails | undefined; getGlobalConfig(key: string): T | undefined; getGlobalData: () => GlobalData; getConfig: () => RedoclyConfig; getAllRoutes: () => PageRouteDetails[]; getAllApiRoutes: () => ApiRoute[]; parseMarkdoc: (opts: Omit) => Promise<{ ast: Node; info: Record; compoundHash: string; }>; getAllRoutesForLocale: (locale?: string) => PageRouteDetails[]; contentDir: string; outdir: string; }; export type GetStaticDataFn = (route: TRoute, context: GetStaticDataContext) => Promise; export type GetServerPropsContext = { getConfig: () => RedoclyConfig; getGlobalConfig(key: string): T | undefined; getGlobalData: () => GlobalData; getRouteSharedDataByFsPath: (routeFsPath: string) => Record | undefined; getPartialsForRoute?: (slug: string) => Record; serverOutDir: string; }; export type GetServerPropsFn = (route: PageRouteDetails, data: TData, mdOptions: MdOptions, actions: GetServerPropsContext) => Promise; export type GetPagePropsFn = (data: TData, request: ServerPropsRequest, context: ServerPropsContext) => Promise; export type RouteDetails = { slug: string; fsPath?: string; [REDOCLY_TEAMS_RBAC]?: RbacScopeItems; [REDOCLY_ROUTE_RBAC]?: { slug?: string; fsPath?: string; }; getStaticData?: GetStaticDataFn; metadata?: Record; getNavText?: () => Promise | string; }; type PageRouteDetailsForward = { slug: string; fsPath: string; baseSlug: string; templateId: string; hasClientRoutes?: boolean; versions?: Version[]; product?: ProductConfig; httpVerb?: string; path?: string; params?: string[]; queries?: Record; excludeFromSearch?: boolean; getStaticData?: GetStaticDataFn, TData>; metadata?: Record; getNavText?: () => Promise | string; getSidebar?(route: PageRouteDetailsForward, item?: NavItem): ResolvedNavItem[]; getSearchDocuments?(route: PageRouteDetailsForward, staticData: TData, actions: AfterRoutesCreatedActions): Promise; getAiDocumentsStore?(route: PageRouteDetailsForward, staticData: TData, context: AfterRoutesCreatedLifecycleContext, actions: AfterRoutesCreatedActions): Promise; serverPropsGetterIds?: string[]; excludeFromSidebar?: boolean; [REDOCLY_TEAMS_RBAC]?: RbacScopeItems; [REDOCLY_ROUTE_RBAC]?: { slug?: string; fsPath?: string; }; }; export type PageRouteDetails = PageRouteDetailsForward; export type PageRouteInit = Omit, '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; }; 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; addRouteSharedData(slug: string, dataKey: string, dataId: string): void; addRouteSharedDataToAllLocales(slug: string, dataKey: string, dataId: string): void; loadOpenApiDefinitions(context: LifecycleContext): Promise; setGlobalConfig: (data: Record) => void; setGlobalData: (data: GlobalData) => void; getConfig: () => RedoclyConfig; parseMarkdoc: (opt: ParseMarkdocOpts) => Promise<{ ast: Node; info: Record; compoundHash: string; }>; setSearchFacets: (facets: Map) => void; getSearchFacets: () => Map; addRoute: (route: PageRouteInit) => void; addApiRoute: (route: ApiRoute) => void; addMcpTools: (importPath: string, tools: McpToolSchema[]) => void; getMcpTools: () => McpToolRegistration[]; createRequestHandler: (id: string, importPath: 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; serverOutDir: string; contentDir: string; outdir: string; }; export type AfterRoutesCreatedActions = { createSharedData(id: string, data: unknown, hash?: string): Promise; addRouteSharedData(routeSlug: string, dataKey: string, dataId: string): void; getRouteByFsPath: (relativePath: string) => PageRouteDetails | undefined; getRouteBySlug: (relativePath: string, opts?: { followRedirect: boolean; }) => PageRouteDetails | undefined; getConfig: () => RedoclyConfig; getGlobalConfig(key: string): T | undefined; getAllRoutes: () => PageRouteDetails[]; getAllRoutesForLocale: (locale?: string) => PageRouteDetails[]; getAllApiRoutes: () => ApiRoute[]; setGlobalData: (data: GlobalData) => void; getGlobalData: () => GlobalData; setGlobalConfig: (data: Record) => void; parseMarkdoc: (opts: ParseMarkdocOpts) => Promise<{ ast: Node; info: Record; compoundHash: string; }>; setSearchFacets: (facets: Map) => void; getSearchFacets: () => Map; 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; getRouteSharedDataByFsPath: (routeFsPath: string) => Record | undefined; getKv: () => Promise; }; export type LifecycleContext = { fs: ContentFs; cache: Cache; getConfig: (dirPath?: string) => Promise; isPathIgnored: (relativePath: string) => Promise; 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; type AfterRoutesCreatedFn = (actions: AfterRoutesCreatedActions, context: AfterRoutesCreatedLifecycleContext) => Promise | void; export type ExternalPlugin = { id: string; processContent?: ProcessContentFn; afterRoutesCreated?: AfterRoutesCreatedFn; loaders?: Record; requiredEntitlements?: Feature[]; ssoConfigSchema?: JSONSchemaType; redoclyConfigSchema?: JSONSchemaType; ejectIgnore?: string[]; }; export type DeprecatedCliPlugin = { default: { id: string; }; }; export type ImportedPlugin = { default?: ExternalPluginCreator | { default?: ExternalPluginCreator; }; } | DeprecatedCliPlugin; export type ExternalPluginCreator = (options: PluginOptions) => ExternalPlugin | Promise; export type LifecyclePluginInstance = { id: string; processContent?: ProcessContentFn; afterRoutesCreated?: AfterRoutesCreatedFn; loaders?: Record; requiredEntitlements?: Feature[]; }; export type DynamicLifecyclePluginCreator = { importPath: string; loadCondition: () => boolean; }; export type LifecyclePluginCreator = (options: PluginOptions) => Promise | 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