@unicom-cloud/utils 0.1.27 → 0.1.28
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/case-name/index.js +1 -1
- package/caseName.js +1 -1
- package/class-name/index.js +1 -1
- package/className.js +1 -1
- package/clipboard-copy/index.js +1 -1
- package/clipboardCopy.js +1 -1
- package/constant/address.js +1 -1
- package/constant/chineseCharacters.js +1 -1
- package/constant/constellations.js +1 -1
- package/constant/domain.js +1 -1
- package/constant/emoji.js +1 -1
- package/constant/identity.js +1 -1
- package/constant/index.js +1 -1
- package/constant/keyboardCode.js +1 -1
- package/constant/licensePlate.js +1 -1
- package/constant/name.js +1 -1
- package/constant/platform.js +1 -1
- package/constant/protocol.js +1 -1
- package/constant/ui.js +1 -1
- package/constant.js +1 -1
- package/content-disposition/index.js +1 -1
- package/contentDisposition.js +1 -1
- package/cookie/index.js +1 -1
- package/cookie/src/index.js +1 -1
- package/cookie.js +1 -1
- package/date/convertTime.js +1 -1
- package/date/convertToDuration.js +1 -1
- package/date/index.js +1 -1
- package/date.js +1 -1
- package/decimal/decimal.js +1 -1
- package/decimal/index.js +1 -1
- package/decimal.js +1 -1
- package/dom-helpers/LICENSE +20 -0
- package/dom-helpers/activeElement.js +1 -1
- package/dom-helpers/addClass.js +1 -1
- package/dom-helpers/addEventListener.js +1 -1
- package/dom-helpers/animate.js +1 -1
- package/dom-helpers/animationFrame.js +1 -1
- package/dom-helpers/attribute.js +1 -1
- package/dom-helpers/camelize.js +1 -1
- package/dom-helpers/camelizeStyle.js +1 -1
- package/dom-helpers/canUseDOM.js +1 -1
- package/dom-helpers/childElements.js +1 -1
- package/dom-helpers/childNodes.js +1 -1
- package/dom-helpers/clear.js +1 -1
- package/dom-helpers/closest.js +1 -1
- package/dom-helpers/collectElements.js +1 -1
- package/dom-helpers/collectSiblings.js +1 -1
- package/dom-helpers/contains.js +1 -1
- package/dom-helpers/css.js +1 -1
- package/dom-helpers/filterEventHandler.js +1 -1
- package/dom-helpers/getComputedStyle.js +1 -1
- package/dom-helpers/getScrollAccessor.js +1 -1
- package/dom-helpers/hasClass.js +1 -1
- package/dom-helpers/height.js +1 -1
- package/dom-helpers/hyphenate.js +1 -1
- package/dom-helpers/hyphenateStyle.js +1 -1
- package/dom-helpers/index.js +1 -1
- package/dom-helpers/insertAfter.js +1 -1
- package/dom-helpers/isDocument.js +1 -1
- package/dom-helpers/isInput.js +1 -1
- package/dom-helpers/isTransform.js +1 -1
- package/dom-helpers/isVisible.js +1 -1
- package/dom-helpers/isWindow.js +1 -1
- package/dom-helpers/listen.js +1 -1
- package/dom-helpers/matches.js +1 -1
- package/dom-helpers/nextUntil.js +1 -1
- package/dom-helpers/offset.js +1 -1
- package/dom-helpers/offsetParent.js +1 -1
- package/dom-helpers/ownerDocument.js +1 -1
- package/dom-helpers/ownerWindow.js +1 -1
- package/dom-helpers/parents.js +1 -1
- package/dom-helpers/position.js +1 -1
- package/dom-helpers/prepend.js +1 -1
- package/dom-helpers/querySelectorAll.js +1 -1
- package/dom-helpers/reflow.js +1 -1
- package/dom-helpers/remove.js +1 -1
- package/dom-helpers/removeClass.js +1 -1
- package/dom-helpers/removeEventListener.js +1 -1
- package/dom-helpers/scrollLeft.js +1 -1
- package/dom-helpers/scrollParent.js +1 -1
- package/dom-helpers/scrollTo.js +1 -1
- package/dom-helpers/scrollTop.js +1 -1
- package/dom-helpers/scrollbarSize.js +1 -1
- package/dom-helpers/siblings.js +1 -1
- package/dom-helpers/text.js +1 -1
- package/dom-helpers/toggleClass.js +1 -1
- package/dom-helpers/transitionEnd.js +1 -1
- package/dom-helpers/triggerEvent.js +1 -1
- package/dom-helpers/types.js +1 -1
- package/dom-helpers/width.js +1 -1
- package/domHelpers.js +1 -1
- package/emitter/index.js +1 -1
- package/emitter/src/index.js +1 -1
- package/emitter.js +1 -1
- package/file/fileToURL.js +1 -1
- package/file/index.js +1 -1
- package/file/saveAs.js +1 -1
- package/file.js +1 -1
- package/filesize/LICENSE +26 -0
- package/idb/index.js +1 -1
- package/idb.js +1 -1
- package/index.js +1 -1
- package/invariant/index.js +1 -1
- package/invariant.js +1 -1
- package/is/index.js +1 -1
- package/is.js +1 -1
- package/js-cookie/index.js +1 -1
- package/js-cookie/src/api.js +1 -1
- package/js-cookie/src/assign.js +1 -1
- package/js-cookie/src/converter.js +1 -1
- package/jsCookie.js +1 -1
- package/lodash/LICENSE +47 -0
- package/lunar/LICENSE +20 -0
- package/lunar/index.js +1 -1
- package/lunar/lib/Holiday.js +1 -1
- package/lunar/lib/HolidayUtil.js +1 -1
- package/lunar/lib/I18n.js +1 -1
- package/lunar/lib/JieQi.js +1 -1
- package/lunar/lib/Lunar.js +1 -1
- package/lunar/lib/LunarMonth.js +1 -1
- package/lunar/lib/LunarTime.js +1 -1
- package/lunar/lib/LunarUtil.js +1 -1
- package/lunar/lib/LunarYear.js +1 -1
- package/lunar/lib/ShouXingUtil.js +1 -1
- package/lunar/lib/Solar.js +1 -1
- package/lunar/lib/SolarHalfYear.js +1 -1
- package/lunar/lib/SolarMonth.js +1 -1
- package/lunar/lib/SolarSeason.js +1 -1
- package/lunar/lib/SolarUtil.js +1 -1
- package/lunar/lib/SolarWeek.js +1 -1
- package/lunar/lib/SolarYear.js +1 -1
- package/lunar/lib/index.js +1 -1
- package/lunar.js +1 -1
- package/math/index.js +1 -1
- package/math.js +1 -1
- package/md5/index.js +1 -1
- package/md5.js +1 -1
- package/mock/MockWebSocket.js +1 -1
- package/mock/MockXMLHttpRequest.js +1 -1
- package/mock/index.js +1 -1
- package/mock.js +1 -1
- package/normalize-wheel/ExecutionEnvironment.js +1 -1
- package/normalize-wheel/UserAgent_DEPRECATED.js +1 -1
- package/normalize-wheel/index.js +1 -1
- package/normalize-wheel/isEventSupported.js +1 -1
- package/normalizeWheel.js +1 -1
- package/number-to-chinese/index.js +1 -1
- package/numberToChinese.js +1 -1
- package/nzh/cn.js +1 -1
- package/nzh/hk.js +1 -1
- package/nzh/index.js +1 -1
- package/nzh/nzh.js +1 -1
- package/nzh/src/autoGet.js +1 -1
- package/nzh/src/index.js +1 -1
- package/nzh/src/langs/cn_b.js +1 -1
- package/nzh/src/langs/cn_s.js +1 -1
- package/nzh/src/langs/hk_b.js +1 -1
- package/nzh/src/langs/hk_s.js +1 -1
- package/nzh/src/utils.js +1 -1
- package/nzh.js +1 -1
- package/object-keys-sort/index.js +1 -1
- package/object-prototype-to-string-call/index.js +1 -1
- package/objectKeysSort.js +1 -1
- package/objectPrototypeToStringCall.js +1 -1
- package/package.json +1 -1
- package/pinyin/LICENSE +20 -0
- package/pinyin/index.d.ts +6 -0
- package/pinyin/index.js +1 -1
- package/pinyin/simplified.js +1 -1
- package/pinyin/src/core.js +62 -62
- package/pinyin/src/simplified.js +1 -1
- package/pinyin/src/simplified_dict.js +2 -2
- package/pinyin/src/traditional.js +1 -1
- package/pinyin/src/traditional_dict.js +1 -1
- package/pinyin/traditional.js +1 -1
- package/pinyin.js +1 -1
- package/query-string/LICENSE +20 -0
- package/query-string/base.js +1 -1
- package/query-string/index.js +1 -1
- package/query-string/splitOnFirst.js +1 -1
- package/queryString.js +1 -1
- package/random/address.js +1 -1
- package/random/constellation.js +1 -1
- package/random/image.js +1 -1
- package/random/index.js +1 -1
- package/random/licensePlate.js +1 -1
- package/random/name.js +1 -1
- package/random/number.js +1 -1
- package/random/text.js +1 -1
- package/random/time.js +1 -1
- package/random/web.js +1 -1
- package/random.js +1 -1
- package/screenfull/index.js +1 -1
- package/screenfull.js +1 -1
- package/sleep/index.js +1 -1
- package/sleep.js +1 -1
- package/snapdom/LICENSE +20 -0
- package/snapdom/index.js +1 -1
- package/snapdom/src/api/preCache.js +1 -1
- package/snapdom/src/api/snapdom.js +1 -1
- package/snapdom/src/core/cache.js +1 -1
- package/snapdom/src/core/capture.js +1 -1
- package/snapdom/src/core/clone.js +1 -1
- package/snapdom/src/core/context.js +1 -1
- package/snapdom/src/core/plugins.js +1 -1
- package/snapdom/src/core/prepare.js +1 -1
- package/snapdom/src/exporters/download.js +1 -1
- package/snapdom/src/exporters/toBlob.js +1 -1
- package/snapdom/src/exporters/toCanvas.js +1 -1
- package/snapdom/src/exporters/toImg.js +1 -1
- package/snapdom/src/modules/CSSVar.js +1 -1
- package/snapdom/src/modules/background.js +1 -1
- package/snapdom/src/modules/changeCSS.js +1 -1
- package/snapdom/src/modules/counter.js +1 -1
- package/snapdom/src/modules/fonts.js +1 -1
- package/snapdom/src/modules/iconFonts.js +1 -1
- package/snapdom/src/modules/images.js +1 -1
- package/snapdom/src/modules/lineClamp.js +1 -1
- package/snapdom/src/modules/pseudo.js +1 -1
- package/snapdom/src/modules/rasterize.js +1 -1
- package/snapdom/src/modules/snapFetch.js +1 -1
- package/snapdom/src/modules/styles.js +1 -1
- package/snapdom/src/modules/svgDefs.js +1 -1
- package/snapdom/src/utils/browser.js +1 -1
- package/snapdom/src/utils/css.js +1 -1
- package/snapdom/src/utils/helpers.js +1 -1
- package/snapdom/src/utils/image.js +1 -1
- package/snapdom.js +1 -1
- package/string/index.js +7 -0
- package/string.js +5 -0
- package/tinycolor/index.js +1 -1
- package/tinycolor/src/conversion.js +1 -1
- package/tinycolor/src/css-color-names.js +1 -1
- package/tinycolor/src/format-input.js +1 -1
- package/tinycolor/src/from-ratio.js +1 -1
- package/tinycolor/src/index.js +1 -1
- package/tinycolor/src/random.js +1 -1
- package/tinycolor/src/readability.js +1 -1
- package/tinycolor/src/to-ms-filter.js +1 -1
- package/tinycolor/src/utils.js +1 -1
- package/tinycolor.js +1 -1
- package/tree/index.js +1 -1
- package/tree/search/index.js +1 -1
- package/tree.js +1 -1
- package/tween/index.js +1 -1
- package/tween/src/easing.js +1 -1
- package/tween/src/tween.js +1 -1
- package/tween.js +1 -1
- package/types/string/index.d.ts +8 -0
- package/types/xlsx/index.d.ts +2 -0
- package/types/xlsx/xlsx.d.ts +224 -0
- package/ui-color/compareColorByRange.js +1 -1
- package/ui-color/index.js +1 -1
- package/uiColor.js +1 -1
- package/url-toolkit/index.js +1 -1
- package/url-toolkit/src/url-toolkit.js +1 -1
- package/urlToolkit.js +1 -1
- package/validate/index.js +1 -1
- package/validate/src/index.js +1 -1
- package/validate/src/locale/en-US.js +1 -1
- package/validate/src/locale/zh-CN.js +1 -1
- package/validate/src/message.js +1 -1
- package/validate/src/rules/array.js +1 -1
- package/validate/src/rules/base.js +1 -1
- package/validate/src/rules/boolean.js +1 -1
- package/validate/src/rules/custom.js +1 -1
- package/validate/src/rules/number.js +1 -1
- package/validate/src/rules/object.js +1 -1
- package/validate/src/rules/string.js +1 -1
- package/validate/src/rules/type.js +1 -1
- package/validate/src/utils.js +1 -1
- package/validate.js +1 -1
- package/version/index.js +1 -1
- package/version.js +1 -1
- package/xlsx/LICENSE +189 -0
- package/xlsx/index.d.ts +1139 -0
- package/xlsx/index.js +23 -0
- package/xlsx/xlsx.js +28329 -0
- package/xlsx.js +23 -0
- package/axios/chunk/BJvTEV6n.js +0 -253
- package/axios/chunk/CB3wlosT.js +0 -64
- package/axios/index.d.ts +0 -796
- package/axios/index.js +0 -43
- package/axios/lib/axios.js +0 -1635
- package/axios/lib/utils.js +0 -5
- package/axios/mock-adapter/index.d.ts +0 -59
- package/axios/mock-adapter/index.js +0 -205
- package/axios/mock-adapter/request.js +0 -50
- package/axios/mock-adapter/utils.js +0 -130
package/xlsx/index.d.ts
ADDED
|
@@ -0,0 +1,1139 @@
|
|
|
1
|
+
/* index.d.ts (C) 2015-present SheetJS and contributors */
|
|
2
|
+
// TypeScript Version: 2.2
|
|
3
|
+
// import * as CFB from "cfb";
|
|
4
|
+
// import * as SSF from "ssf";
|
|
5
|
+
|
|
6
|
+
/** Version string */
|
|
7
|
+
export const version: string;
|
|
8
|
+
|
|
9
|
+
/** SSF Formatter Library */
|
|
10
|
+
// export { SSF };
|
|
11
|
+
export const SSF: any;
|
|
12
|
+
|
|
13
|
+
/** CFB Library */
|
|
14
|
+
// export { CFB };
|
|
15
|
+
export const CFB: any;
|
|
16
|
+
|
|
17
|
+
/** Set internal `fs` instance */
|
|
18
|
+
export function set_fs(fs: any): void;
|
|
19
|
+
/** Set internal codepage tables */
|
|
20
|
+
export function set_cptable(cptable: any): void;
|
|
21
|
+
|
|
22
|
+
/** NODE ONLY! Attempts to read filename and parse */
|
|
23
|
+
export function readFile(filename: string, opts?: ParsingOptions): WorkBook;
|
|
24
|
+
/** Attempts to parse data */
|
|
25
|
+
export function read(data: any, opts?: ParsingOptions): WorkBook;
|
|
26
|
+
/** Attempts to write or download workbook data to file */
|
|
27
|
+
export function writeFile(
|
|
28
|
+
data: WorkBook,
|
|
29
|
+
filename: string,
|
|
30
|
+
opts?: WritingOptions,
|
|
31
|
+
): void;
|
|
32
|
+
/** Attempts to write or download workbook data to XLSX file */
|
|
33
|
+
export function writeFileXLSX(
|
|
34
|
+
data: WorkBook,
|
|
35
|
+
filename: string,
|
|
36
|
+
opts?: WritingOptions,
|
|
37
|
+
): void;
|
|
38
|
+
/** Attempts to write or download workbook data to file asynchronously */
|
|
39
|
+
type CBFunc = () => void;
|
|
40
|
+
export function writeFileAsync(
|
|
41
|
+
filename: string,
|
|
42
|
+
data: WorkBook,
|
|
43
|
+
opts: WritingOptions | CBFunc,
|
|
44
|
+
cb?: CBFunc,
|
|
45
|
+
): void;
|
|
46
|
+
/** Attempts to write the workbook data */
|
|
47
|
+
export function write(data: WorkBook, opts: WritingOptions): any;
|
|
48
|
+
/** Attempts to write the workbook data as XLSX */
|
|
49
|
+
export function writeXLSX(data: WorkBook, opts: WritingOptions): any;
|
|
50
|
+
|
|
51
|
+
/** Utility Functions */
|
|
52
|
+
export const utils: XLSX$Utils;
|
|
53
|
+
/** Stream Utility Functions */
|
|
54
|
+
export const stream: StreamUtils;
|
|
55
|
+
|
|
56
|
+
/** Number Format (either a string or an index to the format table) */
|
|
57
|
+
export type NumberFormat = string | number;
|
|
58
|
+
|
|
59
|
+
/** Worksheet specifier (string, number, worksheet) */
|
|
60
|
+
export type WSSpec = string | number | WorkSheet;
|
|
61
|
+
|
|
62
|
+
/** Range specifier (string or range or cell), single-cell lifted to range */
|
|
63
|
+
export type RangeSpec = string | Range | CellAddress;
|
|
64
|
+
|
|
65
|
+
/** Basic File Properties */
|
|
66
|
+
export interface Properties {
|
|
67
|
+
/** Summary tab "Title" */
|
|
68
|
+
Title?: string;
|
|
69
|
+
/** Summary tab "Subject" */
|
|
70
|
+
Subject?: string;
|
|
71
|
+
/** Summary tab "Author" */
|
|
72
|
+
Author?: string;
|
|
73
|
+
/** Summary tab "Manager" */
|
|
74
|
+
Manager?: string;
|
|
75
|
+
/** Summary tab "Company" */
|
|
76
|
+
Company?: string;
|
|
77
|
+
/** Summary tab "Category" */
|
|
78
|
+
Category?: string;
|
|
79
|
+
/** Summary tab "Keywords" */
|
|
80
|
+
Keywords?: string;
|
|
81
|
+
/** Summary tab "Comments" */
|
|
82
|
+
Comments?: string;
|
|
83
|
+
/** Statistics tab "Last saved by" */
|
|
84
|
+
LastAuthor?: string;
|
|
85
|
+
/** Statistics tab "Created" */
|
|
86
|
+
CreatedDate?: Date;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Other supported properties */
|
|
90
|
+
export interface FullProperties extends Properties {
|
|
91
|
+
ModifiedDate?: Date;
|
|
92
|
+
Application?: string;
|
|
93
|
+
AppVersion?: string;
|
|
94
|
+
DocSecurity?: string;
|
|
95
|
+
HyperlinksChanged?: boolean;
|
|
96
|
+
SharedDoc?: boolean;
|
|
97
|
+
LinksUpToDate?: boolean;
|
|
98
|
+
ScaleCrop?: boolean;
|
|
99
|
+
Worksheets?: number;
|
|
100
|
+
SheetNames?: string[];
|
|
101
|
+
ContentStatus?: string;
|
|
102
|
+
LastPrinted?: string;
|
|
103
|
+
Revision?: string | number;
|
|
104
|
+
Version?: string;
|
|
105
|
+
Identifier?: string;
|
|
106
|
+
Language?: string;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export interface CommonOptions {
|
|
110
|
+
/**
|
|
111
|
+
* If true, throw errors when features are not understood
|
|
112
|
+
* @default false
|
|
113
|
+
*/
|
|
114
|
+
WTF?: boolean;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* When reading a file with VBA macros, expose CFB blob to `vbaraw` field
|
|
118
|
+
* When writing BIFF8/XLSB/XLSM, reseat `vbaraw` and export to file
|
|
119
|
+
* @default false
|
|
120
|
+
*/
|
|
121
|
+
bookVBA?: boolean;
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* When reading a file, store dates as type d (default is n)
|
|
125
|
+
* When writing XLSX/XLSM file, use native date (default uses date codes)
|
|
126
|
+
* @default false
|
|
127
|
+
*/
|
|
128
|
+
cellDates?: boolean;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Create cell objects for stub cells
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
sheetStubs?: boolean;
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* When reading a file, save style/theme info to the .s field
|
|
138
|
+
* When writing a file, export style/theme info
|
|
139
|
+
* @default false
|
|
140
|
+
*/
|
|
141
|
+
cellStyles?: boolean;
|
|
142
|
+
|
|
143
|
+
/**
|
|
144
|
+
* If defined and file is encrypted, use password
|
|
145
|
+
* @default ''
|
|
146
|
+
*/
|
|
147
|
+
password?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
export interface DateNFOption {
|
|
151
|
+
/** Use specified date format */
|
|
152
|
+
dateNF?: NumberFormat;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
export interface UTCOption {
|
|
156
|
+
/**
|
|
157
|
+
* For plaintext formats, interpret ambiguous datetimes in UTC
|
|
158
|
+
* If explicitly set to `false`, dates will be parsed in local time.
|
|
159
|
+
*
|
|
160
|
+
* The `true` option is consistent with spreadsheet application export.
|
|
161
|
+
*
|
|
162
|
+
* @default true
|
|
163
|
+
*/
|
|
164
|
+
UTC?: boolean;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
export interface DenseOption {
|
|
168
|
+
/** If true, generate dense-mode worksheets */
|
|
169
|
+
dense?: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/** Options for read and readFile */
|
|
173
|
+
export interface ParsingOptions extends UTCOption, CommonOptions, DenseOption {
|
|
174
|
+
/** Input data encoding */
|
|
175
|
+
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Default codepage for legacy files
|
|
179
|
+
*
|
|
180
|
+
* This requires encoding support to be loaded. It is automatically loaded
|
|
181
|
+
* in `xlsx.full.min.js` and in CommonJS / Extendscript, but an extra step
|
|
182
|
+
* is required in React / Angular / Webpack ESM deployments.
|
|
183
|
+
*
|
|
184
|
+
* Check the relevant guide https://docs.sheetjs.com/docs/getting-started/
|
|
185
|
+
*/
|
|
186
|
+
codepage?: number;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Save formulae to the .f field
|
|
190
|
+
* @default true
|
|
191
|
+
*/
|
|
192
|
+
cellFormula?: boolean;
|
|
193
|
+
|
|
194
|
+
/**
|
|
195
|
+
* Parse rich text and save HTML to the .h field
|
|
196
|
+
* @default true
|
|
197
|
+
*/
|
|
198
|
+
cellHTML?: boolean;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Save number format string to the .z field
|
|
202
|
+
* @default false
|
|
203
|
+
*/
|
|
204
|
+
cellNF?: boolean;
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Generate formatted text to the .w field
|
|
208
|
+
* @default true
|
|
209
|
+
*/
|
|
210
|
+
cellText?: boolean;
|
|
211
|
+
|
|
212
|
+
/** Override default date format (code 14) */
|
|
213
|
+
dateNF?: string;
|
|
214
|
+
|
|
215
|
+
/** Field Separator ("Delimiter" override) */
|
|
216
|
+
FS?: string;
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* If >0, read the first sheetRows rows
|
|
220
|
+
* @default 0
|
|
221
|
+
*/
|
|
222
|
+
sheetRows?: number;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* If true, parse calculation chains
|
|
226
|
+
* @default false
|
|
227
|
+
*/
|
|
228
|
+
bookDeps?: boolean;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* If true, add raw files to book object
|
|
232
|
+
* @default false
|
|
233
|
+
*/
|
|
234
|
+
bookFiles?: boolean;
|
|
235
|
+
|
|
236
|
+
/**
|
|
237
|
+
* If true, only parse enough to get book metadata
|
|
238
|
+
* @default false
|
|
239
|
+
*/
|
|
240
|
+
bookProps?: boolean;
|
|
241
|
+
|
|
242
|
+
/**
|
|
243
|
+
* If true, only parse enough to get the sheet names
|
|
244
|
+
* @default false
|
|
245
|
+
*/
|
|
246
|
+
bookSheets?: boolean;
|
|
247
|
+
|
|
248
|
+
/** If specified, only parse the specified sheets or sheet names */
|
|
249
|
+
sheets?: number | string | Array<number | string>;
|
|
250
|
+
|
|
251
|
+
/** If true, plaintext parsing will not parse values */
|
|
252
|
+
raw?: boolean;
|
|
253
|
+
|
|
254
|
+
/** If true, ignore "dimensions" records and guess range using every cell */
|
|
255
|
+
nodim?: boolean;
|
|
256
|
+
|
|
257
|
+
/** If true, preserve _xlfn. prefixes in formula function names */
|
|
258
|
+
xlfn?: boolean;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* For single-sheet formats (including CSV), override the worksheet name
|
|
262
|
+
* @default "Sheet1"
|
|
263
|
+
*/
|
|
264
|
+
sheet?: string;
|
|
265
|
+
|
|
266
|
+
PRN?: boolean;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** Options for write and writeFile */
|
|
270
|
+
export interface WritingOptions extends CommonOptions {
|
|
271
|
+
/** Output data encoding */
|
|
272
|
+
type?: 'base64' | 'binary' | 'buffer' | 'file' | 'array' | 'string';
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Generate Shared String Table
|
|
276
|
+
* @default false
|
|
277
|
+
*/
|
|
278
|
+
bookSST?: boolean;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* File format of generated workbook
|
|
282
|
+
* @default 'xlsx'
|
|
283
|
+
*/
|
|
284
|
+
bookType?: BookType;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Use ZIP compression for ZIP-based formats
|
|
288
|
+
* @default false
|
|
289
|
+
*/
|
|
290
|
+
compression?: boolean;
|
|
291
|
+
|
|
292
|
+
/** Override theme XML when exporting to XLSX/XLSM/XLSB */
|
|
293
|
+
themeXLSX?: string;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Suppress "number stored as text" errors in generated files
|
|
297
|
+
* @default true
|
|
298
|
+
*/
|
|
299
|
+
ignoreEC?: boolean;
|
|
300
|
+
|
|
301
|
+
/** Override workbook properties on save */
|
|
302
|
+
Props?: Properties;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Desired codepage for legacy file formats
|
|
306
|
+
*
|
|
307
|
+
* This requires encoding support to be loaded. It is automatically loaded
|
|
308
|
+
* in `xlsx.full.min.js` and in CommonJS / Extendscript, but an extra step
|
|
309
|
+
* is required in React / Angular / Webpack / ESM deployments.
|
|
310
|
+
*
|
|
311
|
+
* Check the relevant guide https://docs.sheetjs.com/docs/getting-started/
|
|
312
|
+
*/
|
|
313
|
+
codepage?: number;
|
|
314
|
+
|
|
315
|
+
/** Base64 encoding of NUMBERS base for exports */
|
|
316
|
+
numbers?: string;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* For single-sheet formats, export the specified worksheet.
|
|
320
|
+
*
|
|
321
|
+
* The property must be a string (sheet name) or number (`SheetNames` index).
|
|
322
|
+
*
|
|
323
|
+
* If this option is omitted, the first worksheet will be exported.
|
|
324
|
+
*/
|
|
325
|
+
sheet?: string | number;
|
|
326
|
+
|
|
327
|
+
/** Field Separator ("delimiter") for CSV / Text output */
|
|
328
|
+
FS?: string;
|
|
329
|
+
|
|
330
|
+
/** Record Separator ("row separator") for CSV / Text output */
|
|
331
|
+
RS?: string;
|
|
332
|
+
|
|
333
|
+
/** Skip certain validity checks (NOTE: generated files may not open in Excel) */
|
|
334
|
+
unsafe?: boolean;
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
/** Workbook Object */
|
|
338
|
+
export interface WorkBook {
|
|
339
|
+
/**
|
|
340
|
+
* A dictionary of the worksheets in the workbook.
|
|
341
|
+
* Use SheetNames to reference these.
|
|
342
|
+
*/
|
|
343
|
+
Sheets: { [sheet: string]: WorkSheet };
|
|
344
|
+
|
|
345
|
+
/** Ordered list of the sheet names in the workbook */
|
|
346
|
+
SheetNames: string[];
|
|
347
|
+
|
|
348
|
+
/** Standard workbook Properties */
|
|
349
|
+
Props?: FullProperties;
|
|
350
|
+
|
|
351
|
+
/** Custom workbook Properties */
|
|
352
|
+
Custprops?: object;
|
|
353
|
+
|
|
354
|
+
Workbook?: WBProps;
|
|
355
|
+
|
|
356
|
+
vbaraw?: any;
|
|
357
|
+
|
|
358
|
+
/** Original file type (when parsed with `read` or `readFile`) */
|
|
359
|
+
bookType?: BookType;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
export interface SheetProps {
|
|
363
|
+
/** Name of Sheet */
|
|
364
|
+
name?: string;
|
|
365
|
+
|
|
366
|
+
/** Sheet Visibility (0=Visible 1=Hidden 2=VeryHidden) */
|
|
367
|
+
Hidden?: 0 | 1 | 2;
|
|
368
|
+
|
|
369
|
+
/** Name of Document Module in associated VBA Project */
|
|
370
|
+
CodeName?: string;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** Defined Name Object */
|
|
374
|
+
export interface DefinedName {
|
|
375
|
+
/** Name */
|
|
376
|
+
Name: string;
|
|
377
|
+
|
|
378
|
+
/** Reference */
|
|
379
|
+
Ref: string;
|
|
380
|
+
|
|
381
|
+
/** Scope (undefined for workbook scope) */
|
|
382
|
+
Sheet?: number;
|
|
383
|
+
|
|
384
|
+
/** Name comment */
|
|
385
|
+
Comment?: string;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
/** Workbook-Level Attributes */
|
|
389
|
+
export interface WBProps {
|
|
390
|
+
/** Sheet Properties */
|
|
391
|
+
Sheets?: SheetProps[];
|
|
392
|
+
|
|
393
|
+
/** Defined Names */
|
|
394
|
+
Names?: DefinedName[];
|
|
395
|
+
|
|
396
|
+
/** Workbook Views */
|
|
397
|
+
Views?: WBView[];
|
|
398
|
+
|
|
399
|
+
/** Other Workbook Properties */
|
|
400
|
+
WBProps?: WorkbookProperties;
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/** Workbook View */
|
|
404
|
+
export interface WBView {
|
|
405
|
+
/** Right-to-left mode */
|
|
406
|
+
RTL?: boolean;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Other Workbook Properties */
|
|
410
|
+
export interface WorkbookProperties {
|
|
411
|
+
/** Worksheet Epoch (1904 if true, 1900 if false) */
|
|
412
|
+
date1904?: boolean;
|
|
413
|
+
|
|
414
|
+
/** Warn or strip personally identifying info on save */
|
|
415
|
+
filterPrivacy?: boolean;
|
|
416
|
+
|
|
417
|
+
/** Name of Document Module in associated VBA Project */
|
|
418
|
+
CodeName?: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
/** DBF Field Header */
|
|
422
|
+
export interface DBFField {
|
|
423
|
+
/** Original Field Name */
|
|
424
|
+
name?: string;
|
|
425
|
+
|
|
426
|
+
/** Field Type */
|
|
427
|
+
type?: string;
|
|
428
|
+
|
|
429
|
+
/** Field Length */
|
|
430
|
+
len?: number;
|
|
431
|
+
|
|
432
|
+
/** Field Decimal Count */
|
|
433
|
+
dec?: number;
|
|
434
|
+
}
|
|
435
|
+
|
|
436
|
+
/** Column Properties Object */
|
|
437
|
+
export interface ColInfo {
|
|
438
|
+
/* --- visibility --- */
|
|
439
|
+
|
|
440
|
+
/** if true, the column is hidden */
|
|
441
|
+
hidden?: boolean;
|
|
442
|
+
|
|
443
|
+
/* --- column width --- */
|
|
444
|
+
|
|
445
|
+
/** width in Excel's "Max Digit Width", width*256 is integral */
|
|
446
|
+
width?: number;
|
|
447
|
+
|
|
448
|
+
/** width in screen pixels */
|
|
449
|
+
wpx?: number;
|
|
450
|
+
|
|
451
|
+
/** width in "characters" */
|
|
452
|
+
wch?: number;
|
|
453
|
+
|
|
454
|
+
/** outline / group level */
|
|
455
|
+
level?: number;
|
|
456
|
+
|
|
457
|
+
/** Excel's "Max Digit Width" unit, always integral */
|
|
458
|
+
MDW?: number;
|
|
459
|
+
|
|
460
|
+
/** DBF Field Header */
|
|
461
|
+
DBF?: DBFField;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/** Row Properties Object */
|
|
465
|
+
export interface RowInfo {
|
|
466
|
+
/* --- visibility --- */
|
|
467
|
+
|
|
468
|
+
/** if true, the column is hidden */
|
|
469
|
+
hidden?: boolean;
|
|
470
|
+
|
|
471
|
+
/* --- row height --- */
|
|
472
|
+
|
|
473
|
+
/** height in screen pixels */
|
|
474
|
+
hpx?: number;
|
|
475
|
+
|
|
476
|
+
/** height in points */
|
|
477
|
+
hpt?: number;
|
|
478
|
+
|
|
479
|
+
/** outline / group level */
|
|
480
|
+
level?: number;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
/**
|
|
484
|
+
* Write sheet protection properties.
|
|
485
|
+
*/
|
|
486
|
+
export interface ProtectInfo {
|
|
487
|
+
/**
|
|
488
|
+
* The password for formats that support password-protected sheets
|
|
489
|
+
* (XLSX/XLSB/XLS). The writer uses the XOR obfuscation method.
|
|
490
|
+
*/
|
|
491
|
+
password?: string;
|
|
492
|
+
/**
|
|
493
|
+
* Select locked cells
|
|
494
|
+
* @default: true
|
|
495
|
+
*/
|
|
496
|
+
selectLockedCells?: boolean;
|
|
497
|
+
/**
|
|
498
|
+
* Select unlocked cells
|
|
499
|
+
* @default: true
|
|
500
|
+
*/
|
|
501
|
+
selectUnlockedCells?: boolean;
|
|
502
|
+
/**
|
|
503
|
+
* Format cells
|
|
504
|
+
* @default: false
|
|
505
|
+
*/
|
|
506
|
+
formatCells?: boolean;
|
|
507
|
+
/**
|
|
508
|
+
* Format columns
|
|
509
|
+
* @default: false
|
|
510
|
+
*/
|
|
511
|
+
formatColumns?: boolean;
|
|
512
|
+
/**
|
|
513
|
+
* Format rows
|
|
514
|
+
* @default: false
|
|
515
|
+
*/
|
|
516
|
+
formatRows?: boolean;
|
|
517
|
+
/**
|
|
518
|
+
* Insert columns
|
|
519
|
+
* @default: false
|
|
520
|
+
*/
|
|
521
|
+
insertColumns?: boolean;
|
|
522
|
+
/**
|
|
523
|
+
* Insert rows
|
|
524
|
+
* @default: false
|
|
525
|
+
*/
|
|
526
|
+
insertRows?: boolean;
|
|
527
|
+
/**
|
|
528
|
+
* Insert hyperlinks
|
|
529
|
+
* @default: false
|
|
530
|
+
*/
|
|
531
|
+
insertHyperlinks?: boolean;
|
|
532
|
+
/**
|
|
533
|
+
* Delete columns
|
|
534
|
+
* @default: false
|
|
535
|
+
*/
|
|
536
|
+
deleteColumns?: boolean;
|
|
537
|
+
/**
|
|
538
|
+
* Delete rows
|
|
539
|
+
* @default: false
|
|
540
|
+
*/
|
|
541
|
+
deleteRows?: boolean;
|
|
542
|
+
/**
|
|
543
|
+
* Sort
|
|
544
|
+
* @default: false
|
|
545
|
+
*/
|
|
546
|
+
sort?: boolean;
|
|
547
|
+
/**
|
|
548
|
+
* Filter
|
|
549
|
+
* @default: false
|
|
550
|
+
*/
|
|
551
|
+
autoFilter?: boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Use PivotTable reports
|
|
554
|
+
* @default: false
|
|
555
|
+
*/
|
|
556
|
+
pivotTables?: boolean;
|
|
557
|
+
/**
|
|
558
|
+
* Edit objects
|
|
559
|
+
* @default: true
|
|
560
|
+
*/
|
|
561
|
+
objects?: boolean;
|
|
562
|
+
/**
|
|
563
|
+
* Edit scenarios
|
|
564
|
+
* @default: true
|
|
565
|
+
*/
|
|
566
|
+
scenarios?: boolean;
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
/** Page Margins -- see Excel Page Setup .. Margins diagram for explanation */
|
|
570
|
+
export interface MarginInfo {
|
|
571
|
+
/** Left side margin (inches) */
|
|
572
|
+
left?: number;
|
|
573
|
+
/** Right side margin (inches) */
|
|
574
|
+
right?: number;
|
|
575
|
+
/** Top side margin (inches) */
|
|
576
|
+
top?: number;
|
|
577
|
+
/** Bottom side margin (inches) */
|
|
578
|
+
bottom?: number;
|
|
579
|
+
/** Header top margin (inches) */
|
|
580
|
+
header?: number;
|
|
581
|
+
/** Footer bottom height (inches) */
|
|
582
|
+
footer?: number;
|
|
583
|
+
}
|
|
584
|
+
export type SheetType = 'sheet' | 'chart';
|
|
585
|
+
export type SheetKeys = string | MarginInfo | SheetType;
|
|
586
|
+
/** General object representing a Sheet (worksheet or chartsheet) */
|
|
587
|
+
export interface Sheet {
|
|
588
|
+
/**
|
|
589
|
+
* Sparse-mode store cells with keys corresponding to A1-style address
|
|
590
|
+
* Dense-mode store cells in the '!data' key
|
|
591
|
+
* Special keys start with '!'
|
|
592
|
+
*/
|
|
593
|
+
[cell: string]: CellObject | DenseSheetData | SheetKeys | any;
|
|
594
|
+
|
|
595
|
+
/**
|
|
596
|
+
* Dense-mode worksheets store data in an array of arrays
|
|
597
|
+
*
|
|
598
|
+
* Cells are accessed with sheet['!data'][R][C] (where R and C are 0-indexed)
|
|
599
|
+
*/
|
|
600
|
+
'!data'?: DenseSheetData;
|
|
601
|
+
|
|
602
|
+
/** Sheet type */
|
|
603
|
+
'!type'?: SheetType;
|
|
604
|
+
|
|
605
|
+
/** Sheet Range (A1-style) */
|
|
606
|
+
'!ref'?: string;
|
|
607
|
+
|
|
608
|
+
/** Page Margins */
|
|
609
|
+
'!margins'?: MarginInfo;
|
|
610
|
+
}
|
|
611
|
+
/** General object representing a dense Sheet (worksheet or chartsheet) */
|
|
612
|
+
export interface DenseSheet extends Sheet {
|
|
613
|
+
/**
|
|
614
|
+
* Special keys start with '!'
|
|
615
|
+
* Dense-mode worksheets store data in the '!data' key
|
|
616
|
+
*/
|
|
617
|
+
[cell: string]: DenseSheetData | SheetKeys | any;
|
|
618
|
+
|
|
619
|
+
/**
|
|
620
|
+
* Dense-mode worksheets store data in an array of arrays
|
|
621
|
+
*
|
|
622
|
+
* Cells are accessed with sheet['!data'][R][C] (where R and C are 0-indexed)
|
|
623
|
+
*/
|
|
624
|
+
'!data': DenseSheetData;
|
|
625
|
+
}
|
|
626
|
+
export type DenseSheetData = ((CellObject | undefined)[] | undefined)[];
|
|
627
|
+
/** General object representing a sparse Sheet (worksheet or chartsheet) */
|
|
628
|
+
export interface SparseSheet extends Sheet {
|
|
629
|
+
/**
|
|
630
|
+
* Sparse-mode store cells with keys corresponding to A1-style address
|
|
631
|
+
* Cells are accessed with sheet[addr]
|
|
632
|
+
*/
|
|
633
|
+
'!data': never;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
/** AutoFilter properties */
|
|
637
|
+
export interface AutoFilterInfo {
|
|
638
|
+
/** Range of the AutoFilter table */
|
|
639
|
+
ref: string;
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
export type WSKeys =
|
|
643
|
+
| SheetKeys
|
|
644
|
+
| ColInfo[]
|
|
645
|
+
| RowInfo[]
|
|
646
|
+
| Range[]
|
|
647
|
+
| ProtectInfo
|
|
648
|
+
| AutoFilterInfo;
|
|
649
|
+
|
|
650
|
+
/** Worksheet Object */
|
|
651
|
+
export interface WorkSheet extends Sheet {
|
|
652
|
+
/**
|
|
653
|
+
* Indexing with a cell address string maps to a cell object
|
|
654
|
+
* Special keys start with '!'
|
|
655
|
+
*/
|
|
656
|
+
[cell: string]: CellObject | WSKeys | any;
|
|
657
|
+
|
|
658
|
+
/** Column Info */
|
|
659
|
+
'!cols'?: ColInfo[];
|
|
660
|
+
|
|
661
|
+
/** Row Info */
|
|
662
|
+
'!rows'?: RowInfo[];
|
|
663
|
+
|
|
664
|
+
/** Merge Ranges */
|
|
665
|
+
'!merges'?: Range[];
|
|
666
|
+
|
|
667
|
+
/** Worksheet Protection info */
|
|
668
|
+
'!protect'?: ProtectInfo;
|
|
669
|
+
|
|
670
|
+
/** AutoFilter info */
|
|
671
|
+
'!autofilter'?: AutoFilterInfo;
|
|
672
|
+
}
|
|
673
|
+
/** Dense Worksheet Object */
|
|
674
|
+
export interface DenseWorkSheet extends DenseSheet {}
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Worksheet Object with CellObject type
|
|
678
|
+
*
|
|
679
|
+
* The normal Worksheet type uses indexer of type `any` -- this enforces CellObject
|
|
680
|
+
*/
|
|
681
|
+
export interface StrictWS {
|
|
682
|
+
[addr: string]: CellObject;
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* The Excel data type for a cell.
|
|
687
|
+
* b Boolean, n Number, e error, s String, d Date, z Stub
|
|
688
|
+
*/
|
|
689
|
+
export type ExcelDataType = 'b' | 'n' | 'e' | 's' | 'd' | 'z';
|
|
690
|
+
|
|
691
|
+
/**
|
|
692
|
+
* Type of generated workbook
|
|
693
|
+
* @default 'xlsx'
|
|
694
|
+
*/
|
|
695
|
+
export type BookType =
|
|
696
|
+
| 'xlsx'
|
|
697
|
+
| 'xlsm'
|
|
698
|
+
| 'xlsb'
|
|
699
|
+
| 'xls'
|
|
700
|
+
| 'xla'
|
|
701
|
+
| 'biff8'
|
|
702
|
+
| 'biff5'
|
|
703
|
+
| 'biff2'
|
|
704
|
+
| 'xlml'
|
|
705
|
+
| 'ods'
|
|
706
|
+
| 'fods'
|
|
707
|
+
| 'csv'
|
|
708
|
+
| 'txt'
|
|
709
|
+
| 'sylk'
|
|
710
|
+
| 'slk'
|
|
711
|
+
| 'html'
|
|
712
|
+
| 'dif'
|
|
713
|
+
| 'rtf'
|
|
714
|
+
| 'prn'
|
|
715
|
+
| 'eth'
|
|
716
|
+
| 'dbf'
|
|
717
|
+
| 'numbers';
|
|
718
|
+
|
|
719
|
+
/** Comment element */
|
|
720
|
+
export interface Comment {
|
|
721
|
+
/** Author of the comment block */
|
|
722
|
+
a?: string;
|
|
723
|
+
|
|
724
|
+
/** Plaintext of the comment */
|
|
725
|
+
t: string;
|
|
726
|
+
|
|
727
|
+
/** If true, mark the comment as a part of a thread */
|
|
728
|
+
T?: boolean;
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/** Cell comments */
|
|
732
|
+
export interface Comments extends Array<Comment> {
|
|
733
|
+
/** Hide comment by default */
|
|
734
|
+
hidden?: boolean;
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
/** Link object */
|
|
738
|
+
export interface Hyperlink {
|
|
739
|
+
/** Target of the link (HREF) */
|
|
740
|
+
Target: string;
|
|
741
|
+
|
|
742
|
+
/** Plaintext tooltip to display when mouse is over cell */
|
|
743
|
+
Tooltip?: string;
|
|
744
|
+
}
|
|
745
|
+
|
|
746
|
+
/** Worksheet Cell Object */
|
|
747
|
+
export interface CellObject {
|
|
748
|
+
/** The raw value of the cell. Can be omitted if a formula is specified */
|
|
749
|
+
v?: string | number | boolean | Date;
|
|
750
|
+
|
|
751
|
+
/** Formatted text (if applicable) */
|
|
752
|
+
w?: string;
|
|
753
|
+
|
|
754
|
+
/**
|
|
755
|
+
* The Excel Data Type of the cell.
|
|
756
|
+
* b Boolean, n Number, e Error, s String, d Date, z Empty
|
|
757
|
+
*/
|
|
758
|
+
t: ExcelDataType;
|
|
759
|
+
|
|
760
|
+
/** Cell formula (if applicable) */
|
|
761
|
+
f?: string;
|
|
762
|
+
|
|
763
|
+
/** Range of enclosing array if formula is array formula (if applicable) */
|
|
764
|
+
F?: string;
|
|
765
|
+
|
|
766
|
+
/** If true, cell is a dynamic array formula (for supported file formats) */
|
|
767
|
+
D?: boolean;
|
|
768
|
+
|
|
769
|
+
/** Rich text encoding (if applicable) */
|
|
770
|
+
r?: any;
|
|
771
|
+
|
|
772
|
+
/** HTML rendering of the rich text (if applicable) */
|
|
773
|
+
h?: string;
|
|
774
|
+
|
|
775
|
+
/** Comments associated with the cell */
|
|
776
|
+
c?: Comments;
|
|
777
|
+
|
|
778
|
+
/** Number format string associated with the cell (if requested) */
|
|
779
|
+
z?: NumberFormat;
|
|
780
|
+
|
|
781
|
+
/** Cell hyperlink object (.Target holds link, .tooltip is tooltip) */
|
|
782
|
+
l?: Hyperlink;
|
|
783
|
+
|
|
784
|
+
/** The style/theme of the cell (if applicable) */
|
|
785
|
+
s?: any;
|
|
786
|
+
}
|
|
787
|
+
|
|
788
|
+
/** Simple Cell Address */
|
|
789
|
+
export interface CellAddress {
|
|
790
|
+
/** Column number */
|
|
791
|
+
c: number;
|
|
792
|
+
/** Row number */
|
|
793
|
+
r: number;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
/** Range object (representing ranges like "A1:B2") */
|
|
797
|
+
export interface Range {
|
|
798
|
+
/** Starting cell */
|
|
799
|
+
s: CellAddress;
|
|
800
|
+
/** Ending cell */
|
|
801
|
+
e: CellAddress;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
export interface Sheet2CSVOpts extends DateNFOption {
|
|
805
|
+
/** Field Separator ("delimiter") */
|
|
806
|
+
FS?: string;
|
|
807
|
+
|
|
808
|
+
/** Record Separator ("row separator") */
|
|
809
|
+
RS?: string;
|
|
810
|
+
|
|
811
|
+
/** Remove trailing field separators in each record */
|
|
812
|
+
strip?: boolean;
|
|
813
|
+
|
|
814
|
+
/** Include blank lines in the CSV output */
|
|
815
|
+
blankrows?: boolean;
|
|
816
|
+
|
|
817
|
+
/** Skip hidden rows and columns in the CSV output */
|
|
818
|
+
skipHidden?: boolean;
|
|
819
|
+
|
|
820
|
+
/** Force quotes around fields */
|
|
821
|
+
forceQuotes?: boolean;
|
|
822
|
+
|
|
823
|
+
/** if true, return raw numbers; if false, return formatted numbers */
|
|
824
|
+
rawNumbers?: boolean;
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
export interface OriginOption {
|
|
828
|
+
/** Top-Left cell for operation (CellAddress or A1 string or row) */
|
|
829
|
+
origin?: number | string | CellAddress;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
export interface Sheet2HTMLOpts {
|
|
833
|
+
/** TABLE element id attribute */
|
|
834
|
+
id?: string;
|
|
835
|
+
|
|
836
|
+
/** Add contenteditable to every cell */
|
|
837
|
+
editable?: boolean;
|
|
838
|
+
|
|
839
|
+
/** Header HTML */
|
|
840
|
+
header?: string;
|
|
841
|
+
|
|
842
|
+
/** Footer HTML */
|
|
843
|
+
footer?: string;
|
|
844
|
+
}
|
|
845
|
+
|
|
846
|
+
export interface Sheet2JSONOpts extends DateNFOption {
|
|
847
|
+
/** Output format */
|
|
848
|
+
header?: 'A' | number | string[];
|
|
849
|
+
|
|
850
|
+
/** Override worksheet range */
|
|
851
|
+
range?: any;
|
|
852
|
+
|
|
853
|
+
/** Include or omit blank lines in the output */
|
|
854
|
+
blankrows?: boolean;
|
|
855
|
+
|
|
856
|
+
/** Default value for null/undefined values */
|
|
857
|
+
defval?: any;
|
|
858
|
+
|
|
859
|
+
/** if true, return raw data; if false, return formatted text */
|
|
860
|
+
raw?: boolean;
|
|
861
|
+
|
|
862
|
+
/** if true, skip hidden rows and columns */
|
|
863
|
+
skipHidden?: boolean;
|
|
864
|
+
|
|
865
|
+
/** if true, return raw numbers; if false, return formatted numbers */
|
|
866
|
+
rawNumbers?: boolean;
|
|
867
|
+
|
|
868
|
+
/**
|
|
869
|
+
* If true, return dates whose UTC interpretation is correct
|
|
870
|
+
* By default, return dates whose local interpretation is correct
|
|
871
|
+
*
|
|
872
|
+
* @default false
|
|
873
|
+
*/
|
|
874
|
+
UTC?: boolean;
|
|
875
|
+
}
|
|
876
|
+
|
|
877
|
+
export interface Sheet2FormulaOpts {
|
|
878
|
+
/**
|
|
879
|
+
* If false, only export cells with formulae.
|
|
880
|
+
* By default, synthetic formulae are generated for each cell.
|
|
881
|
+
*/
|
|
882
|
+
values?: boolean;
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
export interface UTCDateOption {
|
|
886
|
+
/**
|
|
887
|
+
* If true, dates are interpreted using the UTC methods
|
|
888
|
+
* By default, dates are interpreted in the local timezone
|
|
889
|
+
*
|
|
890
|
+
* @default false
|
|
891
|
+
*/
|
|
892
|
+
UTC?: boolean;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
export interface AOA2SheetOpts
|
|
896
|
+
extends CommonOptions,
|
|
897
|
+
UTCDateOption,
|
|
898
|
+
DateNFOption,
|
|
899
|
+
DenseOption {
|
|
900
|
+
/**
|
|
901
|
+
* Create cell objects for stub cells
|
|
902
|
+
* @default false
|
|
903
|
+
*/
|
|
904
|
+
sheetStubs?: boolean;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
export interface SheetAOAOpts extends AOA2SheetOpts, OriginOption {}
|
|
908
|
+
|
|
909
|
+
export interface JSON2SheetOpts
|
|
910
|
+
extends CommonOptions,
|
|
911
|
+
UTCDateOption,
|
|
912
|
+
DateNFOption,
|
|
913
|
+
OriginOption,
|
|
914
|
+
DenseOption {
|
|
915
|
+
/** Use specified column order */
|
|
916
|
+
header?: string[];
|
|
917
|
+
|
|
918
|
+
/** Skip header row in generated sheet */
|
|
919
|
+
skipHeader?: boolean;
|
|
920
|
+
}
|
|
921
|
+
|
|
922
|
+
export interface Table2SheetOpts
|
|
923
|
+
extends CommonOptions,
|
|
924
|
+
DateNFOption,
|
|
925
|
+
OriginOption {
|
|
926
|
+
/** If true, plaintext parsing will not parse values */
|
|
927
|
+
raw?: boolean;
|
|
928
|
+
|
|
929
|
+
/**
|
|
930
|
+
* If >0, read the first sheetRows rows
|
|
931
|
+
* @default 0
|
|
932
|
+
*/
|
|
933
|
+
sheetRows?: number;
|
|
934
|
+
|
|
935
|
+
/** If true, hidden rows and cells will not be parsed */
|
|
936
|
+
display?: boolean;
|
|
937
|
+
|
|
938
|
+
/**
|
|
939
|
+
* Override the worksheet name
|
|
940
|
+
* @default "Sheet1"
|
|
941
|
+
*/
|
|
942
|
+
sheet?: string;
|
|
943
|
+
|
|
944
|
+
/**
|
|
945
|
+
* If true, interpret date strings as if they are UTC.
|
|
946
|
+
* By default, date strings are interpreted in the local timezone.
|
|
947
|
+
*
|
|
948
|
+
* @default false
|
|
949
|
+
*/
|
|
950
|
+
UTC?: boolean;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
export interface Table2BookOpts extends Table2SheetOpts {
|
|
954
|
+
/**
|
|
955
|
+
* Override the worksheet name
|
|
956
|
+
* @default "Sheet1"
|
|
957
|
+
*/
|
|
958
|
+
sheet?: string;
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
/** General utilities */
|
|
962
|
+
export interface XLSX$Utils {
|
|
963
|
+
/* --- Import Functions --- */
|
|
964
|
+
|
|
965
|
+
/** Converts an array of arrays of JS data to a worksheet. */
|
|
966
|
+
aoa_to_sheet<T>(data: T[][], opts?: AOA2SheetOpts): WorkSheet;
|
|
967
|
+
aoa_to_sheet(data: any[][], opts?: AOA2SheetOpts): WorkSheet;
|
|
968
|
+
|
|
969
|
+
/** Converts an array of JS objects to a worksheet. */
|
|
970
|
+
json_to_sheet<T>(data: T[], opts?: JSON2SheetOpts): WorkSheet;
|
|
971
|
+
json_to_sheet(data: any[], opts?: JSON2SheetOpts): WorkSheet;
|
|
972
|
+
|
|
973
|
+
/** BROWSER ONLY! Converts a TABLE DOM element to a worksheet. */
|
|
974
|
+
table_to_sheet(data: any, opts?: Table2SheetOpts): WorkSheet;
|
|
975
|
+
table_to_book(data: any, opts?: Table2BookOpts): WorkBook;
|
|
976
|
+
sheet_add_dom(ws: WorkSheet, data: any, opts?: Table2SheetOpts): WorkSheet;
|
|
977
|
+
|
|
978
|
+
/* --- Export Functions --- */
|
|
979
|
+
|
|
980
|
+
/** Converts a worksheet object to an array of JSON objects */
|
|
981
|
+
sheet_to_json<T>(worksheet: WorkSheet, opts?: Sheet2JSONOpts): T[];
|
|
982
|
+
sheet_to_json(worksheet: WorkSheet, opts?: Sheet2JSONOpts): any[][];
|
|
983
|
+
sheet_to_json(worksheet: WorkSheet, opts?: Sheet2JSONOpts): any[];
|
|
984
|
+
|
|
985
|
+
/** Generates delimiter-separated-values output */
|
|
986
|
+
sheet_to_csv(worksheet: WorkSheet, options?: Sheet2CSVOpts): string;
|
|
987
|
+
|
|
988
|
+
/** Generates UTF16 Formatted Text */
|
|
989
|
+
sheet_to_txt(worksheet: WorkSheet, options?: Sheet2CSVOpts): string;
|
|
990
|
+
|
|
991
|
+
/** Generates HTML */
|
|
992
|
+
sheet_to_html(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string;
|
|
993
|
+
|
|
994
|
+
/** Generates a list of the formulae (with value fallbacks) */
|
|
995
|
+
sheet_to_formulae(
|
|
996
|
+
worksheet: WorkSheet,
|
|
997
|
+
options?: Sheet2FormulaOpts,
|
|
998
|
+
): string[];
|
|
999
|
+
|
|
1000
|
+
/* --- Cell Address Utilities --- */
|
|
1001
|
+
|
|
1002
|
+
/** Converts 0-indexed cell address to A1 form */
|
|
1003
|
+
encode_cell(cell: CellAddress): string;
|
|
1004
|
+
|
|
1005
|
+
/** Converts 0-indexed row to A1 form */
|
|
1006
|
+
encode_row(row: number): string;
|
|
1007
|
+
|
|
1008
|
+
/** Converts 0-indexed column to A1 form */
|
|
1009
|
+
encode_col(col: number): string;
|
|
1010
|
+
|
|
1011
|
+
/** Converts 0-indexed range to A1 form */
|
|
1012
|
+
encode_range(s: CellAddress, e: CellAddress): string;
|
|
1013
|
+
encode_range(r: Range): string;
|
|
1014
|
+
|
|
1015
|
+
/** Converts A1 cell address to 0-indexed form */
|
|
1016
|
+
decode_cell(address: string): CellAddress;
|
|
1017
|
+
|
|
1018
|
+
/** Converts A1 row to 0-indexed form */
|
|
1019
|
+
decode_row(row: string): number;
|
|
1020
|
+
|
|
1021
|
+
/** Converts A1 column to 0-indexed form */
|
|
1022
|
+
decode_col(col: string): number;
|
|
1023
|
+
|
|
1024
|
+
/** Converts A1 range to 0-indexed form */
|
|
1025
|
+
decode_range(range: string): Range;
|
|
1026
|
+
|
|
1027
|
+
/** Format cell */
|
|
1028
|
+
format_cell(cell: CellObject, v?: any, opts?: any): string;
|
|
1029
|
+
|
|
1030
|
+
/* --- General Utilities --- */
|
|
1031
|
+
|
|
1032
|
+
/** Create a new workbook */
|
|
1033
|
+
book_new(ws?: WorkSheet, wsname?: string): WorkBook;
|
|
1034
|
+
|
|
1035
|
+
/** Create a new worksheet */
|
|
1036
|
+
sheet_new(opts?: DenseOption): WorkSheet;
|
|
1037
|
+
|
|
1038
|
+
/** Append a worksheet to a workbook, returns new worksheet name */
|
|
1039
|
+
book_append_sheet(
|
|
1040
|
+
workbook: WorkBook,
|
|
1041
|
+
worksheet: WorkSheet,
|
|
1042
|
+
name?: string,
|
|
1043
|
+
roll?: boolean,
|
|
1044
|
+
): string;
|
|
1045
|
+
|
|
1046
|
+
/** Set sheet visibility (visible/hidden/very hidden) */
|
|
1047
|
+
book_set_sheet_visibility(
|
|
1048
|
+
workbook: WorkBook,
|
|
1049
|
+
sheet: number | string,
|
|
1050
|
+
visibility: number,
|
|
1051
|
+
): void;
|
|
1052
|
+
|
|
1053
|
+
/** Set number format for a cell */
|
|
1054
|
+
cell_set_number_format(cell: CellObject, fmt: string | number): CellObject;
|
|
1055
|
+
|
|
1056
|
+
/** Set hyperlink for a cell */
|
|
1057
|
+
cell_set_hyperlink(
|
|
1058
|
+
cell: CellObject,
|
|
1059
|
+
target: string,
|
|
1060
|
+
tooltip?: string,
|
|
1061
|
+
): CellObject;
|
|
1062
|
+
|
|
1063
|
+
/** Set internal link for a cell */
|
|
1064
|
+
cell_set_internal_link(
|
|
1065
|
+
cell: CellObject,
|
|
1066
|
+
target: string,
|
|
1067
|
+
tooltip?: string,
|
|
1068
|
+
): CellObject;
|
|
1069
|
+
|
|
1070
|
+
/** Add comment to a cell */
|
|
1071
|
+
cell_add_comment(cell: CellObject, text: string, author?: string): void;
|
|
1072
|
+
|
|
1073
|
+
/** Assign an Array Formula to a range */
|
|
1074
|
+
sheet_set_array_formula(
|
|
1075
|
+
ws: WorkSheet,
|
|
1076
|
+
range: Range | string,
|
|
1077
|
+
formula: string,
|
|
1078
|
+
dynamic?: boolean,
|
|
1079
|
+
): WorkSheet;
|
|
1080
|
+
|
|
1081
|
+
/** Add an array of arrays of JS data to a worksheet */
|
|
1082
|
+
sheet_add_aoa<T>(ws: WorkSheet, data: T[][], opts?: SheetAOAOpts): WorkSheet;
|
|
1083
|
+
sheet_add_aoa(ws: WorkSheet, data: any[][], opts?: SheetAOAOpts): WorkSheet;
|
|
1084
|
+
|
|
1085
|
+
/** Add an array of JS objects to a worksheet */
|
|
1086
|
+
sheet_add_json(ws: WorkSheet, data: any[], opts?: JSON2SheetOpts): WorkSheet;
|
|
1087
|
+
sheet_add_json<T>(ws: WorkSheet, data: T[], opts?: JSON2SheetOpts): WorkSheet;
|
|
1088
|
+
|
|
1089
|
+
consts: XLSX$Consts;
|
|
1090
|
+
}
|
|
1091
|
+
|
|
1092
|
+
export interface XLSX$Consts {
|
|
1093
|
+
/* --- Sheet Visibility --- */
|
|
1094
|
+
|
|
1095
|
+
/** Visibility: Visible */
|
|
1096
|
+
SHEET_VISIBLE: 0;
|
|
1097
|
+
|
|
1098
|
+
/** Visibility: Hidden */
|
|
1099
|
+
SHEET_HIDDEN: 1;
|
|
1100
|
+
|
|
1101
|
+
/** Visibility: Very Hidden */
|
|
1102
|
+
SHEET_VERYHIDDEN: 2;
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
export interface StrideOption {
|
|
1106
|
+
/** Number of rows to write per step */
|
|
1107
|
+
stride?: number;
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
export interface XLMLStreamOpts extends WritingOptions, StrideOption {}
|
|
1111
|
+
|
|
1112
|
+
/**
|
|
1113
|
+
* Streaming write methods
|
|
1114
|
+
*
|
|
1115
|
+
* These methods are directly compatible with NodeJS `stream.Readable` API
|
|
1116
|
+
*
|
|
1117
|
+
* Web Streams (modern browsers) can play nice with NodeJS streams. See the Web
|
|
1118
|
+
* Demo at https://docs.sheetjs.com/docs/demos/bigdata/worker#streaming-write
|
|
1119
|
+
*
|
|
1120
|
+
* NOTE: These methods are not included in the `xlsx.mini.min.js` build!
|
|
1121
|
+
*/
|
|
1122
|
+
export interface StreamUtils {
|
|
1123
|
+
/** Set `Readable` (for environments that do not support NodeJS Streams) */
|
|
1124
|
+
set_readable(Readable: any): void;
|
|
1125
|
+
|
|
1126
|
+
/* --- Worksheet writers --- */
|
|
1127
|
+
|
|
1128
|
+
/** CSV output stream, generate one line at a time */
|
|
1129
|
+
to_csv(sheet: WorkSheet, opts?: Sheet2CSVOpts): any;
|
|
1130
|
+
/** HTML output stream, generate one line at a time */
|
|
1131
|
+
to_html(sheet: WorkSheet, opts?: Sheet2HTMLOpts): any;
|
|
1132
|
+
/** JSON object stream, generate one row at a time */
|
|
1133
|
+
to_json(sheet: WorkSheet, opts?: Sheet2JSONOpts): any;
|
|
1134
|
+
|
|
1135
|
+
/* --- Workbook writers --- */
|
|
1136
|
+
|
|
1137
|
+
/** XLML output string stream (bookType `xlml`) */
|
|
1138
|
+
to_xlml(data: WorkBook, opts?: XLMLStreamOpts): any;
|
|
1139
|
+
}
|