vitepress-openapi
Version:
Generate VitePress API Documentation from OpenAPI Specification.
46 lines (45 loc) • 1.52 kB
TypeScript
import type { OpenAPIV3 } from '@scalar/openapi-types';
export interface SecuritySchemeDefaultValues {
'http-basic': string;
'http-bearer': string;
'apiKey': string | null;
'openIdConnect': string;
'oauth2': string;
}
export interface PlaygroundResponse {
body: any;
type: string;
time: string | null;
status: number | null;
headers?: Record<string, string>;
}
export interface SubmitOptions {
request: any;
method: string;
baseUrl: string;
path: string;
operationId: string;
}
export declare function usePlayground(): {
loading: import("vue").Ref<boolean, boolean>;
response: import("vue").Ref<{
body: any;
type: string;
time: string | null;
status: number | null;
headers?: Record<string, string> | undefined;
} | null, PlaygroundResponse | {
body: any;
type: string;
time: string | null;
status: number | null;
headers?: Record<string, string> | undefined;
} | null>;
imageUrls: import("vue").Ref<string[], string[]>;
setSecuritySchemeDefaultValues: (values: Partial<SecuritySchemeDefaultValues>) => void;
getSecuritySchemeDefaultValue: (scheme: OpenAPIV3.SecuritySchemeObject) => string;
submitRequest: ({ request, method, baseUrl, path, operationId }: SubmitOptions) => Promise<PlaygroundResponse | null>;
cleanupImageUrls: () => void;
setParameterValue: (parameterName: string, value: any) => void;
hasOperationData: boolean;
};