/** * generate-types.ts * * Programmatic type generator for Zveltio collections. * Fetches collection schemas from a running Zveltio engine and generates * TypeScript interface declarations with full type information. * * Usage (programmatic): * import { generateTypes } from '@zveltio/sdk/generate-types'; * const dts = await generateTypes({ url: 'http://localhost:3000', apiKey: 'sk-...' }); * await fs.writeFile('./types/zveltio.d.ts', dts); * * Usage (CLI): * zveltio generate-types --output ./types/zveltio.d.ts * zveltio types --output ./types/zveltio.d.ts */ export interface GenerateTypesOptions { /** Zveltio engine URL (default: http://localhost:3000) */ url?: string; /** API key for authentication */ apiKey?: string; /** Only generate types for this collection */ collection?: string; } /** * Generates TypeScript declarations for all (or one) Zveltio collection(s). * * Returns the `.d.ts` file content as a string. The caller is responsible for * writing it to disk. * * The engine endpoint `/api/admin/types` is used when available (returns * pre-generated TS from the server's field-type registry). If the endpoint * fails or is unavailable this function falls back to generating types from * the collection schema returned by `/api/collections`. */ export declare function generateTypes(options?: GenerateTypesOptions): Promise; //# sourceMappingURL=generate-types.d.ts.map