UNPKG

1 kBTypeScriptView Raw
1import { FileObject, SliceType } from "../../LargeFileUploadTask";
2import { Range } from "../Range";
3/**
4 * @class
5 * FileObject class for Readable Stream upload
6 */
7export declare class StreamUpload implements FileObject<NodeStream> {
8 content: NodeStream;
9 name: string;
10 size: number;
11 /**
12 * @private
13 * Represents a cache of the last attempted upload slice.
14 * This can be used when resuming a previously failed slice upload.
15 */
16 private previousSlice;
17 constructor(content: NodeStream, name: string, size: number);
18 /**
19 * @public
20 * Slices the file content to the given range
21 * @param {Range} range - The range value
22 * @returns The sliced file part
23 */
24 sliceFile(range: Range): Promise<SliceType>;
25 /**
26 * @private
27 * Reads the specified byte size from the stream
28 * @param {number} size - The size of bytes to be read
29 * @returns Buffer with the given length of data.
30 */
31 private readNBytesFromStream;
32}