import type { Relationship, TableSchema } from '../table-schema.ts'; import type { TableBuilderWithColumns } from './table-builder.ts'; type ConnectArg = { readonly sourceField: TSourceField; readonly destField: TDestField; readonly destSchema: TableBuilderWithColumns; }; type ManyConnection = { readonly sourceField: TSourceField; readonly destField: TDestField; readonly destSchema: TDest['name']; readonly cardinality: 'many'; }; type OneConnection = { readonly sourceField: TSourceField; readonly destField: TDestField; readonly destSchema: TDest['name']; readonly cardinality: 'one'; }; type Prev = [-1, 0, 1, 2, 3, 4, 5, 6]; export type PreviousSchema = K extends 0 ? TSource : TDests[Prev[K]]; export type Relationships = { name: string; relationships: Record; }; export declare function relationships>(table: TableBuilderWithColumns, cb: (connects: { many: ['columns'] & string)[]; }, TDestFields extends { [K in keyof TDests]: (keyof TDests[K]['columns'] & string)[]; }>(...args: { [K in keyof TDests]: ConnectArg; }) => { [K in keyof TDests]: ManyConnection; }; one: ['columns'] & string)[]; }, TDestFields extends { [K in keyof TDests]: (keyof TDests[K]['columns'] & string)[]; }>(...args: { [K in keyof TDests]: ConnectArg; }) => { [K in keyof TDests]: OneConnection; }; }) => TRelationships): { name: TSource['name']; relationships: TRelationships; }; export {}; //# sourceMappingURL=relationship-builder.d.ts.map