Skip to content

Class: SDKFile

Defined in: src/file/file.ts:10

Deprecated

Use MwFile instead.

A file loaded into memory from base64-encoded data.

Properties

PropertyTypeDescriptionDefined in
datastringBase64-encoded file data.src/file/file.ts:12
namestringFile name.src/file/file.ts:14
webkitRelativePathstringRelative path to the file.src/file/file.ts:16
lastModifiednumberLast modified time in milliseconds since epoch.src/file/file.ts:18
sizenumberFile size in bytes.src/file/file.ts:20
typestringMIME type.src/file/file.ts:22
processedFile?anyOptional 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

ParameterTypeDescription
start?numberStart index of the byte range.
end?numberEnd index of the byte range.
type?stringMIME type of the sliced file. Defaults to an empty string.

Returns

SdkFile

A new SDKFile with the sliced data.

Matterway Assistant SDK Documentation