/**
 * Module-level helpers for SyncController.
 *
 * Pure utility functions extracted from SyncController to keep the class
 * file within the 500 LOC ceiling.
 *
 * @module domain/services/controllers/syncHelpers
 */
import type SyncTrustGate from '../sync/SyncTrustGate.ts';
import type { SyncPeer, SyncRequestProcessor } from '../../capabilities/SyncCapability.ts';
import type CryptoPort from '../../../ports/CryptoPort.ts';
import type { SyncHost } from './SyncController.ts';
import type SyncSecret from '../sync/SyncSecret.ts';
/**
 * Compares two string→string Maps for value equality without allocating.
 *
 * @param a - First map
 * @param b - Second map
 * @returns True if every key in `a` has the same value in `b`
 */
export declare function mapsEqual(a: Map<string, string>, b: Map<string, string>): boolean;
/**
 * Normalizes a sync endpoint path to ensure it starts with '/'.
 * Returns '/sync' if no path is provided.
 *
 * @param path - The sync path to normalize
 * @returns Normalized path starting with '/'
 */
export declare function normalizeSyncPath(path: string | undefined | null): string;
/**
 * Resolves a sync remote into either a direct peer or an HTTP URL target.
 *
 * @param remote - URL string, URL object, or a peer graph instance
 * @param path - Sync endpoint path
 * @param hasPathOverride - Whether `path` was explicitly provided by the caller
 * @returns An object indicating peer type and resolved URL
 */
export declare function resolveSyncTarget(remote: string | SyncRequestProcessor | SyncPeer, path: string, hasPathOverride: boolean): {
    kind: 'peer';
    peer: SyncRequestProcessor;
} | {
    kind: 'url';
    targetUrl: URL;
};
/**
 * Resolves the effective SyncTrustGate for a sync operation,
 * preferring per-call trust overrides when present.
 *
 * @param host - The SyncHost instance
 * @param defaultGate - The controller's default trust gate
 * @param options - Options object that may contain a `trust` override
 * @returns The resolved trust gate, or null
 */
export declare function resolveSyncTrustGate(host: SyncHost, defaultGate: SyncTrustGate | null, options: {
    trust?: {
        mode?: 'off' | 'log-only' | 'enforce';
        pin?: string | null;
    };
}): SyncTrustGate | null;
/**
 * Builds auth headers for an outgoing sync request if auth is configured.
 *
 * @param params - Auth parameters
 * @returns HTTP headers map (empty if no auth configured)
 */
export declare function buildSyncAuthHeaders(params: {
    auth: {
        secret: SyncSecret;
        keyId?: string;
    } | undefined;
    bodyStr: string;
    targetUrl: URL;
    crypto: CryptoPort;
    lamport: number;
}): Promise<Record<string, string>>;
