@xlsxflow/core 1.1.3 → 1.1.5
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/CHANGELOG.md +38 -0
- package/README.md +20 -10
- package/dist/index.cjs +1113 -743
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +30 -7
- package/dist/index.d.ts +30 -7
- package/dist/index.mjs +1113 -743
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -286,9 +286,11 @@ interface RowData {
|
|
|
286
286
|
styles?: (CellStyle | undefined)[];
|
|
287
287
|
richText?: (RichTextRun[] | undefined)[];
|
|
288
288
|
formatted?: (string | undefined)[];
|
|
289
|
+
errors?: (true | undefined)[];
|
|
289
290
|
}
|
|
290
291
|
interface WorksheetOptions {
|
|
291
292
|
formulas?: boolean;
|
|
293
|
+
errors?: boolean;
|
|
292
294
|
cellStyles?: (CellStyle | undefined)[];
|
|
293
295
|
numFmts?: (string | undefined)[];
|
|
294
296
|
richText?: ColorResolver;
|
|
@@ -365,6 +367,7 @@ interface WorkbookParts {
|
|
|
365
367
|
workbookPath: string;
|
|
366
368
|
workbookXml: string;
|
|
367
369
|
sheets: Map<string, string>;
|
|
370
|
+
chartsheets: Set<string>;
|
|
368
371
|
sharedStrings?: string;
|
|
369
372
|
styles?: string;
|
|
370
373
|
theme?: string;
|
|
@@ -392,12 +395,12 @@ type CellEdit = CellValue$1 | {
|
|
|
392
395
|
style?: CellStyle;
|
|
393
396
|
};
|
|
394
397
|
declare class SheetEditor {
|
|
395
|
-
private
|
|
398
|
+
private appends;
|
|
396
399
|
private cellEdits;
|
|
397
400
|
private additions;
|
|
398
401
|
private deletions;
|
|
399
402
|
private shiftOps;
|
|
400
|
-
appendSheet(sheetName: string, rows: Row[],
|
|
403
|
+
appendSheet(sheetName: string, rows: Row[], _options?: SheetOptions): this;
|
|
401
404
|
setCells(sheetName: string, cells: Record<string, CellEdit>): this;
|
|
402
405
|
addSheet(sheetName: string, rows: Row[]): this;
|
|
403
406
|
deleteSheet(sheetName: string): this;
|
|
@@ -410,7 +413,6 @@ declare class SheetEditor {
|
|
|
410
413
|
maxUncompressedBytes?: number;
|
|
411
414
|
}): ReadableStream<Uint8Array>;
|
|
412
415
|
private createEditTransform;
|
|
413
|
-
private createInjectTransform;
|
|
414
416
|
private readStreamToString;
|
|
415
417
|
}
|
|
416
418
|
|
|
@@ -421,6 +423,7 @@ interface ParseOptions {
|
|
|
421
423
|
styles?: boolean;
|
|
422
424
|
richText?: boolean;
|
|
423
425
|
formatted?: boolean;
|
|
426
|
+
errors?: boolean;
|
|
424
427
|
}
|
|
425
428
|
interface WorkbookInfo {
|
|
426
429
|
sheets: {
|
|
@@ -492,16 +495,31 @@ declare class StyleEngine {
|
|
|
492
495
|
}
|
|
493
496
|
|
|
494
497
|
type FormulaResult = number | string | boolean | null;
|
|
498
|
+
interface FormulaCell {
|
|
499
|
+
formula: string;
|
|
500
|
+
}
|
|
501
|
+
declare class FormulaError {
|
|
502
|
+
readonly code: string;
|
|
503
|
+
constructor(code: string);
|
|
504
|
+
}
|
|
505
|
+
type Value = number | string | boolean | null | FormulaError;
|
|
495
506
|
declare class FormulaEngine {
|
|
496
507
|
private cells;
|
|
508
|
+
private results;
|
|
509
|
+
private evaluating;
|
|
497
510
|
clear(): void;
|
|
498
|
-
loadData(data: (FormulaResult)[][], startRow?: number): void;
|
|
511
|
+
loadData(data: (FormulaResult | FormulaCell)[][], startRow?: number): void;
|
|
499
512
|
evaluate(formula: string): FormulaResult;
|
|
513
|
+
evaluateRaw(formula: string): Value;
|
|
514
|
+
cellValue(ref: string): Value;
|
|
515
|
+
private run;
|
|
516
|
+
private lookup;
|
|
500
517
|
private tokenize;
|
|
501
518
|
private parse;
|
|
519
|
+
private scalar;
|
|
502
520
|
private evaluateAst;
|
|
503
|
-
private
|
|
504
|
-
private
|
|
521
|
+
private binary;
|
|
522
|
+
private call;
|
|
505
523
|
private getRangeValues;
|
|
506
524
|
private parseRef;
|
|
507
525
|
private toRef;
|
|
@@ -527,6 +545,7 @@ interface ZipRecord {
|
|
|
527
545
|
declare class ZipRandomAccessParser {
|
|
528
546
|
private reader;
|
|
529
547
|
private records;
|
|
548
|
+
private lowerCase;
|
|
530
549
|
constructor(reader: RandomAccessReader);
|
|
531
550
|
parseCentralDirectory(): Promise<void>;
|
|
532
551
|
has(filename: string): boolean;
|
|
@@ -541,7 +560,7 @@ declare class ZipStreamWriter {
|
|
|
541
560
|
private cdEntries;
|
|
542
561
|
private offset;
|
|
543
562
|
private streamController;
|
|
544
|
-
private
|
|
563
|
+
private waiting;
|
|
545
564
|
private cancelled;
|
|
546
565
|
stream: ReadableStream<Uint8Array>;
|
|
547
566
|
private textEncoder;
|
|
@@ -552,6 +571,8 @@ declare class ZipStreamWriter {
|
|
|
552
571
|
error(err: unknown): void;
|
|
553
572
|
private localHeader;
|
|
554
573
|
private pushChunk;
|
|
574
|
+
private roomInQueue;
|
|
575
|
+
private wake;
|
|
555
576
|
}
|
|
556
577
|
|
|
557
578
|
interface CfbEntry {
|
|
@@ -597,6 +618,8 @@ declare class StylePatcher {
|
|
|
597
618
|
dateFormat(base: number, d: Date): number;
|
|
598
619
|
toXml(): string;
|
|
599
620
|
private existing;
|
|
621
|
+
private list;
|
|
622
|
+
private at;
|
|
600
623
|
private add;
|
|
601
624
|
private items;
|
|
602
625
|
private prefix;
|
package/dist/index.d.ts
CHANGED
|
@@ -286,9 +286,11 @@ interface RowData {
|
|
|
286
286
|
styles?: (CellStyle | undefined)[];
|
|
287
287
|
richText?: (RichTextRun[] | undefined)[];
|
|
288
288
|
formatted?: (string | undefined)[];
|
|
289
|
+
errors?: (true | undefined)[];
|
|
289
290
|
}
|
|
290
291
|
interface WorksheetOptions {
|
|
291
292
|
formulas?: boolean;
|
|
293
|
+
errors?: boolean;
|
|
292
294
|
cellStyles?: (CellStyle | undefined)[];
|
|
293
295
|
numFmts?: (string | undefined)[];
|
|
294
296
|
richText?: ColorResolver;
|
|
@@ -365,6 +367,7 @@ interface WorkbookParts {
|
|
|
365
367
|
workbookPath: string;
|
|
366
368
|
workbookXml: string;
|
|
367
369
|
sheets: Map<string, string>;
|
|
370
|
+
chartsheets: Set<string>;
|
|
368
371
|
sharedStrings?: string;
|
|
369
372
|
styles?: string;
|
|
370
373
|
theme?: string;
|
|
@@ -392,12 +395,12 @@ type CellEdit = CellValue$1 | {
|
|
|
392
395
|
style?: CellStyle;
|
|
393
396
|
};
|
|
394
397
|
declare class SheetEditor {
|
|
395
|
-
private
|
|
398
|
+
private appends;
|
|
396
399
|
private cellEdits;
|
|
397
400
|
private additions;
|
|
398
401
|
private deletions;
|
|
399
402
|
private shiftOps;
|
|
400
|
-
appendSheet(sheetName: string, rows: Row[],
|
|
403
|
+
appendSheet(sheetName: string, rows: Row[], _options?: SheetOptions): this;
|
|
401
404
|
setCells(sheetName: string, cells: Record<string, CellEdit>): this;
|
|
402
405
|
addSheet(sheetName: string, rows: Row[]): this;
|
|
403
406
|
deleteSheet(sheetName: string): this;
|
|
@@ -410,7 +413,6 @@ declare class SheetEditor {
|
|
|
410
413
|
maxUncompressedBytes?: number;
|
|
411
414
|
}): ReadableStream<Uint8Array>;
|
|
412
415
|
private createEditTransform;
|
|
413
|
-
private createInjectTransform;
|
|
414
416
|
private readStreamToString;
|
|
415
417
|
}
|
|
416
418
|
|
|
@@ -421,6 +423,7 @@ interface ParseOptions {
|
|
|
421
423
|
styles?: boolean;
|
|
422
424
|
richText?: boolean;
|
|
423
425
|
formatted?: boolean;
|
|
426
|
+
errors?: boolean;
|
|
424
427
|
}
|
|
425
428
|
interface WorkbookInfo {
|
|
426
429
|
sheets: {
|
|
@@ -492,16 +495,31 @@ declare class StyleEngine {
|
|
|
492
495
|
}
|
|
493
496
|
|
|
494
497
|
type FormulaResult = number | string | boolean | null;
|
|
498
|
+
interface FormulaCell {
|
|
499
|
+
formula: string;
|
|
500
|
+
}
|
|
501
|
+
declare class FormulaError {
|
|
502
|
+
readonly code: string;
|
|
503
|
+
constructor(code: string);
|
|
504
|
+
}
|
|
505
|
+
type Value = number | string | boolean | null | FormulaError;
|
|
495
506
|
declare class FormulaEngine {
|
|
496
507
|
private cells;
|
|
508
|
+
private results;
|
|
509
|
+
private evaluating;
|
|
497
510
|
clear(): void;
|
|
498
|
-
loadData(data: (FormulaResult)[][], startRow?: number): void;
|
|
511
|
+
loadData(data: (FormulaResult | FormulaCell)[][], startRow?: number): void;
|
|
499
512
|
evaluate(formula: string): FormulaResult;
|
|
513
|
+
evaluateRaw(formula: string): Value;
|
|
514
|
+
cellValue(ref: string): Value;
|
|
515
|
+
private run;
|
|
516
|
+
private lookup;
|
|
500
517
|
private tokenize;
|
|
501
518
|
private parse;
|
|
519
|
+
private scalar;
|
|
502
520
|
private evaluateAst;
|
|
503
|
-
private
|
|
504
|
-
private
|
|
521
|
+
private binary;
|
|
522
|
+
private call;
|
|
505
523
|
private getRangeValues;
|
|
506
524
|
private parseRef;
|
|
507
525
|
private toRef;
|
|
@@ -527,6 +545,7 @@ interface ZipRecord {
|
|
|
527
545
|
declare class ZipRandomAccessParser {
|
|
528
546
|
private reader;
|
|
529
547
|
private records;
|
|
548
|
+
private lowerCase;
|
|
530
549
|
constructor(reader: RandomAccessReader);
|
|
531
550
|
parseCentralDirectory(): Promise<void>;
|
|
532
551
|
has(filename: string): boolean;
|
|
@@ -541,7 +560,7 @@ declare class ZipStreamWriter {
|
|
|
541
560
|
private cdEntries;
|
|
542
561
|
private offset;
|
|
543
562
|
private streamController;
|
|
544
|
-
private
|
|
563
|
+
private waiting;
|
|
545
564
|
private cancelled;
|
|
546
565
|
stream: ReadableStream<Uint8Array>;
|
|
547
566
|
private textEncoder;
|
|
@@ -552,6 +571,8 @@ declare class ZipStreamWriter {
|
|
|
552
571
|
error(err: unknown): void;
|
|
553
572
|
private localHeader;
|
|
554
573
|
private pushChunk;
|
|
574
|
+
private roomInQueue;
|
|
575
|
+
private wake;
|
|
555
576
|
}
|
|
556
577
|
|
|
557
578
|
interface CfbEntry {
|
|
@@ -597,6 +618,8 @@ declare class StylePatcher {
|
|
|
597
618
|
dateFormat(base: number, d: Date): number;
|
|
598
619
|
toXml(): string;
|
|
599
620
|
private existing;
|
|
621
|
+
private list;
|
|
622
|
+
private at;
|
|
600
623
|
private add;
|
|
601
624
|
private items;
|
|
602
625
|
private prefix;
|