import { WorkPaper } from '@bilig/headless'; import type { PersistedWorkPaperDocument, RawCellContent, WorkPaperChange, WorkPaperConfig, WorkPaperFormulaDiagnostic, WorkPaperSheets } from '@bilig/headless'; type WorkPaperInstance = ReturnType; export type A1CellInput = RawCellContent; export type A1CellValue = ReturnType; export interface A1WorkPaperOptions { readonly defaultSheetName?: string; readonly writableSheets?: readonly string[]; readonly limitations?: readonly string[]; } export interface A1CellRead { readonly address: string; readonly value: A1CellValue; readonly serialized: RawCellContent; readonly formula: string | null; readonly displayValue: string; readonly formulaDiagnostics: readonly WorkPaperFormulaDiagnostic[]; } export interface A1RangeRead { readonly range: string; readonly values: A1CellValue[][]; readonly serialized: RawCellContent[][]; readonly displayValues: string[][]; readonly formulaDiagnostics: readonly WorkPaperFormulaDiagnostic[]; readonly cells: readonly (readonly A1CellRead[])[]; } export interface A1SetCellAndReadbackOptions { readonly readbackRange: string; readonly requireReadbackChange?: boolean; readonly includeConfig?: boolean; readonly includeSerializedDocument?: boolean; readonly limitations?: readonly string[]; } export interface A1SetCellAndReadbackProof { readonly editedCell: string; readonly readbackRange: string; readonly before: A1CellRead; readonly after: A1CellRead; readonly beforeReadback: A1RangeRead; readonly afterReadback: A1RangeRead; readonly restoredReadback: A1RangeRead; readonly persistedDocumentBytes: number; readonly checks: { readonly readbackChanged: boolean; readonly computedReadbackChanged: boolean; readonly editedFormulaReadbackChanged: boolean; readonly readbackIncludesEditedCell: boolean; readonly readbackContainsOnlyEditedCell: boolean; readonly restoredReadbackMatchesAfter: boolean; readonly blockingFormulaDiagnosticCount: number; readonly formulaDiagnostics: readonly WorkPaperFormulaDiagnostic[]; readonly previousSerialized: RawCellContent; readonly newSerialized: RawCellContent; }; readonly verified: boolean; readonly limitations: readonly string[]; readonly changes: readonly WorkPaperChange[]; readonly serializedDocument?: string; } export interface A1EditManyAndReadbackProof { readonly editedCells: readonly string[]; readonly readbackRange: string; readonly before: Readonly>; readonly after: Readonly>; readonly beforeReadback: A1RangeRead; readonly afterReadback: A1RangeRead; readonly restoredReadback: A1RangeRead; readonly persistedDocumentBytes: number; readonly checks: { readonly readbackChanged: boolean; readonly computedReadbackChanged: boolean; readonly editedFormulaReadbackChanged: boolean; readonly readbackIncludesEditedCells: boolean; readonly readbackContainsOnlyEditedCells: boolean; readonly restoredReadbackMatchesAfter: boolean; readonly blockingFormulaDiagnosticCount: number; readonly formulaDiagnostics: readonly WorkPaperFormulaDiagnostic[]; readonly previousSerialized: Readonly>; readonly newSerialized: Readonly>; }; readonly verified: boolean; readonly limitations: readonly string[]; readonly changes: readonly WorkPaperChange[]; readonly serializedDocument?: string; } export interface A1WorkPaper { readonly workpaper: WorkPaperInstance; readCell(address: string): A1CellRead; get(address: string): A1CellValue; display(address: string): string; formula(address: string): string | null; readRange(range: string): A1RangeRead; range(range: string): A1CellValue[][]; setCell(address: string, value: A1CellInput): WorkPaperChange[]; set(address: string, value: A1CellInput): WorkPaperChange[]; readMany(addresses: readonly string[]): Readonly>; setCells(edits: Readonly>): WorkPaperChange[]; setMany(edits: Readonly>): WorkPaperChange[]; validateFormula(formula: string): boolean; setCellAndReadback(address: string, value: A1CellInput, options: A1SetCellAndReadbackOptions): A1SetCellAndReadbackProof; editAndReadback(address: string, value: A1CellInput, options: A1SetCellAndReadbackOptions): A1SetCellAndReadbackProof; editManyAndReadback(edits: Readonly>, options: A1SetCellAndReadbackOptions): A1EditManyAndReadbackProof; exportDocument(options?: { readonly includeConfig?: boolean; }): PersistedWorkPaperDocument; serialize(options?: { readonly includeConfig?: boolean; }): string; saveJson(options?: { readonly includeConfig?: boolean; }): string; restoreJson(input: string | PersistedWorkPaperDocument): A1WorkPaper; dispose(): void; } export declare function createA1WorkPaper(workpaper: WorkPaperInstance, options?: A1WorkPaperOptions): A1WorkPaper; export declare function buildA1WorkPaper(sheets: WorkPaperSheets, config?: WorkPaperConfig, options?: A1WorkPaperOptions): A1WorkPaper; export declare function restoreA1WorkPaper(input: string | PersistedWorkPaperDocument, options?: A1WorkPaperOptions): A1WorkPaper; export {};