{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "xlsx",
  "type": "registry:lib",
  "title": "ساخت و دانلود فایل اکسل با تاریخ شمسی",
  "description": "ساخت و دانلود فایل اکسل با تاریخ شمسی",
  "dependencies": [
    "@kashi-ui/persian@^2.26.0"
  ],
  "files": [
    {
      "path": "registry/kashi/xlsx.ts",
      "type": "registry:lib",
      "target": "components/kashi/xlsx.ts",
      "content": "import { toXlsx, type XlsxCell, type XlsxOptions } from \"@kashi-ui/persian\";\n\nexport { toXlsx };\nexport type { XlsxCell, XlsxOptions };\n\n/** ساخت و دانلود فایل اکسل در مرورگر */\nexport function downloadXlsx(fileName: string, header: string[], rows: XlsxCell[][], options?: XlsxOptions): void {\n  const bytes = toXlsx(header, rows, options);\n  const blob = new Blob([bytes as BlobPart], { type: \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\" });\n  const a = document.createElement(\"a\");\n  a.href = URL.createObjectURL(blob);\n  a.download = fileName.endsWith(\".xlsx\") ? fileName : `${fileName}.xlsx`;\n  document.body.append(a);\n  a.click();\n  a.remove();\n  setTimeout(() => URL.revokeObjectURL(a.href), 1000);\n}\n"
    }
  ]
}