xlsx-populate-types
v1.21.4
Published
TypeScript definitions for XLSX-Populate
Maintainers
Readme
xlsx-populate-types
TypeScript declarations for XLSX-Populate, an XLSX parser and generator for Node.js and browsers.
This package contains types only. Install xlsx-populate separately for the runtime implementation.
Installation
npm install xlsx-populate
npm install --save-dev xlsx-populate-typesLoad the declarations through compilerOptions.types:
{
"compilerOptions": {
"types": ["node", "xlsx-populate-types"]
}
}If your project already has a types array, append xlsx-populate-types instead of replacing the existing entries. You can also load the package from a single entry point:
/// <reference types="xlsx-populate-types" />Then import the runtime package normally:
import XlsxPopulate = require('xlsx-populate')
async function createWorkbook(): Promise<Buffer> {
const workbook = await XlsxPopulate.fromBlankAsync()
const sheet = workbook.sheet(0)
if (!sheet) {
throw new Error('The workbook has no sheets')
}
sheet
.cell('A1')
.value('Hello from TypeScript')
.style({ bold: true, fontColor: '0563C1' })
return workbook.outputAsync('nodebuffer')
}Included API
The declarations cover the public XLSX-Populate 1.21 API, including:
- workbook, sheet, row, column, cell, and range operations
- values, formulas, defined names, hyperlinks, and data validation
- styles, fills, borders, colors, and number formats
- rich text and formula errors
- panes, print options, page margins, and page breaks
- Node.js and browser input/output types
Refer to the XLSX-Populate documentation for runtime behavior and examples.
Versioning
The package version follows the supported XLSX-Populate release. For example, [email protected] targets [email protected]. Patch releases of this package improve declarations and documentation without changing the runtime library.
Development
npm ci
npm testnpm test compiles positive and negative type assertions with strict TypeScript settings and validates the npm package structure with publint. Pull requests also run the suite on supported Node.js versions through GitHub Actions.
When reporting a type mismatch, include a small TypeScript example and a link to the corresponding XLSX-Populate API or implementation.
Status
These declarations are maintained independently from XLSX-Populate. If an API is missing or its runtime behavior differs from the declared type, please open an issue.
License
MIT. XLSX-Populate is a separate project distributed under its own MIT license.
