@u4/adbkit
Version:
A Typescript client for the Android Debug Bridge.
22 lines • 1.02 kB
TypeScript
import { Stream } from 'stream';
/**
* `PullTransfer` is a [`Stream`][node-stream]. Use [`fs.createWriteStream()`][node-fs] to pipe the stream to a file if necessary.
*/
export default class PullTransfer extends Stream.PassThrough {
stats: {
bytesTransferred: number;
};
/**
* Cancels the transfer by ending the connection. Can be useful for reading endless streams of data, such as `/dev/urandom` or `/dev/zero`, perhaps for benchmarking use. Note that you must create a new sync connection if you wish to continue using the sync service.
* @returns The pullTransfer instance.
*/
cancel(): boolean;
write(chunk: Buffer, encoding?: BufferEncoding | typeof callback, callback?: (error: Error | null | undefined) => void): boolean;
promiseWrite(chunk: Buffer, encoding?: BufferEncoding): Promise<void>;
private waitForEndPromise?;
/**
* get end notification using Promise
*/
waitForEnd(): Promise<void>;
}
//# sourceMappingURL=pulltransfer.d.ts.map