/** One output column: the row key to read and, optionally, the header text to print instead of the key. */ export interface CsvColumn { /** Property of each row whose value fills this column. */ key: keyof Row & string; /** * Header cell text. * * @default the key itself */ label?: string | undefined; } /** Output options for {@link toCsv}; every field has a working default. */ export interface CsvOptions { /** * Columns to emit, in order; omit to emit every key of the first row. * * @default Object.keys(rows[0]) */ columns?: readonly (CsvColumn | (keyof Row & string))[] | undefined; /** * Field separator. * * @default ',' */ delimiter?: string | undefined; /** * Whether the first line is the header row. * * @default true */ header?: boolean | undefined; } /** * Serialises rows to RFC 4180 CSV text — CRLF line ends, fields quoted only when * they contain the delimiter, a quote or a line break — ready for a Blob or a * data: URL. Dates print as ISO 8601; null and undefined print as empty fields. * * @example * ```ts * toCsv(rows, { columns: [{ key: 'name', label: 'Name' }, 'amount'] }); * ``` */ export declare function toCsv(rows: readonly Row[], options?: CsvOptions): string;