/**
 * Records changes to a object which can later be reversed.
 */
export declare class ChangeRecorder {
    private _items;
    /**
     * Save a property `prop` on `obj`. This value will be restored when {@link restoreAll} is called later.
     * @param obj
     * @param prop
     */
    save<O extends unknown, P extends keyof O>(obj: O, prop: P): void;
    /**
     * Set a property `prop` on `obj` to `newValue`. This can later be reversed by calling {@link restoreAll}.
     * @param obj Object to set property on.
     * @param prop Property to set
     * @param newValue New value which `obj[prop]` will get.
     */
    set<O extends unknown, P extends keyof O, V extends O[P]>(obj: O, prop: P, newValue: V): void;
    /**
     * Register callback, for `o`, which will be invoked when {@link restoreAll} is called. Useful
     * when a more complex state needs to be restored when {@link restoreAll} is called. The callback is then
     * responsible for modifying `o` when {@link restoreAll} is called.
     * @param o Object to register callback for.
     * @param onRestore callback.
     */
    onRestore<O extends unknown>(o: O, onRestore: (obj: O) => void): void;
    /**
     * Reverts all changes made to the objects.
     */
    restoreAll(): void;
}
//# sourceMappingURL=change-recorder.d.ts.map