import type React from 'react'; import type { OpenAPIOperation, OpenAPIParameter, OpenAPIServer, OpenAPITag, Referenced, OpenAPISchema, Server } from '../types'; import type { ProStore } from '../../../services'; import type { OAuth2 } from '../../../services/OAuth2'; import type { ThemeInterface } from '../theme'; import type { ApiInfoModel, GroupModel, OperationModel, Sample } from './models'; export declare type MenuItemGroupType = 'group' | 'tag' | 'section' | 'schema'; export declare type MenuItemType = MenuItemGroupType | 'operation'; /** Generic interface for MenuItems */ export interface IMenuItem { id: string; absoluteIdx?: number; name: string; description?: string; href?: string; depth: number; active: boolean; expanded: boolean; items: IMenuItem[]; parent?: IMenuItem; deprecated?: boolean; type: MenuItemType; isSchema?: boolean; deactivate(): void; activate(): void; collapse(): void; expand(): void; } export declare type TagInfo = OpenAPITag & { operations: ExtendedOpenAPIOperation[]; used?: boolean; schemaRendersInTag?: boolean; isSchema?: boolean; }; export declare type ExtendedOpenAPIOperation = { pointer: string; pathName: string; httpVerb: string; pathParameters: Array>; pathServers: Array | undefined; isWebhook: boolean; defaultSampleName?: string | false; defaultMimeType?: string; } & OpenAPIOperation; export declare type TagsInfoMap = Record; export interface TagGroup { name: string; tags: string[]; } export declare type ContentItemModel = GroupModel | OperationModel; export declare type MergedOpenAPISchema = OpenAPISchema & { 'x-refsStack'?: string[]; 'x-parentRefs'?: string[]; 'x-circular-ref'?: boolean; }; export interface MDXComponentMeta { component: React.ComponentType; propsSelector: (store?: ProStore) => GenericObject; props?: GenericObject; } export interface MarkdownHeading { id: string; name: string; level: number; items?: MarkdownHeading[]; description?: string; } export interface LabelsConfig { enum: string; enumValue: string; enumSingleValue: string; enumArray: string; default: string; deprecated: string; example: string; examples: string; recursive: string; arrayOf: string; webhook: string; const: string; authorizations: string; tryItBody: string; tryItParameters: string; tryItAuth: string; tryItAuthBasicUsername: string; tryItAuthBasicPassword: string; download: string; downloadSpecification: string; request: string; responses: string; callbackResponses: string; callbacks: string; requestSamples: string; responseSamples: string; } export declare type LabelsConfigRaw = Partial; export declare type Unstable_ExternalCodeSample = Sample & { get: (source: ExternalSource) => string; }; export interface ExternalSource { sample: Unstable_ExternalCodeSample; operation: OperationModel; exampleName?: string; pathParams?: any; properties?: any; } export interface SecurityPanelHookProps { operation: OperationModel; server: Server; onChange: (securityDetails: unknown) => void; OAuth2: OAuth2; } export declare type AuthPanelHookProps = SecurityPanelHookProps; export interface HookRawHtml { html: string; } declare type HookResult = JSX.Element | HookRawHtml | null; export declare type HookConfig = (props: T) => HookResult; export interface HooksConfig { AfterApiTitle?: HookConfig<{ info: ApiInfoModel; }>; BeforeOperation?: HookConfig<{ operation: OperationModel; }>; BeforeOperationSummary?: HookConfig<{ operation: OperationModel; }>; AfterOperationSummary?: HookConfig<{ operation: OperationModel; }>; AfterOperation?: HookConfig<{ operation: OperationModel; }>; ReplaceTryItSecurityPanel?: HookConfig; onInit?: (args: { store: ProStore; }) => void; replaceSecurityLink?: (args: { securityRequirementId: string; }) => string; sanitize?: (raw: string) => string; /** @deprecated Use ReplaceTryItSecurityPanel instead */ ReplaceTryItAuthPanel?: HookConfig; } export interface RedocRawOptions { theme?: ThemeInterface; scrollYOffset?: number | string | (() => number); hideHostname?: boolean | string; hideInfoDescription?: boolean | string; expandResponses?: string | 'all'; requiredPropsFirst?: boolean | string; sortPropsAlphabetically?: boolean | string; sortEnumValuesAlphabetically?: boolean | string; sortOperationsAlphabetically?: boolean | string; sortTagsAlphabetically?: boolean | string; nativeScrollbars?: boolean | string; pathInMiddlePanel?: boolean | string; untrustedDefinition?: boolean | string; hideLoading?: boolean | string; hideDownloadButton?: boolean | string; downloadDefinitionUrl?: string; disableSearch?: boolean | string; showChangeLayoutButton?: boolean | string; onlyRequiredInSamples?: boolean | string; generatedPayloadSamplesMaxDepth?: number | string; sendXUserAgentInTryIt?: boolean | string; showExtensions?: boolean | string | string[]; preserveOriginalExtensionsName?: boolean; hideSingleRequestSampleTab?: boolean | string; hideRequestPayloadSample?: boolean; menuToggle?: boolean | string; jsonSampleExpandLevel?: number | string | 'all'; hideSchemaTitles?: boolean | string; hideSecuritySection?: boolean; showSecuritySchemeType?: boolean; simpleOneOfTypeLabel?: boolean | string; payloadSampleIdx?: number; expandSingleSchemaField?: boolean | string; schemaExpansionLevel?: number | string | 'all'; samplesTabsMaxCount?: number; unstable_tryItButtonOverride?: { label: string; link: string; }; mockServer?: { url?: string; position?: 'first' | 'last' | 'replace' | 'off'; description?: string; }; allowedMdComponents?: Record; labels?: LabelsConfigRaw; enumSkipQuotes?: boolean | string; expandDefaultServerVariables?: boolean; expandDefaultRequest?: boolean; expandDefaultResponse?: boolean; collapseRequestSamplePanel?: boolean; collapseResponseSamplePanel?: boolean; maxDisplayedEnumValues?: number; ignoreNamedSchemas?: string[] | string; unstable_externalCodeSamples?: Unstable_ExternalCodeSample[]; unstable_ignoreMimeParameters?: boolean; hooks?: HooksConfig; hideSchemaPattern?: boolean; hideOneOfDescription?: boolean; hideFab?: boolean; markdownHeadingsAnchorLevel?: number; schemaDefinitionsTagName?: string; minCharacterLengthToInitSearch?: number; maxResponseHeadersToShowInTryIt?: number; showWebhookVerb?: boolean; showObjectSchemaExamples?: boolean; showAccessMode?: boolean; disableTryItRequestUrlEncoding?: boolean; } export interface SearchDocument { title: string; description: string; id: string; } export interface SearchResult { meta: T; score: number; } export {};