Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix type definitions about last column, formula values and protection #2309

Merged
merged 4 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ export interface Font {
}

export type BorderStyle =
| 'thin' | 'dotted' | 'hair' | 'medium' | 'double' | 'thick' | 'dashDot'
| 'thin' | 'dotted' | 'hair' | 'medium' | 'double' | 'thick' | 'dashed' | 'dashDot'
| 'dashDotDot' | 'slantDashDot' | 'mediumDashed' | 'mediumDashDotDot' | 'mediumDashDot';

export interface Color {
Expand Down Expand Up @@ -289,6 +289,7 @@ export interface Alignment {

export interface Protection {
locked: boolean;
hidden: boolean;
}

export interface Style {
Expand Down Expand Up @@ -349,15 +350,15 @@ export interface CellHyperlinkValue {

export interface CellFormulaValue {
formula: string;
result?: number | string | Date | { error: CellErrorValue };
date1904: boolean;
result?: number | string | boolean | Date | CellErrorValue;
date1904?: boolean;
}

export interface CellSharedFormulaValue {
sharedFormula: string;
readonly formula?: string;
result?: number | string | Date | { error: CellErrorValue };
date1904: boolean;
result?: number | string | boolean | Date | CellErrorValue;
date1904?: boolean;
}

export declare enum ValueType {
Expand Down Expand Up @@ -1140,7 +1141,7 @@ export interface Worksheet {
/**
* Get the last column in a worksheet
*/
readonly lastColumn: Column;
readonly lastColumn: Column | undefined;

/**
* A count of the number of columns that have values.
Expand Down Expand Up @@ -2022,4 +2023,4 @@ export namespace stream {
getColumn(c: number): Column;
}
}
}
}
1 change: 1 addition & 0 deletions lib/xlsx/xform/style/border-xform.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ class EdgeXform extends BaseXform {

EdgeXform.validStyleValues = [
'thin',
'dashed',
'dotted',
'dashDot',
'hair',
Expand Down
Loading