UNPKG

@odoo/o-spreadsheet

Version:
28 lines (27 loc) 1.27 kB
import { Dimension } from "../../types/misc"; import { ExcelHeaderData, ExcelSheetData } from "../../types/workbook_data"; /** * Get the relative path between two files * * Eg.: * from "folder1/file1.txt" to "folder2/file2.txt" => "../folder2/file2.txt" */ export declare function getRelativePath(from: string, to: string): string; /** * Convert an array of element into an object where the objects keys were the elements position in the array. * Can give an offset as argument, and all the array indexes will we shifted by this offset in the returned object. * * eg. : ["a", "b"] => {0:"a", 1:"b"} */ export declare function arrayToObject<T>(array: T[], indexOffset?: number): { [key: number]: T; }; /** * In xlsx we can have string with unicode characters with the format _x00fa_. * Replace with characters understandable by JS */ export declare function fixXlsxUnicode(str: string): string; /** Get a header in the SheetData. Create the header if it doesn't exist in the SheetData */ export declare function getSheetDataHeader(sheetData: ExcelSheetData, dimension: Dimension, index: number): ExcelHeaderData; /** Prefix the string by "=" if the string looks like a formula */ export declare function prefixFormulaWithEqual(formula: string): string;