Skip to content

Commit bd317db

Browse files
authored
fix: fix type definitions about last column, formula values and protection (#2309)
* fix: fix type definitions about last column, formula values and protection * fix: add boolean type to formula value result * add support for dashed `BorderStyle`
1 parent b392ec5 commit bd317db

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

index.d.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ export interface Font {
230230
}
231231

232232
export type BorderStyle =
233-
| 'thin' | 'dotted' | 'hair' | 'medium' | 'double' | 'thick' | 'dashDot'
233+
| 'thin' | 'dotted' | 'hair' | 'medium' | 'double' | 'thick' | 'dashed' | 'dashDot'
234234
| 'dashDotDot' | 'slantDashDot' | 'mediumDashed' | 'mediumDashDotDot' | 'mediumDashDot';
235235

236236
export interface Color {
@@ -289,6 +289,7 @@ export interface Alignment {
289289

290290
export interface Protection {
291291
locked: boolean;
292+
hidden: boolean;
292293
}
293294

294295
export interface Style {
@@ -349,15 +350,15 @@ export interface CellHyperlinkValue {
349350

350351
export interface CellFormulaValue {
351352
formula: string;
352-
result?: number | string | Date | { error: CellErrorValue };
353-
date1904: boolean;
353+
result?: number | string | boolean | Date | CellErrorValue;
354+
date1904?: boolean;
354355
}
355356

356357
export interface CellSharedFormulaValue {
357358
sharedFormula: string;
358359
readonly formula?: string;
359-
result?: number | string | Date | { error: CellErrorValue };
360-
date1904: boolean;
360+
result?: number | string | boolean | Date | CellErrorValue;
361+
date1904?: boolean;
361362
}
362363

363364
export declare enum ValueType {
@@ -1140,7 +1141,7 @@ export interface Worksheet {
11401141
/**
11411142
* Get the last column in a worksheet
11421143
*/
1143-
readonly lastColumn: Column;
1144+
readonly lastColumn: Column | undefined;
11441145

11451146
/**
11461147
* A count of the number of columns that have values.
@@ -2022,4 +2023,4 @@ export namespace stream {
20222023
getColumn(c: number): Column;
20232024
}
20242025
}
2025-
}
2026+
}

lib/xlsx/xform/style/border-xform.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ class EdgeXform extends BaseXform {
8989

9090
EdgeXform.validStyleValues = [
9191
'thin',
92+
'dashed',
9293
'dotted',
9394
'dashDot',
9495
'hair',

0 commit comments

Comments
 (0)