import type { GenericMessage, MessagesSyncDiffEntry } from '@enbox/dwn-sdk-js';
import type { PushResult } from './types/sync.js';
export type ReconcileDirection = 'pull' | 'push';
export type ReconcileTarget = {
    did: string;
    dwnUrl: string;
    delegateDid?: string;
    protocol?: string;
    permissionGrantIds?: string[];
};
export type ReconcileOutcome = {
    aborted?: boolean;
    changed: boolean;
    didPull: boolean;
    didPush: boolean;
    localRoot?: string;
    remoteRoot?: string;
    postLocalRoot?: string;
    postRemoteRoot?: string;
    converged?: boolean;
    pushResult?: PushResult;
};
type ReconcileDeps = {
    getLocalRoot: (did: string, delegateDid?: string, protocol?: string, permissionGrantIds?: string[]) => Promise<string>;
    getRemoteRoot: (did: string, dwnUrl: string, delegateDid?: string, protocol?: string, permissionGrantIds?: string[]) => Promise<string>;
    diffWithRemote: (target: ReconcileTarget) => Promise<{
        onlyRemote: MessagesSyncDiffEntry[];
        onlyLocal: string[];
    }>;
    pullMessages: (params: {
        did: string;
        dwnUrl: string;
        delegateDid?: string;
        protocol?: string;
        permissionGrantIds?: string[];
        messageCids: string[];
        prefetched: (MessagesSyncDiffEntry & {
            message: GenericMessage;
        })[];
        shouldContinue?: () => boolean;
    }) => Promise<void>;
    pushMessages: (params: {
        did: string;
        dwnUrl: string;
        delegateDid?: string;
        protocol?: string;
        permissionGrantIds?: string[];
        messageCids: string[];
    }) => Promise<PushResult>;
    shouldContinue?: () => boolean;
};
export declare function partitionRemoteEntries(entries: MessagesSyncDiffEntry[]): {
    prefetched: (MessagesSyncDiffEntry & {
        message: GenericMessage;
    })[];
    needsFetchCids: string[];
};
export declare class SyncLinkReconciler {
    private readonly _deps;
    constructor(deps: ReconcileDeps);
    reconcile(target: ReconcileTarget, options?: {
        direction?: ReconcileDirection;
        verifyConvergence?: boolean;
    }): Promise<ReconcileOutcome>;
}
export {};
//# sourceMappingURL=sync-link-reconciler.d.ts.map