import type { GraphQLQueryFn, GraphQLQueryFnObj } from 'graphile-test'; import type { Table } from '@constructive-io/graphql-query'; export interface CodegenResult { /** Factory function to create an ORM client from a GraphQLAdapter */ createClient: (config: any) => Record; /** Inferred table metadata from introspection */ tables: Table[]; /** Raw codegen output (generated files) */ ormResult: { files: { path: string; content: string; }[]; }; } /** * Run the codegen pipeline against a live graphile-test schema and load the result. * * Each test suite must pass a unique `name` to avoid collisions when Jest * runs suites in parallel — each gets its own `__generated__/` dir. * * Accepts either positional-style `GraphQLQueryFn` or object-style `GraphQLQueryFnObj`. * The generated files are compiled to JavaScript and loaded via require(). * * IMPORTANT: This must be called inside an active transaction (e.g. in beforeEach * after db.beforeEach()), because graphile-test's query wrapper uses savepoints * which require a transaction block. * * @param queryFn - The graphile-test query function (positional or object-style) * @param name - Unique suite name for generated file isolation * @param outputDir - Optional custom output directory (defaults to __generated__/ next to caller) * @returns CodegenResult with createClient factory, tables, and raw ormResult */ export declare function runCodegenAndLoad(queryFn: GraphQLQueryFn | GraphQLQueryFnObj, name: string, outputDir?: string): Promise;