import { BaseSchemes, Root, Scope } from 'rete'; import { BaseArea } from 'rete-area-plugin'; import { Preset } from './presets/types'; import type { Action } from './types'; export type { Action as HistoryAction }; export * as HistoryExtensions from './extensions'; export * as Presets from './presets'; export type { HistoryActions } from './presets/classic'; export type { CommentHistoryActions } from './presets/comments'; export type { Preset } from './presets/types'; /** * History plugin. Allows to undo/redo actions such as adding/removing nodes, connections, etc. */ export declare class HistoryPlugin extends Scope, Root]> { private history; private editor; private area; private presets; timing: number; /** * @constructor * @param props History plugin properties * @param props.timing Time in ms between actions to be considered as one action */ constructor(props?: { timing?: number; }); setParent(scope: Scope, [Root]>): void; /** * Adds a preset to the history plugin * @param preset Preset that manages some actions, e.g. classic preset for adding/removing nodes, connections, etc. */ addPreset(preset: Preset): void; /** * Adds an action to the history * @param action Action instance */ add(action: A): void; /** * Get produced history records * @returns History snapshot */ getHistorySnapshot(): import("./history").HistoryRecord[]; /** * Get recent history records produced in the last `ms` milliseconds * @param ms Delta time in milliseconds * @returns History records produced in the last `ms` milliseconds */ getRecent(ms: number): import("./history").HistoryRecord[]; /** * Removes the most recent history record matching the predicate within the time window */ removeRecent(predicate: (record: { time: number; action: A; }) => boolean, ms?: number): import("./history").HistoryRecord | undefined; /** * Clear history */ clear(): void; /** * */ separate(): void; /** * Asynchronously undoes an actions until the `separated` flag is encountered or the time between the current and previous action exceeds `timing` property which is 200ms by default */ undo(): Promise; /** * Asynchronously redoes an actions until the `separated` flag is encountered or the time between the current and previous action exceeds `timing` property which is 200ms by default */ redo(): Promise; } //# sourceMappingURL=index.d.ts.map