import { ServiceOptions } from "../config.mjs"; import { OpenAPITSOptions } from "openapi-typescript"; //#region src/openapi/generate.d.ts interface DTSFragmentOutput { /** The `apiful/schema` module, importing from every fragment and exporting the type helpers. */ entry: string; /** One `apiful/schema/` module per service, keyed by service name. */ fragments: Record; } interface GenerateOptions { openAPITSOptions?: OpenAPITSOptions; /** Directory a relative schema path resolves against. Defaults to the current working directory. */ rootDir?: string; } declare class SchemaGenerationError extends Error {} declare function generateDTS(services: Record, options?: GenerateOptions): Promise; /** Joins the entry and the per-service fragments into the single file `generateDTS` returns. */ declare function joinDTSFragments({ entry, fragments }: DTSFragmentOutput): string; declare function generateDTSFragments(services: Record, options?: GenerateOptions): Promise; /** * Emits the type helpers for one service. The emitted code references `Paths` and * `Components` along with `OpenAPIEndpoint` and `OpenAPIPathMethods`, none of which it * imports – the module declaration it is placed in brings them into scope. */ declare function generateTypeHelpers(id: string): string; /** Runs `openapi-typescript` for one service and returns its types, without a module declaration around them. */ declare function generateSchemaTypes(options: { id: string; service: ServiceOptions; } & GenerateOptions): Promise; //#endregion export { DTSFragmentOutput, GenerateOptions, SchemaGenerationError, generateDTS, generateDTSFragments, generateSchemaTypes, generateTypeHelpers, joinDTSFragments };