import type { DMMF } from '@prisma/generator-helper'; import type { GoImports } from './type-map'; /** * Information about a generated Ent edge. */ export interface EdgeDef { /** The full Go code for the edge definition (e.g., `edge.To("posts", Post.Type)`). */ code: string; } /** * Generate the Ent edge definition lines for a given model. * * Analyses all relation (object) fields on the model, determines edge ownership * (edge.To vs edge.From) based on FK presence, and generates the correct Ent * edge builder calls. * * Ownership rules: * - Model with FK fields (relationFromFields non-empty) → edge.From (back-reference) * - Model without FK fields, but inverse has FK → edge.To (owns the relation) * - Neither side has FK (M2M implicit join table) → alphabetical model name tiebreaker * * @returns An array of Go code strings, each representing one edge definition. */ export declare function generateEdges(model: DMMF.Model, allModels: readonly DMMF.Model[], imports: GoImports): string[]; //# sourceMappingURL=edge.d.ts.map