javascript-excel 2.0.0-alpha.2 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -21
- package/dist/address-DUn7-5OS.js +75 -0
- package/dist/address-DZBHchLv.cjs +122 -0
- package/dist/{auto-width-2oBzjeNG.d.cts → auto-width-DRHsPKNk.d.cts} +1 -1
- package/dist/cells-CPXU722t.cjs +33 -0
- package/dist/cells-CrMF8h_t.js +28 -0
- package/dist/colors-B8Nf_xTx.js +114 -0
- package/dist/colors-oBpjx97l.cjs +119 -0
- package/dist/csv.d.cts +4 -1
- package/dist/csv.d.ts +4 -1
- package/dist/dataset-KeMzHCGl.js +664 -0
- package/dist/dataset-UUZCzsi3.cjs +687 -0
- package/dist/dates-BXcSWf9_.js +64 -0
- package/dist/dates-CA1dCizp.cjs +75 -0
- package/dist/dom.cjs +5 -2
- package/dist/dom.d.cts +5 -2
- package/dist/dom.d.ts +4 -1
- package/dist/dom.js +4 -1
- package/dist/{numfmt-Dv6AjopS.cjs → dos-time-FZ7-1tot.cjs} +0 -199
- package/dist/{numfmt-BBgB7iQA.js → dos-time-dD0z1YWU.js} +2 -177
- package/dist/format.cjs +1264 -0
- package/dist/format.d.cts +59 -0
- package/dist/format.d.ts +59 -0
- package/dist/format.js +1262 -0
- package/dist/import.cjs +10 -0
- package/dist/import.d.cts +10 -0
- package/dist/import.d.ts +10 -0
- package/dist/import.js +1 -0
- package/dist/index.cjs +24 -607
- package/dist/index.d.cts +32 -6
- package/dist/index.d.ts +31 -5
- package/dist/index.js +10 -594
- package/dist/{warnings-C_12PT4t.d.cts → model-0JikLfuM.d.cts} +1 -41
- package/dist/{warnings-DXJKe1lx.d.ts → model-0JikLfuM.d.ts} +1 -41
- package/dist/numfmt-BmEbm78Y.cjs +125 -0
- package/dist/numfmt-DCDrX9P1.js +114 -0
- package/dist/pipeline-BAJtzBdW.js +1085 -0
- package/dist/pipeline-Bnf7EU3X.cjs +1132 -0
- package/dist/pipeline-CctEa86r.d.cts +186 -0
- package/dist/pipeline-I8SLmV9S.d.ts +186 -0
- package/dist/{read-Ym1voUct.cjs → read-CZEWV4rK.cjs} +181 -17
- package/dist/{read-DDN5ZsPe.js → read-LWti17lz.js} +169 -5
- package/dist/read.cjs +1 -1
- package/dist/read.d.cts +78 -4
- package/dist/read.d.ts +78 -4
- package/dist/read.js +1 -1
- package/dist/render.cjs +751 -0
- package/dist/render.d.cts +215 -0
- package/dist/render.d.ts +215 -0
- package/dist/render.js +732 -0
- package/dist/{sheet-names-uT2EH5Ui.js → sheet-names-7p-joVsG.js} +2 -101
- package/dist/{sheet-names-qpXsvMpM.cjs → sheet-names-B8U5RAW0.cjs} +14 -167
- package/dist/warnings-B1v58nCZ.d.cts +41 -0
- package/dist/warnings-B1v58nCZ.d.ts +41 -0
- package/dist/worker.cjs +10 -2
- package/dist/worker.d.cts +10 -4
- package/dist/worker.d.ts +10 -4
- package/dist/worker.js +10 -2
- package/dist/{write-CYpLGuzl.d.ts → write-DM6ieuQY.d.ts} +2 -1
- package/dist/{write-DubvcG-x.js → write-DjgWy1PK.js} +5 -2
- package/dist/{write-C5JgeIar.d.cts → write-DtjfdIFm.d.cts} +2 -1
- package/dist/{write-BOh9jfu1.cjs → write-f9kcYf5K.cjs} +31 -28
- package/package.json +32 -1
- package/dist/read-C6L7Nyy3.d.cts +0 -78
- package/dist/read-Ddkks7qC.d.ts +0 -78
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { r as BinaryInput, t as ExcelWarning } from "./warnings-B1v58nCZ.cjs";
|
|
2
|
+
import { ReadLimits, SheetInfo } from "./read.cjs";
|
|
3
|
+
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.cjs";
|
|
4
|
+
import { D as Sheet, s as CellInput } from "./model-0JikLfuM.cjs";
|
|
5
|
+
type NumberGroup = "," | "." | " " | "'" | "";
|
|
6
|
+
/**
|
|
7
|
+
* Parses `text` as a number written with `decimal` and `group` separators.
|
|
8
|
+
* Returns undefined for anything else (leading zeros, misplaced groups,
|
|
9
|
+
* percent or currency signs, integers beyond 2^53).
|
|
10
|
+
*/
|
|
11
|
+
declare function parseNumber(text: string, options?: {
|
|
12
|
+
decimal?: "." | ",";
|
|
13
|
+
group?: NumberGroup;
|
|
14
|
+
}): number | undefined;
|
|
15
|
+
type DateOrder = "YMD" | "DMY" | "MDY";
|
|
16
|
+
/** ISO 8601 always; numeric dates (d/m/yyyy, …) only with `order`. Two-digit years are not accepted. */
|
|
17
|
+
declare function parseDate(text: string, options?: {
|
|
18
|
+
order?: DateOrder;
|
|
19
|
+
zone?: "local" | "utc";
|
|
20
|
+
}): Date | undefined;
|
|
21
|
+
interface ImportLocale {
|
|
22
|
+
decimal?: "." | "," | undefined;
|
|
23
|
+
group?: NumberGroup | undefined;
|
|
24
|
+
dateOrder?: "auto" | "YMD" | "DMY" | "MDY" | undefined;
|
|
25
|
+
}
|
|
26
|
+
interface DetectHeaderOptions {
|
|
27
|
+
range?: string | undefined;
|
|
28
|
+
/** Rows scanned from the top of the range. Default 25 (a choice, not a measurement). */
|
|
29
|
+
maxScan?: number | undefined;
|
|
30
|
+
locale?: ImportLocale | undefined;
|
|
31
|
+
}
|
|
32
|
+
interface HeaderDetection {
|
|
33
|
+
/** Zero-based sheet rows of the header, top to bottom. */
|
|
34
|
+
rows: number[];
|
|
35
|
+
confidence: "high" | "low";
|
|
36
|
+
}
|
|
37
|
+
declare function detectHeader(sheet: Sheet<CellInput>, options?: DetectHeaderOptions): HeaderDetection;
|
|
38
|
+
type ColumnType = "string" | "number" | "boolean" | "date" | "datetime" | "mixed" | "empty";
|
|
39
|
+
interface DatasetLike {
|
|
40
|
+
columns: ReadonlyArray<{
|
|
41
|
+
key: string;
|
|
42
|
+
title: string;
|
|
43
|
+
letter?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
data: ReadonlyArray<Record<string, unknown>>;
|
|
46
|
+
/** Spreadsheet row of each data entry, for issues. Default: index + 2 (one header row). */
|
|
47
|
+
rowNumbers?: readonly number[] | undefined;
|
|
48
|
+
}
|
|
49
|
+
interface TypeOptions {
|
|
50
|
+
locale?: ImportLocale | undefined;
|
|
51
|
+
dateZone?: "local" | "utc" | undefined;
|
|
52
|
+
}
|
|
53
|
+
interface InferredColumn {
|
|
54
|
+
key: string;
|
|
55
|
+
type: ColumnType;
|
|
56
|
+
/** For date columns read from numeric text: the order the values are in. */
|
|
57
|
+
dateOrder?: DateOrder | undefined;
|
|
58
|
+
}
|
|
59
|
+
type ImportIssueCode = "TYPE" | "REQUIRED" | "MAPPING_MISSING" | "ERROR_CELL" | "EMPTY" | "DATE_ORDER_AMBIGUOUS";
|
|
60
|
+
interface ImportIssue {
|
|
61
|
+
/** Spreadsheet row (1-based); 0 for column- or file-level issues. */
|
|
62
|
+
row: number;
|
|
63
|
+
field?: string | undefined;
|
|
64
|
+
ref?: string | undefined;
|
|
65
|
+
code: ImportIssueCode;
|
|
66
|
+
message: string;
|
|
67
|
+
severity: "error" | "warning";
|
|
68
|
+
}
|
|
69
|
+
interface CoerceResult {
|
|
70
|
+
data: Array<Record<string, unknown>>;
|
|
71
|
+
issues: ImportIssue[];
|
|
72
|
+
}
|
|
73
|
+
declare function inferColumnTypes(dataset: DatasetLike, options?: TypeOptions): InferredColumn[];
|
|
74
|
+
declare function coerceColumns(dataset: DatasetLike, types: Record<string, ColumnType | InferredColumn>, options?: TypeOptions): CoerceResult;
|
|
75
|
+
interface FieldSpec {
|
|
76
|
+
/** Titles that match this field, besides the field name itself. */
|
|
77
|
+
aliases?: string[] | undefined;
|
|
78
|
+
required?: boolean | undefined;
|
|
79
|
+
/** Forces the column's type (a value that doesn't convert becomes null with a TYPE issue). */
|
|
80
|
+
type?: ColumnType | undefined;
|
|
81
|
+
}
|
|
82
|
+
interface ImportSchema {
|
|
83
|
+
fields: Record<string, FieldSpec>;
|
|
84
|
+
/** Columns no field takes: dropped (default) or kept under their own keys. */
|
|
85
|
+
unmapped?: "drop" | "keep" | undefined;
|
|
86
|
+
}
|
|
87
|
+
/** Field name -> column key, or null when the field has no column. */
|
|
88
|
+
type ColumnMapping = Record<string, string | null>;
|
|
89
|
+
interface MappingResult {
|
|
90
|
+
mapping: ColumnMapping;
|
|
91
|
+
/** Required fields without a column. */
|
|
92
|
+
missing: string[];
|
|
93
|
+
/** Column keys no field took. */
|
|
94
|
+
unmapped: string[];
|
|
95
|
+
}
|
|
96
|
+
interface ImportedColumn {
|
|
97
|
+
key: string;
|
|
98
|
+
title: string;
|
|
99
|
+
letter: string;
|
|
100
|
+
type: ColumnType;
|
|
101
|
+
field?: string | undefined;
|
|
102
|
+
}
|
|
103
|
+
interface MappedDataset {
|
|
104
|
+
columns: ImportedColumn[];
|
|
105
|
+
data: Array<Record<string, unknown>>;
|
|
106
|
+
rowNumbers: number[];
|
|
107
|
+
issues: ImportIssue[];
|
|
108
|
+
}
|
|
109
|
+
declare function mapColumns(columns: ReadonlyArray<{
|
|
110
|
+
key: string;
|
|
111
|
+
title: string;
|
|
112
|
+
}>, schema: ImportSchema, mapping?: ColumnMapping): MappingResult;
|
|
113
|
+
/** A dataset to map: like DatasetLike, and columns may carry their type. */
|
|
114
|
+
interface MappableDataset extends DatasetLike {
|
|
115
|
+
columns: ReadonlyArray<{
|
|
116
|
+
key: string;
|
|
117
|
+
title: string;
|
|
118
|
+
letter?: string | undefined;
|
|
119
|
+
type?: ColumnType | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
122
|
+
declare function applyMapping(dataset: MappableDataset, mapping: ColumnMapping, schema: ImportSchema): MappedDataset;
|
|
123
|
+
interface ImportProgress {
|
|
124
|
+
phase: "unzip" | "parse" | "dataset";
|
|
125
|
+
ratio: number;
|
|
126
|
+
}
|
|
127
|
+
interface ImportDatasetOptions {
|
|
128
|
+
format?: "auto" | "xlsx" | "csv" | undefined;
|
|
129
|
+
fileName?: string | undefined;
|
|
130
|
+
mimeType?: string | undefined;
|
|
131
|
+
sheet?: number | string | "first-visible" | undefined;
|
|
132
|
+
header?: "auto" | number | {
|
|
133
|
+
row?: number | undefined;
|
|
134
|
+
rows: number;
|
|
135
|
+
join?: string | undefined;
|
|
136
|
+
} | false | undefined;
|
|
137
|
+
range?: string | undefined;
|
|
138
|
+
types?: "infer" | "none" | Record<string, ColumnType> | undefined;
|
|
139
|
+
locale?: ImportLocale | undefined;
|
|
140
|
+
delimiter?: string | undefined;
|
|
141
|
+
encoding?: string | undefined;
|
|
142
|
+
skipTotals?: "auto" | boolean | undefined;
|
|
143
|
+
errorCells?: "null" | "keep" | undefined;
|
|
144
|
+
dates?: "date" | "serial" | undefined;
|
|
145
|
+
dateZone?: "local" | "utc" | undefined;
|
|
146
|
+
schema?: ImportSchema | undefined;
|
|
147
|
+
mapping?: ColumnMapping | undefined;
|
|
148
|
+
maxRows?: number | undefined;
|
|
149
|
+
preview?: number | undefined;
|
|
150
|
+
limits?: Partial<ReadLimits> | undefined;
|
|
151
|
+
signal?: AbortSignalLike | undefined;
|
|
152
|
+
onProgress?: ((p: ImportProgress) => void) | undefined;
|
|
153
|
+
onWarning?: ((w: ExcelWarning) => void) | undefined;
|
|
154
|
+
}
|
|
155
|
+
interface ImportMeta {
|
|
156
|
+
format: "xlsx" | "xlsm" | "xltx" | "xltm" | "csv";
|
|
157
|
+
fileName?: string | undefined;
|
|
158
|
+
sheet?: {
|
|
159
|
+
name: string;
|
|
160
|
+
index: number;
|
|
161
|
+
} | undefined;
|
|
162
|
+
sheets?: SheetInfo[] | undefined;
|
|
163
|
+
header: {
|
|
164
|
+
rows: number[];
|
|
165
|
+
detected: boolean;
|
|
166
|
+
confidence?: "high" | "low" | undefined;
|
|
167
|
+
};
|
|
168
|
+
range: string;
|
|
169
|
+
delimiter?: string | undefined;
|
|
170
|
+
encoding?: string | undefined;
|
|
171
|
+
bom?: boolean | undefined;
|
|
172
|
+
totalsRowSkipped: boolean;
|
|
173
|
+
truncated: boolean;
|
|
174
|
+
mapping?: ColumnMapping | undefined;
|
|
175
|
+
unmappedColumns?: string[] | undefined;
|
|
176
|
+
}
|
|
177
|
+
interface ImportDatasetResult {
|
|
178
|
+
columns: ImportedColumn[];
|
|
179
|
+
data: Array<Record<string, unknown>>;
|
|
180
|
+
rowNumbers: number[];
|
|
181
|
+
issues: ImportIssue[];
|
|
182
|
+
warnings: ExcelWarning[];
|
|
183
|
+
meta: ImportMeta;
|
|
184
|
+
}
|
|
185
|
+
declare function importDataset(input: string | BinaryInput, options?: ImportDatasetOptions): Promise<ImportDatasetResult>;
|
|
186
|
+
export { parseDate as A, inferColumnTypes as C, detectHeader as D, ImportLocale as E, DateOrder as O, coerceColumns as S, HeaderDetection as T, DatasetLike as _, importDataset as a, InferredColumn as b, ImportSchema as c, MappedDataset as d, MappingResult as f, ColumnType as g, CoerceResult as h, ImportProgress as i, parseNumber as j, NumberGroup as k, ImportedColumn as l, mapColumns as m, ImportDatasetResult as n, ColumnMapping as o, applyMapping as p, ImportMeta as r, FieldSpec as s, ImportDatasetOptions as t, MappableDataset as u, ImportIssue as v, DetectHeaderOptions as w, TypeOptions as x, ImportIssueCode as y };
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { r as BinaryInput, t as ExcelWarning } from "./warnings-B1v58nCZ.js";
|
|
2
|
+
import { ReadLimits, SheetInfo } from "./read.js";
|
|
3
|
+
import { t as AbortSignalLike } from "./signal-Dz0ZYe6d.js";
|
|
4
|
+
import { D as Sheet, s as CellInput } from "./model-0JikLfuM.js";
|
|
5
|
+
type NumberGroup = "," | "." | " " | "'" | "";
|
|
6
|
+
/**
|
|
7
|
+
* Parses `text` as a number written with `decimal` and `group` separators.
|
|
8
|
+
* Returns undefined for anything else (leading zeros, misplaced groups,
|
|
9
|
+
* percent or currency signs, integers beyond 2^53).
|
|
10
|
+
*/
|
|
11
|
+
declare function parseNumber(text: string, options?: {
|
|
12
|
+
decimal?: "." | ",";
|
|
13
|
+
group?: NumberGroup;
|
|
14
|
+
}): number | undefined;
|
|
15
|
+
type DateOrder = "YMD" | "DMY" | "MDY";
|
|
16
|
+
/** ISO 8601 always; numeric dates (d/m/yyyy, …) only with `order`. Two-digit years are not accepted. */
|
|
17
|
+
declare function parseDate(text: string, options?: {
|
|
18
|
+
order?: DateOrder;
|
|
19
|
+
zone?: "local" | "utc";
|
|
20
|
+
}): Date | undefined;
|
|
21
|
+
interface ImportLocale {
|
|
22
|
+
decimal?: "." | "," | undefined;
|
|
23
|
+
group?: NumberGroup | undefined;
|
|
24
|
+
dateOrder?: "auto" | "YMD" | "DMY" | "MDY" | undefined;
|
|
25
|
+
}
|
|
26
|
+
interface DetectHeaderOptions {
|
|
27
|
+
range?: string | undefined;
|
|
28
|
+
/** Rows scanned from the top of the range. Default 25 (a choice, not a measurement). */
|
|
29
|
+
maxScan?: number | undefined;
|
|
30
|
+
locale?: ImportLocale | undefined;
|
|
31
|
+
}
|
|
32
|
+
interface HeaderDetection {
|
|
33
|
+
/** Zero-based sheet rows of the header, top to bottom. */
|
|
34
|
+
rows: number[];
|
|
35
|
+
confidence: "high" | "low";
|
|
36
|
+
}
|
|
37
|
+
declare function detectHeader(sheet: Sheet<CellInput>, options?: DetectHeaderOptions): HeaderDetection;
|
|
38
|
+
type ColumnType = "string" | "number" | "boolean" | "date" | "datetime" | "mixed" | "empty";
|
|
39
|
+
interface DatasetLike {
|
|
40
|
+
columns: ReadonlyArray<{
|
|
41
|
+
key: string;
|
|
42
|
+
title: string;
|
|
43
|
+
letter?: string | undefined;
|
|
44
|
+
}>;
|
|
45
|
+
data: ReadonlyArray<Record<string, unknown>>;
|
|
46
|
+
/** Spreadsheet row of each data entry, for issues. Default: index + 2 (one header row). */
|
|
47
|
+
rowNumbers?: readonly number[] | undefined;
|
|
48
|
+
}
|
|
49
|
+
interface TypeOptions {
|
|
50
|
+
locale?: ImportLocale | undefined;
|
|
51
|
+
dateZone?: "local" | "utc" | undefined;
|
|
52
|
+
}
|
|
53
|
+
interface InferredColumn {
|
|
54
|
+
key: string;
|
|
55
|
+
type: ColumnType;
|
|
56
|
+
/** For date columns read from numeric text: the order the values are in. */
|
|
57
|
+
dateOrder?: DateOrder | undefined;
|
|
58
|
+
}
|
|
59
|
+
type ImportIssueCode = "TYPE" | "REQUIRED" | "MAPPING_MISSING" | "ERROR_CELL" | "EMPTY" | "DATE_ORDER_AMBIGUOUS";
|
|
60
|
+
interface ImportIssue {
|
|
61
|
+
/** Spreadsheet row (1-based); 0 for column- or file-level issues. */
|
|
62
|
+
row: number;
|
|
63
|
+
field?: string | undefined;
|
|
64
|
+
ref?: string | undefined;
|
|
65
|
+
code: ImportIssueCode;
|
|
66
|
+
message: string;
|
|
67
|
+
severity: "error" | "warning";
|
|
68
|
+
}
|
|
69
|
+
interface CoerceResult {
|
|
70
|
+
data: Array<Record<string, unknown>>;
|
|
71
|
+
issues: ImportIssue[];
|
|
72
|
+
}
|
|
73
|
+
declare function inferColumnTypes(dataset: DatasetLike, options?: TypeOptions): InferredColumn[];
|
|
74
|
+
declare function coerceColumns(dataset: DatasetLike, types: Record<string, ColumnType | InferredColumn>, options?: TypeOptions): CoerceResult;
|
|
75
|
+
interface FieldSpec {
|
|
76
|
+
/** Titles that match this field, besides the field name itself. */
|
|
77
|
+
aliases?: string[] | undefined;
|
|
78
|
+
required?: boolean | undefined;
|
|
79
|
+
/** Forces the column's type (a value that doesn't convert becomes null with a TYPE issue). */
|
|
80
|
+
type?: ColumnType | undefined;
|
|
81
|
+
}
|
|
82
|
+
interface ImportSchema {
|
|
83
|
+
fields: Record<string, FieldSpec>;
|
|
84
|
+
/** Columns no field takes: dropped (default) or kept under their own keys. */
|
|
85
|
+
unmapped?: "drop" | "keep" | undefined;
|
|
86
|
+
}
|
|
87
|
+
/** Field name -> column key, or null when the field has no column. */
|
|
88
|
+
type ColumnMapping = Record<string, string | null>;
|
|
89
|
+
interface MappingResult {
|
|
90
|
+
mapping: ColumnMapping;
|
|
91
|
+
/** Required fields without a column. */
|
|
92
|
+
missing: string[];
|
|
93
|
+
/** Column keys no field took. */
|
|
94
|
+
unmapped: string[];
|
|
95
|
+
}
|
|
96
|
+
interface ImportedColumn {
|
|
97
|
+
key: string;
|
|
98
|
+
title: string;
|
|
99
|
+
letter: string;
|
|
100
|
+
type: ColumnType;
|
|
101
|
+
field?: string | undefined;
|
|
102
|
+
}
|
|
103
|
+
interface MappedDataset {
|
|
104
|
+
columns: ImportedColumn[];
|
|
105
|
+
data: Array<Record<string, unknown>>;
|
|
106
|
+
rowNumbers: number[];
|
|
107
|
+
issues: ImportIssue[];
|
|
108
|
+
}
|
|
109
|
+
declare function mapColumns(columns: ReadonlyArray<{
|
|
110
|
+
key: string;
|
|
111
|
+
title: string;
|
|
112
|
+
}>, schema: ImportSchema, mapping?: ColumnMapping): MappingResult;
|
|
113
|
+
/** A dataset to map: like DatasetLike, and columns may carry their type. */
|
|
114
|
+
interface MappableDataset extends DatasetLike {
|
|
115
|
+
columns: ReadonlyArray<{
|
|
116
|
+
key: string;
|
|
117
|
+
title: string;
|
|
118
|
+
letter?: string | undefined;
|
|
119
|
+
type?: ColumnType | undefined;
|
|
120
|
+
}>;
|
|
121
|
+
}
|
|
122
|
+
declare function applyMapping(dataset: MappableDataset, mapping: ColumnMapping, schema: ImportSchema): MappedDataset;
|
|
123
|
+
interface ImportProgress {
|
|
124
|
+
phase: "unzip" | "parse" | "dataset";
|
|
125
|
+
ratio: number;
|
|
126
|
+
}
|
|
127
|
+
interface ImportDatasetOptions {
|
|
128
|
+
format?: "auto" | "xlsx" | "csv" | undefined;
|
|
129
|
+
fileName?: string | undefined;
|
|
130
|
+
mimeType?: string | undefined;
|
|
131
|
+
sheet?: number | string | "first-visible" | undefined;
|
|
132
|
+
header?: "auto" | number | {
|
|
133
|
+
row?: number | undefined;
|
|
134
|
+
rows: number;
|
|
135
|
+
join?: string | undefined;
|
|
136
|
+
} | false | undefined;
|
|
137
|
+
range?: string | undefined;
|
|
138
|
+
types?: "infer" | "none" | Record<string, ColumnType> | undefined;
|
|
139
|
+
locale?: ImportLocale | undefined;
|
|
140
|
+
delimiter?: string | undefined;
|
|
141
|
+
encoding?: string | undefined;
|
|
142
|
+
skipTotals?: "auto" | boolean | undefined;
|
|
143
|
+
errorCells?: "null" | "keep" | undefined;
|
|
144
|
+
dates?: "date" | "serial" | undefined;
|
|
145
|
+
dateZone?: "local" | "utc" | undefined;
|
|
146
|
+
schema?: ImportSchema | undefined;
|
|
147
|
+
mapping?: ColumnMapping | undefined;
|
|
148
|
+
maxRows?: number | undefined;
|
|
149
|
+
preview?: number | undefined;
|
|
150
|
+
limits?: Partial<ReadLimits> | undefined;
|
|
151
|
+
signal?: AbortSignalLike | undefined;
|
|
152
|
+
onProgress?: ((p: ImportProgress) => void) | undefined;
|
|
153
|
+
onWarning?: ((w: ExcelWarning) => void) | undefined;
|
|
154
|
+
}
|
|
155
|
+
interface ImportMeta {
|
|
156
|
+
format: "xlsx" | "xlsm" | "xltx" | "xltm" | "csv";
|
|
157
|
+
fileName?: string | undefined;
|
|
158
|
+
sheet?: {
|
|
159
|
+
name: string;
|
|
160
|
+
index: number;
|
|
161
|
+
} | undefined;
|
|
162
|
+
sheets?: SheetInfo[] | undefined;
|
|
163
|
+
header: {
|
|
164
|
+
rows: number[];
|
|
165
|
+
detected: boolean;
|
|
166
|
+
confidence?: "high" | "low" | undefined;
|
|
167
|
+
};
|
|
168
|
+
range: string;
|
|
169
|
+
delimiter?: string | undefined;
|
|
170
|
+
encoding?: string | undefined;
|
|
171
|
+
bom?: boolean | undefined;
|
|
172
|
+
totalsRowSkipped: boolean;
|
|
173
|
+
truncated: boolean;
|
|
174
|
+
mapping?: ColumnMapping | undefined;
|
|
175
|
+
unmappedColumns?: string[] | undefined;
|
|
176
|
+
}
|
|
177
|
+
interface ImportDatasetResult {
|
|
178
|
+
columns: ImportedColumn[];
|
|
179
|
+
data: Array<Record<string, unknown>>;
|
|
180
|
+
rowNumbers: number[];
|
|
181
|
+
issues: ImportIssue[];
|
|
182
|
+
warnings: ExcelWarning[];
|
|
183
|
+
meta: ImportMeta;
|
|
184
|
+
}
|
|
185
|
+
declare function importDataset(input: string | BinaryInput, options?: ImportDatasetOptions): Promise<ImportDatasetResult>;
|
|
186
|
+
export { parseDate as A, inferColumnTypes as C, detectHeader as D, ImportLocale as E, DateOrder as O, coerceColumns as S, HeaderDetection as T, DatasetLike as _, importDataset as a, InferredColumn as b, ImportSchema as c, MappedDataset as d, MappingResult as f, ColumnType as g, CoerceResult as h, ImportProgress as i, parseNumber as j, NumberGroup as k, ImportedColumn as l, mapColumns as m, ImportDatasetResult as n, ColumnMapping as o, applyMapping as p, ImportMeta as r, FieldSpec as s, ImportDatasetOptions as t, MappableDataset as u, ImportIssue as v, DetectHeaderOptions as w, TypeOptions as x, ImportIssueCode as y };
|