/**
 * The diff engine: compares a remote canonical document against the locally
 * edited one and produces ONLY server-whitelisted JSON Patch operations.
 *
 * Identity-based: items are matched by `id` then `name` (see `matchItems`),
 * never by index. Renames are plain `replace .../name` ops because children
 * are always addressed by the REMOTE item's key (stable across edits).
 * Emission order per domain: adds (parents first) → replaces → removes.
 */
import type { LayoutDomain, PlannedOp } from './types';
export type DiffResult = {
    ops: PlannedOp[];
    warnings: string[];
};
type Item = Record<string, unknown>;
/**
 * Match local items to remote ones by `id`, then by `name` — so a hand-authored
 * item that omits its `id` updates the existing element instead of being seen as
 * an add + a remove. Fails loudly on ambiguous input (duplicate local identities,
 * or two locals resolving to the same remote).
 */
/**
 * Build the local→remote resolver: a singleton (e.g. the main folder) matches its
 * remote counterpart regardless of id/name; otherwise match by id, then by name.
 * Exported so the sidecar upload (`workflow-sidecar.ts`) resolves its target with
 * the EXACT same semantics as the domain patch (incl. last-wins on duplicate names).
 */
export declare function remoteResolver(remoteItems: Item[], singletonFlag?: string): (local: Item) => Item | undefined;
/** Diff one domain; returns whitelisted ops (adds → replaces → removes) + warnings. */
export declare function diffDomain(domain: LayoutDomain, remote: unknown, local: unknown): DiffResult;
export {};
//# sourceMappingURL=diff.d.ts.map