@xlvane/compat 1.2.3 → 1.3.1
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/dist/index.d.ts +37 -9
- package/dist/index.js +940 -112
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { StreamSheetSpec, Workbook as Workbook$1, WorkbookProperties as WorkbookProperties$1 } from "xlvane";
|
|
1
|
+
import { FontStyle, StreamSheetSpec, Workbook as Workbook$1, WorkbookProperties as WorkbookProperties$1 } from "xlvane";
|
|
2
2
|
/**
|
|
3
3
|
* A cell location of a defined name, as exceljs keeps it.
|
|
4
4
|
*
|
|
@@ -150,6 +150,8 @@ interface WorkbookMeta {
|
|
|
150
150
|
readonly views?: readonly Record<string, unknown>[];
|
|
151
151
|
/** `workbook.calcProperties`. */
|
|
152
152
|
readonly calcProperties?: Record<string, unknown>;
|
|
153
|
+
/** The default font (font 0) of a loaded workbook (F4). */
|
|
154
|
+
readonly defaultFont?: FontStyle;
|
|
153
155
|
}
|
|
154
156
|
/**
|
|
155
157
|
* Options of `xlsx.load`, `read` and `readFile`, as exceljs `XlsxReadOptions` (index.d.ts L1460;
|
|
@@ -287,6 +289,8 @@ export declare class Workbook {
|
|
|
287
289
|
get definedNames(): DefinedNames;
|
|
288
290
|
/** @internal The document properties and defined names to write, as exceljs `workbook.model`. */
|
|
289
291
|
_meta(): WorkbookMeta;
|
|
292
|
+
/** @internal The default font (font 0) of the file this workbook was loaded from, written again (F4); `null` for a workbook made in code. */
|
|
293
|
+
_defaultFont: FontStyle | null;
|
|
290
294
|
/** @internal */
|
|
291
295
|
get _date1904(): boolean;
|
|
292
296
|
private _byName;
|
|
@@ -405,12 +409,16 @@ interface CsvWriteOptions {
|
|
|
405
409
|
map?(value: unknown, index: number): unknown;
|
|
406
410
|
/** Blank lines for missing rows (default `true`). */
|
|
407
411
|
includeEmptyRows?: boolean;
|
|
408
|
-
/** fast-csv formatter options: `delimiter`, `rowDelimiter`, `quote`, `escape`, `quoteColumns`, `headers`, `writeHeaders`, `includeEndRowDelimiter`, `writeBOM`. */
|
|
412
|
+
/** fast-csv formatter options: `delimiter`, `rowDelimiter`, `quote`, `escape`, `quoteColumns`, `quoteHeaders`, `headers`, `writeHeaders`, `alwaysWriteHeaders`, `includeEndRowDelimiter`, `writeBOM`, `transform`. */
|
|
409
413
|
formatterOptions?: Record<string, unknown>;
|
|
410
414
|
/**
|
|
411
|
-
* `"escape"` (default): text that starts with `=`, `+`, `-`, `@`, tab, CR
|
|
412
|
-
* full-width forms)
|
|
413
|
-
*
|
|
415
|
+
* `"escape"` (default): text that starts with `=`, `+`, `-`, `@`, tab, CR, LF or another
|
|
416
|
+
* control character (or the full-width forms of the signs), or with a byte order mark, is
|
|
417
|
+
* written with a leading `'`, so spreadsheet applications show it as text (OWASP CSV
|
|
418
|
+
* Injection); so is a `latin1` or `utf16le` field whose first bytes are a byte order mark, and
|
|
419
|
+
* a `utf16le` field whose bytes without NULs start with `=`. `utf16le` output starts with the
|
|
420
|
+
* UTF-16LE byte order mark. A field holding a comma, `;`, tab or `|` is quoted whatever the
|
|
421
|
+
* delimiter. `"off"`: written unchanged, as exceljs does. An xlvane option.
|
|
414
422
|
*/
|
|
415
423
|
formulaInjection?: "escape" | "off";
|
|
416
424
|
}
|
|
@@ -2452,8 +2460,12 @@ export declare class Cell {
|
|
|
2452
2460
|
_master: Cell | null;
|
|
2453
2461
|
/** @internal Number of merged ranges this cell is the master of. */
|
|
2454
2462
|
_mergeCount: number;
|
|
2463
|
+
/** The moved formula of a `{ sharedFormula }` value, and what it was moved from (see `formula`). */
|
|
2464
|
+
private _moved;
|
|
2455
2465
|
/** @internal Use `worksheet.getCell()`. */
|
|
2456
2466
|
constructor(_row: Row, _col: number);
|
|
2467
|
+
/** The style a new cell takes: row style wins over column style, part by part (lib/doc/cell.js L99-119 `_mergeStyle`). */
|
|
2468
|
+
private _rowColumnStyle;
|
|
2457
2469
|
get worksheet(): Worksheet;
|
|
2458
2470
|
get row(): number;
|
|
2459
2471
|
get col(): number;
|
|
@@ -2476,7 +2488,12 @@ export declare class Cell {
|
|
|
2476
2488
|
* this cell, as exceljs translates it (lib/doc/cell.js `_getTranslatedFormula`; X4-29).
|
|
2477
2489
|
*/
|
|
2478
2490
|
get formula(): string | undefined;
|
|
2479
|
-
/**
|
|
2491
|
+
/**
|
|
2492
|
+
* `FormulaType.Shared` for a `{ sharedFormula }` value, `Master` for other formulas, and
|
|
2493
|
+
* `undefined` for a cell without a formula and for a merged cell other than the top-left one,
|
|
2494
|
+
* as in exceljs, where only the formula value has a `formulaType` (lib/doc/cell.js L264-266,
|
|
2495
|
+
* L807-815; exceljs's declaration says `FormulaType` all the same).
|
|
2496
|
+
*/
|
|
2480
2497
|
get formulaType(): FormulaType;
|
|
2481
2498
|
get result(): unknown;
|
|
2482
2499
|
get numFmt(): string | undefined;
|
|
@@ -2553,6 +2570,11 @@ export declare class Cell {
|
|
|
2553
2570
|
_merge(master: Cell): void;
|
|
2554
2571
|
/** @internal */
|
|
2555
2572
|
_unmerge(): void;
|
|
2573
|
+
/**
|
|
2574
|
+
* @internal As exceljs `cell.unmerge()` (lib/doc/cell.js L177-183): a cell merged into another
|
|
2575
|
+
* one gets the row and column style again, instead of the master's.
|
|
2576
|
+
*/
|
|
2577
|
+
_unmergeResetStyle(): void;
|
|
2556
2578
|
}
|
|
2557
2579
|
/**
|
|
2558
2580
|
* A row, as exceljs `Row` (lib/doc/row.js).
|
|
@@ -2702,7 +2724,7 @@ export declare class Column {
|
|
|
2702
2724
|
equivalentTo(other: Column): boolean;
|
|
2703
2725
|
get defn(): ColumnDefn;
|
|
2704
2726
|
set defn(value: ColumnDefn | undefined);
|
|
2705
|
-
/** Cell values of this column by row number (index 0 unused). */
|
|
2727
|
+
/** Cell values of this column by row number (index 0 unused); empty cells are left out (lib/doc/column.js L179-187). */
|
|
2706
2728
|
get values(): CellValue[];
|
|
2707
2729
|
set values(values: CellValue[]);
|
|
2708
2730
|
eachCell(options: {
|
|
@@ -2808,6 +2830,11 @@ export declare class Worksheet {
|
|
|
2808
2830
|
_columns: Column[];
|
|
2809
2831
|
/** @internal */
|
|
2810
2832
|
_merges: MergeMap;
|
|
2833
|
+
/**
|
|
2834
|
+
* @internal Formulas of shared-formula masters by address, for the dependents of a worksheet
|
|
2835
|
+
* whose rows are not kept (stream.xlsx.WorkbookReader), so `cell.formula` can move them (K2).
|
|
2836
|
+
*/
|
|
2837
|
+
_sharedMasters: Map<string, string> | undefined;
|
|
2811
2838
|
/** The cells covered by `_merges` (row × 16 385 + column), valid while `_mergedVersion` equals `_merges.version`. */
|
|
2812
2839
|
private _mergedCells;
|
|
2813
2840
|
private _mergedVersion;
|
|
@@ -2902,8 +2929,9 @@ export declare class Worksheet {
|
|
|
2902
2929
|
}[], change: SpliceChange): void;
|
|
2903
2930
|
/**
|
|
2904
2931
|
* @internal Merges a range without the overlap check of `mergeCells`. Cells keep their own
|
|
2905
|
-
* style
|
|
2906
|
-
*
|
|
2932
|
+
* style object (the master's, when `mergeCells` shared it with them), except those for which
|
|
2933
|
+
* `takeMasterStyle` returns true (cells inserted inside the range), which get a copy of the
|
|
2934
|
+
* master's style.
|
|
2907
2935
|
*/
|
|
2908
2936
|
_mergeRange(range: {
|
|
2909
2937
|
top: number;
|