/**
 * Schema describing the deltas produced/consumed by a {@link DomRDT}: a recursive node with a string
 * name, string→string attributes, and text content.
 */
export const $domDelta: s.Schema<delta.Delta<{
    name: string;
    attrs: {
        [x: string]: string;
    };
    text: true;
    recursiveChildren: true;
}>>;
export function domRDT(dom: Element): DomRDT;
export type Schema<T> = import("../../schema.js").Schema<T>;
export type RDT<Conf extends delta.DeltaConf> = import("../rdt.js").RDT<Conf>;
/**
 * The {@link delta.DeltaConf} of the deltas a {@link DomRDT} produces/consumes (see {@link $domDelta}).
 */
export type DomConf = {
    name: string;
    attrs: {
        [key: string]: string;
    };
    text: true;
    recursiveChildren: true;
};
export type DomDelta = delta.Delta<DomConf>;
import * as delta from '../delta.js';
import * as s from '../../schema.js';
/**
 * The {@link delta.DeltaConf} of the deltas a {@link DomRDT} produces/consumes (see {@link $domDelta}).
 *
 * @typedef {{ name: string, attrs: { [key:string]: string }, text: true, recursiveChildren: true }} DomConf
 */
/**
 * @typedef {delta.Delta<DomConf>} DomDelta
 */
/**
 * An RDT backed by a live DOM subtree. DOM mutations observed via `MutationObserver` are diffed
 * against the last-known state and emitted as deltas; incoming deltas are applied back onto the DOM.
 *
 * @implements {RDT<DomConf>}
 * @extends {ObservableV2<{ delta: (delta: delta.Delta<DomConf>, origin: any) => void, destroy: (rdt: DomRDT) => void }>}
 */
declare class DomRDT extends ObservableV2<{
    delta: (delta: delta.Delta<DomConf>, origin: any) => void;
    destroy: (rdt: DomRDT) => void;
}> implements RDT<DomConf> {
    /**
     * @param {Element} observedNode
     */
    constructor(observedNode: Element);
    /**
     * @type {Schema<DomDelta>}
     */
    $delta: Schema<DomDelta>;
    observedNode: Element;
    /**
     * Last-known DOM state. The observe path diffs the live DOM against this to compute the change to
     * emit, then advances it; `applyDelta` re-syncs it after mutating the DOM.
     *
     * @type {DomDelta}
     */
    _state: DomDelta;
    observer: MutationObserver;
    /**
     * Pull the local DOM changes accumulated since the last sync as a delta (by diffing the live DOM
     * against `_state`), advancing `_state` to the current DOM.
     *
     * @return {DomDelta}
     */
    _pull(): DomDelta;
    /**
     * @param {MutationRecord[]} mutations
     */
    _mutationHandler: (mutations: MutationRecord[]) => void;
    /**
     * Apply a foreign delta onto the DOM.
     *
     * The DOM may have been edited locally (`b`) since the last sync, concurrently with the incoming
     * change (`d`). We pull `b` first and rebase the two against each other (OT) so neither is lost:
     * `d` rebased onto `b` is applied to the DOM, and `b` rebased onto `d` is returned as the fix so the
     * binding pipes it back through the transformer to the other side.
     *
     * @param {delta.Delta<DomConf>} d
     * @param {any} [origin] who produced `d`; forwarded verbatim on the emitted `'delta'` event so
     * listeners can recognise (and skip) their own changes — see {@link RDT} “Origins”. Defaults to `null`
     * (an anonymous/local change).
     * @return {delta.DeltaBuilder<DomConf> | null} the rebased local change (`b`), or `null` when there
     * were no concurrent edits
     */
    applyDelta(d: delta.Delta<DomConf>, origin?: any): delta.DeltaBuilder<DomConf> | null;
    /**
     * The current state as a delta: an "insert everything" delta describing the observed subtree.
     *
     * @return {delta.Delta<DomConf>}
     */
    get delta(): delta.Delta<DomConf>;
}
import { ObservableV2 } from '../../observable.js';
export {};
//# sourceMappingURL=dom.d.ts.map