import { AutoFillPlugin, createFormulaAdapter } from "../src/auto-fill";

export function setupAutoFillWithFormulas(table, formulaManager) {
    const autoFillPlugin = new AutoFillPlugin({
        fillMode: "series"
    });
    return table.registerPlugin(autoFillPlugin), autoFillPlugin;
}

export function demonstrateFormulaAdapter(table, formulaManager) {
    const formulaAdapter = createFormulaAdapter(table, formulaManager);
    formulaAdapter.isFormulaCell(0, 0), formulaAdapter.getCellFormula(0, 0);
    formulaAdapter.setCellFormula(1, 0, "=A1+1");
    formulaAdapter.getCalculatedValue(1, 0);
}

export const formulaAutoFillExamples = {
    simpleSeries: [ {
        cell: "A1",
        formula: "=B1"
    }, {
        cell: "A2",
        formula: "=B2"
    } ],
    mixedReferences: [ {
        cell: "C1",
        formula: "=$A$1+B1"
    }, {
        cell: "C2",
        formula: "=$A$1+B2"
    } ],
    mathematicalSeries: [ {
        cell: "D1",
        formula: "=A1+1"
    }, {
        cell: "D2",
        formula: "=A2+2"
    } ],
    functionSeries: [ {
        cell: "E1",
        formula: "=SUM(A1:B1)"
    }, {
        cell: "E2",
        formula: "=SUM(A2:B2)"
    } ]
};

export function testFormulaAutoFill() {}

export function testVTableSheetIntegration(table) {
    table.changeCellValue(1, 0, "10"), table.changeCellValue(1, 1, "20"), table.changeCellValue(1, 2, "30");
    createFormulaAdapter(table).setCellFormula(0, 0, "=B1*2");
}
//# sourceMappingURL=formula-integration.test.js.map
