vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
85 lines (84 loc) • 4.82 kB
TypeScript
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 | string;
config?: PartialUseThemeConfig;
}): {
async: ({ spec, }?: {
spec?: OpenAPIDocument | string;
}) => Promise<{
spec: OpenAPIDocument;
originalSpec: OpenAPIDocument | null;
setSpec: (spec: any) => void;
getSpec: () => OpenAPIDocument;
getOriginalSpec: () => OpenAPIDocument | null;
setOriginalSpec: (spec: OpenAPIDocument | null) => void;
getOperation: (operationId: string) => import("@scalar/openapi-types").OpenAPIV3.OperationObject<{}> | null;
getOperationPath: (operationId: string) => string | null;
getOperationMethod: (operationId: string) => import("@scalar/openapi-types").OpenAPIV3.HttpMethods | null;
getOperationParameters: (operationId: string) => (import("@scalar/openapi-types").OpenAPIV3.ReferenceObject | import("@scalar/openapi-types").OpenAPIV3.ParameterObject)[];
getPaths: () => import("../types").ParsedPaths;
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) => import("@scalar/openapi-types").OpenAPIV3.ServerObject[];
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;
originalSpec?: OpenAPIDocument | null | undefined;
setSpec?: ((spec: any) => void) | undefined;
getSpec?: (() => OpenAPIDocument) | undefined;
getOriginalSpec?: (() => OpenAPIDocument | null) | undefined;
setOriginalSpec?: ((spec: OpenAPIDocument | null) => void) | undefined;
getOperation?: ((operationId: string) => import("@scalar/openapi-types").OpenAPIV3.OperationObject<{}> | null) | undefined;
getOperationPath?: ((operationId: string) => string | null) | undefined;
getOperationMethod?: ((operationId: string) => import("@scalar/openapi-types").OpenAPIV3.HttpMethods | null) | undefined;
getOperationParameters?: ((operationId: string) => (import("@scalar/openapi-types").OpenAPIV3.ReferenceObject | import("@scalar/openapi-types").OpenAPIV3.ParameterObject)[]) | undefined;
getPaths?: (() => import("../types").ParsedPaths) | 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) => import("@scalar/openapi-types").OpenAPIV3.ServerObject[]) | 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;
};