/** One spreadsheet cell; `null` and `undefined` write an empty cell. */ export type TabularCell = string | number | boolean | null | undefined; interface TabularColumnBase { /** Row field the cell reads, the same `key` a table column uses. */ readonly key: K; /** Text of the header line. */ readonly header: string; /** Turns the field into a cell; required when the field is not a scalar. */ readonly format?: (value: Row[K], row: Row) => TabularCell; /** Default true: formula-like text gets a leading `'` so it is shown, not run. */ readonly escapeFormulas?: boolean; } /** One exported column; `format` is required when the field is not a scalar. */ export type TabularColumn = { [K in keyof Row & string]: Row[K] extends TabularCell ? TabularColumnBase : TabularColumnBase & { readonly format: (value: Row[K], row: Row) => TabularCell; }; }[keyof Row & string]; /** Options for `toCsv`. */ export interface ToCsvOptions { /** Prepends a UTF-8 byte-order mark so Excel reads non-ASCII. Default false. */ readonly bom?: boolean; } /** RFC 4180 CSV: header line, then one CRLF-separated line per row. */ export declare function toCsv(rows: readonly Row[], columns: readonly TabularColumn[], { bom }?: ToCsvOptions): string; /** Replaces path and reserved characters with `-`; caps at 80 characters, keeping the extension. */ export declare function safeFileName(fileName: string): string; /** Saves `blob` as `safeFileName(fileName)`, then revokes its object URL. */ export declare function downloadBlob(blob: Blob, fileName: string): void; export {};