UNPKG

@alexop/openapi-zod-client

Version:

[![Screenshot 2022-11-12 at 18 52 25](https://user-images.githubusercontent.com/47224540/201487856-ffc4c862-6f31-4de1-8ef1-3981fabf3416.png)](https://openapi-zod-client.vercel.app/)

21 lines (20 loc) 1.27 kB
import type { OpenAPIObject } from "openapi3-ts"; import type { Options } from "prettier"; import { getHandlebars } from "./getHandlebars.js"; import type { TemplateContext } from "./template-context.js"; type GenerateZodClientFromOpenApiArgs<TOptions extends TemplateContext["options"] = TemplateContext["options"]> = { openApiDoc: OpenAPIObject; templatePath?: string; prettierConfig?: Options | null; options?: TOptions; handlebars?: ReturnType<typeof getHandlebars>; } & ({ distPath?: never; /** when true, will only return the result rather than writing it to a file, mostly used for easier testing purpose */ disableWriteToFile: true; } | { distPath: string; disableWriteToFile?: false; }); export declare const generateZodClientFromOpenAPI: <TOptions extends import("./template-context.js").TemplateContextOptions | undefined>({ openApiDoc, distPath, templatePath, prettierConfig, options, disableWriteToFile, handlebars, }: GenerateZodClientFromOpenApiArgs<TOptions>) => Promise<TOptions extends import("./template-context.js").TemplateContextOptions ? undefined extends TOptions["groupStrategy"] ? string : TOptions["groupStrategy"] extends "none" | "tag" | "method" ? string : Record<string, string> : string>; export {};