@nazarkalytiuk/rusc-xlsx 1.0.3
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/LICENSE +21 -0
- package/README.md +289 -0
- package/index.d.ts +599 -0
- package/index.js +590 -0
- package/package.json +80 -0
- package/wrapper.d.ts +2283 -0
- package/wrapper.js +1318 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,599 @@
|
|
|
1
|
+
/* auto-generated by NAPI-RS */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export declare class RuscButton {
|
|
4
|
+
/** Create a new Button */
|
|
5
|
+
static new(): RuscButton
|
|
6
|
+
/** Set the button caption/text */
|
|
7
|
+
setCaption(caption: string): this
|
|
8
|
+
/** Set the VBA macro to run when button is clicked */
|
|
9
|
+
setMacro(macroName: string): this
|
|
10
|
+
/** Set the button width in pixels */
|
|
11
|
+
setWidth(width: number): this
|
|
12
|
+
/** Set the button height in pixels */
|
|
13
|
+
setHeight(height: number): this
|
|
14
|
+
/** Set the button alt text for accessibility */
|
|
15
|
+
setAltText(altText: string): this
|
|
16
|
+
/** Set how the button moves and sizes with cells */
|
|
17
|
+
setObjectMovement(option: string): this
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
/** Chart wrapper for Excel charts */
|
|
21
|
+
export declare class RuscChart {
|
|
22
|
+
/** Create a new chart with the specified type */
|
|
23
|
+
constructor(chartType: string)
|
|
24
|
+
/** Add a data series to the chart */
|
|
25
|
+
addSeries(categories: string | undefined | null, values: string, name?: string | undefined | null): void
|
|
26
|
+
/** Set the chart title */
|
|
27
|
+
setTitle(title: string): void
|
|
28
|
+
/** Set the X-axis label */
|
|
29
|
+
setXAxisName(name: string): void
|
|
30
|
+
/** Set the Y-axis label */
|
|
31
|
+
setYAxisName(name: string): void
|
|
32
|
+
/** Set the chart style (1-48) */
|
|
33
|
+
setStyle(style: number): void
|
|
34
|
+
/** Hide the chart legend */
|
|
35
|
+
setLegendHidden(): void
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export declare class RuscDataValidation {
|
|
39
|
+
/** Create a new data validation with "any value" type */
|
|
40
|
+
constructor()
|
|
41
|
+
/** Allow whole number validation */
|
|
42
|
+
allowWholeNumber(rule: string, value: number): void
|
|
43
|
+
/** Allow whole number validation between two values */
|
|
44
|
+
allowWholeNumberBetween(min: number, max: number): void
|
|
45
|
+
/** Allow decimal number validation */
|
|
46
|
+
allowDecimalNumber(rule: string, value: number): void
|
|
47
|
+
/** Allow decimal number validation between two values */
|
|
48
|
+
allowDecimalNumberBetween(min: number, max: number): void
|
|
49
|
+
/** Allow list validation with strings */
|
|
50
|
+
allowListStrings(list: Array<string>): void
|
|
51
|
+
/** Allow list validation from a formula/cell range */
|
|
52
|
+
allowListFormula(formula: string): void
|
|
53
|
+
/** Allow custom formula validation */
|
|
54
|
+
allowCustom(formula: string): void
|
|
55
|
+
/** Allow any value (mainly used for input messages) */
|
|
56
|
+
allowAnyValue(): void
|
|
57
|
+
/** Set whether to ignore blank cells */
|
|
58
|
+
ignoreBlank(enable: boolean): void
|
|
59
|
+
/** Set whether to show the dropdown arrow */
|
|
60
|
+
showDropdown(enable: boolean): void
|
|
61
|
+
/** Set whether to show the input message */
|
|
62
|
+
showInputMessage(enable: boolean): void
|
|
63
|
+
/** Set whether to show the error message */
|
|
64
|
+
showErrorMessage(enable: boolean): void
|
|
65
|
+
/** Set the input message title */
|
|
66
|
+
setInputTitle(title: string): void
|
|
67
|
+
/** Set the input message text */
|
|
68
|
+
setInputMessage(message: string): void
|
|
69
|
+
/** Set the error message title */
|
|
70
|
+
setErrorTitle(title: string): void
|
|
71
|
+
/** Set the error message text */
|
|
72
|
+
setErrorMessage(message: string): void
|
|
73
|
+
/** Set the error style */
|
|
74
|
+
setErrorStyle(style: string): void
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export declare class RuscDocProperties {
|
|
78
|
+
/** Create a new DocProperties struct */
|
|
79
|
+
static new(): RuscDocProperties
|
|
80
|
+
/** Set the document author */
|
|
81
|
+
setAuthor(author: string): this
|
|
82
|
+
/** Set the document title */
|
|
83
|
+
setTitle(title: string): this
|
|
84
|
+
/** Set the document subject */
|
|
85
|
+
setSubject(subject: string): this
|
|
86
|
+
/** Set the document comment */
|
|
87
|
+
setComment(comment: string): this
|
|
88
|
+
/** Set the document company */
|
|
89
|
+
setCompany(company: string): this
|
|
90
|
+
/** Set the document manager */
|
|
91
|
+
setManager(manager: string): this
|
|
92
|
+
/** Set the document status */
|
|
93
|
+
setStatus(status: string): this
|
|
94
|
+
/** Set the document category */
|
|
95
|
+
setCategory(category: string): this
|
|
96
|
+
/** Set the document keywords */
|
|
97
|
+
setKeywords(keywords: string): this
|
|
98
|
+
/** Set the document hyperlink base */
|
|
99
|
+
setHyperlinkBase(base: string): this
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export declare class RuscFormat {
|
|
103
|
+
/** Create a new format */
|
|
104
|
+
constructor()
|
|
105
|
+
/** Set bold text */
|
|
106
|
+
setBold(): void
|
|
107
|
+
/** Set italic text */
|
|
108
|
+
setItalic(): void
|
|
109
|
+
/** Set font size */
|
|
110
|
+
setFontSize(size: number): void
|
|
111
|
+
/** Set font color */
|
|
112
|
+
setFontColor(color: string): void
|
|
113
|
+
/** Set background color */
|
|
114
|
+
setBackgroundColor(color: string): void
|
|
115
|
+
/** Set horizontal alignment */
|
|
116
|
+
setAlign(align: string): void
|
|
117
|
+
/** Set vertical alignment */
|
|
118
|
+
setVerticalAlign(align: string): void
|
|
119
|
+
/** Set border style */
|
|
120
|
+
setBorder(border: string): void
|
|
121
|
+
/** Set number format */
|
|
122
|
+
setNumFormat(numFormat: string): void
|
|
123
|
+
/** Set font name (e.g., 'Arial', 'Calibri', 'Times New Roman') */
|
|
124
|
+
setFontName(fontName: string): void
|
|
125
|
+
/** Set text underline style */
|
|
126
|
+
setUnderline(underline: string): void
|
|
127
|
+
/** Set strikethrough text */
|
|
128
|
+
setStrikethrough(): void
|
|
129
|
+
/** Set foreground color (for patterns) */
|
|
130
|
+
setForegroundColor(color: string): void
|
|
131
|
+
/** Set fill pattern */
|
|
132
|
+
setPattern(pattern: string): void
|
|
133
|
+
/** Enable text wrapping in the cell */
|
|
134
|
+
setTextWrap(): void
|
|
135
|
+
/** Set text indentation level (0-15) */
|
|
136
|
+
setIndent(indent: number): void
|
|
137
|
+
/** Set text rotation in degrees (-90 to 90, or 270 for vertical text) */
|
|
138
|
+
setRotation(rotation: number): void
|
|
139
|
+
/** Shrink text to fit cell */
|
|
140
|
+
setShrink(): void
|
|
141
|
+
/** Set top border style */
|
|
142
|
+
setBorderTop(border: string): void
|
|
143
|
+
/** Set bottom border style */
|
|
144
|
+
setBorderBottom(border: string): void
|
|
145
|
+
/** Set left border style */
|
|
146
|
+
setBorderLeft(border: string): void
|
|
147
|
+
/** Set right border style */
|
|
148
|
+
setBorderRight(border: string): void
|
|
149
|
+
/** Set color for all borders */
|
|
150
|
+
setBorderColor(color: string): void
|
|
151
|
+
/** Set top border color */
|
|
152
|
+
setBorderTopColor(color: string): void
|
|
153
|
+
/** Set bottom border color */
|
|
154
|
+
setBorderBottomColor(color: string): void
|
|
155
|
+
/** Set left border color */
|
|
156
|
+
setBorderLeftColor(color: string): void
|
|
157
|
+
/** Set right border color */
|
|
158
|
+
setBorderRightColor(color: string): void
|
|
159
|
+
/** Unlock cell (for use with worksheet protection) */
|
|
160
|
+
setUnlocked(): void
|
|
161
|
+
/** Lock cell (cell will be protected when worksheet is protected) */
|
|
162
|
+
setLocked(): void
|
|
163
|
+
/** Hide formulas in cell (for use with worksheet protection) */
|
|
164
|
+
setHidden(): void
|
|
165
|
+
/** Set font script (superscript or subscript) */
|
|
166
|
+
setFontScript(script: string): void
|
|
167
|
+
/** Set diagonal border style */
|
|
168
|
+
setBorderDiagonal(border: string): void
|
|
169
|
+
/** Set diagonal border color */
|
|
170
|
+
setBorderDiagonalColor(color: string): void
|
|
171
|
+
/** Set diagonal border type (up, down, or both) */
|
|
172
|
+
setBorderDiagonalType(borderType: string): void
|
|
173
|
+
/** Set reading direction (0=context, 1=left-to-right, 2=right-to-left) */
|
|
174
|
+
setReadingDirection(direction: number): void
|
|
175
|
+
/** Set quote prefix (force string interpretation with leading apostrophe) */
|
|
176
|
+
setQuotePrefix(): void
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare class RuscFormula {
|
|
180
|
+
/** Create a new formula */
|
|
181
|
+
constructor(formula: string)
|
|
182
|
+
/** Set the result value for the formula (for apps that don't auto-calculate) */
|
|
183
|
+
setResult(result: string): void
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** Wrapper for Image to insert images into worksheets */
|
|
187
|
+
export declare class RuscImage {
|
|
188
|
+
/**
|
|
189
|
+
* Create a new Image from a file path
|
|
190
|
+
* Supports PNG, JPG, GIF, and BMP formats
|
|
191
|
+
*/
|
|
192
|
+
static new(path: string): RuscImage
|
|
193
|
+
/** Create an Image from a buffer (u8 array) */
|
|
194
|
+
static newFromBuffer(buffer: Buffer): RuscImage
|
|
195
|
+
/** Set the width of the image in pixels */
|
|
196
|
+
setWidth(width: number): this
|
|
197
|
+
/** Set the height of the image in pixels */
|
|
198
|
+
setHeight(height: number): this
|
|
199
|
+
/** Scale the width of the image as a percentage */
|
|
200
|
+
setScaleWidth(scale: number): this
|
|
201
|
+
/** Scale the height of the image as a percentage */
|
|
202
|
+
setScaleHeight(scale: number): this
|
|
203
|
+
/** Scale the image to a specific size maintaining or ignoring aspect ratio */
|
|
204
|
+
setScaleToSize(width: number, height: number, keepAspectRatio: boolean): this
|
|
205
|
+
/** Set alt text for the image (for accessibility) */
|
|
206
|
+
setAltText(altText: string): this
|
|
207
|
+
/** Set the image as decorative (no alt text required) */
|
|
208
|
+
setDecorative(enable: boolean): this
|
|
209
|
+
/**
|
|
210
|
+
* Set how the image moves and sizes with cells
|
|
211
|
+
* Options: 'moveAndSize', 'moveOnly', 'none', 'moveAndSizeAfter'
|
|
212
|
+
*/
|
|
213
|
+
setObjectMovement(option: string): this
|
|
214
|
+
/** Add a URL link to the image */
|
|
215
|
+
setUrl(url: string): this
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export declare class RuscNote {
|
|
219
|
+
/** Create a new note with text */
|
|
220
|
+
constructor(text: string)
|
|
221
|
+
/** Set the author name for the note */
|
|
222
|
+
setAuthor(name: string): void
|
|
223
|
+
/** Set the width of the note in pixels */
|
|
224
|
+
setWidth(width: number): void
|
|
225
|
+
/** Set the height of the note in pixels */
|
|
226
|
+
setHeight(height: number): void
|
|
227
|
+
/** Set the background color of the note */
|
|
228
|
+
setBackgroundColor(color: string): void
|
|
229
|
+
/** Make the note visible by default (normally it's hidden until you hover over the cell) */
|
|
230
|
+
setVisible(visible: boolean): void
|
|
231
|
+
/** Set alt text for accessibility */
|
|
232
|
+
setAltText(altText: string): void
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/** Wrapper for ProtectionOptions to configure worksheet protection */
|
|
236
|
+
export declare class RuscProtectionOptions {
|
|
237
|
+
/** Create a new ProtectionOptions object with default settings */
|
|
238
|
+
constructor()
|
|
239
|
+
/** Allow or prevent users from selecting locked cells (default: true) */
|
|
240
|
+
setSelectLockedCells(allow: boolean): this
|
|
241
|
+
/** Allow or prevent users from selecting unlocked cells (default: true) */
|
|
242
|
+
setSelectUnlockedCells(allow: boolean): this
|
|
243
|
+
/** Allow or prevent users from formatting cells (default: false) */
|
|
244
|
+
setFormatCells(allow: boolean): this
|
|
245
|
+
/** Allow or prevent users from formatting columns (default: false) */
|
|
246
|
+
setFormatColumns(allow: boolean): this
|
|
247
|
+
/** Allow or prevent users from formatting rows (default: false) */
|
|
248
|
+
setFormatRows(allow: boolean): this
|
|
249
|
+
/** Allow or prevent users from inserting columns (default: false) */
|
|
250
|
+
setInsertColumns(allow: boolean): this
|
|
251
|
+
/** Allow or prevent users from inserting rows (default: false) */
|
|
252
|
+
setInsertRows(allow: boolean): this
|
|
253
|
+
/** Allow or prevent users from inserting hyperlinks (default: false) */
|
|
254
|
+
setInsertLinks(allow: boolean): this
|
|
255
|
+
/** Allow or prevent users from deleting columns (default: false) */
|
|
256
|
+
setDeleteColumns(allow: boolean): this
|
|
257
|
+
/** Allow or prevent users from deleting rows (default: false) */
|
|
258
|
+
setDeleteRows(allow: boolean): this
|
|
259
|
+
/** Allow or prevent users from sorting data (default: false) */
|
|
260
|
+
setSort(allow: boolean): this
|
|
261
|
+
/** Allow or prevent users from using autofilters (default: false) */
|
|
262
|
+
setUseAutofilter(allow: boolean): this
|
|
263
|
+
/** Allow or prevent users from using pivot tables (default: false) */
|
|
264
|
+
setUsePivotTables(allow: boolean): this
|
|
265
|
+
/** Allow or prevent users from editing scenarios (default: false) */
|
|
266
|
+
setEditScenarios(allow: boolean): this
|
|
267
|
+
/** Allow or prevent users from editing objects like images (default: false) */
|
|
268
|
+
setEditObjects(allow: boolean): this
|
|
269
|
+
/** Allow or prevent editing contents in chartsheets (default: true) */
|
|
270
|
+
setContents(allow: boolean): this
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Wrapper for rich text strings (multi-format text in a single cell) */
|
|
274
|
+
export declare class RuscRichText {
|
|
275
|
+
/** Create a new empty rich text string */
|
|
276
|
+
constructor()
|
|
277
|
+
/**
|
|
278
|
+
* Add a text segment with formatting
|
|
279
|
+
* The format is cloned internally for storage
|
|
280
|
+
*/
|
|
281
|
+
addSegment(text: string, format: RuscFormat): this
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
export declare class RuscShape {
|
|
285
|
+
/** Create a new textbox shape */
|
|
286
|
+
static textbox(): RuscShape
|
|
287
|
+
/** Set the text content of the textbox */
|
|
288
|
+
setText(text: string): this
|
|
289
|
+
/** Set the width in pixels */
|
|
290
|
+
setWidth(width: number): this
|
|
291
|
+
/** Set the height in pixels */
|
|
292
|
+
setHeight(height: number): this
|
|
293
|
+
/** Set the alt text for accessibility */
|
|
294
|
+
setAltText(altText: string): this
|
|
295
|
+
/** Set how the shape moves and sizes with cells */
|
|
296
|
+
setObjectMovement(option: string): this
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export declare class RuscSparkline {
|
|
300
|
+
/** Create a new Sparkline */
|
|
301
|
+
static new(): RuscSparkline
|
|
302
|
+
/** Set the data range for the sparkline (e.g., "Sheet1!A1:E1") */
|
|
303
|
+
setRange(range: string): this
|
|
304
|
+
/** Set the type of sparkline: 'line', 'column', or 'winLose' */
|
|
305
|
+
setType(sparklineType: string): this
|
|
306
|
+
/** Show markers for the highest point */
|
|
307
|
+
showHighPoint(enable: boolean): this
|
|
308
|
+
/** Show markers for the lowest point */
|
|
309
|
+
showLowPoint(enable: boolean): this
|
|
310
|
+
/** Show markers for the first point */
|
|
311
|
+
showFirstPoint(enable: boolean): this
|
|
312
|
+
/** Show markers for the last point */
|
|
313
|
+
showLastPoint(enable: boolean): this
|
|
314
|
+
/** Show markers for negative points */
|
|
315
|
+
showNegativePoints(enable: boolean): this
|
|
316
|
+
/** Show markers for all points */
|
|
317
|
+
showMarkers(enable: boolean): this
|
|
318
|
+
/** Show the horizontal axis */
|
|
319
|
+
showAxis(enable: boolean): this
|
|
320
|
+
/** Show data from hidden rows/columns */
|
|
321
|
+
showHiddenData(enable: boolean): this
|
|
322
|
+
/** Display sparkline right to left */
|
|
323
|
+
setRightToLeft(enable: boolean): this
|
|
324
|
+
/** Set the color of the sparkline (hex color like "#FF0000") */
|
|
325
|
+
setSparklineColor(color: string): this
|
|
326
|
+
/** Set the color of the high point marker */
|
|
327
|
+
setHighPointColor(color: string): this
|
|
328
|
+
/** Set the color of the low point marker */
|
|
329
|
+
setLowPointColor(color: string): this
|
|
330
|
+
/** Set the color of the first point marker */
|
|
331
|
+
setFirstPointColor(color: string): this
|
|
332
|
+
/** Set the color of the last point marker */
|
|
333
|
+
setLastPointColor(color: string): this
|
|
334
|
+
/** Set the color of negative point markers */
|
|
335
|
+
setNegativePointsColor(color: string): this
|
|
336
|
+
/** Set the color of all point markers */
|
|
337
|
+
setMarkersColor(color: string): this
|
|
338
|
+
/** Set the line weight/width */
|
|
339
|
+
setLineWeight(weight: number): this
|
|
340
|
+
/** Set the custom maximum value for vertical axis */
|
|
341
|
+
setCustomMax(max: number): this
|
|
342
|
+
/** Set the custom minimum value for vertical axis */
|
|
343
|
+
setCustomMin(min: number): this
|
|
344
|
+
/** Set maximum value based on group maximum */
|
|
345
|
+
setGroupMax(enable: boolean): this
|
|
346
|
+
/** Set minimum value based on group minimum */
|
|
347
|
+
setGroupMin(enable: boolean): this
|
|
348
|
+
/** Set a predefined style (1-36) */
|
|
349
|
+
setStyle(style: number): this
|
|
350
|
+
/** Set how empty cells are displayed: 'gaps', 'zero', or 'connected' */
|
|
351
|
+
showEmptyCellsAs(option: string): this
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
export declare class RuscTable {
|
|
355
|
+
/** Create a new Table */
|
|
356
|
+
static new(): RuscTable
|
|
357
|
+
/** Set whether the table has a header row */
|
|
358
|
+
setHeaderRow(show: boolean): this
|
|
359
|
+
/** Set whether the table has a total row */
|
|
360
|
+
setTotalRow(show: boolean): this
|
|
361
|
+
/** Set whether the table has banded rows */
|
|
362
|
+
setBandedRows(show: boolean): this
|
|
363
|
+
/** Set whether the table has banded columns */
|
|
364
|
+
setBandedColumns(show: boolean): this
|
|
365
|
+
/** Set whether the first column is formatted */
|
|
366
|
+
setFirstColumn(show: boolean): this
|
|
367
|
+
/** Set whether the last column is formatted */
|
|
368
|
+
setLastColumn(show: boolean): this
|
|
369
|
+
/** Set the name of the table */
|
|
370
|
+
setName(name: string): this
|
|
371
|
+
/** Set the style of the table (1-21 for light styles, 22-49 for medium styles, 50-61 for dark styles) */
|
|
372
|
+
setStyle(styleId: number): this
|
|
373
|
+
/** Add columns to the table */
|
|
374
|
+
setColumns(columns: Array<RuscTableColumn>): this
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
export declare class RuscTableColumn {
|
|
378
|
+
/** Create a new table column */
|
|
379
|
+
static new(): RuscTableColumn
|
|
380
|
+
/** Set the header name for the column */
|
|
381
|
+
setHeader(header: string): this
|
|
382
|
+
/** Set the total function for the column */
|
|
383
|
+
setTotalFunction(function: string): this
|
|
384
|
+
/** Set a custom total label for the column */
|
|
385
|
+
setTotalLabel(label: string): this
|
|
386
|
+
/** Set a custom formula for the column */
|
|
387
|
+
setFormula(formula: string): this
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/** Workbook wrapper for Excel file creation */
|
|
391
|
+
export declare class RuscWorkbook {
|
|
392
|
+
/** Create a new workbook */
|
|
393
|
+
constructor()
|
|
394
|
+
/** Add a new worksheet to the workbook and return a reference to it */
|
|
395
|
+
addWorksheet(name?: string | undefined | null): RuscWorksheet
|
|
396
|
+
/** Add a new worksheet with constant memory mode to the workbook */
|
|
397
|
+
addWorksheetWithConstantMemory(name?: string | undefined | null): RuscWorksheet
|
|
398
|
+
/** Add a new worksheet with low memory mode to the workbook */
|
|
399
|
+
addWorksheetWithLowMemory(name?: string | undefined | null): RuscWorksheet
|
|
400
|
+
/** Set a custom temporary directory for constant memory mode */
|
|
401
|
+
setTempdir(dir: string): void
|
|
402
|
+
/** Save the workbook to a file */
|
|
403
|
+
save(filename: string): void
|
|
404
|
+
/** Save the workbook to a buffer */
|
|
405
|
+
saveToBuffer(): Buffer
|
|
406
|
+
/**
|
|
407
|
+
* Define a named range or formula
|
|
408
|
+
*
|
|
409
|
+
* # Arguments
|
|
410
|
+
*
|
|
411
|
+
* * `name` - The name for the range (e.g., "Sales" or "Sheet1!Sales" for local names)
|
|
412
|
+
* * `formula` - The formula or range (e.g., "=Sheet1!$A$1:$A$10" or "=SUM(A1:A10)")
|
|
413
|
+
*/
|
|
414
|
+
defineName(name: string, formula: string): void
|
|
415
|
+
/** Set the workbook to be opened in read-only recommended mode */
|
|
416
|
+
readOnlyRecommended(): void
|
|
417
|
+
/**
|
|
418
|
+
* Add a VBA macro file to the workbook
|
|
419
|
+
*
|
|
420
|
+
* # Arguments
|
|
421
|
+
*
|
|
422
|
+
* * `path` - Path to the vbaProject.bin file
|
|
423
|
+
*/
|
|
424
|
+
addVbaProject(path: string): void
|
|
425
|
+
/**
|
|
426
|
+
* Set document properties (metadata) for the workbook
|
|
427
|
+
*
|
|
428
|
+
* # Arguments
|
|
429
|
+
*
|
|
430
|
+
* * `properties` - DocProperties object with metadata
|
|
431
|
+
*/
|
|
432
|
+
setProperties(properties: RuscDocProperties): void
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/** Worksheet wrapper for Excel sheet manipulation */
|
|
436
|
+
export declare class RuscWorksheet {
|
|
437
|
+
/** Write a value to a cell (auto-detects type) */
|
|
438
|
+
write(row: number, col: number, value: string | number | boolean, format?: RuscFormat | undefined | null): void
|
|
439
|
+
/** Write a string to a cell */
|
|
440
|
+
writeString(row: number, col: number, value: string): void
|
|
441
|
+
/** Write a number to a cell */
|
|
442
|
+
writeNumber(row: number, col: number, value: number): void
|
|
443
|
+
/** Write a boolean to a cell */
|
|
444
|
+
writeBoolean(row: number, col: number, value: boolean): void
|
|
445
|
+
/** Write a blank cell with formatting */
|
|
446
|
+
writeBlank(row: number, col: number, format: RuscFormat): void
|
|
447
|
+
/** Write a rich text string (multi-format text) to a cell */
|
|
448
|
+
writeRichString(row: number, col: number, richText: RuscRichText): void
|
|
449
|
+
/** Write a rich text string with an additional cell format */
|
|
450
|
+
writeRichStringWithFormat(row: number, col: number, richText: RuscRichText, cellFormat: RuscFormat): void
|
|
451
|
+
/** Write a datetime from a Unix timestamp (seconds since 1970-01-01 UTC) */
|
|
452
|
+
writeDatetimeFromTimestamp(row: number, col: number, timestamp: number, format?: RuscFormat | undefined | null): void
|
|
453
|
+
/** Write a datetime from year, month, day components */
|
|
454
|
+
writeDatetimeFromYmd(row: number, col: number, year: number, month: number, day: number, format?: RuscFormat | undefined | null): void
|
|
455
|
+
/** Write a datetime from year, month, day, hour, minute, second components */
|
|
456
|
+
writeDatetimeFromYmdHms(row: number, col: number, year: number, month: number, day: number, hour: number, min: number, sec: number, format?: RuscFormat | undefined | null): void
|
|
457
|
+
/** Write a datetime from an ISO 8601 string (e.g., "2023-01-25T12:30:00") */
|
|
458
|
+
writeDatetimeFromString(row: number, col: number, datetimeStr: string, format?: RuscFormat | undefined | null): void
|
|
459
|
+
/** Write a value with formatting to a cell */
|
|
460
|
+
writeWithFormat(row: number, col: number, value: string | number | boolean, format: RuscFormat): void
|
|
461
|
+
/** Set the width of a column */
|
|
462
|
+
setColumnWidth(col: number, width: number): void
|
|
463
|
+
/** Set the height of a row */
|
|
464
|
+
setRowHeight(row: number, height: number): void
|
|
465
|
+
/** Set the name of the worksheet */
|
|
466
|
+
setName(name: string): void
|
|
467
|
+
/** Merge a range of cells */
|
|
468
|
+
mergeRange(firstRow: number, firstCol: number, lastRow: number, lastCol: number, value: string, format?: RuscFormat | undefined | null): void
|
|
469
|
+
/** Merge a range of cells with formatting */
|
|
470
|
+
mergeRangeWithFormat(firstRow: number, firstCol: number, lastRow: number, lastCol: number, value: string, format: RuscFormat): void
|
|
471
|
+
/** Insert a note (post-it style comment) to a cell */
|
|
472
|
+
insertNote(row: number, col: number, note: RuscNote): void
|
|
473
|
+
/** Set the default author name for all notes in the worksheet */
|
|
474
|
+
setDefaultNoteAuthor(name: string): void
|
|
475
|
+
/** Write a formula to a cell */
|
|
476
|
+
writeFormula(row: number, col: number, formula: RuscFormula, format?: RuscFormat | undefined | null): void
|
|
477
|
+
/** Write a dynamic array formula to a cell (Excel 365) */
|
|
478
|
+
writeDynamicFormula(row: number, col: number, formula: RuscFormula, format?: RuscFormat | undefined | null): void
|
|
479
|
+
/** Write an array formula to a range of cells */
|
|
480
|
+
writeArrayFormula(firstRow: number, firstCol: number, lastRow: number, lastCol: number, formula: RuscFormula, format?: RuscFormat | undefined | null): void
|
|
481
|
+
/** Add data validation to a cell or range */
|
|
482
|
+
addDataValidation(firstRow: number, firstCol: number, lastRow: number, lastCol: number, validation: RuscDataValidation): void
|
|
483
|
+
/** Write a URL to a cell */
|
|
484
|
+
writeUrl(row: number, col: number, url: string, format?: RuscFormat | undefined | null): void
|
|
485
|
+
/** Write a URL to a cell with custom display text */
|
|
486
|
+
writeUrlWithText(row: number, col: number, url: string, text: string, format?: RuscFormat | undefined | null): void
|
|
487
|
+
/** Set autofilter on a range */
|
|
488
|
+
autofilter(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void
|
|
489
|
+
/** Freeze panes at the specified row and column */
|
|
490
|
+
setFreezePanes(row: number, col: number): void
|
|
491
|
+
/** Add 2-color scale conditional formatting */
|
|
492
|
+
addConditionalFormat2ColorScale(firstRow: number, firstCol: number, lastRow: number, lastCol: number, minColor: string, maxColor: string): void
|
|
493
|
+
/** Add 3-color scale conditional formatting */
|
|
494
|
+
addConditionalFormat3ColorScale(firstRow: number, firstCol: number, lastRow: number, lastCol: number, minColor: string, midColor: string, maxColor: string): void
|
|
495
|
+
/** Add data bar conditional formatting */
|
|
496
|
+
addConditionalFormatDataBar(firstRow: number, firstCol: number, lastRow: number, lastCol: number, barColor: string): void
|
|
497
|
+
/** Add cell-based conditional formatting (greater than, less than, etc.) */
|
|
498
|
+
addConditionalFormatCell(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: string, value: number, format: RuscFormat): void
|
|
499
|
+
/** Add text-based conditional formatting */
|
|
500
|
+
addConditionalFormatText(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: string, text: string, format: RuscFormat): void
|
|
501
|
+
/** Add average/standard deviation conditional formatting */
|
|
502
|
+
addConditionalFormatAverage(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: string, format: RuscFormat): void
|
|
503
|
+
/** Add top/bottom N conditional formatting */
|
|
504
|
+
addConditionalFormatTop(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: string, value: number, format: RuscFormat): void
|
|
505
|
+
/** Add duplicate/unique values conditional formatting */
|
|
506
|
+
addConditionalFormatDuplicate(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: RuscFormat): void
|
|
507
|
+
/** Add blank/non-blank conditional formatting */
|
|
508
|
+
addConditionalFormatBlank(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: RuscFormat): void
|
|
509
|
+
/** Add error/non-error conditional formatting */
|
|
510
|
+
addConditionalFormatError(firstRow: number, firstCol: number, lastRow: number, lastCol: number, invert: boolean, format: RuscFormat): void
|
|
511
|
+
/** Add date-based conditional formatting */
|
|
512
|
+
addConditionalFormatDate(firstRow: number, firstCol: number, lastRow: number, lastCol: number, rule: string, format: RuscFormat): void
|
|
513
|
+
/** Add formula-based conditional formatting */
|
|
514
|
+
addConditionalFormatFormula(firstRow: number, firstCol: number, lastRow: number, lastCol: number, formula: string, format: RuscFormat): void
|
|
515
|
+
/** Add icon set conditional formatting */
|
|
516
|
+
addConditionalFormatIconSet(firstRow: number, firstCol: number, lastRow: number, lastCol: number, iconType: string): void
|
|
517
|
+
/** Set page margins (in inches) */
|
|
518
|
+
setMargins(left: number, right: number, top: number, bottom: number, header: number, footer: number): void
|
|
519
|
+
/** Set page orientation to portrait */
|
|
520
|
+
setPortrait(): void
|
|
521
|
+
/** Set page orientation to landscape */
|
|
522
|
+
setLandscape(): void
|
|
523
|
+
/** Set paper size (1=Letter, 9=A4, etc.) */
|
|
524
|
+
setPaperSize(paperSize: number): void
|
|
525
|
+
/** Set header text */
|
|
526
|
+
setHeader(header: string): void
|
|
527
|
+
/** Set footer text */
|
|
528
|
+
setFooter(footer: string): void
|
|
529
|
+
/** Set print area */
|
|
530
|
+
setPrintArea(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void
|
|
531
|
+
/** Set print gridlines */
|
|
532
|
+
setPrintGridlines(enable: boolean): void
|
|
533
|
+
/** Center content horizontally on the page when printing */
|
|
534
|
+
setPrintCenterHorizontally(enable: boolean): void
|
|
535
|
+
/** Center content vertically on the page when printing */
|
|
536
|
+
setPrintCenterVertically(enable: boolean): void
|
|
537
|
+
/** Fit worksheet to N pages wide by M pages tall when printing */
|
|
538
|
+
setPrintFitToPages(width: number, height: number): void
|
|
539
|
+
/** Set print scale as a percentage (10-400) */
|
|
540
|
+
setPrintScale(scale: number): void
|
|
541
|
+
/** Set the first page number for printing */
|
|
542
|
+
setPrintFirstPageNumber(pageNumber: number): void
|
|
543
|
+
/** Enable/disable black and white printing */
|
|
544
|
+
setPrintBlackAndWhite(enable: boolean): void
|
|
545
|
+
/** Enable/disable draft quality printing */
|
|
546
|
+
setPrintDraft(enable: boolean): void
|
|
547
|
+
/** Enable/disable printing of row and column headings */
|
|
548
|
+
setPrintHeadings(enable: boolean): void
|
|
549
|
+
/** Repeat rows at the top of each printed page */
|
|
550
|
+
setRepeatRows(firstRow: number, lastRow: number): void
|
|
551
|
+
/** Repeat columns at the left of each printed page */
|
|
552
|
+
setRepeatColumns(firstCol: number, lastCol: number): void
|
|
553
|
+
/** Scale header and footer with document */
|
|
554
|
+
setHeaderFooterScaleWithDoc(enable: boolean): void
|
|
555
|
+
/** Align header and footer with page margins */
|
|
556
|
+
setHeaderFooterAlignWithPage(enable: boolean): void
|
|
557
|
+
/** Set the worksheet tab color */
|
|
558
|
+
setTabColor(color: string): void
|
|
559
|
+
/** Hide or show the worksheet */
|
|
560
|
+
setHidden(enable: boolean): void
|
|
561
|
+
/** Set the worksheet zoom level (10-400) */
|
|
562
|
+
setZoom(zoom: number): void
|
|
563
|
+
/** Set the default cell selection when opening the worksheet */
|
|
564
|
+
setSelection(firstRow: number, firstCol: number, lastRow: number, lastCol: number): void
|
|
565
|
+
/** Set which cell appears in the top-left corner when opening the worksheet */
|
|
566
|
+
setTopLeftCell(row: number, col: number): void
|
|
567
|
+
/** Protect the worksheet from editing */
|
|
568
|
+
protect(): void
|
|
569
|
+
/** Protect the worksheet with a password */
|
|
570
|
+
protectWithPassword(password: string): void
|
|
571
|
+
/** Protect the worksheet with granular protection options */
|
|
572
|
+
protectWithOptions(options: RuscProtectionOptions): void
|
|
573
|
+
/** Protect the worksheet with a password and granular protection options */
|
|
574
|
+
protectWithPasswordAndOptions(password: string, options: RuscProtectionOptions): void
|
|
575
|
+
/** Insert a chart at the specified cell position */
|
|
576
|
+
insertChart(row: number, col: number, chart: RuscChart): void
|
|
577
|
+
/** Insert a chart at the specified cell position with pixel offsets */
|
|
578
|
+
insertChartWithOffset(row: number, col: number, chart: RuscChart, xOffset: number, yOffset: number): void
|
|
579
|
+
/** Insert an image at the specified cell position */
|
|
580
|
+
insertImage(row: number, col: number, image: RuscImage): void
|
|
581
|
+
/** Insert an image at the specified cell position with pixel offsets */
|
|
582
|
+
insertImageWithOffset(row: number, col: number, image: RuscImage, xOffset: number, yOffset: number): void
|
|
583
|
+
/** Insert an image that fits to a cell */
|
|
584
|
+
insertImageFitToCell(row: number, col: number, image: RuscImage, keepAspectRatio: boolean): void
|
|
585
|
+
/** Add a table to the worksheet */
|
|
586
|
+
addTable(firstRow: number, firstCol: number, lastRow: number, lastCol: number, table: RuscTable): void
|
|
587
|
+
/** Add a sparkline to a single cell */
|
|
588
|
+
addSparkline(row: number, col: number, sparkline: RuscSparkline): void
|
|
589
|
+
/** Add a sparkline group to a range of cells */
|
|
590
|
+
addSparklineGroup(firstRow: number, firstCol: number, lastRow: number, lastCol: number, sparkline: RuscSparkline): void
|
|
591
|
+
/** Insert a button at the specified cell position */
|
|
592
|
+
insertButton(row: number, col: number, button: RuscButton): void
|
|
593
|
+
/** Insert a button at the specified cell position with pixel offsets */
|
|
594
|
+
insertButtonWithOffset(row: number, col: number, button: RuscButton, xOffset: number, yOffset: number): void
|
|
595
|
+
/** Insert a shape (textbox) at the specified cell position */
|
|
596
|
+
insertShape(row: number, col: number, shape: RuscShape): void
|
|
597
|
+
/** Insert a shape (textbox) at the specified cell position with pixel offsets */
|
|
598
|
+
insertShapeWithOffset(row: number, col: number, shape: RuscShape, xOffset: number, yOffset: number): void
|
|
599
|
+
}
|