/** * switching to a different xml library, and trying to simplify how * we deal with XLSX files. * * the original impetus for the switch was CSP -- ElementTree uses eval * (actually new Function(...)) which is blocked by CSP, and I don't want to * allow it (or patch ET). so we swtiched to fast-xml-parser, but optimally we * should not be reliant on the actual parser, if we can have some sort of * common data structure. * * in any event, in the old scheme we were constantly updating the XML tree * so we could write back. in the new scheme, we'll start from raw data, build * a structure, and then generate XML from that. * * the primary problems we are going to run into are namespacing and output * ordering, but we can probably get through it. * * output ordering may be the hardest one, because different browsers. if * necessary we can custom roll the js -> xml side. */ import type { AddressType, RangeType } from './address-type'; import type { SharedStrings } from './shared-strings'; import type { Drawing } from './drawing/drawing'; import type { RelationshipMap } from './relationship'; import * as OOXML from 'ooxml-types'; export interface SheetOptions { name?: string; id?: number; rid?: string; } export interface RangeOptions { merge?: boolean; style?: number; precalc?: boolean | string | number; preserveStyle?: boolean; type?: string; array?: string; } export declare enum VisibleState { visible = 0, hidden = 1, very_hidden = 2 } export declare class Sheet { options: SheetOptions; root: OOXML.Worksheet; path?: string; rels_path?: string; rels: RelationshipMap; shared_strings?: SharedStrings; extent?: RangeType; visible_state?: VisibleState; tab_selected: boolean; default_width: number; drawings: Drawing[]; constructor(options: SheetOptions, root: OOXML.Worksheet); /** * A1 -> {row: 1, col: 1} etc. * in the event of a range, { from: {}, to: {} } */ TranslateAddress(s: string): AddressType | RangeType; /** * { row: 1, col: 1 } -> A1. * for ranges, {from: {}, to: {}} -> A1:B2 */ Address(r: AddressType | RangeType, absolute?: boolean): string; /** * convert an address (either style) to BOTH A1 and R1C1 */ NormalizeAddress(rng: string | AddressType | RangeType): { a: string; rc: RangeType | AddressType; }; Parse(): void; }