import { type merge } from '@scalar/json-magic/diff';
import type { ComputedRef } from 'vue';
import { type MaybeRefOrGetter } from 'vue';
type UseThreeWayMergeEditorOptions = {
    /** Base document (common ancestor). */
    baseDocument: MaybeRefOrGetter<Record<string, unknown>>;
    /** Document with resolved conflicts (current result). */
    resolvedDocument: MaybeRefOrGetter<Record<string, unknown>>;
    /** Merge conflicts from diff. */
    conflicts: MaybeRefOrGetter<ReturnType<typeof merge>['conflicts']>;
    /** Called when user applies resolved changes. */
    onApplyChanges: (resolvedDocument: Record<string, unknown>) => void;
    /** Optional: called with error message for conflicts left or parse errors. */
    onError?: (message: string) => void;
};
type ThreeWayMergeEditorContainers = {
    /** Container for the local (current) diff editor. */
    local: HTMLElement;
    /** Container for the remote diff editor. */
    remote: HTMLElement;
    /** Container for the result (editable) diff editor. */
    result: HTMLElement;
};
/**
 * Shared state and logic for a 3-way merge editor (base | local | remote → result).
 * Create editors by calling init() with the three container elements (e.g. from refs in onMounted).
 * Call dispose() in onUnmounted.
 *
 * @example
 * ```vue
 * <script setup lang="ts">
 * const localRef = ref<HTMLDivElement>()
 * const remoteRef = ref<HTMLDivElement>()
 * const resultRef = ref<HTMLDivElement>()
 *
 * const mergeEditor = useThreeWayMergeEditor({
 *   baseDocument,
 *   resolvedDocument,
 *   conflicts,
 *   onApplyChanges: (doc) => emit('applyChanges', { resolvedDocument: doc }),
 *   onError: (msg) => toast(msg, 'error'),
 * })
 *
 * onMounted(() => {
 *   const local = localRef.value
 *   const remote = remoteRef.value
 *   const result = resultRef.value
 *   if (local && remote && result) {
 *     mergeEditor.init({ local, remote, result })
 *   }
 * })
 *
 * onUnmounted(() => {
 *   mergeEditor.dispose()
 * })
 * </script>
 *
 * <template>
 *   <div ref="localRef" />
 *   <div ref="remoteRef" />
 *   <div ref="resultRef" />
 *   <button @click="mergeEditor.goToNextConflict">Next conflict</button>
 *   <button :disabled="mergeEditor.conflictsLeft > 0" @click="mergeEditor.applyResolvedConflicts">
 *     Apply ({{ mergeEditor.conflictsLeft }} left)
 *   </button>
 * </template>
 * ```
 */
export declare function useThreeWayMergeEditor(options: UseThreeWayMergeEditorOptions): {
    init: (containers: ThreeWayMergeEditorContainers) => void;
    dispose: () => void;
    conflictsLeft: ComputedRef<number>;
    goToNextConflict: () => void;
    applyResolvedConflicts: () => void;
};
export {};
//# sourceMappingURL=use-three-way-merge-editor.d.ts.map