UNPKG

vitepress-openapi

Version:

Generate VitePress API Documentation from OpenAPI Specification.

79 lines (78 loc) 3.93 kB
import type { OpenAPIDocument } from '../types'; import type { PartialUseThemeConfig } from './useTheme'; export declare const OPENAPI_LOCAL_KEY: unique symbol; export declare function useOpenapi({ spec, config, }?: { spec?: OpenAPIDocument; config?: PartialUseThemeConfig; }): { async: ({ spec, }?: { spec?: OpenAPIDocument; }) => Promise<{ spec: OpenAPIDocument; setSpec: (spec: any) => void; getSpec: () => OpenAPIDocument; getOperation: (operationId: string) => any; getOperationPath: (operationId: string) => string | null; getOperationMethod: (operationId: string) => string | null; getOperationParameters: (operationId: string) => any; getPaths: () => import("@scalar/openapi-types").OpenAPIV3.PathsObject; getPathsByVerbs: () => ({ path: string; verb: string; operationId: any; summary: any; tags: any; } | null)[]; getInfo: () => import("@scalar/openapi-types").OpenAPIV3.InfoObject & Omit<import("@scalar/openapi-types").OpenAPIV3.InfoObject, "license" | "summary"> & { summary?: string; license?: import("@scalar/openapi-types").OpenAPIV3_1.LicenseObject; }; getExternalDocs: () => import("@scalar/openapi-types").OpenAPIV3.ExternalDocumentationObject; getServers: () => import("@scalar/openapi-types").OpenAPIV3.ServerObject[] & import("@scalar/openapi-types").OpenAPIV3_1.ServerObject[]; getOperationServers: (operationId: string) => any[]; getOperationsTags: () => string[]; getPathsByTags: (tags: string | string[]) => import("@scalar/openapi-types").OpenAPIV3.PathsObject<{}, {}>; getPathsWithoutTags: () => import("@scalar/openapi-types").OpenAPIV3.PathsObject<{}, {}>; getTags: () => { name: string | null; description: string | null; }[]; getFilteredTags: () => { name: string | null; description: string | null; }[]; } | null>; spec?: OpenAPIDocument | undefined; setSpec?: ((spec: any) => void) | undefined; getSpec?: (() => OpenAPIDocument) | undefined; getOperation?: ((operationId: string) => any) | undefined; getOperationPath?: ((operationId: string) => string | null) | undefined; getOperationMethod?: ((operationId: string) => string | null) | undefined; getOperationParameters?: ((operationId: string) => any) | undefined; getPaths?: (() => import("@scalar/openapi-types").OpenAPIV3.PathsObject) | undefined; getPathsByVerbs?: (() => ({ path: string; verb: string; operationId: any; summary: any; tags: any; } | null)[]) | undefined; getInfo?: (() => import("@scalar/openapi-types").OpenAPIV3.InfoObject & Omit<import("@scalar/openapi-types").OpenAPIV3.InfoObject, "license" | "summary"> & { summary?: string; license?: import("@scalar/openapi-types").OpenAPIV3_1.LicenseObject; }) | undefined; getExternalDocs?: (() => import("@scalar/openapi-types").OpenAPIV3.ExternalDocumentationObject) | undefined; getServers?: (() => import("@scalar/openapi-types").OpenAPIV3.ServerObject[] & import("@scalar/openapi-types").OpenAPIV3_1.ServerObject[]) | undefined; getOperationServers?: ((operationId: string) => any[]) | undefined; getOperationsTags?: (() => string[]) | undefined; getPathsByTags?: ((tags: string | string[]) => import("@scalar/openapi-types").OpenAPIV3.PathsObject<{}, {}>) | undefined; getPathsWithoutTags?: (() => import("@scalar/openapi-types").OpenAPIV3.PathsObject<{}, {}>) | undefined; getTags?: (() => { name: string | null; description: string | null; }[]) | undefined; getFilteredTags?: (() => { name: string | null; description: string | null; }[]) | undefined; };