/**
 * Pre-realize spec normalization — attribute/relationship name collisions.
 *
 * Why this lives in realize (not inference)
 * ----------------------------------------
 *
 * The analyse pipeline can produce specs where a model declares an
 * attribute and a relationship sharing the same name (e.g. SaveGame
 * has both `attributes.gameState: Json` and `relationships.gameState:
 * belongsTo GameState`). That's an ambiguity the AST happily carries
 * — `attributes.gameState` and `relationships.gameState` are two
 * distinct slots in the schema — but every downstream code emitter
 * needs to project them onto a single namespace (one Prisma column
 * + one Prisma relation field; one TypeScript class member +
 * one ORM relation accessor) and the projection collides.
 *
 * Pre-engines 6.38.4 this was guarded inside `prisma/schema-generator.ts`
 * which threw on the first collision and aborted the model loop — one
 * bad model in a 24-model spec left zero schema on disk. 6.38.4 moved
 * the guard to a non-throwing auto-rename: keep the relationship's
 * canonical name and rename the colliding attribute to `<name>Data`.
 * But the rename lived inside the prisma generator, which meant:
 *   - Mongo / pg / non-Prisma specs never got the rename. Mongo
 *     tolerates parallel fields more leniently than Prisma, but the
 *     ambiguity still propagates to controllers / services /
 *     validators that read `model.attributes` and would still
 *     mention the colliding name twice.
 *   - Service / controller / route generators that read
 *     `model.attributes` saw the rename ONLY when the ORM step ran
 *     first AND mutated the shared `allModels` reference. Skip the
 *     ORM (e.g. mongo manifests) → drift.
 *
 * This module lifts the rename to a single pre-emission pass that
 * runs regardless of which ORM (if any) is in the manifest. The
 * `realizeAll` entrypoint calls `normalizeAttributeRelationshipCollisions`
 * once at the top, mutating `spec.models` in place. All subsequent
 * generators (prisma, mongo, pg, controllers, services, routes,
 * views) see the canonical renamed shape.
 *
 * Backward compatibility
 * ---------------------
 *
 * - `prisma/schema-generator.ts` still calls
 *   `resolveAttributeRelationshipCollisions(model)` defensively,
 *   but the first pass at realize-top has already mutated the
 *   model, so the second pass is a no-op (no collisions remain).
 *   We keep the call there to protect direct invocations of the
 *   schema generator that bypass realize (e.g. test fixtures).
 */
export interface RenameRecord {
    modelName: string;
    fromAttributeName: string;
    toAttributeName: string;
    relationshipType: string;
    relationshipTarget: string;
}
/**
 * Walk every model in the spec and resolve attribute/relationship
 * name collisions. Returns the list of renames performed so callers
 * (realize/index.ts) can surface them in a single tidy log line
 * instead of one console.warn per model.
 *
 * Mutates spec.models in place — downstream generators read the
 * renamed shape. Idempotent: a second pass produces zero renames.
 */
export declare function normalizeAttributeRelationshipCollisions(spec: any): RenameRecord[];
/** A redundant scalar FK attribute dropped because a belongsTo relationship
 *  already generates that foreign key. */
export interface ForeignKeyDropRecord {
    modelName: string;
    droppedAttribute: string;
    relationshipName: string;
    relationshipTarget: string;
    foreignKeyField: string;
}
/**
 * #94 (defect 2) — drop redundant scalar foreign-key attributes.
 *
 * When `analyse` reverse-engineers an adapter-less app it can extract a raw FK
 * column (`house_id`) as a model *attribute* AND infer the `belongsTo House`
 * relationship from it. Realize then emits TWO FK fields — the scalar
 * `house_id` (from the attribute) and `houseId` (from the relationship's
 * `@relation(fields: [houseId])`) — and the generated controller becomes
 * internally inconsistent (`validate()` requires `house_id` while the FK-connect
 * uses `houseId`), so Room/Booking creation fails at runtime.
 *
 * A `belongsTo`/`hasOne` relationship `relName: belongsTo Target` generates the
 * FK field `rel.foreignKey || (rel.name || target.toLowerCase()) + 'Id'` (see
 * `orms/templates/prisma/schema-generator.ts`). Any scalar attribute whose
 * name normalises to that FK (`house_id`, `houseId`, `houseID`) is therefore
 * redundant — the relationship is the canonical source of the FK — so we drop
 * the attribute. The primary `id` is never dropped. Idempotent.
 *
 * Mutates `model.attributes` in place; returns the drops for logging/tests.
 */
export declare function dropRedundantForeignKeyAttributes(model: any): ForeignKeyDropRecord[];
/**
 * Resolve collisions for a single model. Exported so prisma's
 * schema-generator can keep its defensive call site for direct
 * invocations (the call becomes a no-op when realize has already
 * normalized; non-zero only when the generator is invoked outside
 * the realize pipeline).
 */
export declare function resolveOneModel(model: any): RenameRecord[];
//# sourceMappingURL=normalize-collisions.d.ts.map