/** * SPREADSHEET EDITOR CORE * Grid-based collaborative spreadsheet with formula support * * Features: * - Virtual scrolling for large grids * - Cell editing and formula input * - Formula engine integration * - Column/row resize and freeze panes * - Cell formatting (colors, alignment, borders) * - Dependency tracking for formula recalculation * - Collaborative cell selection */ import type { CellAddress } from '@materi.ai/frame/core/types'; export interface CellData { address: CellAddress; value: string | number | boolean | null; formula?: string; format?: CellFormatting; displayValue?: string; } export interface CellFormatting { fontWeight?: 'normal' | 'bold'; fontStyle?: 'normal' | 'italic'; textAlign?: 'left' | 'center' | 'right'; backgroundColor?: string; textColor?: string; borderColor?: string; borderWidth?: number; numberFormat?: string; } export interface GridSelection { start: CellAddress; end: CellAddress; selectedCells: CellAddress[]; } export interface GridDimensions { rows: number; cols: number; rowHeight: number; colWidth: Map; frozenRows: number; frozenCols: number; } export interface CellDependency { cell: CellAddress; dependencies: CellAddress[]; dependents: CellAddress[]; } /** * Parse cell address and get row/col indices */ export declare function getCellCoordinates(address: CellAddress): { row: number; col: number; }; /** * Get cell address from coordinates */ export declare function getCellAddress(row: number, col: number): CellAddress; /** * Check if cell is frozen */ export declare function isCellFrozen(address: CellAddress, dims: GridDimensions): boolean; /** * Get range of cells between two addresses */ export declare function getCellRange(start: CellAddress, end: CellAddress): CellAddress[]; /** * Build cell dependency graph */ export declare function buildDependencyGraph(cells: Map): Map; /** * Topologically sort cells for recalculation */ export declare function getSortedCellsForRecalculation(graph: Map, changedCell: CellAddress): CellAddress[]; /** * Detect circular references */ export declare function hasCircularReference(graph: Map): boolean; /** * Recalculate cell formulas */ export declare function recalculateCells(cells: Map, sortedAddresses: CellAddress[]): void; /** * Apply cell formatting */ export declare function formatCells(cells: CellAddress[], format: CellFormatting, cellData: Map): void; /** * Clear cell formatting */ export declare function clearFormatting(cells: CellAddress[], cellData: Map): void; /** * Get visible cell range for viewport */ export declare function getVisibleCells(dims: GridDimensions, scrollTop: number, scrollLeft: number, viewportHeight: number, viewportWidth: number): { rows: [number, number]; cols: [number, number]; }; /** * Merge cells */ export declare function mergeCells(start: CellAddress, end: CellAddress, cellData: Map): void; /** * Split merged cells */ export declare function splitMergedCells(address: CellAddress, cellData: Map): void; //# sourceMappingURL=spreadsheet.d.ts.map