@nazarkalytiuk/rusc-xlsx 1.0.10 → 2.1.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.
Files changed (6) hide show
  1. package/README.md +115 -11
  2. package/index.d.ts +98 -14
  3. package/index.js +367 -104
  4. package/package.json +47 -20
  5. package/wrapper.d.ts +171 -510
  6. package/wrapper.js +1228 -1381
package/wrapper.js CHANGED
@@ -1,1382 +1,1229 @@
1
- // JavaScript wrappers for rusc-xlsx
2
- const nativeBinding = require('./index.js');
3
-
4
- // JavaScript wrapper for Format with fluent API
5
- class Format {
6
- constructor() {
7
- this._native = new nativeBinding.RuscFormat()
8
- }
9
-
10
- setBold() {
11
- this._native.setBold()
12
- return this
13
- }
14
-
15
- setItalic() {
16
- this._native.setItalic()
17
- return this
18
- }
19
-
20
- setFontSize(size) {
21
- this._native.setFontSize(size)
22
- return this
23
- }
24
-
25
- setFontColor(color) {
26
- this._native.setFontColor(color)
27
- return this
28
- }
29
-
30
- setBackgroundColor(color) {
31
- this._native.setBackgroundColor(color)
32
- return this
33
- }
34
-
35
- setAlign(align) {
36
- this._native.setAlign(align)
37
- return this
38
- }
39
-
40
- setVerticalAlign(align) {
41
- this._native.setVerticalAlign(align)
42
- return this
43
- }
44
-
45
- setBorder(border) {
46
- this._native.setBorder(border)
47
- return this
48
- }
49
-
50
- setNumFormat(format) {
51
- this._native.setNumFormat(format)
52
- return this
53
- }
54
-
55
- setFontName(fontName) {
56
- this._native.setFontName(fontName)
57
- return this
58
- }
59
-
60
- setUnderline(underline) {
61
- this._native.setUnderline(underline)
62
- return this
63
- }
64
-
65
- setStrikethrough() {
66
- this._native.setStrikethrough()
67
- return this
68
- }
69
-
70
- setForegroundColor(color) {
71
- this._native.setForegroundColor(color)
72
- return this
73
- }
74
-
75
- setPattern(pattern) {
76
- this._native.setPattern(pattern)
77
- return this
78
- }
79
-
80
- setTextWrap() {
81
- this._native.setTextWrap()
82
- return this
83
- }
84
-
85
- setIndent(indent) {
86
- this._native.setIndent(indent)
87
- return this
88
- }
89
-
90
- setRotation(rotation) {
91
- this._native.setRotation(rotation)
92
- return this
93
- }
94
-
95
- setShrink() {
96
- this._native.setShrink()
97
- return this
98
- }
99
-
100
- setBorderTop(border) {
101
- this._native.setBorderTop(border)
102
- return this
103
- }
104
-
105
- setBorderBottom(border) {
106
- this._native.setBorderBottom(border)
107
- return this
108
- }
109
-
110
- setBorderLeft(border) {
111
- this._native.setBorderLeft(border)
112
- return this
113
- }
114
-
115
- setBorderRight(border) {
116
- this._native.setBorderRight(border)
117
- return this
118
- }
119
-
120
- setBorderColor(color) {
121
- this._native.setBorderColor(color)
122
- return this
123
- }
124
-
125
- setBorderTopColor(color) {
126
- this._native.setBorderTopColor(color)
127
- return this
128
- }
129
-
130
- setBorderBottomColor(color) {
131
- this._native.setBorderBottomColor(color)
132
- return this
133
- }
134
-
135
- setBorderLeftColor(color) {
136
- this._native.setBorderLeftColor(color)
137
- return this
138
- }
139
-
140
- setBorderRightColor(color) {
141
- this._native.setBorderRightColor(color)
142
- return this
143
- }
144
-
145
- setUnlocked() {
146
- this._native.setUnlocked()
147
- return this
148
- }
149
-
150
- setLocked() {
151
- this._native.setLocked()
152
- return this
153
- }
154
-
155
- setHidden() {
156
- this._native.setHidden()
157
- return this
158
- }
159
-
160
- setFontScript(script) {
161
- this._native.setFontScript(script)
162
- return this
163
- }
164
-
165
- setBorderDiagonal(border) {
166
- this._native.setBorderDiagonal(border)
167
- return this
168
- }
169
-
170
- setBorderDiagonalColor(color) {
171
- this._native.setBorderDiagonalColor(color)
172
- return this
173
- }
174
-
175
- setBorderDiagonalType(type) {
176
- this._native.setBorderDiagonalType(type)
177
- return this
178
- }
179
-
180
- setReadingDirection(direction) {
181
- this._native.setReadingDirection(direction)
182
- return this
183
- }
184
-
185
- setQuotePrefix() {
186
- this._native.setQuotePrefix()
187
- return this
188
- }
189
- }
190
-
191
- // JavaScript wrapper for Note
192
- class Note {
193
- constructor(text) {
194
- this._native = new nativeBinding.RuscNote(text)
195
- }
196
-
197
- setAuthor(name) {
198
- this._native.setAuthor(name)
199
- return this
200
- }
201
-
202
- setWidth(width) {
203
- this._native.setWidth(width)
204
- return this
205
- }
206
-
207
- setHeight(height) {
208
- this._native.setHeight(height)
209
- return this
210
- }
211
-
212
- setBackgroundColor(color) {
213
- this._native.setBackgroundColor(color)
214
- return this
215
- }
216
-
217
- setVisible(visible) {
218
- this._native.setVisible(visible)
219
- return this
220
- }
221
-
222
- setAltText(altText) {
223
- this._native.setAltText(altText)
224
- return this
225
- }
226
- }
227
-
228
- // JavaScript wrapper for ProtectionOptions
229
- class ProtectionOptions {
230
- constructor() {
231
- this._native = new nativeBinding.RuscProtectionOptions()
232
- }
233
-
234
- setSelectLockedCells(allow) {
235
- this._native.setSelectLockedCells(allow)
236
- return this
237
- }
238
-
239
- setSelectUnlockedCells(allow) {
240
- this._native.setSelectUnlockedCells(allow)
241
- return this
242
- }
243
-
244
- setFormatCells(allow) {
245
- this._native.setFormatCells(allow)
246
- return this
247
- }
248
-
249
- setFormatColumns(allow) {
250
- this._native.setFormatColumns(allow)
251
- return this
252
- }
253
-
254
- setFormatRows(allow) {
255
- this._native.setFormatRows(allow)
256
- return this
257
- }
258
-
259
- setInsertColumns(allow) {
260
- this._native.setInsertColumns(allow)
261
- return this
262
- }
263
-
264
- setInsertRows(allow) {
265
- this._native.setInsertRows(allow)
266
- return this
267
- }
268
-
269
- setInsertLinks(allow) {
270
- this._native.setInsertLinks(allow)
271
- return this
272
- }
273
-
274
- setDeleteColumns(allow) {
275
- this._native.setDeleteColumns(allow)
276
- return this
277
- }
278
-
279
- setDeleteRows(allow) {
280
- this._native.setDeleteRows(allow)
281
- return this
282
- }
283
-
284
- setSort(allow) {
285
- this._native.setSort(allow)
286
- return this
287
- }
288
-
289
- setUseAutofilter(allow) {
290
- this._native.setUseAutofilter(allow)
291
- return this
292
- }
293
-
294
- setUsePivotTables(allow) {
295
- this._native.setUsePivotTables(allow)
296
- return this
297
- }
298
-
299
- setEditScenarios(allow) {
300
- this._native.setEditScenarios(allow)
301
- return this
302
- }
303
-
304
- setEditObjects(allow) {
305
- this._native.setEditObjects(allow)
306
- return this
307
- }
308
-
309
- setContents(allow) {
310
- this._native.setContents(allow)
311
- return this
312
- }
313
- }
314
-
315
- // JavaScript wrapper for RichText
316
- class RichText {
317
- constructor() {
318
- this._native = new nativeBinding.RuscRichText()
319
- }
320
-
321
- addSegment(text, format) {
322
- this._native.addSegment(text, format ? format._native : null)
323
- return this
324
- }
325
- }
326
-
327
- // JavaScript wrapper for Image
328
- class Image {
329
- constructor(path) {
330
- this._native = nativeBinding.RuscImage.new(path)
331
- }
332
-
333
- static fromBuffer(buffer) {
334
- const img = Object.create(Image.prototype)
335
- img._native = nativeBinding.RuscImage.newFromBuffer(buffer)
336
- return img
337
- }
338
-
339
- setWidth(width) {
340
- this._native.setWidth(width)
341
- return this
342
- }
343
-
344
- setHeight(height) {
345
- this._native.setHeight(height)
346
- return this
347
- }
348
-
349
- setScaleWidth(scale) {
350
- this._native.setScaleWidth(scale)
351
- return this
352
- }
353
-
354
- setScaleHeight(scale) {
355
- this._native.setScaleHeight(scale)
356
- return this
357
- }
358
-
359
- setScaleToSize(width, height, keepAspectRatio = true) {
360
- this._native.setScaleToSize(width, height, keepAspectRatio)
361
- return this
362
- }
363
-
364
- setAltText(altText) {
365
- this._native.setAltText(altText)
366
- return this
367
- }
368
-
369
- setDecorative(enable) {
370
- this._native.setDecorative(enable)
371
- return this
372
- }
373
-
374
- setObjectMovement(option) {
375
- this._native.setObjectMovement(option)
376
- return this
377
- }
378
-
379
- setUrl(url) {
380
- this._native.setUrl(url)
381
- return this
382
- }
383
- }
384
-
385
- // JavaScript wrapper for Formula
386
- class Formula {
387
- constructor(formula) {
388
- this._native = new nativeBinding.RuscFormula(formula)
389
- }
390
-
391
- setResult(result) {
392
- this._native.setResult(result)
393
- return this
394
- }
395
- }
396
-
397
- // JavaScript wrapper for DataValidation
398
- class DataValidation {
399
- constructor() {
400
- this._native = new nativeBinding.RuscDataValidation()
401
- }
402
-
403
- allowWholeNumber(rule, value) {
404
- this._native.allowWholeNumber(rule, value)
405
- return this
406
- }
407
-
408
- allowWholeNumberBetween(min, max) {
409
- this._native.allowWholeNumberBetween(min, max)
410
- return this
411
- }
412
-
413
- allowDecimalNumber(rule, value) {
414
- this._native.allowDecimalNumber(rule, value)
415
- return this
416
- }
417
-
418
- allowDecimalNumberBetween(min, max) {
419
- this._native.allowDecimalNumberBetween(min, max)
420
- return this
421
- }
422
-
423
- allowListStrings(list) {
424
- this._native.allowListStrings(list)
425
- return this
426
- }
427
-
428
- allowListFormula(formula) {
429
- this._native.allowListFormula(formula)
430
- return this
431
- }
432
-
433
- allowCustom(formula) {
434
- this._native.allowCustom(formula)
435
- return this
436
- }
437
-
438
- allowAnyValue() {
439
- this._native.allowAnyValue()
440
- return this
441
- }
442
-
443
- ignoreBlank(enable) {
444
- this._native.ignoreBlank(enable)
445
- return this
446
- }
447
-
448
- showDropdown(enable) {
449
- this._native.showDropdown(enable)
450
- return this
451
- }
452
-
453
- showInputMessage(enable) {
454
- this._native.showInputMessage(enable)
455
- return this
456
- }
457
-
458
- showErrorMessage(enable) {
459
- this._native.showErrorMessage(enable)
460
- return this
461
- }
462
-
463
- setInputTitle(title) {
464
- this._native.setInputTitle(title)
465
- return this
466
- }
467
-
468
- setInputMessage(message) {
469
- this._native.setInputMessage(message)
470
- return this
471
- }
472
-
473
- setErrorTitle(title) {
474
- this._native.setErrorTitle(title)
475
- return this
476
- }
477
-
478
- setErrorMessage(message) {
479
- this._native.setErrorMessage(message)
480
- return this
481
- }
482
-
483
- setErrorStyle(style) {
484
- this._native.setErrorStyle(style)
485
- return this
486
- }
487
- }
488
-
489
- // JavaScript wrapper for Worksheet
490
- class Worksheet {
491
- constructor(nativeWorksheet) {
492
- this._native = nativeWorksheet
493
- }
494
-
495
- write(row, col, value, format) {
496
- if (format) {
497
- return this._native.write(row, col, value, format._native)
498
- }
499
-
500
- switch (typeof value) {
501
- case 'string':
502
- return this._native.writeString(row, col, value)
503
- case 'number':
504
- return this._native.writeNumber(row, col, value)
505
- case 'boolean':
506
- return this._native.writeBoolean(row, col, value)
507
- default:
508
- return this._native.write(row, col, value)
509
- }
510
- }
511
-
512
- writeRow(row, startCol, values, format) {
513
- return this._native.writeRow(row, startCol, values, format ? format._native : undefined)
514
- }
515
-
516
- writeRows(startRow, startCol, rows, format) {
517
- return this._native.writeRows(startRow, startCol, rows, format ? format._native : undefined)
518
- }
519
-
520
- writeString(row, col, value) {
521
- return this._native.writeString(row, col, value)
522
- }
523
-
524
- writeNumber(row, col, value) {
525
- return this._native.writeNumber(row, col, value)
526
- }
527
-
528
- writeBoolean(row, col, value) {
529
- return this._native.writeBoolean(row, col, value)
530
- }
531
-
532
- writeBlank(row, col, format) {
533
- return this._native.writeBlank(row, col, format._native)
534
- }
535
-
536
- writeDatetimeFromTimestamp(row, col, timestamp, format) {
537
- return this._native.writeDatetimeFromTimestamp(row, col, timestamp, format ? format._native : undefined)
538
- }
539
-
540
- writeDatetimeFromYmd(row, col, year, month, day, format) {
541
- return this._native.writeDatetimeFromYmd(row, col, year, month, day, format ? format._native : undefined)
542
- }
543
-
544
- writeDatetimeFromYmdHms(row, col, year, month, day, hour, min, sec, format) {
545
- return this._native.writeDatetimeFromYmdHms(row, col, year, month, day, hour, min, sec, format ? format._native : undefined)
546
- }
547
-
548
- writeDatetimeFromString(row, col, datetimeStr, format) {
549
- return this._native.writeDatetimeFromString(row, col, datetimeStr, format ? format._native : undefined)
550
- }
551
-
552
- writeDatetime(row, col, datetime, format) {
553
- // Convenience method that handles multiple input types
554
- if (datetime instanceof Date) {
555
- // JavaScript Date object
556
- const timestamp = Math.floor(datetime.getTime() / 1000)
557
- return this.writeDatetimeFromTimestamp(row, col, timestamp, format)
558
- } else if (typeof datetime === 'number') {
559
- // Unix timestamp
560
- return this.writeDatetimeFromTimestamp(row, col, datetime, format)
561
- } else if (typeof datetime === 'string') {
562
- // ISO string
563
- return this.writeDatetimeFromString(row, col, datetime, format)
564
- } else if (typeof datetime === 'object') {
565
- // Object with year, month, day, etc.
566
- if (datetime.hour !== undefined || datetime.min !== undefined || datetime.sec !== undefined) {
567
- return this.writeDatetimeFromYmdHms(
568
- row, col,
569
- datetime.year, datetime.month, datetime.day,
570
- datetime.hour || 0, datetime.min || 0, datetime.sec || 0,
571
- format
572
- )
573
- } else {
574
- return this.writeDatetimeFromYmd(row, col, datetime.year, datetime.month, datetime.day, format)
575
- }
576
- } else {
577
- throw new Error('Invalid datetime input: must be Date, number (timestamp), string (ISO), or object')
578
- }
579
- }
580
-
581
- writeWithFormat(row, col, value, format) {
582
- return this._native.writeWithFormat(row, col, value, format._native)
583
- }
584
-
585
- setColumnWidth(col, width) {
586
- return this._native.setColumnWidth(col, width)
587
- }
588
-
589
- setRowHeight(row, height) {
590
- return this._native.setRowHeight(row, height)
591
- }
592
-
593
- setDefaultRowHeight(height) {
594
- return this._native.setDefaultRowHeight(height)
595
- }
596
-
597
- setName(name) {
598
- return this._native.setName(name)
599
- }
600
-
601
- mergeRange(firstRow, firstCol, lastRow, lastCol, value, format) {
602
- return this._native.mergeRange(firstRow, firstCol, lastRow, lastCol, value, format ? format._native : undefined)
603
- }
604
-
605
- mergeRangeWithFormat(firstRow, firstCol, lastRow, lastCol, value, format) {
606
- return this._native.mergeRangeWithFormat(firstRow, firstCol, lastRow, lastCol, value, format._native)
607
- }
608
-
609
- insertNote(row, col, note) {
610
- return this._native.insertNote(row, col, note._native)
611
- }
612
-
613
- setDefaultNoteAuthor(name) {
614
- return this._native.setDefaultNoteAuthor(name)
615
- }
616
-
617
- writeFormula(row, col, formula, format) {
618
- return this._native.writeFormula(row, col, formula._native, format ? format._native : undefined)
619
- }
620
-
621
- writeDynamicFormula(row, col, formula, format) {
622
- return this._native.writeDynamicFormula(row, col, formula._native, format ? format._native : undefined)
623
- }
624
-
625
- writeArrayFormula(firstRow, firstCol, lastRow, lastCol, formula, format) {
626
- return this._native.writeArrayFormula(firstRow, firstCol, lastRow, lastCol, formula._native, format ? format._native : undefined)
627
- }
628
-
629
- addDataValidation(firstRow, firstCol, lastRow, lastCol, validation) {
630
- return this._native.addDataValidation(firstRow, firstCol, lastRow, lastCol, validation._native)
631
- }
632
-
633
- writeUrl(row, col, url, format) {
634
- return this._native.writeUrl(row, col, url, format ? format._native : undefined)
635
- }
636
-
637
- writeUrlWithText(row, col, url, text, format) {
638
- return this._native.writeUrlWithText(row, col, url, text, format ? format._native : undefined)
639
- }
640
-
641
- autofilter(firstRow, firstCol, lastRow, lastCol) {
642
- return this._native.autofilter(firstRow, firstCol, lastRow, lastCol)
643
- }
644
-
645
- setFreezePanes(row, col) {
646
- return this._native.setFreezePanes(row, col)
647
- }
648
-
649
- // Conditional Formatting
650
- addConditionalFormat2ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, maxColor) {
651
- return this._native.addConditionalFormat2ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, maxColor)
652
- }
653
-
654
- addConditionalFormat3ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, midColor, maxColor) {
655
- return this._native.addConditionalFormat3ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, midColor, maxColor)
656
- }
657
-
658
- addConditionalFormatDataBar(firstRow, firstCol, lastRow, lastCol, barColor) {
659
- return this._native.addConditionalFormatDataBar(firstRow, firstCol, lastRow, lastCol, barColor)
660
- }
661
-
662
- addConditionalFormatCell(firstRow, firstCol, lastRow, lastCol, rule, value, format) {
663
- return this._native.addConditionalFormatCell(firstRow, firstCol, lastRow, lastCol, rule, value, format._native)
664
- }
665
-
666
- addConditionalFormatText(firstRow, firstCol, lastRow, lastCol, rule, text, format) {
667
- return this._native.addConditionalFormatText(firstRow, firstCol, lastRow, lastCol, rule, text, format._native)
668
- }
669
-
670
- addConditionalFormatAverage(firstRow, firstCol, lastRow, lastCol, rule, format) {
671
- return this._native.addConditionalFormatAverage(firstRow, firstCol, lastRow, lastCol, rule, format._native)
672
- }
673
-
674
- addConditionalFormatTop(firstRow, firstCol, lastRow, lastCol, rule, value, format) {
675
- return this._native.addConditionalFormatTop(firstRow, firstCol, lastRow, lastCol, rule, value, format._native)
676
- }
677
-
678
- addConditionalFormatDuplicate(firstRow, firstCol, lastRow, lastCol, invert, format) {
679
- return this._native.addConditionalFormatDuplicate(firstRow, firstCol, lastRow, lastCol, invert, format._native)
680
- }
681
-
682
- addConditionalFormatBlank(firstRow, firstCol, lastRow, lastCol, invert, format) {
683
- return this._native.addConditionalFormatBlank(firstRow, firstCol, lastRow, lastCol, invert, format._native)
684
- }
685
-
686
- addConditionalFormatError(firstRow, firstCol, lastRow, lastCol, invert, format) {
687
- return this._native.addConditionalFormatError(firstRow, firstCol, lastRow, lastCol, invert, format._native)
688
- }
689
-
690
- addConditionalFormatDate(firstRow, firstCol, lastRow, lastCol, rule, format) {
691
- return this._native.addConditionalFormatDate(firstRow, firstCol, lastRow, lastCol, rule, format._native)
692
- }
693
-
694
- addConditionalFormatFormula(firstRow, firstCol, lastRow, lastCol, formula, format) {
695
- return this._native.addConditionalFormatFormula(firstRow, firstCol, lastRow, lastCol, formula, format._native)
696
- }
697
-
698
- addConditionalFormatIconSet(firstRow, firstCol, lastRow, lastCol, iconType) {
699
- return this._native.addConditionalFormatIconSet(firstRow, firstCol, lastRow, lastCol, iconType)
700
- }
701
-
702
- // Page Setup
703
- setMargins(left, right, top, bottom, header, footer) {
704
- return this._native.setMargins(left, right, top, bottom, header, footer)
705
- }
706
-
707
- setPortrait() {
708
- return this._native.setPortrait()
709
- }
710
-
711
- setLandscape() {
712
- return this._native.setLandscape()
713
- }
714
-
715
- setPaperSize(paperSize) {
716
- return this._native.setPaperSize(paperSize)
717
- }
718
-
719
- setHeader(header) {
720
- return this._native.setHeader(header)
721
- }
722
-
723
- setFooter(footer) {
724
- return this._native.setFooter(footer)
725
- }
726
-
727
- setPrintArea(firstRow, firstCol, lastRow, lastCol) {
728
- return this._native.setPrintArea(firstRow, firstCol, lastRow, lastCol)
729
- }
730
-
731
- setPrintGridlines(enable) {
732
- return this._native.setPrintGridlines(enable)
733
- }
734
-
735
- setPrintCenterHorizontally(enable) {
736
- return this._native.setPrintCenterHorizontally(enable)
737
- }
738
-
739
- setPrintCenterVertically(enable) {
740
- return this._native.setPrintCenterVertically(enable)
741
- }
742
-
743
- setPrintFitToPages(width, height) {
744
- return this._native.setPrintFitToPages(width, height)
745
- }
746
-
747
- setPrintScale(scale) {
748
- return this._native.setPrintScale(scale)
749
- }
750
-
751
- setPrintFirstPageNumber(pageNumber) {
752
- return this._native.setPrintFirstPageNumber(pageNumber)
753
- }
754
-
755
- setPrintBlackAndWhite(enable) {
756
- return this._native.setPrintBlackAndWhite(enable)
757
- }
758
-
759
- setPrintDraft(enable) {
760
- return this._native.setPrintDraft(enable)
761
- }
762
-
763
- setPrintHeadings(enable) {
764
- return this._native.setPrintHeadings(enable)
765
- }
766
-
767
- setRepeatRows(firstRow, lastRow) {
768
- return this._native.setRepeatRows(firstRow, lastRow)
769
- }
770
-
771
- setRepeatColumns(firstCol, lastCol) {
772
- return this._native.setRepeatColumns(firstCol, lastCol)
773
- }
774
-
775
- setHeaderFooterScaleWithDoc(enable) {
776
- return this._native.setHeaderFooterScaleWithDoc(enable)
777
- }
778
-
779
- setHeaderFooterAlignWithPage(enable) {
780
- return this._native.setHeaderFooterAlignWithPage(enable)
781
- }
782
-
783
- // Worksheet View & Display
784
- setTabColor(color) {
785
- return this._native.setTabColor(color)
786
- }
787
-
788
- setHidden(enable) {
789
- return this._native.setHidden(enable)
790
- }
791
-
792
- setZoom(zoom) {
793
- return this._native.setZoom(zoom)
794
- }
795
-
796
- setSelection(firstRow, firstCol, lastRow, lastCol) {
797
- return this._native.setSelection(firstRow, firstCol, lastRow, lastCol)
798
- }
799
-
800
- setTopLeftCell(row, col) {
801
- return this._native.setTopLeftCell(row, col)
802
- }
803
-
804
- // Worksheet Protection
805
- protect() {
806
- return this._native.protect()
807
- }
808
-
809
- protectWithPassword(password) {
810
- return this._native.protectWithPassword(password)
811
- }
812
-
813
- protectWithOptions(options) {
814
- return this._native.protectWithOptions(options._native)
815
- }
816
-
817
- protectWithPasswordAndOptions(password, options) {
818
- return this._native.protectWithPasswordAndOptions(password, options._native)
819
- }
820
-
821
- // Rich Text
822
- writeRichString(row, col, richText) {
823
- return this._native.writeRichString(row, col, richText._native)
824
- }
825
-
826
- writeRichStringWithFormat(row, col, richText, format) {
827
- return this._native.writeRichStringWithFormat(row, col, richText._native, format._native)
828
- }
829
-
830
- // Charts
831
- insertChart(row, col, chart) {
832
- return this._native.insertChart(row, col, chart._native)
833
- }
834
-
835
- insertChartWithOffset(row, col, chart, xOffset, yOffset) {
836
- return this._native.insertChartWithOffset(row, col, chart._native, xOffset, yOffset)
837
- }
838
-
839
- // Images
840
- insertImage(row, col, image) {
841
- return this._native.insertImage(row, col, image._native)
842
- }
843
-
844
- insertImageWithOffset(row, col, image, xOffset, yOffset) {
845
- return this._native.insertImageWithOffset(row, col, image._native, xOffset, yOffset)
846
- }
847
-
848
- insertImageFitToCell(row, col, image, keepAspectRatio = true) {
849
- return this._native.insertImageFitToCell(row, col, image._native, keepAspectRatio)
850
- }
851
-
852
- addTable(firstRow, firstCol, lastRow, lastCol, table) {
853
- return this._native.addTable(firstRow, firstCol, lastRow, lastCol, table._native)
854
- }
855
-
856
- addSparkline(row, col, sparkline) {
857
- return this._native.addSparkline(row, col, sparkline._native)
858
- }
859
-
860
- addSparklineGroup(firstRow, firstCol, lastRow, lastCol, sparkline) {
861
- return this._native.addSparklineGroup(firstRow, firstCol, lastRow, lastCol, sparkline._native)
862
- }
863
-
864
- insertButton(row, col, button) {
865
- return this._native.insertButton(row, col, button._native)
866
- }
867
-
868
- insertButtonWithOffset(row, col, button, xOffset, yOffset) {
869
- return this._native.insertButtonWithOffset(row, col, button._native, xOffset, yOffset)
870
- }
871
-
872
- insertShape(row, col, shape) {
873
- return this._native.insertShape(row, col, shape._native)
874
- }
875
-
876
- insertShapeWithOffset(row, col, shape, xOffset, yOffset) {
877
- return this._native.insertShapeWithOffset(row, col, shape._native, xOffset, yOffset)
878
- }
879
- }
880
-
881
- // JavaScript wrapper for Chart
882
- class Chart {
883
- constructor(chartType) {
884
- this._native = new nativeBinding.RuscChart(chartType)
885
- }
886
-
887
- addSeries(options) {
888
- const {categories, values, name} = options
889
- return this._native.addSeries(categories || null, values, name || null)
890
- }
891
-
892
- setTitle(title) {
893
- this._native.setTitle(title)
894
- return this
895
- }
896
-
897
- setXAxisName(name) {
898
- this._native.setXAxisName(name)
899
- return this
900
- }
901
-
902
- setYAxisName(name) {
903
- this._native.setYAxisName(name)
904
- return this
905
- }
906
-
907
- setStyle(style) {
908
- this._native.setStyle(style)
909
- return this
910
- }
911
-
912
- setLegendHidden() {
913
- this._native.setLegendHidden()
914
- return this
915
- }
916
- }
917
-
918
- // JavaScript wrapper for Table
919
- class Table {
920
- constructor() {
921
- this._native = nativeBinding.RuscTable.new()
922
- }
923
-
924
- setHeaderRow(show) {
925
- this._native.setHeaderRow(show)
926
- return this
927
- }
928
-
929
- setTotalRow(show) {
930
- this._native.setTotalRow(show)
931
- return this
932
- }
933
-
934
- setBandedRows(show) {
935
- this._native.setBandedRows(show)
936
- return this
937
- }
938
-
939
- setBandedColumns(show) {
940
- this._native.setBandedColumns(show)
941
- return this
942
- }
943
-
944
- setFirstColumn(show) {
945
- this._native.setFirstColumn(show)
946
- return this
947
- }
948
-
949
- setLastColumn(show) {
950
- this._native.setLastColumn(show)
951
- return this
952
- }
953
-
954
- setName(name) {
955
- this._native.setName(name)
956
- return this
957
- }
958
-
959
- setStyle(styleId) {
960
- this._native.setStyle(styleId)
961
- return this
962
- }
963
-
964
- setColumns(columns) {
965
- const nativeColumns = columns.map(col => col._native)
966
- this._native.setColumns(nativeColumns)
967
- return this
968
- }
969
- }
970
-
971
- // JavaScript wrapper for TableColumn
972
- class TableColumn {
973
- constructor() {
974
- this._native = nativeBinding.RuscTableColumn.new()
975
- }
976
-
977
- setHeader(header) {
978
- this._native.setHeader(header)
979
- return this
980
- }
981
-
982
- setTotalFunction(func) {
983
- this._native.setTotalFunction(func)
984
- return this
985
- }
986
-
987
- setTotalLabel(label) {
988
- this._native.setTotalLabel(label)
989
- return this
990
- }
991
-
992
- setFormula(formula) {
993
- this._native.setFormula(formula)
994
- return this
995
- }
996
- }
997
-
998
- // JavaScript wrapper for Sparkline
999
- class Sparkline {
1000
- constructor() {
1001
- this._native = nativeBinding.RuscSparkline.new()
1002
- }
1003
-
1004
- setRange(range) {
1005
- this._native.setRange(range)
1006
- return this
1007
- }
1008
-
1009
- setType(type) {
1010
- this._native.setType(type)
1011
- return this
1012
- }
1013
-
1014
- showHighPoint(enable) {
1015
- this._native.showHighPoint(enable)
1016
- return this
1017
- }
1018
-
1019
- showLowPoint(enable) {
1020
- this._native.showLowPoint(enable)
1021
- return this
1022
- }
1023
-
1024
- showFirstPoint(enable) {
1025
- this._native.showFirstPoint(enable)
1026
- return this
1027
- }
1028
-
1029
- showLastPoint(enable) {
1030
- this._native.showLastPoint(enable)
1031
- return this
1032
- }
1033
-
1034
- showNegativePoints(enable) {
1035
- this._native.showNegativePoints(enable)
1036
- return this
1037
- }
1038
-
1039
- showMarkers(enable) {
1040
- this._native.showMarkers(enable)
1041
- return this
1042
- }
1043
-
1044
- showAxis(enable) {
1045
- this._native.showAxis(enable)
1046
- return this
1047
- }
1048
-
1049
- showHiddenData(enable) {
1050
- this._native.showHiddenData(enable)
1051
- return this
1052
- }
1053
-
1054
- setRightToLeft(enable) {
1055
- this._native.setRightToLeft(enable)
1056
- return this
1057
- }
1058
-
1059
- setSparklineColor(color) {
1060
- this._native.setSparklineColor(color)
1061
- return this
1062
- }
1063
-
1064
- setHighPointColor(color) {
1065
- this._native.setHighPointColor(color)
1066
- return this
1067
- }
1068
-
1069
- setLowPointColor(color) {
1070
- this._native.setLowPointColor(color)
1071
- return this
1072
- }
1073
-
1074
- setFirstPointColor(color) {
1075
- this._native.setFirstPointColor(color)
1076
- return this
1077
- }
1078
-
1079
- setLastPointColor(color) {
1080
- this._native.setLastPointColor(color)
1081
- return this
1082
- }
1083
-
1084
- setNegativePointsColor(color) {
1085
- this._native.setNegativePointsColor(color)
1086
- return this
1087
- }
1088
-
1089
- setMarkersColor(color) {
1090
- this._native.setMarkersColor(color)
1091
- return this
1092
- }
1093
-
1094
- setLineWeight(weight) {
1095
- this._native.setLineWeight(weight)
1096
- return this
1097
- }
1098
-
1099
- setCustomMax(max) {
1100
- this._native.setCustomMax(max)
1101
- return this
1102
- }
1103
-
1104
- setCustomMin(min) {
1105
- this._native.setCustomMin(min)
1106
- return this
1107
- }
1108
-
1109
- setGroupMax(enable) {
1110
- this._native.setGroupMax(enable)
1111
- return this
1112
- }
1113
-
1114
- setGroupMin(enable) {
1115
- this._native.setGroupMin(enable)
1116
- return this
1117
- }
1118
-
1119
- setStyle(style) {
1120
- this._native.setStyle(style)
1121
- return this
1122
- }
1123
-
1124
- showEmptyCellsAs(option) {
1125
- this._native.showEmptyCellsAs(option)
1126
- return this
1127
- }
1128
- }
1129
-
1130
- // JavaScript wrapper for DocProperties
1131
- class DocProperties {
1132
- constructor() {
1133
- this._native = nativeBinding.RuscDocProperties.new()
1134
- }
1135
-
1136
- setAuthor(author) {
1137
- this._native.setAuthor(author)
1138
- return this
1139
- }
1140
-
1141
- setTitle(title) {
1142
- this._native.setTitle(title)
1143
- return this
1144
- }
1145
-
1146
- setSubject(subject) {
1147
- this._native.setSubject(subject)
1148
- return this
1149
- }
1150
-
1151
- setComment(comment) {
1152
- this._native.setComment(comment)
1153
- return this
1154
- }
1155
-
1156
- setCompany(company) {
1157
- this._native.setCompany(company)
1158
- return this
1159
- }
1160
-
1161
- setManager(manager) {
1162
- this._native.setManager(manager)
1163
- return this
1164
- }
1165
-
1166
- setStatus(status) {
1167
- this._native.setStatus(status)
1168
- return this
1169
- }
1170
-
1171
- setCategory(category) {
1172
- this._native.setCategory(category)
1173
- return this
1174
- }
1175
-
1176
- setKeywords(keywords) {
1177
- this._native.setKeywords(keywords)
1178
- return this
1179
- }
1180
-
1181
- setHyperlinkBase(base) {
1182
- this._native.setHyperlinkBase(base)
1183
- return this
1184
- }
1185
- }
1186
-
1187
- // JavaScript wrapper for Button
1188
- class Button {
1189
- constructor() {
1190
- this._native = nativeBinding.RuscButton.new()
1191
- }
1192
-
1193
- setCaption(caption) {
1194
- this._native.setCaption(caption)
1195
- return this
1196
- }
1197
-
1198
- setMacro(macroName) {
1199
- this._native.setMacro(macroName)
1200
- return this
1201
- }
1202
-
1203
- setWidth(width) {
1204
- this._native.setWidth(width)
1205
- return this
1206
- }
1207
-
1208
- setHeight(height) {
1209
- this._native.setHeight(height)
1210
- return this
1211
- }
1212
-
1213
- setAltText(altText) {
1214
- this._native.setAltText(altText)
1215
- return this
1216
- }
1217
-
1218
- setObjectMovement(option) {
1219
- this._native.setObjectMovement(option)
1220
- return this
1221
- }
1222
- }
1223
-
1224
- // JavaScript wrapper for Shape
1225
- class Shape {
1226
- static textbox() {
1227
- const shape = Object.create(Shape.prototype)
1228
- shape._native = nativeBinding.RuscShape.textbox()
1229
- return shape
1230
- }
1231
-
1232
- setText(text) {
1233
- this._native.setText(text)
1234
- return this
1235
- }
1236
-
1237
- setWidth(width) {
1238
- this._native.setWidth(width)
1239
- return this
1240
- }
1241
-
1242
- setHeight(height) {
1243
- this._native.setHeight(height)
1244
- return this
1245
- }
1246
-
1247
- setAltText(altText) {
1248
- this._native.setAltText(altText)
1249
- return this
1250
- }
1251
-
1252
- setObjectMovement(option) {
1253
- this._native.setObjectMovement(option)
1254
- return this
1255
- }
1256
- }
1257
-
1258
- // JavaScript wrapper for Workbook
1259
- class Workbook {
1260
- constructor() {
1261
- this._native = new nativeBinding.RuscWorkbook()
1262
- }
1263
-
1264
- addWorksheet(name) {
1265
- const nativeWorksheet = this._native.addWorksheet(name)
1266
- return new Worksheet(nativeWorksheet)
1267
- }
1268
-
1269
- addWorksheetWithConstantMemory(name) {
1270
- const nativeWorksheet = this._native.addWorksheetWithConstantMemory(name)
1271
- return new Worksheet(nativeWorksheet)
1272
- }
1273
-
1274
- addWorksheetWithLowMemory(name) {
1275
- const nativeWorksheet = this._native.addWorksheetWithLowMemory(name)
1276
- return new Worksheet(nativeWorksheet)
1277
- }
1278
-
1279
- setTempdir(dir) {
1280
- return this._native.setTempdir(dir)
1281
- }
1282
-
1283
- save(filename) {
1284
- return this._native.save(filename)
1285
- }
1286
-
1287
- saveToBuffer() {
1288
- return this._native.saveToBuffer()
1289
- }
1290
-
1291
- async saveToStream(writable) {
1292
- const os = require('os')
1293
- const path = require('path')
1294
- const fs = require('fs')
1295
- const crypto = require('crypto')
1296
- const { pipeline } = require('stream/promises')
1297
-
1298
- const tmpFile = path.join(os.tmpdir(), `rusc-xlsx-${crypto.randomBytes(8).toString('hex')}.xlsx`)
1299
- let operationError
1300
-
1301
- try {
1302
- this._native.save(tmpFile)
1303
- await pipeline(fs.createReadStream(tmpFile), writable)
1304
- } catch (error) {
1305
- operationError = error
1306
- }
1307
-
1308
- try {
1309
- await fs.promises.unlink(tmpFile)
1310
- } catch (cleanupError) {
1311
- if (cleanupError.code !== 'ENOENT') {
1312
- if (operationError) {
1313
- throw new AggregateError(
1314
- [operationError, cleanupError],
1315
- 'Failed to save workbook to stream and remove the temporary file'
1316
- )
1317
- }
1318
- throw cleanupError
1319
- }
1320
- }
1321
-
1322
- if (operationError) {
1323
- throw operationError
1324
- }
1325
- }
1326
-
1327
- defineName(name, formula) {
1328
- return this._native.defineName(name, formula)
1329
- }
1330
-
1331
- readOnlyRecommended() {
1332
- return this._native.readOnlyRecommended()
1333
- }
1334
-
1335
- addVbaProject(path) {
1336
- return this._native.addVbaProject(path)
1337
- }
1338
-
1339
- setProperties(properties) {
1340
- return this._native.setProperties(properties._native)
1341
- }
1342
- }
1343
-
1344
- // Export wrapper classes
1345
- module.exports = {
1346
- Format,
1347
- Note,
1348
- Formula,
1349
- DataValidation,
1350
- Chart,
1351
- Workbook,
1352
- Worksheet,
1353
- ProtectionOptions,
1354
- RichText,
1355
- Image,
1356
- Table,
1357
- TableColumn,
1358
- Sparkline,
1359
- DocProperties,
1360
- Button,
1361
- Shape,
1362
- // Also export native bindings for advanced use
1363
- RuscFormat: nativeBinding.RuscFormat,
1364
- RuscNote: nativeBinding.RuscNote,
1365
- RuscFormula: nativeBinding.RuscFormula,
1366
- RuscDataValidation: nativeBinding.RuscDataValidation,
1367
- RuscChart: nativeBinding.RuscChart,
1368
- RuscWorkbook: nativeBinding.RuscWorkbook,
1369
- RuscWorksheet: nativeBinding.RuscWorksheet,
1370
- RuscProtectionOptions: nativeBinding.RuscProtectionOptions,
1371
- RuscRichText: nativeBinding.RuscRichText,
1372
- RuscImage: nativeBinding.RuscImage,
1373
- RuscTable: nativeBinding.RuscTable,
1374
- RuscTableColumn: nativeBinding.RuscTableColumn,
1375
- RuscSparkline: nativeBinding.RuscSparkline,
1376
- RuscDocProperties: nativeBinding.RuscDocProperties,
1377
- RuscButton: nativeBinding.RuscButton,
1378
- RuscShape: nativeBinding.RuscShape,
1379
- // Memory tracking
1380
- rustMemoryStats: nativeBinding.rustMemoryStats,
1381
- rustMemoryResetPeak: nativeBinding.rustMemoryResetPeak,
1
+ // \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
15
+ }
16
+ return to;
17
+ };
18
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
19
+ value: mod,
20
+ enumerable: true
21
+ }) : target, mod));
22
+ let node_crypto = require("node:crypto");
23
+ let node_fs = require("node:fs");
24
+ node_fs = __toESM(node_fs);
25
+ let node_os = require("node:os");
26
+ node_os = __toESM(node_os);
27
+ let node_path = require("node:path");
28
+ let node_stream_promises = require("node:stream/promises");
29
+ let index_js = require("./index.js");
30
+ // wrapper.ts
31
+ function isErrnoException(error) {
32
+ return error instanceof Error && "code" in error;
1382
33
  }
34
+ var Format = class {
35
+ _native;
36
+ constructor() {
37
+ this._native = new index_js.RuscFormat();
38
+ }
39
+ setBold() {
40
+ this._native.setBold();
41
+ return this;
42
+ }
43
+ setItalic() {
44
+ this._native.setItalic();
45
+ return this;
46
+ }
47
+ setFontSize(size) {
48
+ this._native.setFontSize(size);
49
+ return this;
50
+ }
51
+ setFontName(fontName) {
52
+ this._native.setFontName(fontName);
53
+ return this;
54
+ }
55
+ setFontScheme(scheme) {
56
+ this._native.setFontScheme(scheme);
57
+ return this;
58
+ }
59
+ setFontColor(color) {
60
+ this._native.setFontColor(color);
61
+ return this;
62
+ }
63
+ setUnderline(underline) {
64
+ this._native.setUnderline(underline);
65
+ return this;
66
+ }
67
+ setStrikethrough() {
68
+ this._native.setStrikethrough();
69
+ return this;
70
+ }
71
+ setBackgroundColor(color) {
72
+ this._native.setBackgroundColor(color);
73
+ return this;
74
+ }
75
+ setForegroundColor(color) {
76
+ this._native.setForegroundColor(color);
77
+ return this;
78
+ }
79
+ setPattern(pattern) {
80
+ this._native.setPattern(pattern);
81
+ return this;
82
+ }
83
+ setAlign(align) {
84
+ this._native.setAlign(align);
85
+ return this;
86
+ }
87
+ setVerticalAlign(align) {
88
+ this._native.setVerticalAlign(align);
89
+ return this;
90
+ }
91
+ setTextWrap() {
92
+ this._native.setTextWrap();
93
+ return this;
94
+ }
95
+ setIndent(indent) {
96
+ this._native.setIndent(indent);
97
+ return this;
98
+ }
99
+ setRotation(rotation) {
100
+ this._native.setRotation(rotation);
101
+ return this;
102
+ }
103
+ setShrink() {
104
+ this._native.setShrink();
105
+ return this;
106
+ }
107
+ setBorder(border) {
108
+ this._native.setBorder(border);
109
+ return this;
110
+ }
111
+ setBorderTop(border) {
112
+ this._native.setBorderTop(border);
113
+ return this;
114
+ }
115
+ setBorderBottom(border) {
116
+ this._native.setBorderBottom(border);
117
+ return this;
118
+ }
119
+ setBorderLeft(border) {
120
+ this._native.setBorderLeft(border);
121
+ return this;
122
+ }
123
+ setBorderRight(border) {
124
+ this._native.setBorderRight(border);
125
+ return this;
126
+ }
127
+ setBorderColor(color) {
128
+ this._native.setBorderColor(color);
129
+ return this;
130
+ }
131
+ setBorderTopColor(color) {
132
+ this._native.setBorderTopColor(color);
133
+ return this;
134
+ }
135
+ setBorderBottomColor(color) {
136
+ this._native.setBorderBottomColor(color);
137
+ return this;
138
+ }
139
+ setBorderLeftColor(color) {
140
+ this._native.setBorderLeftColor(color);
141
+ return this;
142
+ }
143
+ setBorderRightColor(color) {
144
+ this._native.setBorderRightColor(color);
145
+ return this;
146
+ }
147
+ setNumFormat(format) {
148
+ this._native.setNumFormat(format);
149
+ return this;
150
+ }
151
+ setUnlocked() {
152
+ this._native.setUnlocked();
153
+ return this;
154
+ }
155
+ setLocked() {
156
+ this._native.setLocked();
157
+ return this;
158
+ }
159
+ setHidden() {
160
+ this._native.setHidden();
161
+ return this;
162
+ }
163
+ setFontScript(script) {
164
+ this._native.setFontScript(script);
165
+ return this;
166
+ }
167
+ setBorderDiagonal(border) {
168
+ this._native.setBorderDiagonal(border);
169
+ return this;
170
+ }
171
+ setBorderDiagonalColor(color) {
172
+ this._native.setBorderDiagonalColor(color);
173
+ return this;
174
+ }
175
+ setBorderDiagonalType(type) {
176
+ this._native.setBorderDiagonalType(type);
177
+ return this;
178
+ }
179
+ setReadingDirection(direction) {
180
+ this._native.setReadingDirection(direction);
181
+ return this;
182
+ }
183
+ setQuotePrefix() {
184
+ this._native.setQuotePrefix();
185
+ return this;
186
+ }
187
+ };
188
+ var Note = class {
189
+ _native;
190
+ constructor(text) {
191
+ this._native = new index_js.RuscNote(text);
192
+ }
193
+ setAuthor(name) {
194
+ this._native.setAuthor(name);
195
+ return this;
196
+ }
197
+ setWidth(width) {
198
+ this._native.setWidth(width);
199
+ return this;
200
+ }
201
+ setHeight(height) {
202
+ this._native.setHeight(height);
203
+ return this;
204
+ }
205
+ setBackgroundColor(color) {
206
+ this._native.setBackgroundColor(color);
207
+ return this;
208
+ }
209
+ setVisible(visible) {
210
+ this._native.setVisible(visible);
211
+ return this;
212
+ }
213
+ setAltText(altText) {
214
+ this._native.setAltText(altText);
215
+ return this;
216
+ }
217
+ };
218
+ var Formula = class {
219
+ _native;
220
+ constructor(formula) {
221
+ this._native = new index_js.RuscFormula(formula);
222
+ }
223
+ setResult(result) {
224
+ this._native.setResult(result);
225
+ return this;
226
+ }
227
+ };
228
+ var DataValidation = class {
229
+ _native;
230
+ constructor() {
231
+ this._native = new index_js.RuscDataValidation();
232
+ }
233
+ allowWholeNumber(rule, value) {
234
+ this._native.allowWholeNumber(rule, value);
235
+ return this;
236
+ }
237
+ allowWholeNumberBetween(min, max) {
238
+ this._native.allowWholeNumberBetween(min, max);
239
+ return this;
240
+ }
241
+ allowDecimalNumber(rule, value) {
242
+ this._native.allowDecimalNumber(rule, value);
243
+ return this;
244
+ }
245
+ allowDecimalNumberBetween(min, max) {
246
+ this._native.allowDecimalNumberBetween(min, max);
247
+ return this;
248
+ }
249
+ allowListStrings(list) {
250
+ this._native.allowListStrings(list);
251
+ return this;
252
+ }
253
+ allowListFormula(formula) {
254
+ this._native.allowListFormula(formula);
255
+ return this;
256
+ }
257
+ allowCustom(formula) {
258
+ this._native.allowCustom(formula);
259
+ return this;
260
+ }
261
+ allowAnyValue() {
262
+ this._native.allowAnyValue();
263
+ return this;
264
+ }
265
+ ignoreBlank(enable) {
266
+ this._native.ignoreBlank(enable);
267
+ return this;
268
+ }
269
+ showDropdown(enable) {
270
+ this._native.showDropdown(enable);
271
+ return this;
272
+ }
273
+ showInputMessage(enable) {
274
+ this._native.showInputMessage(enable);
275
+ return this;
276
+ }
277
+ showErrorMessage(enable) {
278
+ this._native.showErrorMessage(enable);
279
+ return this;
280
+ }
281
+ setInputTitle(title) {
282
+ this._native.setInputTitle(title);
283
+ return this;
284
+ }
285
+ setInputMessage(message) {
286
+ this._native.setInputMessage(message);
287
+ return this;
288
+ }
289
+ setErrorTitle(title) {
290
+ this._native.setErrorTitle(title);
291
+ return this;
292
+ }
293
+ setErrorMessage(message) {
294
+ this._native.setErrorMessage(message);
295
+ return this;
296
+ }
297
+ setErrorStyle(style) {
298
+ this._native.setErrorStyle(style);
299
+ return this;
300
+ }
301
+ };
302
+ var ProtectionOptions = class {
303
+ _native;
304
+ constructor() {
305
+ this._native = new index_js.RuscProtectionOptions();
306
+ }
307
+ setSelectLockedCells(allow) {
308
+ this._native.setSelectLockedCells(allow);
309
+ return this;
310
+ }
311
+ setSelectUnlockedCells(allow) {
312
+ this._native.setSelectUnlockedCells(allow);
313
+ return this;
314
+ }
315
+ setFormatCells(allow) {
316
+ this._native.setFormatCells(allow);
317
+ return this;
318
+ }
319
+ setFormatColumns(allow) {
320
+ this._native.setFormatColumns(allow);
321
+ return this;
322
+ }
323
+ setFormatRows(allow) {
324
+ this._native.setFormatRows(allow);
325
+ return this;
326
+ }
327
+ setInsertColumns(allow) {
328
+ this._native.setInsertColumns(allow);
329
+ return this;
330
+ }
331
+ setInsertRows(allow) {
332
+ this._native.setInsertRows(allow);
333
+ return this;
334
+ }
335
+ setInsertLinks(allow) {
336
+ this._native.setInsertLinks(allow);
337
+ return this;
338
+ }
339
+ setDeleteColumns(allow) {
340
+ this._native.setDeleteColumns(allow);
341
+ return this;
342
+ }
343
+ setDeleteRows(allow) {
344
+ this._native.setDeleteRows(allow);
345
+ return this;
346
+ }
347
+ setSort(allow) {
348
+ this._native.setSort(allow);
349
+ return this;
350
+ }
351
+ setUseAutofilter(allow) {
352
+ this._native.setUseAutofilter(allow);
353
+ return this;
354
+ }
355
+ setUsePivotTables(allow) {
356
+ this._native.setUsePivotTables(allow);
357
+ return this;
358
+ }
359
+ setEditScenarios(allow) {
360
+ this._native.setEditScenarios(allow);
361
+ return this;
362
+ }
363
+ setEditObjects(allow) {
364
+ this._native.setEditObjects(allow);
365
+ return this;
366
+ }
367
+ setContents(allow) {
368
+ this._native.setContents(allow);
369
+ return this;
370
+ }
371
+ };
372
+ var Image = class Image {
373
+ _native;
374
+ constructor(path) {
375
+ this._native = index_js.RuscImage.new(path);
376
+ }
377
+ static fromBuffer(buffer) {
378
+ const image = Object.create(Image.prototype);
379
+ image._native = index_js.RuscImage.newFromBuffer(buffer);
380
+ return image;
381
+ }
382
+ setWidth(width) {
383
+ this._native.setWidth(width);
384
+ return this;
385
+ }
386
+ setHeight(height) {
387
+ this._native.setHeight(height);
388
+ return this;
389
+ }
390
+ setScaleWidth(scale) {
391
+ this._native.setScaleWidth(scale);
392
+ return this;
393
+ }
394
+ setScaleHeight(scale) {
395
+ this._native.setScaleHeight(scale);
396
+ return this;
397
+ }
398
+ setScaleToSize(width, height, keepAspectRatio = true) {
399
+ this._native.setScaleToSize(width, height, keepAspectRatio);
400
+ return this;
401
+ }
402
+ setAltText(altText) {
403
+ this._native.setAltText(altText);
404
+ return this;
405
+ }
406
+ setDecorative(enable) {
407
+ this._native.setDecorative(enable);
408
+ return this;
409
+ }
410
+ setObjectMovement(option) {
411
+ this._native.setObjectMovement(option);
412
+ return this;
413
+ }
414
+ setUrl(url) {
415
+ this._native.setUrl(url);
416
+ return this;
417
+ }
418
+ };
419
+ var RichText = class {
420
+ _native;
421
+ constructor() {
422
+ this._native = new index_js.RuscRichText();
423
+ }
424
+ addSegment(text, format) {
425
+ this._native.addSegment(text, format ? format._native : null);
426
+ return this;
427
+ }
428
+ };
429
+ var Worksheet = class {
430
+ _native;
431
+ constructor(nativeWorksheet) {
432
+ this._native = nativeWorksheet;
433
+ }
434
+ write(row, col, value, format) {
435
+ if (format) return this._native.write(row, col, value, format._native);
436
+ switch (typeof value) {
437
+ case "string": return this._native.writeString(row, col, value);
438
+ case "number": return this._native.writeNumber(row, col, value);
439
+ case "boolean": return this._native.writeBoolean(row, col, value);
440
+ default: return this._native.write(row, col, value);
441
+ }
442
+ }
443
+ writeRow(row, startCol, values, format) {
444
+ return this._native.writeRow(row, startCol, values, format ? format._native : void 0);
445
+ }
446
+ writeRows(startRow, startCol, rows, format) {
447
+ return this._native.writeRows(startRow, startCol, rows, format ? format._native : void 0);
448
+ }
449
+ writeString(row, col, value) {
450
+ return this._native.writeString(row, col, value);
451
+ }
452
+ writeNumber(row, col, value) {
453
+ return this._native.writeNumber(row, col, value);
454
+ }
455
+ writeBoolean(row, col, value) {
456
+ return this._native.writeBoolean(row, col, value);
457
+ }
458
+ writeBlank(row, col, format) {
459
+ return this._native.writeBlank(row, col, format._native);
460
+ }
461
+ writeDatetimeFromTimestamp(row, col, timestamp, format) {
462
+ return this._native.writeDatetimeFromTimestamp(row, col, timestamp, format ? format._native : void 0);
463
+ }
464
+ writeDatetimeFromYmd(row, col, year, month, day, format) {
465
+ return this._native.writeDatetimeFromYmd(row, col, year, month, day, format ? format._native : void 0);
466
+ }
467
+ writeDatetimeFromYmdHms(row, col, year, month, day, hour, min, sec, format) {
468
+ return this._native.writeDatetimeFromYmdHms(row, col, year, month, day, hour, min, sec, format ? format._native : void 0);
469
+ }
470
+ writeDatetimeFromString(row, col, datetimeStr, format) {
471
+ return this._native.writeDatetimeFromString(row, col, datetimeStr, format ? format._native : void 0);
472
+ }
473
+ writeDatetime(row, col, datetime, format) {
474
+ if (datetime instanceof Date) {
475
+ const timestamp = Math.floor(datetime.getTime() / 1e3);
476
+ return this.writeDatetimeFromTimestamp(row, col, timestamp, format);
477
+ } else if (typeof datetime === "number") return this.writeDatetimeFromTimestamp(row, col, datetime, format);
478
+ else if (typeof datetime === "string") return this.writeDatetimeFromString(row, col, datetime, format);
479
+ else if (typeof datetime === "object") {
480
+ if (datetime.hour !== void 0 || datetime.min !== void 0 || datetime.sec !== void 0) return this.writeDatetimeFromYmdHms(row, col, datetime.year, datetime.month, datetime.day, datetime.hour || 0, datetime.min || 0, datetime.sec || 0, format);
481
+ else return this.writeDatetimeFromYmd(row, col, datetime.year, datetime.month, datetime.day, format);
482
+ } else throw new Error("Invalid datetime input: must be Date, number (timestamp), string (ISO), or object");
483
+ }
484
+ writeWithFormat(row, col, value, format) {
485
+ return this._native.writeWithFormat(row, col, value, format._native);
486
+ }
487
+ setColumnWidth(col, width) {
488
+ return this._native.setColumnWidth(col, width);
489
+ }
490
+ setRowHeight(row, height) {
491
+ return this._native.setRowHeight(row, height);
492
+ }
493
+ setDefaultRowHeight(height) {
494
+ return this._native.setDefaultRowHeight(height);
495
+ }
496
+ setAutofitMaxRow(maxRow) {
497
+ return this._native.setAutofitMaxRow(maxRow);
498
+ }
499
+ setAutofitMaxWidth(maxWidth) {
500
+ return this._native.setAutofitMaxWidth(maxWidth);
501
+ }
502
+ autofit() {
503
+ return this._native.autofit();
504
+ }
505
+ setName(name) {
506
+ return this._native.setName(name);
507
+ }
508
+ mergeRange(firstRow, firstCol, lastRow, lastCol, value, format) {
509
+ return this._native.mergeRange(firstRow, firstCol, lastRow, lastCol, value, format ? format._native : void 0);
510
+ }
511
+ mergeRangeWithFormat(firstRow, firstCol, lastRow, lastCol, value, format) {
512
+ return this._native.mergeRangeWithFormat(firstRow, firstCol, lastRow, lastCol, value, format._native);
513
+ }
514
+ insertNote(row, col, note) {
515
+ return this._native.insertNote(row, col, note._native);
516
+ }
517
+ setDefaultNoteAuthor(name) {
518
+ return this._native.setDefaultNoteAuthor(name);
519
+ }
520
+ writeFormula(row, col, formula, format) {
521
+ return this._native.writeFormula(row, col, formula._native, format ? format._native : void 0);
522
+ }
523
+ writeDynamicFormula(row, col, formula, format) {
524
+ return this._native.writeDynamicFormula(row, col, formula._native, format ? format._native : void 0);
525
+ }
526
+ writeArrayFormula(firstRow, firstCol, lastRow, lastCol, formula, format) {
527
+ return this._native.writeArrayFormula(firstRow, firstCol, lastRow, lastCol, formula._native, format ? format._native : void 0);
528
+ }
529
+ addDataValidation(firstRow, firstCol, lastRow, lastCol, validation) {
530
+ return this._native.addDataValidation(firstRow, firstCol, lastRow, lastCol, validation._native);
531
+ }
532
+ writeUrl(row, col, url, format) {
533
+ return this._native.writeUrl(row, col, url, format ? format._native : void 0);
534
+ }
535
+ writeUrlWithText(row, col, url, text, format) {
536
+ return this._native.writeUrlWithText(row, col, url, text, format ? format._native : void 0);
537
+ }
538
+ autofilter(firstRow, firstCol, lastRow, lastCol) {
539
+ return this._native.autofilter(firstRow, firstCol, lastRow, lastCol);
540
+ }
541
+ setFreezePanes(row, col) {
542
+ return this._native.setFreezePanes(row, col);
543
+ }
544
+ addConditionalFormat2ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, maxColor) {
545
+ return this._native.addConditionalFormat2ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, maxColor);
546
+ }
547
+ addConditionalFormat3ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, midColor, maxColor) {
548
+ return this._native.addConditionalFormat3ColorScale(firstRow, firstCol, lastRow, lastCol, minColor, midColor, maxColor);
549
+ }
550
+ addConditionalFormatDataBar(firstRow, firstCol, lastRow, lastCol, barColor) {
551
+ return this._native.addConditionalFormatDataBar(firstRow, firstCol, lastRow, lastCol, barColor);
552
+ }
553
+ addConditionalFormatCell(firstRow, firstCol, lastRow, lastCol, rule, value, format) {
554
+ return this._native.addConditionalFormatCell(firstRow, firstCol, lastRow, lastCol, rule, value, format._native);
555
+ }
556
+ addConditionalFormatText(firstRow, firstCol, lastRow, lastCol, rule, text, format) {
557
+ return this._native.addConditionalFormatText(firstRow, firstCol, lastRow, lastCol, rule, text, format._native);
558
+ }
559
+ addConditionalFormatAverage(firstRow, firstCol, lastRow, lastCol, rule, format) {
560
+ return this._native.addConditionalFormatAverage(firstRow, firstCol, lastRow, lastCol, rule, format._native);
561
+ }
562
+ addConditionalFormatTop(firstRow, firstCol, lastRow, lastCol, rule, value, format) {
563
+ return this._native.addConditionalFormatTop(firstRow, firstCol, lastRow, lastCol, rule, value, format._native);
564
+ }
565
+ addConditionalFormatDuplicate(firstRow, firstCol, lastRow, lastCol, invert, format) {
566
+ return this._native.addConditionalFormatDuplicate(firstRow, firstCol, lastRow, lastCol, invert, format._native);
567
+ }
568
+ addConditionalFormatBlank(firstRow, firstCol, lastRow, lastCol, invert, format) {
569
+ return this._native.addConditionalFormatBlank(firstRow, firstCol, lastRow, lastCol, invert, format._native);
570
+ }
571
+ addConditionalFormatError(firstRow, firstCol, lastRow, lastCol, invert, format) {
572
+ return this._native.addConditionalFormatError(firstRow, firstCol, lastRow, lastCol, invert, format._native);
573
+ }
574
+ addConditionalFormatDate(firstRow, firstCol, lastRow, lastCol, rule, format) {
575
+ return this._native.addConditionalFormatDate(firstRow, firstCol, lastRow, lastCol, rule, format._native);
576
+ }
577
+ addConditionalFormatFormula(firstRow, firstCol, lastRow, lastCol, formula, format) {
578
+ return this._native.addConditionalFormatFormula(firstRow, firstCol, lastRow, lastCol, formula, format._native);
579
+ }
580
+ addConditionalFormatIconSet(firstRow, firstCol, lastRow, lastCol, iconType) {
581
+ return this._native.addConditionalFormatIconSet(firstRow, firstCol, lastRow, lastCol, iconType);
582
+ }
583
+ setMargins(left, right, top, bottom, header, footer) {
584
+ return this._native.setMargins(left, right, top, bottom, header, footer);
585
+ }
586
+ setPortrait() {
587
+ return this._native.setPortrait();
588
+ }
589
+ setLandscape() {
590
+ return this._native.setLandscape();
591
+ }
592
+ setPaperSize(paperSize) {
593
+ return this._native.setPaperSize(paperSize);
594
+ }
595
+ setHeader(header) {
596
+ return this._native.setHeader(header);
597
+ }
598
+ setFooter(footer) {
599
+ return this._native.setFooter(footer);
600
+ }
601
+ setPrintArea(firstRow, firstCol, lastRow, lastCol) {
602
+ return this._native.setPrintArea(firstRow, firstCol, lastRow, lastCol);
603
+ }
604
+ setPrintGridlines(enable) {
605
+ return this._native.setPrintGridlines(enable);
606
+ }
607
+ setPrintCenterHorizontally(enable) {
608
+ return this._native.setPrintCenterHorizontally(enable);
609
+ }
610
+ setPrintCenterVertically(enable) {
611
+ return this._native.setPrintCenterVertically(enable);
612
+ }
613
+ setPrintFitToPages(width, height) {
614
+ return this._native.setPrintFitToPages(width, height);
615
+ }
616
+ setPrintScale(scale) {
617
+ return this._native.setPrintScale(scale);
618
+ }
619
+ setPrintFirstPageNumber(pageNumber) {
620
+ return this._native.setPrintFirstPageNumber(pageNumber);
621
+ }
622
+ setPrintBlackAndWhite(enable) {
623
+ return this._native.setPrintBlackAndWhite(enable);
624
+ }
625
+ setPrintDraft(enable) {
626
+ return this._native.setPrintDraft(enable);
627
+ }
628
+ setPrintHeadings(enable) {
629
+ return this._native.setPrintHeadings(enable);
630
+ }
631
+ setRepeatRows(firstRow, lastRow) {
632
+ return this._native.setRepeatRows(firstRow, lastRow);
633
+ }
634
+ setRepeatColumns(firstCol, lastCol) {
635
+ return this._native.setRepeatColumns(firstCol, lastCol);
636
+ }
637
+ setHeaderFooterScaleWithDoc(enable) {
638
+ return this._native.setHeaderFooterScaleWithDoc(enable);
639
+ }
640
+ setHeaderFooterAlignWithPage(enable) {
641
+ return this._native.setHeaderFooterAlignWithPage(enable);
642
+ }
643
+ insertChart(row, col, chart) {
644
+ return this._native.insertChart(row, col, chart._native);
645
+ }
646
+ insertChartWithOffset(row, col, chart, xOffset, yOffset) {
647
+ return this._native.insertChartWithOffset(row, col, chart._native, xOffset, yOffset);
648
+ }
649
+ insertImage(row, col, image) {
650
+ return this._native.insertImage(row, col, image._native);
651
+ }
652
+ insertImageWithOffset(row, col, image, xOffset, yOffset) {
653
+ return this._native.insertImageWithOffset(row, col, image._native, xOffset, yOffset);
654
+ }
655
+ insertImageFitToCell(row, col, image, keepAspectRatio = true) {
656
+ return this._native.insertImageFitToCell(row, col, image._native, keepAspectRatio);
657
+ }
658
+ insertImageFitToCellCentered(row, col, image) {
659
+ return this._native.insertImageFitToCellCentered(row, col, image._native);
660
+ }
661
+ addTable(firstRow, firstCol, lastRow, lastCol, table) {
662
+ return this._native.addTable(firstRow, firstCol, lastRow, lastCol, table._native);
663
+ }
664
+ addSparkline(row, col, sparkline) {
665
+ return this._native.addSparkline(row, col, sparkline._native);
666
+ }
667
+ addSparklineGroup(firstRow, firstCol, lastRow, lastCol, sparkline) {
668
+ return this._native.addSparklineGroup(firstRow, firstCol, lastRow, lastCol, sparkline._native);
669
+ }
670
+ setTabColor(color) {
671
+ return this._native.setTabColor(color);
672
+ }
673
+ setHidden(enable) {
674
+ return this._native.setHidden(enable);
675
+ }
676
+ setZoom(zoom) {
677
+ return this._native.setZoom(zoom);
678
+ }
679
+ setHiddenZeroes(enable) {
680
+ return this._native.setHiddenZeroes(enable);
681
+ }
682
+ setSelection(firstRow, firstCol, lastRow, lastCol) {
683
+ return this._native.setSelection(firstRow, firstCol, lastRow, lastCol);
684
+ }
685
+ setTopLeftCell(row, col) {
686
+ return this._native.setTopLeftCell(row, col);
687
+ }
688
+ protect() {
689
+ return this._native.protect();
690
+ }
691
+ protectWithPassword(password) {
692
+ return this._native.protectWithPassword(password);
693
+ }
694
+ protectWithOptions(options) {
695
+ return this._native.protectWithOptions(options._native);
696
+ }
697
+ protectWithPasswordAndOptions(password, options) {
698
+ return this._native.protectWithPasswordAndOptions(password, options._native);
699
+ }
700
+ writeRichString(row, col, richText) {
701
+ return this._native.writeRichString(row, col, richText._native);
702
+ }
703
+ writeRichStringWithFormat(row, col, richText, cellFormat) {
704
+ return this._native.writeRichStringWithFormat(row, col, richText._native, cellFormat._native);
705
+ }
706
+ insertButton(row, col, button) {
707
+ return this._native.insertButton(row, col, button._native);
708
+ }
709
+ insertButtonWithOffset(row, col, button, xOffset, yOffset) {
710
+ return this._native.insertButtonWithOffset(row, col, button._native, xOffset, yOffset);
711
+ }
712
+ insertShape(row, col, shape) {
713
+ return this._native.insertShape(row, col, shape._native);
714
+ }
715
+ insertShapeWithOffset(row, col, shape, xOffset, yOffset) {
716
+ return this._native.insertShapeWithOffset(row, col, shape._native, xOffset, yOffset);
717
+ }
718
+ };
719
+ var Chart = class {
720
+ _native;
721
+ constructor(chartType) {
722
+ this._native = new index_js.RuscChart(chartType);
723
+ }
724
+ addSeries(options) {
725
+ const { categories, values, name } = options;
726
+ return this._native.addSeries(categories || null, values, name || null);
727
+ }
728
+ setTitle(title) {
729
+ this._native.setTitle(title);
730
+ return this;
731
+ }
732
+ setXAxisName(name) {
733
+ this._native.setXAxisName(name);
734
+ return this;
735
+ }
736
+ setYAxisName(name) {
737
+ this._native.setYAxisName(name);
738
+ return this;
739
+ }
740
+ setStyle(style) {
741
+ this._native.setStyle(style);
742
+ return this;
743
+ }
744
+ setLegendHidden() {
745
+ this._native.setLegendHidden();
746
+ return this;
747
+ }
748
+ };
749
+ var Table = class {
750
+ _native;
751
+ constructor() {
752
+ this._native = index_js.RuscTable.new();
753
+ }
754
+ setHeaderRow(show) {
755
+ this._native.setHeaderRow(show);
756
+ return this;
757
+ }
758
+ setTotalRow(show) {
759
+ this._native.setTotalRow(show);
760
+ return this;
761
+ }
762
+ setBandedRows(show) {
763
+ this._native.setBandedRows(show);
764
+ return this;
765
+ }
766
+ setBandedColumns(show) {
767
+ this._native.setBandedColumns(show);
768
+ return this;
769
+ }
770
+ setFirstColumn(show) {
771
+ this._native.setFirstColumn(show);
772
+ return this;
773
+ }
774
+ setLastColumn(show) {
775
+ this._native.setLastColumn(show);
776
+ return this;
777
+ }
778
+ setName(name) {
779
+ this._native.setName(name);
780
+ return this;
781
+ }
782
+ setAltText(altText) {
783
+ this._native.setAltText(altText);
784
+ return this;
785
+ }
786
+ setAltTextTitle(title) {
787
+ this._native.setAltTextTitle(title);
788
+ return this;
789
+ }
790
+ setStyle(styleId) {
791
+ this._native.setStyle(styleId);
792
+ return this;
793
+ }
794
+ setColumns(columns) {
795
+ const nativeColumns = columns.map((col) => col._native);
796
+ this._native.setColumns(nativeColumns);
797
+ return this;
798
+ }
799
+ };
800
+ var TableColumn = class {
801
+ _native;
802
+ constructor() {
803
+ this._native = index_js.RuscTableColumn.new();
804
+ }
805
+ setHeader(header) {
806
+ this._native.setHeader(header);
807
+ return this;
808
+ }
809
+ setTotalFunction(func) {
810
+ this._native.setTotalFunction(func);
811
+ return this;
812
+ }
813
+ setTotalLabel(label) {
814
+ this._native.setTotalLabel(label);
815
+ return this;
816
+ }
817
+ setFormula(formula) {
818
+ this._native.setFormula(formula);
819
+ return this;
820
+ }
821
+ };
822
+ var Sparkline = class {
823
+ _native;
824
+ constructor() {
825
+ this._native = index_js.RuscSparkline.new();
826
+ }
827
+ setRange(range) {
828
+ this._native.setRange(range);
829
+ return this;
830
+ }
831
+ setType(type) {
832
+ this._native.setType(type);
833
+ return this;
834
+ }
835
+ showHighPoint(enable) {
836
+ this._native.showHighPoint(enable);
837
+ return this;
838
+ }
839
+ showLowPoint(enable) {
840
+ this._native.showLowPoint(enable);
841
+ return this;
842
+ }
843
+ showFirstPoint(enable) {
844
+ this._native.showFirstPoint(enable);
845
+ return this;
846
+ }
847
+ showLastPoint(enable) {
848
+ this._native.showLastPoint(enable);
849
+ return this;
850
+ }
851
+ showNegativePoints(enable) {
852
+ this._native.showNegativePoints(enable);
853
+ return this;
854
+ }
855
+ showMarkers(enable) {
856
+ this._native.showMarkers(enable);
857
+ return this;
858
+ }
859
+ showAxis(enable) {
860
+ this._native.showAxis(enable);
861
+ return this;
862
+ }
863
+ showHiddenData(enable) {
864
+ this._native.showHiddenData(enable);
865
+ return this;
866
+ }
867
+ setRightToLeft(enable) {
868
+ this._native.setRightToLeft(enable);
869
+ return this;
870
+ }
871
+ setSparklineColor(color) {
872
+ this._native.setSparklineColor(color);
873
+ return this;
874
+ }
875
+ setHighPointColor(color) {
876
+ this._native.setHighPointColor(color);
877
+ return this;
878
+ }
879
+ setLowPointColor(color) {
880
+ this._native.setLowPointColor(color);
881
+ return this;
882
+ }
883
+ setFirstPointColor(color) {
884
+ this._native.setFirstPointColor(color);
885
+ return this;
886
+ }
887
+ setLastPointColor(color) {
888
+ this._native.setLastPointColor(color);
889
+ return this;
890
+ }
891
+ setNegativePointsColor(color) {
892
+ this._native.setNegativePointsColor(color);
893
+ return this;
894
+ }
895
+ setMarkersColor(color) {
896
+ this._native.setMarkersColor(color);
897
+ return this;
898
+ }
899
+ setLineWeight(weight) {
900
+ this._native.setLineWeight(weight);
901
+ return this;
902
+ }
903
+ setCustomMax(max) {
904
+ this._native.setCustomMax(max);
905
+ return this;
906
+ }
907
+ setCustomMin(min) {
908
+ this._native.setCustomMin(min);
909
+ return this;
910
+ }
911
+ setGroupMax(enable) {
912
+ this._native.setGroupMax(enable);
913
+ return this;
914
+ }
915
+ setGroupMin(enable) {
916
+ this._native.setGroupMin(enable);
917
+ return this;
918
+ }
919
+ setStyle(style) {
920
+ this._native.setStyle(style);
921
+ return this;
922
+ }
923
+ showEmptyCellsAs(option) {
924
+ this._native.showEmptyCellsAs(option);
925
+ return this;
926
+ }
927
+ };
928
+ var DocProperties = class {
929
+ _native;
930
+ constructor() {
931
+ this._native = index_js.RuscDocProperties.new();
932
+ }
933
+ setAuthor(author) {
934
+ this._native.setAuthor(author);
935
+ return this;
936
+ }
937
+ setTitle(title) {
938
+ this._native.setTitle(title);
939
+ return this;
940
+ }
941
+ setSubject(subject) {
942
+ this._native.setSubject(subject);
943
+ return this;
944
+ }
945
+ setComment(comment) {
946
+ this._native.setComment(comment);
947
+ return this;
948
+ }
949
+ setCompany(company) {
950
+ this._native.setCompany(company);
951
+ return this;
952
+ }
953
+ setManager(manager) {
954
+ this._native.setManager(manager);
955
+ return this;
956
+ }
957
+ setStatus(status) {
958
+ this._native.setStatus(status);
959
+ return this;
960
+ }
961
+ setCategory(category) {
962
+ this._native.setCategory(category);
963
+ return this;
964
+ }
965
+ setKeywords(keywords) {
966
+ this._native.setKeywords(keywords);
967
+ return this;
968
+ }
969
+ setHyperlinkBase(base) {
970
+ this._native.setHyperlinkBase(base);
971
+ return this;
972
+ }
973
+ };
974
+ var Button = class {
975
+ _native;
976
+ constructor() {
977
+ this._native = index_js.RuscButton.new();
978
+ }
979
+ setCaption(caption) {
980
+ this._native.setCaption(caption);
981
+ return this;
982
+ }
983
+ setMacro(macroName) {
984
+ this._native.setMacro(macroName);
985
+ return this;
986
+ }
987
+ setWidth(width) {
988
+ this._native.setWidth(width);
989
+ return this;
990
+ }
991
+ setHeight(height) {
992
+ this._native.setHeight(height);
993
+ return this;
994
+ }
995
+ setAltText(altText) {
996
+ this._native.setAltText(altText);
997
+ return this;
998
+ }
999
+ setObjectMovement(option) {
1000
+ this._native.setObjectMovement(option);
1001
+ return this;
1002
+ }
1003
+ };
1004
+ var Shape = class Shape {
1005
+ _native;
1006
+ constructor(native) {
1007
+ this._native = native;
1008
+ }
1009
+ static textbox() {
1010
+ return new Shape(index_js.RuscShape.textbox());
1011
+ }
1012
+ setText(text) {
1013
+ this._native.setText(text);
1014
+ return this;
1015
+ }
1016
+ setWidth(width) {
1017
+ this._native.setWidth(width);
1018
+ return this;
1019
+ }
1020
+ setHeight(height) {
1021
+ this._native.setHeight(height);
1022
+ return this;
1023
+ }
1024
+ setAltText(altText) {
1025
+ this._native.setAltText(altText);
1026
+ return this;
1027
+ }
1028
+ setObjectMovement(option) {
1029
+ this._native.setObjectMovement(option);
1030
+ return this;
1031
+ }
1032
+ };
1033
+ var Workbook = class {
1034
+ _native;
1035
+ constructor() {
1036
+ this._native = new index_js.RuscWorkbook();
1037
+ }
1038
+ addWorksheet(name) {
1039
+ return new Worksheet(this._native.addWorksheet(name));
1040
+ }
1041
+ addWorksheetWithConstantMemory(name) {
1042
+ return new Worksheet(this._native.addWorksheetWithConstantMemory(name));
1043
+ }
1044
+ addWorksheetWithLowMemory(name) {
1045
+ return new Worksheet(this._native.addWorksheetWithLowMemory(name));
1046
+ }
1047
+ setTempdir(dir) {
1048
+ return this._native.setTempdir(dir);
1049
+ }
1050
+ setDefaultFormat(format, rowHeight, columnWidth) {
1051
+ return this._native.setDefaultFormat(format._native, rowHeight, columnWidth);
1052
+ }
1053
+ useExcel2023Theme() {
1054
+ return this._native.useExcel2023Theme();
1055
+ }
1056
+ setZipCompressionLevel(level) {
1057
+ return this._native.setZipCompressionLevel(level);
1058
+ }
1059
+ setCalculationMode(mode) {
1060
+ return this._native.setCalculationMode(mode);
1061
+ }
1062
+ setTabRatio(ratio) {
1063
+ return this._native.setTabRatio(ratio);
1064
+ }
1065
+ useCustomTheme(path) {
1066
+ return this._native.useCustomTheme(path);
1067
+ }
1068
+ save(filename) {
1069
+ return this._native.save(filename);
1070
+ }
1071
+ saveToBuffer() {
1072
+ return this._native.saveToBuffer();
1073
+ }
1074
+ async saveToStream(writable) {
1075
+ const tmpFile = (0, node_path.join)(node_os.default.tmpdir(), `rusc-xlsx-${(0, node_crypto.randomBytes)(8).toString("hex")}.xlsx`);
1076
+ let operationError;
1077
+ try {
1078
+ this._native.save(tmpFile);
1079
+ await (0, node_stream_promises.pipeline)(node_fs.default.createReadStream(tmpFile), writable);
1080
+ } catch (error) {
1081
+ operationError = error;
1082
+ }
1083
+ try {
1084
+ await node_fs.default.promises.unlink(tmpFile);
1085
+ } catch (cleanupError) {
1086
+ if (!isErrnoException(cleanupError) || cleanupError.code !== "ENOENT") {
1087
+ if (operationError) throw new AggregateError([operationError, cleanupError], "Failed to save workbook to stream and remove the temporary file", { cause: cleanupError });
1088
+ throw cleanupError;
1089
+ }
1090
+ }
1091
+ if (operationError) throw operationError;
1092
+ }
1093
+ defineName(name, formula) {
1094
+ return this._native.defineName(name, formula);
1095
+ }
1096
+ readOnlyRecommended() {
1097
+ return this._native.readOnlyRecommended();
1098
+ }
1099
+ addVbaProject(path) {
1100
+ return this._native.addVbaProject(path);
1101
+ }
1102
+ setProperties(properties) {
1103
+ return this._native.setProperties(properties._native);
1104
+ }
1105
+ };
1106
+ exports.Button = Button;
1107
+ exports.Chart = Chart;
1108
+ exports.DataValidation = DataValidation;
1109
+ exports.DocProperties = DocProperties;
1110
+ exports.Format = Format;
1111
+ exports.Formula = Formula;
1112
+ exports.Image = Image;
1113
+ exports.Note = Note;
1114
+ exports.ProtectionOptions = ProtectionOptions;
1115
+ exports.RichText = RichText;
1116
+ Object.defineProperty(exports, "RuscButton", {
1117
+ enumerable: true,
1118
+ get: function() {
1119
+ return index_js.RuscButton;
1120
+ }
1121
+ });
1122
+ Object.defineProperty(exports, "RuscChart", {
1123
+ enumerable: true,
1124
+ get: function() {
1125
+ return index_js.RuscChart;
1126
+ }
1127
+ });
1128
+ Object.defineProperty(exports, "RuscDataValidation", {
1129
+ enumerable: true,
1130
+ get: function() {
1131
+ return index_js.RuscDataValidation;
1132
+ }
1133
+ });
1134
+ Object.defineProperty(exports, "RuscDocProperties", {
1135
+ enumerable: true,
1136
+ get: function() {
1137
+ return index_js.RuscDocProperties;
1138
+ }
1139
+ });
1140
+ Object.defineProperty(exports, "RuscFormat", {
1141
+ enumerable: true,
1142
+ get: function() {
1143
+ return index_js.RuscFormat;
1144
+ }
1145
+ });
1146
+ Object.defineProperty(exports, "RuscFormula", {
1147
+ enumerable: true,
1148
+ get: function() {
1149
+ return index_js.RuscFormula;
1150
+ }
1151
+ });
1152
+ Object.defineProperty(exports, "RuscImage", {
1153
+ enumerable: true,
1154
+ get: function() {
1155
+ return index_js.RuscImage;
1156
+ }
1157
+ });
1158
+ Object.defineProperty(exports, "RuscNote", {
1159
+ enumerable: true,
1160
+ get: function() {
1161
+ return index_js.RuscNote;
1162
+ }
1163
+ });
1164
+ Object.defineProperty(exports, "RuscProtectionOptions", {
1165
+ enumerable: true,
1166
+ get: function() {
1167
+ return index_js.RuscProtectionOptions;
1168
+ }
1169
+ });
1170
+ Object.defineProperty(exports, "RuscRichText", {
1171
+ enumerable: true,
1172
+ get: function() {
1173
+ return index_js.RuscRichText;
1174
+ }
1175
+ });
1176
+ Object.defineProperty(exports, "RuscShape", {
1177
+ enumerable: true,
1178
+ get: function() {
1179
+ return index_js.RuscShape;
1180
+ }
1181
+ });
1182
+ Object.defineProperty(exports, "RuscSparkline", {
1183
+ enumerable: true,
1184
+ get: function() {
1185
+ return index_js.RuscSparkline;
1186
+ }
1187
+ });
1188
+ Object.defineProperty(exports, "RuscTable", {
1189
+ enumerable: true,
1190
+ get: function() {
1191
+ return index_js.RuscTable;
1192
+ }
1193
+ });
1194
+ Object.defineProperty(exports, "RuscTableColumn", {
1195
+ enumerable: true,
1196
+ get: function() {
1197
+ return index_js.RuscTableColumn;
1198
+ }
1199
+ });
1200
+ Object.defineProperty(exports, "RuscWorkbook", {
1201
+ enumerable: true,
1202
+ get: function() {
1203
+ return index_js.RuscWorkbook;
1204
+ }
1205
+ });
1206
+ Object.defineProperty(exports, "RuscWorksheet", {
1207
+ enumerable: true,
1208
+ get: function() {
1209
+ return index_js.RuscWorksheet;
1210
+ }
1211
+ });
1212
+ exports.Shape = Shape;
1213
+ exports.Sparkline = Sparkline;
1214
+ exports.Table = Table;
1215
+ exports.TableColumn = TableColumn;
1216
+ exports.Workbook = Workbook;
1217
+ exports.Worksheet = Worksheet;
1218
+ Object.defineProperty(exports, "rustMemoryResetPeak", {
1219
+ enumerable: true,
1220
+ get: function() {
1221
+ return index_js.rustMemoryResetPeak;
1222
+ }
1223
+ });
1224
+ Object.defineProperty(exports, "rustMemoryStats", {
1225
+ enumerable: true,
1226
+ get: function() {
1227
+ return index_js.rustMemoryStats;
1228
+ }
1229
+ });