import { parseChangeReturns } from './converters';
export class SnapshotHandler {
    constructor(dispatcher, snapshot) {
        this.dispatch = dispatcher.dispatch.bind(this);
        this.snapshot = snapshot;
        this.cloneInternal =
            this.snapshot === 'main'
                ? () => this.dispatch({ method: 'snapshot_clone' })
                : () => {
                };
    }
    commit() {
        return this.dispatch({
            method: 'snapshot_commit',
            args: {
                snapshot: this.snapshot,
            },
        });
    }
    getChangeSet() {
        return parseChangeReturns(this.dispatch({
            method: 'snapshot_get_change_set',
            args: {
                snapshot: this.snapshot,
            },
        }));
    }
    clone() {
        this.cloneInternal();
    }
    reset() {
        return this.dispatch({
            method: 'snapshot_reset',
        });
    }
}

//# sourceMappingURL=SnapshotHandler.js.map
