@nazarkalytiuk/rusc-xlsx 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -5
- package/index.d.ts +117 -22
- package/index.js +217 -82
- package/package.json +44 -17
- package/wrapper.d.ts +149 -532
- package/wrapper.js +1227 -1423
package/wrapper.d.ts
CHANGED
|
@@ -1,47 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import type { Writable } from 'stream';
|
|
5
|
-
|
|
1
|
+
import { Writable } from "node:stream";
|
|
2
|
+
import { RuscButton, RuscChart, RuscDataValidation, RuscDocProperties, RuscFormat, RuscFormula, RuscFormulaData, RuscImage, RuscNote, RuscProtectionOptions, RuscRichText, RuscShape, RuscSparkline, RuscTable, RuscTableColumn, RuscWorkbook, RuscWorksheet, rustMemoryResetPeak, rustMemoryStats } from "./index.js";
|
|
6
3
|
/** Color value - can be a named color or hex code */
|
|
7
|
-
export type Color =
|
|
8
|
-
| 'black' | 'blue' | 'brown' | 'cyan' | 'gray' | 'green'
|
|
9
|
-
| 'lime' | 'magenta' | 'navy' | 'orange' | 'pink' | 'purple'
|
|
10
|
-
| 'red' | 'silver' | 'white' | 'yellow'
|
|
11
|
-
| `#${string}`; // Hex colors like #FF0000
|
|
12
|
-
|
|
4
|
+
export type Color = "black" | "blue" | "brown" | "cyan" | "gray" | "green" | "lime" | "magenta" | "navy" | "orange" | "pink" | "purple" | "red" | "silver" | "white" | "yellow" | `#${string}`;
|
|
13
5
|
/** Horizontal alignment options */
|
|
14
|
-
export type HorizontalAlign =
|
|
15
|
-
|
|
6
|
+
export type HorizontalAlign = "left" | "center" | "right" | "fill" | "justify" | "centerAcross" | "distributed";
|
|
16
7
|
/** Vertical alignment options */
|
|
17
|
-
export type VerticalAlign =
|
|
18
|
-
|
|
8
|
+
export type VerticalAlign = "top" | "center" | "bottom" | "justify" | "distributed";
|
|
19
9
|
/** Border style options */
|
|
20
|
-
export type BorderStyle =
|
|
21
|
-
| 'thin' | 'medium' | 'thick' | 'double' | 'dotted' | 'dashed'
|
|
22
|
-
| 'dashDot' | 'dashDotDot' | 'slantDashDot'
|
|
23
|
-
| 'mediumDashed' | 'mediumDashDot' | 'mediumDashDotDot';
|
|
24
|
-
|
|
10
|
+
export type BorderStyle = "thin" | "medium" | "thick" | "double" | "dotted" | "dashed" | "dashDot" | "dashDotDot" | "slantDashDot" | "mediumDashed" | "mediumDashDot" | "mediumDashDotDot";
|
|
25
11
|
/** Underline style options */
|
|
26
|
-
export type UnderlineStyle =
|
|
27
|
-
|
|
12
|
+
export type UnderlineStyle = "single" | "double" | "singleAccounting" | "doubleAccounting";
|
|
28
13
|
/** Fill pattern options */
|
|
29
|
-
export type FillPattern =
|
|
30
|
-
| 'solid' | 'mediumGray' | 'darkGray' | 'lightGray'
|
|
31
|
-
| 'darkHorizontal' | 'darkVertical' | 'darkDown' | 'darkUp'
|
|
32
|
-
| 'darkGrid' | 'darkTrellis' | 'lightHorizontal' | 'lightVertical'
|
|
33
|
-
| 'lightDown' | 'lightUp' | 'lightGrid' | 'lightTrellis'
|
|
34
|
-
| 'gray125' | 'gray0625';
|
|
35
|
-
|
|
14
|
+
export type FillPattern = "solid" | "mediumGray" | "darkGray" | "lightGray" | "darkHorizontal" | "darkVertical" | "darkDown" | "darkUp" | "darkGrid" | "darkTrellis" | "lightHorizontal" | "lightVertical" | "lightDown" | "lightUp" | "lightGrid" | "lightTrellis" | "gray125" | "gray0625";
|
|
36
15
|
/** Font theme scheme */
|
|
37
|
-
export type FontScheme =
|
|
38
|
-
|
|
16
|
+
export type FontScheme = "body" | "headings" | "none";
|
|
39
17
|
/** Data validation rule type */
|
|
40
|
-
export type ValidationRule =
|
|
41
|
-
|
|
18
|
+
export type ValidationRule = "equal" | "notEqual" | "greaterThan" | "lessThan" | "greaterThanOrEqual" | "lessThanOrEqual";
|
|
42
19
|
/** Data validation error style */
|
|
43
|
-
export type ValidationErrorStyle =
|
|
44
|
-
|
|
20
|
+
export type ValidationErrorStyle = "stop" | "warning" | "information";
|
|
21
|
+
/**
|
|
22
|
+
* When Excel recalculates formulas: `automatic` (the default), `manual` (only on
|
|
23
|
+
* request, e.g. F9), or `partial` (automatic except for data tables).
|
|
24
|
+
*/
|
|
25
|
+
export type CalculationMode = "automatic" | "manual" | "partial";
|
|
45
26
|
/**
|
|
46
27
|
* Format class for cell styling with fluent API
|
|
47
28
|
* All methods return `this` for method chaining
|
|
@@ -54,12 +35,9 @@ export type ValidationErrorStyle = 'stop' | 'warning' | 'information';
|
|
|
54
35
|
*/
|
|
55
36
|
export declare class Format {
|
|
56
37
|
/** Internal native binding */
|
|
57
|
-
_native:
|
|
58
|
-
|
|
38
|
+
_native: RuscFormat;
|
|
59
39
|
/** Create a new format */
|
|
60
40
|
constructor();
|
|
61
|
-
|
|
62
|
-
// Font styling methods (return this for chaining)
|
|
63
41
|
/** Set bold text */
|
|
64
42
|
setBold(): this;
|
|
65
43
|
/** Set italic text */
|
|
@@ -76,16 +54,12 @@ export declare class Format {
|
|
|
76
54
|
setUnderline(underline: UnderlineStyle): this;
|
|
77
55
|
/** Set strikethrough text */
|
|
78
56
|
setStrikethrough(): this;
|
|
79
|
-
|
|
80
|
-
// Fill and background methods
|
|
81
57
|
/** Set background color using named color or hex code */
|
|
82
58
|
setBackgroundColor(color: Color): this;
|
|
83
59
|
/** Set foreground color (for patterns) using named color or hex code */
|
|
84
60
|
setForegroundColor(color: Color): this;
|
|
85
61
|
/** Set fill pattern */
|
|
86
62
|
setPattern(pattern: FillPattern): this;
|
|
87
|
-
|
|
88
|
-
// Alignment and text formatting methods
|
|
89
63
|
/** Set horizontal alignment */
|
|
90
64
|
setAlign(align: HorizontalAlign): this;
|
|
91
65
|
/** Set vertical alignment */
|
|
@@ -98,8 +72,6 @@ export declare class Format {
|
|
|
98
72
|
setRotation(rotation: number): this;
|
|
99
73
|
/** Shrink text to fit cell */
|
|
100
74
|
setShrink(): this;
|
|
101
|
-
|
|
102
|
-
// Border methods
|
|
103
75
|
/** Set border style for all borders */
|
|
104
76
|
setBorder(border: BorderStyle): this;
|
|
105
77
|
/** Set top border style */
|
|
@@ -120,8 +92,6 @@ export declare class Format {
|
|
|
120
92
|
setBorderLeftColor(color: Color): this;
|
|
121
93
|
/** Set right border color */
|
|
122
94
|
setBorderRightColor(color: Color): this;
|
|
123
|
-
|
|
124
|
-
// Number format
|
|
125
95
|
/**
|
|
126
96
|
* Set number format using Excel format strings
|
|
127
97
|
* @example
|
|
@@ -131,15 +101,12 @@ export declare class Format {
|
|
|
131
101
|
* format.setNumFormat('yyyy-mm-dd'); // Date
|
|
132
102
|
*/
|
|
133
103
|
setNumFormat(format: string): this;
|
|
134
|
-
|
|
135
|
-
// Cell protection
|
|
136
104
|
/** Unlock cell (for use with worksheet protection) */
|
|
137
105
|
setUnlocked(): this;
|
|
138
106
|
/** Lock cell (cell will be protected when worksheet is protected) */
|
|
139
107
|
setLocked(): this;
|
|
140
108
|
/** Hide formulas in cell (for use with worksheet protection) */
|
|
141
109
|
setHidden(): this;
|
|
142
|
-
|
|
143
110
|
/**
|
|
144
111
|
* Set font script (superscript or subscript)
|
|
145
112
|
* @param script - 'superscript' for X² or 'subscript' for H₂O
|
|
@@ -147,8 +114,7 @@ export declare class Format {
|
|
|
147
114
|
* format.setFontScript('superscript'); // X²
|
|
148
115
|
* format.setFontScript('subscript'); // H₂O
|
|
149
116
|
*/
|
|
150
|
-
setFontScript(script:
|
|
151
|
-
|
|
117
|
+
setFontScript(script: "superscript" | "subscript"): this;
|
|
152
118
|
/**
|
|
153
119
|
* Set diagonal border style
|
|
154
120
|
* @param border - Border style
|
|
@@ -156,13 +122,11 @@ export declare class Format {
|
|
|
156
122
|
* format.setBorderDiagonal('thin');
|
|
157
123
|
*/
|
|
158
124
|
setBorderDiagonal(border: BorderStyle): this;
|
|
159
|
-
|
|
160
125
|
/**
|
|
161
126
|
* Set diagonal border color
|
|
162
127
|
* @param color - Color for diagonal border
|
|
163
128
|
*/
|
|
164
129
|
setBorderDiagonalColor(color: Color): this;
|
|
165
|
-
|
|
166
130
|
/**
|
|
167
131
|
* Set diagonal border type
|
|
168
132
|
* @param type - 'up' for / border, 'down' for \ border, 'both' for X
|
|
@@ -171,8 +135,7 @@ export declare class Format {
|
|
|
171
135
|
* format.setBorderDiagonalType('down'); // \
|
|
172
136
|
* format.setBorderDiagonalType('both'); // X
|
|
173
137
|
*/
|
|
174
|
-
setBorderDiagonalType(type:
|
|
175
|
-
|
|
138
|
+
setBorderDiagonalType(type: "up" | "down" | "both"): this;
|
|
176
139
|
/**
|
|
177
140
|
* Set reading direction for RTL languages
|
|
178
141
|
* @param direction - 0=context, 1=left-to-right, 2=right-to-left
|
|
@@ -180,7 +143,6 @@ export declare class Format {
|
|
|
180
143
|
* format.setReadingDirection(2); // Right-to-left (Arabic, Hebrew)
|
|
181
144
|
*/
|
|
182
145
|
setReadingDirection(direction: 0 | 1 | 2): this;
|
|
183
|
-
|
|
184
146
|
/**
|
|
185
147
|
* Force string interpretation with leading apostrophe
|
|
186
148
|
* Useful for numbers that should be treated as text
|
|
@@ -189,7 +151,6 @@ export declare class Format {
|
|
|
189
151
|
*/
|
|
190
152
|
setQuotePrefix(): this;
|
|
191
153
|
}
|
|
192
|
-
|
|
193
154
|
/**
|
|
194
155
|
* Note class for Excel cell notes (comments) with fluent API
|
|
195
156
|
* All methods return `this` for method chaining
|
|
@@ -205,51 +166,43 @@ export declare class Format {
|
|
|
205
166
|
*/
|
|
206
167
|
export declare class Note {
|
|
207
168
|
/** Internal native binding */
|
|
208
|
-
_native:
|
|
209
|
-
|
|
169
|
+
_native: RuscNote;
|
|
210
170
|
/**
|
|
211
171
|
* Create a new note with text
|
|
212
172
|
* @param text - The text content of the note
|
|
213
173
|
*/
|
|
214
174
|
constructor(text: string);
|
|
215
|
-
|
|
216
175
|
/**
|
|
217
176
|
* Set the author name for the note (max 52 characters)
|
|
218
177
|
* @param name - Author name
|
|
219
178
|
*/
|
|
220
179
|
setAuthor(name: string): this;
|
|
221
|
-
|
|
222
180
|
/**
|
|
223
181
|
* Set the width of the note in pixels
|
|
224
182
|
* @param width - Width in pixels
|
|
225
183
|
*/
|
|
226
184
|
setWidth(width: number): this;
|
|
227
|
-
|
|
228
185
|
/**
|
|
229
186
|
* Set the height of the note in pixels
|
|
230
187
|
* @param height - Height in pixels
|
|
231
188
|
*/
|
|
232
189
|
setHeight(height: number): this;
|
|
233
|
-
|
|
234
190
|
/**
|
|
235
191
|
* Set the background color of the note
|
|
236
192
|
* @param color - Color name or hex code
|
|
237
193
|
*/
|
|
238
194
|
setBackgroundColor(color: Color): this;
|
|
239
|
-
|
|
240
195
|
/**
|
|
241
196
|
* Make the note visible by default (normally hidden until hover)
|
|
242
197
|
* @param visible - True to show by default, false to show on hover
|
|
243
198
|
*/
|
|
244
199
|
setVisible(visible: boolean): this;
|
|
245
|
-
|
|
246
200
|
/**
|
|
247
201
|
* Set alt text for accessibility
|
|
248
202
|
* @param altText - Accessibility description
|
|
249
203
|
*/
|
|
250
204
|
setAltText(altText: string): this;
|
|
251
205
|
}
|
|
252
|
-
|
|
253
206
|
/**
|
|
254
207
|
* Formula class for Excel formulas with fluent API
|
|
255
208
|
*
|
|
@@ -258,22 +211,22 @@ export declare class Note {
|
|
|
258
211
|
* const formulaWithResult = new Formula('=2+2').setResult('4');
|
|
259
212
|
*/
|
|
260
213
|
export declare class Formula {
|
|
261
|
-
/**
|
|
262
|
-
|
|
263
|
-
|
|
214
|
+
/**
|
|
215
|
+
* Internal formula data passed to the native writer. A `Formula` is plain
|
|
216
|
+
* JavaScript data, so creating one per row allocates no Rust memory.
|
|
217
|
+
*/
|
|
218
|
+
readonly _data: RuscFormulaData;
|
|
264
219
|
/**
|
|
265
220
|
* Create a new formula
|
|
266
221
|
* @param formula - Excel formula string (e.g., '=SUM(A1:A10)')
|
|
267
222
|
*/
|
|
268
223
|
constructor(formula: string);
|
|
269
|
-
|
|
270
224
|
/**
|
|
271
225
|
* Set the result value for applications that don't auto-calculate formulas
|
|
272
226
|
* @param result - The calculated result as a string
|
|
273
227
|
*/
|
|
274
228
|
setResult(result: string): this;
|
|
275
229
|
}
|
|
276
|
-
|
|
277
230
|
/**
|
|
278
231
|
* DataValidation class for restricting cell input with fluent API
|
|
279
232
|
*
|
|
@@ -295,117 +248,98 @@ export declare class Formula {
|
|
|
295
248
|
*/
|
|
296
249
|
export declare class DataValidation {
|
|
297
250
|
/** Internal native binding */
|
|
298
|
-
_native:
|
|
299
|
-
|
|
251
|
+
_native: RuscDataValidation;
|
|
300
252
|
/** Create a new data validation */
|
|
301
253
|
constructor();
|
|
302
|
-
|
|
303
254
|
/**
|
|
304
255
|
* Allow whole number validation with a rule
|
|
305
256
|
* @param rule - Validation rule type
|
|
306
257
|
* @param value - Comparison value
|
|
307
258
|
*/
|
|
308
259
|
allowWholeNumber(rule: ValidationRule, value: number): this;
|
|
309
|
-
|
|
310
260
|
/**
|
|
311
261
|
* Allow whole number validation between min and max
|
|
312
262
|
* @param min - Minimum value (inclusive)
|
|
313
263
|
* @param max - Maximum value (inclusive)
|
|
314
264
|
*/
|
|
315
265
|
allowWholeNumberBetween(min: number, max: number): this;
|
|
316
|
-
|
|
317
266
|
/**
|
|
318
267
|
* Allow decimal number validation with a rule
|
|
319
268
|
* @param rule - Validation rule type
|
|
320
269
|
* @param value - Comparison value
|
|
321
270
|
*/
|
|
322
271
|
allowDecimalNumber(rule: ValidationRule, value: number): this;
|
|
323
|
-
|
|
324
272
|
/**
|
|
325
273
|
* Allow decimal number validation between min and max
|
|
326
274
|
* @param min - Minimum value (inclusive)
|
|
327
275
|
* @param max - Maximum value (inclusive)
|
|
328
276
|
*/
|
|
329
277
|
allowDecimalNumberBetween(min: number, max: number): this;
|
|
330
|
-
|
|
331
278
|
/**
|
|
332
279
|
* Allow list validation with an array of strings (creates dropdown)
|
|
333
280
|
* @param list - Array of allowed values (max 255 chars total)
|
|
334
281
|
*/
|
|
335
282
|
allowListStrings(list: string[]): this;
|
|
336
|
-
|
|
337
283
|
/**
|
|
338
284
|
* Allow list validation from a cell range formula
|
|
339
285
|
* @param formula - Cell range formula (e.g., '=$A$1:$A$10')
|
|
340
286
|
*/
|
|
341
287
|
allowListFormula(formula: string): this;
|
|
342
|
-
|
|
343
288
|
/**
|
|
344
289
|
* Allow custom formula validation
|
|
345
290
|
* @param formula - Excel formula that returns true/false
|
|
346
291
|
*/
|
|
347
292
|
allowCustom(formula: string): this;
|
|
348
|
-
|
|
349
293
|
/**
|
|
350
294
|
* Allow any value (mainly used for displaying input messages)
|
|
351
295
|
*/
|
|
352
296
|
allowAnyValue(): this;
|
|
353
|
-
|
|
354
297
|
/**
|
|
355
298
|
* Set whether to ignore blank cells
|
|
356
299
|
* @param enable - True to allow blank cells (default: true)
|
|
357
300
|
*/
|
|
358
301
|
ignoreBlank(enable: boolean): this;
|
|
359
|
-
|
|
360
302
|
/**
|
|
361
303
|
* Set whether to show dropdown arrow for list validations
|
|
362
304
|
* @param enable - True to show dropdown (default: true)
|
|
363
305
|
*/
|
|
364
306
|
showDropdown(enable: boolean): this;
|
|
365
|
-
|
|
366
307
|
/**
|
|
367
308
|
* Set whether to show input message when cell is selected
|
|
368
309
|
* @param enable - True to show message (default: true)
|
|
369
310
|
*/
|
|
370
311
|
showInputMessage(enable: boolean): this;
|
|
371
|
-
|
|
372
312
|
/**
|
|
373
313
|
* Set whether to show error message on invalid input
|
|
374
314
|
* @param enable - True to show message (default: true)
|
|
375
315
|
*/
|
|
376
316
|
showErrorMessage(enable: boolean): this;
|
|
377
|
-
|
|
378
317
|
/**
|
|
379
318
|
* Set the input message title (shown when cell is selected)
|
|
380
319
|
* @param title - Title text (max 32 characters)
|
|
381
320
|
*/
|
|
382
321
|
setInputTitle(title: string): this;
|
|
383
|
-
|
|
384
322
|
/**
|
|
385
323
|
* Set the input message text (shown when cell is selected)
|
|
386
324
|
* @param message - Message text (max 255 characters)
|
|
387
325
|
*/
|
|
388
326
|
setInputMessage(message: string): this;
|
|
389
|
-
|
|
390
327
|
/**
|
|
391
328
|
* Set the error message title (shown on invalid input)
|
|
392
329
|
* @param title - Title text (max 32 characters)
|
|
393
330
|
*/
|
|
394
331
|
setErrorTitle(title: string): this;
|
|
395
|
-
|
|
396
332
|
/**
|
|
397
333
|
* Set the error message text (shown on invalid input)
|
|
398
334
|
* @param message - Message text (max 255 characters)
|
|
399
335
|
*/
|
|
400
336
|
setErrorMessage(message: string): this;
|
|
401
|
-
|
|
402
337
|
/**
|
|
403
338
|
* Set the error dialog style
|
|
404
339
|
* @param style - Error style: 'stop' (red X), 'warning' (yellow !), or 'information' (blue i)
|
|
405
340
|
*/
|
|
406
341
|
setErrorStyle(style: ValidationErrorStyle): this;
|
|
407
342
|
}
|
|
408
|
-
|
|
409
343
|
/**
|
|
410
344
|
* Protection Options for worksheet protection
|
|
411
345
|
* Configure granular permissions for protected worksheets
|
|
@@ -419,108 +353,90 @@ export declare class DataValidation {
|
|
|
419
353
|
*/
|
|
420
354
|
export declare class ProtectionOptions {
|
|
421
355
|
/** Internal native binding */
|
|
422
|
-
_native:
|
|
423
|
-
|
|
356
|
+
_native: RuscProtectionOptions;
|
|
424
357
|
/** Create a new ProtectionOptions with default settings */
|
|
425
358
|
constructor();
|
|
426
|
-
|
|
427
359
|
/**
|
|
428
360
|
* Allow or prevent selecting locked cells (default: true)
|
|
429
361
|
* @param allow - true to allow, false to prevent
|
|
430
362
|
*/
|
|
431
363
|
setSelectLockedCells(allow: boolean): this;
|
|
432
|
-
|
|
433
364
|
/**
|
|
434
365
|
* Allow or prevent selecting unlocked cells (default: true)
|
|
435
366
|
* @param allow - true to allow, false to prevent
|
|
436
367
|
*/
|
|
437
368
|
setSelectUnlockedCells(allow: boolean): this;
|
|
438
|
-
|
|
439
369
|
/**
|
|
440
370
|
* Allow or prevent formatting cells (default: false)
|
|
441
371
|
* @param allow - true to allow, false to prevent
|
|
442
372
|
*/
|
|
443
373
|
setFormatCells(allow: boolean): this;
|
|
444
|
-
|
|
445
374
|
/**
|
|
446
375
|
* Allow or prevent formatting columns (default: false)
|
|
447
376
|
* @param allow - true to allow, false to prevent
|
|
448
377
|
*/
|
|
449
378
|
setFormatColumns(allow: boolean): this;
|
|
450
|
-
|
|
451
379
|
/**
|
|
452
380
|
* Allow or prevent formatting rows (default: false)
|
|
453
381
|
* @param allow - true to allow, false to prevent
|
|
454
382
|
*/
|
|
455
383
|
setFormatRows(allow: boolean): this;
|
|
456
|
-
|
|
457
384
|
/**
|
|
458
385
|
* Allow or prevent inserting columns (default: false)
|
|
459
386
|
* @param allow - true to allow, false to prevent
|
|
460
387
|
*/
|
|
461
388
|
setInsertColumns(allow: boolean): this;
|
|
462
|
-
|
|
463
389
|
/**
|
|
464
390
|
* Allow or prevent inserting rows (default: false)
|
|
465
391
|
* @param allow - true to allow, false to prevent
|
|
466
392
|
*/
|
|
467
393
|
setInsertRows(allow: boolean): this;
|
|
468
|
-
|
|
469
394
|
/**
|
|
470
395
|
* Allow or prevent inserting hyperlinks (default: false)
|
|
471
396
|
* @param allow - true to allow, false to prevent
|
|
472
397
|
*/
|
|
473
398
|
setInsertLinks(allow: boolean): this;
|
|
474
|
-
|
|
475
399
|
/**
|
|
476
400
|
* Allow or prevent deleting columns (default: false)
|
|
477
401
|
* @param allow - true to allow, false to prevent
|
|
478
402
|
*/
|
|
479
403
|
setDeleteColumns(allow: boolean): this;
|
|
480
|
-
|
|
481
404
|
/**
|
|
482
405
|
* Allow or prevent deleting rows (default: false)
|
|
483
406
|
* @param allow - true to allow, false to prevent
|
|
484
407
|
*/
|
|
485
408
|
setDeleteRows(allow: boolean): this;
|
|
486
|
-
|
|
487
409
|
/**
|
|
488
410
|
* Allow or prevent sorting data (default: false)
|
|
489
411
|
* @param allow - true to allow, false to prevent
|
|
490
412
|
*/
|
|
491
413
|
setSort(allow: boolean): this;
|
|
492
|
-
|
|
493
414
|
/**
|
|
494
415
|
* Allow or prevent using autofilters (default: false)
|
|
495
416
|
* @param allow - true to allow, false to prevent
|
|
496
417
|
*/
|
|
497
418
|
setUseAutofilter(allow: boolean): this;
|
|
498
|
-
|
|
499
419
|
/**
|
|
500
420
|
* Allow or prevent using pivot tables (default: false)
|
|
501
421
|
* @param allow - true to allow, false to prevent
|
|
502
422
|
*/
|
|
503
423
|
setUsePivotTables(allow: boolean): this;
|
|
504
|
-
|
|
505
424
|
/**
|
|
506
425
|
* Allow or prevent editing scenarios (default: false)
|
|
507
426
|
* @param allow - true to allow, false to prevent
|
|
508
427
|
*/
|
|
509
428
|
setEditScenarios(allow: boolean): this;
|
|
510
|
-
|
|
511
429
|
/**
|
|
512
430
|
* Allow or prevent editing objects like images (default: false)
|
|
513
431
|
* @param allow - true to allow, false to prevent
|
|
514
432
|
*/
|
|
515
433
|
setEditObjects(allow: boolean): this;
|
|
516
|
-
|
|
517
434
|
/**
|
|
518
435
|
* Allow or prevent editing contents in chartsheets (default: true)
|
|
519
436
|
* @param allow - true to allow, false to prevent
|
|
520
437
|
*/
|
|
521
438
|
setContents(allow: boolean): this;
|
|
522
439
|
}
|
|
523
|
-
|
|
524
440
|
/**
|
|
525
441
|
* Image for inserting images into worksheets
|
|
526
442
|
* Supports PNG, JPG, GIF, and BMP formats
|
|
@@ -532,15 +448,13 @@ export declare class ProtectionOptions {
|
|
|
532
448
|
*/
|
|
533
449
|
export declare class Image {
|
|
534
450
|
/** Internal native binding */
|
|
535
|
-
_native:
|
|
536
|
-
|
|
451
|
+
_native: RuscImage;
|
|
537
452
|
/**
|
|
538
453
|
* Create a new Image from a file path
|
|
539
454
|
* @param path - Path to the image file (PNG, JPG, GIF, or BMP)
|
|
540
455
|
* @throws Error if file cannot be read or format is unsupported
|
|
541
456
|
*/
|
|
542
457
|
constructor(path: string);
|
|
543
|
-
|
|
544
458
|
/**
|
|
545
459
|
* Create an Image from a buffer
|
|
546
460
|
* @param buffer - Buffer containing image data
|
|
@@ -550,35 +464,30 @@ export declare class Image {
|
|
|
550
464
|
* const image = Image.fromBuffer(buffer);
|
|
551
465
|
*/
|
|
552
466
|
static fromBuffer(buffer: Buffer): Image;
|
|
553
|
-
|
|
554
467
|
/**
|
|
555
468
|
* Set the width of the image in pixels
|
|
556
469
|
* @param width - Width in pixels
|
|
557
470
|
* @returns this for method chaining
|
|
558
471
|
*/
|
|
559
472
|
setWidth(width: number): this;
|
|
560
|
-
|
|
561
473
|
/**
|
|
562
474
|
* Set the height of the image in pixels
|
|
563
475
|
* @param height - Height in pixels
|
|
564
476
|
* @returns this for method chaining
|
|
565
477
|
*/
|
|
566
478
|
setHeight(height: number): this;
|
|
567
|
-
|
|
568
479
|
/**
|
|
569
480
|
* Scale the width of the image as a percentage
|
|
570
481
|
* @param scale - Scale percentage (e.g., 1.5 for 150%)
|
|
571
482
|
* @returns this for method chaining
|
|
572
483
|
*/
|
|
573
484
|
setScaleWidth(scale: number): this;
|
|
574
|
-
|
|
575
485
|
/**
|
|
576
486
|
* Scale the height of the image as a percentage
|
|
577
487
|
* @param scale - Scale percentage (e.g., 0.5 for 50%)
|
|
578
488
|
* @returns this for method chaining
|
|
579
489
|
*/
|
|
580
490
|
setScaleHeight(scale: number): this;
|
|
581
|
-
|
|
582
491
|
/**
|
|
583
492
|
* Scale the image to a specific size
|
|
584
493
|
* @param width - Target width
|
|
@@ -589,21 +498,18 @@ export declare class Image {
|
|
|
589
498
|
* image.setScaleToSize(300, 200, true);
|
|
590
499
|
*/
|
|
591
500
|
setScaleToSize(width: number, height: number, keepAspectRatio?: boolean): this;
|
|
592
|
-
|
|
593
501
|
/**
|
|
594
502
|
* Set alt text for the image (for accessibility)
|
|
595
503
|
* @param altText - Descriptive text for the image
|
|
596
504
|
* @returns this for method chaining
|
|
597
505
|
*/
|
|
598
506
|
setAltText(altText: string): this;
|
|
599
|
-
|
|
600
507
|
/**
|
|
601
508
|
* Mark the image as decorative (no alt text required)
|
|
602
509
|
* @param enable - true to mark as decorative
|
|
603
510
|
* @returns this for method chaining
|
|
604
511
|
*/
|
|
605
512
|
setDecorative(enable: boolean): this;
|
|
606
|
-
|
|
607
513
|
/**
|
|
608
514
|
* Set how the image moves and sizes with cells
|
|
609
515
|
* @param option - 'moveAndSize' | 'moveOnly' | 'none' | 'moveAndSizeAfter'
|
|
@@ -611,8 +517,7 @@ export declare class Image {
|
|
|
611
517
|
* @example
|
|
612
518
|
* image.setObjectMovement('moveOnly'); // Image moves but doesn't resize with cells
|
|
613
519
|
*/
|
|
614
|
-
setObjectMovement(option:
|
|
615
|
-
|
|
520
|
+
setObjectMovement(option: "moveAndSize" | "moveOnly" | "none" | "moveAndSizeAfter"): this;
|
|
616
521
|
/**
|
|
617
522
|
* Add a URL link to the image
|
|
618
523
|
* @param url - URL to link to
|
|
@@ -622,7 +527,6 @@ export declare class Image {
|
|
|
622
527
|
*/
|
|
623
528
|
setUrl(url: string): this;
|
|
624
529
|
}
|
|
625
|
-
|
|
626
530
|
/**
|
|
627
531
|
* Rich Text for multi-format text in a single cell
|
|
628
532
|
*
|
|
@@ -635,16 +539,18 @@ export declare class Image {
|
|
|
635
539
|
* worksheet.writeRichString(0, 0, richText);
|
|
636
540
|
*/
|
|
637
541
|
export declare class RichText {
|
|
638
|
-
/** Internal native binding */
|
|
639
|
-
_native: any;
|
|
640
|
-
|
|
641
|
-
/** Create a new empty rich text string */
|
|
642
|
-
constructor();
|
|
643
|
-
|
|
644
542
|
/**
|
|
645
|
-
*
|
|
543
|
+
* Internal `[text, format]` segments passed to the native writer. A
|
|
544
|
+
* `RichText` is plain JavaScript data, so creating one per row allocates no
|
|
545
|
+
* Rust memory.
|
|
546
|
+
*/
|
|
547
|
+
readonly _segments: [text: string, format: RuscFormat | undefined][];
|
|
548
|
+
/**
|
|
549
|
+
* Add a text segment with formatting. The format is read when the rich text
|
|
550
|
+
* is written, as the format of any other write is.
|
|
646
551
|
* @param text - The text content
|
|
647
|
-
* @param format - Optional format to apply to this segment
|
|
552
|
+
* @param format - Optional format to apply to this segment; without one the
|
|
553
|
+
* segment uses the default cell font
|
|
648
554
|
* @returns this for method chaining
|
|
649
555
|
* @example
|
|
650
556
|
* richText.addSegment('Hello ', normalFormat)
|
|
@@ -652,7 +558,6 @@ export declare class RichText {
|
|
|
652
558
|
*/
|
|
653
559
|
addSegment(text: string, format?: Format): this;
|
|
654
560
|
}
|
|
655
|
-
|
|
656
561
|
/**
|
|
657
562
|
* Worksheet class for Excel sheet manipulation
|
|
658
563
|
*
|
|
@@ -664,44 +569,49 @@ export declare class RichText {
|
|
|
664
569
|
*/
|
|
665
570
|
export declare class Worksheet {
|
|
666
571
|
/** Internal native binding */
|
|
667
|
-
_native:
|
|
668
|
-
|
|
572
|
+
_native: RuscWorksheet;
|
|
669
573
|
/** @internal */
|
|
670
|
-
constructor(nativeWorksheet:
|
|
671
|
-
|
|
574
|
+
constructor(nativeWorksheet: RuscWorksheet);
|
|
672
575
|
/**
|
|
673
576
|
* Write a value to a cell (auto-detects type)
|
|
674
577
|
* @param row - Row number (0-indexed)
|
|
675
578
|
* @param col - Column number (0-indexed)
|
|
676
|
-
* @param value - Value to write (string, number, or boolean)
|
|
579
|
+
* @param value - Value to write (string, number, or boolean); `null` or `undefined`
|
|
580
|
+
* writes nothing, or a blank cell when a format is given
|
|
677
581
|
* @param format - Optional format to apply
|
|
582
|
+
* @throws If the value is of another type, such as an object or a Date (use
|
|
583
|
+
* {@link Worksheet.writeDatetime} for dates)
|
|
678
584
|
*/
|
|
679
|
-
write(row: number, col: number, value: string | number | boolean, format?: Format): void;
|
|
680
|
-
|
|
585
|
+
write(row: number, col: number, value: string | number | boolean | null | undefined, format?: Format): void;
|
|
681
586
|
/**
|
|
682
587
|
* Write an array of values as a row starting at the given column.
|
|
683
588
|
* Batches all writes into a single native call — much faster than calling write() in a loop.
|
|
684
|
-
*
|
|
589
|
+
* Each value is written as {@link Worksheet.write} writes it: `null`, `undefined` and
|
|
590
|
+
* array holes leave the cell empty, or write a blank cell when a format is given.
|
|
685
591
|
*
|
|
686
592
|
* @param row - Row number (0-indexed)
|
|
687
593
|
* @param startCol - Starting column number (0-indexed)
|
|
688
594
|
* @param values - Array of values to write
|
|
689
595
|
* @param format - Optional format to apply to all cells in the row
|
|
596
|
+
* @throws If a value is of another type, such as an object or a Date; the
|
|
597
|
+
* values before it are already written
|
|
690
598
|
* @example
|
|
691
599
|
* worksheet.writeRow(0, 0, ['Name', 'Age', 'Active'], headerFormat);
|
|
692
600
|
* worksheet.writeRow(1, 0, ['Alice', 30, true]);
|
|
693
601
|
*/
|
|
694
|
-
writeRow(row: number, startCol: number, values: (string | number | boolean | null)[], format?: Format): void;
|
|
695
|
-
|
|
602
|
+
writeRow(row: number, startCol: number, values: (string | number | boolean | null | undefined)[], format?: Format): void;
|
|
696
603
|
/**
|
|
697
604
|
* Write a 2D array of values starting at the given position.
|
|
698
605
|
* Batches all writes — much faster than nested write() loops.
|
|
699
|
-
*
|
|
606
|
+
* Each value is written as {@link Worksheet.write} writes it: `null`, `undefined` and
|
|
607
|
+
* array holes leave the cell empty, or write a blank cell when a format is given.
|
|
700
608
|
*
|
|
701
609
|
* @param startRow - Starting row number (0-indexed)
|
|
702
610
|
* @param startCol - Starting column number (0-indexed)
|
|
703
611
|
* @param rows - 2D array of values to write
|
|
704
612
|
* @param format - Optional format to apply to all cells
|
|
613
|
+
* @throws If a row is not an array or a value is of another type, such as an
|
|
614
|
+
* object or a Date; the values before it are already written
|
|
705
615
|
* @example
|
|
706
616
|
* worksheet.writeRows(0, 0, [
|
|
707
617
|
* ['Name', 'Age', 'Active'],
|
|
@@ -709,8 +619,7 @@ export declare class Worksheet {
|
|
|
709
619
|
* ['Bob', 25, false],
|
|
710
620
|
* ]);
|
|
711
621
|
*/
|
|
712
|
-
writeRows(startRow: number, startCol: number, rows: (string | number | boolean | null)[][], format?: Format): void;
|
|
713
|
-
|
|
622
|
+
writeRows(startRow: number, startCol: number, rows: (string | number | boolean | null | undefined)[][], format?: Format): void;
|
|
714
623
|
/**
|
|
715
624
|
* Write a string to a cell
|
|
716
625
|
* @param row - Row number (0-indexed)
|
|
@@ -718,7 +627,6 @@ export declare class Worksheet {
|
|
|
718
627
|
* @param value - String value to write
|
|
719
628
|
*/
|
|
720
629
|
writeString(row: number, col: number, value: string): void;
|
|
721
|
-
|
|
722
630
|
/**
|
|
723
631
|
* Write a number to a cell
|
|
724
632
|
* @param row - Row number (0-indexed)
|
|
@@ -726,7 +634,6 @@ export declare class Worksheet {
|
|
|
726
634
|
* @param value - Number value to write
|
|
727
635
|
*/
|
|
728
636
|
writeNumber(row: number, col: number, value: number): void;
|
|
729
|
-
|
|
730
637
|
/**
|
|
731
638
|
* Write a boolean to a cell
|
|
732
639
|
* @param row - Row number (0-indexed)
|
|
@@ -734,7 +641,6 @@ export declare class Worksheet {
|
|
|
734
641
|
* @param value - Boolean value to write
|
|
735
642
|
*/
|
|
736
643
|
writeBoolean(row: number, col: number, value: boolean): void;
|
|
737
|
-
|
|
738
644
|
/**
|
|
739
645
|
* Write a blank cell with formatting
|
|
740
646
|
* Useful for creating styled empty cells or clearing cells while keeping formatting
|
|
@@ -746,7 +652,6 @@ export declare class Worksheet {
|
|
|
746
652
|
* worksheet.writeBlank(0, 0, grayFormat); // Gray empty cell
|
|
747
653
|
*/
|
|
748
654
|
writeBlank(row: number, col: number, format: Format): void;
|
|
749
|
-
|
|
750
655
|
/**
|
|
751
656
|
* Write a datetime from a Unix timestamp (seconds since 1970-01-01 UTC)
|
|
752
657
|
* @param row - Row number (0-indexed)
|
|
@@ -758,7 +663,6 @@ export declare class Worksheet {
|
|
|
758
663
|
* worksheet.writeDatetimeFromTimestamp(0, 0, 1706184600, dateFormat);
|
|
759
664
|
*/
|
|
760
665
|
writeDatetimeFromTimestamp(row: number, col: number, timestamp: number, format?: Format): void;
|
|
761
|
-
|
|
762
666
|
/**
|
|
763
667
|
* Write a datetime from year, month, day components
|
|
764
668
|
* @param row - Row number (0-indexed)
|
|
@@ -772,7 +676,6 @@ export declare class Worksheet {
|
|
|
772
676
|
* worksheet.writeDatetimeFromYmd(0, 0, 2023, 1, 25, dateFormat);
|
|
773
677
|
*/
|
|
774
678
|
writeDatetimeFromYmd(row: number, col: number, year: number, month: number, day: number, format?: Format): void;
|
|
775
|
-
|
|
776
679
|
/**
|
|
777
680
|
* Write a datetime from year, month, day, hour, minute, second components
|
|
778
681
|
* @param row - Row number (0-indexed)
|
|
@@ -789,7 +692,6 @@ export declare class Worksheet {
|
|
|
789
692
|
* worksheet.writeDatetimeFromYmdHms(0, 0, 2023, 1, 25, 12, 30, 45.5, datetimeFormat);
|
|
790
693
|
*/
|
|
791
694
|
writeDatetimeFromYmdHms(row: number, col: number, year: number, month: number, day: number, hour: number, min: number, sec: number, format?: Format): void;
|
|
792
|
-
|
|
793
695
|
/**
|
|
794
696
|
* Write a datetime from an ISO 8601 string
|
|
795
697
|
* @param row - Row number (0-indexed)
|
|
@@ -801,7 +703,6 @@ export declare class Worksheet {
|
|
|
801
703
|
* worksheet.writeDatetimeFromString(0, 0, '2023-01-25T12:30:00', datetimeFormat);
|
|
802
704
|
*/
|
|
803
705
|
writeDatetimeFromString(row: number, col: number, datetimeStr: string, format?: Format): void;
|
|
804
|
-
|
|
805
706
|
/**
|
|
806
707
|
* Write a datetime (convenience method that auto-detects input type)
|
|
807
708
|
* Accepts: Date object, Unix timestamp (number), ISO string, or object with date components
|
|
@@ -826,58 +727,58 @@ export declare class Worksheet {
|
|
|
826
727
|
* // Using object
|
|
827
728
|
* worksheet.writeDatetime(3, 0, { year: 2023, month: 1, day: 25, hour: 12, min: 30 }, dateFormat);
|
|
828
729
|
*/
|
|
829
|
-
writeDatetime(row: number, col: number, datetime: Date | number | string | {
|
|
830
|
-
|
|
730
|
+
writeDatetime(row: number, col: number, datetime: Date | number | string | {
|
|
731
|
+
year: number;
|
|
732
|
+
month: number;
|
|
733
|
+
day: number;
|
|
734
|
+
hour?: number;
|
|
735
|
+
min?: number;
|
|
736
|
+
sec?: number;
|
|
737
|
+
}, format?: Format): void;
|
|
831
738
|
/**
|
|
832
739
|
* Write a value with formatting to a cell
|
|
833
740
|
* @param row - Row number (0-indexed)
|
|
834
741
|
* @param col - Column number (0-indexed)
|
|
835
|
-
* @param value - Value to write (string, number, or boolean)
|
|
742
|
+
* @param value - Value to write (string, number, or boolean); `null` or `undefined`
|
|
743
|
+
* writes a blank cell with the format
|
|
836
744
|
* @param format - Format to apply
|
|
745
|
+
* @throws If the value is of another type, such as an object or a Date
|
|
837
746
|
*/
|
|
838
|
-
writeWithFormat(row: number, col: number, value: string | number | boolean, format: Format): void;
|
|
839
|
-
|
|
747
|
+
writeWithFormat(row: number, col: number, value: string | number | boolean | null | undefined, format: Format): void;
|
|
840
748
|
/**
|
|
841
749
|
* Set the width of a column
|
|
842
750
|
* @param col - Column number (0-indexed)
|
|
843
751
|
* @param width - Width in Excel units (approximately character width)
|
|
844
752
|
*/
|
|
845
753
|
setColumnWidth(col: number, width: number): void;
|
|
846
|
-
|
|
847
754
|
/**
|
|
848
755
|
* Set the height of a row
|
|
849
756
|
* @param row - Row number (0-indexed)
|
|
850
757
|
* @param height - Height in points
|
|
851
758
|
*/
|
|
852
759
|
setRowHeight(row: number, height: number): void;
|
|
853
|
-
|
|
854
760
|
/**
|
|
855
761
|
* Set the default height for all worksheet rows without per-row metadata
|
|
856
762
|
* @param height - Height in points
|
|
857
763
|
*/
|
|
858
764
|
setDefaultRowHeight(height: number): void;
|
|
859
|
-
|
|
860
765
|
/**
|
|
861
766
|
* Set the exclusive upper row bound inspected by autofit
|
|
862
767
|
* @param maxRow - Rows at or above this zero-indexed bound are skipped
|
|
863
768
|
*/
|
|
864
769
|
setAutofitMaxRow(maxRow: number): void;
|
|
865
|
-
|
|
866
770
|
/**
|
|
867
771
|
* Limit the maximum autofitted column width
|
|
868
772
|
* @param maxWidth - Maximum width in pixels
|
|
869
773
|
*/
|
|
870
774
|
setAutofitMaxWidth(maxWidth: number): void;
|
|
871
|
-
|
|
872
775
|
/** Autofit worksheet columns based on cell contents */
|
|
873
776
|
autofit(): void;
|
|
874
|
-
|
|
875
777
|
/**
|
|
876
778
|
* Set the worksheet name
|
|
877
779
|
* @param name - Worksheet name
|
|
878
780
|
*/
|
|
879
781
|
setName(name: string): void;
|
|
880
|
-
|
|
881
782
|
/**
|
|
882
783
|
* Merge a range of cells and write a value to it
|
|
883
784
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -887,15 +788,7 @@ export declare class Worksheet {
|
|
|
887
788
|
* @param value - Value to write to merged cell
|
|
888
789
|
* @param format - Optional format to apply
|
|
889
790
|
*/
|
|
890
|
-
mergeRange(
|
|
891
|
-
firstRow: number,
|
|
892
|
-
firstCol: number,
|
|
893
|
-
lastRow: number,
|
|
894
|
-
lastCol: number,
|
|
895
|
-
value: string,
|
|
896
|
-
format?: Format
|
|
897
|
-
): void;
|
|
898
|
-
|
|
791
|
+
mergeRange(firstRow: number, firstCol: number, lastRow: number, lastCol: number, value: string, format?: Format): void;
|
|
899
792
|
/**
|
|
900
793
|
* Merge a range of cells with formatting
|
|
901
794
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -905,15 +798,7 @@ export declare class Worksheet {
|
|
|
905
798
|
* @param value - Value to write to merged cell
|
|
906
799
|
* @param format - Format to apply
|
|
907
800
|
*/
|
|
908
|
-
mergeRangeWithFormat(
|
|
909
|
-
firstRow: number,
|
|
910
|
-
firstCol: number,
|
|
911
|
-
lastRow: number,
|
|
912
|
-
lastCol: number,
|
|
913
|
-
value: string,
|
|
914
|
-
format: Format
|
|
915
|
-
): void;
|
|
916
|
-
|
|
801
|
+
mergeRangeWithFormat(firstRow: number, firstCol: number, lastRow: number, lastCol: number, value: string, format: Format): void;
|
|
917
802
|
/**
|
|
918
803
|
* Insert a note (post-it style comment) to a cell
|
|
919
804
|
* @param row - Row number (0-indexed)
|
|
@@ -921,50 +806,42 @@ export declare class Worksheet {
|
|
|
921
806
|
* @param note - Note object to insert
|
|
922
807
|
*/
|
|
923
808
|
insertNote(row: number, col: number, note: Note): void;
|
|
924
|
-
|
|
925
809
|
/**
|
|
926
810
|
* Set the default author name for all notes in the worksheet
|
|
927
811
|
* @param name - Author name (max 52 characters)
|
|
928
812
|
*/
|
|
929
813
|
setDefaultNoteAuthor(name: string): void;
|
|
930
|
-
|
|
931
814
|
/**
|
|
932
815
|
* Write a formula to a cell
|
|
933
816
|
* @param row - Row number (0-indexed)
|
|
934
817
|
* @param col - Column number (0-indexed)
|
|
935
|
-
* @param formula - Formula object
|
|
818
|
+
* @param formula - Formula object or formula string (e.g., '=SUM(A1:A10)')
|
|
936
819
|
* @param format - Optional format to apply
|
|
820
|
+
* @example
|
|
821
|
+
* worksheet.writeFormula(0, 2, '=A1+B1');
|
|
822
|
+
* worksheet.writeFormula(1, 2, new Formula('=A2+B2').setResult('42'));
|
|
937
823
|
*/
|
|
938
|
-
writeFormula(row: number, col: number, formula: Formula, format?: Format): void;
|
|
939
|
-
|
|
824
|
+
writeFormula(row: number, col: number, formula: Formula | string, format?: Format): void;
|
|
940
825
|
/**
|
|
941
826
|
* Write a dynamic array formula to a cell (Excel 365+)
|
|
942
827
|
* Dynamic arrays automatically spill into adjacent cells
|
|
943
828
|
* @param row - Row number (0-indexed)
|
|
944
829
|
* @param col - Column number (0-indexed)
|
|
945
|
-
* @param formula - Formula object
|
|
830
|
+
* @param formula - Formula object or formula string with a dynamic array
|
|
831
|
+
* function (FILTER, SORT, UNIQUE, etc.)
|
|
946
832
|
* @param format - Optional format to apply
|
|
947
833
|
*/
|
|
948
|
-
writeDynamicFormula(row: number, col: number, formula: Formula, format?: Format): void;
|
|
949
|
-
|
|
834
|
+
writeDynamicFormula(row: number, col: number, formula: Formula | string, format?: Format): void;
|
|
950
835
|
/**
|
|
951
836
|
* Write an array formula to a range of cells
|
|
952
837
|
* @param firstRow - First row of range (0-indexed)
|
|
953
838
|
* @param firstCol - First column of range (0-indexed)
|
|
954
839
|
* @param lastRow - Last row of range (0-indexed)
|
|
955
840
|
* @param lastCol - Last column of range (0-indexed)
|
|
956
|
-
* @param formula - Formula object
|
|
841
|
+
* @param formula - Formula object or formula string
|
|
957
842
|
* @param format - Optional format to apply
|
|
958
843
|
*/
|
|
959
|
-
writeArrayFormula(
|
|
960
|
-
firstRow: number,
|
|
961
|
-
firstCol: number,
|
|
962
|
-
lastRow: number,
|
|
963
|
-
lastCol: number,
|
|
964
|
-
formula: Formula,
|
|
965
|
-
format?: Format
|
|
966
|
-
): void;
|
|
967
|
-
|
|
844
|
+
writeArrayFormula(firstRow: number, firstCol: number, lastRow: number, lastCol: number, formula: Formula | string, format?: Format): void;
|
|
968
845
|
/**
|
|
969
846
|
* Add data validation to a cell or range
|
|
970
847
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -973,14 +850,7 @@ export declare class Worksheet {
|
|
|
973
850
|
* @param lastCol - Last column of range (0-indexed)
|
|
974
851
|
* @param validation - DataValidation object with rules
|
|
975
852
|
*/
|
|
976
|
-
addDataValidation(
|
|
977
|
-
firstRow: number,
|
|
978
|
-
firstCol: number,
|
|
979
|
-
lastRow: number,
|
|
980
|
-
lastCol: number,
|
|
981
|
-
validation: DataValidation
|
|
982
|
-
): void;
|
|
983
|
-
|
|
853
|
+
addDataValidation(firstRow: number, firstCol: number, lastRow: number, lastCol: number, validation: DataValidation): void;
|
|
984
854
|
/**
|
|
985
855
|
* Write a URL/hyperlink to a cell
|
|
986
856
|
* @param row - Row number (0-indexed)
|
|
@@ -989,7 +859,6 @@ export declare class Worksheet {
|
|
|
989
859
|
* @param format - Optional format to apply
|
|
990
860
|
*/
|
|
991
861
|
writeUrl(row: number, col: number, url: string, format?: Format): void;
|
|
992
|
-
|
|
993
862
|
/**
|
|
994
863
|
* Write a URL/hyperlink to a cell with custom display text
|
|
995
864
|
* @param row - Row number (0-indexed)
|
|
@@ -999,7 +868,6 @@ export declare class Worksheet {
|
|
|
999
868
|
* @param format - Optional format to apply
|
|
1000
869
|
*/
|
|
1001
870
|
writeUrlWithText(row: number, col: number, url: string, text: string, format?: Format): void;
|
|
1002
|
-
|
|
1003
871
|
/**
|
|
1004
872
|
* Add autofilter dropdown buttons to a range
|
|
1005
873
|
* @param firstRow - First row of range (0-indexed, typically header row)
|
|
@@ -1008,7 +876,6 @@ export declare class Worksheet {
|
|
|
1008
876
|
* @param lastCol - Last column of range (0-indexed)
|
|
1009
877
|
*/
|
|
1010
878
|
autofilter(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void;
|
|
1011
|
-
|
|
1012
879
|
/**
|
|
1013
880
|
* Freeze panes at the specified row and column
|
|
1014
881
|
* @param row - Row to freeze above (0 = no horizontal freeze)
|
|
@@ -1019,7 +886,6 @@ export declare class Worksheet {
|
|
|
1019
886
|
* worksheet.setFreezePanes(1, 1); // Freeze both top row and first column
|
|
1020
887
|
*/
|
|
1021
888
|
setFreezePanes(row: number, col: number): void;
|
|
1022
|
-
|
|
1023
889
|
/**
|
|
1024
890
|
* Add 2-color scale conditional formatting (gradient between two colors)
|
|
1025
891
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1029,15 +895,7 @@ export declare class Worksheet {
|
|
|
1029
895
|
* @param minColor - Color for minimum value
|
|
1030
896
|
* @param maxColor - Color for maximum value
|
|
1031
897
|
*/
|
|
1032
|
-
addConditionalFormat2ColorScale(
|
|
1033
|
-
firstRow: number,
|
|
1034
|
-
firstCol: number,
|
|
1035
|
-
lastRow: number,
|
|
1036
|
-
lastCol: number,
|
|
1037
|
-
minColor: Color,
|
|
1038
|
-
maxColor: Color
|
|
1039
|
-
): void;
|
|
1040
|
-
|
|
898
|
+
addConditionalFormat2ColorScale(firstRow: number, firstCol: number, lastRow: number, lastCol: number, minColor: Color, maxColor: Color): void;
|
|
1041
899
|
/**
|
|
1042
900
|
* Add 3-color scale conditional formatting (gradient across three colors)
|
|
1043
901
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1048,16 +906,7 @@ export declare class Worksheet {
|
|
|
1048
906
|
* @param midColor - Color for middle value
|
|
1049
907
|
* @param maxColor - Color for maximum value
|
|
1050
908
|
*/
|
|
1051
|
-
addConditionalFormat3ColorScale(
|
|
1052
|
-
firstRow: number,
|
|
1053
|
-
firstCol: number,
|
|
1054
|
-
lastRow: number,
|
|
1055
|
-
lastCol: number,
|
|
1056
|
-
minColor: Color,
|
|
1057
|
-
midColor: Color,
|
|
1058
|
-
maxColor: Color
|
|
1059
|
-
): void;
|
|
1060
|
-
|
|
909
|
+
addConditionalFormat3ColorScale(firstRow: number, firstCol: number, lastRow: number, lastCol: number, minColor: Color, midColor: Color, maxColor: Color): void;
|
|
1061
910
|
/**
|
|
1062
911
|
* Add data bar conditional formatting (horizontal bar visualization in cells)
|
|
1063
912
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1066,14 +915,7 @@ export declare class Worksheet {
|
|
|
1066
915
|
* @param lastCol - Last column of range (0-indexed)
|
|
1067
916
|
* @param barColor - Color for the data bars
|
|
1068
917
|
*/
|
|
1069
|
-
addConditionalFormatDataBar(
|
|
1070
|
-
firstRow: number,
|
|
1071
|
-
firstCol: number,
|
|
1072
|
-
lastRow: number,
|
|
1073
|
-
lastCol: number,
|
|
1074
|
-
barColor: Color
|
|
1075
|
-
): void;
|
|
1076
|
-
|
|
918
|
+
addConditionalFormatDataBar(firstRow: number, firstCol: number, lastRow: number, lastCol: number, barColor: Color): void;
|
|
1077
919
|
/**
|
|
1078
920
|
* Add cell-based conditional formatting (highlight cells based on value)
|
|
1079
921
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1084,16 +926,7 @@ export declare class Worksheet {
|
|
|
1084
926
|
* @param value - Comparison value
|
|
1085
927
|
* @param format - Format to apply to matching cells
|
|
1086
928
|
*/
|
|
1087
|
-
addConditionalFormatCell(
|
|
1088
|
-
firstRow: number,
|
|
1089
|
-
firstCol: number,
|
|
1090
|
-
lastRow: number,
|
|
1091
|
-
lastCol: number,
|
|
1092
|
-
rule: 'greaterThan' | 'lessThan' | 'equal' | 'notEqual' | 'greaterThanOrEqual' | 'lessThanOrEqual',
|
|
1093
|
-
value: number,
|
|
1094
|
-
format: Format
|
|
1095
|
-
): void;
|
|
1096
|
-
|
|
929
|
+
addConditionalFormatCell(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: "greaterThan" | "lessThan" | "equal" | "notEqual" | "greaterThanOrEqual" | "lessThanOrEqual", value: number, format: Format): void;
|
|
1097
930
|
/**
|
|
1098
931
|
* Add text-based conditional formatting (highlight cells based on text content)
|
|
1099
932
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1104,16 +937,7 @@ export declare class Worksheet {
|
|
|
1104
937
|
* @param text - Text to match
|
|
1105
938
|
* @param format - Format to apply to matching cells
|
|
1106
939
|
*/
|
|
1107
|
-
addConditionalFormatText(
|
|
1108
|
-
firstRow: number,
|
|
1109
|
-
firstCol: number,
|
|
1110
|
-
lastRow: number,
|
|
1111
|
-
lastCol: number,
|
|
1112
|
-
rule: 'contains' | 'notContains' | 'beginsWith' | 'endsWith',
|
|
1113
|
-
text: string,
|
|
1114
|
-
format: Format
|
|
1115
|
-
): void;
|
|
1116
|
-
|
|
940
|
+
addConditionalFormatText(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: "contains" | "notContains" | "beginsWith" | "endsWith", text: string, format: Format): void;
|
|
1117
941
|
/**
|
|
1118
942
|
* Add average/standard deviation conditional formatting
|
|
1119
943
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1123,15 +947,7 @@ export declare class Worksheet {
|
|
|
1123
947
|
* @param rule - Average rule ('aboveAverage', 'belowAverage', 'equalOrAboveAverage', 'equalOrBelowAverage')
|
|
1124
948
|
* @param format - Format to apply to matching cells
|
|
1125
949
|
*/
|
|
1126
|
-
addConditionalFormatAverage(
|
|
1127
|
-
firstRow: number,
|
|
1128
|
-
firstCol: number,
|
|
1129
|
-
lastRow: number,
|
|
1130
|
-
lastCol: number,
|
|
1131
|
-
rule: 'aboveAverage' | 'belowAverage' | 'equalOrAboveAverage' | 'equalOrBelowAverage',
|
|
1132
|
-
format: Format
|
|
1133
|
-
): void;
|
|
1134
|
-
|
|
950
|
+
addConditionalFormatAverage(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: "aboveAverage" | "belowAverage" | "equalOrAboveAverage" | "equalOrBelowAverage", format: Format): void;
|
|
1135
951
|
/**
|
|
1136
952
|
* Add top/bottom N values conditional formatting
|
|
1137
953
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1142,16 +958,7 @@ export declare class Worksheet {
|
|
|
1142
958
|
* @param value - Number of items or percentage
|
|
1143
959
|
* @param format - Format to apply to matching cells
|
|
1144
960
|
*/
|
|
1145
|
-
addConditionalFormatTop(
|
|
1146
|
-
firstRow: number,
|
|
1147
|
-
firstCol: number,
|
|
1148
|
-
lastRow: number,
|
|
1149
|
-
lastCol: number,
|
|
1150
|
-
rule: 'top' | 'bottom' | 'topPercent' | 'bottomPercent',
|
|
1151
|
-
value: number,
|
|
1152
|
-
format: Format
|
|
1153
|
-
): void;
|
|
1154
|
-
|
|
961
|
+
addConditionalFormatTop(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: "top" | "bottom" | "topPercent" | "bottomPercent", value: number, format: Format): void;
|
|
1155
962
|
/**
|
|
1156
963
|
* Add duplicate/unique values conditional formatting
|
|
1157
964
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1161,15 +968,7 @@ export declare class Worksheet {
|
|
|
1161
968
|
* @param invert - If true, highlight unique values instead of duplicates
|
|
1162
969
|
* @param format - Format to apply to matching cells
|
|
1163
970
|
*/
|
|
1164
|
-
addConditionalFormatDuplicate(
|
|
1165
|
-
firstRow: number,
|
|
1166
|
-
firstCol: number,
|
|
1167
|
-
lastRow: number,
|
|
1168
|
-
lastCol: number,
|
|
1169
|
-
invert: boolean,
|
|
1170
|
-
format: Format
|
|
1171
|
-
): void;
|
|
1172
|
-
|
|
971
|
+
addConditionalFormatDuplicate(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: Format): void;
|
|
1173
972
|
/**
|
|
1174
973
|
* Add blank/non-blank cells conditional formatting
|
|
1175
974
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1179,15 +978,7 @@ export declare class Worksheet {
|
|
|
1179
978
|
* @param invert - If true, highlight non-blank cells instead of blank
|
|
1180
979
|
* @param format - Format to apply to matching cells
|
|
1181
980
|
*/
|
|
1182
|
-
addConditionalFormatBlank(
|
|
1183
|
-
firstRow: number,
|
|
1184
|
-
firstCol: number,
|
|
1185
|
-
lastRow: number,
|
|
1186
|
-
lastCol: number,
|
|
1187
|
-
invert: boolean,
|
|
1188
|
-
format: Format
|
|
1189
|
-
): void;
|
|
1190
|
-
|
|
981
|
+
addConditionalFormatBlank(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: Format): void;
|
|
1191
982
|
/**
|
|
1192
983
|
* Add error/non-error cells conditional formatting
|
|
1193
984
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1197,15 +988,7 @@ export declare class Worksheet {
|
|
|
1197
988
|
* @param invert - If true, highlight non-error cells instead of errors
|
|
1198
989
|
* @param format - Format to apply to matching cells
|
|
1199
990
|
*/
|
|
1200
|
-
addConditionalFormatError(
|
|
1201
|
-
firstRow: number,
|
|
1202
|
-
firstCol: number,
|
|
1203
|
-
lastRow: number,
|
|
1204
|
-
lastCol: number,
|
|
1205
|
-
invert: boolean,
|
|
1206
|
-
format: Format
|
|
1207
|
-
): void;
|
|
1208
|
-
|
|
991
|
+
addConditionalFormatError(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: Format): void;
|
|
1209
992
|
/**
|
|
1210
993
|
* Add date-based conditional formatting
|
|
1211
994
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1215,15 +998,7 @@ export declare class Worksheet {
|
|
|
1215
998
|
* @param rule - Date rule ('yesterday', 'today', 'tomorrow', 'last7Days', 'lastWeek', 'thisWeek', 'nextWeek', 'lastMonth', 'thisMonth', 'nextMonth')
|
|
1216
999
|
* @param format - Format to apply to matching cells
|
|
1217
1000
|
*/
|
|
1218
|
-
addConditionalFormatDate(
|
|
1219
|
-
firstRow: number,
|
|
1220
|
-
firstCol: number,
|
|
1221
|
-
lastRow: number,
|
|
1222
|
-
lastCol: number,
|
|
1223
|
-
rule: 'yesterday' | 'today' | 'tomorrow' | 'last7Days' | 'lastWeek' | 'thisWeek' | 'nextWeek' | 'lastMonth' | 'thisMonth' | 'nextMonth',
|
|
1224
|
-
format: Format
|
|
1225
|
-
): void;
|
|
1226
|
-
|
|
1001
|
+
addConditionalFormatDate(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: "yesterday" | "today" | "tomorrow" | "last7Days" | "lastWeek" | "thisWeek" | "nextWeek" | "lastMonth" | "thisMonth" | "nextMonth", format: Format): void;
|
|
1227
1002
|
/**
|
|
1228
1003
|
* Add formula-based conditional formatting
|
|
1229
1004
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1233,15 +1008,7 @@ export declare class Worksheet {
|
|
|
1233
1008
|
* @param formula - Excel formula (e.g., '=MOD(ROW(),2)=0' for even rows)
|
|
1234
1009
|
* @param format - Format to apply when formula returns true
|
|
1235
1010
|
*/
|
|
1236
|
-
addConditionalFormatFormula(
|
|
1237
|
-
firstRow: number,
|
|
1238
|
-
firstCol: number,
|
|
1239
|
-
lastRow: number,
|
|
1240
|
-
lastCol: number,
|
|
1241
|
-
formula: string,
|
|
1242
|
-
format: Format
|
|
1243
|
-
): void;
|
|
1244
|
-
|
|
1011
|
+
addConditionalFormatFormula(firstRow: number, firstCol: number, lastRow: number, lastCol: number, formula: string, format: Format): void;
|
|
1245
1012
|
/**
|
|
1246
1013
|
* Add icon set conditional formatting
|
|
1247
1014
|
* @param firstRow - First row of range (0-indexed)
|
|
@@ -1250,17 +1017,7 @@ export declare class Worksheet {
|
|
|
1250
1017
|
* @param lastCol - Last column of range (0-indexed)
|
|
1251
1018
|
* @param iconType - Icon set type (e.g., 'threeArrows', 'threeTrafficLights', 'fiveStars', etc.)
|
|
1252
1019
|
*/
|
|
1253
|
-
addConditionalFormatIconSet(
|
|
1254
|
-
firstRow: number,
|
|
1255
|
-
firstCol: number,
|
|
1256
|
-
lastRow: number,
|
|
1257
|
-
lastCol: number,
|
|
1258
|
-
iconType: 'threeArrows' | 'threeArrowsGray' | 'threeFlags' | 'threeTrafficLights' | 'threeTrafficLightsWithRim' |
|
|
1259
|
-
'threeSigns' | 'threeSymbols' | 'threeSymbolsCircled' | 'threeStars' | 'threeTriangles' |
|
|
1260
|
-
'fourArrows' | 'fourArrowsGray' | 'fourRedToBlack' | 'fourHistograms' | 'fourTrafficLights' |
|
|
1261
|
-
'fiveArrows' | 'fiveArrowsGray' | 'fiveHistograms' | 'fiveQuadrants' | 'fiveBoxes'
|
|
1262
|
-
): void;
|
|
1263
|
-
|
|
1020
|
+
addConditionalFormatIconSet(firstRow: number, firstCol: number, lastRow: number, lastCol: number, iconType: "threeArrows" | "threeArrowsGray" | "threeFlags" | "threeTrafficLights" | "threeTrafficLightsWithRim" | "threeSigns" | "threeSymbols" | "threeSymbolsCircled" | "threeStars" | "threeTriangles" | "fourArrows" | "fourArrowsGray" | "fourRedToBlack" | "fourHistograms" | "fourTrafficLights" | "fiveArrows" | "fiveArrowsGray" | "fiveHistograms" | "fiveQuadrants" | "fiveBoxes"): void;
|
|
1264
1021
|
/**
|
|
1265
1022
|
* Set page margins for printing (in inches)
|
|
1266
1023
|
* @param left - Left margin
|
|
@@ -1271,23 +1028,19 @@ export declare class Worksheet {
|
|
|
1271
1028
|
* @param footer - Footer margin
|
|
1272
1029
|
*/
|
|
1273
1030
|
setMargins(left: number, right: number, top: number, bottom: number, header: number, footer: number): void;
|
|
1274
|
-
|
|
1275
1031
|
/**
|
|
1276
1032
|
* Set page orientation to portrait
|
|
1277
1033
|
*/
|
|
1278
1034
|
setPortrait(): void;
|
|
1279
|
-
|
|
1280
1035
|
/**
|
|
1281
1036
|
* Set page orientation to landscape
|
|
1282
1037
|
*/
|
|
1283
1038
|
setLandscape(): void;
|
|
1284
|
-
|
|
1285
1039
|
/**
|
|
1286
1040
|
* Set paper size for printing
|
|
1287
1041
|
* @param paperSize - Paper size code (1=Letter, 5=Legal, 9=A4, 11=A5, etc.)
|
|
1288
1042
|
*/
|
|
1289
1043
|
setPaperSize(paperSize: number): void;
|
|
1290
|
-
|
|
1291
1044
|
/**
|
|
1292
1045
|
* Set header text for printing
|
|
1293
1046
|
* @param header - Header text (use &L, &C, &R for left/center/right, &P for page number, &D for date)
|
|
@@ -1296,7 +1049,6 @@ export declare class Worksheet {
|
|
|
1296
1049
|
* worksheet.setHeader('&LCompany&CTitle&RPage &P'); // Left, center, and right
|
|
1297
1050
|
*/
|
|
1298
1051
|
setHeader(header: string): void;
|
|
1299
|
-
|
|
1300
1052
|
/**
|
|
1301
1053
|
* Set footer text for printing
|
|
1302
1054
|
* @param footer - Footer text (use &L, &C, &R for left/center/right, &P for page number, &D for date)
|
|
@@ -1305,7 +1057,6 @@ export declare class Worksheet {
|
|
|
1305
1057
|
* worksheet.setFooter('&L&D&RPage &P'); // Date left, page right
|
|
1306
1058
|
*/
|
|
1307
1059
|
setFooter(footer: string): void;
|
|
1308
|
-
|
|
1309
1060
|
/**
|
|
1310
1061
|
* Set print area (only this range will be printed)
|
|
1311
1062
|
* @param firstRow - First row of print area (0-indexed)
|
|
@@ -1314,25 +1065,21 @@ export declare class Worksheet {
|
|
|
1314
1065
|
* @param lastCol - Last column of print area (0-indexed)
|
|
1315
1066
|
*/
|
|
1316
1067
|
setPrintArea(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void;
|
|
1317
|
-
|
|
1318
1068
|
/**
|
|
1319
1069
|
* Show or hide gridlines when printing
|
|
1320
1070
|
* @param enable - True to show gridlines, false to hide
|
|
1321
1071
|
*/
|
|
1322
1072
|
setPrintGridlines(enable: boolean): void;
|
|
1323
|
-
|
|
1324
1073
|
/**
|
|
1325
1074
|
* Center worksheet horizontally on the page when printing
|
|
1326
1075
|
* @param enable - True to center horizontally
|
|
1327
1076
|
*/
|
|
1328
1077
|
setPrintCenterHorizontally(enable: boolean): void;
|
|
1329
|
-
|
|
1330
1078
|
/**
|
|
1331
1079
|
* Center worksheet vertically on the page when printing
|
|
1332
1080
|
* @param enable - True to center vertically
|
|
1333
1081
|
*/
|
|
1334
1082
|
setPrintCenterVertically(enable: boolean): void;
|
|
1335
|
-
|
|
1336
1083
|
/**
|
|
1337
1084
|
* Fit worksheet to N pages wide by M pages tall when printing
|
|
1338
1085
|
* @param width - Number of pages wide (0 = no limit)
|
|
@@ -1341,7 +1088,6 @@ export declare class Worksheet {
|
|
|
1341
1088
|
* worksheet.setPrintFitToPages(1, 0); // Fit to 1 page wide, unlimited height
|
|
1342
1089
|
*/
|
|
1343
1090
|
setPrintFitToPages(width: number, height: number): void;
|
|
1344
|
-
|
|
1345
1091
|
/**
|
|
1346
1092
|
* Set print scale as a percentage
|
|
1347
1093
|
* @param scale - Scale percentage (10-400)
|
|
@@ -1349,31 +1095,26 @@ export declare class Worksheet {
|
|
|
1349
1095
|
* worksheet.setPrintScale(75); // Print at 75% scale
|
|
1350
1096
|
*/
|
|
1351
1097
|
setPrintScale(scale: number): void;
|
|
1352
|
-
|
|
1353
1098
|
/**
|
|
1354
1099
|
* Set the first page number for printing
|
|
1355
1100
|
* @param pageNumber - Starting page number
|
|
1356
1101
|
*/
|
|
1357
1102
|
setPrintFirstPageNumber(pageNumber: number): void;
|
|
1358
|
-
|
|
1359
1103
|
/**
|
|
1360
1104
|
* Enable/disable black and white printing
|
|
1361
1105
|
* @param enable - True to print in black and white
|
|
1362
1106
|
*/
|
|
1363
1107
|
setPrintBlackAndWhite(enable: boolean): void;
|
|
1364
|
-
|
|
1365
1108
|
/**
|
|
1366
1109
|
* Enable/disable draft quality printing
|
|
1367
1110
|
* @param enable - True for draft quality
|
|
1368
1111
|
*/
|
|
1369
1112
|
setPrintDraft(enable: boolean): void;
|
|
1370
|
-
|
|
1371
1113
|
/**
|
|
1372
1114
|
* Enable/disable printing of row and column headings
|
|
1373
1115
|
* @param enable - True to print headings
|
|
1374
1116
|
*/
|
|
1375
1117
|
setPrintHeadings(enable: boolean): void;
|
|
1376
|
-
|
|
1377
1118
|
/**
|
|
1378
1119
|
* Repeat rows at the top of each printed page
|
|
1379
1120
|
* @param firstRow - First row to repeat (0-indexed)
|
|
@@ -1383,7 +1124,6 @@ export declare class Worksheet {
|
|
|
1383
1124
|
* worksheet.setRepeatRows(0, 2); // Repeat first 3 rows on each page
|
|
1384
1125
|
*/
|
|
1385
1126
|
setRepeatRows(firstRow: number, lastRow: number): void;
|
|
1386
|
-
|
|
1387
1127
|
/**
|
|
1388
1128
|
* Repeat columns at the left of each printed page
|
|
1389
1129
|
* @param firstCol - First column to repeat (0-indexed)
|
|
@@ -1393,19 +1133,16 @@ export declare class Worksheet {
|
|
|
1393
1133
|
* worksheet.setRepeatColumns(0, 1); // Repeat first 2 columns on each page
|
|
1394
1134
|
*/
|
|
1395
1135
|
setRepeatColumns(firstCol: number, lastCol: number): void;
|
|
1396
|
-
|
|
1397
1136
|
/**
|
|
1398
1137
|
* Scale header and footer with document
|
|
1399
1138
|
* @param enable - True to scale with document
|
|
1400
1139
|
*/
|
|
1401
1140
|
setHeaderFooterScaleWithDoc(enable: boolean): void;
|
|
1402
|
-
|
|
1403
1141
|
/**
|
|
1404
1142
|
* Align header and footer with page margins
|
|
1405
1143
|
* @param enable - True to align with page margins
|
|
1406
1144
|
*/
|
|
1407
1145
|
setHeaderFooterAlignWithPage(enable: boolean): void;
|
|
1408
|
-
|
|
1409
1146
|
/**
|
|
1410
1147
|
* Insert a chart at the specified cell position
|
|
1411
1148
|
* @param row - Row number (0-indexed)
|
|
@@ -1417,7 +1154,6 @@ export declare class Worksheet {
|
|
|
1417
1154
|
* worksheet.insertChart(1, 3, chart);
|
|
1418
1155
|
*/
|
|
1419
1156
|
insertChart(row: number, col: number, chart: Chart): void;
|
|
1420
|
-
|
|
1421
1157
|
/**
|
|
1422
1158
|
* Insert a chart at the specified cell position with pixel offsets
|
|
1423
1159
|
* @param row - Row number (0-indexed)
|
|
@@ -1431,7 +1167,6 @@ export declare class Worksheet {
|
|
|
1431
1167
|
* worksheet.insertChartWithOffset(1, 3, chart, 25, 10);
|
|
1432
1168
|
*/
|
|
1433
1169
|
insertChartWithOffset(row: number, col: number, chart: Chart, xOffset: number, yOffset: number): void;
|
|
1434
|
-
|
|
1435
1170
|
/**
|
|
1436
1171
|
* Insert an image at the specified cell position
|
|
1437
1172
|
* @param row - Row number (0-indexed)
|
|
@@ -1442,7 +1177,6 @@ export declare class Worksheet {
|
|
|
1442
1177
|
* worksheet.insertImage(0, 0, image);
|
|
1443
1178
|
*/
|
|
1444
1179
|
insertImage(row: number, col: number, image: Image): void;
|
|
1445
|
-
|
|
1446
1180
|
/**
|
|
1447
1181
|
* Insert an image at the specified cell position with pixel offsets
|
|
1448
1182
|
* @param row - Row number (0-indexed)
|
|
@@ -1455,7 +1189,6 @@ export declare class Worksheet {
|
|
|
1455
1189
|
* worksheet.insertImageWithOffset(1, 2, image, 10, 20);
|
|
1456
1190
|
*/
|
|
1457
1191
|
insertImageWithOffset(row: number, col: number, image: Image, xOffset: number, yOffset: number): void;
|
|
1458
|
-
|
|
1459
1192
|
/**
|
|
1460
1193
|
* Insert an image that fits to a cell
|
|
1461
1194
|
* @param row - Row number (0-indexed)
|
|
@@ -1467,7 +1200,6 @@ export declare class Worksheet {
|
|
|
1467
1200
|
* worksheet.insertImageFitToCell(0, 0, image, true);
|
|
1468
1201
|
*/
|
|
1469
1202
|
insertImageFitToCell(row: number, col: number, image: Image, keepAspectRatio?: boolean): void;
|
|
1470
|
-
|
|
1471
1203
|
/**
|
|
1472
1204
|
* Insert an image scaled proportionally and centered within a cell
|
|
1473
1205
|
* @param row - Row number (0-indexed)
|
|
@@ -1475,7 +1207,6 @@ export declare class Worksheet {
|
|
|
1475
1207
|
* @param image - Image instance
|
|
1476
1208
|
*/
|
|
1477
1209
|
insertImageFitToCellCentered(row: number, col: number, image: Image): void;
|
|
1478
|
-
|
|
1479
1210
|
/**
|
|
1480
1211
|
* Add a table to the worksheet
|
|
1481
1212
|
* @param firstRow - First row of the table (0-indexed)
|
|
@@ -1489,7 +1220,6 @@ export declare class Worksheet {
|
|
|
1489
1220
|
* worksheet.addTable(0, 0, 10, 4, table);
|
|
1490
1221
|
*/
|
|
1491
1222
|
addTable(firstRow: number, firstCol: number, lastRow: number, lastCol: number, table: Table): void;
|
|
1492
|
-
|
|
1493
1223
|
/**
|
|
1494
1224
|
* Add a sparkline to a single cell
|
|
1495
1225
|
* @param row - Row number (0-indexed)
|
|
@@ -1501,7 +1231,6 @@ export declare class Worksheet {
|
|
|
1501
1231
|
* worksheet.addSparkline(0, 5, sparkline);
|
|
1502
1232
|
*/
|
|
1503
1233
|
addSparkline(row: number, col: number, sparkline: Sparkline): void;
|
|
1504
|
-
|
|
1505
1234
|
/**
|
|
1506
1235
|
* Add a sparkline group to a range of cells
|
|
1507
1236
|
* @param firstRow - First row of the sparkline range (0-indexed)
|
|
@@ -1515,7 +1244,6 @@ export declare class Worksheet {
|
|
|
1515
1244
|
* worksheet.addSparklineGroup(0, 5, 2, 5, sparkline);
|
|
1516
1245
|
*/
|
|
1517
1246
|
addSparklineGroup(firstRow: number, firstCol: number, lastRow: number, lastCol: number, sparkline: Sparkline): void;
|
|
1518
|
-
|
|
1519
1247
|
/**
|
|
1520
1248
|
* Set the worksheet tab color
|
|
1521
1249
|
* @param color - Color name or hex code
|
|
@@ -1524,7 +1252,6 @@ export declare class Worksheet {
|
|
|
1524
1252
|
* worksheet.setTabColor('#FF0000');
|
|
1525
1253
|
*/
|
|
1526
1254
|
setTabColor(color: Color): void;
|
|
1527
|
-
|
|
1528
1255
|
/**
|
|
1529
1256
|
* Hide or show the worksheet
|
|
1530
1257
|
* @param enable - True to hide worksheet, false to show
|
|
@@ -1532,7 +1259,6 @@ export declare class Worksheet {
|
|
|
1532
1259
|
* worksheet.setHidden(true); // Hide worksheet
|
|
1533
1260
|
*/
|
|
1534
1261
|
setHidden(enable: boolean): void;
|
|
1535
|
-
|
|
1536
1262
|
/**
|
|
1537
1263
|
* Set the worksheet zoom level
|
|
1538
1264
|
* @param zoom - Zoom percentage (10-400)
|
|
@@ -1540,7 +1266,14 @@ export declare class Worksheet {
|
|
|
1540
1266
|
* worksheet.setZoom(150); // 150% zoom
|
|
1541
1267
|
*/
|
|
1542
1268
|
setZoom(zoom: number): void;
|
|
1543
|
-
|
|
1269
|
+
/**
|
|
1270
|
+
* Hide zero values in worksheet cells, the equivalent of turning off the Excel
|
|
1271
|
+
* option "Show a zero in cells that have zero value"
|
|
1272
|
+
* @param enable - True to hide zero values, false to show them (the default)
|
|
1273
|
+
* @example
|
|
1274
|
+
* worksheet.setHiddenZeroes(true);
|
|
1275
|
+
*/
|
|
1276
|
+
setHiddenZeroes(enable: boolean): void;
|
|
1544
1277
|
/**
|
|
1545
1278
|
* Set the default cell selection when opening the worksheet
|
|
1546
1279
|
* @param firstRow - First row of selection (0-indexed)
|
|
@@ -1551,7 +1284,6 @@ export declare class Worksheet {
|
|
|
1551
1284
|
* worksheet.setSelection(0, 0, 5, 5); // Select A1:F6
|
|
1552
1285
|
*/
|
|
1553
1286
|
setSelection(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void;
|
|
1554
|
-
|
|
1555
1287
|
/**
|
|
1556
1288
|
* Set which cell appears in the top-left corner when opening the worksheet
|
|
1557
1289
|
* @param row - Row number (0-indexed)
|
|
@@ -1560,7 +1292,6 @@ export declare class Worksheet {
|
|
|
1560
1292
|
* worksheet.setTopLeftCell(10, 0); // Start view at row 11
|
|
1561
1293
|
*/
|
|
1562
1294
|
setTopLeftCell(row: number, col: number): void;
|
|
1563
|
-
|
|
1564
1295
|
/**
|
|
1565
1296
|
* Protect the worksheet from editing
|
|
1566
1297
|
* Cells must be unlocked via format.setUnlocked() to remain editable
|
|
@@ -1568,7 +1299,6 @@ export declare class Worksheet {
|
|
|
1568
1299
|
* worksheet.protect(); // Protect all cells
|
|
1569
1300
|
*/
|
|
1570
1301
|
protect(): void;
|
|
1571
|
-
|
|
1572
1302
|
/**
|
|
1573
1303
|
* Protect the worksheet with a password
|
|
1574
1304
|
* @param password - Password to protect worksheet
|
|
@@ -1576,7 +1306,6 @@ export declare class Worksheet {
|
|
|
1576
1306
|
* worksheet.protectWithPassword('secret123');
|
|
1577
1307
|
*/
|
|
1578
1308
|
protectWithPassword(password: string): void;
|
|
1579
|
-
|
|
1580
1309
|
/**
|
|
1581
1310
|
* Protect the worksheet with granular protection options
|
|
1582
1311
|
* @param options - ProtectionOptions instance with desired settings
|
|
@@ -1587,7 +1316,6 @@ export declare class Worksheet {
|
|
|
1587
1316
|
* worksheet.protectWithOptions(options);
|
|
1588
1317
|
*/
|
|
1589
1318
|
protectWithOptions(options: ProtectionOptions): void;
|
|
1590
|
-
|
|
1591
1319
|
/**
|
|
1592
1320
|
* Protect the worksheet with a password and granular protection options
|
|
1593
1321
|
* @param password - Password to protect worksheet
|
|
@@ -1598,7 +1326,6 @@ export declare class Worksheet {
|
|
|
1598
1326
|
* worksheet.protectWithPasswordAndOptions('secret123', options);
|
|
1599
1327
|
*/
|
|
1600
1328
|
protectWithPasswordAndOptions(password: string, options: ProtectionOptions): void;
|
|
1601
|
-
|
|
1602
1329
|
/**
|
|
1603
1330
|
* Write a rich text string (multi-format text) to a cell
|
|
1604
1331
|
* @param row - Row number (0-indexed)
|
|
@@ -1611,7 +1338,6 @@ export declare class Worksheet {
|
|
|
1611
1338
|
* worksheet.writeRichString(0, 0, richText);
|
|
1612
1339
|
*/
|
|
1613
1340
|
writeRichString(row: number, col: number, richText: RichText): void;
|
|
1614
|
-
|
|
1615
1341
|
/**
|
|
1616
1342
|
* Write a rich text string with an additional cell format
|
|
1617
1343
|
* @param row - Row number (0-indexed)
|
|
@@ -1626,7 +1352,6 @@ export declare class Worksheet {
|
|
|
1626
1352
|
* worksheet.writeRichStringWithFormat(0, 0, richText, cellFormat);
|
|
1627
1353
|
*/
|
|
1628
1354
|
writeRichStringWithFormat(row: number, col: number, richText: RichText, cellFormat: Format): void;
|
|
1629
|
-
|
|
1630
1355
|
/**
|
|
1631
1356
|
* Insert a button at the specified cell position
|
|
1632
1357
|
* @param row - Row number (0-indexed)
|
|
@@ -1638,7 +1363,6 @@ export declare class Worksheet {
|
|
|
1638
1363
|
* worksheet.insertButton(0, 0, button);
|
|
1639
1364
|
*/
|
|
1640
1365
|
insertButton(row: number, col: number, button: Button): void;
|
|
1641
|
-
|
|
1642
1366
|
/**
|
|
1643
1367
|
* Insert a button at the specified cell position with pixel offsets
|
|
1644
1368
|
* @param row - Row number (0-indexed)
|
|
@@ -1652,7 +1376,6 @@ export declare class Worksheet {
|
|
|
1652
1376
|
* worksheet.insertButtonWithOffset(0, 0, button, 10, 5);
|
|
1653
1377
|
*/
|
|
1654
1378
|
insertButtonWithOffset(row: number, col: number, button: Button, xOffset: number, yOffset: number): void;
|
|
1655
|
-
|
|
1656
1379
|
/**
|
|
1657
1380
|
* Insert a shape at the specified cell position
|
|
1658
1381
|
* @param row - Row number (0-indexed)
|
|
@@ -1664,7 +1387,6 @@ export declare class Worksheet {
|
|
|
1664
1387
|
* worksheet.insertShape(0, 0, shape);
|
|
1665
1388
|
*/
|
|
1666
1389
|
insertShape(row: number, col: number, shape: Shape): void;
|
|
1667
|
-
|
|
1668
1390
|
/**
|
|
1669
1391
|
* Insert a shape at the specified cell position with pixel offsets
|
|
1670
1392
|
* @param row - Row number (0-indexed)
|
|
@@ -1679,22 +1401,8 @@ export declare class Worksheet {
|
|
|
1679
1401
|
*/
|
|
1680
1402
|
insertShapeWithOffset(row: number, col: number, shape: Shape, xOffset: number, yOffset: number): void;
|
|
1681
1403
|
}
|
|
1682
|
-
|
|
1683
1404
|
/** Chart type options */
|
|
1684
|
-
export type ChartType =
|
|
1685
|
-
| 'area' | 'areaStacked' | 'area_stacked' | 'areaPercentStacked' | 'area_percent_stacked'
|
|
1686
|
-
| 'bar' | 'barStacked' | 'bar_stacked' | 'barPercentStacked' | 'bar_percent_stacked'
|
|
1687
|
-
| 'column' | 'columnStacked' | 'column_stacked' | 'columnPercentStacked' | 'column_percent_stacked'
|
|
1688
|
-
| 'doughnut'
|
|
1689
|
-
| 'line' | 'lineStacked' | 'line_stacked' | 'linePercentStacked' | 'line_percent_stacked'
|
|
1690
|
-
| 'pie'
|
|
1691
|
-
| 'radar' | 'radarWithMarkers' | 'radar_with_markers' | 'radarFilled' | 'radar_filled'
|
|
1692
|
-
| 'scatter' | 'scatterStraight' | 'scatter_straight'
|
|
1693
|
-
| 'scatterStraightWithMarkers' | 'scatter_straight_with_markers'
|
|
1694
|
-
| 'scatterSmooth' | 'scatter_smooth'
|
|
1695
|
-
| 'scatterSmoothWithMarkers' | 'scatter_smooth_with_markers'
|
|
1696
|
-
| 'stock';
|
|
1697
|
-
|
|
1405
|
+
export type ChartType = "area" | "areaStacked" | "area_stacked" | "areaPercentStacked" | "area_percent_stacked" | "bar" | "barStacked" | "bar_stacked" | "barPercentStacked" | "bar_percent_stacked" | "column" | "columnStacked" | "column_stacked" | "columnPercentStacked" | "column_percent_stacked" | "doughnut" | "line" | "lineStacked" | "line_stacked" | "linePercentStacked" | "line_percent_stacked" | "pie" | "radar" | "radarWithMarkers" | "radar_with_markers" | "radarFilled" | "radar_filled" | "scatter" | "scatterStraight" | "scatter_straight" | "scatterStraightWithMarkers" | "scatter_straight_with_markers" | "scatterSmooth" | "scatter_smooth" | "scatterSmoothWithMarkers" | "scatter_smooth_with_markers" | "stock";
|
|
1698
1406
|
/** Chart series configuration options */
|
|
1699
1407
|
export interface ChartSeriesOptions {
|
|
1700
1408
|
/** Data values range (e.g., 'Sheet1!$B$2:$B$7') */
|
|
@@ -1704,7 +1412,6 @@ export interface ChartSeriesOptions {
|
|
|
1704
1412
|
/** Series name (optional, e.g., 'Sales Q1' or 'Sheet1!$B$1') */
|
|
1705
1413
|
name?: string;
|
|
1706
1414
|
}
|
|
1707
|
-
|
|
1708
1415
|
/**
|
|
1709
1416
|
* Chart class for creating Excel charts
|
|
1710
1417
|
*
|
|
@@ -1723,8 +1430,7 @@ export interface ChartSeriesOptions {
|
|
|
1723
1430
|
*/
|
|
1724
1431
|
export declare class Chart {
|
|
1725
1432
|
/** Internal native binding */
|
|
1726
|
-
_native:
|
|
1727
|
-
|
|
1433
|
+
_native: RuscChart;
|
|
1728
1434
|
/**
|
|
1729
1435
|
* Create a new chart
|
|
1730
1436
|
* @param chartType - Type of chart to create
|
|
@@ -1734,7 +1440,6 @@ export declare class Chart {
|
|
|
1734
1440
|
* const lineChart = new Chart('line');
|
|
1735
1441
|
*/
|
|
1736
1442
|
constructor(chartType: ChartType);
|
|
1737
|
-
|
|
1738
1443
|
/**
|
|
1739
1444
|
* Add a data series to the chart
|
|
1740
1445
|
* @param options - Series configuration options
|
|
@@ -1746,7 +1451,6 @@ export declare class Chart {
|
|
|
1746
1451
|
* });
|
|
1747
1452
|
*/
|
|
1748
1453
|
addSeries(options: ChartSeriesOptions): void;
|
|
1749
|
-
|
|
1750
1454
|
/**
|
|
1751
1455
|
* Set the chart title
|
|
1752
1456
|
* @param title - Chart title text
|
|
@@ -1754,7 +1458,6 @@ export declare class Chart {
|
|
|
1754
1458
|
* chart.setTitle('Q1 Sales Results');
|
|
1755
1459
|
*/
|
|
1756
1460
|
setTitle(title: string): this;
|
|
1757
|
-
|
|
1758
1461
|
/**
|
|
1759
1462
|
* Set the X-axis label
|
|
1760
1463
|
* @param name - X-axis label text
|
|
@@ -1762,7 +1465,6 @@ export declare class Chart {
|
|
|
1762
1465
|
* chart.setXAxisName('Month');
|
|
1763
1466
|
*/
|
|
1764
1467
|
setXAxisName(name: string): this;
|
|
1765
|
-
|
|
1766
1468
|
/**
|
|
1767
1469
|
* Set the Y-axis label
|
|
1768
1470
|
* @param name - Y-axis label text
|
|
@@ -1770,7 +1472,6 @@ export declare class Chart {
|
|
|
1770
1472
|
* chart.setYAxisName('Revenue ($)');
|
|
1771
1473
|
*/
|
|
1772
1474
|
setYAxisName(name: string): this;
|
|
1773
|
-
|
|
1774
1475
|
/**
|
|
1775
1476
|
* Set the chart style (1-48)
|
|
1776
1477
|
* @param style - Excel chart style number (1-48)
|
|
@@ -1778,7 +1479,6 @@ export declare class Chart {
|
|
|
1778
1479
|
* chart.setStyle(11); // Apply Excel style 11
|
|
1779
1480
|
*/
|
|
1780
1481
|
setStyle(style: number): this;
|
|
1781
|
-
|
|
1782
1482
|
/**
|
|
1783
1483
|
* Hide the chart legend
|
|
1784
1484
|
* @example
|
|
@@ -1786,7 +1486,6 @@ export declare class Chart {
|
|
|
1786
1486
|
*/
|
|
1787
1487
|
setLegendHidden(): this;
|
|
1788
1488
|
}
|
|
1789
|
-
|
|
1790
1489
|
/**
|
|
1791
1490
|
* Table class for creating Excel tables
|
|
1792
1491
|
*
|
|
@@ -1799,74 +1498,62 @@ export declare class Chart {
|
|
|
1799
1498
|
*/
|
|
1800
1499
|
export declare class Table {
|
|
1801
1500
|
/** Internal native binding */
|
|
1802
|
-
_native:
|
|
1803
|
-
|
|
1501
|
+
_native: RuscTable;
|
|
1804
1502
|
/** Create a new table */
|
|
1805
1503
|
constructor();
|
|
1806
|
-
|
|
1807
1504
|
/**
|
|
1808
1505
|
* Set whether the table has a header row
|
|
1809
1506
|
* @param show - Show header row (default: true)
|
|
1810
1507
|
*/
|
|
1811
1508
|
setHeaderRow(show: boolean): this;
|
|
1812
|
-
|
|
1813
1509
|
/**
|
|
1814
1510
|
* Set whether the table has a total row
|
|
1815
1511
|
* @param show - Show total row (default: false)
|
|
1816
1512
|
*/
|
|
1817
1513
|
setTotalRow(show: boolean): this;
|
|
1818
|
-
|
|
1819
1514
|
/**
|
|
1820
1515
|
* Set whether the table has banded rows
|
|
1821
1516
|
* @param show - Show banded rows (default: true)
|
|
1822
1517
|
*/
|
|
1823
1518
|
setBandedRows(show: boolean): this;
|
|
1824
|
-
|
|
1825
1519
|
/**
|
|
1826
1520
|
* Set whether the table has banded columns
|
|
1827
1521
|
* @param show - Show banded columns (default: false)
|
|
1828
1522
|
*/
|
|
1829
1523
|
setBandedColumns(show: boolean): this;
|
|
1830
|
-
|
|
1831
1524
|
/**
|
|
1832
1525
|
* Set whether the first column is formatted
|
|
1833
1526
|
* @param show - Format first column (default: false)
|
|
1834
1527
|
*/
|
|
1835
1528
|
setFirstColumn(show: boolean): this;
|
|
1836
|
-
|
|
1837
1529
|
/**
|
|
1838
1530
|
* Set whether the last column is formatted
|
|
1839
1531
|
* @param show - Format last column (default: false)
|
|
1840
1532
|
*/
|
|
1841
1533
|
setLastColumn(show: boolean): this;
|
|
1842
|
-
|
|
1843
1534
|
/**
|
|
1844
1535
|
* Set the name of the table
|
|
1845
1536
|
* @param name - Table name (must be unique)
|
|
1846
1537
|
*/
|
|
1847
1538
|
setName(name: string): this;
|
|
1848
|
-
|
|
1849
1539
|
/** Set alternative text for screen readers */
|
|
1850
1540
|
setAltText(altText: string): this;
|
|
1851
|
-
|
|
1852
1541
|
/** Set the alternative text title for screen readers */
|
|
1853
1542
|
setAltTextTitle(title: string): this;
|
|
1854
|
-
|
|
1855
1543
|
/**
|
|
1856
1544
|
* Set the style of the table
|
|
1857
|
-
* @param styleId - Table style ID (1-21: light, 22-49: medium, 50-60: dark)
|
|
1545
|
+
* @param styleId - Table style ID (0: no style, 1-21: light, 22-49: medium, 50-60: dark)
|
|
1546
|
+
* @throws If the ID is outside 0-60
|
|
1858
1547
|
* @example
|
|
1859
|
-
* table.setStyle(
|
|
1548
|
+
* table.setStyle(30); // Medium style 9, Excel's default
|
|
1860
1549
|
*/
|
|
1861
1550
|
setStyle(styleId: number): this;
|
|
1862
|
-
|
|
1863
1551
|
/**
|
|
1864
1552
|
* Set columns for the table
|
|
1865
1553
|
* @param columns - Array of TableColumn objects
|
|
1866
1554
|
*/
|
|
1867
1555
|
setColumns(columns: TableColumn[]): this;
|
|
1868
1556
|
}
|
|
1869
|
-
|
|
1870
1557
|
/**
|
|
1871
1558
|
* TableColumn class for configuring table columns
|
|
1872
1559
|
*
|
|
@@ -1877,36 +1564,30 @@ export declare class Table {
|
|
|
1877
1564
|
*/
|
|
1878
1565
|
export declare class TableColumn {
|
|
1879
1566
|
/** Internal native binding */
|
|
1880
|
-
_native:
|
|
1881
|
-
|
|
1567
|
+
_native: RuscTableColumn;
|
|
1882
1568
|
/** Create a new table column */
|
|
1883
1569
|
constructor();
|
|
1884
|
-
|
|
1885
1570
|
/**
|
|
1886
1571
|
* Set the header name for the column
|
|
1887
1572
|
* @param header - Column header text
|
|
1888
1573
|
*/
|
|
1889
1574
|
setHeader(header: string): this;
|
|
1890
|
-
|
|
1891
1575
|
/**
|
|
1892
1576
|
* Set the total function for the column
|
|
1893
1577
|
* @param func - Function: 'average', 'count', 'countNumbers', 'max', 'min', 'stdDev', 'sum', 'var'
|
|
1894
1578
|
*/
|
|
1895
|
-
setTotalFunction(func:
|
|
1896
|
-
|
|
1579
|
+
setTotalFunction(func: "average" | "count" | "countNumbers" | "max" | "min" | "stdDev" | "sum" | "var"): this;
|
|
1897
1580
|
/**
|
|
1898
1581
|
* Set a custom total label for the column
|
|
1899
1582
|
* @param label - Total row label text
|
|
1900
1583
|
*/
|
|
1901
1584
|
setTotalLabel(label: string): this;
|
|
1902
|
-
|
|
1903
1585
|
/**
|
|
1904
1586
|
* Set a custom formula for the column
|
|
1905
1587
|
* @param formula - Excel formula (without '=')
|
|
1906
1588
|
*/
|
|
1907
1589
|
setFormula(formula: string): this;
|
|
1908
1590
|
}
|
|
1909
|
-
|
|
1910
1591
|
/**
|
|
1911
1592
|
* Sparkline class for creating Excel sparklines
|
|
1912
1593
|
*
|
|
@@ -1919,162 +1600,136 @@ export declare class TableColumn {
|
|
|
1919
1600
|
*/
|
|
1920
1601
|
export declare class Sparkline {
|
|
1921
1602
|
/** Internal native binding */
|
|
1922
|
-
_native:
|
|
1923
|
-
|
|
1603
|
+
_native: RuscSparkline;
|
|
1924
1604
|
/** Create a new sparkline */
|
|
1925
1605
|
constructor();
|
|
1926
|
-
|
|
1927
1606
|
/**
|
|
1928
1607
|
* Set the data range for the sparkline
|
|
1929
|
-
* @param range - Range string (e.g., 'Sheet1!A1:E1' or 'A1:E1')
|
|
1608
|
+
* @param range - Range string (e.g., 'Sheet1!A1:E1' or 'A1:E1'); a range without a
|
|
1609
|
+
* sheet name refers to the worksheet the sparkline is added to
|
|
1930
1610
|
*/
|
|
1931
1611
|
setRange(range: string): this;
|
|
1932
|
-
|
|
1933
1612
|
/**
|
|
1934
1613
|
* Set the type of sparkline
|
|
1935
1614
|
* @param type - Sparkline type: 'line', 'column', or 'winLose'
|
|
1936
1615
|
*/
|
|
1937
|
-
setType(type:
|
|
1938
|
-
|
|
1616
|
+
setType(type: "line" | "column" | "winLose"): this;
|
|
1939
1617
|
/**
|
|
1940
1618
|
* Show markers for the highest point
|
|
1941
1619
|
* @param enable - Enable high point marker
|
|
1942
1620
|
*/
|
|
1943
1621
|
showHighPoint(enable: boolean): this;
|
|
1944
|
-
|
|
1945
1622
|
/**
|
|
1946
1623
|
* Show markers for the lowest point
|
|
1947
1624
|
* @param enable - Enable low point marker
|
|
1948
1625
|
*/
|
|
1949
1626
|
showLowPoint(enable: boolean): this;
|
|
1950
|
-
|
|
1951
1627
|
/**
|
|
1952
1628
|
* Show markers for the first point
|
|
1953
1629
|
* @param enable - Enable first point marker
|
|
1954
1630
|
*/
|
|
1955
1631
|
showFirstPoint(enable: boolean): this;
|
|
1956
|
-
|
|
1957
1632
|
/**
|
|
1958
1633
|
* Show markers for the last point
|
|
1959
1634
|
* @param enable - Enable last point marker
|
|
1960
1635
|
*/
|
|
1961
1636
|
showLastPoint(enable: boolean): this;
|
|
1962
|
-
|
|
1963
1637
|
/**
|
|
1964
1638
|
* Show markers for negative points
|
|
1965
1639
|
* @param enable - Enable negative point markers
|
|
1966
1640
|
*/
|
|
1967
1641
|
showNegativePoints(enable: boolean): this;
|
|
1968
|
-
|
|
1969
1642
|
/**
|
|
1970
1643
|
* Show markers for all points
|
|
1971
1644
|
* @param enable - Enable all point markers
|
|
1972
1645
|
*/
|
|
1973
1646
|
showMarkers(enable: boolean): this;
|
|
1974
|
-
|
|
1975
1647
|
/**
|
|
1976
1648
|
* Show the horizontal axis
|
|
1977
1649
|
* @param enable - Enable axis display
|
|
1978
1650
|
*/
|
|
1979
1651
|
showAxis(enable: boolean): this;
|
|
1980
|
-
|
|
1981
1652
|
/**
|
|
1982
1653
|
* Show data from hidden rows/columns
|
|
1983
1654
|
* @param enable - Enable hidden data display
|
|
1984
1655
|
*/
|
|
1985
1656
|
showHiddenData(enable: boolean): this;
|
|
1986
|
-
|
|
1987
1657
|
/**
|
|
1988
1658
|
* Display sparkline right to left
|
|
1989
1659
|
* @param enable - Enable right-to-left direction
|
|
1990
1660
|
*/
|
|
1991
1661
|
setRightToLeft(enable: boolean): this;
|
|
1992
|
-
|
|
1993
1662
|
/**
|
|
1994
1663
|
* Set the color of the sparkline
|
|
1995
1664
|
* @param color - Hex color (e.g., '#FF0000')
|
|
1996
1665
|
*/
|
|
1997
1666
|
setSparklineColor(color: string): this;
|
|
1998
|
-
|
|
1999
1667
|
/**
|
|
2000
1668
|
* Set the color of the high point marker
|
|
2001
1669
|
* @param color - Hex color (e.g., '#00FF00')
|
|
2002
1670
|
*/
|
|
2003
1671
|
setHighPointColor(color: string): this;
|
|
2004
|
-
|
|
2005
1672
|
/**
|
|
2006
1673
|
* Set the color of the low point marker
|
|
2007
1674
|
* @param color - Hex color (e.g., '#FF0000')
|
|
2008
1675
|
*/
|
|
2009
1676
|
setLowPointColor(color: string): this;
|
|
2010
|
-
|
|
2011
1677
|
/**
|
|
2012
1678
|
* Set the color of the first point marker
|
|
2013
1679
|
* @param color - Hex color (e.g., '#0000FF')
|
|
2014
1680
|
*/
|
|
2015
1681
|
setFirstPointColor(color: string): this;
|
|
2016
|
-
|
|
2017
1682
|
/**
|
|
2018
1683
|
* Set the color of the last point marker
|
|
2019
1684
|
* @param color - Hex color (e.g., '#0000FF')
|
|
2020
1685
|
*/
|
|
2021
1686
|
setLastPointColor(color: string): this;
|
|
2022
|
-
|
|
2023
1687
|
/**
|
|
2024
1688
|
* Set the color of negative point markers
|
|
2025
1689
|
* @param color - Hex color (e.g., '#FFA500')
|
|
2026
1690
|
*/
|
|
2027
1691
|
setNegativePointsColor(color: string): this;
|
|
2028
|
-
|
|
2029
1692
|
/**
|
|
2030
1693
|
* Set the color of all point markers
|
|
2031
1694
|
* @param color - Hex color (e.g., '#000000')
|
|
2032
1695
|
*/
|
|
2033
1696
|
setMarkersColor(color: string): this;
|
|
2034
|
-
|
|
2035
1697
|
/**
|
|
2036
1698
|
* Set the line weight/width
|
|
2037
1699
|
* @param weight - Line weight (default: 0.75)
|
|
2038
1700
|
*/
|
|
2039
1701
|
setLineWeight(weight: number): this;
|
|
2040
|
-
|
|
2041
1702
|
/**
|
|
2042
1703
|
* Set the custom maximum value for vertical axis
|
|
2043
1704
|
* @param max - Maximum value
|
|
2044
1705
|
*/
|
|
2045
1706
|
setCustomMax(max: number): this;
|
|
2046
|
-
|
|
2047
1707
|
/**
|
|
2048
1708
|
* Set the custom minimum value for vertical axis
|
|
2049
1709
|
* @param min - Minimum value
|
|
2050
1710
|
*/
|
|
2051
1711
|
setCustomMin(min: number): this;
|
|
2052
|
-
|
|
2053
1712
|
/**
|
|
2054
1713
|
* Set maximum value based on group maximum
|
|
2055
1714
|
* @param enable - Use group maximum
|
|
2056
1715
|
*/
|
|
2057
1716
|
setGroupMax(enable: boolean): this;
|
|
2058
|
-
|
|
2059
1717
|
/**
|
|
2060
1718
|
* Set minimum value based on group minimum
|
|
2061
1719
|
* @param enable - Use group minimum
|
|
2062
1720
|
*/
|
|
2063
1721
|
setGroupMin(enable: boolean): this;
|
|
2064
|
-
|
|
2065
1722
|
/**
|
|
2066
1723
|
* Set a predefined style
|
|
2067
1724
|
* @param style - Style number (1-36)
|
|
2068
1725
|
*/
|
|
2069
1726
|
setStyle(style: number): this;
|
|
2070
|
-
|
|
2071
1727
|
/**
|
|
2072
1728
|
* Set how empty cells are displayed
|
|
2073
1729
|
* @param option - Display option: 'gaps', 'zero', or 'connected'
|
|
2074
1730
|
*/
|
|
2075
|
-
showEmptyCellsAs(option:
|
|
1731
|
+
showEmptyCellsAs(option: "gaps" | "zero" | "connected"): this;
|
|
2076
1732
|
}
|
|
2077
|
-
|
|
2078
1733
|
/**
|
|
2079
1734
|
* DocProperties class for setting document metadata
|
|
2080
1735
|
*
|
|
@@ -2087,72 +1742,60 @@ export declare class Sparkline {
|
|
|
2087
1742
|
*/
|
|
2088
1743
|
export declare class DocProperties {
|
|
2089
1744
|
/** Internal native binding */
|
|
2090
|
-
_native:
|
|
2091
|
-
|
|
1745
|
+
_native: RuscDocProperties;
|
|
2092
1746
|
/** Create a new DocProperties instance */
|
|
2093
1747
|
constructor();
|
|
2094
|
-
|
|
2095
1748
|
/**
|
|
2096
1749
|
* Set the document author
|
|
2097
1750
|
* @param author - Author name
|
|
2098
1751
|
*/
|
|
2099
1752
|
setAuthor(author: string): this;
|
|
2100
|
-
|
|
2101
1753
|
/**
|
|
2102
1754
|
* Set the document title
|
|
2103
1755
|
* @param title - Document title
|
|
2104
1756
|
*/
|
|
2105
1757
|
setTitle(title: string): this;
|
|
2106
|
-
|
|
2107
1758
|
/**
|
|
2108
1759
|
* Set the document subject
|
|
2109
1760
|
* @param subject - Document subject
|
|
2110
1761
|
*/
|
|
2111
1762
|
setSubject(subject: string): this;
|
|
2112
|
-
|
|
2113
1763
|
/**
|
|
2114
1764
|
* Set the document comment/description
|
|
2115
1765
|
* @param comment - Document comment
|
|
2116
1766
|
*/
|
|
2117
1767
|
setComment(comment: string): this;
|
|
2118
|
-
|
|
2119
1768
|
/**
|
|
2120
1769
|
* Set the company name
|
|
2121
1770
|
* @param company - Company name
|
|
2122
1771
|
*/
|
|
2123
1772
|
setCompany(company: string): this;
|
|
2124
|
-
|
|
2125
1773
|
/**
|
|
2126
1774
|
* Set the manager name
|
|
2127
1775
|
* @param manager - Manager name
|
|
2128
1776
|
*/
|
|
2129
1777
|
setManager(manager: string): this;
|
|
2130
|
-
|
|
2131
1778
|
/**
|
|
2132
1779
|
* Set the document status
|
|
2133
1780
|
* @param status - Document status (e.g., 'Draft', 'Final')
|
|
2134
1781
|
*/
|
|
2135
1782
|
setStatus(status: string): this;
|
|
2136
|
-
|
|
2137
1783
|
/**
|
|
2138
1784
|
* Set the document category
|
|
2139
1785
|
* @param category - Document category
|
|
2140
1786
|
*/
|
|
2141
1787
|
setCategory(category: string): this;
|
|
2142
|
-
|
|
2143
1788
|
/**
|
|
2144
1789
|
* Set document keywords for searching
|
|
2145
1790
|
* @param keywords - Comma-separated keywords
|
|
2146
1791
|
*/
|
|
2147
1792
|
setKeywords(keywords: string): this;
|
|
2148
|
-
|
|
2149
1793
|
/**
|
|
2150
1794
|
* Set the hyperlink base URL
|
|
2151
1795
|
* @param base - Base URL for relative hyperlinks
|
|
2152
1796
|
*/
|
|
2153
1797
|
setHyperlinkBase(base: string): this;
|
|
2154
1798
|
}
|
|
2155
|
-
|
|
2156
1799
|
/**
|
|
2157
1800
|
* Button class for Excel form control buttons
|
|
2158
1801
|
*
|
|
@@ -2166,48 +1809,40 @@ export declare class DocProperties {
|
|
|
2166
1809
|
*/
|
|
2167
1810
|
export declare class Button {
|
|
2168
1811
|
/** Internal native binding */
|
|
2169
|
-
_native:
|
|
2170
|
-
|
|
1812
|
+
_native: RuscButton;
|
|
2171
1813
|
/** Create a new button */
|
|
2172
1814
|
constructor();
|
|
2173
|
-
|
|
2174
1815
|
/**
|
|
2175
1816
|
* Set the button caption/text
|
|
2176
1817
|
* @param caption - Text displayed on the button
|
|
2177
1818
|
*/
|
|
2178
1819
|
setCaption(caption: string): this;
|
|
2179
|
-
|
|
2180
1820
|
/**
|
|
2181
1821
|
* Set the VBA macro to run when button is clicked
|
|
2182
1822
|
* @param macroName - Name of the VBA macro
|
|
2183
1823
|
*/
|
|
2184
1824
|
setMacro(macroName: string): this;
|
|
2185
|
-
|
|
2186
1825
|
/**
|
|
2187
1826
|
* Set the button width in pixels
|
|
2188
1827
|
* @param width - Width in pixels
|
|
2189
1828
|
*/
|
|
2190
1829
|
setWidth(width: number): this;
|
|
2191
|
-
|
|
2192
1830
|
/**
|
|
2193
1831
|
* Set the button height in pixels
|
|
2194
1832
|
* @param height - Height in pixels
|
|
2195
1833
|
*/
|
|
2196
1834
|
setHeight(height: number): this;
|
|
2197
|
-
|
|
2198
1835
|
/**
|
|
2199
1836
|
* Set alt text for accessibility
|
|
2200
1837
|
* @param altText - Accessibility description
|
|
2201
1838
|
*/
|
|
2202
1839
|
setAltText(altText: string): this;
|
|
2203
|
-
|
|
2204
1840
|
/**
|
|
2205
1841
|
* Set how the button moves and sizes with cells
|
|
2206
1842
|
* @param option - Movement option: 'moveAndSize', 'moveOnly', 'none', or 'moveAndSizeAfter'
|
|
2207
1843
|
*/
|
|
2208
|
-
setObjectMovement(option:
|
|
1844
|
+
setObjectMovement(option: "moveAndSize" | "moveOnly" | "none" | "moveAndSizeAfter"): this;
|
|
2209
1845
|
}
|
|
2210
|
-
|
|
2211
1846
|
/**
|
|
2212
1847
|
* Shape class for Excel shapes (textboxes)
|
|
2213
1848
|
*
|
|
@@ -2220,45 +1855,40 @@ export declare class Button {
|
|
|
2220
1855
|
*/
|
|
2221
1856
|
export declare class Shape {
|
|
2222
1857
|
/** Internal native binding */
|
|
2223
|
-
_native:
|
|
2224
|
-
|
|
1858
|
+
_native: RuscShape;
|
|
1859
|
+
/** Shapes are created through factories such as {@link Shape.textbox}. */
|
|
1860
|
+
private constructor();
|
|
2225
1861
|
/**
|
|
2226
1862
|
* Create a new textbox shape
|
|
2227
1863
|
* @returns Shape instance configured as a textbox
|
|
2228
1864
|
*/
|
|
2229
1865
|
static textbox(): Shape;
|
|
2230
|
-
|
|
2231
1866
|
/**
|
|
2232
1867
|
* Set the text content of the textbox
|
|
2233
1868
|
* @param text - Text content
|
|
2234
1869
|
*/
|
|
2235
1870
|
setText(text: string): this;
|
|
2236
|
-
|
|
2237
1871
|
/**
|
|
2238
1872
|
* Set the shape width in pixels
|
|
2239
1873
|
* @param width - Width in pixels
|
|
2240
1874
|
*/
|
|
2241
1875
|
setWidth(width: number): this;
|
|
2242
|
-
|
|
2243
1876
|
/**
|
|
2244
1877
|
* Set the shape height in pixels
|
|
2245
1878
|
* @param height - Height in pixels
|
|
2246
1879
|
*/
|
|
2247
1880
|
setHeight(height: number): this;
|
|
2248
|
-
|
|
2249
1881
|
/**
|
|
2250
1882
|
* Set alt text for accessibility
|
|
2251
1883
|
* @param altText - Accessibility description
|
|
2252
1884
|
*/
|
|
2253
1885
|
setAltText(altText: string): this;
|
|
2254
|
-
|
|
2255
1886
|
/**
|
|
2256
1887
|
* Set how the shape moves and sizes with cells
|
|
2257
1888
|
* @param option - Movement option: 'moveAndSize', 'moveOnly', 'none', or 'moveAndSizeAfter'
|
|
2258
1889
|
*/
|
|
2259
|
-
setObjectMovement(option:
|
|
1890
|
+
setObjectMovement(option: "moveAndSize" | "moveOnly" | "none" | "moveAndSizeAfter"): this;
|
|
2260
1891
|
}
|
|
2261
|
-
|
|
2262
1892
|
/**
|
|
2263
1893
|
* Workbook class for Excel file creation
|
|
2264
1894
|
*
|
|
@@ -2270,18 +1900,15 @@ export declare class Shape {
|
|
|
2270
1900
|
*/
|
|
2271
1901
|
export declare class Workbook {
|
|
2272
1902
|
/** Internal native binding */
|
|
2273
|
-
_native:
|
|
2274
|
-
|
|
1903
|
+
_native: RuscWorkbook;
|
|
2275
1904
|
/** Create a new workbook */
|
|
2276
1905
|
constructor();
|
|
2277
|
-
|
|
2278
1906
|
/**
|
|
2279
1907
|
* Add a new worksheet to the workbook
|
|
2280
1908
|
* @param name - Optional worksheet name
|
|
2281
1909
|
* @returns Worksheet instance
|
|
2282
1910
|
*/
|
|
2283
1911
|
addWorksheet(name?: string): Worksheet;
|
|
2284
|
-
|
|
2285
1912
|
/**
|
|
2286
1913
|
* Add a new worksheet with constant memory mode (minimal memory footprint)
|
|
2287
1914
|
* Sequential row writing only, limited merge support, no tables.
|
|
@@ -2289,7 +1916,6 @@ export declare class Workbook {
|
|
|
2289
1916
|
* @returns Worksheet instance in constant memory mode
|
|
2290
1917
|
*/
|
|
2291
1918
|
addWorksheetWithConstantMemory(name?: string): Worksheet;
|
|
2292
|
-
|
|
2293
1919
|
/**
|
|
2294
1920
|
* Add a new worksheet with low memory mode (balanced optimization)
|
|
2295
1921
|
* Good for large datasets with repeated strings.
|
|
@@ -2297,14 +1923,12 @@ export declare class Workbook {
|
|
|
2297
1923
|
* @returns Worksheet instance in low memory mode
|
|
2298
1924
|
*/
|
|
2299
1925
|
addWorksheetWithLowMemory(name?: string): Worksheet;
|
|
2300
|
-
|
|
2301
1926
|
/**
|
|
2302
1927
|
* Set custom temporary directory for constant/low memory modes
|
|
2303
1928
|
* Must be called BEFORE adding memory mode worksheets
|
|
2304
1929
|
* @param dir - Directory path for temporary files
|
|
2305
1930
|
*/
|
|
2306
1931
|
setTempdir(dir: string): void;
|
|
2307
|
-
|
|
2308
1932
|
/**
|
|
2309
1933
|
* Set the default workbook format and row/column dimensions.
|
|
2310
1934
|
* Must be called before adding worksheets.
|
|
@@ -2313,31 +1937,51 @@ export declare class Workbook {
|
|
|
2313
1937
|
* @param columnWidth - Supported default column width in pixels: 56, 64, 72, 80, 96, 104, or 120
|
|
2314
1938
|
*/
|
|
2315
1939
|
setDefaultFormat(format: Format, rowHeight: number, columnWidth: number): void;
|
|
2316
|
-
|
|
2317
1940
|
/**
|
|
2318
1941
|
* Use the Excel 2023 Office theme with the Aptos default font.
|
|
2319
1942
|
* Must be called before adding worksheets.
|
|
2320
1943
|
*/
|
|
2321
1944
|
useExcel2023Theme(): void;
|
|
2322
|
-
|
|
1945
|
+
/**
|
|
1946
|
+
* Set the zip compression level of the xlsx container.
|
|
1947
|
+
* Lower levels are faster, higher levels produce smaller files.
|
|
1948
|
+
* @param level - Compression level from 1 to 9 (default: 6)
|
|
1949
|
+
* @throws Error if the level is outside 1-9
|
|
1950
|
+
* @example
|
|
1951
|
+
* workbook.setZipCompressionLevel(1); // fastest
|
|
1952
|
+
*/
|
|
1953
|
+
setZipCompressionLevel(level: number): void;
|
|
1954
|
+
/**
|
|
1955
|
+
* Set when Excel recalculates the workbook's formulas
|
|
1956
|
+
* @param mode - `automatic` (default), `manual`, or `partial` (all but data tables)
|
|
1957
|
+
* @example
|
|
1958
|
+
* workbook.setCalculationMode('manual');
|
|
1959
|
+
*/
|
|
1960
|
+
setCalculationMode(mode: CalculationMode): void;
|
|
1961
|
+
/**
|
|
1962
|
+
* Set the width of the worksheet tab bar as a percentage of the space it
|
|
1963
|
+
* shares with the horizontal scroll bar
|
|
1964
|
+
* @param ratio - Percentage from 0 to 100 (default: 60)
|
|
1965
|
+
* @throws Error if the ratio is outside 0-100
|
|
1966
|
+
* @example
|
|
1967
|
+
* workbook.setTabRatio(80);
|
|
1968
|
+
*/
|
|
1969
|
+
setTabRatio(ratio: number): void;
|
|
2323
1970
|
/**
|
|
2324
1971
|
* Load a custom theme from a .thmx, .xlsx, or theme XML file.
|
|
2325
1972
|
* Must be called before adding worksheets.
|
|
2326
1973
|
*/
|
|
2327
1974
|
useCustomTheme(path: string): void;
|
|
2328
|
-
|
|
2329
1975
|
/**
|
|
2330
1976
|
* Save the workbook to a file
|
|
2331
1977
|
* @param filename - Path where the file should be saved
|
|
2332
1978
|
*/
|
|
2333
1979
|
save(filename: string): void;
|
|
2334
|
-
|
|
2335
1980
|
/**
|
|
2336
1981
|
* Save the workbook to a Buffer
|
|
2337
1982
|
* @returns Buffer containing the Excel file data
|
|
2338
1983
|
*/
|
|
2339
1984
|
saveToBuffer(): Buffer;
|
|
2340
|
-
|
|
2341
1985
|
/**
|
|
2342
1986
|
* Save the workbook to a Writable stream
|
|
2343
1987
|
*
|
|
@@ -2359,7 +2003,6 @@ export declare class Workbook {
|
|
|
2359
2003
|
* await workbook.saveToStream(res);
|
|
2360
2004
|
*/
|
|
2361
2005
|
saveToStream(writable: Writable): Promise<void>;
|
|
2362
|
-
|
|
2363
2006
|
/**
|
|
2364
2007
|
* Define a named range or formula
|
|
2365
2008
|
* @param name - Name for the range (e.g., 'Sales' or 'Sheet1!Sales' for local names)
|
|
@@ -2369,7 +2012,6 @@ export declare class Workbook {
|
|
|
2369
2012
|
* workbook.defineName('Sheet1!LocalName', '=Sheet1!$B$1:$B$10');
|
|
2370
2013
|
*/
|
|
2371
2014
|
defineName(name: string, formula: string): void;
|
|
2372
|
-
|
|
2373
2015
|
/**
|
|
2374
2016
|
* Set the workbook to be opened in read-only recommended mode
|
|
2375
2017
|
* Users will be prompted to open as read-only but can choose to edit
|
|
@@ -2377,7 +2019,6 @@ export declare class Workbook {
|
|
|
2377
2019
|
* workbook.readOnlyRecommended();
|
|
2378
2020
|
*/
|
|
2379
2021
|
readOnlyRecommended(): void;
|
|
2380
|
-
|
|
2381
2022
|
/**
|
|
2382
2023
|
* Add a VBA macro file to the workbook
|
|
2383
2024
|
* @param path - Path to the vbaProject.bin file
|
|
@@ -2385,7 +2026,6 @@ export declare class Workbook {
|
|
|
2385
2026
|
* workbook.addVbaProject('./vbaProject.bin');
|
|
2386
2027
|
*/
|
|
2387
2028
|
addVbaProject(path: string): void;
|
|
2388
|
-
|
|
2389
2029
|
/**
|
|
2390
2030
|
* Set document properties (metadata) for the workbook
|
|
2391
2031
|
* @param properties - DocProperties instance with metadata
|
|
@@ -2396,27 +2036,4 @@ export declare class Workbook {
|
|
|
2396
2036
|
*/
|
|
2397
2037
|
setProperties(properties: DocProperties): void;
|
|
2398
2038
|
}
|
|
2399
|
-
|
|
2400
|
-
/**
|
|
2401
|
-
* Returns [currentBytes, peakBytes] of Rust allocator usage.
|
|
2402
|
-
* Useful for profiling memory consumption of the native layer.
|
|
2403
|
-
*
|
|
2404
|
-
* @example
|
|
2405
|
-
* const [current, peak] = rustMemoryStats();
|
|
2406
|
-
* console.log(`Rust heap: ${(current / 1024 / 1024).toFixed(2)} MB (peak: ${(peak / 1024 / 1024).toFixed(2)} MB)`);
|
|
2407
|
-
*/
|
|
2408
|
-
export declare function rustMemoryStats(): [number, number];
|
|
2409
|
-
|
|
2410
|
-
/**
|
|
2411
|
-
* Resets peak memory tracking to the current allocation level.
|
|
2412
|
-
* Call before a section you want to measure.
|
|
2413
|
-
*
|
|
2414
|
-
* @example
|
|
2415
|
-
* rustMemoryResetPeak();
|
|
2416
|
-
* // ... do work ...
|
|
2417
|
-
* const [current, peak] = rustMemoryStats();
|
|
2418
|
-
*/
|
|
2419
|
-
export declare function rustMemoryResetPeak(): void;
|
|
2420
|
-
|
|
2421
|
-
// Re-export native bindings for advanced use
|
|
2422
|
-
export { RuscFormat, RuscNote, RuscFormula, RuscDataValidation, RuscChart, RuscWorkbook, RuscWorksheet, RuscProtectionOptions, RuscRichText, RuscImage, RuscTable, RuscTableColumn, RuscSparkline, RuscDocProperties, RuscButton, RuscShape } from './index';
|
|
2039
|
+
export { RuscButton, RuscChart, RuscDataValidation, RuscDocProperties, RuscFormat, RuscFormula, type RuscFormulaData, RuscImage, RuscNote, RuscProtectionOptions, RuscRichText, RuscShape, RuscSparkline, RuscTable, RuscTableColumn, RuscWorkbook, RuscWorksheet, rustMemoryResetPeak, rustMemoryStats };
|