import { PgTableWithColumns } from 'drizzle-orm/pg-core';
import { BaseRepository } from './base-repository.js';
import { DrizzleTx } from '../types/drizzle.js';
import 'drizzle-orm';
import 'drizzle-orm/node-postgres';

declare abstract class MetadataEntityRepository<TEntity> extends BaseRepository<TEntity> {
    /**
     * Bulk upsert with a caller-specified conflict target.
     * Uses Drizzle's onConflictDoUpdate to merge records.
     */
    upsertMany(inputs: Array<Partial<TEntity>>, tx?: DrizzleTx, options?: {
        conflictTarget?: keyof PgTableWithColumns<any>['_']['columns'];
    }): Promise<TEntity[]>;
    /**
     * Find metadata by entity ID and entity type (compound lookup).
     */
    findByEntityIdAndType(entityId: string, entityType: string): Promise<TEntity[]>;
    /**
     * List all metadata records for an entity.
     */
    listByEntityId(entityId: string): Promise<TEntity[]>;
    /**
     * List metadata history for an entity, ordered by validFrom descending.
     */
    listHistoryByEntityId(entityId: string): Promise<TEntity[]>;
}

export { MetadataEntityRepository };
