-
-
Notifications
You must be signed in to change notification settings - Fork 32
/
index.d.ts
2614 lines (2445 loc) · 98.8 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Copyright 2022 - 2023 The excelize-wasm Authors. All rights reserved. Use of
// this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//
// Package excelize providing a set of functions that allow you to write to and
// read from XLAM / XLSM / XLSX / XLTM / XLTX files. Supports reading and
// writing spreadsheet documents generated by Microsoft Excel™ 2007 and later.
// Supports complex components by high compatibility.
//
// Type definitions for excelize-wasm
declare module 'excelize-wasm' {
/**
* AppProperties directly maps the document application properties.
*/
export type AppProperties = {
Application?: string;
ScaleCrop?: boolean;
DocSecurity?: number;
Company?: string;
LinksUpToDate?: boolean;
HyperlinksChanged?: boolean;
AppVersion?: string;
};
/**
* This section defines the currently supported country code types
* enumeration for apply number format.
*/
export enum CultureName {
CultureNameUnknown,
CultureNameEnUS,
CultureNameZhCN,
}
/**
* Options define the options for o`pen and reading spreadsheet.
*
* MaxCalcIterations specifies the maximum iterations for iterative
* calculation, the default value is 0.
*
* Password specifies the password of the spreadsheet in plain text.
*
* RawCellValue specifies if apply the number format for the cell value or get
* the raw value.
*
* UnzipSizeLimit specifies the unzip size limit in bytes on open the
* spreadsheet, this value should be greater than or equal to
* UnzipXMLSizeLimit, the default size limit is 16GB.
*
* UnzipXMLSizeLimit specifies the memory limit on unzipping worksheet and
* shared string table in bytes, worksheet XML will be extracted to system
* temporary directory when the file size is over this value, this value
* should be less than or equal to UnzipSizeLimit, the default value is
* 16MB.
*
* ShortDatePattern specifies the short date number format code. In the
* spreadsheet applications, date formats display date and time serial numbers
* as date values. Date formats that begin with an asterisk (*) respond to
* changes in regional date and time settings that are specified for the
* operating system. Formats without an asterisk are not affected by operating
* system settings. The ShortDatePattern used for specifies apply date formats
* that begin with an asterisk.
*
* LongDatePattern specifies the long date number format code.
*
* LongTimePattern specifies the long time number format code.
*
* CultureInfo specifies the country code for applying built-in language number
* format code these effect by the system's local language settings.
*/
export type Options = {
MaxCalcIterations?: number;
Password?: string;
RawCellValue?: boolean;
UnzipSizeLimit?: number;
UnzipXMLSizeLimit?: number;
ShortDatePattern?: string;
LongDatePattern?: string;
LongTimePattern?: string;
CultureInfo?: CultureName;
};
/**
* Border directly maps the border settings of the cells.
*/
export type Border = {
Type?: string;
Color?: string;
Style?: number;
};
/**
* Fill directly maps the fill settings of the cells.
*/
export type Fill = {
Type?: string;
Pattern?: number;
Color?: string[];
Shading?: number;
};
/**
* Font directly maps the font settings of the fonts.
*/
export type Font = {
Bold?: boolean;
Italic?: boolean;
Underline?: string;
Family?: string;
Size?: number;
Strike?: boolean;
Color?: string;
ColorIndexed?: number;
ColorTheme?: number;
ColorTint?: number;
VertAlign?: string;
};
/**
* Alignment directly maps the alignment settings of the cells.
*/
export type Alignment = {
Horizontal?: string;
Indent?: number;
JustifyLastLine?: boolean;
ReadingOrder?: number;
RelativeIndent?: number;
ShrinkToFit?: boolean;
TextRotation?: number;
Vertical?: string;
WrapText?: boolean;
};
/**
* Protection directly maps the protection settings of the cells.
*/
export type Protection = {
Hidden?: boolean;
Locked?: boolean;
};
/**
* Style directly maps the style settings of the cells.
*/
export type Style = {
Border?: Border[];
Fill?: Fill;
Font?: Font;
Alignment?: Alignment;
Protection?: Protection;
NumFmt?: number;
DecimalPlaces?: number;
CustomNumFmt?: string;
NegRed?: boolean;
};
/**
* PaneOptions directly maps the settings of the pane.
*/
export type PaneOptions = {
SQRef?: string;
ActiveCell?: string;
Pane?: string;
};
/**
* Panes directly maps the settings of the panes.
*/
export type Panes = {
Freeze?: boolean;
Split?: boolean;
XSplit?: number;
YSplit?: number;
TopLeftCell?: string;
ActivePane?: string;
Panes?: PaneOptions[];
};
/**
* ConditionalFormatOptions directly maps the conditional format settings of
* the cells.
*/
export type ConditionalFormatOptions = {
Type?: string;
AboveAverage?: boolean;
Percent?: boolean;
Format?: number;
Criteria?: string;
Value?: string;
MinType?: string;
MidType?: string;
MaxType?: string;
MinValue?: string;
MidValue?: string;
MaxValue?: string;
MinColor?: string;
MidColor?: string;
MaxColor?: string;
BarColor?: string;
BarBorderColor?: string;
BarDirection?: string;
BarOnly?: boolean;
BarSolid?: boolean;
IconStyle?: string;
ReverseIcons?: boolean;
IconsOnly?: boolean;
StopIfTrue?: boolean;
};
/**
* Shape directly maps the format settings of the shape.
*/
export type Shape = {
Macro?: string;
Type?: string;
Width?: number;
Height?: number;
Format?: GraphicOptions;
Color?: ShapeColor;
Line?: ShapeLine;
Paragraph?: ShapeParagraph[];
};
/**
* ShapeParagraph directly maps the format settings of the paragraph in the
* shape.
*/
export type ShapeParagraph = {
Font?: Font;
Text?: string;
};
/**
* ShapeColor directly maps the color settings of the shape.
*/
export type ShapeColor = {
Line?: string;
Fill?: string;
Effect?: string;
};
/**
* ShapeLine directly maps the line settings of the shape.
*/
export type ShapeLine = {
Width?: number;
};
/**
* SparklineOptions directly maps the settings of the sparkline.
*/
export type SparklineOptions = {
Location?: string[];
Range?: string[];
Max?: number;
CustMax?: number;
Min?: number;
CustMin?: number;
Type?: string;
Weight?: number;
DateAxis?: boolean;
Markers?: boolean;
High?: boolean;
Low?: boolean;
First?: boolean;
Last?: boolean;
Negative?: boolean;
Axis?: boolean;
Hidden?: boolean;
Reverse?: boolean;
Style?: number;
SeriesColor?: string;
NegativeColor?: string;
MarkersColor?: string;
FirstColor?: string;
LastColor?: string;
HightColor?: string;
LowColor?: string;
EmptyCells?: string;
};
/**
* GraphicOptions directly maps the format settings of the picture.
*/
export type GraphicOptions = {
AltText?: string;
PrintObject?: boolean;
Locked?: boolean;
LockAspectRatio?: boolean;
AutoFit?: boolean;
OffsetX?: number;
OffsetY?: number;
ScaleX?: number;
ScaleY?: number;
Hyperlink?: string;
HyperlinkType?: string;
Positioning?: string;
};
/**
* TableOptions directly maps the format settings of the table.
*/
export type TableOptions = {
Range: string;
Name?: string;
StyleName?: string;
ShowFirstColumn?: boolean;
ShowLastColumn?: boolean;
ShowRowStripes?: boolean;
ShowColumnStripes?: boolean;
};
/**
* AutoFilterOptions directly maps the auto filter settings.
*/
export type AutoFilterOptions = {
Column?: string;
Expression?: string;
};
/**
* ChartAxis directly maps the format settings of the chart axis.
*/
export type ChartAxis = {
None?: boolean;
MajorGridLines?: boolean;
MinorGridLines?: boolean;
MajorUnit?: number;
TickLabelSkip?: number;
ReverseOrder?: boolean;
Maximum?: number;
Minimum?: number;
Font?: Font;
LogBase?: number;
};
/**
* ChartDimension directly maps the dimension of the chart.
*/
export type ChartDimension = {
Width?: number;
Height?: number;
};
/**
* ChartPlotArea directly maps the format settings of the plot area.
*/
export type ChartPlotArea = {
ShowBubbleSize?: boolean;
ShowCatName?: boolean;
ShowLeaderLines?: boolean;
ShowPercent?: boolean;
ShowSerName?: boolean;
ShowVal?: boolean;
};
/**
* ChartType defines the currently supported chart types enumeration.
*/
export enum ChartType {
Area,
AreaStacked,
AreaPercentStacked,
Area3D,
Area3DStacked,
Area3DPercentStacked,
Bar,
BarStacked,
BarPercentStacked,
Bar3DClustered,
Bar3DStacked,
Bar3DPercentStacked,
Bar3DConeClustered,
Bar3DConeStacked,
Bar3DConePercentStacked,
Bar3DPyramidClustered,
Bar3DPyramidStacked,
Bar3DPyramidPercentStacked,
Bar3DCylinderClustered,
Bar3DCylinderStacked,
Bar3DCylinderPercentStacked,
Col,
ColStacked,
ColPercentStacked,
Col3D,
Col3DClustered,
Col3DStacked,
Col3DPercentStacked,
Col3DCone,
Col3DConeClustered,
Col3DConeStacked,
Col3DConePercentStacked,
Col3DPyramid,
Col3DPyramidClustered,
Col3DPyramidStacked,
Col3DPyramidPercentStacked,
Col3DCylinder,
Col3DCylinderClustered,
Col3DCylinderStacked,
Col3DCylinderPercentStacked,
Doughnut,
Line,
Line3D,
Pie,
Pie3D,
PieOfPie,
BarOfPie,
Radar,
Scatter,
Surface3D,
WireframeSurface3D,
Contour,
WireframeContour,
Bubble,
Bubble3D,
}
/**
* Chart directly maps the format settings of the chart.
*/
export type Chart = {
Type: ChartType;
Series?: ChartSeries[];
Format?: GraphicOptions;
Dimension?: ChartDimension;
Legend?: ChartLegend;
Title?: ChartTitle;
VaryColors?: boolean;
XAxis?: ChartAxis;
YAxis?: ChartAxis;
PlotArea?: ChartPlotArea;
ShowBlanksAs?: string;
HoleSize?: number;
};
/**
* ChartLegend directly maps the format settings of the chart legend.
*/
export type ChartLegend = {
Position?: string
ShowLegendKey?: boolean;
};
/**
* ChartMarker directly maps the format settings of the chart marker.
*/
export type ChartMarker = {
Symbol?: string;
Size?: number;
};
/**
* ChartLine directly maps the format settings of the chart line.
*/
export type ChartLine = {
Color?: string
Smooth?: boolean;
Width?: number;
};
/**
* ChartSeries directly maps the format settings of the chart series.
*/
export type ChartSeries = {
Name?: string;
Categories?: string;
Values?: string;
Line?: ChartLine;
Marker?: ChartMarker;
};
/**
* ChartTitle directly maps the format settings of the chart title.
*/
export type ChartTitle = {
Name?: string;
};
/**
* PivotTableOptions directly maps the format settings of the pivot table.
*
* PivotTableStyleName: The built-in pivot table style names
*
* PivotStyleLight1 - PivotStyleLight28
* PivotStyleMedium1 - PivotStyleMedium28
* PivotStyleDark1 - PivotStyleDark28
*/
export type PivotTableOptions = {
DataRange?: string;
PivotTableRange?: string;
Rows?: PivotTableField[];
Columns?: PivotTableField[];
Data?: PivotTableField[];
Filter?: PivotTableField[];
RowGrandTotals?: boolean;
ColGrandTotals?: boolean;
ShowDrill?: boolean;
UseAutoFormatting?: boolean;
PageOverThenDown?: boolean;
MergeItem?: boolean;
CompactData ?: boolean;
ShowError?: boolean;
ShowRowHeaders?: boolean;
ShowColHeaders?: boolean;
ShowRowStripes?: boolean;
ShowColStripes?: boolean;
ShowLastColumn?: boolean;
PivotTableStyleName?: string;
};
/**
* PivotTableField directly maps the field settings of the pivot table.
* Subtotal specifies the aggregation function that applies to this data
* field. The default value is sum. The possible values for this attribute
* are:
*
* Average
* Count
* CountNums
* Max
* Min
* Product
* StdDev
* StdDevp
* Sum
* Var
* Varp
*
* Name specifies the name of the data field. Maximum 255 characters
* are allowed in data field name, excess characters will be truncated.
*/
export type PivotTableField = {
Compact?: boolean;
Data?: string;
Name?: string;
Outline?: boolean;
Subtotal?: string;
DefaultSubtotal?: boolean;
};
/**
* Comment directly maps the comment information.
*/
export type Comment = {
Author?: string;
AuthorID?: number;
Cell?: string;
Text?: string;
Runs?: RichTextRun[];
};
/**
* Picture maps the format settings of the picture.
*/
export type Picture = {
Extension: string;
File: Uint8Array[];
Format: GraphicOptions;
};
/**
* DataValidation directly maps the a single item of data validation defined
* on a range of the worksheet.
*/
export type DataValidation = {
AllowBlank?: boolean;
Error?: string;
ErrorStyle?: string;
ErrorTitle?: string;
Operator?: string
Prompt?: string;
PromptTitle?: string;
ShowDropDown?: boolean;
ShowErrorMessage?: boolean;
ShowInputMessage?: boolean;
Sqref?: string;
Type?: string;
Formula1?: string;
Formula2?: string;
};
/**
* RichTextRun directly maps the settings of the rich text run.
*/
export type RichTextRun = {
Font?: Font;
Text?: string;
};
/**
* FormulaOptions can be passed to SetCellFormula to use other formula types.
*/
export type FormulaOptions = {
Ref?: string;
Type?: string;
};
/**
* HyperlinkOpts can be passed to SetCellHyperlink to set optional hyperlink
* attributes (e.g. display value).
*/
export type HyperlinkOpts = {
Display?: string;
Tooltip?: string;
};
/**
* SheetProtectionOptions directly maps the settings of worksheet protection.
*/
export type SheetProtectionOptions = {
AlgorithmName?: string;
AutoFilter?: boolean;
DeleteColumns?: boolean;
DeleteRows?: boolean;
EditObjects?: boolean;
EditScenarios?: boolean;
FormatCells?: boolean;
FormatColumns?: boolean;
FormatRows?: boolean;
InsertColumns?: boolean;
InsertHyperlinks?: boolean;
InsertRows?: boolean;
Password?: string;
PivotTables?: boolean;
SelectLockedCells?: boolean;
SelectUnlockedCells?: boolean;
Sort?: boolean;
};
/**
* DefinedName directly maps the name for a cell or cell range on a
* worksheet.
*/
export type DefinedName = {
Name?: string;
Comment?: string;
RefersTo?: string;
Scope?: string;
};
/**
* DocProperties directly maps the document core properties.
*/
export type DocProperties = {
Category?: string;
ContentStatus?: string;
Created?: string;
Creator?: string;
Description?: string;
Identifier?: string;
Keywords?: string;
LastModifiedBy?: string;
Modified?: string;
Revision?: string;
Subject?: string;
Title?: string;
Language?: string;
Version?: string;
};
/**
* HeaderFooterOptions directly maps the settings of header and footer.
*/
export type HeaderFooterOptions = {
AlignWithMargins?: boolean;
DifferentFirst?: boolean;
DifferentOddEven?: boolean;
ScaleWithDoc?: boolean;
OddHeader?: string;
OddFooter?: string;
EvenHeader?: string;
EvenFooter?: string;
FirstHeader?: string;
FirstFooter?: string;
};
/**
* PageLayoutOptions directly maps the settings of page layout.
*/
export type PageLayoutOptions = {
// Size defines the paper size of the worksheet.
Size?: number;
// Orientation defines the orientation of page layout for a worksheet.
Orientation?: string;
// FirstPageNumber specified the first printed page number. If no value is
// specified, then 'automatic' is assumed.
FirstPageNumber?: number;
// AdjustTo defines the print scaling. This attribute is restricted to
// value ranging from 10 (10%) to 400 (400%). This setting is overridden
// when fitToWidth and/or fitToHeight are in use.
AdjustTo?: number;
// FitToHeight specified the number of vertical pages to fit on.
FitToHeight?: number;
// FitToWidth specified the number of horizontal pages to fit on.
FitToWidth?: number;
// BlackAndWhite specified print black and white.
BlackAndWhite?: boolean;
};
// PageLayoutMarginsOptions directly maps the settings of page layout margins.
export type PageLayoutMarginsOptions = {
Bottom?: number;
Footer?: number;
Header?: number;
Left?: number;
Right?: number;
Top?: number;
Horizontally?: boolean;
Vertically?: boolean;
};
// SheetPropsOptions directly maps the settings of sheet view.
export type SheetPropsOptions = {
// Specifies a stable name of the sheet, which should not change over time,
// and does not change from user input. This name should be used by code
// to reference a particular sheet.
CodeName?: string;
// EnableFormatConditionsCalculation indicating whether the conditional
// formatting calculations shall be evaluated. If set to false, then the
// min/max values of color scales or data bars or threshold values in Top N
// rules shall not be updated. Essentially the conditional
// formatting "calc" is off.
EnableFormatConditionsCalculation?: boolean;
// Published indicating whether the worksheet is published.
Published?: boolean;
// AutoPageBreaks indicating whether the sheet displays Automatic Page
// Breaks.
AutoPageBreaks?: boolean;
// FitToPage indicating whether the Fit to Page print option is enabled.
FitToPage?: boolean;
// TabColorIndexed represents the indexed color value.
TabColorIndexed?: number;
// TabColorRGB represents the standard Alpha Red Green Blue color value.
TabColorRGB?: string;
// TabColorTheme represents the zero-based index into the collection,
// referencing a particular value expressed in the Theme part.
TabColorTheme?: number;
// TabColorTint specifies the tint value applied to the color.
TabColorTint?: number;
// OutlineSummaryBelow indicating whether summary rows appear below detail
// in an outline, when applying an outline.
OutlineSummaryBelow?: boolean;
// OutlineSummaryRight indicating whether summary columns appear to the
// right of detail in an outline, when applying an outline.
OutlineSummaryRight?: boolean;
// BaseColWidth specifies the number of characters of the maximum digit
// width of the normal style's font. This value does not include margin
// padding or extra padding for grid lines. It is only the number of
// characters.
BaseColWidth?: number;
// DefaultColWidth specifies the default column width measured as the
// number of characters of the maximum digit width of the normal style's
// font.
DefaultColWidth?: number;
// DefaultRowHeight specifies the default row height measured in point
// size. Optimization so we don't have to write the height on all rows.
// This can be written out if most rows have custom height, to achieve the
// optimization.
DefaultRowHeight?: number;
// CustomHeight specifies the custom height.
CustomHeight?: boolean;
// ZeroHeight specifies if rows are hidden.
ZeroHeight?: boolean;
// ThickTop specifies if rows have a thick top border by default.
ThickTop?: boolean;
// ThickBottom specifies if rows have a thick bottom border by default.
ThickBottom?: boolean;
};
export type ViewOptions = {
// DefaultGridColor indicating that the consuming application should use
// the default grid lines color(system dependent). Overrides any color
// specified in colorId.
DefaultGridColor?: boolean;
// RightToLeft indicating whether the sheet is in 'right to left' display
// mode. When in this mode, Column A is on the far right, Column B; is one
// column left of Column A, and so on. Also, information in cells is
// displayed in the Right to Left format.
RightToLeft?: boolean;
// ShowFormulas indicating whether this sheet should display formulas.
ShowFormulas?: boolean;
// ShowGridLines indicating whether this sheet should display grid lines.
ShowGridLines?: boolean;
// ShowRowColHeaders indicating whether the sheet should display row and
// column headings.
ShowRowColHeaders?: boolean;
// ShowRuler indicating this sheet should display ruler.
ShowRuler?: boolean;
// ShowZeros indicating whether to "show a zero in cells that have zero
// value". When using a formula to reference another cell which is empty,
// the referenced value becomes 0 when the flag is true. (Default setting
// is true.)
ShowZeros?: boolean;
// TopLeftCell specifies a location of the top left visible cell Location
// of the top left visible cell in the bottom right pane (when in
// Left-to-Right mode).
TopLeftCell: string;
// View indicating how sheet is displayed, by default it uses empty string
// available options: normal, pageLayout, pageBreakPreview
View: string;
// ZoomScale specifies a window zoom magnification for current view
// representing percent values. This attribute is restricted to values
// ranging from 10 to 400. Horizontal & Vertical scale together.
ZoomScale?: number;
};
/**
* WorkbookPropsOptions directly maps the settings of workbook proprieties.
*/
export type WorkbookPropsOptions = {
Date1904?: boolean;
FilterPrivacy?: boolean;
CodeName?: string;
};
/**
* WorkbookProtectionOptions directly maps the settings of workbook
* protection.
*/
export type WorkbookProtectionOptions = {
AlgorithmName?: string;
Password?: string;
LockStructure?: boolean;
LockWindows?: boolean;
};
/**
* CellNameToCoordinates converts alphanumeric cell name to [X, Y]
* coordinates or returns an error.
* @param cell The cell reference
*/
export function CellNameToCoordinates(cell: string): { col: number, row: number, error: string | null }
/**
* ColumnNameToNumber provides a function to convert Excel sheet column name
* (case-insensitive) to int. The function returns an error if column name
* incorrect.
* @param name The column name
*/
export function ColumnNameToNumber(name: string): { col: number, error: string | null }
/**
* ColumnNumberToName provides a function to convert the integer to Excel
* sheet column title.
* @param num The column name
*/
export function ColumnNumberToName(num: number): { col: string, error: string | null }
/**
* CoordinatesToCellName converts [X, Y] coordinates to alpha-numeric cell
* name or returns an error.
* @param col The column number
* @param row The row number
* @param abs Specifies the absolute cell references
*/
export function CoordinatesToCellName(col: number, row: number, abs?: boolean): { cell: string, error: string | null }
/**
* HSLToRGB converts an HSL triple to a RGB triple.
* @param h Hue
* @param s Saturation
* @param l Lightness
*/
export function HSLToRGB(h: number, s: number, l: number): { r: number, g: number, b: number, error: string | null }
/**
* JoinCellName joins cell name from column name and row number.
* @param col The column name
* @param row The row number
*/
export function JoinCellName(col: string, row: number): { cell: string, error: string | null }
/**
* RGBToHSL converts an RGB triple to a HSL triple.
* @param r Red
* @param g Green
* @param b Blue
*/
export function RGBToHSL(r: number, g: number, b: number): { h: number, s: number, l: number, error: string | null }
/**
* SplitCellName splits cell name to column name and row number.
* @param cell The cell reference
*/
export function SplitCellName(cell: string): { col: string, row: number, error: string | null }
/**
* ThemeColor applied the color with tint value.
* @param baseColor Base color in hex format
* @param tint A mixture of a color with white
*/
export function ThemeColor(baseColor: string, tint: number): { color: string, error: string | null }
/**
* NewFile provides a function to create new file by default template.
* @param opts The options for open and reading spreadsheet
*/
export function NewFile(opts?: Options): NewFile;
/**
* OpenReader read data stream from buffer and return a populated spreadsheet
* file.
* @param r The contents buffer of the file
* @param opts The options for open and reading spreadsheet
*/
export function OpenReader(r: Uint8Array[], opts?: Options): NewFile;
/**
* @constructor
*/
export class NewFile {
/**
* AddChart provides the method to add chart in a sheet by given chart
* format set (such as offset, scale, aspect ratio setting and print
* settings) and properties set.
* @param sheet The worksheet name
* @param cell The cell reference
* @param chart The chart options
* @param combo Specifies the create a chart that combines two or more
* chart types in a single chart
*/
AddChart(sheet: string, cell: string, chart: Chart, combo?: Chart): { error: string | null }
/**
* AddChartSheet provides the method to create a chartsheet by given chart
* format set (such as offset, scale, aspect ratio setting and print
* settings) and properties set. In Excel a chartsheet is a worksheet that
* only contains a chart.
* @param sheet The worksheet name
* @param chart The chart options
* @param combo Specifies the create a chart that combines two or more
* chart types in a single chart
*/
AddChartSheet(sheet: string, chart: Chart, combo?: Chart): { error: string | null }
/**
* AddComment provides the method to add comment in a sheet by given
* worksheet index, cell and format set (such as author and text). Note
* that the max author length is 255 and the max text length is 32512.
* @param sheet The worksheet name
* @param comment The comment options
*/
AddComment(sheet: string, comment: Comment): { error: string | null }
/**
* AddDataValidation provides set data validation on a range of the worksheet
* by given data validation object and worksheet name.
* @param sheet The worksheet name
* @param dv The data validation rules
*/
AddDataValidation(sheet: string, dv: DataValidation): { error: string | null }
/**
* AddPictureFromBytes provides the method to add picture in a sheet by
* given picture format set (such as offset, scale, aspect ratio setting
* and print settings), file base name, extension name and file bytes.
* @param sheet The worksheet name
* @param cell The cell reference
* @param name The picture name
* @param extension The extension name
* @param file The contents buffer of the file
* @param opts The graphic options
*/
AddPictureFromBytes(sheet: string, cell: string, pic: Picture): { error: string | null }
/**
* AddPivotTable provides the method to add pivot table by given pivot
* table options. Note that the same fields can not in Columns, Rows and
* Filter fields at the same time.
* @param opt The pivot table option
*/
AddPivotTable(opt: PivotTableOptions): { error: string | null }
/**
* AddShape provides the method to add shape in a sheet by given worksheet
* index, shape format set (such as offset, scale, aspect ratio setting
* and print settings) and properties set.
* @param sheet The worksheet name
* @param cell The cell reference
* @param opts The shape options
*/
AddShape(sheet: string, cell: string, opts: Shape): { error: string | null }
/**
* AddSparkline provides a function to add sparklines to the worksheet by
* given formatting options. Sparklines are small charts that fit in a single
* cell and are used to show trends in data. Sparklines are a feature of Excel
* 2010 and later only. You can write them to an XLSX file that can be read by
* Excel 2007, but they won't be displayed. For example, add a grouped
* sparkline. Changes are applied to all three:
*
* ```typescript
* const { error } = f.AddSparkline("Sheet1", {
* Location: ["A1", "A2", "A3"],
* Range: ["Sheet2!A1:J1", "Sheet2!A2:J2", "Sheet2!A3:J3"],
* Markers: true,
* })
* ```