import { DockviewCompositeDisposable as CompositeDisposable, DockviewEvent as Event, ILayoutHistoryHost, ILayoutHistoryService, LayoutHistoryChangeEvent } from 'dockview'; /** * Undo / redo for layout mutations. Snapshot strategy: each recorded mutation * keeps a full `toJSON()` pre-image (`before`) and post-image (`after`); undo * restores `before` via `fromJSON(.., { reuseExistingPanels: true })`, redo * restores `after`. Opt-in via `layoutHistory.enabled`. * * Discrete mutations (close/move/float/popout/add/maximize/tab-group) record one * step each off the will/did boundary. Resize (sash drag) has no boundary, so * it's caught off the coalesced `onDidLayoutChange` ping, using the last settled * snapshot as the pre-image (the "lazy pre-image"), and a continuous drag is * debounced into a single entry. A bulk `load`/`clear` clears the stacks. Undo / * redo restore popout windows, which re-open asynchronously, so the guard is held * across that re-open via `popoutRestorationPromise`. */ export declare class LayoutHistoryService extends CompositeDisposable implements ILayoutHistoryService { private readonly _host; private readonly _undo; private readonly _redo; /** Pre-image captured on `onWillMutateLayout`, consumed on `onDidMutateLayout`. */ private _pendingBefore; /** >0 while an undo/redo apply is in flight (counter, not a boolean, so an * apply that starts before a previous one's async popout restoration has * settled still keeps the guard up). The recorder ignores all boundary / * layout events while it's active (re-entrancy). */ private _applyDepth; private get _applying(); /** The last settled snapshot, used as the pre-image for the next resize run. */ private _baseline; /** The resize entry currently being coalesced (open during a drag). */ private _pendingResize; private _resizeTimer; /** Set when a boundary mutation just ran, so its trailing layout ping is * treated as a settle, not the start of a resize. */ private _mutationSettlePending; private readonly _onDidChangeHistory; readonly onDidChangeHistory: Event; constructor(host: ILayoutHistoryHost); private get _opts(); get canUndo(): boolean; get canRedo(): boolean; private _records; private _onWill; private _onDid; /** Push an entry, invalidate redo, trim to depth, and notify. */ private _push; private _onLayoutChange; /** Close an open resize run, pushing one entry for the whole drag. */ private _finalizeResize; private _clearResizeTimer; undo(): void; redo(): void; /** * Restore a snapshot. `reuseExistingPanels` is mandatory; without it every * undo disposes and recreates every renderer (content flash, lost focus). * The re-entrancy guard stops the mutations this fires from re-recording. */ private _apply; clear(): void; private _fire; } export declare const LayoutHistoryModule: import("dockview").DockviewModule;