Appearance
Class: SDKFile
Defined in: src/file/file.ts:10
Deprecated
Use MwFile instead.
A file loaded into memory from base64-encoded data.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
data | string | Base64-encoded file data. | src/file/file.ts:12 |
name | string | File name. | src/file/file.ts:14 |
webkitRelativePath | string | Relative path to the file. | src/file/file.ts:16 |
lastModified | number | Last modified time in milliseconds since epoch. | src/file/file.ts:18 |
size | number | File size in bytes. | src/file/file.ts:20 |
type | string | MIME type. | src/file/file.ts:22 |
processedFile? | any | Optional processed file, such as OCR data or an Excel Workbook. | src/file/file.ts:24 |
Methods
arrayBuffer()
ts
arrayBuffer(): Promise<ArrayBuffer>;Defined in: src/file/file.ts:36
Read the data and return it as an ArrayBuffer.
Returns
Promise<ArrayBuffer>
text()
ts
text(): Promise<string>;Defined in: src/file/file.ts:45
Read the data and return it as a string.
Returns
Promise<string>
slice()
ts
slice(
start?: number,
end?: number,
type?: string): SdkFile;Defined in: src/file/file.ts:57
Return a new file with only data in the given byte range.
Parameters
| Parameter | Type | Description |
|---|---|---|
start? | number | Start index of the byte range. |
end? | number | End index of the byte range. |
type? | string | MIME type of the sliced file. Defaults to an empty string. |
Returns
A new SDKFile with the sliced data.