sheet_get_cell is neither documented nor typed #3209

Open
opened 2024-09-11 09:56:06 +00:00 by yf-yang · 1 comment
Contributor

Is it a stable utility? I find it has been there since 0.15. Should we declare it in the typescript signature file?

Is it a stable utility? I find it has been there since 0.15. Should we declare it in the typescript signature file?
Owner

It was added to support some operations that needed to add to cells that may or may not exist. The original goal was to support both sparse and dense worksheets.

The type signature for the current implementation would be something like:

    /** Get cell object for specified address, creating a new stub cell if necessary */
    sheet_get_cell(worksheet: WorkSheet, addr: CellAddress | string): CellObject;
    sheet_get_cell(worksheet: WorkSheet, R: number, C: number): CellObject;

Before updating the types, we should probably discuss what this function should do. Should the default behavior (creating cell stubs) be the default? Should there be an option to throw an error or return null if the cell does not exist?

PS: In general, we try hard not to remove any methods (and if we do remove something, it will involve a major or minor version bump)

It was added to support some operations that needed to add to cells that may or may not exist. The original goal was to support both sparse and dense worksheets. The type signature for the current implementation would be something like: ```ts /** Get cell object for specified address, creating a new stub cell if necessary */ sheet_get_cell(worksheet: WorkSheet, addr: CellAddress | string): CellObject; sheet_get_cell(worksheet: WorkSheet, R: number, C: number): CellObject; ``` Before updating the types, we should probably discuss what this function should do. Should the default behavior (creating cell stubs) be the default? Should there be an option to throw an error or return `null` if the cell does not exist? PS: In general, we try hard not to remove any methods (and if we do remove something, it will involve a major or minor version bump)
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#3209
No description provided.