import { ConflictResolution } from "../validation/dolt-schemas.js";
import { AgentsManageDatabaseClient } from "../db/manage/manage-client.js";

//#region src/dolt/merge.d.ts
declare class MergeConflictError extends Error {
  readonly conflictCount: number;
  readonly fromBranch: string;
  readonly toBranch: string;
  constructor(message: string, conflictCount: number, fromBranch: string, toBranch: string);
}
/**
 * Merge a branch into the currently checked out branch.
 *
 * Runs inside an explicit transaction so that conflicts and
 * constraint-violations are surfaced to the caller instead of being
 * auto-rolled-back by Dolt's AUTOCOMMIT mode.
 *
 * If conflicts arise and `resolutions` are provided, they are applied
 * and the merge is committed. If conflicts arise without resolutions
 * (or with insufficient resolutions), the transaction is rolled back
 * and a `MergeConflictError` is thrown.
 */
declare const doltMerge: (db: AgentsManageDatabaseClient) => (params: {
  fromBranch: string;
  toBranch: string;
  message?: string;
  noFastForward?: boolean;
  author?: {
    name: string;
    email: string;
  };
  resolutions?: ConflictResolution[];
}) => Promise<{
  status: "success";
  from: string;
  to: string;
  toHead?: string;
  hasConflicts: boolean;
}>;
/**
 * Abort a merge
 */
declare const doltAbortMerge: (db: AgentsManageDatabaseClient) => () => Promise<void>;
/**
 * Get merge status
 */
declare const doltMergeStatus: (db: AgentsManageDatabaseClient) => () => Promise<{
  isMerging: boolean;
  source?: string;
  target?: string;
  unmergedTables?: string[];
}>;
/**
 * Get list of tables with conflicts
 */
declare const doltConflicts: (db: AgentsManageDatabaseClient) => () => Promise<{
  table: string;
  numConflicts: number;
}[]>;
/**
 * Get detailed conflicts for a specific table
 */
declare const doltTableConflicts: (db: AgentsManageDatabaseClient) => (params: {
  tableName: string;
}) => Promise<any[]>;
/**
 * Get schema conflicts
 */
declare const doltSchemaConflicts: (db: AgentsManageDatabaseClient) => () => Promise<any[]>;
/**
 * Preview merge conflicts without modifying the database (dry-run).
 * Returns a summary of which tables have conflicts.
 */
declare const doltPreviewMergeConflictsSummary: (db: AgentsManageDatabaseClient) => (params: {
  baseBranch: string;
  mergeBranch: string;
}) => Promise<{
  table: string;
  numDataConflicts: number;
  numSchemaConflicts: number;
}[]>;
/**
 * Preview detailed merge conflicts for a specific table without modifying the database (dry-run).
 * Returns the same column shape as dolt_conflicts_$table.
 */
declare const doltPreviewMergeConflicts: (db: AgentsManageDatabaseClient) => (params: {
  baseBranch: string;
  mergeBranch: string;
  tableName: string;
}) => Promise<Record<string, unknown>[]>;
/**
 * Resolve conflicts for a table using a strategy
 */
declare const doltResolveConflicts: (db: AgentsManageDatabaseClient) => (params: {
  tableName: string;
  strategy: "ours" | "theirs";
}) => Promise<void>;
//#endregion
export { MergeConflictError, doltAbortMerge, doltConflicts, doltMerge, doltMergeStatus, doltPreviewMergeConflicts, doltPreviewMergeConflictsSummary, doltResolveConflicts, doltSchemaConflicts, doltTableConflicts };