generateClientTypes
function generateClientTypes(options): Promise<string>;Defined in: client/src/generate/generate.ts:107
Fetch the server manifest and compile it into a TypeScript source string that
exports both the ApiSchema interface (the compile-time contract handed to
createClient) and an apiManifest runtime constant (the metadata and
schemas toTools needs to reconstruct tools). Implementers wire this
into a small script that writes the result to disk.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
options |
GenerateOptions |
Returns
Section titled “Returns”Promise<string>
Example
Section titled “Example”import { writeFile } from 'node:fs/promises';import { generateClientTypes } from '@grundlag/client';
await writeFile('./src/client.generated.ts', await generateClientTypes({ url: 'http://localhost:3800' }));