@moccona/apicodegen
Version:
`@moccona/apicodegen` is a command-line tool for generating TypeScript code from OpenAPI documentation. It provides a simple and efficient way to automate the process of creating API clients.
30 lines (26 loc) • 773 B
TypeScript
import { ServerOptions, PluginOption } from 'vite';
type FetchDocRequestInit = {
method?: string;
body?: string | FormData;
headers?: Record<string, string>;
};
declare enum Adaptors {
fetch = "fetch",
axios = "axios"
}
type ProviderInitOptions = {
docURL: string;
output: string;
baseURL?: string;
importClientSource?: string;
requestOptions?: FetchDocRequestInit;
verbose?: boolean;
adaptor?: keyof typeof Adaptors;
};
type apiCodeGenPluginOptions = ProviderInitOptions & {
name: string;
proxy?: ServerOptions["proxy"];
};
declare const tsc: () => Promise<void>;
declare function apiCodeGenPlugin(options: apiCodeGenPluginOptions[]): PluginOption;
export { apiCodeGenPlugin, type apiCodeGenPluginOptions, tsc };