export const globalCommitContext = {
    ops: [],
    flushOptions: {},
    nonPayload: {
        removedSubtrees: [],
    },
};
export function resetGlobalCommitContext() {
    globalCommitContext.ops = [];
    globalCommitContext.flushOptions = {};
    delete globalCommitContext.flowIds;
    globalCommitContext.nonPayload.removedSubtrees = [];
}
export function markRemovedSubtreeForCurrentCommit(root) {
    const { removedSubtrees } = globalCommitContext.nonPayload;
    if (!removedSubtrees.includes(root)) {
        removedSubtrees.push(root);
    }
}
export function takeRemovedSubtreesForCurrentCommit() {
    const removedSubtrees = globalCommitContext.nonPayload.removedSubtrees;
    globalCommitContext.nonPayload.removedSubtrees = [];
    return removedSubtrees;
}
//# sourceMappingURL=commit-context.js.map