import { FormulaMode } from '@bilig/protocol';
const DERIVED_OUTPUT_FLAGS = 64 /* CellFlags.SpillChild */ | 128 /* CellFlags.PivotOutput */;
const FORMULA_RUNTIME_FLAGS = 2 /* CellFlags.HasFormula */ | 4 /* CellFlags.JsOnly */ | 8 /* CellFlags.InCycle */ | 64 /* CellFlags.SpillChild */ | 128 /* CellFlags.PivotOutput */;
export function markFormulaCellBound(cellStore, cellIndex, mode) {
    let nextFlags = ((cellStore.flags[cellIndex] ?? 0) & ~DERIVED_OUTPUT_FLAGS) | 2 /* CellFlags.HasFormula */;
    nextFlags = mode === FormulaMode.JsOnly ? nextFlags | 4 /* CellFlags.JsOnly */ : nextFlags & ~4 /* CellFlags.JsOnly */;
    cellStore.flags[cellIndex] = nextFlags;
}
export function clearFormulaRuntimeFlags(cellStore, cellIndex) {
    cellStore.flags[cellIndex] = (cellStore.flags[cellIndex] ?? 0) & ~FORMULA_RUNTIME_FLAGS;
}
//# sourceMappingURL=formula-binding-cell-flags.js.map