/** * Shared interface for frontend SDK generators. * * TEACHING NOTE: All SDK generators implement this contract so * generate.ts can call them polymorphically without caring about * the target framework specifics. */ import type { DmmfDocument, DmmfModel, DmmfField } from '../../types/dmmf.js'; export type { DmmfDocument, DmmfModel, DmmfField }; export interface SdkGenerator { /** Human-readable framework name (e.g., "React") */ readonly frameworkName: string; /** Generate the SDK for all models */ generate(dmmf: DmmfDocument, config: SdkConfig, customQueries: CustomQueryDef[], customSchemas: CustomSchemaDef[], log: (msg: string) => void): Promise; } /** Subset of DataBridgeConfig that SDK generators need */ export interface SdkConfig { api: { port: number; outputPath: string; }; } /** Minimal custom query def */ export interface CustomQueryDef { name: string; method: string; path: string; params?: Record; query?: Record; body?: unknown; responseSchema?: string; responseArray?: boolean; description?: string; } /** Minimal custom schema def */ export interface CustomSchemaDef { name: string; description?: string; fields: Array<{ name: string; type: string; required?: boolean; computed?: boolean; }>; } /** * Map Prisma types to TypeScript types. * Shared across all SDK generators. */ export declare function mapPrismaTypeToTs(prismaType: string): string; /** * Generate a TypeScript interface string for a DMMF model. * Used by React, Vue, and Svelte generators that emit raw strings. */ export declare function generateModelInterface(model: DmmfModel): string; /** * Generate query params type string (e.g., `{ page?: number; limit?: number }`) */ export declare function generateQueryParamsType(queryParams: Record): string; /** * Log SDK generation for a model in a consistent way. */ export declare function logSdkModel(log: (msg: string) => void, label: string): void; //# sourceMappingURL=sdk-types.d.ts.map