import type { ChangesetOperationRow } from '../../../types/db/index.js'; /** * In-memory overlay engine for the storefront / preview path. * * Source state (`widgetMap`, `placementMap`) comes from the live DB tables. * The supplied `ops` are walked in `change_order` ascending and applied to * those maps per the conflict rules in spec 03 § 6.3: * - INSERT: add (widget) or add-if-parent-widget-known (placement) * - UPDATE: replace if entity exists in the map (else silently skip — the * entity was deleted in source by a competing publish; the deletion wins) * - DELETE: remove (no-op if already gone) * * The maps are keyed by **UUID** so the overlay never depends on auto-increment * IDs. After applying, the caller filters by route / type / parent and * produces the render-time list. */ export type OverlayWidget = { uuid: string; type: string; status: boolean; settings: Record; [key: string]: unknown; }; export type OverlayPlacement = { uuid: string; widget_instance_uuid: string; route: string; area: string; sort_order: number; entity_urn: string | null; [key: string]: unknown; }; export declare function applyOverlayToWidgets(widgetMap: Map, placementMap: Map, ops: ChangesetOperationRow[]): void;