Skip to content

Export Excel

ColumnRegular (Extended from @revolist/revogrid)

Section titled “ColumnRegular (Extended from @revolist/revogrid)”
interface ColumnRegular {
/**
* Excel export-only properties and formatting. This does not affect the
* rendered grid cell renderer.
*/
excelExport?: ExcelExportColumnOptions
}

HTMLRevoGridElement (Extended from global)

Section titled “HTMLRevoGridElement (Extended from global)”
interface HTMLRevoGridElement {
exportExcel?: ExcelConfig;
'export-excel'?: ExcelConfig
}

HTMLRevoGridElementEventMap (Extended from global)

Section titled “HTMLRevoGridElementEventMap (Extended from global)”
interface HTMLRevoGridElementEventMap {
/**
* Event for export excel
*
* @example
* ```typescript
* grid.addEventListener(EXCEL_EXPORT_EVENT, (event) => {
* console.log(event);
* });
*/
[EXCEL_EXPORT_EVENT]: ExportExcelEvent | undefined;
[EXCEL_BEFORE_IMPORT_EVENT]: ExcelCsvBeforeImportEvent;
[EXCEL_BEFORE_SET_EVENT]: ExcelCsvBeforeSetEvent
}

AdditionalData (Extended from @revolist/revogrid)

Section titled “AdditionalData (Extended from @revolist/revogrid)”
interface AdditionalData {
/**
* Additional data property for export excel
*
* @deprecated Use `grid.exportExcel` instead.
*
* @example
* ```typescript
* const grid = document.createElement('revo-grid');
* grid.additionalData = { excel: { allowDrag: false } };
* ```
*/
excel?: ExcelConfig
}
export function createExcelJsExcelExportProvider(excelJsModule: ExcelJsExcelExportModule): ExcelExportProvider;

export function createSheetJsExcelExportProvider(xlsxModule: SheetJsExcelExportModule): ExcelExportProvider;

export function createWorkbookModuleExcelExportProvider(workbookModule: WorkbookExportModule): ExcelExportProvider;

The ExportExcelPlugin is a plugin for RevoGrid that enables XLSX export and CSV import while preserving the historic public plugin and event names.

Features:

  • Drag-and-drop interface for importing CSV files directly into the grid.
  • Event-driven architecture allowing hooks for customization via ‘excel-before-import’ and ‘excel-before-set’ events, giving plugins the ability to modify parsed CSV data before it is processed by the grid.
  • Export current grid data to an XLSX file through the bundled write-excel-file provider or a custom provider.
  • Event integration EXCEL_EXPORT_EVENT, EXCEL_BEFORE_IMPORT_EVENT, EXCEL_BEFORE_SET_EVENT: Dispatches and listens to Excel events so other plugins can customize import and export data.
  • Config integration additionalData.excel: Reads legacy Excel configuration from additionalData.excel.
class ExportExcelPlugin {
/**
* Imports a CSV file into the grid.
*/
async importFile(
file: File,
config: ExcelConfig = this.config,
);
isCsv(file: File, allowedExtensions: string[] = ['.csv']);
/**
* @deprecated Import is CSV-only. Use `isCsv()` instead.
*/
isExcel(file: File, allowedExtensions: string[] = ['.csv']);
async export(config?: ExportExcelEvent): Promise<void>;
destroy();
}

Detail payload emitted before a CSV import is applied to the grid.

/**
* Detail payload emitted before a CSV import is applied to the grid.
*/
export type ExcelCsvBeforeImportEvent = {
file: File;
sheetName: string;
csv: string;
rows: string[][];
};

ExcelCsvBeforeSetEvent (Extended from index.ts)

Section titled “ExcelCsvBeforeSetEvent (Extended from index.ts)”

Detail payload emitted after CSV rows are mapped to grid row objects and before the grid source is replaced.

/**
* Detail payload emitted after CSV rows are mapped to grid row objects and
* before the grid source is replaced.
*/
export type ExcelCsvBeforeSetEvent = ExcelCsvBeforeImportEvent & {
jsonData: DataType[];
};

Example usage of the ExportExcelEvent type

Example:

* const exportConfig: ExportExcelEvent = {
* sheetName: 'Property Data', // Specify the name of the Excel sheet
* workbookName: 'Properties.xlsx', // Name of the workbook file
* writingOptions: {
* type: 'file', // Output type
* bookType: 'xlsx', // Workbook type
* compression: true, // Enable compression
* ignoreEC: true, // Ignore Excel compatibility
* },
* };
/**
* Example usage of the ExportExcelEvent type
*
* @example
* const exportConfig: ExportExcelEvent = {
* sheetName: 'Property Data', // Specify the name of the Excel sheet
* workbookName: 'Properties.xlsx', // Name of the workbook file
* writingOptions: {
* type: 'file', // Output type
* bookType: 'xlsx', // Workbook type
* compression: true, // Enable compression
* ignoreEC: true, // Ignore Excel compatibility
* },
* };
*/
export type ExportExcelEvent = {
/** The name of the sheet within the workbook. */
sheetName?: string;
/** The name of the Excel workbook. Extensionless names receive `.xlsx`. */
workbookName?: string;
/** Export provider object or built-in provider id. */
provider?: ExcelExportProviderRef;
/**
* Optional one-off export transforms for the final provider context.
*
* These run after built-in feature transforms and after grid-level
* `grid.exportExcel.exportTransformers`. Use them for app-owned matrix
* formatting, provider options, or metadata that applies only to this export
* call and cannot live on a column definition.
*/
exportTransformers?: ExcelExportContextTransformer[];
/**
* Infer provider options such as column widths and sticky row/column counts
* from current grid state. Defaults to `true`.
*/
deriveGridOptions?: boolean;
/** Provider-specific options forwarded to the selected workbook provider. */
providerOptions?: Record<string, unknown>;
/** Options for how the selected provider writes the workbook file. */
writingOptions?: ExcelExportWritingOptions;
};

Primitive value shape accepted by the Excel export cell formatting pipeline.

/**
* Primitive value shape accepted by the Excel export cell formatting pipeline.
*/
export type ExcelExportCellValue = string | number | boolean | Date | null | undefined;

Workbook-oriented cell style options shared by the bundled writer and optional provider adapters.

Providers map this structural shape to their own workbook library. Unsupported fields can be ignored by custom providers without changing the export context.

/**
* Workbook-oriented cell style options shared by the bundled writer and optional
* provider adapters.
*
* Providers map this structural shape to their own workbook library. Unsupported
* fields can be ignored by custom providers without changing the export context.
*/
export type ExcelExportCellStyle = {
fontFamily?: string;
fontSize?: number;
fontWeight?: 'bold';
fontStyle?: 'italic';
textDecoration?: {
strikethrough?: boolean;
underline?: true;
doubleUnderline?: true;
};
textColor?: string;
backgroundColor?: string;
fillPatternStyle?: string;
fillPatternColor?: string;
borderColor?: string;
borderStyle?: string;
leftBorderColor?: string;
leftBorderStyle?: string;
rightBorderColor?: string;
rightBorderStyle?: string;
topBorderColor?: string;
topBorderStyle?: string;
bottomBorderColor?: string;
bottomBorderStyle?: string;
align?: 'left' | 'center' | 'right';
alignVertical?: 'top' | 'center' | 'bottom';
height?: number;
columnSpan?: number;
rowSpan?: number;
indent?: number;
wrap?: boolean;
textRotation?: number;
format?: string;
};

Provider-ready cell object used in ExcelExportProviderContext.cellRows.

Additional provider-specific fields are allowed so apps can add metadata for custom providers through column callbacks or export transformers.

/**
* Provider-ready cell object used in `ExcelExportProviderContext.cellRows`.
*
* Additional provider-specific fields are allowed so apps can add metadata for
* custom providers through column callbacks or export transformers.
*/
export type ExcelExportCell = ExcelExportCellStyle & {
value: ExcelExportCellValue;
[option: string]: unknown;
};

One matrix entry passed to workbook providers.

null and undefined are reserved for intentional blank cells or span placeholders created by feature-owned export transforms.

/**
* One matrix entry passed to workbook providers.
*
* `null` and `undefined` are reserved for intentional blank cells or span
* placeholders created by feature-owned export transforms.
*/
export type ExcelExportCellData = ExcelExportCell | null | undefined;

Return value accepted from column-level Excel export callbacks.

Return a primitive to replace the cell value, a partial cell object to apply value/style options, or undefined to keep the prepared cell unchanged.

/**
* Return value accepted from column-level Excel export callbacks.
*
* Return a primitive to replace the cell value, a partial cell object to apply
* value/style options, or `undefined` to keep the prepared cell unchanged.
*/
export type ExcelExportCellPropertiesResult =
| ExcelExportCellValue
| (Partial<ExcelExportCell> & Record<string, unknown>)
| void;

Context passed to column.excelExport.cellProperties for body and pinned rows during export preparation.

/**
* Context passed to `column.excelExport.cellProperties` for body and pinned
* rows during export preparation.
*/
export type ExcelExportCellPropertiesContext = {
value: ExcelExportCellValue;
rawValue: unknown;
model: DataType;
rowIndex: number;
rowType: DimensionRows;
column: ColumnRegular;
columnIndex: number;
revogrid: HTMLRevoGridElement;
providers: PluginProviders;
};

Context passed to column.excelExport.columnProperties for the generated column/header row.

/**
* Context passed to `column.excelExport.columnProperties` for the generated
* column/header row.
*/
export type ExcelExportColumnPropertiesContext = {
value: string;
column: ColumnRegular;
columnIndex: number;
revogrid: HTMLRevoGridElement;
providers: PluginProviders;
};

Column-level callback for formatting exported body or pinned-row cells.

/**
* Column-level callback for formatting exported body or pinned-row cells.
*/
export type ExcelExportCellProperties = (
context: ExcelExportCellPropertiesContext,
) => ExcelExportCellPropertiesResult;

Column-level callback for formatting the generated exported column/header cell.

/**
* Column-level callback for formatting the generated exported column/header
* cell.
*/
export type ExcelExportColumnProperties = (
context: ExcelExportColumnPropertiesContext,
) => ExcelExportCellPropertiesResult;

Excel export-only column options.

These options affect exported workbook cells only; rendered grid cells should use the normal RevoGrid cellTemplate and cellProperties APIs.

/**
* Excel export-only column options.
*
* These options affect exported workbook cells only; rendered grid cells should
* use the normal RevoGrid `cellTemplate` and `cellProperties` APIs.
*/
export type ExcelExportColumnOptions = {
/**
* Format or replace an exported body/pinned cell. Returning a cell object
* without `value` keeps the prepared value and applies the returned options.
*/
cellProperties?: ExcelExportCellProperties;
/**
* Format or replace the generated column/header cell for this column.
*/
columnProperties?: ExcelExportColumnProperties;
};

Built-in provider id for the bundled write-excel-file adapter.

WRITE_EXCEL_FILE_PROVIDER_ID: string;

export type BuiltInExcelExportProviderId = typeof WRITE_EXCEL_FILE_PROVIDER_ID;

Original source-row metadata paired with each exported data row.

Providers and transformers can use this to distinguish body, pinned-top, and pinned-bottom rows without reading rendered DOM state.

/**
* Original source-row metadata paired with each exported data row.
*
* Providers and transformers can use this to distinguish body, pinned-top, and
* pinned-bottom rows without reading rendered DOM state.
*/
export type ExcelExportSourceRow = {
model: DataType;
rowIndex: number;
rowType: DimensionRows;
};

Partial update returned by an ExcelExportContextTransformer.

Omitted fields leave the current export context unchanged. Returned cellRows replace the matrix, while option and metadata objects are merged with the existing context.

@public

/**
* Partial update returned by an `ExcelExportContextTransformer`.
*
* Omitted fields leave the current export context unchanged. Returned
* `cellRows` replace the matrix, while option and metadata objects are merged
* with the existing context.
*
* @public
*/
export type ExcelExportContextTransformResult = {
/**
* Replace the provider-ready matrix after export preparation.
*
* The matrix includes all generated header rows before source data rows.
*/
cellRows?: ExcelExportCellData[][];
/**
* Merge additional provider options into the export context.
*
* Use this for options consumed by the selected workbook provider.
*/
providerOptions?: Record<string, unknown>;
/**
* Merge derived grid options such as freeze panes or column widths.
*
* Provider implementations can combine these with explicit provider options.
*/
gridDerivedOptions?: Record<string, unknown>;
/**
* Merge provider-agnostic metadata for custom workbook providers.
*
* Built-in transforms use this to expose details such as grouped headers and
* cell merge ranges to providers that can map them natively.
*/
exportMetadata?: Record<string, unknown>;
};

Synchronous hook for the final Excel export context before provider output.

Transformers run after RevoGrid data collection, column/header formatting, and built-in Pro transforms. Grid-level transformers configured on grid.exportExcel.exportTransformers run first; one-off transformers passed to plugin.export({ exportTransformers }) run after them.

A transformer can mutate context directly, return a partial ExcelExportContextTransformResult, or do both. Use context.cellRows for provider-ready formatted output and context.rows only when plain row data is sufficient.

@public

/**
* Synchronous hook for the final Excel export context before provider output.
*
* Transformers run after RevoGrid data collection, column/header formatting,
* and built-in Pro transforms. Grid-level transformers configured on
* `grid.exportExcel.exportTransformers` run first; one-off transformers passed
* to `plugin.export({ exportTransformers })` run after them.
*
* A transformer can mutate `context` directly, return a partial
* `ExcelExportContextTransformResult`, or do both. Use `context.cellRows` for
* provider-ready formatted output and `context.rows` only when plain row data is
* sufficient.
*
* @public
*/
export type ExcelExportContextTransformer = (
context: ExcelExportProviderContext,
) => void | ExcelExportContextTransformResult;

Full provider handoff context created by ExportExcelPlugin.

Custom providers should consume this data-source-based context instead of reading rendered grid rows. Virtualized offscreen rows are included in rows, sourceRows, and cellRows.

/**
* Full provider handoff context created by `ExportExcelPlugin`.
*
* Custom providers should consume this data-source-based context instead of
* reading rendered grid rows. Virtualized offscreen rows are included in
* `rows`, `sourceRows`, and `cellRows`.
*/
export type ExcelExportProviderContext = {
/** Grid element that initiated the export. */
revogrid: HTMLRevoGridElement;
/** Runtime providers for advanced integrations that need grid stores or column metadata. */
providers: PluginProviders;
/** Original export call configuration, if provided. */
config?: ExportExcelEvent;
/** Excel-safe worksheet name after defaulting and normalization. */
sheetName: string;
/** Workbook filename after defaulting and extension normalization. */
workbookName: string;
/** Requested workbook type. The bundled provider accepts only `xlsx`. */
bookType: BookType;
/** Export columns in provider order, including pinned/start/body/end column segments. */
columns: ColumnRegular[];
/** Human-readable first row generated from column names. */
headerRow: string[];
/**
* Export data rows keyed by column prop.
*
* Rows are collected from the grid data stores in pinned-top, body,
* pinned-bottom order. This is data-source based and includes virtualized
* rows that may not be rendered in the DOM.
*
* Workbook providers that need formatting, spans, or grouped headers should
* prefer `cellRows`, which contains the provider-ready matrix.
*/
rows: DataType[];
/** Source row metadata in the same order as `rows`. */
sourceRows: ExcelExportSourceRow[];
/** Number of generated header rows before data rows in `cellRows`. */
headerRowsCount: number;
/** Provider-ready cell matrix with generated headers before data rows. */
cellRows: ExcelExportCellData[][];
/** Provider-specific options passed through from `ExportExcelEvent.providerOptions`. */
providerOptions?: Record<string, unknown>;
/**
* Provider options inferred from current grid state, such as column widths
* and pinned row/column freeze counts. Explicit `providerOptions` may
* override these in providers that support merging.
*/
gridDerivedOptions?: Record<string, unknown>;
/**
* Feature-owned metadata for custom providers. Built-in providers consume the
* prepared `cellRows`; optional providers may read metadata such as merge
* ranges or grouped header details when they can map them natively.
*/
exportMetadata?: Record<string, unknown>;
/** Workbook-library writing options passed through for optional adapters. */
writingOptions?: ExcelExportWritingOptions;
};

Workbook provider contract used by ExportExcelPlugin.

Implement this interface directly for app-owned workbook libraries or use one of the optional provider factories for common adapters.

/**
* Workbook provider contract used by `ExportExcelPlugin`.
*
* Implement this interface directly for app-owned workbook libraries or use one
* of the optional provider factories for common adapters.
*/
export type ExcelExportProvider = {
id?: string;
/**
* Writes or downloads an exported workbook.
*
* Providers receive prepared rows, columns, names, and options. They should
* not read rendered DOM rows because virtualization may omit offscreen data.
*/
export(context: ExcelExportProviderContext): void | Promise<void>;
};

Provider selection value accepted by ExportExcelEvent.provider and grid.exportExcel.exportProvider.

/**
* Provider selection value accepted by `ExportExcelEvent.provider` and
* `grid.exportExcel.exportProvider`.
*/
export type ExcelExportProviderRef = BuiltInExcelExportProviderId | ExcelExportProvider;

export type BookType = 'xlsx' | 'xlsm' | 'xlsb' | 'xls' | 'xla' | 'biff8' | 'biff5' | 'biff2' | 'xlml' | 'ods' | 'fods' | 'csv' | 'txt' | 'sylk' | 'slk' | 'html' | 'dif' | 'rtf' | 'prn' | 'eth' | 'dbf';

Basic File Properties

interface Properties {
/** Summary tab "Title" */
Title?: string;
/** Summary tab "Subject" */
Subject?: string;
/** Summary tab "Author" */
Author?: string;
/** Summary tab "Manager" */
Manager?: string;
/** Summary tab "Company" */
Company?: string;
/** Summary tab "Category" */
Category?: string;
/** Summary tab "Keywords" */
Keywords?: string;
/** Summary tab "Comments" */
Comments?: string;
/** Statistics tab "Last saved by" */
LastAuthor?: string;
/** Statistics tab "Created" */
CreatedDate?: Date
}

export type ExcelExportWritingOptions = {
/** Output data encoding */
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
/**
* Generate Shared String Table
* @default false
*/
bookSST?: boolean;
/**
* File format of generated workbook
* @default 'xlsx'
*/
bookType?: BookType;
/**
* Use ZIP compression for ZIP-based formats
* @default false
*/
compression?: boolean;
/**
* Suppress "number stored as text" errors in generated files
* @default true
*/
ignoreEC?: boolean;
/** Override workbook properties on save */
Props?: Properties;
/** Base64 encoding of NUMBERS base for exports */
numbers?: string;
};

Structural subset of the ExcelJS module consumed by createExcelJsExcelExportProvider().

RevoGrid Pro keeps ExcelJS optional. Callers pass their installed module into the provider factory so the Pro package does not add ExcelJS to every bundle.

/**
* Structural subset of the ExcelJS module consumed by
* `createExcelJsExcelExportProvider()`.
*
* RevoGrid Pro keeps ExcelJS optional. Callers pass their installed module into
* the provider factory so the Pro package does not add ExcelJS to every bundle.
*/
export type ExcelJsExcelExportModule = {
Workbook: new () => ExcelJsWorkbook;
};

export type ExcelJsWorkbook = {
addWorksheet(
sheetName: string,
options?: Record<string, unknown>,
): ExcelJsWorksheet;
xlsx: {
writeBuffer?(
writingOptions?: ExcelExportWritingOptions,
): Promise<ArrayBuffer | BlobPart> | ArrayBuffer | BlobPart;
writeFile?(
workbookName: string,
writingOptions?: ExcelExportWritingOptions,
): Promise<unknown> | unknown;
};
};

export type ExcelJsWorksheet = {
addRow(values: unknown[]): ExcelJsRow;
getColumn?(index: number): ExcelJsColumn;
mergeCells?(
startRow: number,
startColumn: number,
endRow: number,
endColumn: number,
): void;
views?: Record<string, unknown>[];
};

export type ExcelJsRow = {
getCell(index: number): ExcelJsCell;
height?: number;
};

export type ExcelJsCell = {
value?: unknown;
font?: Record<string, unknown>;
fill?: Record<string, unknown>;
alignment?: Record<string, unknown>;
border?: Record<string, unknown>;
numFmt?: string;
};

export type ExcelJsColumn = {
width?: number;
};

Structural subset of the SheetJS xlsx module consumed by createSheetJsExcelExportProvider().

RevoGrid Pro does not import or bundle SheetJS. Applications that need this adapter install xlsx themselves and pass the module object into the factory.

/**
* Structural subset of the SheetJS `xlsx` module consumed by
* `createSheetJsExcelExportProvider()`.
*
* RevoGrid Pro does not import or bundle SheetJS. Applications that need this
* adapter install `xlsx` themselves and pass the module object into the factory.
*/
export type SheetJsExcelExportModule = {
utils: {
book_new(): unknown;
json_to_sheet(
data: DataType[],
options?: Record<string, unknown>,
): unknown;
book_append_sheet(workbook: unknown, worksheet: unknown, sheetName: string): void;
};
writeFile(
workbook: unknown,
workbookName: string,
writingOptions?: ExcelExportWritingOptions,
): void;
};

Minimal workbook module adapter for libraries that can build a workbook from plain row objects.

This is intentionally smaller than the provider context. Use a custom ExcelExportProvider when a workbook library needs formatted cellRows, merge metadata, grouped headers, or library-specific setup.

/**
* Minimal workbook module adapter for libraries that can build a workbook from
* plain row objects.
*
* This is intentionally smaller than the provider context. Use a custom
* `ExcelExportProvider` when a workbook library needs formatted `cellRows`,
* merge metadata, grouped headers, or library-specific setup.
*/
export type WorkbookExportModule = {
createWorkbook(): unknown;
createWorksheet(
data: DataType[],
options?: Record<string, unknown>,
): unknown;
appendWorksheet(workbook: unknown, worksheet: unknown, sheetName: string): void;
writeFile(
workbook: unknown,
workbookName: string,
writingOptions?: ExcelExportWritingOptions,
): void;
};

Create a reusable excelExport.cellProperties callback for date columns.

The callback converts valid date-like values into Excel date cells and keeps empty, invalid, or unsupported values unchanged. Use this helper when you want to compose the callback into a larger column export configuration.

export function createDateExcelExportCellProperties(
options: DateColumnExcelExportOptions =;

Create column-level Excel export options for date columns.

Valid Date, ISO date-only strings, parseable date strings, and numeric date values are exported as workbook date cells with the configured format. Unsupported values are returned unchanged so the export pipeline keeps the source value instead of producing an invalid date.

export function createDateExcelExportColumnOptions(
options: DateColumnExcelExportOptions =;

Options for date-column Excel export helpers.

The helpers do not import @revolist/revogrid-column-date; callers pass column metadata and the desired workbook date format explicitly.

/**
* Options for date-column Excel export helpers.
*
* The helpers do not import `@revolist/revogrid-column-date`; callers pass
* column metadata and the desired workbook date format explicitly.
*/
export type DateColumnExcelExportOptions = {
/**
* Column metadata from the date column.
*
* Reserved for future date-package metadata while keeping a consistent
* options shape with other external column-type export helpers.
*/
column?: ColumnRegular;
/**
* Excel date number format applied to converted date cells.
*
* Defaults to `yyyy-mm-dd`.
*/
format?: string;
};

Create a reusable excelExport.cellProperties callback for numeral columns.

The callback converts finite numbers and numeric strings into Excel number cells, applies the inferred or explicit format, and right-aligns converted values. Non-numeric values are returned unchanged so the export pipeline preserves the original cell content.

export function createNumeralExcelExportCellProperties(
options: NumeralColumnExcelExportOptions =;

Create column-level Excel export options for numeral columns.

Use this when wiring an external numeral column type to Excel export through column.excelExport. The returned options contain the same callback as createNumeralExcelExportCellProperties.

export function createNumeralExcelExportColumnOptions(
options: NumeralColumnExcelExportOptions =;

Options for numeral-column Excel export helpers.

These helpers mirror the external numeral column type at export time without importing the column-type package. Pass the grid column and active columnTypes map when the export format should be inferred from runtime column-type metadata.

/**
* Options for numeral-column Excel export helpers.
*
* These helpers mirror the external numeral column type at export time without
* importing the column-type package. Pass the grid column and active
* `columnTypes` map when the export format should be inferred from runtime
* column-type metadata.
*/
export type NumeralColumnExcelExportOptions = {
/**
* Column metadata for the exported numeral column.
*
* When `format` is not provided, the helper reads `column.columnType` and
* looks for a matching `numberFormat` value in `columnTypes`.
*/
column?: ColumnRegular;
/**
* Grid column type registry used to infer the Excel number format.
*
* Only the matching column type's `numberFormat` string is read. Other
* metadata stays owned by the runtime column type.
*/
columnTypes?: ColumnTypes;
/**
* Excel number format applied to converted numeric cells.
*
* Defaults to the external numeral column type format, `0,0[.]00`.
*/
format?: string;
};

Create a reusable excelExport.cellProperties callback for select columns.

The callback exports the user-facing label for a stored select value. If no lookup or source match is available, the original value is converted to a supported Excel cell primitive and exported unchanged semantically.

export function createSelectExcelExportCellProperties(;

Create column-level Excel export options for select columns.

Use this when wiring an external select column type to Excel export through column.excelExport. The returned options contain the same callback as createSelectExcelExportCellProperties.

export function createSelectExcelExportColumnOptions(
options: SelectColumnExcelExportOptions,
): ExcelExportColumnOptions;

A select-column source entry that can be exported as either a direct label or an object resolved through labelKey and valueKey.

/**
* A select-column source entry that can be exported as either a direct label or
* an object resolved through `labelKey` and `valueKey`.
*/
export type SelectSourceEntry = string | Record<string, unknown>;

SelectColumnMetadata (Extended from index.ts)

Section titled “SelectColumnMetadata (Extended from index.ts)”

Minimal select-column metadata required to resolve exported labels.

The type intentionally captures only the public metadata used by the external select column type, allowing Excel export integrations to resolve labels without importing the select package.

/**
* Minimal select-column metadata required to resolve exported labels.
*
* The type intentionally captures only the public metadata used by the
* external select column type, allowing Excel export integrations to resolve
* labels without importing the select package.
*/
export type SelectColumnMetadata = ColumnRegular & {
/**
* Select options shown by the runtime column type.
*
* String entries are exported directly. Object entries are matched through
* `valueKey` and exported through `labelKey`.
*/
source?: SelectSourceEntry[];
/**
* Optional precomputed lookup by source value.
*
* When present, it is checked before scanning `source` and is useful for
* large option lists.
*/
sourceLookup?: Record<string, unknown>;
/**
* Object key that contains the human-readable export label.
*/
labelKey?: string;
/**
* Object key that contains the stored cell value.
*/
valueKey?: string;
};

Options for select-column Excel export helpers.

/**
* Options for select-column Excel export helpers.
*/
export type SelectColumnExcelExportOptions = {
/**
* Select column metadata used to translate stored values into labels.
*/
column: SelectColumnMetadata;
};

export type ExcelConfig = {
/** Allow CSV drag and drop files to the grid area. Default: `true`. */
allowDrag?: boolean;
/**
* Grid-level default export provider.
*
* `plugin.export({ provider })` still wins for one-off exports. When omitted,
* the bundled `write-excel-file` provider is used.
*/
exportProvider?: ExcelExportProviderRef;
/**
* Grid-level Excel export transforms for every export call.
*
* These run after the plugin prepares the provider context and applies
* built-in Pro transforms, but before one-off
* `plugin.export({ exportTransformers })` transforms. Use them for
* application-wide workbook formatting, provider-option defaults, or
* provider metadata that should apply consistently to all Excel exports.
*/
exportTransformers?: ExcelExportContextTransformer[];
/**
* Keep existing grid columns during CSV import instead of generating columns
* from the first CSV row. Default: `false`.
*/
skipColumnGeneration?: boolean;
/** Allowed file extensions for CSV import. Default: `['.csv']`. */
allowedExtensions?: string[];
};