Skip to content

xlsx

Type module

Sources

Items from xlsx can be imported/included and used via following ways.

/**
* Import via: xlsx.ts
* Access items like: $xlsx.myVariable
*/
import * as $xlsx from "@amcharts/amcharts5/xlsx";

Variables

CFB

Type anyDefault unsupportedObject("CFB")

crcTable

Type Int32Array | undefined

CT

Type "application/vnd.openxmlformats-"Default "application/vnd.openxmlformats-"

DAY

Type 86400000Default 86400000

EPOCH

Type numberDefault Date.UTC(1899, 11, 30)

NS_MAIN

Type "http://schemas.openxmlformats.org/spreadsheetml/2006/main"Default "http://schemas.openxmlformats.org/spreadsheetml/2006/main"

NS_PKG_REL

Type "http://schemas.openxmlformats.org/package/2006/relationships"Default "http://schemas.openxmlformats.org/package/2006/relationships"

NS_REL

Type "http://schemas.openxmlformats.org/officeDocument/2006/relationships"Default "http://schemas.openxmlformats.org/officeDocument/2006/relationships"

read

Type (args: any[]) => TDefault unsupported("read", () => book_new())

readFile

Type (args: any[]) => TDefault unsupported("readFile", () => book_new())

readFileSync

Type (args: any[]) => TDefault readFile

set_cptable

Type (args: any[]) => TDefault unsupported("set_cptable", toNothing)

set_fs

Type (args: any[]) => TDefault unsupported("set_fs", toNothing)

SSF

Type anyDefault unsupportedObject("SSF")

stream

Type anyDefault unsupportedObject("stream")

version

Type "amcharts"Default "amcharts"

warned

Type object

writeFileAsync

Type (args: any[]) => TDefault unsupported("writeFileAsync", toNothing)

writeFileSync

Type writeFileDefault writeFile

writeFileXLSX

Type writeFileDefault writeFile

writeXLSX

Type writeDefault write

XML

Type "<?xml version="1.0" encoding="UTF-8" standalone="yes"?>"Default "<?xml version="1.0" encoding="UTF-8" standalone="yes"?> "

Functions

aoa_to_sheet(data: any[][],
options?: ISheetOptions
)

Returns IWorkSheet

appPropsXml(props: object)

Returns string

base64(bytes: Uint8Array)

Returns string

binaryString(bytes: Uint8Array)

Returns string

book_append_sheet(wb: IWorkBook,
ws: IWorkSheet,
name?: undefined | string,
roll?: undefined | false | true
)

Returns string

book_new(ws?: IWorkSheet,
name?: undefined | string
)

Returns IWorkBook

Returns ICell

Returns ICell

cell_set_number_format(cell: ICell,
format: string | number
)

Returns ICell

cellXml(ref: string,
cell: ICell,
styles: Styles,
strings: SharedStrings
)

Returns string

checkSheetName(name: string)

Returns void

checkWriteOptions(wb: IWorkBook,
o: IWriteOptions
)

Returns void

columnWidth(col: { wch: undefined | number, width: undefined | number, wpx: undefined | number })

Returns number | undefined

Column width in Excel's units, for Calibri 11 (7 pixels a digit)

corePropsXml(props: object)

Returns string

crc32(bytes: Uint8Array)

Returns number

decode_cell(cell: string)

Returns ICellAddress

decode_col(col: string)

Returns number

decode_range(range: string)

Returns IRange

decode_row(row: string)

Returns number

encode_cell(cell: ICellAddress)

Returns string

encode_col(col: number)

Returns string

encode_range(s: ICellAddress | IRange,
e?: ICellAddress
)

Returns string

encode_row(row: number)

Returns string

escapeAttr(value: any)

Returns string

escapeText(value: string)

Returns string

Escapes cell text. Characters XML can't hold are written the way Excel writes them, as xHHHH, so text that already looks like that is escaped too.

escapeXml(value: any)

Returns string

hasSheet(wb: IWorkBook,
name: string
)

Returns boolean

isoDate(value: any)

Returns string | undefined

json_to_sheet(data: any[],
options?: ISheetOptions
)

Returns IWorkSheet

localToUTC(date: Date)

Returns Date

A local date as a date whose UTC parts are its wall-clock time.

makeCell(value: any,
options: ISheetOptions
)

Returns ICell | undefined

resolveOrigin(ws: IWorkSheet,
origin: ISheetOptions["origin"]
)

Returns ICellAddress

serial(time: number)

Returns number

Excel's serial number for a time whose UTC parts are the wall-clock time.

setOwn(target: any,
key: string,
value: any
)

Returns void

sheet_add_aoa(ws: IWorkSheet | null | undefined,
data: any[][],
options?: ISheetOptions
)

Returns IWorkSheet

sheet_add_json(ws: IWorkSheet | null | undefined,
data: any[],
options?: ISheetOptions
)

Returns IWorkSheet

sheet_get_cell(ws: IWorkSheet,
address: string | ICellAddress
)

Returns ICell

sheet_new(options?: ISheetOptions)

Returns IWorkSheet

sheetXml(ws: IWorkSheet,
styles: Styles,
strings: SharedStrings
)

Returns ISheetPart

split_cell(cell: string)

Returns string[]

toDate(value: Date | number | string)

Returns Date

Converts anything to Date object.

toEmptyArray()

Returns never[]

toEmptyString()

Returns string

toFirst(first: any)

Returns any

toNothing()

Returns undefined

unsupported(name: string,
result: (args: any[]) => T
)

Returns (args: any[]) => T

unsupportedObject(name: string)

Returns any

utf8(value: string)

Returns Uint8Array

warn(message: string)

Returns void

write(wb: IWorkBook,
options?: IWriteOptions
)

Returns any

writeBytes(wb: IWorkBook,
o: IWriteOptions
)

Returns Uint8Array

writeFile(wb: IWorkBook,
filename: string,
options?: IWriteOptions
)

Returns void

xmlChars(value: string)

Returns string

zip(files: Array)

Returns Uint8Array

An uncompressed ZIP archive, as SheetJS writes by default