import { BaseReportSettings, ReportConfig } from './report-types.js'; import { Properties, CellStyle, ExcelDataType, NumberFormat } from 'xlsx-js-style'; import { ReportRunner } from './report.js'; /** * Output options specific to workbook-style spreadsheet files */ export type XlsReportSettings = BaseReportSettings & { type: 'xlsx'; /** * Internal metadata about the spreadsheet, usually displayed by a program's * "document information" command. */ metadata?: Properties; /** * A dictionary of per-sheet configuration options. Each key corresponds to a key * in the report's `data` property; if it exists, the `default` entry will be used * as a fallback for sheets with no specific settings. */ sheets?: Record; }; type SheetSettings = { /** * A human-friendly name for the sheet. */ name?: string; /** * A human-friendly description of the data on the sheet. */ description?: string; /** * An output template to use when generating the sheet. * * - table: A traditional columns/rows data sheet, with styled header * - cover: An array of strings to turned into * - inspector: Key/Value pairs, optionally grouped under subheadings. */ template?: 'table' | 'cover' | 'inspector'; /** * Settings for individual columns. The settings in the 'default' entry will be * applied to all columns. */ columns?: Record; /** * Default styling information for all cells in the sheet */ style?: CellStyle; /** * Additional style information for heading columns and rows. */ headingStyle?: CellStyle; }; type ColumnSettings = { /** * Override the text of the column's first row. */ title?: string; /** * Add a hover/tooltip comment to the column's first row. */ comment?: string; /** * Hide the column from view; its data will still be present and usable in formulas. */ hidden?: boolean; /** * Adjust the column to the width of its widest row. * * @defaultValue true */ autoFit?: boolean; /** * Hard-code the width of the column. This measurement is in 'approxomate characters,' not pixels. */ width?: number; /** * The max width for the column. This measurement is in 'approxomate characters,' not pixels. * * @defaultValue 80 */ maxWidth?: number; /** * The minimum width for the column. This measurement is in 'approxomate characters,' not pixels. * * @defaultValue 5 */ minWidth?: number; /** * Wrap the contents of this column rather than truncating or overflowing. */ wrap?: boolean; /** * If the column is populated and wrapping is turned on, its Row's height should * be set to this number. */ height?: number; /** * Override data type auto-detection. Possible values: * * - "b": boolean * - "n": number * - "s": string * - "d": date */ type?: ExcelDataType; /** * If the data type is set to 'n' or 'd', this format will be used used by Excel * when displaying the data. it does not change the underlying cell value. */ format?: NumberFormat; /** * Attempt to parse and/or coerce the column's data before creating the sheet. * This is mostly useful for dates, which are a nightmare: setting 'type' to 'd' * and 'parse' to 'true' means Spidergram will ATTEMPT to turn timestamps, ISO dates, * and more into "clean" dates. */ parse?: boolean; }; export declare function outputXlsxReport(config: ReportConfig, runner: ReportRunner): Promise; export {}; //# sourceMappingURL=output-xlsx.d.ts.map