{"version":3,"file":"excelExporter.cjs","names":["utils"],"sources":["../src/exporters/excelExporter.ts"],"sourcesContent":["import { utils, write } from 'xlsx';\nimport { BlobExporter } from './exporter';\n\nexport default class ExcelExporter implements BlobExporter {\n  readonly type = 'xlsx';\n  readonly fileEnding = 'xlsx';\n\n  exportToBlob(columns: (string | number | Date)[], rows: (string | number | Date)[][]): Blob {\n    const worksheet = utils.aoa_to_sheet([columns, ...rows]);\n    const workbook = utils.book_new();\n    utils.book_append_sheet(workbook, worksheet, 'Sheet1');\n\n    const data = write(workbook, { type: 'buffer' });\n    return new Blob([data], {\n      type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',\n    });\n  }\n}\n"],"mappings":";;;;;AAGA,IAAqB,gBAArB,MAA2D;;cACzC;oBACM;;CAEtB,aAAa,SAAqC,MAA0C;EAC1F,MAAM,YAAYA,WAAM,aAAa,CAAC,SAAS,GAAG,KAAK,CAAC;EACxD,MAAM,WAAWA,WAAM,UAAU;AACjC,aAAM,kBAAkB,UAAU,WAAW,SAAS;EAEtD,MAAM,uBAAa,UAAU,EAAE,MAAM,UAAU,CAAC;AAChD,SAAO,IAAI,KAAK,CAAC,KAAK,EAAE,EACtB,MAAM,qEACP,CAAC"}