Missing TypeScript types for files and Directory in WorkBook #3317

Open
opened 2025-07-31 14:27:47 +00:00 by azuziii · 1 comment

When using the bookFiles: true option, the returned Workbook object contains a files property. However, this property is not defined in the WorkBook TypeScript interface. It also contains a Directory property, but its type is missing too.

When using the `bookFiles: true` option, the returned Workbook object contains a files property. However, this property is not defined in the WorkBook TypeScript interface. It also contains a Directory property, but its type is missing too.
Owner

The current behavior of bookFiles is filetype-dependent. For XLSX and other ZIP-based formats, the keys property is a list of entry names (string[]) and the files property is an object whose keys are path names (the names from the keys array) and whose values are entry objects from the cfb project Once we unify the interpretation across formats, we'll add type definitions.

Do not rely on Directory, as it is an internal structure that will eventually be removed from the workbook object.

The current behavior of `bookFiles` is filetype-dependent. For XLSX and other ZIP-based formats, the `keys` property is a list of entry names (`string[]`) and the `files` property is an object whose keys are path names (the names from the `keys` array) and whose values are entry objects [from the `cfb` project](https://git.sheetjs.com/sheetjs/js-cfb) Once we unify the interpretation across formats, we'll add type definitions. Do not rely on `Directory`, as it is an internal structure that will eventually be removed from the workbook object.
Sign in to join this conversation.
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#3317
No description provided.