import { DirtyTracker, type DirtyTrackerOptions, type HistoryManager } from "@pixerate/editor/history"; export interface CreateHistoryDirtyOptions extends DirtyTrackerOptions { /** The history whose changes re-check the document (a `createHistory().manager`). */ history: HistoryManager; /** Reads the current document value. */ getValue: () => T; /** Existing tracker to drive. */ tracker?: DirtyTracker; } export interface SvelteHistoryDirty { /** Whether the document differs from the saved state (reactive). */ readonly isDirty: boolean; /** Marks the current document as saved. */ markClean(): void; /** Runs a load / restore without marking the document dirty (re-entrant). */ suppress(fn: () => R): R; /** Re-checks after a change made outside the history. */ refresh(): boolean; readonly tracker: DirtyTracker; /** Stops following the history. */ destroy(): void; } /** * Svelte 5 rune: dirty-vs-saved tracking bound to a HistoryManager. Undoing * back to the saved state makes the document clean again, so a navigation * guard fed with `isDirty` stops prompting. * * Usage: `createNavigationGuard({ isDirty: () => dirty.isDirty })`. */ export declare function createHistoryDirty(options: CreateHistoryDirtyOptions): SvelteHistoryDirty;