UNPKG

@odoo/o-spreadsheet

Version:
32 lines (31 loc) 1.67 kB
import { StateUpdateMessage } from "../types/collaborative/transport_service"; import { UID } from "../types/misc"; import { ExcelSheetData, ExcelWorkbookData, SheetData, WorkbookData } from "../types/workbook_data"; /** * Represents the current version of the exported JSON data. * A new version must be created whenever a breaking change is introduced in the export format. * To define a new version, add an upgrade function to `migrationStepRegistry`. */ export declare function getCurrentVersion(): string; /** * This function tries to load anything that could look like a valid * workbookData object. It applies any migrations, if needed, and return a * current, complete workbookData object. * * It also ensures that there is at least one sheet. */ export declare function load(data?: any, verboseImport?: boolean): WorkbookData; /** * This function is used to repair faulty data independently of the migration. */ export declare function repairData(data: Partial<WorkbookData>): Partial<WorkbookData>; /** * The goal of this function is to repair corrupted/wrong initial messages caused by * a bug. * The bug should obviously be fixed, but it's too late for existing spreadsheet. */ export declare function repairInitialMessages(data: Partial<WorkbookData>, initialMessages: StateUpdateMessage[]): StateUpdateMessage[]; export declare function createEmptySheet(sheetId: UID, name: string): SheetData; export declare function createEmptyWorkbookData(sheetName?: string): WorkbookData; export declare function createEmptyExcelSheet(sheetId: UID, name: string): ExcelSheetData; export declare function createEmptyExcelWorkbookData(): ExcelWorkbookData;