import { AxisResidentCellIndex } from './storage/axis-resident-cell-index.js';
import { CellAxisIdentityStore } from './storage/cell-axis-identity-store.js';
import { CellPageStore } from './storage/cell-page-store.js';
import { LogicalSheetStore } from './storage/logical-sheet-store.js';
import { SheetAxisMap } from './storage/sheet-axis-map.js';
import { SheetGrid } from './sheet-grid.js';
import { makeLogicalCellKey } from './workbook-cell-key-index.js';
export function createWorkbookSheetRecord(args) {
    const axisMap = new SheetAxisMap();
    const logicalAxisMap = new SheetAxisMap();
    const cellIdentities = new CellAxisIdentityStore();
    const residentCells = new AxisResidentCellIndex((callback) => {
        cellIdentities.forEach((identity, cellIndex) => {
            callback(cellIndex, identity);
        });
    });
    const logical = new LogicalSheetStore(args.id, logicalAxisMap, new CellPageStore(new Map(), (location) => makeLogicalCellKey(location.sheetId, location.rowId, location.colId), (callback) => {
        cellIdentities.forEach((identity, cellIndex) => {
            callback(identity, cellIndex);
        });
    }, makeLogicalCellKey), cellIdentities, residentCells);
    return {
        id: args.id,
        name: args.name,
        order: args.order,
        grid: new SheetGrid(args.counters, {
            get: (row, col) => logical.getVisibleCell(row, col),
            forEachCellEntry: (fn) => {
                logical.forEachVisibleCellEntry(fn);
            },
            someCellInAxisScope: (axis, scope, predicate) => logical.someResidentCellInAxisScope(axis, scope, predicate),
        }),
        axisMap,
        logicalAxisMap,
        logical,
        cellIdentities,
        residentCells,
        columnVersions: new Uint32Array(0),
        structureVersion: 1,
        rowAxis: [],
        columnAxis: [],
        styleRanges: [],
        formatRanges: [],
    };
}
//# sourceMappingURL=workbook-sheet-record.js.map