@@ -158,133 +158,222 @@ export type ExcelColorStyle = string | {
158158theme : number ;
159159} ;
160160export interface ExcelAlignmentStyle {
161+ /** Horizontal alignment of cell content */
161162horizontal ?: "center" | "fill" | "general" | "justify" | "left" | "right" ;
163+ /** Justify last line (for justified alignment) */
162164justifyLastLine ?: boolean ;
163- readingOrder ?: string ;
164- relativeIndent ?: boolean ;
165+ /** Reading order (1 = LTR, 2 = RTL) */
166+ readingOrder ?: 1 | 2 ;
167+ /** Indent cell content (number of spaces) */
168+ indent ?: number ;
169+ /** Shrink text to fit cell */
165170shrinkToFit ?: boolean ;
171+ /** Text rotation angle or preset */
166172textRotation ?: string | number ;
173+ /** Vertical alignment of cell content */
167174vertical ?: "bottom" | "distributed" | "center" | "justify" | "top" ;
175+ /** Wrap text within cell */
168176wrapText ?: boolean ;
169177}
170- export type ExcelBorderLineStyle = "continuous" | "dash" | "dashDot" | "dashDotDot" | "dotted" | "double" | "lineStyleNone " | "medium" | "slantDashDot" | "thin" | "thick" ;
178+ export type ExcelBorderLineStyle = "continuous" | "dash" | "dashDot" | "dashDotDot" | "dotted" | "double" | "none " | "medium" | "slantDashDot" | "thin" | "thick" ;
171179export interface ExcelBorderStyle {
180+ /** Bottom border configuration */
172181bottom ?: {
173182color ?: ExcelColorStyle ;
174183style ?: ExcelBorderLineStyle ;
175184} ;
185+ /** Top border configuration */
176186top ?: {
177187color ?: ExcelColorStyle ;
178188style ?: ExcelBorderLineStyle ;
179189} ;
190+ /** Left border configuration */
180191left ?: {
181192color ?: ExcelColorStyle ;
182193style ?: ExcelBorderLineStyle ;
183194} ;
195+ /** Right border configuration */
184196right ?: {
185197color ?: ExcelColorStyle ;
186198style ?: ExcelBorderLineStyle ;
187199} ;
188- diagonal ?: any ;
200+ /** Diagonal border configuration */
201+ diagonal ?: {
202+ color ?: ExcelColorStyle ;
203+ style ?: ExcelBorderLineStyle ;
204+ } ;
205+ /** Outline border (all sides) */
189206outline ?: boolean ;
207+ /** Diagonal up border */
190208diagonalUp ?: boolean ;
209+ /** Diagonal down border */
191210diagonalDown ?: boolean ;
192211}
193212export interface ExcelColumn {
213+ /** Auto-fit column width to content */
194214bestFit ?: boolean ;
215+ /** Collapse grouped columns */
195216collapsed ?: boolean ;
217+ /** Custom column width */
196218customWidth ?: number ;
219+ /** Hide column from view */
197220hidden ?: boolean ;
221+ /** Maximum column index for this config */
198222max ?: number ;
223+ /** Minimum column index for this config */
199224min ?: number ;
225+ /** Outline level for grouping */
200226outlineLevel ?: number ;
227+ /** Enable phonetic guide (East Asian languages) */
201228phonetic ?: boolean ;
229+ /** Style ID for column */
202230style ?: number ;
231+ /** Column width in Excel units */
203232width ?: number ;
204233}
205234export interface ExcelTableColumn {
235+ /** Column display name */
206236name : string ;
207- dataCellStyle ?: any ;
237+ /** Style for data cells in this column */
238+ dataCellStyle ?: ExcelStyleInstruction ;
239+ /** Differential style ID for data cells */
208240dataDxfId ?: number ;
241+ /** Style for header row cell */
209242headerRowCellStyle ?: ExcelStyleInstruction ;
243+ /** Differential style ID for header row */
210244headerRowDxfId ?: number ;
245+ /** Style for totals row cell */
211246totalsRowCellStyle ?: ExcelStyleInstruction ;
247+ /** Differential style ID for totals row */
212248totalsRowDxfId ?: number ;
213- totalsRowFunction ?: any ;
249+ /** Function for totals row (e.g. SUM, COUNT) */
250+ totalsRowFunction ?: string ;
251+ /** Label for totals row cell */
214252totalsRowLabel ?: string ;
253+ /** Formula for column values */
215254columnFormula ?: string ;
255+ /** Is column formula an array formula? */
216256columnFormulaIsArrayType ?: boolean ;
257+ /** Formula for totals row */
217258totalFormula ?: string ;
259+ /** Is totals formula an array formula? */
218260totalFormulaIsArrayType ?: boolean ;
219261}
220262export interface ExcelFillStyle {
263+ /** Fill type: gradient or pattern */
221264type ?: "gradient" | "pattern" ;
265+ /** Pattern type (if pattern fill) */
222266patternType ?: string ;
267+ /** Gradient angle (if gradient fill) */
223268degree ?: number ;
269+ /** Foreground color for fill */
224270fgColor ?: ExcelColorStyle ;
271+ /** Gradient start color */
225272start ?: ExcelColorStyle ;
273+ /** Gradient end color and position */
226274end ?: {
227275pureAt ?: number ;
228276color ?: ExcelColorStyle ;
229277} ;
230278}
231279export interface ExcelFontStyle {
280+ /** Bold text */
232281bold ?: boolean ;
282+ /** Font color */
233283color ?: ExcelColorStyle ;
284+ /** Font family name */
234285fontName ?: string ;
286+ /** Italic text */
235287italic ?: boolean ;
288+ /** Outline font effect */
236289outline ?: boolean ;
290+ /** Font size in points */
237291size ?: number ;
292+ /** Shadow effect */
238293shadow ?: boolean ;
294+ /** Strikethrough text */
239295strike ?: boolean ;
296+ /** Subscript text */
240297subscript ?: boolean ;
298+ /** Superscript text */
241299superscript ?: boolean ;
300+ /** Underline style */
242301underline ?: boolean | "single" | "double" | "singleAccounting" | "doubleAccounting" ;
243302}
244303export interface ExcelMetadata {
304+ /** Type of metadata (custom usage) */
245305type ?: string ;
306+ /** Style ID for metadata */
246307style ?: number ;
247308}
248309export interface ExcelColumnMetadata {
249- value : any ;
310+ /** Cell value */
311+ value : string | number | boolean | Date | null ;
312+ /** Optional metadata for the value */
250313metadata ?: ExcelMetadata ;
251314}
252315export interface ExcelMargin {
316+ /** Top margin in inches */
253317top : number ;
318+ /** Bottom margin in inches */
254319bottom : number ;
320+ /** Left margin in inches */
255321left : number ;
322+ /** Right margin in inches */
256323right : number ;
324+ /** Header margin in inches */
257325header : number ;
326+ /** Footer margin in inches */
258327footer : number ;
259328}
260329export interface ExcelSortState {
330+ /** Is sort case sensitive? */
261331caseSensitive ?: boolean ;
262- dataRange ?: any ;
332+ /** Data range to sort */
333+ dataRange ?: string ;
334+ /** Sort by column (true) or row (false) */
263335columnSort ?: boolean ;
336+ /** Sort direction: ascending or descending */
264337sortDirection ?: "ascending" | "descending" ;
265- sortRange ?: any ;
338+ /** Range to sort (defaults to dataRange) */
339+ sortRange ?: string ;
266340}
267341/** Excel custom formatting that will be applied to a column */
268342export interface ExcelStyleInstruction {
343+ /** Unique style instruction ID (internal use) */
269344id ?: number ;
345+ /** Cell alignment style (horizontal, vertical, wrap, etc.) */
270346alignment ?: ExcelAlignmentStyle ;
347+ /** Cell border style or border style ID */
271348border ?: ExcelBorderStyle | number ;
349+ /** Border style ID (if referencing a shared style) */
272350borderId ?: number ;
351+ /** Cell fill style (pattern, gradient, color) or fill style ID */
273352fill ?: ExcelFillStyle | number ;
353+ /** Fill style ID (if referencing a shared style) */
274354fillId ?: number ;
355+ /** Cell font style (bold, italic, color, etc.) or font style ID */
275356font ?: ExcelFontStyle | number ;
357+ /** Font style ID (if referencing a shared style) */
276358fontId ?: number ;
359+ /** Custom cell format string or format ID (e.g., date, currency) */
277360format ?: string | number ;
361+ /** Row height in points (if set at row level) */
278362height ?: number ;
363+ /** Number format string (Excel format codes) */
279364numFmt ?: string ;
365+ /** Number format ID (if referencing a shared format) */
280366numFmtId ?: number ;
367+ /** Column width in Excel units (if set at column level) */
281368width ?: number ;
369+ /** Extended format ID (Open XML xfId, for advanced style referencing) */
282370xfId ?: number ;
371+ /** Cell protection settings (locked, hidden) */
283372protection ?: {
284373locked ?: boolean ;
285374hidden ?: boolean ;
286375} ;
287- /** style id */
376+ /** Style ID (if referencing a shared style) */
288377style ?: number ;
289378}
290379export type ChartType = "column" | "bar" | "line" | "pie" | "doughnut" | "scatter" ;
0 commit comments