import type { TwoCellAnchor } from './drawing/drawing'; import { SharedStrings } from './shared-strings'; import { StyleCache } from './workbook-style'; import { Theme } from './workbook-theme'; import { Sheet } from './workbook-sheet'; import type { RelationshipMap } from './relationship'; import { ZipWrapper } from './zip-wrapper'; import type { CellStyle } from '../../treb-base-types/src/index'; import type { SerializedNamed } from '../../treb-data-model/src/index'; import { type Metadata } from './metadata'; /** * @privateRemarks -- FIXME: not sure about the equal/equals thing. need to check. */ export declare const ConditionalFormatOperators: Record; export declare enum ChartType { Null = 0, Column = 1, Bar = 2, Line = 3, Scatter = 4, Donut = 5, Pie = 6, Bubble = 7, Box = 8, Histogram = 9, Unknown = 10 } export interface ChartSeries { values?: string; categories?: string; bubble_size?: string; /** special for histogram */ bin_count?: number; title?: string; } type ChartFlags = 'stacked'; export interface ChartDescription { title?: string; type: ChartType; flags?: ChartFlags[]; series?: ChartSeries[]; } export interface AnchoredImageDescription { type: 'image'; image?: Uint8Array; filename?: string; anchor: TwoCellAnchor; } export interface AnchoredChartDescription { type: 'chart'; chart?: ChartDescription; anchor: TwoCellAnchor; } export interface AnchoredTextBoxDescription { type: 'textbox'; style?: CellStyle; reference?: string; paragraphs: { style?: CellStyle; content: { text: string; style?: CellStyle; reference?: boolean; }[]; }[]; anchor: TwoCellAnchor; } export type AnchoredDrawingPart = AnchoredChartDescription | AnchoredTextBoxDescription | AnchoredImageDescription; export interface TableFooterType { type: 'label' | 'formula'; value: string; } export interface TableDescription { name: string; display_name: string; ref: string; filterRef?: string; totals_row_shown?: number; totals_row_count?: number; rel?: string; index?: number; columns?: string[]; footers?: TableFooterType[]; } export declare class Workbook { zip: ZipWrapper; xml: any; /** start with an empty strings table, if we load a file we will update it */ shared_strings: SharedStrings; /** document styles */ style_cache: StyleCache; /** theme */ theme: Theme; named: Array; /** the workbook "rels" */ rels: RelationshipMap; /** metadata reference; new and WIP */ metadata?: Metadata; sheets: Sheet[]; active_tab: number; get sheet_count(): number; constructor(zip: ZipWrapper); /** * given a path in the zip file, read and parse the rels file */ ReadRels(path: string): RelationshipMap; Init(): void; ReadTable(reference: string): TableDescription | undefined; ReadDrawing(reference: string): AnchoredDrawingPart[] | undefined; /** * * FIXME: this is using the old options with old structure, just have * not updated it yet */ ReadChart(reference: string): ChartDescription | undefined; /** FIXME: accessor */ GetNamedRanges(): (SerializedNamed & { local_scope?: number; })[]; } export {};