import type { ReactElement, ComponentType } from 'react'; import type { FromSchema } from 'json-schema-to-ts'; import type { Schema, ConfigFunction } from '@markdoc/markdoc/dist/src/types'; import type { redocConfigSchema } from '../redoc-config-schema'; export type RedocConfigTypes = FromSchema & { markdocOptions?: { tags: Record; nodes: Record; components: Record; variables?: Record; partials?: Record; functions?: Record; }; onDeepLinkClick?: ((link: string) => void) | undefined | null; unstable_hooks?: HooksConfig; requestInterceptor?: ((req: Request, operation: OperationModel) => void) | undefined | null; unstable_externalCodeSamples?: Unstable_ExternalCodeSample[]; unstable_skipSamples?: boolean; scrollYOffset?: number | string | (() => number); }; type HooksConfig = { AfterApiTitle?: HookConfig<{ info: OpenAPIInfo; }>; BeforeOperation?: HookConfig<{ operation: OperationModel; }>; BeforeOperationSummary?: HookConfig<{ operation: OperationModel; }>; AfterOperationSummary?: HookConfig<{ operation: OperationModel; }>; AfterOperation?: HookConfig<{ operation: OperationModel; }>; onInit?: (args: { store: Record; }) => void; replaceSecurityLink?: (args: { securityRequirementId: string; }) => string; sanitize?: (raw: string) => string; MiddlePanelFooter?: HookConfig; MiddlePanelHeader?: HookConfig; }; type OpenAPIInfo = { title: string; version: string; description?: string; summary?: string; termsOfService?: string; contact?: Record; license?: Record; 'x-logo'?: Record; 'x-metadata'?: Record; 'x-seo'?: Record; }; type HookResult = ReactElement | { html: string; } | null; type HookConfig = (props: T) => HookResult; type Unstable_ExternalCodeSample = { get: (source: ExternalSource) => string; lang: string; label?: string; }; type ExternalSource = { sample: Unstable_ExternalCodeSample; operation: OperationModel; exampleName?: string; pathParams?: any; properties?: any; }; type OperationModel = { id: string; name: string; description?: string | Record; href: string; pointer: string; httpVerb: string; deprecated: boolean; path: string; }; export {};