import { type OfficeTheme } from '../../shared/ooxml/theme'; import type { XlsxCellStyle } from './types'; /** XLSX 单元格格式引用的字体、填充、边框和对齐。 */ export type ParsedStyle = { /** 当前单元格格式引用的字体索引。 */ fontId?: number; /** 当前单元格格式引用的填充索引。 */ fillId?: number; /** 当前单元格格式引用的边框索引。 */ borderId?: number; /** 解析出的单元格水平、垂直对齐与换行配置。 */ alignment?: XlsxCellStyle; }; /** XLSX 工作簿共享的字体、填充、边框和单元格格式表。 */ export type StyleBook = { /** 按字体索引排列的文字样式。 */ fonts: XlsxCellStyle[]; /** 按填充索引排列的背景样式。 */ fills: Array>; /** 按边框索引排列的单元格边框样式。 */ borders: Array>; /** 按样式索引排列的单元格格式引用。 */ styles: ParsedStyle[]; /** 条件格式 dxfId 引用的差异样式。 */ differentialStyles: XlsxCellStyle[]; }; /** 完成解析且从 1 开始计数的单元格坐标。 */ export type CellAddress = { /** 单元格从 1 开始计数的行索引。 */ row: number; /** 单元格从 1 开始计数的列索引。 */ column: number; }; /** 描述从起始单元格到结束单元格的闭合区域。 */ export type CellRange = { /** 起始单元格的行索引。 */ startRow: CellAddress['row']; /** 起始单元格的列索引。 */ startColumn: CellAddress['column']; /** 结束单元格的行索引。 */ endRow: CellAddress['row']; /** 结束单元格的列索引。 */ endColumn: CellAddress['column']; }; /** Excel 默认行高,单位为磅。 */ export declare const DEFAULT_ROW_HEIGHT_POINTS = 15; /** Excel 默认列宽,单位为标准化渲染像素。 */ export declare const DEFAULT_COLUMN_WIDTH = 64; /** Excel 默认行高,单位为标准化渲染像素。 */ export declare const DEFAULT_ROW_HEIGHT = 20; /** 尝试修复由 UTF-8 字节误按单字节编码解读产生的乱码。 */ export declare function decodeMojibake(value: string): string; /** 将 Excel 列标签转换为从 1 开始计数的列索引。 */ export declare function columnLabelToIndex(label: string): number; /** 将零基列索引转换为 Excel 列标签。 */ export declare function columnIndexToLabel(index: number): string; /** 解析 A1 单元格引用并返回从 1 开始计数的坐标。 */ export declare function parseCellRef(ref: string): CellAddress; /** 解析 A1 区域引用并返回行列边界。 */ export declare function parseRange(range?: string): CellRange | undefined; /** 从无 DOM 的属性映射解析主题色、索引色和 tint。 */ export declare function parseXlsxColorAttributes(attributes: ReadonlyMap, theme: OfficeTheme): string | undefined; declare function parseColor(node: Element | null | undefined, theme: OfficeTheme): string | undefined; /** 读取 XLSX 样式表并建立字体、填充和边框索引。 */ export declare function parseStyles(xml: string, theme: OfficeTheme): StyleBook; /** 为条件格式解析器开放与普通样式一致的颜色解析。 */ export declare const parseXlsxColor: typeof parseColor; /** 解析并确定 `resolveStyle` 对应的引用或配置。 */ export declare function resolveStyle(styleId: number | undefined, styleBook: StyleBook): XlsxCellStyle | undefined; /** 将 Excel 字符列宽换算为标准化渲染像素。 */ export declare function excelWidthToPx(width?: number, fallback?: number, maxDigitWidth?: number): number; /** 按 Normal 字体估算 Excel 列宽算法使用的最大数字宽度。 */ export declare function resolveXlsxMaxDigitWidth(font: XlsxCellStyle | undefined): number; /** 将磅值换算为标准化渲染像素。 */ export declare function pointToPx(point?: number, fallback?: number): number; export {};