vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
36 lines (35 loc) • 1.45 kB
TypeScript
import type { OpenAPIV3 } from '@scalar/openapi-types';
import type { OpenAPIDocument, ParsedOpenAPI, ParsedPaths } from '../../types';
export interface OpenApiSpecInstance {
spec: OpenAPIDocument;
originalSpec: OpenAPIDocument | null;
getSpec: () => OpenAPIDocument;
setSpec: (spec: OpenAPIDocument) => void;
getOriginalSpec: () => OpenAPIDocument | null;
setOriginalSpec: (spec: OpenAPIDocument | null) => void;
getOperation: (operationId: string) => any | null;
getOperationPath: (operationId: string) => string | null;
getOperationMethod: (operationId: string) => string | null;
getOperationParameters: (operationId: string) => any[];
getPaths: () => ParsedPaths;
getPathsByVerbs: () => any[];
getInfo: () => any;
getExternalDocs: () => any;
getServers: () => any[];
getOperationServers: (operationId: string) => OpenAPIV3.ServerObject[];
getOperationsTags: () => string[];
getPathsByTags: (tags: string | string[]) => OpenAPIV3.PathsObject;
getPathsWithoutTags: () => OpenAPIV3.PathsObject;
getTags: () => {
name: string | null;
description: string | null;
}[];
getFilteredTags: () => {
name: string | null;
description: string | null;
}[];
}
export declare function createOpenApiSpec(options?: {
spec?: ParsedOpenAPI | OpenAPIDocument | null;
originalSpec?: OpenAPIDocument | null;
}): OpenApiSpecInstance;