UNPKG

fumadocs-openapi

Version:

Generate MDX docs for your OpenAPI spec

44 lines (43 loc) 2.05 kB
import { NoReference } from "./utils/schema.js"; import { MediaAdapter } from "./requests/media/adapter.js"; import { CodeUsageGenerator } from "./ui/operation/usage-tabs/index.js"; import { OpenAPIOptions } from "./server/create.js"; import { CreateAPIPageOptions } from "./ui/api-page.js"; import "./server/index.js"; import { ProcessedDocument } from "./utils/process-document.js"; import Slugger from "github-slugger"; import { HTMLAttributes, ReactNode } from "react"; import { OpenAPIV3_1 } from "openapi-types"; //#region src/types.d.ts type Document = OpenAPIV3_1.Document; type OperationObject = OpenAPIV3_1.OperationObject; type ParameterObject = OpenAPIV3_1.ParameterObject; type SecuritySchemeObject = OpenAPIV3_1.SecuritySchemeObject; type ReferenceObject = OpenAPIV3_1.ReferenceObject; type PathItemObject = OpenAPIV3_1.PathItemObject; type TagObject = OpenAPIV3_1.TagObject; type ServerObject = OpenAPIV3_1.ServerObject; type CallbackObject = OpenAPIV3_1.CallbackObject; type ServerVariableObject = OpenAPIV3_1.ServerVariableObject; type ResponseObject = OpenAPIV3_1.ResponseObject; type MethodInformation = NoReference<OperationObject> & { method: string; 'x-codeSamples'?: Omit<CodeUsageGenerator, 'id'>[]; 'x-selectedCodeSample'?: string; 'x-exclusiveCodeSample'?: string; }; interface RenderContext extends Pick<OpenAPIOptions, 'proxyUrl'>, CreateAPIPageOptions { servers: NoReference<ServerObject>[]; slugger: Slugger; /** * dereferenced schema */ schema: ProcessedDocument; mediaAdapters: Record<string, MediaAdapter>; renderHeading: (depth: number, text: string, props?: HTMLAttributes<HTMLHeadingElement>) => ReactNode; renderMarkdown: (text: string) => ReactNode; renderCodeBlock: (lang: string, code: string) => ReactNode; } //#endregion export { CallbackObject, Document, MethodInformation, OperationObject, ParameterObject, PathItemObject, ReferenceObject, RenderContext, ResponseObject, SecuritySchemeObject, ServerObject, ServerVariableObject, TagObject }; //# sourceMappingURL=types.d.ts.map