/** * **Optional SheetJS-backed Workbook parser.** * * This adapter is the officially-supported way to enable binary Excel * (`.xlsx` / `.xls`) import. It is deliberately **not** referenced by the core * barrel (`src/index.ts`) and is published on a separate entry point, so Photon * Grid Core stays zero-dependency and this file's `xlsx` cost is paid only by * hosts that opt in: * * ```ts * import { SheetJsWorkbookParser } from '@photon-grid/core/import/sheetjs'; * gridApi.registerImportParser(new SheetJsWorkbookParser()); * await gridApi.importExcel(file); * ``` * * `xlsx` is an **optional peer dependency** — the host installs it. It is loaded * lazily (`import('xlsx')`) the first time a file is parsed, so it never enters * the initial bundle. The dynamic specifier is typed indirectly (`as string`) * so Photon Grid Core type-checks and builds without `xlsx` present. * * Formulas are preserved (`cell.f` → `=…`) and never evaluated here — the grid's * Formula Engine computes them after import. * * @packageDocumentation */ import type { Workbook } from '../model/workbook'; import type { WorkbookParser, WorkbookParseOptions } from '../parser/workbook-parser'; /** A {@link WorkbookParser} that reads real spreadsheets via SheetJS. */ export declare class SheetJsWorkbookParser implements WorkbookParser { /** Cached module handle after the first lazy load. */ private xlsx; /** * @param preloaded - An already-imported `xlsx` module, to skip the dynamic * import (useful in bundled/SSR environments or tests). */ constructor(preloaded?: unknown); /** Lazily loads (and caches) the `xlsx` module. */ private load; /** @inheritDoc */ parse(input: ArrayBuffer | string, _options?: WorkbookParseOptions): Promise; /** Converts one SheetJS worksheet into a {@link WorkbookSheet}. */ private convertSheet; /** Converts a SheetJS cell into a {@link WorkbookCell}, preserving formulas. */ private convertCell; } //# sourceMappingURL=sheetjs-workbook-parser.d.ts.map