javascript-excel 2.0.0-alpha.1 → 2.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/dist/csv-DyVH9y7S.cjs +647 -0
- package/dist/csv-pXfaputs.js +618 -0
- package/dist/csv.cjs +6 -622
- package/dist/csv.js +1 -618
- package/dist/dom.cjs +3 -27
- package/dist/dom.js +3 -27
- package/dist/index.cjs +561 -1358
- package/dist/index.d.cts +119 -4
- package/dist/index.d.ts +119 -4
- package/dist/index.js +556 -1356
- package/dist/iso-date-3TY1OlGd.cjs +57 -0
- package/dist/iso-date-CXnn-9mT.js +46 -0
- package/dist/{numfmt-DEm0sYBJ.js → numfmt-BBgB7iQA.js} +39 -9
- package/dist/{numfmt-B-TlCgr7.cjs → numfmt-Dv6AjopS.cjs} +44 -8
- package/dist/read-C6L7Nyy3.d.cts +78 -0
- package/dist/read-DDN5ZsPe.js +2909 -0
- package/dist/read-Ddkks7qC.d.ts +78 -0
- package/dist/read-Ym1voUct.cjs +2932 -0
- package/dist/read.cjs +5 -2898
- package/dist/read.d.cts +2 -75
- package/dist/read.d.ts +2 -75
- package/dist/read.js +1 -2895
- package/dist/{sheet-names-Cm-IhbBk.cjs → sheet-names-qpXsvMpM.cjs} +3 -2
- package/dist/{sheet-names-CDsVK15c.js → sheet-names-uT2EH5Ui.js} +3 -2
- package/dist/worker.cjs +236 -7
- package/dist/worker.d.cts +62 -5
- package/dist/worker.d.ts +62 -5
- package/dist/worker.js +235 -7
- package/dist/write-BOh9jfu1.cjs +1487 -0
- package/dist/write-DubvcG-x.js +1470 -0
- package/package.json +46 -12
- package/dist/iso-date-B22IvwL1.js +0 -21
- package/dist/iso-date-BSUsPSWO.cjs +0 -26
package/dist/read.d.cts
CHANGED
|
@@ -11,78 +11,5 @@
|
|
|
11
11
|
import { A as RichTextRun, C as GradientFill, D as PatternType, E as PatternFill, F as Theme, I as Workbook, M as Sheet, N as SheetView, O as PrintSetup, P as Style, S as Font, T as NumFmt, _ as ColumnWidth, a as BlobType, b as ErrorCode, c as BorderSide, d as CellErrorValue, f as CellInput, g as ColumnProps, h as Color, i as BlobLike, j as RowProps, k as RichText, l as BorderStyle, m as CellValue, n as ExcelWarningCode, o as Alignment, p as CellType, r as BinaryInput, s as Border, t as ExcelWarning, u as Cell, v as DefinedName, w as Hyperlink, x as Fill, y as DocProperties } from "./warnings-C_12PT4t.cjs";
|
|
12
12
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
13
13
|
import { t as Progress } from "./write-C5JgeIar.cjs";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
* Detection is data: container signatures first, then, for OPC packages, the
|
|
18
|
-
* workbook part's content type. Supporting another format later (.xlsb, .xls)
|
|
19
|
-
* is one more row plus a decoder; the reader dispatches on `decoder`.
|
|
20
|
-
*/
|
|
21
|
-
/** Every format `detectFormat` can name. */
|
|
22
|
-
type FormatName = "xlsx" | "xlsm" | "xltx" | "xltm" | "xlsb" | "ods" | "cfb" | "zip" | "unknown";
|
|
23
|
-
/** Result of `read`. */
|
|
24
|
-
export interface ReadResult {
|
|
25
|
-
workbook: Workbook<Cell>;
|
|
26
|
-
warnings: ExcelWarning[];
|
|
27
|
-
}
|
|
28
|
-
/** Options for `read`. */
|
|
29
|
-
export interface ReadOptions {
|
|
30
|
-
/** Only parse these sheets (by name or index); the others are listed with empty rows. Default: all. */
|
|
31
|
-
sheets?: Array<string | number> | undefined;
|
|
32
|
-
/** Parse styles (default true). false is faster: no `cell.style`, but date detection still uses the number format. */
|
|
33
|
-
styles?: boolean | undefined;
|
|
34
|
-
/** Return formula text (default true). false: cached values only. */
|
|
35
|
-
formulas?: boolean | undefined;
|
|
36
|
-
/** `'date'` (default): date-formatted numbers become `Date`. `'serial'`: leave them as numbers. */
|
|
37
|
-
dates?: "date" | "serial" | undefined;
|
|
38
|
-
/** Default `'local'`. */
|
|
39
|
-
dateZone?: "local" | "utc" | undefined;
|
|
40
|
-
/** Rich text as runs (default) or flattened to a plain string. */
|
|
41
|
-
richText?: "runs" | "plain" | undefined;
|
|
42
|
-
limits?: Partial<ReadLimits> | undefined;
|
|
43
|
-
/** Rejects with `signal.reason` when aborted. */
|
|
44
|
-
signal?: AbortSignalLike | undefined;
|
|
45
|
-
onProgress?: ((p: Progress) => void) | undefined;
|
|
46
|
-
/** Called as warnings occur, in addition to `ReadResult.warnings`. */
|
|
47
|
-
onWarning?: ((w: ExcelWarning) => void) | undefined;
|
|
48
|
-
}
|
|
49
|
-
/** Limits for untrusted input. Exceeding one throws `LimitError` (`LIMIT_EXCEEDED`, `details.limit` names it). */
|
|
50
|
-
export interface ReadLimits {
|
|
51
|
-
maxInputBytes: number;
|
|
52
|
-
maxEntries: number;
|
|
53
|
-
/** Decompressed bytes of one part. */
|
|
54
|
-
maxEntryBytes: number;
|
|
55
|
-
/** Decompressed bytes of all parts read. */
|
|
56
|
-
maxTotalBytes: number;
|
|
57
|
-
/** Decompressed / compressed, per entry, checked once an entry has produced more than 1 MiB. */
|
|
58
|
-
maxRatio: number;
|
|
59
|
-
maxXmlDepth: number;
|
|
60
|
-
/** All sheets together. */
|
|
61
|
-
maxCells: number;
|
|
62
|
-
maxSharedStrings: number;
|
|
63
|
-
/** Then a single `WARNINGS_TRUNCATED`. */
|
|
64
|
-
maxWarnings: number;
|
|
65
|
-
}
|
|
66
|
-
/** Default limits (docs/api.md §5.2; the measurements behind each value are listed there). */
|
|
67
|
-
export declare const DEFAULT_READ_LIMITS: Readonly<ReadLimits>;
|
|
68
|
-
/** A sheet as listed by `readSheetNames`. */
|
|
69
|
-
export interface SheetInfo {
|
|
70
|
-
name: string;
|
|
71
|
-
index: number;
|
|
72
|
-
state: "visible" | "hidden" | "veryHidden";
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* What `detectFormat` recognises. `'cfb'` is a legacy `.xls` or an encrypted OOXML file.
|
|
76
|
-
* `read` reads xlsx, xlsm, xltx and xltm; the others are rejected with UNSUPPORTED_FORMAT.
|
|
77
|
-
*/
|
|
78
|
-
export type DetectedFormat = FormatName;
|
|
79
|
-
/** Detects the file format from the bytes. Never throws for unreadable input; returns `'unknown'` or `'zip'` instead. */
|
|
80
|
-
export declare function detectFormat(input: BinaryInput): Promise<DetectedFormat>;
|
|
81
|
-
/** Lists the worksheets (name, index, visibility) without parsing any sheet. */
|
|
82
|
-
export declare function readSheetNames(input: BinaryInput, options?: {
|
|
83
|
-
limits?: Partial<ReadLimits> | undefined;
|
|
84
|
-
signal?: AbortSignalLike | undefined;
|
|
85
|
-
}): Promise<SheetInfo[]>;
|
|
86
|
-
/** Reads an .xlsx, .xlsm, .xltx or .xltm file into the model. */
|
|
87
|
-
export declare function read(input: BinaryInput, options?: ReadOptions): Promise<ReadResult>;
|
|
88
|
-
export type { AbortSignalLike, Alignment, BinaryInput, BlobLike, BlobType, Border, BorderSide, BorderStyle, Cell, CellErrorValue, CellInput, CellType, CellValue, Color, ColumnProps, ColumnWidth, DefinedName, DocProperties, ErrorCode, ExcelWarning, ExcelWarningCode, Fill, Font, GradientFill, Hyperlink, NumFmt, PatternFill, PatternType, PrintSetup, Progress, RichText, RichTextRun, RowProps, Sheet, SheetView, Style, Theme, Workbook };
|
|
14
|
+
import { a as ReadResult, c as read, i as ReadOptions, l as readSheetNames, n as DetectedFormat, o as SheetInfo, r as ReadLimits, s as detectFormat, t as DEFAULT_READ_LIMITS } from "./read-C6L7Nyy3.cjs";
|
|
15
|
+
export { type AbortSignalLike, type Alignment, type BinaryInput, type BlobLike, type BlobType, type Border, type BorderSide, type BorderStyle, type Cell, type CellErrorValue, type CellInput, type CellType, type CellValue, type Color, type ColumnProps, type ColumnWidth, DEFAULT_READ_LIMITS, type DefinedName, DetectedFormat, type DocProperties, type ErrorCode, type ExcelWarning, type ExcelWarningCode, type Fill, type Font, type GradientFill, type Hyperlink, type NumFmt, type PatternFill, type PatternType, type PrintSetup, type Progress, ReadLimits, ReadOptions, ReadResult, type RichText, type RichTextRun, type RowProps, type Sheet, SheetInfo, type SheetView, type Style, type Theme, type Workbook, detectFormat, read, readSheetNames };
|
package/dist/read.d.ts
CHANGED
|
@@ -11,78 +11,5 @@
|
|
|
11
11
|
import { A as SheetView, C as PatternFill, D as RichTextRun, E as RichText, F as BlobLike, I as BlobType, M as Theme, N as Workbook, O as RowProps, P as BinaryInput, S as NumFmt, T as PrintSetup, _ as ErrorCode, a as BorderSide, b as GradientFill, c as CellErrorValue, d as CellValue, f as Color, g as DocProperties, h as DefinedName, i as Border, j as Style, k as Sheet, l as CellInput, m as ColumnWidth, n as ExcelWarningCode, o as BorderStyle, p as ColumnProps, r as Alignment, s as Cell, t as ExcelWarning, u as CellType, v as Fill, w as PatternType, x as Hyperlink, y as Font } from "./warnings-DXJKe1lx.js";
|
|
12
12
|
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
13
13
|
import { t as Progress } from "./write-CYpLGuzl.js";
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
*
|
|
17
|
-
* Detection is data: container signatures first, then, for OPC packages, the
|
|
18
|
-
* workbook part's content type. Supporting another format later (.xlsb, .xls)
|
|
19
|
-
* is one more row plus a decoder; the reader dispatches on `decoder`.
|
|
20
|
-
*/
|
|
21
|
-
/** Every format `detectFormat` can name. */
|
|
22
|
-
type FormatName = "xlsx" | "xlsm" | "xltx" | "xltm" | "xlsb" | "ods" | "cfb" | "zip" | "unknown";
|
|
23
|
-
/** Result of `read`. */
|
|
24
|
-
export interface ReadResult {
|
|
25
|
-
workbook: Workbook<Cell>;
|
|
26
|
-
warnings: ExcelWarning[];
|
|
27
|
-
}
|
|
28
|
-
/** Options for `read`. */
|
|
29
|
-
export interface ReadOptions {
|
|
30
|
-
/** Only parse these sheets (by name or index); the others are listed with empty rows. Default: all. */
|
|
31
|
-
sheets?: Array<string | number> | undefined;
|
|
32
|
-
/** Parse styles (default true). false is faster: no `cell.style`, but date detection still uses the number format. */
|
|
33
|
-
styles?: boolean | undefined;
|
|
34
|
-
/** Return formula text (default true). false: cached values only. */
|
|
35
|
-
formulas?: boolean | undefined;
|
|
36
|
-
/** `'date'` (default): date-formatted numbers become `Date`. `'serial'`: leave them as numbers. */
|
|
37
|
-
dates?: "date" | "serial" | undefined;
|
|
38
|
-
/** Default `'local'`. */
|
|
39
|
-
dateZone?: "local" | "utc" | undefined;
|
|
40
|
-
/** Rich text as runs (default) or flattened to a plain string. */
|
|
41
|
-
richText?: "runs" | "plain" | undefined;
|
|
42
|
-
limits?: Partial<ReadLimits> | undefined;
|
|
43
|
-
/** Rejects with `signal.reason` when aborted. */
|
|
44
|
-
signal?: AbortSignalLike | undefined;
|
|
45
|
-
onProgress?: ((p: Progress) => void) | undefined;
|
|
46
|
-
/** Called as warnings occur, in addition to `ReadResult.warnings`. */
|
|
47
|
-
onWarning?: ((w: ExcelWarning) => void) | undefined;
|
|
48
|
-
}
|
|
49
|
-
/** Limits for untrusted input. Exceeding one throws `LimitError` (`LIMIT_EXCEEDED`, `details.limit` names it). */
|
|
50
|
-
export interface ReadLimits {
|
|
51
|
-
maxInputBytes: number;
|
|
52
|
-
maxEntries: number;
|
|
53
|
-
/** Decompressed bytes of one part. */
|
|
54
|
-
maxEntryBytes: number;
|
|
55
|
-
/** Decompressed bytes of all parts read. */
|
|
56
|
-
maxTotalBytes: number;
|
|
57
|
-
/** Decompressed / compressed, per entry, checked once an entry has produced more than 1 MiB. */
|
|
58
|
-
maxRatio: number;
|
|
59
|
-
maxXmlDepth: number;
|
|
60
|
-
/** All sheets together. */
|
|
61
|
-
maxCells: number;
|
|
62
|
-
maxSharedStrings: number;
|
|
63
|
-
/** Then a single `WARNINGS_TRUNCATED`. */
|
|
64
|
-
maxWarnings: number;
|
|
65
|
-
}
|
|
66
|
-
/** Default limits (docs/api.md §5.2; the measurements behind each value are listed there). */
|
|
67
|
-
export declare const DEFAULT_READ_LIMITS: Readonly<ReadLimits>;
|
|
68
|
-
/** A sheet as listed by `readSheetNames`. */
|
|
69
|
-
export interface SheetInfo {
|
|
70
|
-
name: string;
|
|
71
|
-
index: number;
|
|
72
|
-
state: "visible" | "hidden" | "veryHidden";
|
|
73
|
-
}
|
|
74
|
-
/**
|
|
75
|
-
* What `detectFormat` recognises. `'cfb'` is a legacy `.xls` or an encrypted OOXML file.
|
|
76
|
-
* `read` reads xlsx, xlsm, xltx and xltm; the others are rejected with UNSUPPORTED_FORMAT.
|
|
77
|
-
*/
|
|
78
|
-
export type DetectedFormat = FormatName;
|
|
79
|
-
/** Detects the file format from the bytes. Never throws for unreadable input; returns `'unknown'` or `'zip'` instead. */
|
|
80
|
-
export declare function detectFormat(input: BinaryInput): Promise<DetectedFormat>;
|
|
81
|
-
/** Lists the worksheets (name, index, visibility) without parsing any sheet. */
|
|
82
|
-
export declare function readSheetNames(input: BinaryInput, options?: {
|
|
83
|
-
limits?: Partial<ReadLimits> | undefined;
|
|
84
|
-
signal?: AbortSignalLike | undefined;
|
|
85
|
-
}): Promise<SheetInfo[]>;
|
|
86
|
-
/** Reads an .xlsx, .xlsm, .xltx or .xltm file into the model. */
|
|
87
|
-
export declare function read(input: BinaryInput, options?: ReadOptions): Promise<ReadResult>;
|
|
88
|
-
export type { AbortSignalLike, Alignment, BinaryInput, BlobLike, BlobType, Border, BorderSide, BorderStyle, Cell, CellErrorValue, CellInput, CellType, CellValue, Color, ColumnProps, ColumnWidth, DefinedName, DocProperties, ErrorCode, ExcelWarning, ExcelWarningCode, Fill, Font, GradientFill, Hyperlink, NumFmt, PatternFill, PatternType, PrintSetup, Progress, RichText, RichTextRun, RowProps, Sheet, SheetView, Style, Theme, Workbook };
|
|
14
|
+
import { a as ReadResult, c as read, i as ReadOptions, l as readSheetNames, n as DetectedFormat, o as SheetInfo, r as ReadLimits, s as detectFormat, t as DEFAULT_READ_LIMITS } from "./read-Ddkks7qC.js";
|
|
15
|
+
export { type AbortSignalLike, type Alignment, type BinaryInput, type BlobLike, type BlobType, type Border, type BorderSide, type BorderStyle, type Cell, type CellErrorValue, type CellInput, type CellType, type CellValue, type Color, type ColumnProps, type ColumnWidth, DEFAULT_READ_LIMITS, type DefinedName, DetectedFormat, type DocProperties, type ErrorCode, type ExcelWarning, type ExcelWarningCode, type Fill, type Font, type GradientFill, type Hyperlink, type NumFmt, type PatternFill, type PatternType, type PrintSetup, type Progress, ReadLimits, ReadOptions, ReadResult, type RichText, type RichTextRun, type RowProps, type Sheet, SheetInfo, type SheetView, type Style, type Theme, type Workbook, detectFormat, read, readSheetNames };
|