From fa7328c66c353de89a966d940e2796e27fe86be3 Mon Sep 17 00:00:00 2001 From: Alexis Svinartchouk Date: Mon, 13 May 2019 13:13:22 +0200 Subject: [PATCH] Add typedoc generated README Change-type: patch --- README.md | 10 +- doc/README.md | 1651 +++++++++++++++++ doc/classes/adapter.md | 370 ++++ doc/classes/balenas3source.md | 899 +++++++++ doc/classes/blockdevice.md | 1113 +++++++++++ doc/classes/blockdeviceadapter.md | 473 +++++ doc/classes/blockreadstream.md | 1272 +++++++++++++ doc/classes/blocksverificationerror.md | 115 ++ doc/classes/blocktransformstream.md | 1445 +++++++++++++++ doc/classes/blockwritestream.md | 1431 ++++++++++++++ doc/classes/bzip2source.md | 842 +++++++++ doc/classes/checksumverificationerror.md | 116 ++ doc/classes/compressedsource.md | 836 +++++++++ doc/classes/configuredsource.md | 932 ++++++++++ doc/classes/countinghashstream.md | 1373 ++++++++++++++ doc/classes/countingwritable.md | 1277 +++++++++++++ doc/classes/crc32hasher.md | 70 + doc/classes/dmgsource.md | 818 ++++++++ doc/classes/driverlessdevice.md | 972 ++++++++++ doc/classes/driverlessdeviceadapter_.md | 444 +++++ doc/classes/file.md | 843 +++++++++ doc/classes/gzipsource.md | 842 +++++++++ doc/classes/http.md | 847 +++++++++ doc/classes/multidestination.md | 858 +++++++++ doc/classes/multidestinationerror.md | 113 ++ doc/classes/multidestinationverifier.md | 497 +++++ doc/classes/notcapable.md | 68 + doc/classes/randomaccesszipsource.md | 973 ++++++++++ doc/classes/scanner.md | 463 +++++ doc/classes/singleusestreamsource.md | 786 ++++++++ doc/classes/sourcedestination.md | 782 ++++++++ doc/classes/sourcedestinationfs.md | 139 ++ doc/classes/sourcedisk.md | 373 ++++ doc/classes/sourcerandomaccessreader.md | 462 +++++ doc/classes/sourcesource.md | 798 ++++++++ doc/classes/sparsefilterstream.md | 1463 +++++++++++++++ doc/classes/sparsereadstream.md | 1308 +++++++++++++ doc/classes/sparsestreamverifier.md | 466 +++++ doc/classes/sparsewritestream.md | 1427 ++++++++++++++ doc/classes/streamlimiter.md | 1380 ++++++++++++++ doc/classes/streamverifier.md | 477 +++++ doc/classes/streamzipsource.md | 840 +++++++++ doc/classes/usbbootdeviceadapter.md | 442 +++++ doc/classes/usbbootdrive.md | 996 ++++++++++ doc/classes/verificationerror.md | 82 + doc/classes/verifier.md | 421 +++++ doc/classes/xzsource.md | 842 +++++++++ doc/classes/zipsource.md | 851 +++++++++ doc/enums/openflags.md | 46 + doc/interfaces/adaptersourcedestination.md | 828 +++++++++ doc/interfaces/block.md | 38 + doc/interfaces/blockswithchecksum.md | 48 + doc/interfaces/drivelistdrive.md | 280 +++ doc/interfaces/execresult.md | 38 + doc/interfaces/metadata.md | 198 ++ doc/interfaces/multidestinationprogress.md | 224 +++ doc/interfaces/multidestinationstate.md | 140 ++ doc/interfaces/operation.md | 38 + .../pipesourcetodestinationsresult.md | 38 + doc/interfaces/progressevent.md | 48 + doc/interfaces/sourcetransform.md | 1371 ++++++++++++++ doc/interfaces/sparsereadable.md | 509 +++++ doc/interfaces/sparsereaderstate.md | 48 + doc/interfaces/sparsestreamchunk.md | 38 + doc/interfaces/sparsewritable.md | 420 +++++ doc/interfaces/tmpfileresult.md | 38 + doc/interfaces/wificonfig.md | 78 + package.json | 5 +- 68 files changed, 40759 insertions(+), 10 deletions(-) create mode 100644 doc/README.md create mode 100644 doc/classes/adapter.md create mode 100644 doc/classes/balenas3source.md create mode 100644 doc/classes/blockdevice.md create mode 100644 doc/classes/blockdeviceadapter.md create mode 100644 doc/classes/blockreadstream.md create mode 100644 doc/classes/blocksverificationerror.md create mode 100644 doc/classes/blocktransformstream.md create mode 100644 doc/classes/blockwritestream.md create mode 100644 doc/classes/bzip2source.md create mode 100644 doc/classes/checksumverificationerror.md create mode 100644 doc/classes/compressedsource.md create mode 100644 doc/classes/configuredsource.md create mode 100644 doc/classes/countinghashstream.md create mode 100644 doc/classes/countingwritable.md create mode 100644 doc/classes/crc32hasher.md create mode 100644 doc/classes/dmgsource.md create mode 100644 doc/classes/driverlessdevice.md create mode 100644 doc/classes/driverlessdeviceadapter_.md create mode 100644 doc/classes/file.md create mode 100644 doc/classes/gzipsource.md create mode 100644 doc/classes/http.md create mode 100644 doc/classes/multidestination.md create mode 100644 doc/classes/multidestinationerror.md create mode 100644 doc/classes/multidestinationverifier.md create mode 100644 doc/classes/notcapable.md create mode 100644 doc/classes/randomaccesszipsource.md create mode 100644 doc/classes/scanner.md create mode 100644 doc/classes/singleusestreamsource.md create mode 100644 doc/classes/sourcedestination.md create mode 100644 doc/classes/sourcedestinationfs.md create mode 100644 doc/classes/sourcedisk.md create mode 100644 doc/classes/sourcerandomaccessreader.md create mode 100644 doc/classes/sourcesource.md create mode 100644 doc/classes/sparsefilterstream.md create mode 100644 doc/classes/sparsereadstream.md create mode 100644 doc/classes/sparsestreamverifier.md create mode 100644 doc/classes/sparsewritestream.md create mode 100644 doc/classes/streamlimiter.md create mode 100644 doc/classes/streamverifier.md create mode 100644 doc/classes/streamzipsource.md create mode 100644 doc/classes/usbbootdeviceadapter.md create mode 100644 doc/classes/usbbootdrive.md create mode 100644 doc/classes/verificationerror.md create mode 100644 doc/classes/verifier.md create mode 100644 doc/classes/xzsource.md create mode 100644 doc/classes/zipsource.md create mode 100644 doc/enums/openflags.md create mode 100644 doc/interfaces/adaptersourcedestination.md create mode 100644 doc/interfaces/block.md create mode 100644 doc/interfaces/blockswithchecksum.md create mode 100644 doc/interfaces/drivelistdrive.md create mode 100644 doc/interfaces/execresult.md create mode 100644 doc/interfaces/metadata.md create mode 100644 doc/interfaces/multidestinationprogress.md create mode 100644 doc/interfaces/multidestinationstate.md create mode 100644 doc/interfaces/operation.md create mode 100644 doc/interfaces/pipesourcetodestinationsresult.md create mode 100644 doc/interfaces/progressevent.md create mode 100644 doc/interfaces/sourcetransform.md create mode 100644 doc/interfaces/sparsereadable.md create mode 100644 doc/interfaces/sparsereaderstate.md create mode 100644 doc/interfaces/sparsestreamchunk.md create mode 100644 doc/interfaces/sparsewritable.md create mode 100644 doc/interfaces/tmpfileresult.md create mode 100644 doc/interfaces/wificonfig.md diff --git a/README.md b/README.md index 7d5406f7..cc0376a6 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,3 @@ # Etcher SDK -## Install via [npm](https://npmjs.com) - -```sh -$ npm install --save etcher-sdk -``` - -## Usage - -Work in progress +See [examples](./examples) and [typedoc generated README](./doc/README.md) diff --git a/doc/README.md b/doc/README.md new file mode 100644 index 00000000..6560de05 --- /dev/null +++ b/doc/README.md @@ -0,0 +1,1651 @@ + +# etcher-sdk + +## Index + +### Enumerations + +* [OpenFlags](enums/openflags.md) + +### Classes + +* [Adapter](classes/adapter.md) +* [BZip2Source](classes/bzip2source.md) +* [BalenaS3Source](classes/balenas3source.md) +* [BlockDevice](classes/blockdevice.md) +* [BlockDeviceAdapter](classes/blockdeviceadapter.md) +* [BlockReadStream](classes/blockreadstream.md) +* [BlockTransformStream](classes/blocktransformstream.md) +* [BlockWriteStream](classes/blockwritestream.md) +* [BlocksVerificationError](classes/blocksverificationerror.md) +* [CRC32Hasher](classes/crc32hasher.md) +* [ChecksumVerificationError](classes/checksumverificationerror.md) +* [CompressedSource](classes/compressedsource.md) +* [ConfiguredSource](classes/configuredsource.md) +* [CountingHashStream](classes/countinghashstream.md) +* [CountingWritable](classes/countingwritable.md) +* [DmgSource](classes/dmgsource.md) +* [DriverlessDevice](classes/driverlessdevice.md) +* [DriverlessDeviceAdapter$](classes/driverlessdeviceadapter_.md) +* [File](classes/file.md) +* [GZipSource](classes/gzipsource.md) +* [Http](classes/http.md) +* [MultiDestination](classes/multidestination.md) +* [MultiDestinationError](classes/multidestinationerror.md) +* [MultiDestinationVerifier](classes/multidestinationverifier.md) +* [NotCapable](classes/notcapable.md) +* [RandomAccessZipSource](classes/randomaccesszipsource.md) +* [Scanner](classes/scanner.md) +* [SingleUseStreamSource](classes/singleusestreamsource.md) +* [SourceDestination](classes/sourcedestination.md) +* [SourceDestinationFs](classes/sourcedestinationfs.md) +* [SourceDisk](classes/sourcedisk.md) +* [SourceRandomAccessReader](classes/sourcerandomaccessreader.md) +* [SourceSource](classes/sourcesource.md) +* [SparseFilterStream](classes/sparsefilterstream.md) +* [SparseReadStream](classes/sparsereadstream.md) +* [SparseStreamVerifier](classes/sparsestreamverifier.md) +* [SparseWriteStream](classes/sparsewritestream.md) +* [StreamLimiter](classes/streamlimiter.md) +* [StreamVerifier](classes/streamverifier.md) +* [StreamZipSource](classes/streamzipsource.md) +* [UsbbootDeviceAdapter](classes/usbbootdeviceadapter.md) +* [UsbbootDrive](classes/usbbootdrive.md) +* [VerificationError](classes/verificationerror.md) +* [Verifier](classes/verifier.md) +* [XzSource](classes/xzsource.md) +* [ZipSource](classes/zipsource.md) + +### Interfaces + +* [AdapterSourceDestination](interfaces/adaptersourcedestination.md) +* [Block](interfaces/block.md) +* [BlocksWithChecksum](interfaces/blockswithchecksum.md) +* [DrivelistDrive](interfaces/drivelistdrive.md) +* [ExecResult](interfaces/execresult.md) +* [Metadata](interfaces/metadata.md) +* [MultiDestinationProgress](interfaces/multidestinationprogress.md) +* [MultiDestinationState](interfaces/multidestinationstate.md) +* [Operation](interfaces/operation.md) +* [PipeSourceToDestinationsResult](interfaces/pipesourcetodestinationsresult.md) +* [ProgressEvent](interfaces/progressevent.md) +* [SourceTransform](interfaces/sourcetransform.md) +* [SparseReadable](interfaces/sparsereadable.md) +* [SparseReaderState](interfaces/sparsereaderstate.md) +* [SparseStreamChunk](interfaces/sparsestreamchunk.md) +* [SparseWritable](interfaces/sparsewritable.md) +* [TmpFileResult](interfaces/tmpfileresult.md) +* [WifiConfig](interfaces/wificonfig.md) + +### Type aliases + +* [AnyHasher](#anyhasher) +* [ChecksumType](#checksumtype) +* [ConfigureFunction](#configurefunction) +* [Constructor](#constructor) +* [Name](#name) +* [OnFailFunction](#onfailfunction) +* [OnProgressFunction](#onprogressfunction) +* [OperationCommand](#operationcommand) +* [WriteStep](#writestep) + +### Variables + +* [BITS](#bits) +* [CHUNK_SIZE](#chunk_size) +* [DEFAULT_BLOCK_SIZE](#default_block_size) +* [DISKPART_DELAY](#diskpart_delay) +* [DISKPART_RETRIES](#diskpart_retries) +* [DriverlessDeviceAdapter](#driverlessdeviceadapter) +* [ISIZE_LENGTH](#isize_length) +* [MBR_LAST_PRIMARY_PARTITION](#mbr_last_primary_partition) +* [NETWORK_SETTINGS_KEYS](#network_settings_keys) +* [NO_MATCHING_FILE_MSG](#no_matching_file_msg) +* [PARTITION_FIELDS](#partition_fields) +* [PATTERN](#pattern) +* [PROGRESS_EMISSION_INTERVAL](#progress_emission_interval) +* [ProgressBlockReadStream](#progressblockreadstream) +* [ProgressBlockWriteStream](#progressblockwritestream) +* [ProgressHashStream](#progresshashstream) +* [ProgressSparseWriteStream](#progresssparsewritestream) +* [ProgressWritable](#progresswritable) +* [ProgressWriteStream](#progresswritestream) +* [RETRY_BASE_TIMEOUT](#retry_base_timeout) +* [SCAN_INTERVAL](#scan_interval) +* [TMP_DIR](#tmp_dir) +* [TMP_RANDOM_BYTES](#tmp_random_bytes) +* [TRIES](#tries) +* [UNMOUNT_ON_SUCCESS_TIMEOUT_MS](#unmount_on_success_timeout_ms) +* [USBBOOT_RPI_COMPUTE_MODULE_NAMES](#usbboot_rpi_compute_module_names) +* [USE_ALIGNED_IO](#use_aligned_io) +* [UsbbootScanner](#usbbootscanner) +* [WIN32_FIRST_BYTES_TO_KEEP](#win32_first_bytes_to_keep) +* [XXHASH_SEED](#xxhash_seed) +* [debug](#debug) +* [parseFileIndexAsync](#parsefileindexasync) +* [unmountDiskAsync](#unmountdiskasync) + +### Functions + +* [asCallback](#ascallback) +* [blockmapToBlocks](#blockmaptoblocks) +* [blocksLength](#blockslength) +* [blocksVerificationErrorMessage](#blocksverificationerrormessage) +* [clean](#clean) +* [close](#close) +* [configure](#configure) +* [copy](#copy) +* [createHasher](#createhasher) +* [createNetworkConfigFiles](#createnetworkconfigfiles) +* [createSparseReaderStateIterator](#createsparsereaderstateiterator) +* [difference](#difference) +* [driveKey](#drivekey) +* [execFileAsync](#execfileasync) +* [execute](#execute) +* [executeOperation](#executeoperation) +* [fstat](#fstat) +* [fsync](#fsync) +* [getDiskDeviceType](#getdiskdevicetype) +* [getEta](#geteta) +* [getFileStreamFromZipStream](#getfilestreamfromzipstream) +* [getPartitionIndex](#getpartitionindex) +* [getRootStream](#getrootstream) +* [isSourceTransform](#issourcetransform) +* [isTransientError](#istransienterror) +* [isntNull](#isntnull) +* [looksLikeComputeModule](#lookslikecomputemodule) +* [makeClassEmitProgressEvents](#makeclassemitprogressevents) +* [matchSupportedExtensions](#matchsupportedextensions) +* [nmWifiConfig](#nmwificonfig) +* [open](#open) +* [pad](#pad) +* [pipeRegularSourceToDestination](#piperegularsourcetodestination) +* [pipeSourceToDestinations](#pipesourcetodestinations) +* [pipeSparseSourceToDestination](#pipesparsesourcetodestination) +* [randomFilePath](#randomfilepath) +* [read](#read) +* [readFile](#readfile) +* [require](#require) +* [runDiskpart](#rundiskpart) +* [runVerifier](#runverifier) +* [sparseStreamToBuffer](#sparsestreamtobuffer) +* [stat](#stat) +* [streamToBuffer](#streamtobuffer) +* [tmpFile](#tmpfile) +* [tmpFileDisposer](#tmpfiledisposer) +* [unlink](#unlink) +* [verifyOrGenerateChecksum](#verifyorgeneratechecksum) +* [write](#write) +* [writeFile](#writefile) + +### Object literals + +* [ACTIONS](#actions) + +--- + +## Type aliases + + + +### AnyHasher + +**Ƭ AnyHasher**: *[CRC32Hasher](classes/crc32hasher.md) \| `Hash` \| `XXHash` \| `XXHash64`* + +*Defined in [sparse-stream/shared.ts:66](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L66)* + +___ + + +### ChecksumType + +**Ƭ ChecksumType**: *"crc32" \| "sha1" \| "sha256" \| "xxhash32" \| "xxhash64"* + +*Defined in [sparse-stream/shared.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L26)* + +___ + + +### ConfigureFunction + +**Ƭ ConfigureFunction**: *`function`* + +*Defined in [source-destination/configured-source/configured-source.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L41)* + +#### Type declaration +▸(disk: *`Disk`*, config: *`any`*): `Promise`<`void`> + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| disk | `Disk` | +| config | `any` | + +**Returns:** `Promise`<`void`> + +___ + + +### Constructor + +**Ƭ Constructor**: *`object`* + +*Defined in [source-destination/progress.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L25)* + +#### Type declaration + +___ + + +### Name + +**Ƭ Name**: *"balena" \| "resin"* + +*Defined in [source-destination/balena-s3-source.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L25)* + +___ + + +### OnFailFunction + +**Ƭ OnFailFunction**: *`function`* + +*Defined in [multi-write.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L60)* + +#### Type declaration +▸(destination: *[SourceDestination](classes/sourcedestination.md)*, error: *`Error`*): `void` + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | [SourceDestination](classes/sourcedestination.md) | +| error | `Error` | + +**Returns:** `void` + +___ + + +### OnProgressFunction + +**Ƭ OnProgressFunction**: *`function`* + +*Defined in [multi-write.ts:65](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L65)* + +#### Type declaration +▸(progress: *[MultiDestinationProgress](interfaces/multidestinationprogress.md)*): `void` + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| progress | [MultiDestinationProgress](interfaces/multidestinationprogress.md) | + +**Returns:** `void` + +___ + + +### OperationCommand + +**Ƭ OperationCommand**: *"configure" \| "copy"* + +*Defined in [source-destination/configured-source/configure.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L28)* + +___ + + +### WriteStep + +**Ƭ WriteStep**: *"flashing" \| "verifying" \| "finished"* + +*Defined in [multi-write.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L34)* + +___ + +## Variables + + + +### `` BITS + +**● BITS**: *`64` \| `32`* = arch === 'x64' || arch === 'aarch64' ? 64 : 32 + +*Defined in [source-destination/source-destination.ts:45](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L45)* + +___ + + +### `` CHUNK_SIZE + +**● CHUNK_SIZE**: *`number`* = 1024 ** 2 + +*Defined in [constants.ts:19](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/constants.ts#L19)* + +___ + + +### `` DEFAULT_BLOCK_SIZE + +**● DEFAULT_BLOCK_SIZE**: *`512`* = 512 + +*Defined in [source-destination/block-device.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L41)* + +___ + + +### `` DISKPART_DELAY + +**● DISKPART_DELAY**: *`2000`* = 2000 + +*Defined in [diskpart.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L27)* + +___ + + +### `` DISKPART_RETRIES + +**● DISKPART_RETRIES**: *`5`* = 5 + +*Defined in [diskpart.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L28)* + +___ + + +### `` DriverlessDeviceAdapter + +**● DriverlessDeviceAdapter**: *`undefined` \| [DriverlessDeviceAdapter$](classes/driverlessdeviceadapter_.md)* = + platform === 'win32' ? DriverlessDeviceAdapter$ : undefined + +*Defined in [scanner/adapters/driverless.ts:100](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L100)* + +___ + + +### `` ISIZE_LENGTH + +**● ISIZE_LENGTH**: *`4`* = 4 + +*Defined in [source-destination/gzip.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/gzip.ts#L23)* + +___ + + +### `` MBR_LAST_PRIMARY_PARTITION + +**● MBR_LAST_PRIMARY_PARTITION**: *`4`* = 4 + +*Defined in [source-destination/configured-source/configure.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L36)* + +___ + + +### `` NETWORK_SETTINGS_KEYS + +**● NETWORK_SETTINGS_KEYS**: *`string`[]* = [ + 'wifiSsid', + 'wifiKey', + 'ip', + 'netmask', + 'gateway', + 'routeMetric', +] + +*Defined in [source-destination/configured-source/operations/configure.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L23)* + +___ + + +### `` NO_MATCHING_FILE_MSG + +**● NO_MATCHING_FILE_MSG**: *"Can't find a matching file in this zip archive"* = "Can't find a matching file in this zip archive" + +*Defined in [constants.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/constants.ts#L20)* + +___ + + +### `` PARTITION_FIELDS + +**● PARTITION_FIELDS**: *`string`[]* = ['partition', 'to.partition', 'from.partition'] + +*Defined in [source-destination/configured-source/configure.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L35)* + +___ + + +### `` PATTERN + +**● PATTERN**: *`RegExp`* = /PHYSICALDRIVE(\d+)/i + +*Defined in [diskpart.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L29)* + +___ + + +### `` PROGRESS_EMISSION_INTERVAL + +**● PROGRESS_EMISSION_INTERVAL**: *`number`* = 1000 / 2 + +*Defined in [constants.ts:17](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/constants.ts#L17)* + +___ + + +### `` ProgressBlockReadStream + +**● ProgressBlockReadStream**: *`(Anonymous class)` & [BlockReadStream](classes/blockreadstream.md)* = makeClassEmitProgressEvents( + BlockReadStream, + 'bytesRead', + 'bytesRead', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [block-read-stream.ts:98](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L98)* + +___ + + +### `` ProgressBlockWriteStream + +**● ProgressBlockWriteStream**: *`(Anonymous class)` & [BlockWriteStream](classes/blockwritestream.md)* = makeClassEmitProgressEvents( + BlockWriteStream, + 'bytesWritten', + 'bytesWritten', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [block-write-stream.ts:170](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L170)* + +___ + + +### `` ProgressHashStream + +**● ProgressHashStream**: *`(Anonymous class)` & [CountingHashStream](classes/countinghashstream.md)* = makeClassEmitProgressEvents( + CountingHashStream, + 'bytesWritten', + 'bytesWritten', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [source-destination/source-destination.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L58)* + +___ + + +### `` ProgressSparseWriteStream + +**● ProgressSparseWriteStream**: *`(Anonymous class)` & [SparseWriteStream](classes/sparsewritestream.md)* = makeClassEmitProgressEvents( + SparseWriteStream, + 'bytesWritten', + 'position', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [sparse-stream/sparse-write-stream.ts:120](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L120)* + +___ + + +### `` ProgressWritable + +**● ProgressWritable**: *`(Anonymous class)` & [CountingWritable](classes/countingwritable.md)* = makeClassEmitProgressEvents( + CountingWritable, + 'bytesWritten', + 'position', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [source-destination/progress.ts:110](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L110)* + +___ + + +### `` ProgressWriteStream + +**● ProgressWriteStream**: *`any`* = makeClassEmitProgressEvents( + // type definitions for node 6 export fs.WriteStream as an interface, but it's a class. + // @ts-ignore + fs.WriteStream, + 'bytesWritten', + 'bytesWritten', + PROGRESS_EMISSION_INTERVAL, +) + +*Defined in [source-destination/file.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L36)* + +___ + + +### `` RETRY_BASE_TIMEOUT + +**● RETRY_BASE_TIMEOUT**: *`100`* = 100 + +*Defined in [constants.ts:18](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/constants.ts#L18)* + +___ + + +### `` SCAN_INTERVAL + +**● SCAN_INTERVAL**: *`1000`* = 1000 + +*Defined in [scanner/adapters/block-device.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L27)* +*Defined in [scanner/adapters/driverless.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L26)* + +___ + + +### `` TMP_DIR + +**● TMP_DIR**: *`string`* = tmpdir() + +*Defined in [tmp.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L25)* + +___ + + +### `` TMP_RANDOM_BYTES + +**● TMP_RANDOM_BYTES**: *`6`* = 6 + +*Defined in [tmp.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L24)* + +___ + + +### `` TRIES + +**● TRIES**: *`5`* = 5 + +*Defined in [tmp.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L26)* + +___ + + +### `` UNMOUNT_ON_SUCCESS_TIMEOUT_MS + +**● UNMOUNT_ON_SUCCESS_TIMEOUT_MS**: *`2000`* = 2000 + +*Defined in [source-destination/block-device.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L40)* + +*__summary__*: Time, in milliseconds, to wait before unmounting on success + +___ + + +### `` USBBOOT_RPI_COMPUTE_MODULE_NAMES + +**● USBBOOT_RPI_COMPUTE_MODULE_NAMES**: *`string`[]* = [ + '0001', + 'RPi-MSD- 0001', + 'File-Stor Gadget', + 'Linux File-Stor_Gadget', + 'Linux File-Stor Gadget', + 'Linux File-Stor Gadget USB Device', + 'Linux File-Stor Gadget Media', +] + +*Defined in [scanner/adapters/block-device.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L28)* + +___ + + +### `` USE_ALIGNED_IO + +**● USE_ALIGNED_IO**: *`boolean`* = platform() === 'win32' || platform() === 'darwin' + +*Defined in [source-destination/block-device.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L43)* + +___ + + +### `` UsbbootScanner + +**● UsbbootScanner**: *`UsbbootScanner` \| `undefined`* + +*Defined in [scanner/adapters/usbboot.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L27)* + +___ + + +### `` WIN32_FIRST_BYTES_TO_KEEP + +**● WIN32_FIRST_BYTES_TO_KEEP**: *`number`* = 64 * 1024 + +*Defined in [source-destination/block-device.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L42)* + +___ + + +### `` XXHASH_SEED + +**● XXHASH_SEED**: *`1163150152`* = 1163150152 + +*Defined in [constants.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/constants.ts#L22)* + +___ + + +### `` debug + +**● debug**: *`IDebugger`* = _debug('etcher-sdk:configured-source') + +*Defined in [block-write-stream.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L31)* +*Defined in [diskpart.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L25)* +*Defined in [scanner/adapters/block-device.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L25)* +*Defined in [scanner/scanner.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L22)* +*Defined in [source-destination/configured-source/configured-source.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L39)* + +___ + + +### `` parseFileIndexAsync + +**● parseFileIndexAsync**: *`function`* = promisify(parseFileIndex) + +*Defined in [source-destination/xz.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/xz.ts#L24)* + +#### Type declaration +▸(arg1: *`A1`*): `Bluebird`<`T`> + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| arg1 | `A1` | + +**Returns:** `Bluebird`<`T`> + +___ + + +### `` unmountDiskAsync + +**● unmountDiskAsync**: *`function`* = promisify(unmountDisk) + +*Defined in [source-destination/block-device.ts:45](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L45)* + +#### Type declaration +▸(arg1: *`A1`*): `Bluebird`<`T`> + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| arg1 | `A1` | + +**Returns:** `Bluebird`<`T`> + +___ + +## Functions + + + +### asCallback + +▸ **asCallback**(promise: *`Promise`<`any`>*, callback: *`function`*): `void` + +*Defined in [utils.ts:64](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/utils.ts#L64)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| promise | `Promise`<`any`> | +| callback | `function` | + +**Returns:** `void` + +___ + + +### blockmapToBlocks + +▸ **blockmapToBlocks**(blockmap: *`BlockMap`*): [BlocksWithChecksum](interfaces/blockswithchecksum.md)[] + +*Defined in [source-destination/zip.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L46)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blockmap | `BlockMap` | + +**Returns:** [BlocksWithChecksum](interfaces/blockswithchecksum.md)[] + +___ + + +### blocksLength + +▸ **blocksLength**(blocks: *[BlocksWithChecksum](interfaces/blockswithchecksum.md)[]*): `number` + +*Defined in [sparse-stream/shared.ts:128](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L128)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blocks | [BlocksWithChecksum](interfaces/blockswithchecksum.md)[] | + +**Returns:** `number` + +___ + + +### blocksVerificationErrorMessage + +▸ **blocksVerificationErrorMessage**(blocksWithChecksum: *[BlocksWithChecksum](interfaces/blockswithchecksum.md)*, checksum: *`string`*): `string` + +*Defined in [errors.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L37)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blocksWithChecksum | [BlocksWithChecksum](interfaces/blockswithchecksum.md) | +| checksum | `string` | + +**Returns:** `string` + +___ + + +### `` clean + +▸ **clean**(device: *`string`*): `Promise`<`void`> + +*Defined in [diskpart.ts:86](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L86)* + +**Parameters:** + +| Name | Type | Description | +| ------ | ------ | ------ | +| device | `string` | device path | + +**Returns:** `Promise`<`void`> + +___ + + +### close + +▸ **close**(fd: *`number`*): `Promise`<`void`> + +*Defined in [fs.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fd | `number` | + +**Returns:** `Promise`<`void`> + +___ + + +### `` configure + +▸ **configure**(disk: *`Disk`*, options?: *`object`*): `Promise`<`void`> + +*Defined in [source-destination/configured-source/configure.ts:87](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L87)* + +**Parameters:** + +**disk: `Disk`** + +**`Default value` options: `object`** + +| Name | Type | +| ------ | ------ | +| `Optional` config | `any` | + +**Returns:** `Promise`<`void`> + +___ + + +### `` copy + +▸ **copy**(sourceFs: *`AsyncFsLike`*, sourcePath: *`string`*, destinationFs: *`AsyncFsLike`*, destinationPath: *`string`*): `Promise`<`void`> + +*Defined in [source-destination/configured-source/operations/copy.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/copy.ts#L22)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| sourceFs | `AsyncFsLike` | +| sourcePath | `string` | +| destinationFs | `AsyncFsLike` | +| destinationPath | `string` | + +**Returns:** `Promise`<`void`> + +___ + + +### createHasher + +▸ **createHasher**(checksumType?: *[ChecksumType](#checksumtype)*): `undefined` \| [AnyHasher](#anyhasher) + +*Defined in [sparse-stream/shared.ts:68](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L68)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` checksumType | [ChecksumType](#checksumtype) | + +**Returns:** `undefined` \| [AnyHasher](#anyhasher) + +___ + + +### `` createNetworkConfigFiles + +▸ **createNetworkConfigFiles**(networks: *`any`*): `object` + +*Defined in [source-destination/configured-source/operations/configure.ts:95](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L95)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| networks | `any` | + +**Returns:** `object` + +___ + + +### createSparseReaderStateIterator + +▸ **createSparseReaderStateIterator**(blocks: *[BlocksWithChecksum](interfaces/blockswithchecksum.md)[]*, verify: *`boolean`*, generateChecksums: *`boolean`*): `Iterator`<[SparseReaderState](interfaces/sparsereaderstate.md)> + +*Defined in [sparse-stream/shared.ts:86](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L86)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blocks | [BlocksWithChecksum](interfaces/blockswithchecksum.md)[] | +| verify | `boolean` | +| generateChecksums | `boolean` | + +**Returns:** `Iterator`<[SparseReaderState](interfaces/sparsereaderstate.md)> + +___ + + +### difference + +▸ **difference**<`T`>(setA: *`Set`<`T`>*, setB: *`Set`<`T`>*): `Set`<`T`> + +*Defined in [utils.ts:56](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/utils.ts#L56)* + +**Type parameters:** + +#### T +**Parameters:** + +| Name | Type | +| ------ | ------ | +| setA | `Set`<`T`> | +| setB | `Set`<`T`> | + +**Returns:** `Set`<`T`> + +___ + + +### `` driveKey + +▸ **driveKey**(drive: *`$Drive`*): `string` + +*Defined in [scanner/adapters/block-device.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L47)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| drive | `$Drive` | + +**Returns:** `string` + +___ + + +### `` execFileAsync + +▸ **execFileAsync**(command: *`string`*, args?: *`string`[]*, options?: *`ExecFileOptions`*): `Promise`<[ExecResult](interfaces/execresult.md)> + +*Defined in [diskpart.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L36)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| command | `string` | - | +| `Default value` args | `string`[] | [] | +| `Default value` options | `ExecFileOptions` | {} | + +**Returns:** `Promise`<[ExecResult](interfaces/execresult.md)> + +___ + + +### `` execute + +▸ **execute**(operation: *`any`*, disk: *`Disk`*): `Promise`<`void`> + +▸ **execute**(operation: *`any`*, disk: *`Disk`*): `Promise`<`void`> + +*Defined in [source-destination/configured-source/operations/configure.ts:114](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L114)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| operation | `any` | +| disk | `Disk` | + +**Returns:** `Promise`<`void`> + +*Defined in [source-destination/configured-source/operations/copy.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/copy.ts#L39)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| operation | `any` | +| disk | `Disk` | + +**Returns:** `Promise`<`void`> + +___ + + +### `` executeOperation + +▸ **executeOperation**(operation: *[Operation](interfaces/operation.md)*, disk: *`Disk`*): `Promise`<`void`> + +*Defined in [source-destination/configured-source/configure.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L43)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| operation | [Operation](interfaces/operation.md) | +| disk | `Disk` | + +**Returns:** `Promise`<`void`> + +___ + + +### fstat + +▸ **fstat**(fd: *`number`*): `Promise`<`Stats`> + +*Defined in [fs.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L32)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fd | `number` | + +**Returns:** `Promise`<`Stats`> + +___ + + +### fsync + +▸ **fsync**(fd: *`number`*): `Promise`<`void`> + +*Defined in [fs.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L46)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fd | `number` | + +**Returns:** `Promise`<`void`> + +___ + + +### `` getDiskDeviceType + +▸ **getDiskDeviceType**(disk: *`Disk`*): `Promise`<`any`> + +*Defined in [source-destination/configured-source/configure.ts:68](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L68)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| disk | `Disk` | + +**Returns:** `Promise`<`any`> + +___ + + +### getEta + +▸ **getEta**(current: *`number`*, total: *`number`*, speed: *`number`*): `number` \| `undefined` + +*Defined in [multi-write.ts:72](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L72)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| current | `number` | +| total | `number` | +| speed | `number` | + +**Returns:** `number` \| `undefined` + +___ + + +### `` getFileStreamFromZipStream + +▸ **getFileStreamFromZipStream**(zipStream: *`ReadableStream`*, match: *`function`*): `Promise`<`ZipStreamEntry`> + +*Defined in [zip.ts:21](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/zip.ts#L21)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| zipStream | `ReadableStream` | +| match | `function` | + +**Returns:** `Promise`<`ZipStreamEntry`> + +___ + + +### `` getPartitionIndex + +▸ **getPartitionIndex**(partition: *`number` \| `object`*): `number` + +*Defined in [source-destination/configured-source/configure.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L50)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| partition | `number` \| `object` | + +**Returns:** `number` + +___ + + +### getRootStream + +▸ **getRootStream**(stream: *`ReadableStream`*): `ReadableStream` + +*Defined in [source-destination/compressed-source.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L33)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | + +**Returns:** `ReadableStream` + +___ + + +### isSourceTransform + +▸ **isSourceTransform**(stream: *`any`*): `boolean` + +*Defined in [source-destination/compressed-source.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L29)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `any` | + +**Returns:** `boolean` + +___ + + +### isTransientError + +▸ **isTransientError**(error: *`ErrnoException`*): `boolean` + +*Defined in [errors.ts:67](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L67)* + +*__summary__*: Determine whether an error is considered a transient occurrence, and the operation should be retried Errors considered potentially temporary are: + +* Mac OS: ENXIO, EBUSY +* Windows: ENOENT, UNKNOWN +* Linux: EIO, EBUSY + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| error | `ErrnoException` | + +**Returns:** `boolean` + +___ + + +### isntNull + +▸ **isntNull**(x: *`any`*): `boolean` + +*Defined in [source-destination/multi-destination.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L31)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| x | `any` | + +**Returns:** `boolean` + +___ + + +### looksLikeComputeModule + +▸ **looksLikeComputeModule**(description: *`string`*): `boolean` + +*Defined in [scanner/adapters/block-device.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L38)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| description | `string` | + +**Returns:** `boolean` + +___ + + +### makeClassEmitProgressEvents + +▸ **makeClassEmitProgressEvents**<`T`>(Cls: *`T`*, attribute: *`string`*, positionAttribute: *`string`*, interval: *`number`*): `(Anonymous class)` & `T` + +*Defined in [source-destination/progress.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L33)* + +**Type parameters:** + +#### T : [Constructor](#constructor)<`EventEmitter`> +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | `T` | +| attribute | `string` | +| positionAttribute | `string` | +| interval | `number` | + +**Returns:** `(Anonymous class)` & `T` + +___ + + +### matchSupportedExtensions + +▸ **matchSupportedExtensions**(filename: *`string`*): `boolean` + +*Defined in [source-destination/zip.ts:61](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L61)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| filename | `string` | + +**Returns:** `boolean` + +___ + + +### `` nmWifiConfig + +▸ **nmWifiConfig**(index: *`number`*, options: *[WifiConfig](interfaces/wificonfig.md)*): `string` + +*Defined in [source-destination/configured-source/operations/configure.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L41)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| index | `number` | +| options | [WifiConfig](interfaces/wificonfig.md) | + +**Returns:** `string` + +___ + + +### open + +▸ **open**(path: *`string` \| `Buffer`*, flags: *`string` \| `number`*, mode?: *`number`*): `Promise`<`number`> + +*Defined in [fs.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L58)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| path | `string` \| `Buffer` | - | +| flags | `string` \| `number` | - | +| `Default value` mode | `number` | 438 | + +**Returns:** `Promise`<`number`> + +___ + + +### `` pad + +▸ **pad**(num: *`number`*): `string` + +*Defined in [source-destination/configured-source/operations/configure.ts:110](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L110)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| num | `number` | + +**Returns:** `string` + +___ + + +### pipeRegularSourceToDestination + +▸ **pipeRegularSourceToDestination**(source: *[SourceDestination](classes/sourcedestination.md)*, sourceMetadata: *[Metadata](interfaces/metadata.md)*, destination: *[MultiDestination](classes/multidestination.md)*, verify: *`boolean`*, updateState: *`function`*, onFail: *`function`*, onProgress: *`function`*, _onRootStreamProgress: *`function`*): `Promise`<`void`> + +*Defined in [multi-write.ts:218](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L218)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](classes/sourcedestination.md) | +| sourceMetadata | [Metadata](interfaces/metadata.md) | +| destination | [MultiDestination](classes/multidestination.md) | +| verify | `boolean` | +| updateState | `function` | +| onFail | `function` | +| onProgress | `function` | +| _onRootStreamProgress | `function` | + +**Returns:** `Promise`<`void`> + +___ + + +### pipeSourceToDestinations + +▸ **pipeSourceToDestinations**(source: *[SourceDestination](classes/sourcedestination.md)*, destinations: *[SourceDestination](classes/sourcedestination.md)[]*, onFail: *[OnFailFunction](#onfailfunction)*, onProgress: *[OnProgressFunction](#onprogressfunction)*, verify?: *`boolean`*): `Promise`<[PipeSourceToDestinationsResult](interfaces/pipesourcetodestinationsresult.md)> + +*Defined in [multi-write.ts:82](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L82)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](classes/sourcedestination.md) | - | +| destinations | [SourceDestination](classes/sourcedestination.md)[] | - | +| onFail | [OnFailFunction](#onfailfunction) | - | +| onProgress | [OnProgressFunction](#onprogressfunction) | - | +| `Default value` verify | `boolean` | false | + +**Returns:** `Promise`<[PipeSourceToDestinationsResult](interfaces/pipesourcetodestinationsresult.md)> + +___ + + +### pipeSparseSourceToDestination + +▸ **pipeSparseSourceToDestination**(source: *[SourceDestination](classes/sourcedestination.md)*, destination: *[SourceDestination](classes/sourcedestination.md)*, verify: *`boolean`*, updateState: *`function`*, onFail: *`function`*, onProgress: *`function`*, _onRootStreamProgress: *`function`*): `Promise`<`void`> + +*Defined in [multi-write.ts:306](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L306)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](classes/sourcedestination.md) | +| destination | [SourceDestination](classes/sourcedestination.md) | +| verify | `boolean` | +| updateState | `function` | +| onFail | `function` | +| onProgress | `function` | +| _onRootStreamProgress | `function` | + +**Returns:** `Promise`<`void`> + +___ + + +### `` randomFilePath + +▸ **randomFilePath**(): `string` + +*Defined in [tmp.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L28)* + +**Returns:** `string` + +___ + + +### read + +▸ **read**(fd: *`number`*, buf: *`Buffer`*, offset: *`number`*, length: *`number`*, position: *`number`*): `Promise`<`ReadResult`> + +*Defined in [fs.ts:76](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L76)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fd | `number` | +| buf | `Buffer` | +| offset | `number` | +| length | `number` | +| position | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### readFile + +▸ **readFile**(path: *`string`*, options?: *`object` \| `undefined`*): `Promise`<`string` \| `Buffer`> + +*Defined in [fs.ts:103](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L103)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| path | `string` | - | +| `Default value` options | `object` \| `undefined` | {encoding: null,flag: 'r',} | + +**Returns:** `Promise`<`string` \| `Buffer`> + +___ + + +### require + +▸ **require**(moduleName: *`string`*): `any` + +*Defined in [scanner/adapters/usbboot.ts:17](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L17)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| moduleName | `string` | + +**Returns:** `any` + +___ + + +### `` runDiskpart + +▸ **runDiskpart**(commands: *`string`[]*): `Promise`<`void`> + +*Defined in [diskpart.ts:63](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L63)* + +**Parameters:** + +| Name | Type | Description | +| ------ | ------ | ------ | +| commands | `string`[] | list of commands to run | + +**Returns:** `Promise`<`void`> + +___ + + +### runVerifier + +▸ **runVerifier**(verifier: *[Verifier](classes/verifier.md)*, onFail: *`function`*, onProgress: *`function`*): `Promise`<`void`> + +*Defined in [multi-write.ts:338](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L338)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| verifier | [Verifier](classes/verifier.md) | +| onFail | `function` | +| onProgress | `function` | + +**Returns:** `Promise`<`void`> + +___ + + +### sparseStreamToBuffer + +▸ **sparseStreamToBuffer**(stream: *`ReadableStream`*): `Promise`<`Buffer`> + +*Defined in [utils.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/utils.ts#L36)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | + +**Returns:** `Promise`<`Buffer`> + +___ + + +### stat + +▸ **stat**(path: *`string` \| `Buffer`*): `Promise`<`Stats`> + +*Defined in [fs.ts:126](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L126)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| path | `string` \| `Buffer` | + +**Returns:** `Promise`<`Stats`> + +___ + + +### streamToBuffer + +▸ **streamToBuffer**(stream: *`ReadableStream`*): `Promise`<`Buffer`> + +*Defined in [utils.ts:19](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/utils.ts#L19)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | + +**Returns:** `Promise`<`Buffer`> + +___ + + +### `` tmpFile + +▸ **tmpFile**(keepOpen?: *`boolean`*): `Promise`<[TmpFileResult](interfaces/tmpfileresult.md)> + +*Defined in [tmp.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L37)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` keepOpen | `boolean` | true | + +**Returns:** `Promise`<[TmpFileResult](interfaces/tmpfileresult.md)> + +___ + + +### `` tmpFileDisposer + +▸ **tmpFileDisposer**(keepOpen?: *`boolean`*): `Disposer`<[TmpFileResult](interfaces/tmpfileresult.md)> + +*Defined in [tmp.ts:65](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L65)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` keepOpen | `boolean` | true | + +**Returns:** `Disposer`<[TmpFileResult](interfaces/tmpfileresult.md)> + +___ + + +### unlink + +▸ **unlink**(path: *`string` \| `Buffer`*): `Promise`<`void`> + +*Defined in [fs.ts:156](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L156)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| path | `string` \| `Buffer` | + +**Returns:** `Promise`<`void`> + +___ + + +### verifyOrGenerateChecksum + +▸ **verifyOrGenerateChecksum**(hasher: *[AnyHasher](#anyhasher) \| `undefined`*, blocks: *[BlocksWithChecksum](interfaces/blockswithchecksum.md)*, verify: *`boolean`*, generateChecksums: *`boolean`*): `void` + +*Defined in [sparse-stream/shared.ts:112](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L112)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| hasher | [AnyHasher](#anyhasher) \| `undefined` | +| blocks | [BlocksWithChecksum](interfaces/blockswithchecksum.md) | +| verify | `boolean` | +| generateChecksums | `boolean` | + +**Returns:** `void` + +___ + + +### write + +▸ **write**(fd: *`number`*, buf: *`Buffer`*, offset: *`number`*, length: *`number`*, position: *`number`*): `Promise`<`WriteResult`> + +*Defined in [fs.ts:168](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L168)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| fd | `number` | +| buf | `Buffer` | +| offset | `number` | +| length | `number` | +| position | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### writeFile + +▸ **writeFile**(path: *`string`*, data: *`string` \| `Buffer`*, options?: *`object`*): `Promise`<`void`> + +*Defined in [fs.ts:140](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/fs.ts#L140)* + +**Parameters:** + +**path: `string`** + +**data: `string` \| `Buffer`** + +**`Default value` options: `object`** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| encoding | `string` | "utf8" | +| flag | `string` | "w" | +| mode | `number` | 438 | + +**Returns:** `Promise`<`void`> + +___ + +## Object literals + + + +### `` ACTIONS + +**ACTIONS**: *`object`* + +*Defined in [source-destination/configured-source/configure.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L38)* + + + +#### configure + +**● configure**: *[execute]()* = configureAction + +*Defined in [source-destination/configured-source/configure.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L39)* + +___ + + +#### copy + +**● copy**: *[execute]()* = copyAction + +*Defined in [source-destination/configured-source/configure.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L40)* + +___ + +___ + diff --git a/doc/classes/adapter.md b/doc/classes/adapter.md new file mode 100644 index 00000000..a406daff --- /dev/null +++ b/doc/classes/adapter.md @@ -0,0 +1,370 @@ +[etcher-sdk](../README.md) > [Adapter](../classes/adapter.md) + +# Class: Adapter + +## Hierarchy + + `EventEmitter` + +**↳ Adapter** + +↳ [BlockDeviceAdapter](blockdeviceadapter.md) + +↳ [UsbbootDeviceAdapter](usbbootdeviceadapter.md) + +↳ [DriverlessDeviceAdapter$](driverlessdeviceadapter_.md) + +## Index + +### Properties + +* [defaultMaxListeners](adapter.md#defaultmaxlisteners) + +### Methods + +* [addListener](adapter.md#addlistener) +* [emit](adapter.md#emit) +* [eventNames](adapter.md#eventnames) +* [getMaxListeners](adapter.md#getmaxlisteners) +* [listenerCount](adapter.md#listenercount) +* [listeners](adapter.md#listeners) +* [on](adapter.md#on) +* [once](adapter.md#once) +* [prependListener](adapter.md#prependlistener) +* [prependOnceListener](adapter.md#prependoncelistener) +* [removeAllListeners](adapter.md#removealllisteners) +* [removeListener](adapter.md#removelistener) +* [setMaxListeners](adapter.md#setmaxlisteners) +* [start](adapter.md#start) +* [stop](adapter.md#stop) +* [listenerCount](adapter.md#listenercount-1) + +--- + +## Properties + + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` start + +▸ **start**(): `void` + +*Defined in [scanner/adapters/adapter.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L34)* + +**Returns:** `void` + +___ + + +### `` stop + +▸ **stop**(): `void` + +*Defined in [scanner/adapters/adapter.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L35)* + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/balenas3source.md b/doc/classes/balenas3source.md new file mode 100644 index 00000000..95ed193d --- /dev/null +++ b/doc/classes/balenas3source.md @@ -0,0 +1,899 @@ +[etcher-sdk](../README.md) > [BalenaS3Source](../classes/balenas3source.md) + +# Class: BalenaS3Source + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ BalenaS3Source** + +## Index + +### Constructors + +* [constructor](balenas3source.md#constructor) + +### Properties + +* [bucket](balenas3source.md#bucket) +* [deviceType](balenas3source.md#devicetype) +* [host](balenas3source.md#host) +* [name](balenas3source.md#name) +* [names](balenas3source.md#names) +* [rawSource](balenas3source.md#rawsource) +* [ready](balenas3source.md#ready) +* [version](balenas3source.md#version) +* [zipSource](balenas3source.md#zipsource) +* [defaultMaxListeners](balenas3source.md#defaultmaxlisteners) +* [imageExtensions](balenas3source.md#imageextensions) +* [mimetype](balenas3source.md#mimetype) + +### Methods + +* [_close](balenas3source.md#_close) +* [_getMetadata](balenas3source.md#_getmetadata) +* [_open](balenas3source.md#_open) +* [addListener](balenas3source.md#addlistener) +* [canCreateReadStream](balenas3source.md#cancreatereadstream) +* [canCreateSparseReadStream](balenas3source.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](balenas3source.md#cancreatesparsewritestream) +* [canCreateWriteStream](balenas3source.md#cancreatewritestream) +* [canRead](balenas3source.md#canread) +* [canWrite](balenas3source.md#canwrite) +* [close](balenas3source.md#close) +* [createReadStream](balenas3source.md#createreadstream) +* [createSparseReadStream](balenas3source.md#createsparsereadstream) +* [createSparseWriteStream](balenas3source.md#createsparsewritestream) +* [createVerifier](balenas3source.md#createverifier) +* [createWriteStream](balenas3source.md#createwritestream) +* [emit](balenas3source.md#emit) +* [eventNames](balenas3source.md#eventnames) +* [getBlocks](balenas3source.md#getblocks) +* [getInnerSource](balenas3source.md#getinnersource) +* [getMaxListeners](balenas3source.md#getmaxlisteners) +* [getMetadata](balenas3source.md#getmetadata) +* [getName](balenas3source.md#getname) +* [getPartitionTable](balenas3source.md#getpartitiontable) +* [getUrl](balenas3source.md#geturl) +* [listenerCount](balenas3source.md#listenercount) +* [listeners](balenas3source.md#listeners) +* [on](balenas3source.md#on) +* [once](balenas3source.md#once) +* [open](balenas3source.md#open) +* [prepare](balenas3source.md#prepare) +* [prependListener](balenas3source.md#prependlistener) +* [prependOnceListener](balenas3source.md#prependoncelistener) +* [read](balenas3source.md#read) +* [removeAllListeners](balenas3source.md#removealllisteners) +* [removeListener](balenas3source.md#removelistener) +* [setMaxListeners](balenas3source.md#setmaxlisteners) +* [write](balenas3source.md#write) +* [listenerCount](balenas3source.md#listenercount-1) +* [register](balenas3source.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new BalenaS3Source**(bucket: *`string`*, deviceType: *`string`*, version: *`string`*, host?: *`string`*): [BalenaS3Source](balenas3source.md) + +*Defined in [source-destination/balena-s3-source.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L32)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| bucket | `string` | - | +| deviceType | `string` | - | +| version | `string` | - | +| `Default value` host | `string` | "s3.amazonaws.com" | + +**Returns:** [BalenaS3Source](balenas3source.md) + +___ + +## Properties + + + +### bucket + +**● bucket**: *`string`* + +*Defined in [source-destination/balena-s3-source.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L35)* + +___ + + +### deviceType + +**● deviceType**: *`string`* + +*Defined in [source-destination/balena-s3-source.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L36)* + +___ + + +### host + +**● host**: *`string`* + +*Defined in [source-destination/balena-s3-source.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L38)* + +___ + + +### name + +**● name**: *[Name](../#name)* + +*Defined in [source-destination/balena-s3-source.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L32)* + +___ + + +### `` names + +**● names**: *[Name](../#name)[]* = ['balena', 'resin'] + +*Defined in [source-destination/balena-s3-source.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L31)* + +___ + + +### `` rawSource + +**● rawSource**: *[Http](http.md)* + +*Defined in [source-destination/balena-s3-source.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L28)* + +___ + + +### `` ready + +**● ready**: *`Promise`<`void`>* + +*Defined in [source-destination/balena-s3-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L30)* + +___ + + +### version + +**● version**: *`string`* + +*Defined in [source-destination/balena-s3-source.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L37)* + +___ + + +### `` zipSource + +**● zipSource**: *[ZipSource](zipsource.md)* + +*Defined in [source-destination/balena-s3-source.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L29)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/balena-s3-source.ts:117](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L117)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/balena-s3-source.ts:107](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L107)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/balena-s3-source.ts:112](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L112)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/balena-s3-source.ts:71](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L71)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/balena-s3-source.ts:75](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L75)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(...args: *`any`[]*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/balena-s3-source.ts:100](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L100)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Rest` args | `any`[] | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` getName + +▸ **getName**(): `Promise`<[Name](../#name)> + +*Defined in [source-destination/balena-s3-source.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L57)* + +**Returns:** `Promise`<[Name](../#name)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getUrl + +▸ **getUrl**(path: *`string`*): `string` + +*Defined in [source-destination/balena-s3-source.ts:79](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L79)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| path | `string` | + +**Returns:** `string` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` prepare + +▸ **prepare**(): `Promise`<`void`> + +*Defined in [source-destination/balena-s3-source.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L48)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/balena-s3-source.ts:85](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/balena-s3-source.ts#L85)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/blockdevice.md b/doc/classes/blockdevice.md new file mode 100644 index 00000000..c772ab2b --- /dev/null +++ b/doc/classes/blockdevice.md @@ -0,0 +1,1113 @@ +[etcher-sdk](../README.md) > [BlockDevice](../classes/blockdevice.md) + +# Class: BlockDevice + +## Hierarchy + +↳ [File](file.md) + +**↳ BlockDevice** + +## Implements + +* [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) + +## Index + +### Constructors + +* [constructor](blockdevice.md#constructor) + +### Properties + +* [blockSize](blockdevice.md#blocksize) +* [drive](blockdevice.md#drive) +* [emitsProgress](blockdevice.md#emitsprogress) +* [fd](blockdevice.md#fd) +* [unmountOnSuccess](blockdevice.md#unmountonsuccess) +* [OpenFlags](blockdevice.md#openflags) +* [defaultMaxListeners](blockdevice.md#defaultmaxlisteners) +* [imageExtensions](blockdevice.md#imageextensions) +* [mimetype](blockdevice.md#mimetype) + +### Accessors + +* [description](blockdevice.md#description) +* [device](blockdevice.md#device) +* [devicePath](blockdevice.md#devicepath) +* [isSystem](blockdevice.md#issystem) +* [mountpoints](blockdevice.md#mountpoints) +* [raw](blockdevice.md#raw) +* [size](blockdevice.md#size) + +### Methods + +* [_close](blockdevice.md#_close) +* [_getMetadata](blockdevice.md#_getmetadata) +* [_open](blockdevice.md#_open) +* [addListener](blockdevice.md#addlistener) +* [alignOffsetAfter](blockdevice.md#alignoffsetafter) +* [alignOffsetBefore](blockdevice.md#alignoffsetbefore) +* [alignedRead](blockdevice.md#alignedread) +* [alignedWrite](blockdevice.md#alignedwrite) +* [canCreateReadStream](blockdevice.md#cancreatereadstream) +* [canCreateSparseReadStream](blockdevice.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](blockdevice.md#cancreatesparsewritestream) +* [canCreateWriteStream](blockdevice.md#cancreatewritestream) +* [canRead](blockdevice.md#canread) +* [canWrite](blockdevice.md#canwrite) +* [close](blockdevice.md#close) +* [createReadStream](blockdevice.md#createreadstream) +* [createSparseReadStream](blockdevice.md#createsparsereadstream) +* [createSparseWriteStream](blockdevice.md#createsparsewritestream) +* [createVerifier](blockdevice.md#createverifier) +* [createWriteStream](blockdevice.md#createwritestream) +* [emit](blockdevice.md#emit) +* [eventNames](blockdevice.md#eventnames) +* [getBlocks](blockdevice.md#getblocks) +* [getInnerSource](blockdevice.md#getinnersource) +* [getMaxListeners](blockdevice.md#getmaxlisteners) +* [getMetadata](blockdevice.md#getmetadata) +* [getPartitionTable](blockdevice.md#getpartitiontable) +* [listenerCount](blockdevice.md#listenercount) +* [listeners](blockdevice.md#listeners) +* [offsetIsAligned](blockdevice.md#offsetisaligned) +* [on](blockdevice.md#on) +* [once](blockdevice.md#once) +* [open](blockdevice.md#open) +* [prependListener](blockdevice.md#prependlistener) +* [prependOnceListener](blockdevice.md#prependoncelistener) +* [read](blockdevice.md#read) +* [removeAllListeners](blockdevice.md#removealllisteners) +* [removeListener](blockdevice.md#removelistener) +* [setMaxListeners](blockdevice.md#setmaxlisteners) +* [write](blockdevice.md#write) +* [listenerCount](blockdevice.md#listenercount-1) +* [register](blockdevice.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlockDevice**(drive: *[DrivelistDrive](../interfaces/drivelistdrive.md)*, unmountOnSuccess?: *`boolean`*): [BlockDevice](blockdevice.md) + +*Overrides [File](file.md).[constructor](file.md#constructor)* + +*Defined in [source-destination/block-device.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L48)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| drive | [DrivelistDrive](../interfaces/drivelistdrive.md) | - | +| `Default value` unmountOnSuccess | `boolean` | false | + +**Returns:** [BlockDevice](blockdevice.md) + +___ + +## Properties + + + +### blockSize + +**● blockSize**: *`number`* = 512 + +*Inherited from [File](file.md).[blockSize](file.md#blocksize)* + +*Defined in [source-destination/file.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L58)* + +___ + + +### `` drive + +**● drive**: *[DrivelistDrive](../interfaces/drivelistdrive.md)* + +*Defined in [source-destination/block-device.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L50)* + +___ + + +### emitsProgress + +**● emitsProgress**: *`boolean`* = false + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emitsProgress](../interfaces/adaptersourcedestination.md#emitsprogress)* + +*Defined in [source-destination/block-device.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L48)* + +___ + + +### `` fd + +**● fd**: *`number`* + +*Inherited from [File](file.md).[fd](file.md#fd)* + +*Defined in [source-destination/file.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L57)* + +___ + + +### `` unmountOnSuccess + +**● unmountOnSuccess**: *`boolean`* + +*Defined in [source-destination/block-device.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L50)* + +___ + + +### `` OpenFlags + +**● OpenFlags**: *[OpenFlags](../enums/openflags.md)* = OpenFlags + +*Inherited from [File](file.md).[OpenFlags](file.md#openflags)* + +*Defined in [source-destination/file.ts:56](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L56)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[defaultMaxListeners](../interfaces/adaptersourcedestination.md#defaultmaxlisteners)* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[imageExtensions](../interfaces/adaptersourcedestination.md#imageextensions)* + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[mimetype](../interfaces/adaptersourcedestination.md#mimetype)* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Accessors + + + +### description + +**get description**(): `string` + +*Defined in [source-destination/block-device.ts:71](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L71)* + +**Returns:** `string` + +___ + + +### device + +**get device**(): `string` + +*Defined in [source-destination/block-device.ts:63](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L63)* + +**Returns:** `string` + +___ + + +### devicePath + +**get devicePath**(): `string` \| `null` + +*Defined in [source-destination/block-device.ts:67](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L67)* + +**Returns:** `string` \| `null` + +___ + + +### isSystem + +**get isSystem**(): `boolean` + +*Defined in [source-destination/block-device.ts:55](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L55)* + +**Returns:** `boolean` + +___ + + +### mountpoints + +**get mountpoints**(): `Array`<`object`> + +*Defined in [source-destination/block-device.ts:75](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L75)* + +**Returns:** `Array`<`object`> + +___ + + +### raw + +**get raw**(): `string` + +*Defined in [source-destination/block-device.ts:59](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L59)* + +**Returns:** `string` + +___ + + +### size + +**get size**(): `number` \| `null` + +*Defined in [source-destination/block-device.ts:79](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L79)* + +**Returns:** `number` \| `null` + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_close](../interfaces/adaptersourcedestination.md#_close)* + +*Overrides [File](file.md).[_close](file.md#_close)* + +*Defined in [source-destination/block-device.ts:127](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L127)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_getMetadata](../interfaces/adaptersourcedestination.md#_getmetadata)* + +*Overrides [File](file.md).[_getMetadata](file.md#_getmetadata)* + +*Defined in [source-destination/block-device.ts:83](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L83)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_open](../interfaces/adaptersourcedestination.md#_open)* + +*Overrides [File](file.md).[_open](file.md#_open)* + +*Defined in [source-destination/block-device.ts:119](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L119)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[addListener](../interfaces/adaptersourcedestination.md#addlistener)* + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` alignOffsetAfter + +▸ **alignOffsetAfter**(offset: *`number`*): `number` + +*Defined in [source-destination/block-device.ts:147](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L147)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| offset | `number` | + +**Returns:** `number` + +___ + + +### `` alignOffsetBefore + +▸ **alignOffsetBefore**(offset: *`number`*): `number` + +*Defined in [source-destination/block-device.ts:143](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L143)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| offset | `number` | + +**Returns:** `number` + +___ + + +### `` alignedRead + +▸ **alignedRead**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Defined in [source-destination/block-device.ts:151](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L151)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### `` alignedWrite + +▸ **alignedWrite**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Defined in [source-destination/block-device.ts:187](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L187)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateReadStream](../interfaces/adaptersourcedestination.md#cancreatereadstream)* + +*Inherited from [File](file.md).[canCreateReadStream](file.md#cancreatereadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/file.ts:87](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L87)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseReadStream](../interfaces/adaptersourcedestination.md#cancreatesparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseWriteStream](../interfaces/adaptersourcedestination.md#cancreatesparsewritestream)* + +*Overrides [File](file.md).[canCreateSparseWriteStream](file.md#cancreatesparsewritestream)* + +*Defined in [source-destination/block-device.ts:97](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L97)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateWriteStream](../interfaces/adaptersourcedestination.md#cancreatewritestream)* + +*Overrides [File](file.md).[canCreateWriteStream](file.md#cancreatewritestream)* + +*Defined in [source-destination/block-device.ts:93](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L93)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canRead](../interfaces/adaptersourcedestination.md#canread)* + +*Inherited from [File](file.md).[canRead](file.md#canread)* + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/file.ts:79](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L79)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canWrite](../interfaces/adaptersourcedestination.md#canwrite)* + +*Overrides [File](file.md).[canWrite](file.md#canwrite)* + +*Defined in [source-destination/block-device.ts:89](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L89)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[close](../interfaces/adaptersourcedestination.md#close)* + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createReadStream](../interfaces/adaptersourcedestination.md#createreadstream)* + +*Inherited from [File](file.md).[createReadStream](file.md#createreadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/file.ts:124](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L124)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseReadStream](../interfaces/adaptersourcedestination.md#createsparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWriteStream](sparsewritestream.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseWriteStream](../interfaces/adaptersourcedestination.md#createsparsewritestream)* + +*Overrides [File](file.md).[createSparseWriteStream](file.md#createsparsewritestream)* + +*Defined in [source-destination/block-device.ts:110](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L110)* + +**Returns:** `Promise`<[SparseWriteStream](sparsewritestream.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createVerifier](../interfaces/adaptersourcedestination.md#createverifier)* + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<[BlockWriteStream](blockwritestream.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createWriteStream](../interfaces/adaptersourcedestination.md#createwritestream)* + +*Overrides [File](file.md).[createWriteStream](file.md#createwritestream)* + +*Defined in [source-destination/block-device.ts:101](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L101)* + +**Returns:** `Promise`<[BlockWriteStream](blockwritestream.md)> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emit](../interfaces/adaptersourcedestination.md#emit)* + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[eventNames](../interfaces/adaptersourcedestination.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getBlocks](../interfaces/adaptersourcedestination.md#getblocks)* + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getInnerSource](../interfaces/adaptersourcedestination.md#getinnersource)* + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMaxListeners](../interfaces/adaptersourcedestination.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMetadata](../interfaces/adaptersourcedestination.md#getmetadata)* + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getPartitionTable](../interfaces/adaptersourcedestination.md#getpartitiontable)* + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listeners](../interfaces/adaptersourcedestination.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### `` offsetIsAligned + +▸ **offsetIsAligned**(offset: *`number`*): `boolean` + +*Defined in [source-destination/block-device.ts:139](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L139)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| offset | `number` | + +**Returns:** `boolean` + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[on](../interfaces/adaptersourcedestination.md#on)* + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[once](../interfaces/adaptersourcedestination.md#once)* + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[open](../interfaces/adaptersourcedestination.md#open)* + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependListener](../interfaces/adaptersourcedestination.md#prependlistener)* + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependOnceListener](../interfaces/adaptersourcedestination.md#prependoncelistener)* + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[read](../interfaces/adaptersourcedestination.md#read)* + +*Overrides [File](file.md).[read](file.md#read)* + +*Defined in [source-destination/block-device.ts:171](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L171)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeAllListeners](../interfaces/adaptersourcedestination.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeListener](../interfaces/adaptersourcedestination.md#removelistener)* + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[setMaxListeners](../interfaces/adaptersourcedestination.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[write](../interfaces/adaptersourcedestination.md#write)* + +*Overrides [File](file.md).[write](file.md#write)* + +*Defined in [source-destination/block-device.ts:203](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/block-device.ts#L203)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount-1)* + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[register](../interfaces/adaptersourcedestination.md#register)* + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/blockdeviceadapter.md b/doc/classes/blockdeviceadapter.md new file mode 100644 index 00000000..5c46344a --- /dev/null +++ b/doc/classes/blockdeviceadapter.md @@ -0,0 +1,473 @@ +[etcher-sdk](../README.md) > [BlockDeviceAdapter](../classes/blockdeviceadapter.md) + +# Class: BlockDeviceAdapter + +## Hierarchy + +↳ [Adapter](adapter.md) + +**↳ BlockDeviceAdapter** + +## Index + +### Constructors + +* [constructor](blockdeviceadapter.md#constructor) + +### Properties + +* [drives](blockdeviceadapter.md#drives) +* [includeSystemDrives](blockdeviceadapter.md#includesystemdrives) +* [ready](blockdeviceadapter.md#ready) +* [running](blockdeviceadapter.md#running) +* [defaultMaxListeners](blockdeviceadapter.md#defaultmaxlisteners) + +### Methods + +* [addListener](blockdeviceadapter.md#addlistener) +* [emit](blockdeviceadapter.md#emit) +* [eventNames](blockdeviceadapter.md#eventnames) +* [getMaxListeners](blockdeviceadapter.md#getmaxlisteners) +* [listDrives](blockdeviceadapter.md#listdrives) +* [listenerCount](blockdeviceadapter.md#listenercount) +* [listeners](blockdeviceadapter.md#listeners) +* [on](blockdeviceadapter.md#on) +* [once](blockdeviceadapter.md#once) +* [prependListener](blockdeviceadapter.md#prependlistener) +* [prependOnceListener](blockdeviceadapter.md#prependoncelistener) +* [removeAllListeners](blockdeviceadapter.md#removealllisteners) +* [removeListener](blockdeviceadapter.md#removelistener) +* [scan](blockdeviceadapter.md#scan) +* [scanLoop](blockdeviceadapter.md#scanloop) +* [setMaxListeners](blockdeviceadapter.md#setmaxlisteners) +* [start](blockdeviceadapter.md#start) +* [stop](blockdeviceadapter.md#stop) +* [listenerCount](blockdeviceadapter.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlockDeviceAdapter**(includeSystemDrives?: *`function`*): [BlockDeviceAdapter](blockdeviceadapter.md) + +*Defined in [scanner/adapters/block-device.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L60)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` includeSystemDrives | `function` | () => false | + +**Returns:** [BlockDeviceAdapter](blockdeviceadapter.md) + +___ + +## Properties + + + +### `` drives + +**● drives**: *`Map`<`string`, [BlockDevice](blockdevice.md)>* = new Map() + +*Defined in [scanner/adapters/block-device.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L58)* + +___ + + +### includeSystemDrives + +**● includeSystemDrives**: *`function`* + +*Defined in [scanner/adapters/block-device.ts:62](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L62)* + +#### Type declaration +▸(): `boolean` + +**Returns:** `boolean` + +___ + + +### `` ready + +**● ready**: *`boolean`* = false + +*Defined in [scanner/adapters/block-device.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L60)* + +___ + + +### `` running + +**● running**: *`boolean`* = false + +*Defined in [scanner/adapters/block-device.ts:59](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L59)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` listDrives + +▸ **listDrives**(): `Promise`<`Map`<`string`, [DrivelistDrive](../interfaces/drivelistdrive.md)>> + +*Defined in [scanner/adapters/block-device.ts:107](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L107)* + +**Returns:** `Promise`<`Map`<`string`, [DrivelistDrive](../interfaces/drivelistdrive.md)>> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` scan + +▸ **scan**(): `Promise`<`void`> + +*Defined in [scanner/adapters/block-device.ts:88](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L88)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` scanLoop + +▸ **scanLoop**(): `Promise`<`void`> + +*Defined in [scanner/adapters/block-device.ts:77](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L77)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### start + +▸ **start**(): `void` + +*Overrides [Adapter](adapter.md).[start](adapter.md#start)* + +*Defined in [scanner/adapters/block-device.ts:66](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L66)* + +**Returns:** `void` + +___ + + +### stop + +▸ **stop**(): `void` + +*Overrides [Adapter](adapter.md).[stop](adapter.md#stop)* + +*Defined in [scanner/adapters/block-device.ts:71](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L71)* + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/blockreadstream.md b/doc/classes/blockreadstream.md new file mode 100644 index 00000000..8bd06bd0 --- /dev/null +++ b/doc/classes/blockreadstream.md @@ -0,0 +1,1272 @@ +[etcher-sdk](../README.md) > [BlockReadStream](../classes/blockreadstream.md) + +# Class: BlockReadStream + +## Hierarchy + + `Readable` + +**↳ BlockReadStream** + +## Implements + +* `ReadableStream` + +## Index + +### Constructors + +* [constructor](blockreadstream.md#constructor) + +### Properties + +* [bytesRead](blockreadstream.md#bytesread) +* [chunkSize](blockreadstream.md#chunksize) +* [end](blockreadstream.md#end) +* [maxRetries](blockreadstream.md#maxretries) +* [readable](blockreadstream.md#readable) +* [source](blockreadstream.md#source) +* [defaultMaxListeners](blockreadstream.md#defaultmaxlisteners) + +### Methods + +* [__read](blockreadstream.md#__read) +* [_read](blockreadstream.md#_read) +* [addListener](blockreadstream.md#addlistener) +* [emit](blockreadstream.md#emit) +* [eventNames](blockreadstream.md#eventnames) +* [getMaxListeners](blockreadstream.md#getmaxlisteners) +* [isPaused](blockreadstream.md#ispaused) +* [listenerCount](blockreadstream.md#listenercount) +* [listeners](blockreadstream.md#listeners) +* [on](blockreadstream.md#on) +* [once](blockreadstream.md#once) +* [pause](blockreadstream.md#pause) +* [pipe](blockreadstream.md#pipe) +* [prependListener](blockreadstream.md#prependlistener) +* [prependOnceListener](blockreadstream.md#prependoncelistener) +* [push](blockreadstream.md#push) +* [read](blockreadstream.md#read) +* [removeAllListeners](blockreadstream.md#removealllisteners) +* [removeListener](blockreadstream.md#removelistener) +* [resume](blockreadstream.md#resume) +* [setEncoding](blockreadstream.md#setencoding) +* [setMaxListeners](blockreadstream.md#setmaxlisteners) +* [tryRead](blockreadstream.md#tryread) +* [unpipe](blockreadstream.md#unpipe) +* [unshift](blockreadstream.md#unshift) +* [wrap](blockreadstream.md#wrap) +* [listenerCount](blockreadstream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlockReadStream**(source: *[File](file.md)*, bytesRead?: *`number`*, end?: *`number`*, chunkSize?: *`number`*, maxRetries?: *`number`*): [BlockReadStream](blockreadstream.md) + +*Overrides Readable.__constructor* + +*Defined in [block-read-stream.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L31)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [File](file.md) | - | +| `Default value` bytesRead | `number` | 0 | +| `Default value` end | `number` | Infinity | +| `Default value` chunkSize | `number` | CHUNK_SIZE | +| `Default value` maxRetries | `number` | 5 | + +**Returns:** [BlockReadStream](blockreadstream.md) + +___ + +## Properties + + + +### `` bytesRead + +**● bytesRead**: *`number`* + +*Defined in [block-read-stream.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L35)* + +___ + + +### `` chunkSize + +**● chunkSize**: *`number`* + +*Defined in [block-read-stream.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L31)* + +___ + + +### `` end + +**● end**: *`number`* + +*Defined in [block-read-stream.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L36)* + +___ + + +### `` maxRetries + +**● maxRetries**: *`number`* + +*Defined in [block-read-stream.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L38)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### `` source + +**● source**: *[File](file.md)* + +*Defined in [block-read-stream.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L34)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### `` __read + +▸ **__read**(): `Promise`<`void`> + +*Defined in [block-read-stream.ts:68](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L68)* + +**Returns:** `Promise`<`void`> + +___ + + +### _read + +▸ **_read**(): `void` + +*Overrides Readable._read* + +*Defined in [block-read-stream.ts:93](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L93)* + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` tryRead + +▸ **tryRead**(buffer: *`Buffer`*): `Promise`<`ReadResult`> + +*Defined in [block-read-stream.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-read-stream.ts#L47)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/blocksverificationerror.md b/doc/classes/blocksverificationerror.md new file mode 100644 index 00000000..1ea9c45f --- /dev/null +++ b/doc/classes/blocksverificationerror.md @@ -0,0 +1,115 @@ +[etcher-sdk](../README.md) > [BlocksVerificationError](../classes/blocksverificationerror.md) + +# Class: BlocksVerificationError + +## Hierarchy + +↳ [VerificationError](verificationerror.md) + +**↳ BlocksVerificationError** + +## Index + +### Constructors + +* [constructor](blocksverificationerror.md#constructor) + +### Properties + +* [blocks](blocksverificationerror.md#blocks) +* [checksum](blocksverificationerror.md#checksum) +* [code](blocksverificationerror.md#code) +* [message](blocksverificationerror.md#message) +* [name](blocksverificationerror.md#name) +* [stack](blocksverificationerror.md#stack) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlocksVerificationError**(blocks: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)*, checksum: *`string`*): [BlocksVerificationError](blocksverificationerror.md) + +*Defined in [errors.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L50)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blocks | [BlocksWithChecksum](../interfaces/blockswithchecksum.md) | +| checksum | `string` | + +**Returns:** [BlocksVerificationError](blocksverificationerror.md) + +___ + +## Properties + + + +### blocks + +**● blocks**: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)* + +*Defined in [errors.ts:52](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L52)* + +___ + + +### checksum + +**● checksum**: *`string`* + +*Defined in [errors.ts:53](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L53)* + +___ + + +### code + +**● code**: *`string`* = "EVALIDATION" + +*Inherited from [VerificationError](verificationerror.md).[code](verificationerror.md#code)* + +*Defined in [errors.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L24)* + +___ + + +### message + +**● message**: *`string`* + +*Inherited from Error.message* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964* + +___ + + +### name + +**● name**: *`string`* + +*Inherited from Error.name* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:963* + +___ + + +### `` stack + +**● stack**: *`undefined` \| `string`* + +*Inherited from Error.stack* + +*Overrides Error.stack* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965* + +___ + diff --git a/doc/classes/blocktransformstream.md b/doc/classes/blocktransformstream.md new file mode 100644 index 00000000..206fe8f0 --- /dev/null +++ b/doc/classes/blocktransformstream.md @@ -0,0 +1,1445 @@ +[etcher-sdk](../README.md) > [BlockTransformStream](../classes/blocktransformstream.md) + +# Class: BlockTransformStream + +## Hierarchy + + `Transform` + +**↳ BlockTransformStream** + +## Implements + +* `ReadableStream` +* `Writable` + +## Index + +### Constructors + +* [constructor](blocktransformstream.md#constructor) + +### Properties + +* [_buffers](blocktransformstream.md#_buffers) +* [_bytes](blocktransformstream.md#_bytes) +* [bytesRead](blocktransformstream.md#bytesread) +* [bytesWritten](blocktransformstream.md#byteswritten) +* [chunkSize](blocktransformstream.md#chunksize) +* [readable](blocktransformstream.md#readable) +* [writable](blocktransformstream.md#writable) +* [defaultMaxListeners](blocktransformstream.md#defaultmaxlisteners) + +### Methods + +* [_flush](blocktransformstream.md#_flush) +* [_read](blocktransformstream.md#_read) +* [_transform](blocktransformstream.md#_transform) +* [_write](blocktransformstream.md#_write) +* [addListener](blocktransformstream.md#addlistener) +* [emit](blocktransformstream.md#emit) +* [end](blocktransformstream.md#end) +* [eventNames](blocktransformstream.md#eventnames) +* [getMaxListeners](blocktransformstream.md#getmaxlisteners) +* [isPaused](blocktransformstream.md#ispaused) +* [listenerCount](blocktransformstream.md#listenercount) +* [listeners](blocktransformstream.md#listeners) +* [on](blocktransformstream.md#on) +* [once](blocktransformstream.md#once) +* [pause](blocktransformstream.md#pause) +* [pipe](blocktransformstream.md#pipe) +* [prependListener](blocktransformstream.md#prependlistener) +* [prependOnceListener](blocktransformstream.md#prependoncelistener) +* [push](blocktransformstream.md#push) +* [read](blocktransformstream.md#read) +* [removeAllListeners](blocktransformstream.md#removealllisteners) +* [removeListener](blocktransformstream.md#removelistener) +* [resume](blocktransformstream.md#resume) +* [setDefaultEncoding](blocktransformstream.md#setdefaultencoding) +* [setEncoding](blocktransformstream.md#setencoding) +* [setMaxListeners](blocktransformstream.md#setmaxlisteners) +* [unpipe](blocktransformstream.md#unpipe) +* [unshift](blocktransformstream.md#unshift) +* [wrap](blocktransformstream.md#wrap) +* [write](blocktransformstream.md#write) +* [writeBuffers](blocktransformstream.md#writebuffers) +* [listenerCount](blocktransformstream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlockTransformStream**(chunkSize: *`number`*): [BlockTransformStream](blocktransformstream.md) + +*Overrides Transform.__constructor* + +*Defined in [block-transform-stream.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L23)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunkSize | `number` | + +**Returns:** [BlockTransformStream](blocktransformstream.md) + +___ + +## Properties + + + +### `` _buffers + +**● _buffers**: *`Buffer`[]* = [] + +*Defined in [block-transform-stream.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L22)* + +___ + + +### `` _bytes + +**● _bytes**: *`number`* = 0 + +*Defined in [block-transform-stream.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L23)* + +___ + + +### bytesRead + +**● bytesRead**: *`number`* = 0 + +*Defined in [block-transform-stream.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L20)* + +___ + + +### bytesWritten + +**● bytesWritten**: *`number`* = 0 + +*Defined in [block-transform-stream.ts:21](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L21)* + +___ + + +### `` chunkSize + +**● chunkSize**: *`number`* + +*Defined in [block-transform-stream.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L25)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Duplex.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3885* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _flush + +▸ **_flush**(callback: *`function`*): `void` + +*Defined in [block-transform-stream.ts:71](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L71)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _read + +▸ **_read**(size: *`number`*): `void` + +*Inherited from Readable._read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| size | `number` | + +**Returns:** `void` + +___ + + +### _transform + +▸ **_transform**(chunk: *`Buffer`*, _encoding: *`string`*, callback: *`function`*): `void` + +*Overrides Transform._transform* + +*Defined in [block-transform-stream.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L50)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `Buffer` | +| _encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Duplex._write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3887* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3891* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3892* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3893* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Duplex.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3890* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3888* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3889* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` writeBuffers + +▸ **writeBuffers**(flush?: *`boolean`*): `void` + +*Defined in [block-transform-stream.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-transform-stream.ts#L29)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` flush | `boolean` | false | + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/blockwritestream.md b/doc/classes/blockwritestream.md new file mode 100644 index 00000000..0e102d14 --- /dev/null +++ b/doc/classes/blockwritestream.md @@ -0,0 +1,1431 @@ +[etcher-sdk](../README.md) > [BlockWriteStream](../classes/blockwritestream.md) + +# Class: BlockWriteStream + +## Hierarchy + + `Writable` + +**↳ BlockWriteStream** + +## Implements + +* `WritableStream` + +## Index + +### Constructors + +* [constructor](blockwritestream.md#constructor) + +### Properties + +* [_buffers](blockwritestream.md#_buffers) +* [_bytes](blockwritestream.md#_bytes) +* [_firstBuffers](blockwritestream.md#_firstbuffers) +* [bytesWritten](blockwritestream.md#byteswritten) +* [destination](blockwritestream.md#destination) +* [firstBytesToKeep](blockwritestream.md#firstbytestokeep) +* [maxRetries](blockwritestream.md#maxretries) +* [writable](blockwritestream.md#writable) +* [defaultMaxListeners](blockwritestream.md#defaultmaxlisteners) + +### Methods + +* [__final](blockwritestream.md#__final) +* [__write](blockwritestream.md#__write) +* [_final](blockwritestream.md#_final) +* [_write](blockwritestream.md#_write) +* [addListener](blockwritestream.md#addlistener) +* [destroy](blockwritestream.md#destroy) +* [emit](blockwritestream.md#emit) +* [end](blockwritestream.md#end) +* [eventNames](blockwritestream.md#eventnames) +* [getMaxListeners](blockwritestream.md#getmaxlisteners) +* [listenerCount](blockwritestream.md#listenercount) +* [listeners](blockwritestream.md#listeners) +* [on](blockwritestream.md#on) +* [once](blockwritestream.md#once) +* [pipe](blockwritestream.md#pipe) +* [prependListener](blockwritestream.md#prependlistener) +* [prependOnceListener](blockwritestream.md#prependoncelistener) +* [removeAllListeners](blockwritestream.md#removealllisteners) +* [removeListener](blockwritestream.md#removelistener) +* [setDefaultEncoding](blockwritestream.md#setdefaultencoding) +* [setMaxListeners](blockwritestream.md#setmaxlisteners) +* [write](blockwritestream.md#write) +* [writeBuffers](blockwritestream.md#writebuffers) +* [writeChunk](blockwritestream.md#writechunk) +* [listenerCount](blockwritestream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new BlockWriteStream**(destination: *[BlockDevice](blockdevice.md)*, firstBytesToKeep?: *`number`*, maxRetries?: *`number`*): [BlockWriteStream](blockwritestream.md) + +*Overrides Writable.__constructor* + +*Defined in [block-write-stream.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L37)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| destination | [BlockDevice](blockdevice.md) | - | +| `Default value` firstBytesToKeep | `number` | 0 | +| `Default value` maxRetries | `number` | 5 | + +**Returns:** [BlockWriteStream](blockwritestream.md) + +___ + +## Properties + + + +### `` _buffers + +**● _buffers**: *`Buffer`[]* = [] + +*Defined in [block-write-stream.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L36)* + +___ + + +### `` _bytes + +**● _bytes**: *`number`* = 0 + +*Defined in [block-write-stream.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L37)* + +___ + + +### `` _firstBuffers + +**● _firstBuffers**: *`Buffer`[]* = [] + +*Defined in [block-write-stream.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L35)* + +___ + + +### bytesWritten + +**● bytesWritten**: *`number`* = 0 + +*Defined in [block-write-stream.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L34)* + +___ + + +### `` destination + +**● destination**: *[BlockDevice](blockdevice.md)* + +*Defined in [block-write-stream.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L40)* + +___ + + +### firstBytesToKeep + +**● firstBytesToKeep**: *`number`* + +*Defined in [block-write-stream.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L41)* + +___ + + +### `` maxRetries + +**● maxRetries**: *`number`* + +*Defined in [block-write-stream.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L42)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Writable.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3800* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### `` __final + +▸ **__final**(): `Promise`<`void`> + +*Defined in [block-write-stream.ts:141](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L141)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` __write + +▸ **__write**(buffer: *`Buffer`*): `Promise`<`void`> + +*Defined in [block-write-stream.ts:102](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L102)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | + +**Returns:** `Promise`<`void`> + +___ + + +### _final + +▸ **_final**(callback: *`function`*): `void` + +*Defined in [block-write-stream.ts:165](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L165)* + +*__summary__*: Write buffered data before a stream ends, called by stream internals + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(buffer: *`Buffer`*, _encoding: *`string`*, callback: *`function`*): `void` + +*Overrides Writable._write* + +*Defined in [block-write-stream.ts:133](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L133)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| _encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3820* + +Event emitter The defined events on documents including: + +1. close +2. drain +3. error +4. finish +5. pipe +6. unpipe + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3821* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3822* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3823* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3824* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3825* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3826* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### destroy + +▸ **destroy**(error?: *[Error](notcapable.md#error)*): `this` + +*Inherited from Writable.destroy* + +*Defined in [/home/alexis/dev/resin.io/etcher-sdk-2/typings/readable-stream/index.d.ts:18](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/typings/readable-stream/index.d.ts#L18)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` error | [Error](notcapable.md#error) | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"drain"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +▸ **emit**(event: *"finish"*): `boolean` + +▸ **emit**(event: *"pipe"*, src: *`Readable`*): `boolean` + +▸ **emit**(event: *"unpipe"*, src: *`Readable`*): `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3828* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3829* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3830* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3831* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3832* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3833* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| src | `Readable` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3834* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| src | `Readable` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3806* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3807* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3808* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"drain"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +▸ **on**(event: *"finish"*, listener: *`function`*): `this` + +▸ **on**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **on**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3836* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3837* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3838* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3839* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3840* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3841* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3842* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"drain"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +▸ **once**(event: *"finish"*, listener: *`function`*): `this` + +▸ **once**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **once**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3844* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3845* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3846* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3847* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3848* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3849* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3850* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3703* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3852* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3853* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3854* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3855* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3856* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3857* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3858* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3860* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3861* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3862* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3863* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3864* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3865* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3866* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3868* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3869* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3870* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3871* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3872* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3873* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3874* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Writable.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3805* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3803* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3804* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` writeBuffers + +▸ **writeBuffers**(): `Promise`<`void`> + +*Defined in [block-write-stream.ts:82](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L82)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` writeChunk + +▸ **writeChunk**(buffer: *`Buffer`*, position: *`number`*, flushing?: *`boolean`*): `Promise`<`void`> + +*Defined in [block-write-stream.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/block-write-stream.ts#L50)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| buffer | `Buffer` | - | +| position | `number` | - | +| `Default value` flushing | `boolean` | false | + +**Returns:** `Promise`<`void`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/bzip2source.md b/doc/classes/bzip2source.md new file mode 100644 index 00000000..bbd378e5 --- /dev/null +++ b/doc/classes/bzip2source.md @@ -0,0 +1,842 @@ +[etcher-sdk](../README.md) > [BZip2Source](../classes/bzip2source.md) + +# Class: BZip2Source + +## Hierarchy + +↳ [CompressedSource](compressedsource.md) + +**↳ BZip2Source** + +## Index + +### Constructors + +* [constructor](bzip2source.md#constructor) + +### Properties + +* [isSizeEstimated](bzip2source.md#issizeestimated) +* [source](bzip2source.md#source) +* [defaultMaxListeners](bzip2source.md#defaultmaxlisteners) +* [imageExtensions](bzip2source.md#imageextensions) +* [mimetype](bzip2source.md#mimetype) +* [requiresRandomReadableSource](bzip2source.md#requiresrandomreadablesource) + +### Methods + +* [_close](bzip2source.md#_close) +* [_getMetadata](bzip2source.md#_getmetadata) +* [_open](bzip2source.md#_open) +* [addListener](bzip2source.md#addlistener) +* [canCreateReadStream](bzip2source.md#cancreatereadstream) +* [canCreateSparseReadStream](bzip2source.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](bzip2source.md#cancreatesparsewritestream) +* [canCreateWriteStream](bzip2source.md#cancreatewritestream) +* [canRead](bzip2source.md#canread) +* [canWrite](bzip2source.md#canwrite) +* [close](bzip2source.md#close) +* [createReadStream](bzip2source.md#createreadstream) +* [createSparseReadStream](bzip2source.md#createsparsereadstream) +* [createSparseWriteStream](bzip2source.md#createsparsewritestream) +* [createTransform](bzip2source.md#createtransform) +* [createVerifier](bzip2source.md#createverifier) +* [createWriteStream](bzip2source.md#createwritestream) +* [emit](bzip2source.md#emit) +* [eventNames](bzip2source.md#eventnames) +* [getBlocks](bzip2source.md#getblocks) +* [getInnerSource](bzip2source.md#getinnersource) +* [getMaxListeners](bzip2source.md#getmaxlisteners) +* [getMetadata](bzip2source.md#getmetadata) +* [getPartitionTable](bzip2source.md#getpartitiontable) +* [getSize](bzip2source.md#getsize) +* [listenerCount](bzip2source.md#listenercount) +* [listeners](bzip2source.md#listeners) +* [on](bzip2source.md#on) +* [once](bzip2source.md#once) +* [open](bzip2source.md#open) +* [prependListener](bzip2source.md#prependlistener) +* [prependOnceListener](bzip2source.md#prependoncelistener) +* [read](bzip2source.md#read) +* [removeAllListeners](bzip2source.md#removealllisteners) +* [removeListener](bzip2source.md#removelistener) +* [setMaxListeners](bzip2source.md#setmaxlisteners) +* [write](bzip2source.md#write) +* [listenerCount](bzip2source.md#listenercount-1) +* [register](bzip2source.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new BZip2Source**(source: *[SourceDestination](sourcedestination.md)*): [BZip2Source](bzip2source.md) + +*Inherited from [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [BZip2Source](bzip2source.md) + +___ + +## Properties + + + +### `` isSizeEstimated + +**● isSizeEstimated**: *`boolean`* = false + +*Inherited from [CompressedSource](compressedsource.md).[isSizeEstimated](compressedsource.md#issizeestimated)* + +*Defined in [source-destination/compressed-source.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L44)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### `` mimetype + +**● mimetype**: *"application/x-bzip2"* = "application/x-bzip2" + +*Overrides [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/bzip2.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/bzip2.ts#L24)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [CompressedSource](compressedsource.md).[_getMetadata](compressedsource.md#_getmetadata)* + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/compressed-source.ts:84](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L84)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Inherited from [CompressedSource](compressedsource.md).[canCreateReadStream](compressedsource.md#cancreatereadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/compressed-source.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L50)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +*Inherited from [CompressedSource](compressedsource.md).[createReadStream](compressedsource.md#createreadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/compressed-source.ts:54](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L54)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### `` createTransform + +▸ **createTransform**(): `Transform` + +*Overrides [CompressedSource](compressedsource.md).[createTransform](compressedsource.md#createtransform)* + +*Defined in [source-destination/bzip2.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/bzip2.ts#L26)* + +**Returns:** `Transform` + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getSize + +▸ **getSize**(): `Promise`<`number` \| `undefined`> + +*Inherited from [CompressedSource](compressedsource.md).[getSize](compressedsource.md#getsize)* + +*Defined in [source-destination/compressed-source.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L46)* + +**Returns:** `Promise`<`number` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/checksumverificationerror.md b/doc/classes/checksumverificationerror.md new file mode 100644 index 00000000..e39c3b52 --- /dev/null +++ b/doc/classes/checksumverificationerror.md @@ -0,0 +1,116 @@ +[etcher-sdk](../README.md) > [ChecksumVerificationError](../classes/checksumverificationerror.md) + +# Class: ChecksumVerificationError + +## Hierarchy + +↳ [VerificationError](verificationerror.md) + +**↳ ChecksumVerificationError** + +## Index + +### Constructors + +* [constructor](checksumverificationerror.md#constructor) + +### Properties + +* [checksum](checksumverificationerror.md#checksum) +* [code](checksumverificationerror.md#code) +* [expectedChecksum](checksumverificationerror.md#expectedchecksum) +* [message](checksumverificationerror.md#message) +* [name](checksumverificationerror.md#name) +* [stack](checksumverificationerror.md#stack) + +--- + +## Constructors + + + +### constructor + +⊕ **new ChecksumVerificationError**(message: *`string`*, checksum: *`string`*, expectedChecksum: *`string`*): [ChecksumVerificationError](checksumverificationerror.md) + +*Defined in [errors.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L27)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| message | `string` | +| checksum | `string` | +| expectedChecksum | `string` | + +**Returns:** [ChecksumVerificationError](checksumverificationerror.md) + +___ + +## Properties + + + +### checksum + +**● checksum**: *`string`* + +*Defined in [errors.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L30)* + +___ + + +### code + +**● code**: *`string`* = "EVALIDATION" + +*Inherited from [VerificationError](verificationerror.md).[code](verificationerror.md#code)* + +*Defined in [errors.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L24)* + +___ + + +### expectedChecksum + +**● expectedChecksum**: *`string`* + +*Defined in [errors.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L31)* + +___ + + +### message + +**● message**: *`string`* + +*Inherited from Error.message* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964* + +___ + + +### name + +**● name**: *`string`* + +*Inherited from Error.name* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:963* + +___ + + +### `` stack + +**● stack**: *`undefined` \| `string`* + +*Inherited from Error.stack* + +*Overrides Error.stack* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965* + +___ + diff --git a/doc/classes/compressedsource.md b/doc/classes/compressedsource.md new file mode 100644 index 00000000..bd503691 --- /dev/null +++ b/doc/classes/compressedsource.md @@ -0,0 +1,836 @@ +[etcher-sdk](../README.md) > [CompressedSource](../classes/compressedsource.md) + +# Class: CompressedSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ CompressedSource** + +↳ [BZip2Source](bzip2source.md) + +↳ [GZipSource](gzipsource.md) + +↳ [XzSource](xzsource.md) + +## Index + +### Constructors + +* [constructor](compressedsource.md#constructor) + +### Properties + +* [isSizeEstimated](compressedsource.md#issizeestimated) +* [source](compressedsource.md#source) +* [defaultMaxListeners](compressedsource.md#defaultmaxlisteners) +* [imageExtensions](compressedsource.md#imageextensions) +* [mimetype](compressedsource.md#mimetype) +* [requiresRandomReadableSource](compressedsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](compressedsource.md#_close) +* [_getMetadata](compressedsource.md#_getmetadata) +* [_open](compressedsource.md#_open) +* [addListener](compressedsource.md#addlistener) +* [canCreateReadStream](compressedsource.md#cancreatereadstream) +* [canCreateSparseReadStream](compressedsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](compressedsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](compressedsource.md#cancreatewritestream) +* [canRead](compressedsource.md#canread) +* [canWrite](compressedsource.md#canwrite) +* [close](compressedsource.md#close) +* [createReadStream](compressedsource.md#createreadstream) +* [createSparseReadStream](compressedsource.md#createsparsereadstream) +* [createSparseWriteStream](compressedsource.md#createsparsewritestream) +* [createTransform](compressedsource.md#createtransform) +* [createVerifier](compressedsource.md#createverifier) +* [createWriteStream](compressedsource.md#createwritestream) +* [emit](compressedsource.md#emit) +* [eventNames](compressedsource.md#eventnames) +* [getBlocks](compressedsource.md#getblocks) +* [getInnerSource](compressedsource.md#getinnersource) +* [getMaxListeners](compressedsource.md#getmaxlisteners) +* [getMetadata](compressedsource.md#getmetadata) +* [getPartitionTable](compressedsource.md#getpartitiontable) +* [getSize](compressedsource.md#getsize) +* [listenerCount](compressedsource.md#listenercount) +* [listeners](compressedsource.md#listeners) +* [on](compressedsource.md#on) +* [once](compressedsource.md#once) +* [open](compressedsource.md#open) +* [prependListener](compressedsource.md#prependlistener) +* [prependOnceListener](compressedsource.md#prependoncelistener) +* [read](compressedsource.md#read) +* [removeAllListeners](compressedsource.md#removealllisteners) +* [removeListener](compressedsource.md#removelistener) +* [setMaxListeners](compressedsource.md#setmaxlisteners) +* [write](compressedsource.md#write) +* [listenerCount](compressedsource.md#listenercount-1) +* [register](compressedsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new CompressedSource**(source: *[SourceDestination](sourcedestination.md)*): [CompressedSource](compressedsource.md) + +*Inherited from [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [CompressedSource](compressedsource.md) + +___ + +## Properties + + + +### `` isSizeEstimated + +**● isSizeEstimated**: *`boolean`* = false + +*Defined in [source-destination/compressed-source.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L44)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/compressed-source.ts:84](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L84)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/compressed-source.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L50)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/compressed-source.ts:54](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L54)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### ```` createTransform + +▸ **createTransform**(): `Transform` + +*Defined in [source-destination/compressed-source.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L43)* + +**Returns:** `Transform` + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getSize + +▸ **getSize**(): `Promise`<`number` \| `undefined`> + +*Defined in [source-destination/compressed-source.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L46)* + +**Returns:** `Promise`<`number` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/configuredsource.md b/doc/classes/configuredsource.md new file mode 100644 index 00000000..7d915cd7 --- /dev/null +++ b/doc/classes/configuredsource.md @@ -0,0 +1,932 @@ +[etcher-sdk](../README.md) > [ConfiguredSource](../classes/configuredsource.md) + +# Class: ConfiguredSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ ConfiguredSource** + +## Index + +### Constructors + +* [constructor](configuredsource.md#constructor) + +### Properties + +* [checksumType](configuredsource.md#checksumtype) +* [chunkSize](configuredsource.md#chunksize) +* [config](configuredsource.md#config) +* [configure](configuredsource.md#configure) +* [createStreamFromDisk](configuredsource.md#createstreamfromdisk) +* [disk](configuredsource.md#disk) +* [shouldTrimPartitions](configuredsource.md#shouldtrimpartitions) +* [source](configuredsource.md#source) +* [defaultMaxListeners](configuredsource.md#defaultmaxlisteners) +* [imageExtensions](configuredsource.md#imageextensions) +* [mimetype](configuredsource.md#mimetype) +* [requiresRandomReadableSource](configuredsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](configuredsource.md#_close) +* [_getMetadata](configuredsource.md#_getmetadata) +* [_open](configuredsource.md#_open) +* [addListener](configuredsource.md#addlistener) +* [canCreateReadStream](configuredsource.md#cancreatereadstream) +* [canCreateSparseReadStream](configuredsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](configuredsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](configuredsource.md#cancreatewritestream) +* [canRead](configuredsource.md#canread) +* [canWrite](configuredsource.md#canwrite) +* [close](configuredsource.md#close) +* [createReadStream](configuredsource.md#createreadstream) +* [createSparseReadStream](configuredsource.md#createsparsereadstream) +* [createSparseReadStreamFromDisk](configuredsource.md#createsparsereadstreamfromdisk) +* [createSparseReadStreamFromStream](configuredsource.md#createsparsereadstreamfromstream) +* [createSparseWriteStream](configuredsource.md#createsparsewritestream) +* [createVerifier](configuredsource.md#createverifier) +* [createWriteStream](configuredsource.md#createwritestream) +* [emit](configuredsource.md#emit) +* [eventNames](configuredsource.md#eventnames) +* [getBlocks](configuredsource.md#getblocks) +* [getBlocksWithChecksumType](configuredsource.md#getblockswithchecksumtype) +* [getInnerSource](configuredsource.md#getinnersource) +* [getMaxListeners](configuredsource.md#getmaxlisteners) +* [getMetadata](configuredsource.md#getmetadata) +* [getPartitionTable](configuredsource.md#getpartitiontable) +* [listenerCount](configuredsource.md#listenercount) +* [listeners](configuredsource.md#listeners) +* [on](configuredsource.md#on) +* [once](configuredsource.md#once) +* [open](configuredsource.md#open) +* [prependListener](configuredsource.md#prependlistener) +* [prependOnceListener](configuredsource.md#prependoncelistener) +* [read](configuredsource.md#read) +* [removeAllListeners](configuredsource.md#removealllisteners) +* [removeListener](configuredsource.md#removelistener) +* [setMaxListeners](configuredsource.md#setmaxlisteners) +* [trimPartitions](configuredsource.md#trimpartitions) +* [write](configuredsource.md#write) +* [listenerCount](configuredsource.md#listenercount-1) +* [register](configuredsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new ConfiguredSource**(source: *[SourceDestination](sourcedestination.md)*, shouldTrimPartitions: *`boolean`*, createStreamFromDisk: *`boolean`*, configure?: *[ConfigureFunction](../#configurefunction) \| "legacy"*, config?: *`any`*, checksumType?: *[ChecksumType](../#checksumtype)*, chunkSize?: *`number`*): [ConfiguredSource](configuredsource.md) + +*Overrides [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/configured-source/configured-source.ts:87](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L87)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | - | +| shouldTrimPartitions | `boolean` | - | +| createStreamFromDisk | `boolean` | - | +| `Optional` configure | [ConfigureFunction](../#configurefunction) \| "legacy" | - | +| `Optional` config | `any` | - | +| `Default value` checksumType | [ChecksumType](../#checksumtype) | "xxhash64" | +| `Default value` chunkSize | `number` | CHUNK_SIZE | + +**Returns:** [ConfiguredSource](configuredsource.md) + +___ + +## Properties + + + +### `` checksumType + +**● checksumType**: *[ChecksumType](../#checksumtype)* + +*Defined in [source-destination/configured-source/configured-source.ts:96](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L96)* + +___ + + +### `` chunkSize + +**● chunkSize**: *`number`* + +*Defined in [source-destination/configured-source/configured-source.ts:97](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L97)* + +___ + + +### ```` config + +**● config**: *`any`* + +*Defined in [source-destination/configured-source/configured-source.ts:95](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L95)* + +___ + + +### ```` configure + +**● configure**: *[ConfigureFunction](../#configurefunction)* + +*Defined in [source-destination/configured-source/configured-source.ts:87](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L87)* + +___ + + +### `` createStreamFromDisk + +**● createStreamFromDisk**: *`boolean`* + +*Defined in [source-destination/configured-source/configured-source.ts:93](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L93)* + +___ + + +### `` disk + +**● disk**: *[SourceDisk](sourcedisk.md)* + +*Defined in [source-destination/configured-source/configured-source.ts:86](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L86)* + +___ + + +### `` shouldTrimPartitions + +**● shouldTrimPartitions**: *`boolean`* + +*Defined in [source-destination/configured-source/configured-source.ts:92](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L92)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Defined in [source-destination/configured-source/configured-source.ts:248](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L248)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/configured-source/configured-source.ts:196](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L196)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Defined in [source-destination/configured-source/configured-source.ts:237](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L237)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/configured-source/configured-source.ts:131](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L131)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/configured-source/configured-source.ts:135](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L135)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/configured-source/configured-source.ts:127](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L127)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(...args: *`any`[]*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/configured-source/configured-source.ts:148](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L148)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Rest` args | `any`[] | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(generateChecksums: *`boolean`*): `Promise`<[SparseReadStream](sparsereadstream.md) \| [SparseFilterStream](sparsefilterstream.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/configured-source/configured-source.ts:186](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L186)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| generateChecksums | `boolean` | + +**Returns:** `Promise`<[SparseReadStream](sparsereadstream.md) \| [SparseFilterStream](sparsefilterstream.md)> + +___ + + +### `` createSparseReadStreamFromDisk + +▸ **createSparseReadStreamFromDisk**(generateChecksums: *`boolean`*): `Promise`<[SparseReadStream](sparsereadstream.md)> + +*Defined in [source-destination/configured-source/configured-source.ts:160](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L160)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| generateChecksums | `boolean` | + +**Returns:** `Promise`<[SparseReadStream](sparsereadstream.md)> + +___ + + +### `` createSparseReadStreamFromStream + +▸ **createSparseReadStreamFromStream**(generateChecksums: *`boolean`*): `Promise`<[SparseFilterStream](sparsefilterstream.md)> + +*Defined in [source-destination/configured-source/configured-source.ts:172](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L172)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| generateChecksums | `boolean` | + +**Returns:** `Promise`<[SparseFilterStream](sparsefilterstream.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Overrides [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/configured-source/configured-source.ts:108](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L108)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### `` getBlocksWithChecksumType + +▸ **getBlocksWithChecksumType**(generateChecksums: *`boolean`*): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Defined in [source-destination/configured-source/configured-source.ts:114](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L114)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| generateChecksums | `boolean` | + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/configured-source/configured-source.ts:139](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L139)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` trimPartitions + +▸ **trimPartitions**(): `Promise`<`void`> + +*Defined in [source-destination/configured-source/configured-source.ts:203](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L203)* + +**Returns:** `Promise`<`void`> + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/countinghashstream.md b/doc/classes/countinghashstream.md new file mode 100644 index 00000000..8ba9f039 --- /dev/null +++ b/doc/classes/countinghashstream.md @@ -0,0 +1,1373 @@ +[etcher-sdk](../README.md) > [CountingHashStream](../classes/countinghashstream.md) + +# Class: CountingHashStream + +## Hierarchy + + `Stream` + +**↳ CountingHashStream** + +## Implements + +* `ReadableStream` +* `Writable` + +## Index + +### Constructors + +* [constructor](countinghashstream.md#constructor) + +### Properties + +* [bytesWritten](countinghashstream.md#byteswritten) +* [readable](countinghashstream.md#readable) +* [writable](countinghashstream.md#writable) +* [defaultMaxListeners](countinghashstream.md#defaultmaxlisteners) + +### Methods + +* [_read](countinghashstream.md#_read) +* [_transform](countinghashstream.md#_transform) +* [_write](countinghashstream.md#_write) +* [addListener](countinghashstream.md#addlistener) +* [emit](countinghashstream.md#emit) +* [end](countinghashstream.md#end) +* [eventNames](countinghashstream.md#eventnames) +* [getMaxListeners](countinghashstream.md#getmaxlisteners) +* [isPaused](countinghashstream.md#ispaused) +* [listenerCount](countinghashstream.md#listenercount) +* [listeners](countinghashstream.md#listeners) +* [on](countinghashstream.md#on) +* [once](countinghashstream.md#once) +* [pause](countinghashstream.md#pause) +* [pipe](countinghashstream.md#pipe) +* [prependListener](countinghashstream.md#prependlistener) +* [prependOnceListener](countinghashstream.md#prependoncelistener) +* [push](countinghashstream.md#push) +* [read](countinghashstream.md#read) +* [removeAllListeners](countinghashstream.md#removealllisteners) +* [removeListener](countinghashstream.md#removelistener) +* [resume](countinghashstream.md#resume) +* [setDefaultEncoding](countinghashstream.md#setdefaultencoding) +* [setEncoding](countinghashstream.md#setencoding) +* [setMaxListeners](countinghashstream.md#setmaxlisteners) +* [unpipe](countinghashstream.md#unpipe) +* [unshift](countinghashstream.md#unshift) +* [wrap](countinghashstream.md#wrap) +* [write](countinghashstream.md#write) +* [listenerCount](countinghashstream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new CountingHashStream**(seed: *`number`*, bits?: *`undefined` \| `number`*, enc?: *`undefined` \| `string`*): [CountingHashStream](countinghashstream.md) + +*Inherited from Stream.__constructor* + +*Overrides Transform.__constructor* + +*Defined in [/home/alexis/dev/resin.io/etcher-sdk-2/typings/xxhash/index.d.ts:12](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/typings/xxhash/index.d.ts#L12)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| seed | `number` | +| `Optional` bits | `undefined` \| `number` | +| `Optional` enc | `undefined` \| `string` | + +**Returns:** [CountingHashStream](countinghashstream.md) + +___ + +## Properties + + + +### bytesWritten + +**● bytesWritten**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L48)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Duplex.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3885* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _read + +▸ **_read**(size: *`number`*): `void` + +*Inherited from Readable._read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| size | `number` | + +**Returns:** `void` + +___ + + +### _transform + +▸ **_transform**(chunk: *`Buffer`*, encoding: *`string`*, callback: *`function`*): `void` + +*Overrides Transform._transform* + +*Defined in [source-destination/source-destination.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L50)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `Buffer` | +| encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Duplex._write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3887* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3891* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3892* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3893* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Duplex.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3890* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3888* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3889* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/countingwritable.md b/doc/classes/countingwritable.md new file mode 100644 index 00000000..bfa2c906 --- /dev/null +++ b/doc/classes/countingwritable.md @@ -0,0 +1,1277 @@ +[etcher-sdk](../README.md) > [CountingWritable](../classes/countingwritable.md) + +# Class: CountingWritable + +## Hierarchy + + `Writable` + +**↳ CountingWritable** + +## Implements + +* `WritableStream` + +## Index + +### Constructors + +* [constructor](countingwritable.md#constructor) + +### Properties + +* [bytesWritten](countingwritable.md#byteswritten) +* [position](countingwritable.md#position) +* [writable](countingwritable.md#writable) +* [defaultMaxListeners](countingwritable.md#defaultmaxlisteners) + +### Methods + +* [_write](countingwritable.md#_write) +* [addListener](countingwritable.md#addlistener) +* [emit](countingwritable.md#emit) +* [end](countingwritable.md#end) +* [eventNames](countingwritable.md#eventnames) +* [getMaxListeners](countingwritable.md#getmaxlisteners) +* [listenerCount](countingwritable.md#listenercount) +* [listeners](countingwritable.md#listeners) +* [on](countingwritable.md#on) +* [once](countingwritable.md#once) +* [pipe](countingwritable.md#pipe) +* [prependListener](countingwritable.md#prependlistener) +* [prependOnceListener](countingwritable.md#prependoncelistener) +* [removeAllListeners](countingwritable.md#removealllisteners) +* [removeListener](countingwritable.md#removelistener) +* [setDefaultEncoding](countingwritable.md#setdefaultencoding) +* [setMaxListeners](countingwritable.md#setmaxlisteners) +* [write](countingwritable.md#write) +* [listenerCount](countingwritable.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new CountingWritable**(opts?: *`WritableOptions`*): [CountingWritable](countingwritable.md) + +*Inherited from Writable.__constructor* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3800* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` opts | `WritableOptions` | + +**Returns:** [CountingWritable](countingwritable.md) + +___ + +## Properties + + + +### bytesWritten + +**● bytesWritten**: *`number`* = 0 + +*Defined in [source-destination/progress.ts:92](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L92)* + +___ + + +### position + +**● position**: *`number` \| `undefined`* + +*Defined in [source-destination/progress.ts:93](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L93)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Writable.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3800* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _write + +▸ **_write**(chunk: *`Buffer` \| `Chunk`*, _enc: *`string`*, callback: *`function`*): `void` + +*Overrides Writable._write* + +*Defined in [source-destination/progress.ts:95](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L95)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `Buffer` \| `Chunk` | +| _enc | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3820* + +Event emitter The defined events on documents including: + +1. close +2. drain +3. error +4. finish +5. pipe +6. unpipe + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3821* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3822* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3823* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3824* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3825* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3826* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"drain"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +▸ **emit**(event: *"finish"*): `boolean` + +▸ **emit**(event: *"pipe"*, src: *`Readable`*): `boolean` + +▸ **emit**(event: *"unpipe"*, src: *`Readable`*): `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3828* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3829* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3830* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3831* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3832* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3833* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| src | `Readable` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3834* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| src | `Readable` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3806* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3807* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3808* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"drain"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +▸ **on**(event: *"finish"*, listener: *`function`*): `this` + +▸ **on**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **on**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3836* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3837* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3838* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3839* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3840* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3841* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3842* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"drain"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +▸ **once**(event: *"finish"*, listener: *`function`*): `this` + +▸ **once**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **once**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3844* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3845* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3846* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3847* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3848* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3849* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3850* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3703* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3852* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3853* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3854* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3855* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3856* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3857* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3858* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3860* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3861* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3862* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3863* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3864* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3865* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3866* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3868* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3869* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3870* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3871* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3872* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3873* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3874* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Writable.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3805* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3803* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3804* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/crc32hasher.md b/doc/classes/crc32hasher.md new file mode 100644 index 00000000..1962e21b --- /dev/null +++ b/doc/classes/crc32hasher.md @@ -0,0 +1,70 @@ +[etcher-sdk](../README.md) > [CRC32Hasher](../classes/crc32hasher.md) + +# Class: CRC32Hasher + +## Hierarchy + +**CRC32Hasher** + +## Index + +### Properties + +* [value](crc32hasher.md#value) + +### Methods + +* [digest](crc32hasher.md#digest) +* [update](crc32hasher.md#update) + +--- + +## Properties + + + +### `` value + +**● value**: *`number`* + +*Defined in [sparse-stream/shared.ts:55](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L55)* + +___ + +## Methods + + + +### digest + +▸ **digest**(_encoding: *"hex"*): `string` + +*Defined in [sparse-stream/shared.ts:61](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L61)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _encoding | "hex" | + +**Returns:** `string` + +___ + + +### update + +▸ **update**(data: *`Buffer`*): `void` + +*Defined in [sparse-stream/shared.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L57)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| data | `Buffer` | + +**Returns:** `void` + +___ + diff --git a/doc/classes/dmgsource.md b/doc/classes/dmgsource.md new file mode 100644 index 00000000..f265b66d --- /dev/null +++ b/doc/classes/dmgsource.md @@ -0,0 +1,818 @@ +[etcher-sdk](../README.md) > [DmgSource](../classes/dmgsource.md) + +# Class: DmgSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ DmgSource** + +## Index + +### Constructors + +* [constructor](dmgsource.md#constructor) + +### Properties + +* [image](dmgsource.md#image) +* [source](dmgsource.md#source) +* [defaultMaxListeners](dmgsource.md#defaultmaxlisteners) +* [imageExtensions](dmgsource.md#imageextensions) +* [mappedBlockTypes](dmgsource.md#mappedblocktypes) +* [mimetype](dmgsource.md#mimetype) +* [requiresRandomReadableSource](dmgsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](dmgsource.md#_close) +* [_getMetadata](dmgsource.md#_getmetadata) +* [_open](dmgsource.md#_open) +* [addListener](dmgsource.md#addlistener) +* [canCreateReadStream](dmgsource.md#cancreatereadstream) +* [canCreateSparseReadStream](dmgsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](dmgsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](dmgsource.md#cancreatewritestream) +* [canRead](dmgsource.md#canread) +* [canWrite](dmgsource.md#canwrite) +* [close](dmgsource.md#close) +* [createReadStream](dmgsource.md#createreadstream) +* [createSparseReadStream](dmgsource.md#createsparsereadstream) +* [createSparseWriteStream](dmgsource.md#createsparsewritestream) +* [createVerifier](dmgsource.md#createverifier) +* [createWriteStream](dmgsource.md#createwritestream) +* [emit](dmgsource.md#emit) +* [eventNames](dmgsource.md#eventnames) +* [getBlocks](dmgsource.md#getblocks) +* [getInnerSource](dmgsource.md#getinnersource) +* [getMaxListeners](dmgsource.md#getmaxlisteners) +* [getMetadata](dmgsource.md#getmetadata) +* [getPartitionTable](dmgsource.md#getpartitiontable) +* [listenerCount](dmgsource.md#listenercount) +* [listeners](dmgsource.md#listeners) +* [on](dmgsource.md#on) +* [once](dmgsource.md#once) +* [open](dmgsource.md#open) +* [prependListener](dmgsource.md#prependlistener) +* [prependOnceListener](dmgsource.md#prependoncelistener) +* [read](dmgsource.md#read) +* [removeAllListeners](dmgsource.md#removealllisteners) +* [removeListener](dmgsource.md#removelistener) +* [setMaxListeners](dmgsource.md#setmaxlisteners) +* [write](dmgsource.md#write) +* [listenerCount](dmgsource.md#listenercount-1) +* [register](dmgsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new DmgSource**(source: *[SourceDestination](sourcedestination.md)*): [DmgSource](dmgsource.md) + +*Overrides [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/dmg.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L44)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [DmgSource](dmgsource.md) + +___ + +## Properties + + + +### `` image + +**● image**: *`UDIFImage`* + +*Defined in [source-destination/dmg.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L44)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mappedBlockTypes + +**● mappedBlockTypes**: *`number`[]* = [ + BLOCK.RAW, + BLOCK.UDCO, + BLOCK.UDZO, + BLOCK.UDBZ, + BLOCK.LZFSE, + ] + +*Defined in [source-destination/dmg.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L35)* + +___ + + +### `` mimetype + +**● mimetype**: *"application/x-apple-diskimage"* = "application/x-apple-diskimage" + +*Overrides [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/dmg.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L43)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = true + +*Overrides [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/dmg.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L42)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Defined in [source-destination/dmg.ts:136](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L136)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/dmg.ts:123](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L123)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Defined in [source-destination/dmg.ts:131](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L131)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/dmg.ts:51](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L51)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/dmg.ts:55](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L55)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/dmg.ts:59](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L59)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/dmg.ts:75](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L75)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _generateChecksums | `boolean` | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Overrides [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/dmg.ts:83](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/dmg.ts#L83)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/driverlessdevice.md b/doc/classes/driverlessdevice.md new file mode 100644 index 00000000..2e006958 --- /dev/null +++ b/doc/classes/driverlessdevice.md @@ -0,0 +1,972 @@ +[etcher-sdk](../README.md) > [DriverlessDevice](../classes/driverlessdevice.md) + +# Class: DriverlessDevice + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ DriverlessDevice** + +## Implements + +* [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) + +## Index + +### Constructors + +* [constructor](driverlessdevice.md#constructor) + +### Properties + +* [accessible](driverlessdevice.md#accessible) +* [description](driverlessdevice.md#description) +* [device](driverlessdevice.md#device) +* [deviceDescriptor](driverlessdevice.md#devicedescriptor) +* [devicePath](driverlessdevice.md#devicepath) +* [emitsProgress](driverlessdevice.md#emitsprogress) +* [isSystem](driverlessdevice.md#issystem) +* [mountpoints](driverlessdevice.md#mountpoints) +* [raw](driverlessdevice.md#raw) +* [size](driverlessdevice.md#size) +* [defaultMaxListeners](driverlessdevice.md#defaultmaxlisteners) +* [imageExtensions](driverlessdevice.md#imageextensions) +* [mimetype](driverlessdevice.md#mimetype) + +### Methods + +* [_close](driverlessdevice.md#_close) +* [_getMetadata](driverlessdevice.md#_getmetadata) +* [_open](driverlessdevice.md#_open) +* [addListener](driverlessdevice.md#addlistener) +* [canCreateReadStream](driverlessdevice.md#cancreatereadstream) +* [canCreateSparseReadStream](driverlessdevice.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](driverlessdevice.md#cancreatesparsewritestream) +* [canCreateWriteStream](driverlessdevice.md#cancreatewritestream) +* [canRead](driverlessdevice.md#canread) +* [canWrite](driverlessdevice.md#canwrite) +* [close](driverlessdevice.md#close) +* [createReadStream](driverlessdevice.md#createreadstream) +* [createSparseReadStream](driverlessdevice.md#createsparsereadstream) +* [createSparseWriteStream](driverlessdevice.md#createsparsewritestream) +* [createVerifier](driverlessdevice.md#createverifier) +* [createWriteStream](driverlessdevice.md#createwritestream) +* [emit](driverlessdevice.md#emit) +* [eventNames](driverlessdevice.md#eventnames) +* [getBlocks](driverlessdevice.md#getblocks) +* [getInnerSource](driverlessdevice.md#getinnersource) +* [getMaxListeners](driverlessdevice.md#getmaxlisteners) +* [getMetadata](driverlessdevice.md#getmetadata) +* [getPartitionTable](driverlessdevice.md#getpartitiontable) +* [listenerCount](driverlessdevice.md#listenercount) +* [listeners](driverlessdevice.md#listeners) +* [on](driverlessdevice.md#on) +* [once](driverlessdevice.md#once) +* [open](driverlessdevice.md#open) +* [prependListener](driverlessdevice.md#prependlistener) +* [prependOnceListener](driverlessdevice.md#prependoncelistener) +* [read](driverlessdevice.md#read) +* [removeAllListeners](driverlessdevice.md#removealllisteners) +* [removeListener](driverlessdevice.md#removelistener) +* [setMaxListeners](driverlessdevice.md#setmaxlisteners) +* [write](driverlessdevice.md#write) +* [listenerCount](driverlessdevice.md#listenercount-1) +* [register](driverlessdevice.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new DriverlessDevice**(driverlessDevice: *`WinUsbDriverlessDevice`*): [DriverlessDevice](driverlessdevice.md) + +*Defined in [source-destination/driverless.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L33)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| driverlessDevice | `WinUsbDriverlessDevice` | + +**Returns:** [DriverlessDevice](driverlessdevice.md) + +___ + +## Properties + + + +### accessible + +**● accessible**: *`boolean`* = false + +*Defined in [source-destination/driverless.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L24)* + +___ + + +### description + +**● description**: *`string`* = "" + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[description](../interfaces/adaptersourcedestination.md#description)* + +*Defined in [source-destination/driverless.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L33)* + +___ + + +### device + +**● device**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[device](../interfaces/adaptersourcedestination.md#device)* + +*Defined in [source-destination/driverless.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L26)* + +___ + + +### deviceDescriptor + +**● deviceDescriptor**: *`object`* + +*Defined in [source-destination/driverless.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L32)* + +#### Type declaration + + idProduct: `number` + + idVendor: `number` + +___ + + +### devicePath + +**● devicePath**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[devicePath](../interfaces/adaptersourcedestination.md#devicepath)* + +*Defined in [source-destination/driverless.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L27)* + +___ + + +### emitsProgress + +**● emitsProgress**: *`boolean`* = false + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emitsProgress](../interfaces/adaptersourcedestination.md#emitsprogress)* + +*Defined in [source-destination/driverless.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L31)* + +___ + + +### isSystem + +**● isSystem**: *`boolean`* = false + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[isSystem](../interfaces/adaptersourcedestination.md#issystem)* + +*Defined in [source-destination/driverless.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L28)* + +___ + + +### mountpoints + +**● mountpoints**: *`never`[]* = [] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[mountpoints](../interfaces/adaptersourcedestination.md#mountpoints)* + +*Defined in [source-destination/driverless.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L29)* + +___ + + +### raw + +**● raw**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[raw](../interfaces/adaptersourcedestination.md#raw)* + +*Defined in [source-destination/driverless.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L25)* + +___ + + +### size + +**● size**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[size](../interfaces/adaptersourcedestination.md#size)* + +*Defined in [source-destination/driverless.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/driverless.ts#L30)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[defaultMaxListeners](../interfaces/adaptersourcedestination.md#defaultmaxlisteners)* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[imageExtensions](../interfaces/adaptersourcedestination.md#imageextensions)* + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[mimetype](../interfaces/adaptersourcedestination.md#mimetype)* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_close](../interfaces/adaptersourcedestination.md#_close)* + +*Inherited from [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_getMetadata](../interfaces/adaptersourcedestination.md#_getmetadata)* + +*Inherited from [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_open](../interfaces/adaptersourcedestination.md#_open)* + +*Inherited from [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[addListener](../interfaces/adaptersourcedestination.md#addlistener)* + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateReadStream](../interfaces/adaptersourcedestination.md#cancreatereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/source-destination.ts:266](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L266)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseReadStream](../interfaces/adaptersourcedestination.md#cancreatesparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseWriteStream](../interfaces/adaptersourcedestination.md#cancreatesparsewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateWriteStream](../interfaces/adaptersourcedestination.md#cancreatewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canRead](../interfaces/adaptersourcedestination.md#canread)* + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canWrite](../interfaces/adaptersourcedestination.md#canwrite)* + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[close](../interfaces/adaptersourcedestination.md#close)* + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, _start?: *`number`*, _end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createReadStream](../interfaces/adaptersourcedestination.md#createreadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/source-destination.ts:311](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L311)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` _start | `number` | 0 | +| `Optional` _end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseReadStream](../interfaces/adaptersourcedestination.md#createsparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseWriteStream](../interfaces/adaptersourcedestination.md#createsparsewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createVerifier](../interfaces/adaptersourcedestination.md#createverifier)* + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createWriteStream](../interfaces/adaptersourcedestination.md#createwritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emit](../interfaces/adaptersourcedestination.md#emit)* + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[eventNames](../interfaces/adaptersourcedestination.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getBlocks](../interfaces/adaptersourcedestination.md#getblocks)* + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getInnerSource](../interfaces/adaptersourcedestination.md#getinnersource)* + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMaxListeners](../interfaces/adaptersourcedestination.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMetadata](../interfaces/adaptersourcedestination.md#getmetadata)* + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getPartitionTable](../interfaces/adaptersourcedestination.md#getpartitiontable)* + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listeners](../interfaces/adaptersourcedestination.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[on](../interfaces/adaptersourcedestination.md#on)* + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[once](../interfaces/adaptersourcedestination.md#once)* + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[open](../interfaces/adaptersourcedestination.md#open)* + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependListener](../interfaces/adaptersourcedestination.md#prependlistener)* + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependOnceListener](../interfaces/adaptersourcedestination.md#prependoncelistener)* + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[read](../interfaces/adaptersourcedestination.md#read)* + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeAllListeners](../interfaces/adaptersourcedestination.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeListener](../interfaces/adaptersourcedestination.md#removelistener)* + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[setMaxListeners](../interfaces/adaptersourcedestination.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[write](../interfaces/adaptersourcedestination.md#write)* + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount-1)* + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[register](../interfaces/adaptersourcedestination.md#register)* + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/driverlessdeviceadapter_.md b/doc/classes/driverlessdeviceadapter_.md new file mode 100644 index 00000000..0e323881 --- /dev/null +++ b/doc/classes/driverlessdeviceadapter_.md @@ -0,0 +1,444 @@ +[etcher-sdk](../README.md) > [DriverlessDeviceAdapter$](../classes/driverlessdeviceadapter_.md) + +# Class: DriverlessDeviceAdapter$ + +## Hierarchy + +↳ [Adapter](adapter.md) + +**↳ DriverlessDeviceAdapter$** + +## Index + +### Properties + +* [drives](driverlessdeviceadapter_.md#drives) +* [listDriverlessDevices](driverlessdeviceadapter_.md#listdriverlessdevices) +* [ready](driverlessdeviceadapter_.md#ready) +* [running](driverlessdeviceadapter_.md#running) +* [defaultMaxListeners](driverlessdeviceadapter_.md#defaultmaxlisteners) + +### Methods + +* [addListener](driverlessdeviceadapter_.md#addlistener) +* [emit](driverlessdeviceadapter_.md#emit) +* [eventNames](driverlessdeviceadapter_.md#eventnames) +* [getMaxListeners](driverlessdeviceadapter_.md#getmaxlisteners) +* [listDrives](driverlessdeviceadapter_.md#listdrives) +* [listenerCount](driverlessdeviceadapter_.md#listenercount) +* [listeners](driverlessdeviceadapter_.md#listeners) +* [on](driverlessdeviceadapter_.md#on) +* [once](driverlessdeviceadapter_.md#once) +* [prependListener](driverlessdeviceadapter_.md#prependlistener) +* [prependOnceListener](driverlessdeviceadapter_.md#prependoncelistener) +* [removeAllListeners](driverlessdeviceadapter_.md#removealllisteners) +* [removeListener](driverlessdeviceadapter_.md#removelistener) +* [scan](driverlessdeviceadapter_.md#scan) +* [scanLoop](driverlessdeviceadapter_.md#scanloop) +* [setMaxListeners](driverlessdeviceadapter_.md#setmaxlisteners) +* [start](driverlessdeviceadapter_.md#start) +* [stop](driverlessdeviceadapter_.md#stop) +* [listenerCount](driverlessdeviceadapter_.md#listenercount-1) + +--- + +## Properties + + + +### `` drives + +**● drives**: *`Map`<`string`, [DriverlessDevice](driverlessdevice.md)>* = new Map() + +*Defined in [scanner/adapters/driverless.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L30)* + +___ + + +### `` listDriverlessDevices + +**● listDriverlessDevices**: *`any`* + +*Defined in [scanner/adapters/driverless.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L33)* + +___ + + +### `` ready + +**● ready**: *`boolean`* = false + +*Defined in [scanner/adapters/driverless.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L32)* + +___ + + +### `` running + +**● running**: *`boolean`* = false + +*Defined in [scanner/adapters/driverless.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L31)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` listDrives + +▸ **listDrives**(): `Map`<`string`, `WinUsbDriverlessDevice`> + +*Defined in [scanner/adapters/driverless.ts:88](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L88)* + +**Returns:** `Map`<`string`, `WinUsbDriverlessDevice`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` scan + +▸ **scan**(): `void` + +*Defined in [scanner/adapters/driverless.ts:63](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L63)* + +**Returns:** `void` + +___ + + +### `` scanLoop + +▸ **scanLoop**(): `Promise`<`void`> + +*Defined in [scanner/adapters/driverless.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L46)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### start + +▸ **start**(): `void` + +*Overrides [Adapter](adapter.md).[start](adapter.md#start)* + +*Defined in [scanner/adapters/driverless.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L35)* + +**Returns:** `void` + +___ + + +### stop + +▸ **stop**(): `void` + +*Overrides [Adapter](adapter.md).[stop](adapter.md#stop)* + +*Defined in [scanner/adapters/driverless.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/driverless.ts#L40)* + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/file.md b/doc/classes/file.md new file mode 100644 index 00000000..53f0888a --- /dev/null +++ b/doc/classes/file.md @@ -0,0 +1,843 @@ +[etcher-sdk](../README.md) > [File](../classes/file.md) + +# Class: File + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ File** + +↳ [BlockDevice](blockdevice.md) + +## Index + +### Constructors + +* [constructor](file.md#constructor) + +### Properties + +* [blockSize](file.md#blocksize) +* [fd](file.md#fd) +* [flags](file.md#flags) +* [path](file.md#path) +* [OpenFlags](file.md#openflags) +* [defaultMaxListeners](file.md#defaultmaxlisteners) +* [imageExtensions](file.md#imageextensions) +* [mimetype](file.md#mimetype) + +### Methods + +* [_canRead](file.md#_canread) +* [_canWrite](file.md#_canwrite) +* [_close](file.md#_close) +* [_getMetadata](file.md#_getmetadata) +* [_open](file.md#_open) +* [addListener](file.md#addlistener) +* [canCreateReadStream](file.md#cancreatereadstream) +* [canCreateSparseReadStream](file.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](file.md#cancreatesparsewritestream) +* [canCreateWriteStream](file.md#cancreatewritestream) +* [canRead](file.md#canread) +* [canWrite](file.md#canwrite) +* [close](file.md#close) +* [createReadStream](file.md#createreadstream) +* [createSparseReadStream](file.md#createsparsereadstream) +* [createSparseWriteStream](file.md#createsparsewritestream) +* [createVerifier](file.md#createverifier) +* [createWriteStream](file.md#createwritestream) +* [emit](file.md#emit) +* [eventNames](file.md#eventnames) +* [getBlocks](file.md#getblocks) +* [getInnerSource](file.md#getinnersource) +* [getMaxListeners](file.md#getmaxlisteners) +* [getMetadata](file.md#getmetadata) +* [getPartitionTable](file.md#getpartitiontable) +* [listenerCount](file.md#listenercount) +* [listeners](file.md#listeners) +* [on](file.md#on) +* [once](file.md#once) +* [open](file.md#open) +* [prependListener](file.md#prependlistener) +* [prependOnceListener](file.md#prependoncelistener) +* [read](file.md#read) +* [removeAllListeners](file.md#removealllisteners) +* [removeListener](file.md#removelistener) +* [setMaxListeners](file.md#setmaxlisteners) +* [write](file.md#write) +* [listenerCount](file.md#listenercount-1) +* [register](file.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new File**(path: *`string`*, flags: *[OpenFlags](../enums/openflags.md)*): [File](file.md) + +*Defined in [source-destination/file.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L58)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| path | `string` | +| flags | [OpenFlags](../enums/openflags.md) | + +**Returns:** [File](file.md) + +___ + +## Properties + + + +### blockSize + +**● blockSize**: *`number`* = 512 + +*Defined in [source-destination/file.ts:58](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L58)* + +___ + + +### `` fd + +**● fd**: *`number`* + +*Defined in [source-destination/file.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L57)* + +___ + + +### `` flags + +**● flags**: *[OpenFlags](../enums/openflags.md)* + +*Defined in [source-destination/file.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L60)* + +___ + + +### `` path + +**● path**: *`string`* + +*Defined in [source-destination/file.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L60)* + +___ + + +### `` OpenFlags + +**● OpenFlags**: *[OpenFlags](../enums/openflags.md)* = OpenFlags + +*Defined in [source-destination/file.ts:56](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L56)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _canRead + +▸ **_canRead**(): `boolean` + +*Defined in [source-destination/file.ts:64](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L64)* + +**Returns:** `boolean` + +___ + + +### `` _canWrite + +▸ **_canWrite**(): `boolean` + +*Defined in [source-destination/file.ts:72](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L72)* + +**Returns:** `boolean` + +___ + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/file.ts:156](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L156)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/file.ts:99](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L99)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/file.ts:152](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L152)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/file.ts:87](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L87)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/file.ts:95](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L95)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/file.ts:91](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L91)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/file.ts:79](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L79)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/file.ts:83](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L83)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/file.ts:124](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L124)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWriteStream](sparsewritestream.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/file.ts:146](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L146)* + +**Returns:** `Promise`<[SparseWriteStream](sparsewritestream.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/file.ts:137](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L137)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/file.ts:106](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L106)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Overrides [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/file.ts:115](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L115)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/gzipsource.md b/doc/classes/gzipsource.md new file mode 100644 index 00000000..98ea4525 --- /dev/null +++ b/doc/classes/gzipsource.md @@ -0,0 +1,842 @@ +[etcher-sdk](../README.md) > [GZipSource](../classes/gzipsource.md) + +# Class: GZipSource + +## Hierarchy + +↳ [CompressedSource](compressedsource.md) + +**↳ GZipSource** + +## Index + +### Constructors + +* [constructor](gzipsource.md#constructor) + +### Properties + +* [isSizeEstimated](gzipsource.md#issizeestimated) +* [source](gzipsource.md#source) +* [defaultMaxListeners](gzipsource.md#defaultmaxlisteners) +* [imageExtensions](gzipsource.md#imageextensions) +* [mimetype](gzipsource.md#mimetype) +* [requiresRandomReadableSource](gzipsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](gzipsource.md#_close) +* [_getMetadata](gzipsource.md#_getmetadata) +* [_open](gzipsource.md#_open) +* [addListener](gzipsource.md#addlistener) +* [canCreateReadStream](gzipsource.md#cancreatereadstream) +* [canCreateSparseReadStream](gzipsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](gzipsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](gzipsource.md#cancreatewritestream) +* [canRead](gzipsource.md#canread) +* [canWrite](gzipsource.md#canwrite) +* [close](gzipsource.md#close) +* [createReadStream](gzipsource.md#createreadstream) +* [createSparseReadStream](gzipsource.md#createsparsereadstream) +* [createSparseWriteStream](gzipsource.md#createsparsewritestream) +* [createTransform](gzipsource.md#createtransform) +* [createVerifier](gzipsource.md#createverifier) +* [createWriteStream](gzipsource.md#createwritestream) +* [emit](gzipsource.md#emit) +* [eventNames](gzipsource.md#eventnames) +* [getBlocks](gzipsource.md#getblocks) +* [getInnerSource](gzipsource.md#getinnersource) +* [getMaxListeners](gzipsource.md#getmaxlisteners) +* [getMetadata](gzipsource.md#getmetadata) +* [getPartitionTable](gzipsource.md#getpartitiontable) +* [getSize](gzipsource.md#getsize) +* [listenerCount](gzipsource.md#listenercount) +* [listeners](gzipsource.md#listeners) +* [on](gzipsource.md#on) +* [once](gzipsource.md#once) +* [open](gzipsource.md#open) +* [prependListener](gzipsource.md#prependlistener) +* [prependOnceListener](gzipsource.md#prependoncelistener) +* [read](gzipsource.md#read) +* [removeAllListeners](gzipsource.md#removealllisteners) +* [removeListener](gzipsource.md#removelistener) +* [setMaxListeners](gzipsource.md#setmaxlisteners) +* [write](gzipsource.md#write) +* [listenerCount](gzipsource.md#listenercount-1) +* [register](gzipsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new GZipSource**(source: *[SourceDestination](sourcedestination.md)*): [GZipSource](gzipsource.md) + +*Inherited from [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [GZipSource](gzipsource.md) + +___ + +## Properties + + + +### isSizeEstimated + +**● isSizeEstimated**: *`boolean`* = true + +*Overrides [CompressedSource](compressedsource.md).[isSizeEstimated](compressedsource.md#issizeestimated)* + +*Defined in [source-destination/gzip.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/gzip.ts#L27)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### `` mimetype + +**● mimetype**: *"application/gzip"* = "application/gzip" + +*Overrides [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/gzip.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/gzip.ts#L26)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [CompressedSource](compressedsource.md).[_getMetadata](compressedsource.md#_getmetadata)* + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/compressed-source.ts:84](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L84)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Inherited from [CompressedSource](compressedsource.md).[canCreateReadStream](compressedsource.md#cancreatereadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/compressed-source.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L50)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +*Inherited from [CompressedSource](compressedsource.md).[createReadStream](compressedsource.md#createreadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/compressed-source.ts:54](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L54)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### `` createTransform + +▸ **createTransform**(): `Transform` + +*Overrides [CompressedSource](compressedsource.md).[createTransform](compressedsource.md#createtransform)* + +*Defined in [source-destination/gzip.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/gzip.ts#L29)* + +**Returns:** `Transform` + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getSize + +▸ **getSize**(): `Promise`<`number` \| `undefined`> + +*Overrides [CompressedSource](compressedsource.md).[getSize](compressedsource.md#getsize)* + +*Defined in [source-destination/gzip.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/gzip.ts#L33)* + +**Returns:** `Promise`<`number` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/http.md b/doc/classes/http.md new file mode 100644 index 00000000..03608b4d --- /dev/null +++ b/doc/classes/http.md @@ -0,0 +1,847 @@ +[etcher-sdk](../README.md) > [Http](../classes/http.md) + +# Class: Http + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ Http** + +## Index + +### Constructors + +* [constructor](http.md#constructor) + +### Properties + +* [acceptsRange](http.md#acceptsrange) +* [error](http.md#error) +* [ready](http.md#ready) +* [size](http.md#size) +* [url](http.md#url) +* [defaultMaxListeners](http.md#defaultmaxlisteners) +* [imageExtensions](http.md#imageextensions) +* [mimetype](http.md#mimetype) + +### Methods + +* [_close](http.md#_close) +* [_getMetadata](http.md#_getmetadata) +* [_open](http.md#_open) +* [addListener](http.md#addlistener) +* [canCreateReadStream](http.md#cancreatereadstream) +* [canCreateSparseReadStream](http.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](http.md#cancreatesparsewritestream) +* [canCreateWriteStream](http.md#cancreatewritestream) +* [canRead](http.md#canread) +* [canWrite](http.md#canwrite) +* [close](http.md#close) +* [createReadStream](http.md#createreadstream) +* [createSparseReadStream](http.md#createsparsereadstream) +* [createSparseWriteStream](http.md#createsparsewritestream) +* [createVerifier](http.md#createverifier) +* [createWriteStream](http.md#createwritestream) +* [emit](http.md#emit) +* [eventNames](http.md#eventnames) +* [getBlocks](http.md#getblocks) +* [getInfo](http.md#getinfo) +* [getInnerSource](http.md#getinnersource) +* [getMaxListeners](http.md#getmaxlisteners) +* [getMetadata](http.md#getmetadata) +* [getPartitionTable](http.md#getpartitiontable) +* [getRange](http.md#getrange) +* [listenerCount](http.md#listenercount) +* [listeners](http.md#listeners) +* [on](http.md#on) +* [once](http.md#once) +* [open](http.md#open) +* [prependListener](http.md#prependlistener) +* [prependOnceListener](http.md#prependoncelistener) +* [read](http.md#read) +* [removeAllListeners](http.md#removealllisteners) +* [removeListener](http.md#removelistener) +* [setMaxListeners](http.md#setmaxlisteners) +* [write](http.md#write) +* [listenerCount](http.md#listenercount-1) +* [register](http.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new Http**(url: *`string`*): [Http](http.md) + +*Defined in [source-destination/http.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L31)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| url | `string` | + +**Returns:** [Http](http.md) + +___ + +## Properties + + + +### `` acceptsRange + +**● acceptsRange**: *`boolean`* + +*Defined in [source-destination/http.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L29)* + +___ + + +### `` error + +**● error**: *`Error`* + +*Defined in [source-destination/http.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L31)* + +___ + + +### `` ready + +**● ready**: *`Promise`<`void`>* + +*Defined in [source-destination/http.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L30)* + +___ + + +### `` size + +**● size**: *`number`* + +*Defined in [source-destination/http.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L28)* + +___ + + +### `` url + +**● url**: *`string`* + +*Defined in [source-destination/http.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L33)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/http.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L60)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/http.ts:56](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L56)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/http.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L48)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/http.ts:105](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L105)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### `` getInfo + +▸ **getInfo**(): `Promise`<`void`> + +*Defined in [source-destination/http.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L38)* + +**Returns:** `Promise`<`void`> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getRange + +▸ **getRange**(start?: *`number`*, end?: *`undefined` \| `number`*): `string` + +*Defined in [source-destination/http.ts:76](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L76)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `string` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/http.ts:85](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/http.ts#L85)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/multidestination.md b/doc/classes/multidestination.md new file mode 100644 index 00000000..e64f8cb9 --- /dev/null +++ b/doc/classes/multidestination.md @@ -0,0 +1,858 @@ +[etcher-sdk](../README.md) > [MultiDestination](../classes/multidestination.md) + +# Class: MultiDestination + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ MultiDestination** + +## Index + +### Constructors + +* [constructor](multidestination.md#constructor) + +### Properties + +* [destinations](multidestination.md#destinations) +* [erroredDestinations](multidestination.md#erroreddestinations) +* [defaultMaxListeners](multidestination.md#defaultmaxlisteners) +* [imageExtensions](multidestination.md#imageextensions) +* [mimetype](multidestination.md#mimetype) + +### Accessors + +* [activeDestinations](multidestination.md#activedestinations) + +### Methods + +* [_close](multidestination.md#_close) +* [_getMetadata](multidestination.md#_getmetadata) +* [_open](multidestination.md#_open) +* [addListener](multidestination.md#addlistener) +* [can](multidestination.md#can) +* [canCreateReadStream](multidestination.md#cancreatereadstream) +* [canCreateSparseReadStream](multidestination.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](multidestination.md#cancreatesparsewritestream) +* [canCreateWriteStream](multidestination.md#cancreatewritestream) +* [canRead](multidestination.md#canread) +* [canWrite](multidestination.md#canwrite) +* [close](multidestination.md#close) +* [createReadStream](multidestination.md#createreadstream) +* [createSparseReadStream](multidestination.md#createsparsereadstream) +* [createSparseWriteStream](multidestination.md#createsparsewritestream) +* [createStream](multidestination.md#createstream) +* [createVerifier](multidestination.md#createverifier) +* [createWriteStream](multidestination.md#createwritestream) +* [destinationError](multidestination.md#destinationerror) +* [emit](multidestination.md#emit) +* [eventNames](multidestination.md#eventnames) +* [getBlocks](multidestination.md#getblocks) +* [getInnerSource](multidestination.md#getinnersource) +* [getMaxListeners](multidestination.md#getmaxlisteners) +* [getMetadata](multidestination.md#getmetadata) +* [getPartitionTable](multidestination.md#getpartitiontable) +* [listenerCount](multidestination.md#listenercount) +* [listeners](multidestination.md#listeners) +* [on](multidestination.md#on) +* [once](multidestination.md#once) +* [open](multidestination.md#open) +* [prependListener](multidestination.md#prependlistener) +* [prependOnceListener](multidestination.md#prependoncelistener) +* [read](multidestination.md#read) +* [removeAllListeners](multidestination.md#removealllisteners) +* [removeListener](multidestination.md#removelistener) +* [setMaxListeners](multidestination.md#setmaxlisteners) +* [write](multidestination.md#write) +* [listenerCount](multidestination.md#listenercount-1) +* [register](multidestination.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new MultiDestination**(destinations: *[SourceDestination](sourcedestination.md)[]*): [MultiDestination](multidestination.md) + +*Defined in [source-destination/multi-destination.ts:104](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L104)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destinations | [SourceDestination](sourcedestination.md)[] | + +**Returns:** [MultiDestination](multidestination.md) + +___ + +## Properties + + + +### destinations + +**● destinations**: *`Set`<[SourceDestination](sourcedestination.md)>* = new Set() + +*Defined in [source-destination/multi-destination.ts:103](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L103)* + +___ + + +### erroredDestinations + +**● erroredDestinations**: *`Set`<[SourceDestination](sourcedestination.md)>* = new Set() + +*Defined in [source-destination/multi-destination.ts:104](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L104)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Accessors + + + +### activeDestinations + +**get activeDestinations**(): `Set`<[SourceDestination](sourcedestination.md)> + +*Defined in [source-destination/multi-destination.ts:135](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L135)* + +**Returns:** `Set`<[SourceDestination](sourcedestination.md)> + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/multi-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L329)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/multi-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L319)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` can + +▸ **can**(methodName: *"canRead" \| "canWrite" \| "canCreateReadStream" \| "canCreateSparseReadStream" \| "canCreateWriteStream" \| "canCreateSparseWriteStream"*): `Promise`<`boolean`> + +*Defined in [source-destination/multi-destination.ts:139](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L139)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| methodName | "canRead" \| "canWrite" \| "canCreateReadStream" \| "canCreateSparseReadStream" \| "canCreateWriteStream" \| "canCreateSparseWriteStream" | + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/multi-destination.ts:166](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L166)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/multi-destination.ts:170](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L170)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/multi-destination.ts:178](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L178)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/multi-destination.ts:174](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L174)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/multi-destination.ts:158](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L158)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/multi-destination.ts:162](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L162)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(...args: *`any`[]*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/multi-destination.ts:219](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L219)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Rest` args | `any`[] | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(...args: *`any`[]*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/multi-destination.ts:228](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L228)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Rest` args | `any`[] | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/multi-destination.ts:308](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L308)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### `` createStream + +▸ **createStream**(methodName: *"createWriteStream" \| "createSparseWriteStream"*): `Promise`<`PassThrough`> + +*Defined in [source-destination/multi-destination.ts:235](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L235)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| methodName | "createWriteStream" \| "createSparseWriteStream" | + +**Returns:** `Promise`<`PassThrough`> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Overrides [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/multi-destination.ts:312](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L312)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/multi-destination.ts:304](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L304)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### destinationError + +▸ **destinationError**(destination: *[SourceDestination](sourcedestination.md)*, error: *`Error`*, stream?: *`EventEmitter`*): `void` + +*Defined in [source-destination/multi-destination.ts:116](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L116)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | [SourceDestination](sourcedestination.md) | +| error | `Error` | +| `Optional` stream | `EventEmitter` | + +**Returns:** `void` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/multi-destination.ts:182](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L182)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Overrides [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/multi-destination.ts:197](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L197)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/multidestinationerror.md b/doc/classes/multidestinationerror.md new file mode 100644 index 00000000..8945c7a5 --- /dev/null +++ b/doc/classes/multidestinationerror.md @@ -0,0 +1,113 @@ +[etcher-sdk](../README.md) > [MultiDestinationError](../classes/multidestinationerror.md) + +# Class: MultiDestinationError + +## Hierarchy + + `Error` + +**↳ MultiDestinationError** + +## Index + +### Constructors + +* [constructor](multidestinationerror.md#constructor) + +### Properties + +* [destination](multidestinationerror.md#destination) +* [error](multidestinationerror.md#error) +* [message](multidestinationerror.md#message) +* [name](multidestinationerror.md#name) +* [stack](multidestinationerror.md#stack) +* [Error](multidestinationerror.md#error-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new MultiDestinationError**(error: *`Error`*, destination: *[SourceDestination](sourcedestination.md)*): [MultiDestinationError](multidestinationerror.md) + +*Defined in [source-destination/multi-destination.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L35)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| error | `Error` | +| destination | [SourceDestination](sourcedestination.md) | + +**Returns:** [MultiDestinationError](multidestinationerror.md) + +___ + +## Properties + + + +### destination + +**● destination**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/multi-destination.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L36)* + +___ + + +### error + +**● error**: *`Error`* + +*Defined in [source-destination/multi-destination.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L36)* + +___ + + +### message + +**● message**: *`string`* + +*Inherited from Error.message* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964* + +___ + + +### name + +**● name**: *`string`* + +*Inherited from Error.name* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:963* + +___ + + +### `` stack + +**● stack**: *`undefined` \| `string`* + +*Inherited from Error.stack* + +*Overrides Error.stack* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965* + +___ + + +### `` Error + +**● Error**: *`ErrorConstructor`* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974* + +___ + diff --git a/doc/classes/multidestinationverifier.md b/doc/classes/multidestinationverifier.md new file mode 100644 index 00000000..94deaa6c --- /dev/null +++ b/doc/classes/multidestinationverifier.md @@ -0,0 +1,497 @@ +[etcher-sdk](../README.md) > [MultiDestinationVerifier](../classes/multidestinationverifier.md) + +# Class: MultiDestinationVerifier + +## Hierarchy + +↳ [Verifier](verifier.md) + +**↳ MultiDestinationVerifier** + +## Index + +### Constructors + +* [constructor](multidestinationverifier.md#constructor) + +### Properties + +* [timer](multidestinationverifier.md#timer) +* [verifiers](multidestinationverifier.md#verifiers) +* [defaultMaxListeners](multidestinationverifier.md#defaultmaxlisteners) + +### Methods + +* [addListener](multidestinationverifier.md#addlistener) +* [emit](multidestinationverifier.md#emit) +* [emitProgress](multidestinationverifier.md#emitprogress) +* [eventNames](multidestinationverifier.md#eventnames) +* [getMaxListeners](multidestinationverifier.md#getmaxlisteners) +* [handleEventsAndPipe](multidestinationverifier.md#handleeventsandpipe) +* [listenerCount](multidestinationverifier.md#listenercount) +* [listeners](multidestinationverifier.md#listeners) +* [on](multidestinationverifier.md#on) +* [once](multidestinationverifier.md#once) +* [oneVerifierFinished](multidestinationverifier.md#oneverifierfinished) +* [prependListener](multidestinationverifier.md#prependlistener) +* [prependOnceListener](multidestinationverifier.md#prependoncelistener) +* [removeAllListeners](multidestinationverifier.md#removealllisteners) +* [removeListener](multidestinationverifier.md#removelistener) +* [run](multidestinationverifier.md#run) +* [setMaxListeners](multidestinationverifier.md#setmaxlisteners) +* [listenerCount](multidestinationverifier.md#listenercount-1) + +### Object literals + +* [progress](multidestinationverifier.md#progress) + +--- + +## Constructors + + + +### constructor + +⊕ **new MultiDestinationVerifier**(source: *[MultiDestination](multidestination.md)*, checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [MultiDestinationVerifier](multidestinationverifier.md) + +*Defined in [source-destination/multi-destination.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L43)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [MultiDestination](multidestination.md) | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [MultiDestinationVerifier](multidestinationverifier.md) + +___ + +## Properties + + + +### `` timer + +**● timer**: *`Timer`* + +*Defined in [source-destination/multi-destination.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L43)* + +___ + + +### `` verifiers + +**● verifiers**: *`Set`<[Verifier](verifier.md)>* = new Set() + +*Defined in [source-destination/multi-destination.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L42)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### `` emitProgress + +▸ **emitProgress**(): `void` + +*Defined in [source-destination/multi-destination.ts:76](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L76)* + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` handleEventsAndPipe + +▸ **handleEventsAndPipe**(stream: *`ReadableStream`*, meter: *`WritableStream`*): `void` + +*Inherited from [Verifier](verifier.md).[handleEventsAndPipe](verifier.md#handleeventsandpipe)* + +*Defined in [source-destination/source-destination.ts:134](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L134)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | +| meter | `WritableStream` | + +**Returns:** `void` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` oneVerifierFinished + +▸ **oneVerifierFinished**(verifier: *[Verifier](verifier.md)*): `void` + +*Defined in [source-destination/multi-destination.ts:64](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L64)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| verifier | [Verifier](verifier.md) | + +**Returns:** `void` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### run + +▸ **run**(): `Promise`<`void`> + +*Overrides [Verifier](verifier.md).[run](verifier.md#run)* + +*Defined in [source-destination/multi-destination.ts:86](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/multi-destination.ts#L86)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + +## Object literals + + + +### progress + +**progress**: *`object`* + +*Inherited from [Verifier](verifier.md).[progress](verifier.md#progress)* + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + + + +#### bytes + +**● bytes**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### position + +**● position**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### speed + +**● speed**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + +___ + diff --git a/doc/classes/notcapable.md b/doc/classes/notcapable.md new file mode 100644 index 00000000..c05cdef6 --- /dev/null +++ b/doc/classes/notcapable.md @@ -0,0 +1,68 @@ +[etcher-sdk](../README.md) > [NotCapable](../classes/notcapable.md) + +# Class: NotCapable + +## Hierarchy + + `Error` + +**↳ NotCapable** + +## Index + +### Properties + +* [message](notcapable.md#message) +* [name](notcapable.md#name) +* [stack](notcapable.md#stack) +* [Error](notcapable.md#error) + +--- + +## Properties + + + +### message + +**● message**: *`string`* + +*Inherited from Error.message* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964* + +___ + + +### name + +**● name**: *`string`* + +*Inherited from Error.name* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:963* + +___ + + +### `` stack + +**● stack**: *`undefined` \| `string`* + +*Inherited from Error.stack* + +*Overrides Error.stack* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965* + +___ + + +### `` Error + +**● Error**: *`ErrorConstructor`* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974* + +___ + diff --git a/doc/classes/randomaccesszipsource.md b/doc/classes/randomaccesszipsource.md new file mode 100644 index 00000000..036fc4db --- /dev/null +++ b/doc/classes/randomaccesszipsource.md @@ -0,0 +1,973 @@ +[etcher-sdk](../README.md) > [RandomAccessZipSource](../classes/randomaccesszipsource.md) + +# Class: RandomAccessZipSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ RandomAccessZipSource** + +## Index + +### Constructors + +* [constructor](randomaccesszipsource.md#constructor) + +### Properties + +* [entries](randomaccesszipsource.md#entries) +* [match](randomaccesszipsource.md#match) +* [ready](randomaccesszipsource.md#ready) +* [source](randomaccesszipsource.md#source) +* [zip](randomaccesszipsource.md#zip) +* [defaultMaxListeners](randomaccesszipsource.md#defaultmaxlisteners) +* [imageExtensions](randomaccesszipsource.md#imageextensions) +* [manifestFields](randomaccesszipsource.md#manifestfields) +* [mimetype](randomaccesszipsource.md#mimetype) +* [requiresRandomReadableSource](randomaccesszipsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](randomaccesszipsource.md#_close) +* [_getMetadata](randomaccesszipsource.md#_getmetadata) +* [_open](randomaccesszipsource.md#_open) +* [addListener](randomaccesszipsource.md#addlistener) +* [canCreateReadStream](randomaccesszipsource.md#cancreatereadstream) +* [canCreateSparseReadStream](randomaccesszipsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](randomaccesszipsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](randomaccesszipsource.md#cancreatewritestream) +* [canRead](randomaccesszipsource.md#canread) +* [canWrite](randomaccesszipsource.md#canwrite) +* [close](randomaccesszipsource.md#close) +* [createReadStream](randomaccesszipsource.md#createreadstream) +* [createSparseReadStream](randomaccesszipsource.md#createsparsereadstream) +* [createSparseWriteStream](randomaccesszipsource.md#createsparsewritestream) +* [createVerifier](randomaccesszipsource.md#createverifier) +* [createWriteStream](randomaccesszipsource.md#createwritestream) +* [emit](randomaccesszipsource.md#emit) +* [eventNames](randomaccesszipsource.md#eventnames) +* [getBlocks](randomaccesszipsource.md#getblocks) +* [getEntries](randomaccesszipsource.md#getentries) +* [getEntryByName](randomaccesszipsource.md#getentrybyname) +* [getImageEntry](randomaccesszipsource.md#getimageentry) +* [getInnerSource](randomaccesszipsource.md#getinnersource) +* [getJson](randomaccesszipsource.md#getjson) +* [getMaxListeners](randomaccesszipsource.md#getmaxlisteners) +* [getMetadata](randomaccesszipsource.md#getmetadata) +* [getPartitionTable](randomaccesszipsource.md#getpartitiontable) +* [getStream](randomaccesszipsource.md#getstream) +* [getString](randomaccesszipsource.md#getstring) +* [init](randomaccesszipsource.md#init) +* [listenerCount](randomaccesszipsource.md#listenercount) +* [listeners](randomaccesszipsource.md#listeners) +* [on](randomaccesszipsource.md#on) +* [once](randomaccesszipsource.md#once) +* [open](randomaccesszipsource.md#open) +* [prependListener](randomaccesszipsource.md#prependlistener) +* [prependOnceListener](randomaccesszipsource.md#prependoncelistener) +* [read](randomaccesszipsource.md#read) +* [removeAllListeners](randomaccesszipsource.md#removealllisteners) +* [removeListener](randomaccesszipsource.md#removelistener) +* [setMaxListeners](randomaccesszipsource.md#setmaxlisteners) +* [write](randomaccesszipsource.md#write) +* [listenerCount](randomaccesszipsource.md#listenercount-1) +* [register](randomaccesszipsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new RandomAccessZipSource**(source: *[SourceDestination](sourcedestination.md)*, match?: *`function`*): [RandomAccessZipSource](randomaccesszipsource.md) + +*Overrides [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/zip.ts:162](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L162)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | - | +| `Default value` match | `function` | matchSupportedExtensions | + +**Returns:** [RandomAccessZipSource](randomaccesszipsource.md) + +___ + +## Properties + + + +### `` entries + +**● entries**: *`Entry`[]* = [] + +*Defined in [source-destination/zip.ts:162](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L162)* + +___ + + +### `` match + +**● match**: *`function`* + +*Defined in [source-destination/zip.ts:166](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L166)* + +#### Type declaration +▸(filename: *`string`*): `boolean` + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| filename | `string` | + +**Returns:** `boolean` + +___ + + +### `` ready + +**● ready**: *`Promise`<`void`>* + +*Defined in [source-destination/zip.ts:161](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L161)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` zip + +**● zip**: *`ZipFile`* + +*Defined in [source-destination/zip.ts:160](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L160)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` manifestFields + +**● manifestFields**: *`Array`<`keyof Metadata`>* = [ + 'bytesToZeroOutFromTheBeginning', + 'checksum', + 'checksumType', + 'recommendedDriveSize', + 'releaseNotesUrl', + 'supportUrl', + 'url', + 'version', + ] + +*Defined in [source-destination/zip.ts:150](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L150)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/zip.ts:310](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L310)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Defined in [source-destination/zip.ts:227](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L227)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/zip.ts:198](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L198)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/zip.ts:202](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L202)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/zip.ts:271](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L271)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(generateChecksums?: *`boolean`*): `Promise`<[SparseFilterStream](sparsefilterstream.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/zip.ts:292](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L292)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseFilterStream](sparsefilterstream.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### `` getEntries + +▸ **getEntries**(): `Promise`<`Entry`[]> + +*Defined in [source-destination/zip.ts:207](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L207)* + +**Returns:** `Promise`<`Entry`[]> + +___ + + +### `` getEntryByName + +▸ **getEntryByName**(name: *`string`*): `Promise`<`Entry` \| `undefined`> + +*Defined in [source-destination/zip.ts:233](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L233)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| name | `string` | + +**Returns:** `Promise`<`Entry` \| `undefined`> + +___ + + +### `` getImageEntry + +▸ **getImageEntry**(): `Promise`<`Entry`> + +*Defined in [source-destination/zip.ts:212](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L212)* + +**Returns:** `Promise`<`Entry`> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### `` getJson + +▸ **getJson**(name: *`string`*): `Promise`<`any`> + +*Defined in [source-destination/zip.ts:264](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L264)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| name | `string` | + +**Returns:** `Promise`<`any`> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getStream + +▸ **getStream**(name: *`string`*): `Promise`<`ReadableStream` \| `undefined`> + +*Defined in [source-destination/zip.ts:242](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L242)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| name | `string` | + +**Returns:** `Promise`<`ReadableStream` \| `undefined`> + +___ + + +### `` getString + +▸ **getString**(name: *`string`*): `Promise`<`string` \| `undefined`> + +*Defined in [source-destination/zip.ts:256](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L256)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| name | `string` | + +**Returns:** `Promise`<`string` \| `undefined`> + +___ + + +### `` init + +▸ **init**(): `Promise`<`void`> + +*Defined in [source-destination/zip.ts:172](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L172)* + +**Returns:** `Promise`<`void`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/scanner.md b/doc/classes/scanner.md new file mode 100644 index 00000000..525662c1 --- /dev/null +++ b/doc/classes/scanner.md @@ -0,0 +1,463 @@ +[etcher-sdk](../README.md) > [Scanner](../classes/scanner.md) + +# Class: Scanner + +## Hierarchy + + `EventEmitter` + +**↳ Scanner** + +## Index + +### Constructors + +* [constructor](scanner.md#constructor) + +### Properties + +* [adapters](scanner.md#adapters) +* [drives](scanner.md#drives) +* [defaultMaxListeners](scanner.md#defaultmaxlisteners) + +### Methods + +* [addListener](scanner.md#addlistener) +* [emit](scanner.md#emit) +* [eventNames](scanner.md#eventnames) +* [getBy](scanner.md#getby) +* [getMaxListeners](scanner.md#getmaxlisteners) +* [listenerCount](scanner.md#listenercount) +* [listeners](scanner.md#listeners) +* [on](scanner.md#on) +* [onAttach](scanner.md#onattach) +* [onDetach](scanner.md#ondetach) +* [once](scanner.md#once) +* [prependListener](scanner.md#prependlistener) +* [prependOnceListener](scanner.md#prependoncelistener) +* [removeAllListeners](scanner.md#removealllisteners) +* [removeListener](scanner.md#removelistener) +* [setMaxListeners](scanner.md#setmaxlisteners) +* [start](scanner.md#start) +* [stop](scanner.md#stop) +* [listenerCount](scanner.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new Scanner**(adapters: *[Adapter](adapter.md)[]*): [Scanner](scanner.md) + +*Defined in [scanner/scanner.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L25)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| adapters | [Adapter](adapter.md)[] | + +**Returns:** [Scanner](scanner.md) + +___ + +## Properties + + + +### `` adapters + +**● adapters**: *[Adapter](adapter.md)[]* + +*Defined in [scanner/scanner.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L27)* + +___ + + +### drives + +**● drives**: *`Set`<[AdapterSourceDestination](../interfaces/adaptersourcedestination.md)>* = new Set() + +*Defined in [scanner/scanner.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L25)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBy + +▸ **getBy**(field: *"raw" \| "device" \| "devicePath"*, value: *`string`*): [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) \| `undefined` + +*Defined in [scanner/scanner.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L46)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| field | "raw" \| "device" \| "devicePath" | +| value | `string` | + +**Returns:** [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) \| `undefined` + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` onAttach + +▸ **onAttach**(drive: *[AdapterSourceDestination](../interfaces/adaptersourcedestination.md)*): `void` + +*Defined in [scanner/scanner.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L36)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| drive | [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) | + +**Returns:** `void` + +___ + + +### `` onDetach + +▸ **onDetach**(drive: *[AdapterSourceDestination](../interfaces/adaptersourcedestination.md)*): `void` + +*Defined in [scanner/scanner.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L41)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| drive | [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) | + +**Returns:** `void` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### start + +▸ **start**(): `Promise`<`void`> + +*Defined in [scanner/scanner.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L57)* + +**Returns:** `Promise`<`void`> + +___ + + +### stop + +▸ **stop**(): `void` + +*Defined in [scanner/scanner.ts:74](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/scanner.ts#L74)* + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/singleusestreamsource.md b/doc/classes/singleusestreamsource.md new file mode 100644 index 00000000..0fd607cf --- /dev/null +++ b/doc/classes/singleusestreamsource.md @@ -0,0 +1,786 @@ +[etcher-sdk](../README.md) > [SingleUseStreamSource](../classes/singleusestreamsource.md) + +# Class: SingleUseStreamSource + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ SingleUseStreamSource** + +## Index + +### Constructors + +* [constructor](singleusestreamsource.md#constructor) + +### Properties + +* [stream](singleusestreamsource.md#stream) +* [used](singleusestreamsource.md#used) +* [defaultMaxListeners](singleusestreamsource.md#defaultmaxlisteners) +* [imageExtensions](singleusestreamsource.md#imageextensions) +* [mimetype](singleusestreamsource.md#mimetype) + +### Methods + +* [_close](singleusestreamsource.md#_close) +* [_getMetadata](singleusestreamsource.md#_getmetadata) +* [_open](singleusestreamsource.md#_open) +* [addListener](singleusestreamsource.md#addlistener) +* [canCreateReadStream](singleusestreamsource.md#cancreatereadstream) +* [canCreateSparseReadStream](singleusestreamsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](singleusestreamsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](singleusestreamsource.md#cancreatewritestream) +* [canRead](singleusestreamsource.md#canread) +* [canWrite](singleusestreamsource.md#canwrite) +* [close](singleusestreamsource.md#close) +* [createReadStream](singleusestreamsource.md#createreadstream) +* [createSparseReadStream](singleusestreamsource.md#createsparsereadstream) +* [createSparseWriteStream](singleusestreamsource.md#createsparsewritestream) +* [createVerifier](singleusestreamsource.md#createverifier) +* [createWriteStream](singleusestreamsource.md#createwritestream) +* [emit](singleusestreamsource.md#emit) +* [eventNames](singleusestreamsource.md#eventnames) +* [getBlocks](singleusestreamsource.md#getblocks) +* [getInnerSource](singleusestreamsource.md#getinnersource) +* [getMaxListeners](singleusestreamsource.md#getmaxlisteners) +* [getMetadata](singleusestreamsource.md#getmetadata) +* [getPartitionTable](singleusestreamsource.md#getpartitiontable) +* [listenerCount](singleusestreamsource.md#listenercount) +* [listeners](singleusestreamsource.md#listeners) +* [on](singleusestreamsource.md#on) +* [once](singleusestreamsource.md#once) +* [open](singleusestreamsource.md#open) +* [prependListener](singleusestreamsource.md#prependlistener) +* [prependOnceListener](singleusestreamsource.md#prependoncelistener) +* [read](singleusestreamsource.md#read) +* [removeAllListeners](singleusestreamsource.md#removealllisteners) +* [removeListener](singleusestreamsource.md#removelistener) +* [setMaxListeners](singleusestreamsource.md#setmaxlisteners) +* [write](singleusestreamsource.md#write) +* [listenerCount](singleusestreamsource.md#listenercount-1) +* [register](singleusestreamsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new SingleUseStreamSource**(stream: *`ReadableStream`*): [SingleUseStreamSource](singleusestreamsource.md) + +*Defined in [source-destination/single-use-stream-source.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/single-use-stream-source.ts#L23)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | + +**Returns:** [SingleUseStreamSource](singleusestreamsource.md) + +___ + +## Properties + + + +### `` stream + +**● stream**: *`ReadableStream`* + +*Defined in [source-destination/single-use-stream-source.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/single-use-stream-source.ts#L25)* + +___ + + +### `` used + +**● used**: *`boolean`* = false + +*Defined in [source-destination/single-use-stream-source.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/single-use-stream-source.ts#L23)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/single-use-stream-source.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/single-use-stream-source.ts#L29)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/single-use-stream-source.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/single-use-stream-source.ts#L33)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/sourcedestination.md b/doc/classes/sourcedestination.md new file mode 100644 index 00000000..88173ffe --- /dev/null +++ b/doc/classes/sourcedestination.md @@ -0,0 +1,782 @@ +[etcher-sdk](../README.md) > [SourceDestination](../classes/sourcedestination.md) + +# Class: SourceDestination + +## Hierarchy + + `EventEmitter` + +**↳ SourceDestination** + +↳ [SourceSource](sourcesource.md) + +↳ [File](file.md) + +↳ [MultiDestination](multidestination.md) + +↳ [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) + +↳ [UsbbootDrive](usbbootdrive.md) + +↳ [DriverlessDevice](driverlessdevice.md) + +↳ [Http](http.md) + +↳ [BalenaS3Source](balenas3source.md) + +↳ [SingleUseStreamSource](singleusestreamsource.md) + +## Index + +### Properties + +* [isOpen](sourcedestination.md#isopen) +* [metadata](sourcedestination.md#metadata) +* [defaultMaxListeners](sourcedestination.md#defaultmaxlisteners) +* [imageExtensions](sourcedestination.md#imageextensions) +* [mimetype](sourcedestination.md#mimetype) +* [mimetypes](sourcedestination.md#mimetypes) + +### Methods + +* [_close](sourcedestination.md#_close) +* [_getMetadata](sourcedestination.md#_getmetadata) +* [_open](sourcedestination.md#_open) +* [addListener](sourcedestination.md#addlistener) +* [canCreateReadStream](sourcedestination.md#cancreatereadstream) +* [canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream) +* [canCreateWriteStream](sourcedestination.md#cancreatewritestream) +* [canRead](sourcedestination.md#canread) +* [canWrite](sourcedestination.md#canwrite) +* [close](sourcedestination.md#close) +* [createReadStream](sourcedestination.md#createreadstream) +* [createSparseReadStream](sourcedestination.md#createsparsereadstream) +* [createSparseWriteStream](sourcedestination.md#createsparsewritestream) +* [createVerifier](sourcedestination.md#createverifier) +* [createWriteStream](sourcedestination.md#createwritestream) +* [emit](sourcedestination.md#emit) +* [eventNames](sourcedestination.md#eventnames) +* [getBlocks](sourcedestination.md#getblocks) +* [getInnerSource](sourcedestination.md#getinnersource) +* [getInnerSourceHelper](sourcedestination.md#getinnersourcehelper) +* [getMaxListeners](sourcedestination.md#getmaxlisteners) +* [getMetadata](sourcedestination.md#getmetadata) +* [getMimeTypeFromContent](sourcedestination.md#getmimetypefromcontent) +* [getMimeTypeFromName](sourcedestination.md#getmimetypefromname) +* [getPartitionTable](sourcedestination.md#getpartitiontable) +* [listenerCount](sourcedestination.md#listenercount) +* [listeners](sourcedestination.md#listeners) +* [on](sourcedestination.md#on) +* [once](sourcedestination.md#once) +* [open](sourcedestination.md#open) +* [prependListener](sourcedestination.md#prependlistener) +* [prependOnceListener](sourcedestination.md#prependoncelistener) +* [read](sourcedestination.md#read) +* [removeAllListeners](sourcedestination.md#removealllisteners) +* [removeListener](sourcedestination.md#removelistener) +* [setMaxListeners](sourcedestination.md#setmaxlisteners) +* [write](sourcedestination.md#write) +* [listenerCount](sourcedestination.md#listenercount-1) +* [register](sourcedestination.md#register) + +--- + +## Properties + + + +### `` isOpen + +**● isOpen**: *`boolean`* = false + +*Defined in [source-destination/source-destination.ts:250](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L250)* + +___ + + +### `` metadata + +**● metadata**: *[Metadata](../interfaces/metadata.md)* + +*Defined in [source-destination/source-destination.ts:249](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L249)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### ```` mimetypes + +**● mimetypes**: *`Map`<`string`, [SourceSource](sourcesource.md)>* = new Map() + +*Defined in [source-destination/source-destination.ts:247](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L247)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:266](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L266)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, _start?: *`number`*, _end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Defined in [source-destination/source-destination.ts:311](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L311)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` _start | `number` | 0 | +| `Optional` _end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### `` getInnerSourceHelper + +▸ **getInnerSourceHelper**(mimetype?: *`undefined` \| `string`*): `Promise`<[SourceDestination](sourcedestination.md)> + +*Defined in [source-destination/source-destination.ts:409](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L409)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` mimetype | `undefined` \| `string` | + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` getMimeTypeFromContent + +▸ **getMimeTypeFromContent**(): `Promise`<`string` \| `undefined`> + +*Defined in [source-destination/source-destination.ts:393](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L393)* + +**Returns:** `Promise`<`string` \| `undefined`> + +___ + + +### `` getMimeTypeFromName + +▸ **getMimeTypeFromName**(): `Promise`<`string` \| `undefined`> + +*Defined in [source-destination/source-destination.ts:382](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L382)* + +**Returns:** `Promise`<`string` \| `undefined`> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/sourcedestinationfs.md b/doc/classes/sourcedestinationfs.md new file mode 100644 index 00000000..3c48cdd6 --- /dev/null +++ b/doc/classes/sourcedestinationfs.md @@ -0,0 +1,139 @@ +[etcher-sdk](../README.md) > [SourceDestinationFs](../classes/sourcedestinationfs.md) + +# Class: SourceDestinationFs + +## Hierarchy + +**SourceDestinationFs** + +## Index + +### Constructors + +* [constructor](sourcedestinationfs.md#constructor) + +### Properties + +* [source](sourcedestinationfs.md#source) + +### Methods + +* [close](sourcedestinationfs.md#close) +* [fstat](sourcedestinationfs.md#fstat) +* [open](sourcedestinationfs.md#open) +* [read](sourcedestinationfs.md#read) + +--- + +## Constructors + + + +### constructor + +⊕ **new SourceDestinationFs**(source: *[SourceDestination](sourcedestination.md)*): [SourceDestinationFs](sourcedestinationfs.md) + +*Defined in [source-destination/source-destination.ts:74](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L74)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [SourceDestinationFs](sourcedestinationfs.md) + +___ + +## Properties + + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/source-destination.ts:76](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L76)* + +___ + +## Methods + + + +### close + +▸ **close**(_fd: *`number`*, callback: *`function`*): `void` + +*Defined in [source-destination/source-destination.ts:86](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L86)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _fd | `number` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### fstat + +▸ **fstat**(_fd: *`number`*, callback: *`function`*): `void` + +*Defined in [source-destination/source-destination.ts:90](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L90)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _fd | `number` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### open + +▸ **open**(_path: *`string`*, _options: *`any`*, callback: *`function`*): `void` + +*Defined in [source-destination/source-destination.ts:78](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L78)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _path | `string` | +| _options | `any` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### read + +▸ **read**(_fd: *`number`*, buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, sourceOffset: *`number`*, callback: *`function`*): `void` + +*Defined in [source-destination/source-destination.ts:106](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L106)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _fd | `number` | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| sourceOffset | `number` | +| callback | `function` | + +**Returns:** `void` + +___ + diff --git a/doc/classes/sourcedisk.md b/doc/classes/sourcedisk.md new file mode 100644 index 00000000..6c89f02f --- /dev/null +++ b/doc/classes/sourcedisk.md @@ -0,0 +1,373 @@ +[etcher-sdk](../README.md) > [SourceDisk](../classes/sourcedisk.md) + +# Class: SourceDisk + +## Hierarchy + + `Disk` + +**↳ SourceDisk** + +## Index + +### Constructors + +* [constructor](sourcedisk.md#constructor) + +### Properties + +* [capacity](sourcedisk.md#capacity) +* [discardIsZero](sourcedisk.md#discardiszero) +* [knownChunks](sourcedisk.md#knownchunks) +* [readOnly](sourcedisk.md#readonly) +* [recordReads](sourcedisk.md#recordreads) +* [recordWrites](sourcedisk.md#recordwrites) +* [source](sourcedisk.md#source) + +### Methods + +* [_flush](sourcedisk.md#_flush) +* [_getCapacity](sourcedisk.md#_getcapacity) +* [_read](sourcedisk.md#_read) +* [_write](sourcedisk.md#_write) +* [discard](sourcedisk.md#discard) +* [flush](sourcedisk.md#flush) +* [getCapacity](sourcedisk.md#getcapacity) +* [getDiscardedChunks](sourcedisk.md#getdiscardedchunks) +* [getRanges](sourcedisk.md#getranges) +* [getStream](sourcedisk.md#getstream) +* [getTransformStream](sourcedisk.md#gettransformstream) +* [read](sourcedisk.md#read) +* [write](sourcedisk.md#write) + +--- + +## Constructors + + + +### constructor + +⊕ **new SourceDisk**(source: *[SourceDestination](sourcedestination.md)*): [SourceDisk](sourcedisk.md) + +*Overrides Disk.__constructor* + +*Defined in [source-destination/configured-source/configured-source.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L43)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [SourceDisk](sourcedisk.md) + +___ + +## Properties + + + +### capacity + +**● capacity**: *`number` \| `null`* + +*Inherited from Disk.capacity* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:26* + +___ + + +### discardIsZero + +**● discardIsZero**: *`boolean`* + +*Inherited from Disk.discardIsZero* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:24* + +___ + + +### knownChunks + +**● knownChunks**: *`DiskChunk`[]* + +*Inherited from Disk.knownChunks* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:25* + +___ + + +### readOnly + +**● readOnly**: *`boolean`* + +*Inherited from Disk.readOnly* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:21* + +___ + + +### recordReads + +**● recordReads**: *`boolean`* + +*Inherited from Disk.recordReads* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:23* + +___ + + +### recordWrites + +**● recordWrites**: *`boolean`* + +*Inherited from Disk.recordWrites* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:22* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/configured-source/configured-source.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L44)* + +___ + +## Methods + + + +### `` _flush + +▸ **_flush**(): `Promise`<`void`> + +*Overrides Disk._flush* + +*Defined in [source-destination/configured-source/configured-source.ts:80](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L80)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getCapacity + +▸ **_getCapacity**(): `Promise`<`number`> + +*Overrides Disk._getCapacity* + +*Defined in [source-destination/configured-source/configured-source.ts:53](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L53)* + +**Returns:** `Promise`<`number`> + +___ + + +### `` _read + +▸ **_read**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`ReadResult`> + +*Overrides Disk._read* + +*Defined in [source-destination/configured-source/configured-source.ts:62](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L62)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### `` _write + +▸ **_write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Overrides Disk._write* + +*Defined in [source-destination/configured-source/configured-source.ts:71](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configured-source.ts#L71)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### discard + +▸ **discard**(offset: *`number`*, length: *`number`*): `Promise`<`void`> + +*Inherited from Disk.discard* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:36* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| offset | `number` | +| length | `number` | + +**Returns:** `Promise`<`void`> + +___ + + +### flush + +▸ **flush**(): `Promise`<`void`> + +*Inherited from Disk.flush* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:35* + +**Returns:** `Promise`<`void`> + +___ + + +### getCapacity + +▸ **getCapacity**(): `Promise`<`number`> + +*Inherited from Disk.getCapacity* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:37* + +**Returns:** `Promise`<`number`> + +___ + + +### getDiscardedChunks + +▸ **getDiscardedChunks**(): `DiskChunk`[] + +*Inherited from Disk.getDiscardedChunks* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:39* + +**Returns:** `DiskChunk`[] + +___ + + +### getRanges + +▸ **getRanges**(blockSize: *`number`*): `Promise`<`Range`[]> + +*Inherited from Disk.getRanges* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:40* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| blockSize | `number` | + +**Returns:** `Promise`<`Range`[]> + +___ + + +### getStream + +▸ **getStream**(position?: *`undefined` \| `number`*, length?: *`number` \| `null`*, highWaterMark?: *`undefined` \| `number`*): `Promise`<`DiskStream`> + +*Inherited from Disk.getStream* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:38* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` position | `undefined` \| `number` | +| `Optional` length | `number` \| `null` | +| `Optional` highWaterMark | `undefined` \| `number` | + +**Returns:** `Promise`<`DiskStream`> + +___ + + +### getTransformStream + +▸ **getTransformStream**(): `Transform` + +*Inherited from Disk.getTransformStream* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:32* + +**Returns:** `Transform` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, _bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`fs.ReadResult`> + +*Inherited from Disk.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:33* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| _bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`fs.ReadResult`> + +___ + + +### write + +▸ **write**(buffer: *`Buffer`*, bufferOffset: *`number`*, length: *`number`*, fileOffset: *`number`*): `Promise`<`fs.WriteResult`> + +*Inherited from Disk.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/file-disk/build/index.d.ts:34* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| bufferOffset | `number` | +| length | `number` | +| fileOffset | `number` | + +**Returns:** `Promise`<`fs.WriteResult`> + +___ + diff --git a/doc/classes/sourcerandomaccessreader.md b/doc/classes/sourcerandomaccessreader.md new file mode 100644 index 00000000..e3686da1 --- /dev/null +++ b/doc/classes/sourcerandomaccessreader.md @@ -0,0 +1,462 @@ +[etcher-sdk](../README.md) > [SourceRandomAccessReader](../classes/sourcerandomaccessreader.md) + +# Class: SourceRandomAccessReader + +## Hierarchy + + `RandomAccessReader` + +**↳ SourceRandomAccessReader** + +## Index + +### Constructors + +* [constructor](sourcerandomaccessreader.md#constructor) + +### Properties + +* [source](sourcerandomaccessreader.md#source) +* [defaultMaxListeners](sourcerandomaccessreader.md#defaultmaxlisteners) + +### Methods + +* [_readStreamForRange](sourcerandomaccessreader.md#_readstreamforrange) +* [addListener](sourcerandomaccessreader.md#addlistener) +* [close](sourcerandomaccessreader.md#close) +* [createReadStream](sourcerandomaccessreader.md#createreadstream) +* [emit](sourcerandomaccessreader.md#emit) +* [eventNames](sourcerandomaccessreader.md#eventnames) +* [getMaxListeners](sourcerandomaccessreader.md#getmaxlisteners) +* [listenerCount](sourcerandomaccessreader.md#listenercount) +* [listeners](sourcerandomaccessreader.md#listeners) +* [on](sourcerandomaccessreader.md#on) +* [once](sourcerandomaccessreader.md#once) +* [prependListener](sourcerandomaccessreader.md#prependlistener) +* [prependOnceListener](sourcerandomaccessreader.md#prependoncelistener) +* [read](sourcerandomaccessreader.md#read) +* [removeAllListeners](sourcerandomaccessreader.md#removealllisteners) +* [removeListener](sourcerandomaccessreader.md#removelistener) +* [setMaxListeners](sourcerandomaccessreader.md#setmaxlisteners) +* [listenerCount](sourcerandomaccessreader.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new SourceRandomAccessReader**(source: *[SourceDestination](sourcedestination.md)*): [SourceRandomAccessReader](sourcerandomaccessreader.md) + +*Defined in [source-destination/zip.ts:128](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L128)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [SourceRandomAccessReader](sourcerandomaccessreader.md) + +___ + +## Properties + + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/zip.ts:129](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L129)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _readStreamForRange + +▸ **_readStreamForRange**(start: *`number`*, end: *`number`*): `PassThrough` + +*Overrides RandomAccessReader._readStreamForRange* + +*Defined in [source-destination/zip.ts:133](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L133)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| start | `number` | +| end | `number` | + +**Returns:** `PassThrough` + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### close + +▸ **close**(callback: *`function`*): `void` + +*Inherited from RandomAccessReader.close* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/yauzl/index.d.ts:15* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| callback | `function` | + +**Returns:** `void` + +___ + + +### createReadStream + +▸ **createReadStream**(options: *`object`*): `void` + +*Inherited from RandomAccessReader.createReadStream* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/yauzl/index.d.ts:13* + +**Parameters:** + +**options: `object`** + +| Name | Type | +| ------ | ------ | +| end | `number` | +| start | `number` | + +**Returns:** `void` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(buffer: *`Buffer`*, offset: *`number`*, length: *`number`*, position: *`number`*, callback: *`function`*): `void` + +*Inherited from RandomAccessReader.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/yauzl/index.d.ts:14* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| offset | `number` | +| length | `number` | +| position | `number` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/sourcesource.md b/doc/classes/sourcesource.md new file mode 100644 index 00000000..1403eb8f --- /dev/null +++ b/doc/classes/sourcesource.md @@ -0,0 +1,798 @@ +[etcher-sdk](../README.md) > [SourceSource](../classes/sourcesource.md) + +# Class: SourceSource + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ SourceSource** + +↳ [CompressedSource](compressedsource.md) + +↳ [ConfiguredSource](configuredsource.md) + +↳ [DmgSource](dmgsource.md) + +↳ [StreamZipSource](streamzipsource.md) + +↳ [RandomAccessZipSource](randomaccesszipsource.md) + +↳ [ZipSource](zipsource.md) + +## Index + +### Constructors + +* [constructor](sourcesource.md#constructor) + +### Properties + +* [source](sourcesource.md#source) +* [defaultMaxListeners](sourcesource.md#defaultmaxlisteners) +* [imageExtensions](sourcesource.md#imageextensions) +* [mimetype](sourcesource.md#mimetype) +* [requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource) + +### Methods + +* [_close](sourcesource.md#_close) +* [_getMetadata](sourcesource.md#_getmetadata) +* [_open](sourcesource.md#_open) +* [addListener](sourcesource.md#addlistener) +* [canCreateReadStream](sourcesource.md#cancreatereadstream) +* [canCreateSparseReadStream](sourcesource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](sourcesource.md#cancreatesparsewritestream) +* [canCreateWriteStream](sourcesource.md#cancreatewritestream) +* [canRead](sourcesource.md#canread) +* [canWrite](sourcesource.md#canwrite) +* [close](sourcesource.md#close) +* [createReadStream](sourcesource.md#createreadstream) +* [createSparseReadStream](sourcesource.md#createsparsereadstream) +* [createSparseWriteStream](sourcesource.md#createsparsewritestream) +* [createVerifier](sourcesource.md#createverifier) +* [createWriteStream](sourcesource.md#createwritestream) +* [emit](sourcesource.md#emit) +* [eventNames](sourcesource.md#eventnames) +* [getBlocks](sourcesource.md#getblocks) +* [getInnerSource](sourcesource.md#getinnersource) +* [getMaxListeners](sourcesource.md#getmaxlisteners) +* [getMetadata](sourcesource.md#getmetadata) +* [getPartitionTable](sourcesource.md#getpartitiontable) +* [listenerCount](sourcesource.md#listenercount) +* [listeners](sourcesource.md#listeners) +* [on](sourcesource.md#on) +* [once](sourcesource.md#once) +* [open](sourcesource.md#open) +* [prependListener](sourcesource.md#prependlistener) +* [prependOnceListener](sourcesource.md#prependoncelistener) +* [read](sourcesource.md#read) +* [removeAllListeners](sourcesource.md#removealllisteners) +* [removeListener](sourcesource.md#removelistener) +* [setMaxListeners](sourcesource.md#setmaxlisteners) +* [write](sourcesource.md#write) +* [listenerCount](sourcesource.md#listenercount-1) +* [register](sourcesource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new SourceSource**(source: *[SourceDestination](sourcedestination.md)*): [SourceSource](sourcesource.md) + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [SourceSource](sourcesource.md) + +___ + +## Properties + + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/source-destination.ts:266](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L266)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, _start?: *`number`*, _end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/source-destination.ts:311](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L311)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` _start | `number` | 0 | +| `Optional` _end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/sparsefilterstream.md b/doc/classes/sparsefilterstream.md new file mode 100644 index 00000000..3e871c6f --- /dev/null +++ b/doc/classes/sparsefilterstream.md @@ -0,0 +1,1463 @@ +[etcher-sdk](../README.md) > [SparseFilterStream](../classes/sparsefilterstream.md) + +# Class: SparseFilterStream + +## Hierarchy + + `Transform` + +**↳ SparseFilterStream** + +## Implements + +* `ReadableStream` +* `Writable` +* [SparseReadable](../interfaces/sparsereadable.md) + +## Index + +### Constructors + +* [constructor](sparsefilterstream.md#constructor) + +### Properties + +* [blocks](sparsefilterstream.md#blocks) +* [position](sparsefilterstream.md#position) +* [readable](sparsefilterstream.md#readable) +* [state](sparsefilterstream.md#state) +* [stateIterator](sparsefilterstream.md#stateiterator) +* [writable](sparsefilterstream.md#writable) +* [defaultMaxListeners](sparsefilterstream.md#defaultmaxlisteners) + +### Methods + +* [__transform](sparsefilterstream.md#__transform) +* [_read](sparsefilterstream.md#_read) +* [_transform](sparsefilterstream.md#_transform) +* [_write](sparsefilterstream.md#_write) +* [addListener](sparsefilterstream.md#addlistener) +* [emit](sparsefilterstream.md#emit) +* [end](sparsefilterstream.md#end) +* [eventNames](sparsefilterstream.md#eventnames) +* [getMaxListeners](sparsefilterstream.md#getmaxlisteners) +* [isPaused](sparsefilterstream.md#ispaused) +* [listenerCount](sparsefilterstream.md#listenercount) +* [listeners](sparsefilterstream.md#listeners) +* [nextBlock](sparsefilterstream.md#nextblock) +* [on](sparsefilterstream.md#on) +* [once](sparsefilterstream.md#once) +* [pause](sparsefilterstream.md#pause) +* [pipe](sparsefilterstream.md#pipe) +* [prependListener](sparsefilterstream.md#prependlistener) +* [prependOnceListener](sparsefilterstream.md#prependoncelistener) +* [push](sparsefilterstream.md#push) +* [read](sparsefilterstream.md#read) +* [removeAllListeners](sparsefilterstream.md#removealllisteners) +* [removeListener](sparsefilterstream.md#removelistener) +* [resume](sparsefilterstream.md#resume) +* [setDefaultEncoding](sparsefilterstream.md#setdefaultencoding) +* [setEncoding](sparsefilterstream.md#setencoding) +* [setMaxListeners](sparsefilterstream.md#setmaxlisteners) +* [unpipe](sparsefilterstream.md#unpipe) +* [unshift](sparsefilterstream.md#unshift) +* [wrap](sparsefilterstream.md#wrap) +* [write](sparsefilterstream.md#write) +* [listenerCount](sparsefilterstream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new SparseFilterStream**(blocks: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, verify: *`boolean`*, generateChecksums: *`boolean`*, options?: *`TransformOptions`*): [SparseFilterStream](sparsefilterstream.md) + +*Overrides Transform.__constructor* + +*Defined in [sparse-stream/sparse-filter-stream.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L30)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| blocks | [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | - | +| verify | `boolean` | - | +| generateChecksums | `boolean` | - | +| `Default value` options | `TransformOptions` | {} | + +**Returns:** [SparseFilterStream](sparsefilterstream.md) + +___ + +## Properties + + + +### blocks + +**● blocks**: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]* + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[blocks](../interfaces/sparsereadable.md#blocks)* + +*Defined in [sparse-stream/sparse-filter-stream.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L33)* + +___ + + +### `` position + +**● position**: *`number`* = 0 + +*Defined in [sparse-stream/sparse-filter-stream.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L30)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[readable](../interfaces/sparsereadable.md#readable)* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### ```` state + +**● state**: *[SparseReaderState](../interfaces/sparsereaderstate.md)* + +*Defined in [sparse-stream/sparse-filter-stream.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L29)* + +___ + + +### `` stateIterator + +**● stateIterator**: *`Iterator`<[SparseReaderState](../interfaces/sparsereaderstate.md)>* + +*Defined in [sparse-stream/sparse-filter-stream.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L28)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Duplex.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3885* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### `` __transform + +▸ **__transform**(buffer: *`Buffer`*): `void` + +*Defined in [sparse-stream/sparse-filter-stream.ts:65](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L65)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | + +**Returns:** `void` + +___ + + +### _read + +▸ **_read**(size: *`number`*): `void` + +*Inherited from Readable._read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| size | `number` | + +**Returns:** `void` + +___ + + +### _transform + +▸ **_transform**(chunk: *`Buffer`*, _encoding: *`string`*, callback: *`function`*): `void` + +*Overrides Transform._transform* + +*Defined in [sparse-stream/sparse-filter-stream.ts:51](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L51)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `Buffer` | +| _encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Duplex._write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3887* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[emit](../interfaces/sparsereadable.md#emit)* + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3891* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3892* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3893* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[eventNames](../interfaces/sparsereadable.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[getMaxListeners](../interfaces/sparsereadable.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[isPaused](../interfaces/sparsereadable.md#ispaused)* + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[listenerCount](../interfaces/sparsereadable.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[listeners](../interfaces/sparsereadable.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### `` nextBlock + +▸ **nextBlock**(): `void` + +*Defined in [sparse-stream/sparse-filter-stream.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-filter-stream.ts#L47)* + +**Returns:** `void` + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[pause](../interfaces/sparsereadable.md#pause)* + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[read](../interfaces/sparsereadable.md#read)* + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[removeAllListeners](../interfaces/sparsereadable.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[resume](../interfaces/sparsereadable.md#resume)* + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Duplex.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3890* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[setMaxListeners](../interfaces/sparsereadable.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[unpipe](../interfaces/sparsereadable.md#unpipe)* + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[wrap](../interfaces/sparsereadable.md#wrap)* + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3888* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3889* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/sparsereadstream.md b/doc/classes/sparsereadstream.md new file mode 100644 index 00000000..6e5f5dc0 --- /dev/null +++ b/doc/classes/sparsereadstream.md @@ -0,0 +1,1308 @@ +[etcher-sdk](../README.md) > [SparseReadStream](../classes/sparsereadstream.md) + +# Class: SparseReadStream + +## Hierarchy + + `Readable` + +**↳ SparseReadStream** + +## Implements + +* `ReadableStream` +* [SparseReadable](../interfaces/sparsereadable.md) + +## Index + +### Constructors + +* [constructor](sparsereadstream.md#constructor) + +### Properties + +* [blocks](sparsereadstream.md#blocks) +* [chunkSize](sparsereadstream.md#chunksize) +* [positionInBlock](sparsereadstream.md#positioninblock) +* [readable](sparsereadstream.md#readable) +* [source](sparsereadstream.md#source) +* [state](sparsereadstream.md#state) +* [stateIterator](sparsereadstream.md#stateiterator) +* [defaultMaxListeners](sparsereadstream.md#defaultmaxlisteners) + +### Methods + +* [__read](sparsereadstream.md#__read) +* [_read](sparsereadstream.md#_read) +* [addListener](sparsereadstream.md#addlistener) +* [emit](sparsereadstream.md#emit) +* [eventNames](sparsereadstream.md#eventnames) +* [getMaxListeners](sparsereadstream.md#getmaxlisteners) +* [isPaused](sparsereadstream.md#ispaused) +* [listenerCount](sparsereadstream.md#listenercount) +* [listeners](sparsereadstream.md#listeners) +* [nextBlock](sparsereadstream.md#nextblock) +* [on](sparsereadstream.md#on) +* [once](sparsereadstream.md#once) +* [pause](sparsereadstream.md#pause) +* [pipe](sparsereadstream.md#pipe) +* [prependListener](sparsereadstream.md#prependlistener) +* [prependOnceListener](sparsereadstream.md#prependoncelistener) +* [push](sparsereadstream.md#push) +* [read](sparsereadstream.md#read) +* [removeAllListeners](sparsereadstream.md#removealllisteners) +* [removeListener](sparsereadstream.md#removelistener) +* [resume](sparsereadstream.md#resume) +* [setEncoding](sparsereadstream.md#setencoding) +* [setMaxListeners](sparsereadstream.md#setmaxlisteners) +* [unpipe](sparsereadstream.md#unpipe) +* [unshift](sparsereadstream.md#unshift) +* [wrap](sparsereadstream.md#wrap) +* [listenerCount](sparsereadstream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new SparseReadStream**(source: *[SourceDestination](sourcedestination.md)*, blocks: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, chunkSize: *`number`*, verify: *`boolean`*, generateChecksums: *`boolean`*, options?: *`ReadableOptions`*): [SparseReadStream](sparsereadstream.md) + +*Overrides Readable.__constructor* + +*Defined in [sparse-stream/sparse-read-stream.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L32)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | - | +| blocks | [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | - | +| chunkSize | `number` | - | +| verify | `boolean` | - | +| generateChecksums | `boolean` | - | +| `Default value` options | `ReadableOptions` | {} | + +**Returns:** [SparseReadStream](sparsereadstream.md) + +___ + +## Properties + + + +### blocks + +**● blocks**: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]* + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[blocks](../interfaces/sparsereadable.md#blocks)* + +*Defined in [sparse-stream/sparse-read-stream.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L36)* + +___ + + +### `` chunkSize + +**● chunkSize**: *`number`* + +*Defined in [sparse-stream/sparse-read-stream.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L37)* + +___ + + +### `` positionInBlock + +**● positionInBlock**: *`number`* = 0 + +*Defined in [sparse-stream/sparse-read-stream.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L32)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[readable](../interfaces/sparsereadable.md#readable)* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [sparse-stream/sparse-read-stream.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L35)* + +___ + + +### ```` state + +**● state**: *[SparseReaderState](../interfaces/sparsereaderstate.md)* + +*Defined in [sparse-stream/sparse-read-stream.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L31)* + +___ + + +### `` stateIterator + +**● stateIterator**: *`Iterator`<[SparseReaderState](../interfaces/sparsereaderstate.md)>* + +*Defined in [sparse-stream/sparse-read-stream.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L30)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### `` __read + +▸ **__read**(): `Promise`<[SparseStreamChunk](../interfaces/sparsestreamchunk.md) \| `null`> + +*Defined in [sparse-stream/sparse-read-stream.ts:65](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L65)* + +**Returns:** `Promise`<[SparseStreamChunk](../interfaces/sparsestreamchunk.md) \| `null`> + +___ + + +### _read + +▸ **_read**(): `Promise`<`void`> + +*Overrides Readable._read* + +*Defined in [sparse-stream/sparse-read-stream.ts:51](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L51)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[emit](../interfaces/sparsereadable.md#emit)* + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[eventNames](../interfaces/sparsereadable.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[getMaxListeners](../interfaces/sparsereadable.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[isPaused](../interfaces/sparsereadable.md#ispaused)* + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[listenerCount](../interfaces/sparsereadable.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[listeners](../interfaces/sparsereadable.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### `` nextBlock + +▸ **nextBlock**(): `void` + +*Defined in [sparse-stream/sparse-read-stream.ts:60](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-read-stream.ts#L60)* + +**Returns:** `void` + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[pause](../interfaces/sparsereadable.md#pause)* + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[read](../interfaces/sparsereadable.md#read)* + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[removeAllListeners](../interfaces/sparsereadable.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[resume](../interfaces/sparsereadable.md#resume)* + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[setMaxListeners](../interfaces/sparsereadable.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[unpipe](../interfaces/sparsereadable.md#unpipe)* + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Implementation of [SparseReadable](../interfaces/sparsereadable.md).[wrap](../interfaces/sparsereadable.md#wrap)* + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/sparsestreamverifier.md b/doc/classes/sparsestreamverifier.md new file mode 100644 index 00000000..0d00191d --- /dev/null +++ b/doc/classes/sparsestreamverifier.md @@ -0,0 +1,466 @@ +[etcher-sdk](../README.md) > [SparseStreamVerifier](../classes/sparsestreamverifier.md) + +# Class: SparseStreamVerifier + +## Hierarchy + +↳ [Verifier](verifier.md) + +**↳ SparseStreamVerifier** + +## Index + +### Constructors + +* [constructor](sparsestreamverifier.md#constructor) + +### Properties + +* [blocks](sparsestreamverifier.md#blocks) +* [source](sparsestreamverifier.md#source) +* [defaultMaxListeners](sparsestreamverifier.md#defaultmaxlisteners) + +### Methods + +* [addListener](sparsestreamverifier.md#addlistener) +* [emit](sparsestreamverifier.md#emit) +* [eventNames](sparsestreamverifier.md#eventnames) +* [getMaxListeners](sparsestreamverifier.md#getmaxlisteners) +* [handleEventsAndPipe](sparsestreamverifier.md#handleeventsandpipe) +* [listenerCount](sparsestreamverifier.md#listenercount) +* [listeners](sparsestreamverifier.md#listeners) +* [on](sparsestreamverifier.md#on) +* [once](sparsestreamverifier.md#once) +* [prependListener](sparsestreamverifier.md#prependlistener) +* [prependOnceListener](sparsestreamverifier.md#prependoncelistener) +* [removeAllListeners](sparsestreamverifier.md#removealllisteners) +* [removeListener](sparsestreamverifier.md#removelistener) +* [run](sparsestreamverifier.md#run) +* [setMaxListeners](sparsestreamverifier.md#setmaxlisteners) +* [listenerCount](sparsestreamverifier.md#listenercount-1) + +### Object literals + +* [progress](sparsestreamverifier.md#progress) + +--- + +## Constructors + + + +### constructor + +⊕ **new SparseStreamVerifier**(source: *[SourceDestination](sourcedestination.md)*, blocks: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*): [SparseStreamVerifier](sparsestreamverifier.md) + +*Defined in [source-destination/source-destination.ts:184](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L184)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | +| blocks | [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | + +**Returns:** [SparseStreamVerifier](sparsestreamverifier.md) + +___ + +## Properties + + + +### `` blocks + +**● blocks**: *[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]* + +*Defined in [source-destination/source-destination.ts:187](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L187)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/source-destination.ts:186](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L186)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` handleEventsAndPipe + +▸ **handleEventsAndPipe**(stream: *`ReadableStream`*, meter: *`WritableStream`*): `void` + +*Inherited from [Verifier](verifier.md).[handleEventsAndPipe](verifier.md#handleeventsandpipe)* + +*Defined in [source-destination/source-destination.ts:134](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L134)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | +| meter | `WritableStream` | + +**Returns:** `void` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### run + +▸ **run**(): `Promise`<`void`> + +*Overrides [Verifier](verifier.md).[run](verifier.md#run)* + +*Defined in [source-destination/source-destination.ts:192](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L192)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + +## Object literals + + + +### progress + +**progress**: *`object`* + +*Inherited from [Verifier](verifier.md).[progress](verifier.md#progress)* + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + + + +#### bytes + +**● bytes**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### position + +**● position**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### speed + +**● speed**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + +___ + diff --git a/doc/classes/sparsewritestream.md b/doc/classes/sparsewritestream.md new file mode 100644 index 00000000..ff979466 --- /dev/null +++ b/doc/classes/sparsewritestream.md @@ -0,0 +1,1427 @@ +[etcher-sdk](../README.md) > [SparseWriteStream](../classes/sparsewritestream.md) + +# Class: SparseWriteStream + +## Hierarchy + + `Writable` + +**↳ SparseWriteStream** + +## Implements + +* `WritableStream` +* [SparseWritable](../interfaces/sparsewritable.md) + +## Index + +### Constructors + +* [constructor](sparsewritestream.md#constructor) + +### Properties + +* [_firstChunks](sparsewritestream.md#_firstchunks) +* [bytesWritten](sparsewritestream.md#byteswritten) +* [destination](sparsewritestream.md#destination) +* [firstBytesToKeep](sparsewritestream.md#firstbytestokeep) +* [maxRetries](sparsewritestream.md#maxretries) +* [position](sparsewritestream.md#position) +* [writable](sparsewritestream.md#writable) +* [defaultMaxListeners](sparsewritestream.md#defaultmaxlisteners) + +### Methods + +* [__final](sparsewritestream.md#__final) +* [__write](sparsewritestream.md#__write) +* [_final](sparsewritestream.md#_final) +* [_write](sparsewritestream.md#_write) +* [addListener](sparsewritestream.md#addlistener) +* [destroy](sparsewritestream.md#destroy) +* [emit](sparsewritestream.md#emit) +* [end](sparsewritestream.md#end) +* [eventNames](sparsewritestream.md#eventnames) +* [getMaxListeners](sparsewritestream.md#getmaxlisteners) +* [listenerCount](sparsewritestream.md#listenercount) +* [listeners](sparsewritestream.md#listeners) +* [on](sparsewritestream.md#on) +* [once](sparsewritestream.md#once) +* [pipe](sparsewritestream.md#pipe) +* [prependListener](sparsewritestream.md#prependlistener) +* [prependOnceListener](sparsewritestream.md#prependoncelistener) +* [removeAllListeners](sparsewritestream.md#removealllisteners) +* [removeListener](sparsewritestream.md#removelistener) +* [setDefaultEncoding](sparsewritestream.md#setdefaultencoding) +* [setMaxListeners](sparsewritestream.md#setmaxlisteners) +* [write](sparsewritestream.md#write) +* [writeChunk](sparsewritestream.md#writechunk) +* [listenerCount](sparsewritestream.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new SparseWriteStream**(destination: *[SourceDestination](sourcedestination.md)*, firstBytesToKeep?: *`number`*, maxRetries?: *`number`*): [SparseWriteStream](sparsewritestream.md) + +*Overrides Writable.__constructor* + +*Defined in [sparse-stream/sparse-write-stream.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L22)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| destination | [SourceDestination](sourcedestination.md) | - | +| `Default value` firstBytesToKeep | `number` | 0 | +| `Default value` maxRetries | `number` | 5 | + +**Returns:** [SparseWriteStream](sparsewritestream.md) + +___ + +## Properties + + + +### `` _firstChunks + +**● _firstChunks**: *[SparseStreamChunk](../interfaces/sparsestreamchunk.md)[]* = [] + +*Defined in [sparse-stream/sparse-write-stream.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L22)* + +___ + + +### bytesWritten + +**● bytesWritten**: *`number`* = 0 + +*Defined in [sparse-stream/sparse-write-stream.ts:21](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L21)* + +___ + + +### `` destination + +**● destination**: *[SourceDestination](sourcedestination.md)* + +*Defined in [sparse-stream/sparse-write-stream.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L25)* + +___ + + +### firstBytesToKeep + +**● firstBytesToKeep**: *`number`* + +*Defined in [sparse-stream/sparse-write-stream.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L26)* + +___ + + +### `` maxRetries + +**● maxRetries**: *`number`* + +*Defined in [sparse-stream/sparse-write-stream.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L27)* + +___ + + +### position + +**● position**: *`number`* + +*Defined in [sparse-stream/sparse-write-stream.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L20)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[writable](../interfaces/sparsewritable.md#writable)* + +*Inherited from Writable.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3800* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### `` __final + +▸ **__final**(): `Promise`<`void`> + +*Defined in [sparse-stream/sparse-write-stream.ts:101](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L101)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` __write + +▸ **__write**(chunk: *[SparseStreamChunk](../interfaces/sparsestreamchunk.md)*): `Promise`<`void`> + +*Defined in [sparse-stream/sparse-write-stream.ts:65](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L65)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | [SparseStreamChunk](../interfaces/sparsestreamchunk.md) | + +**Returns:** `Promise`<`void`> + +___ + + +### _final + +▸ **_final**(callback: *`function`*): `void` + +*Defined in [sparse-stream/sparse-write-stream.ts:115](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L115)* + +*__summary__*: Write buffered data before a stream ends, called by stream internals + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *[SparseStreamChunk](../interfaces/sparsestreamchunk.md)*, _enc: *`string`*, callback: *`function`*): `void` + +*Overrides Writable._write* + +*Defined in [sparse-stream/sparse-write-stream.ts:93](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L93)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | [SparseStreamChunk](../interfaces/sparsestreamchunk.md) | +| _enc | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3820* + +Event emitter The defined events on documents including: + +1. close +2. drain +3. error +4. finish +5. pipe +6. unpipe + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3821* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3822* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3823* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3824* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3825* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3826* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### destroy + +▸ **destroy**(error?: *[Error](notcapable.md#error)*): `this` + +*Inherited from Writable.destroy* + +*Defined in [/home/alexis/dev/resin.io/etcher-sdk-2/typings/readable-stream/index.d.ts:18](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/typings/readable-stream/index.d.ts#L18)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` error | [Error](notcapable.md#error) | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"drain"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +▸ **emit**(event: *"finish"*): `boolean` + +▸ **emit**(event: *"pipe"*, src: *`Readable`*): `boolean` + +▸ **emit**(event: *"unpipe"*, src: *`Readable`*): `boolean` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[emit](../interfaces/sparsewritable.md#emit)* + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3828* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3829* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3830* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3831* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3832* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3833* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| src | `Readable` | + +**Returns:** `boolean` + +*Inherited from Writable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3834* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| src | `Readable` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[end](../interfaces/sparsewritable.md#end)* + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3806* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3807* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Writable.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3808* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[eventNames](../interfaces/sparsewritable.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[getMaxListeners](../interfaces/sparsewritable.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[listenerCount](../interfaces/sparsewritable.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[listeners](../interfaces/sparsewritable.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"drain"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +▸ **on**(event: *"finish"*, listener: *`function`*): `this` + +▸ **on**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **on**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3836* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3837* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3838* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3839* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3840* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3841* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3842* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"drain"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +▸ **once**(event: *"finish"*, listener: *`function`*): `this` + +▸ **once**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **once**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3844* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3845* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3846* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3847* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3848* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3849* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3850* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3703* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3852* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3853* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3854* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3855* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3856* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3857* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3858* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3860* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3861* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3862* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3863* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3864* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3865* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3866* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[removeAllListeners](../interfaces/sparsewritable.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"drain"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"finish"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"pipe"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"unpipe"*, listener: *`function`*): `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3868* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3869* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3870* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "drain" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3871* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3872* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "finish" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3873* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "pipe" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Writable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3874* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "unpipe" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Writable.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3805* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [SparseWritable](../interfaces/sparsewritable.md).[setMaxListeners](../interfaces/sparsewritable.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3803* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Writable.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3804* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` writeChunk + +▸ **writeChunk**(chunk: *[SparseStreamChunk](../interfaces/sparsestreamchunk.md)*, flushing?: *`boolean`*): `Promise`<`void`> + +*Defined in [sparse-stream/sparse-write-stream.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L32)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| chunk | [SparseStreamChunk](../interfaces/sparsestreamchunk.md) | - | +| `Default value` flushing | `boolean` | false | + +**Returns:** `Promise`<`void`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/streamlimiter.md b/doc/classes/streamlimiter.md new file mode 100644 index 00000000..1dad7028 --- /dev/null +++ b/doc/classes/streamlimiter.md @@ -0,0 +1,1380 @@ +[etcher-sdk](../README.md) > [StreamLimiter](../classes/streamlimiter.md) + +# Class: StreamLimiter + +## Hierarchy + + `Transform` + +**↳ StreamLimiter** + +## Implements + +* `ReadableStream` +* `Writable` + +## Index + +### Constructors + +* [constructor](streamlimiter.md#constructor) + +### Properties + +* [maxBytes](streamlimiter.md#maxbytes) +* [readable](streamlimiter.md#readable) +* [stream](streamlimiter.md#stream) +* [writable](streamlimiter.md#writable) +* [defaultMaxListeners](streamlimiter.md#defaultmaxlisteners) + +### Methods + +* [_read](streamlimiter.md#_read) +* [_transform](streamlimiter.md#_transform) +* [_write](streamlimiter.md#_write) +* [addListener](streamlimiter.md#addlistener) +* [emit](streamlimiter.md#emit) +* [end](streamlimiter.md#end) +* [eventNames](streamlimiter.md#eventnames) +* [getMaxListeners](streamlimiter.md#getmaxlisteners) +* [isPaused](streamlimiter.md#ispaused) +* [listenerCount](streamlimiter.md#listenercount) +* [listeners](streamlimiter.md#listeners) +* [on](streamlimiter.md#on) +* [once](streamlimiter.md#once) +* [pause](streamlimiter.md#pause) +* [pipe](streamlimiter.md#pipe) +* [prependListener](streamlimiter.md#prependlistener) +* [prependOnceListener](streamlimiter.md#prependoncelistener) +* [push](streamlimiter.md#push) +* [read](streamlimiter.md#read) +* [removeAllListeners](streamlimiter.md#removealllisteners) +* [removeListener](streamlimiter.md#removelistener) +* [resume](streamlimiter.md#resume) +* [setDefaultEncoding](streamlimiter.md#setdefaultencoding) +* [setEncoding](streamlimiter.md#setencoding) +* [setMaxListeners](streamlimiter.md#setmaxlisteners) +* [unpipe](streamlimiter.md#unpipe) +* [unshift](streamlimiter.md#unshift) +* [wrap](streamlimiter.md#wrap) +* [write](streamlimiter.md#write) +* [listenerCount](streamlimiter.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new StreamLimiter**(stream: *`ReadableStream`*, maxBytes: *`number`*): [StreamLimiter](streamlimiter.md) + +*Overrides Transform.__constructor* + +*Defined in [stream-limiter.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/stream-limiter.ts#L22)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | +| maxBytes | `number` | + +**Returns:** [StreamLimiter](streamlimiter.md) + +___ + +## Properties + + + +### `` maxBytes + +**● maxBytes**: *`number`* + +*Defined in [stream-limiter.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/stream-limiter.ts#L23)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### `` stream + +**● stream**: *`ReadableStream`* + +*Defined in [stream-limiter.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/stream-limiter.ts#L23)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Duplex.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3885* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _read + +▸ **_read**(size: *`number`*): `void` + +*Inherited from Readable._read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| size | `number` | + +**Returns:** `void` + +___ + + +### _transform + +▸ **_transform**(buffer: *`Buffer`*, _encoding: *`string`*, callback: *`function`*): `void` + +*Overrides Transform._transform* + +*Defined in [stream-limiter.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/stream-limiter.ts#L29)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| _encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Duplex._write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3887* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3891* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3892* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3893* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Duplex.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3890* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3888* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3889* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/streamverifier.md b/doc/classes/streamverifier.md new file mode 100644 index 00000000..013524de --- /dev/null +++ b/doc/classes/streamverifier.md @@ -0,0 +1,477 @@ +[etcher-sdk](../README.md) > [StreamVerifier](../classes/streamverifier.md) + +# Class: StreamVerifier + +## Hierarchy + +↳ [Verifier](verifier.md) + +**↳ StreamVerifier** + +## Index + +### Constructors + +* [constructor](streamverifier.md#constructor) + +### Properties + +* [checksum](streamverifier.md#checksum) +* [size](streamverifier.md#size) +* [source](streamverifier.md#source) +* [defaultMaxListeners](streamverifier.md#defaultmaxlisteners) + +### Methods + +* [addListener](streamverifier.md#addlistener) +* [emit](streamverifier.md#emit) +* [eventNames](streamverifier.md#eventnames) +* [getMaxListeners](streamverifier.md#getmaxlisteners) +* [handleEventsAndPipe](streamverifier.md#handleeventsandpipe) +* [listenerCount](streamverifier.md#listenercount) +* [listeners](streamverifier.md#listeners) +* [on](streamverifier.md#on) +* [once](streamverifier.md#once) +* [prependListener](streamverifier.md#prependlistener) +* [prependOnceListener](streamverifier.md#prependoncelistener) +* [removeAllListeners](streamverifier.md#removealllisteners) +* [removeListener](streamverifier.md#removelistener) +* [run](streamverifier.md#run) +* [setMaxListeners](streamverifier.md#setmaxlisteners) +* [listenerCount](streamverifier.md#listenercount-1) + +### Object literals + +* [progress](streamverifier.md#progress) + +--- + +## Constructors + + + +### constructor + +⊕ **new StreamVerifier**(source: *[SourceDestination](sourcedestination.md)*, checksum: *`string`*, size: *`number`*): [StreamVerifier](streamverifier.md) + +*Defined in [source-destination/source-destination.ts:152](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L152)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | +| checksum | `string` | +| size | `number` | + +**Returns:** [StreamVerifier](streamverifier.md) + +___ + +## Properties + + + +### `` checksum + +**● checksum**: *`string`* + +*Defined in [source-destination/source-destination.ts:155](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L155)* + +___ + + +### `` size + +**● size**: *`number`* + +*Defined in [source-destination/source-destination.ts:156](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L156)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Defined in [source-destination/source-destination.ts:154](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L154)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` handleEventsAndPipe + +▸ **handleEventsAndPipe**(stream: *`ReadableStream`*, meter: *`WritableStream`*): `void` + +*Inherited from [Verifier](verifier.md).[handleEventsAndPipe](verifier.md#handleeventsandpipe)* + +*Defined in [source-destination/source-destination.ts:134](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L134)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | +| meter | `WritableStream` | + +**Returns:** `void` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### run + +▸ **run**(): `Promise`<`void`> + +*Overrides [Verifier](verifier.md).[run](verifier.md#run)* + +*Defined in [source-destination/source-destination.ts:161](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L161)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + +## Object literals + + + +### progress + +**progress**: *`object`* + +*Inherited from [Verifier](verifier.md).[progress](verifier.md#progress)* + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + + + +#### bytes + +**● bytes**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### position + +**● position**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### speed + +**● speed**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + +___ + diff --git a/doc/classes/streamzipsource.md b/doc/classes/streamzipsource.md new file mode 100644 index 00000000..98353a7c --- /dev/null +++ b/doc/classes/streamzipsource.md @@ -0,0 +1,840 @@ +[etcher-sdk](../README.md) > [StreamZipSource](../classes/streamzipsource.md) + +# Class: StreamZipSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ StreamZipSource** + +## Index + +### Constructors + +* [constructor](streamzipsource.md#constructor) + +### Properties + +* [entry](streamzipsource.md#entry) +* [match](streamzipsource.md#match) +* [source](streamzipsource.md#source) +* [defaultMaxListeners](streamzipsource.md#defaultmaxlisteners) +* [imageExtensions](streamzipsource.md#imageextensions) +* [mimetype](streamzipsource.md#mimetype) +* [requiresRandomReadableSource](streamzipsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](streamzipsource.md#_close) +* [_getMetadata](streamzipsource.md#_getmetadata) +* [_open](streamzipsource.md#_open) +* [addListener](streamzipsource.md#addlistener) +* [canCreateReadStream](streamzipsource.md#cancreatereadstream) +* [canCreateSparseReadStream](streamzipsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](streamzipsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](streamzipsource.md#cancreatewritestream) +* [canRead](streamzipsource.md#canread) +* [canWrite](streamzipsource.md#canwrite) +* [close](streamzipsource.md#close) +* [createReadStream](streamzipsource.md#createreadstream) +* [createSparseReadStream](streamzipsource.md#createsparsereadstream) +* [createSparseWriteStream](streamzipsource.md#createsparsewritestream) +* [createVerifier](streamzipsource.md#createverifier) +* [createWriteStream](streamzipsource.md#createwritestream) +* [emit](streamzipsource.md#emit) +* [eventNames](streamzipsource.md#eventnames) +* [getBlocks](streamzipsource.md#getblocks) +* [getEntry](streamzipsource.md#getentry) +* [getInnerSource](streamzipsource.md#getinnersource) +* [getMaxListeners](streamzipsource.md#getmaxlisteners) +* [getMetadata](streamzipsource.md#getmetadata) +* [getPartitionTable](streamzipsource.md#getpartitiontable) +* [listenerCount](streamzipsource.md#listenercount) +* [listeners](streamzipsource.md#listeners) +* [on](streamzipsource.md#on) +* [once](streamzipsource.md#once) +* [open](streamzipsource.md#open) +* [prependListener](streamzipsource.md#prependlistener) +* [prependOnceListener](streamzipsource.md#prependoncelistener) +* [read](streamzipsource.md#read) +* [removeAllListeners](streamzipsource.md#removealllisteners) +* [removeListener](streamzipsource.md#removelistener) +* [setMaxListeners](streamzipsource.md#setmaxlisteners) +* [write](streamzipsource.md#write) +* [listenerCount](streamzipsource.md#listenercount-1) +* [register](streamzipsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new StreamZipSource**(source: *[SourceDestination](sourcedestination.md)*, match?: *`function`*): [StreamZipSource](streamzipsource.md) + +*Overrides [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/zip.ts:70](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L70)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | - | +| `Default value` match | `function` | matchSupportedExtensions | + +**Returns:** [StreamZipSource](streamzipsource.md) + +___ + +## Properties + + + +### ```` entry + +**● entry**: *`ZipStreamEntry`* + +*Defined in [source-destination/zip.ts:70](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L70)* + +___ + + +### `` match + +**● match**: *`function`* + +*Defined in [source-destination/zip.ts:74](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L74)* + +#### Type declaration +▸(filename: *`string`*): `boolean` + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| filename | `string` | + +**Returns:** `boolean` + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/zip.ts:118](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L118)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/zip.ts:79](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L79)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/zip.ts:101](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L101)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### `` getEntry + +▸ **getEntry**(): `Promise`<`ZipStreamEntry`> + +*Defined in [source-destination/zip.ts:83](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L83)* + +**Returns:** `Promise`<`ZipStreamEntry`> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/usbbootdeviceadapter.md b/doc/classes/usbbootdeviceadapter.md new file mode 100644 index 00000000..8c13a92f --- /dev/null +++ b/doc/classes/usbbootdeviceadapter.md @@ -0,0 +1,442 @@ +[etcher-sdk](../README.md) > [UsbbootDeviceAdapter](../classes/usbbootdeviceadapter.md) + +# Class: UsbbootDeviceAdapter + +## Hierarchy + +↳ [Adapter](adapter.md) + +**↳ UsbbootDeviceAdapter** + +## Index + +### Constructors + +* [constructor](usbbootdeviceadapter.md#constructor) + +### Properties + +* [drives](usbbootdeviceadapter.md#drives) +* [scanner](usbbootdeviceadapter.md#scanner) +* [defaultMaxListeners](usbbootdeviceadapter.md#defaultmaxlisteners) + +### Methods + +* [addListener](usbbootdeviceadapter.md#addlistener) +* [emit](usbbootdeviceadapter.md#emit) +* [eventNames](usbbootdeviceadapter.md#eventnames) +* [getMaxListeners](usbbootdeviceadapter.md#getmaxlisteners) +* [listenerCount](usbbootdeviceadapter.md#listenercount) +* [listeners](usbbootdeviceadapter.md#listeners) +* [on](usbbootdeviceadapter.md#on) +* [onAttach](usbbootdeviceadapter.md#onattach) +* [onDetach](usbbootdeviceadapter.md#ondetach) +* [once](usbbootdeviceadapter.md#once) +* [prependListener](usbbootdeviceadapter.md#prependlistener) +* [prependOnceListener](usbbootdeviceadapter.md#prependoncelistener) +* [removeAllListeners](usbbootdeviceadapter.md#removealllisteners) +* [removeListener](usbbootdeviceadapter.md#removelistener) +* [setMaxListeners](usbbootdeviceadapter.md#setmaxlisteners) +* [start](usbbootdeviceadapter.md#start) +* [stop](usbbootdeviceadapter.md#stop) +* [listenerCount](usbbootdeviceadapter.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new UsbbootDeviceAdapter**(): [UsbbootDeviceAdapter](usbbootdeviceadapter.md) + +*Defined in [scanner/adapters/usbboot.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L37)* + +**Returns:** [UsbbootDeviceAdapter](usbbootdeviceadapter.md) + +___ + +## Properties + + + +### `` drives + +**● drives**: *`Map`<`UsbbootDevice`, [UsbbootDrive](usbbootdrive.md)>* = new Map() + +*Defined in [scanner/adapters/usbboot.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L36)* + +___ + + +### `` scanner + +**● scanner**: *`UsbbootScannerType`* + +*Defined in [scanner/adapters/usbboot.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L37)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` onAttach + +▸ **onAttach**(device: *`UsbbootDevice`*): `void` + +*Defined in [scanner/adapters/usbboot.ts:61](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L61)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| device | `UsbbootDevice` | + +**Returns:** `void` + +___ + + +### `` onDetach + +▸ **onDetach**(device: *`UsbbootDevice`*): `void` + +*Defined in [scanner/adapters/usbboot.ts:70](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L70)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| device | `UsbbootDevice` | + +**Returns:** `void` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### start + +▸ **start**(): `void` + +*Overrides [Adapter](adapter.md).[start](adapter.md#start)* + +*Defined in [scanner/adapters/usbboot.ts:53](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L53)* + +**Returns:** `void` + +___ + + +### stop + +▸ **stop**(): `void` + +*Overrides [Adapter](adapter.md).[stop](adapter.md#stop)* + +*Defined in [scanner/adapters/usbboot.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/usbboot.ts#L57)* + +**Returns:** `void` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/classes/usbbootdrive.md b/doc/classes/usbbootdrive.md new file mode 100644 index 00000000..8e8aa2c4 --- /dev/null +++ b/doc/classes/usbbootdrive.md @@ -0,0 +1,996 @@ +[etcher-sdk](../README.md) > [UsbbootDrive](../classes/usbbootdrive.md) + +# Class: UsbbootDrive + +## Hierarchy + +↳ [SourceDestination](sourcedestination.md) + +**↳ UsbbootDrive** + +## Implements + +* [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) + +## Index + +### Constructors + +* [constructor](usbbootdrive.md#constructor) + +### Properties + +* [description](usbbootdrive.md#description) +* [device](usbbootdrive.md#device) +* [devicePath](usbbootdrive.md#devicepath) +* [disabled](usbbootdrive.md#disabled) +* [displayName](usbbootdrive.md#displayname) +* [emitsProgress](usbbootdrive.md#emitsprogress) +* [icon](usbbootdrive.md#icon) +* [isReadOnly](usbbootdrive.md#isreadonly) +* [isSystem](usbbootdrive.md#issystem) +* [mountpoints](usbbootdrive.md#mountpoints) +* [raw](usbbootdrive.md#raw) +* [size](usbbootdrive.md#size) +* [usbDevice](usbbootdrive.md#usbdevice) +* [defaultMaxListeners](usbbootdrive.md#defaultmaxlisteners) +* [imageExtensions](usbbootdrive.md#imageextensions) +* [mimetype](usbbootdrive.md#mimetype) + +### Methods + +* [_close](usbbootdrive.md#_close) +* [_getMetadata](usbbootdrive.md#_getmetadata) +* [_open](usbbootdrive.md#_open) +* [addListener](usbbootdrive.md#addlistener) +* [canCreateReadStream](usbbootdrive.md#cancreatereadstream) +* [canCreateSparseReadStream](usbbootdrive.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](usbbootdrive.md#cancreatesparsewritestream) +* [canCreateWriteStream](usbbootdrive.md#cancreatewritestream) +* [canRead](usbbootdrive.md#canread) +* [canWrite](usbbootdrive.md#canwrite) +* [close](usbbootdrive.md#close) +* [createReadStream](usbbootdrive.md#createreadstream) +* [createSparseReadStream](usbbootdrive.md#createsparsereadstream) +* [createSparseWriteStream](usbbootdrive.md#createsparsewritestream) +* [createVerifier](usbbootdrive.md#createverifier) +* [createWriteStream](usbbootdrive.md#createwritestream) +* [emit](usbbootdrive.md#emit) +* [eventNames](usbbootdrive.md#eventnames) +* [getBlocks](usbbootdrive.md#getblocks) +* [getInnerSource](usbbootdrive.md#getinnersource) +* [getMaxListeners](usbbootdrive.md#getmaxlisteners) +* [getMetadata](usbbootdrive.md#getmetadata) +* [getPartitionTable](usbbootdrive.md#getpartitiontable) +* [listenerCount](usbbootdrive.md#listenercount) +* [listeners](usbbootdrive.md#listeners) +* [on](usbbootdrive.md#on) +* [once](usbbootdrive.md#once) +* [open](usbbootdrive.md#open) +* [prependListener](usbbootdrive.md#prependlistener) +* [prependOnceListener](usbbootdrive.md#prependoncelistener) +* [read](usbbootdrive.md#read) +* [removeAllListeners](usbbootdrive.md#removealllisteners) +* [removeListener](usbbootdrive.md#removelistener) +* [setMaxListeners](usbbootdrive.md#setmaxlisteners) +* [write](usbbootdrive.md#write) +* [listenerCount](usbbootdrive.md#listenercount-1) +* [register](usbbootdrive.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new UsbbootDrive**(usbDevice: *`UsbbootDevice`*): [UsbbootDrive](usbbootdrive.md) + +*Defined in [source-destination/usbboot.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L35)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| usbDevice | `UsbbootDevice` | + +**Returns:** [UsbbootDrive](usbbootdrive.md) + +___ + +## Properties + + + +### description + +**● description**: *`string`* = "Compute Module" + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[description](../interfaces/adaptersourcedestination.md#description)* + +*Defined in [source-destination/usbboot.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L30)* + +___ + + +### device + +**● device**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[device](../interfaces/adaptersourcedestination.md#device)* + +*Defined in [source-destination/usbboot.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L26)* + +___ + + +### devicePath + +**● devicePath**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[devicePath](../interfaces/adaptersourcedestination.md#devicepath)* + +*Defined in [source-destination/usbboot.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L27)* + +___ + + +### disabled + +**● disabled**: *`boolean`* = true + +*Defined in [source-destination/usbboot.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L33)* + +___ + + +### displayName + +**● displayName**: *`string`* = "Initializing device" + +*Defined in [source-destination/usbboot.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L25)* + +___ + + +### emitsProgress + +**● emitsProgress**: *`boolean`* = true + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emitsProgress](../interfaces/adaptersourcedestination.md#emitsprogress)* + +*Defined in [source-destination/usbboot.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L35)* + +___ + + +### icon + +**● icon**: *`string`* = "loading" + +*Defined in [source-destination/usbboot.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L28)* + +___ + + +### isReadOnly + +**● isReadOnly**: *`boolean`* = false + +*Defined in [source-destination/usbboot.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L32)* + +___ + + +### isSystem + +**● isSystem**: *`boolean`* = false + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[isSystem](../interfaces/adaptersourcedestination.md#issystem)* + +*Defined in [source-destination/usbboot.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L29)* + +___ + + +### mountpoints + +**● mountpoints**: *`never`[]* = [] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[mountpoints](../interfaces/adaptersourcedestination.md#mountpoints)* + +*Defined in [source-destination/usbboot.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L31)* + +___ + + +### raw + +**● raw**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[raw](../interfaces/adaptersourcedestination.md#raw)* + +*Defined in [source-destination/usbboot.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L24)* + +___ + + +### size + +**● size**: *`null`* = null + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[size](../interfaces/adaptersourcedestination.md#size)* + +*Defined in [source-destination/usbboot.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L34)* + +___ + + +### usbDevice + +**● usbDevice**: *`UsbbootDevice`* + +*Defined in [source-destination/usbboot.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/usbboot.ts#L37)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[defaultMaxListeners](../interfaces/adaptersourcedestination.md#defaultmaxlisteners)* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[imageExtensions](../interfaces/adaptersourcedestination.md#imageextensions)* + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[mimetype](../interfaces/adaptersourcedestination.md#mimetype)* + +*Inherited from [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_close](../interfaces/adaptersourcedestination.md#_close)* + +*Inherited from [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_getMetadata](../interfaces/adaptersourcedestination.md#_getmetadata)* + +*Inherited from [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[_open](../interfaces/adaptersourcedestination.md#_open)* + +*Inherited from [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[addListener](../interfaces/adaptersourcedestination.md#addlistener)* + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateReadStream](../interfaces/adaptersourcedestination.md#cancreatereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/source-destination.ts:266](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L266)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseReadStream](../interfaces/adaptersourcedestination.md#cancreatesparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateSparseWriteStream](../interfaces/adaptersourcedestination.md#cancreatesparsewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canCreateWriteStream](../interfaces/adaptersourcedestination.md#cancreatewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canRead](../interfaces/adaptersourcedestination.md#canread)* + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[canWrite](../interfaces/adaptersourcedestination.md#canwrite)* + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[close](../interfaces/adaptersourcedestination.md#close)* + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, _start?: *`number`*, _end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createReadStream](../interfaces/adaptersourcedestination.md#createreadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/source-destination.ts:311](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L311)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` _start | `number` | 0 | +| `Optional` _end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseReadStream](../interfaces/adaptersourcedestination.md#createsparsereadstream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createSparseWriteStream](../interfaces/adaptersourcedestination.md#createsparsewritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createVerifier](../interfaces/adaptersourcedestination.md#createverifier)* + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[createWriteStream](../interfaces/adaptersourcedestination.md#createwritestream)* + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[emit](../interfaces/adaptersourcedestination.md#emit)* + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[eventNames](../interfaces/adaptersourcedestination.md#eventnames)* + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getBlocks](../interfaces/adaptersourcedestination.md#getblocks)* + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getInnerSource](../interfaces/adaptersourcedestination.md#getinnersource)* + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMaxListeners](../interfaces/adaptersourcedestination.md#getmaxlisteners)* + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getMetadata](../interfaces/adaptersourcedestination.md#getmetadata)* + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[getPartitionTable](../interfaces/adaptersourcedestination.md#getpartitiontable)* + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount)* + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listeners](../interfaces/adaptersourcedestination.md#listeners)* + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[on](../interfaces/adaptersourcedestination.md#on)* + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[once](../interfaces/adaptersourcedestination.md#once)* + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[open](../interfaces/adaptersourcedestination.md#open)* + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependListener](../interfaces/adaptersourcedestination.md#prependlistener)* + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[prependOnceListener](../interfaces/adaptersourcedestination.md#prependoncelistener)* + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[read](../interfaces/adaptersourcedestination.md#read)* + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeAllListeners](../interfaces/adaptersourcedestination.md#removealllisteners)* + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[removeListener](../interfaces/adaptersourcedestination.md#removelistener)* + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[setMaxListeners](../interfaces/adaptersourcedestination.md#setmaxlisteners)* + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[write](../interfaces/adaptersourcedestination.md#write)* + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[listenerCount](../interfaces/adaptersourcedestination.md#listenercount-1)* + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Implementation of [AdapterSourceDestination](../interfaces/adaptersourcedestination.md).[register](../interfaces/adaptersourcedestination.md#register)* + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/verificationerror.md b/doc/classes/verificationerror.md new file mode 100644 index 00000000..73fae63a --- /dev/null +++ b/doc/classes/verificationerror.md @@ -0,0 +1,82 @@ +[etcher-sdk](../README.md) > [VerificationError](../classes/verificationerror.md) + +# Class: VerificationError + +## Hierarchy + + `Error` + +**↳ VerificationError** + +↳ [ChecksumVerificationError](checksumverificationerror.md) + +↳ [BlocksVerificationError](blocksverificationerror.md) + +## Index + +### Properties + +* [code](verificationerror.md#code) +* [message](verificationerror.md#message) +* [name](verificationerror.md#name) +* [stack](verificationerror.md#stack) +* [Error](verificationerror.md#error) + +--- + +## Properties + + + +### code + +**● code**: *`string`* = "EVALIDATION" + +*Defined in [errors.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/errors.ts#L24)* + +___ + + +### message + +**● message**: *`string`* + +*Inherited from Error.message* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:964* + +___ + + +### name + +**● name**: *`string`* + +*Inherited from Error.name* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:963* + +___ + + +### `` stack + +**● stack**: *`undefined` \| `string`* + +*Inherited from Error.stack* + +*Overrides Error.stack* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:965* + +___ + + +### `` Error + +**● Error**: *`ErrorConstructor`* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/typedoc/node_modules/typescript/lib/lib.es5.d.ts:974* + +___ + diff --git a/doc/classes/verifier.md b/doc/classes/verifier.md new file mode 100644 index 00000000..ee636930 --- /dev/null +++ b/doc/classes/verifier.md @@ -0,0 +1,421 @@ +[etcher-sdk](../README.md) > [Verifier](../classes/verifier.md) + +# Class: Verifier + +## Hierarchy + + `EventEmitter` + +**↳ Verifier** + +↳ [StreamVerifier](streamverifier.md) + +↳ [SparseStreamVerifier](sparsestreamverifier.md) + +↳ [MultiDestinationVerifier](multidestinationverifier.md) + +## Index + +### Properties + +* [defaultMaxListeners](verifier.md#defaultmaxlisteners) + +### Methods + +* [addListener](verifier.md#addlistener) +* [emit](verifier.md#emit) +* [eventNames](verifier.md#eventnames) +* [getMaxListeners](verifier.md#getmaxlisteners) +* [handleEventsAndPipe](verifier.md#handleeventsandpipe) +* [listenerCount](verifier.md#listenercount) +* [listeners](verifier.md#listeners) +* [on](verifier.md#on) +* [once](verifier.md#once) +* [prependListener](verifier.md#prependlistener) +* [prependOnceListener](verifier.md#prependoncelistener) +* [removeAllListeners](verifier.md#removealllisteners) +* [removeListener](verifier.md#removelistener) +* [run](verifier.md#run) +* [setMaxListeners](verifier.md#setmaxlisteners) +* [listenerCount](verifier.md#listenercount-1) + +### Object literals + +* [progress](verifier.md#progress) + +--- + +## Properties + + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### `` handleEventsAndPipe + +▸ **handleEventsAndPipe**(stream: *`ReadableStream`*, meter: *`WritableStream`*): `void` + +*Defined in [source-destination/source-destination.ts:134](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L134)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| stream | `ReadableStream` | +| meter | `WritableStream` | + +**Returns:** `void` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### `` run + +▸ **run**(): `Promise`<`void`> + +*Defined in [source-destination/source-destination.ts:132](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L132)* + +**Returns:** `Promise`<`void`> + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + +## Object literals + + + +### progress + +**progress**: *`object`* + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + + + +#### bytes + +**● bytes**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### position + +**● position**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + + +#### speed + +**● speed**: *`number`* = 0 + +*Defined in [source-destination/source-destination.ts:130](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L130)* + +___ + +___ + diff --git a/doc/classes/xzsource.md b/doc/classes/xzsource.md new file mode 100644 index 00000000..65a8ce94 --- /dev/null +++ b/doc/classes/xzsource.md @@ -0,0 +1,842 @@ +[etcher-sdk](../README.md) > [XzSource](../classes/xzsource.md) + +# Class: XzSource + +## Hierarchy + +↳ [CompressedSource](compressedsource.md) + +**↳ XzSource** + +## Index + +### Constructors + +* [constructor](xzsource.md#constructor) + +### Properties + +* [isSizeEstimated](xzsource.md#issizeestimated) +* [source](xzsource.md#source) +* [defaultMaxListeners](xzsource.md#defaultmaxlisteners) +* [imageExtensions](xzsource.md#imageextensions) +* [mimetype](xzsource.md#mimetype) +* [requiresRandomReadableSource](xzsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](xzsource.md#_close) +* [_getMetadata](xzsource.md#_getmetadata) +* [_open](xzsource.md#_open) +* [addListener](xzsource.md#addlistener) +* [canCreateReadStream](xzsource.md#cancreatereadstream) +* [canCreateSparseReadStream](xzsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](xzsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](xzsource.md#cancreatewritestream) +* [canRead](xzsource.md#canread) +* [canWrite](xzsource.md#canwrite) +* [close](xzsource.md#close) +* [createReadStream](xzsource.md#createreadstream) +* [createSparseReadStream](xzsource.md#createsparsereadstream) +* [createSparseWriteStream](xzsource.md#createsparsewritestream) +* [createTransform](xzsource.md#createtransform) +* [createVerifier](xzsource.md#createverifier) +* [createWriteStream](xzsource.md#createwritestream) +* [emit](xzsource.md#emit) +* [eventNames](xzsource.md#eventnames) +* [getBlocks](xzsource.md#getblocks) +* [getInnerSource](xzsource.md#getinnersource) +* [getMaxListeners](xzsource.md#getmaxlisteners) +* [getMetadata](xzsource.md#getmetadata) +* [getPartitionTable](xzsource.md#getpartitiontable) +* [getSize](xzsource.md#getsize) +* [listenerCount](xzsource.md#listenercount) +* [listeners](xzsource.md#listeners) +* [on](xzsource.md#on) +* [once](xzsource.md#once) +* [open](xzsource.md#open) +* [prependListener](xzsource.md#prependlistener) +* [prependOnceListener](xzsource.md#prependoncelistener) +* [read](xzsource.md#read) +* [removeAllListeners](xzsource.md#removealllisteners) +* [removeListener](xzsource.md#removelistener) +* [setMaxListeners](xzsource.md#setmaxlisteners) +* [write](xzsource.md#write) +* [listenerCount](xzsource.md#listenercount-1) +* [register](xzsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new XzSource**(source: *[SourceDestination](sourcedestination.md)*): [XzSource](xzsource.md) + +*Inherited from [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | + +**Returns:** [XzSource](xzsource.md) + +___ + +## Properties + + + +### `` isSizeEstimated + +**● isSizeEstimated**: *`boolean`* = false + +*Inherited from [CompressedSource](compressedsource.md).[isSizeEstimated](compressedsource.md#issizeestimated)* + +*Defined in [source-destination/compressed-source.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L44)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### `` mimetype + +**● mimetype**: *"application/x-xz"* = "application/x-xz" + +*Overrides [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/xz.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/xz.ts#L27)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [CompressedSource](compressedsource.md).[_getMetadata](compressedsource.md#_getmetadata)* + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/compressed-source.ts:84](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L84)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Inherited from [CompressedSource](compressedsource.md).[canCreateReadStream](compressedsource.md#cancreatereadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/compressed-source.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L50)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +*Inherited from [CompressedSource](compressedsource.md).[createReadStream](compressedsource.md#createreadstream)* + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/compressed-source.ts:54](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L54)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<[SourceTransform](../interfaces/sourcetransform.md)> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### `` createTransform + +▸ **createTransform**(): `Transform` + +*Overrides [CompressedSource](compressedsource.md).[createTransform](compressedsource.md#createtransform)* + +*Defined in [source-destination/xz.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/xz.ts#L29)* + +**Returns:** `Transform` + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### `` getSize + +▸ **getSize**(): `Promise`<`number` \| `undefined`> + +*Overrides [CompressedSource](compressedsource.md).[getSize](compressedsource.md#getsize)* + +*Defined in [source-destination/xz.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/xz.ts#L33)* + +**Returns:** `Promise`<`number` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/classes/zipsource.md b/doc/classes/zipsource.md new file mode 100644 index 00000000..03a4e0e1 --- /dev/null +++ b/doc/classes/zipsource.md @@ -0,0 +1,851 @@ +[etcher-sdk](../README.md) > [ZipSource](../classes/zipsource.md) + +# Class: ZipSource + +## Hierarchy + +↳ [SourceSource](sourcesource.md) + +**↳ ZipSource** + +## Index + +### Constructors + +* [constructor](zipsource.md#constructor) + +### Properties + +* [implementation](zipsource.md#implementation) +* [match](zipsource.md#match) +* [preferStreamSource](zipsource.md#preferstreamsource) +* [source](zipsource.md#source) +* [defaultMaxListeners](zipsource.md#defaultmaxlisteners) +* [imageExtensions](zipsource.md#imageextensions) +* [mimetype](zipsource.md#mimetype) +* [requiresRandomReadableSource](zipsource.md#requiresrandomreadablesource) + +### Methods + +* [_close](zipsource.md#_close) +* [_getMetadata](zipsource.md#_getmetadata) +* [_open](zipsource.md#_open) +* [addListener](zipsource.md#addlistener) +* [canCreateReadStream](zipsource.md#cancreatereadstream) +* [canCreateSparseReadStream](zipsource.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](zipsource.md#cancreatesparsewritestream) +* [canCreateWriteStream](zipsource.md#cancreatewritestream) +* [canRead](zipsource.md#canread) +* [canWrite](zipsource.md#canwrite) +* [close](zipsource.md#close) +* [createReadStream](zipsource.md#createreadstream) +* [createSparseReadStream](zipsource.md#createsparsereadstream) +* [createSparseWriteStream](zipsource.md#createsparsewritestream) +* [createVerifier](zipsource.md#createverifier) +* [createWriteStream](zipsource.md#createwritestream) +* [emit](zipsource.md#emit) +* [eventNames](zipsource.md#eventnames) +* [getBlocks](zipsource.md#getblocks) +* [getInnerSource](zipsource.md#getinnersource) +* [getMaxListeners](zipsource.md#getmaxlisteners) +* [getMetadata](zipsource.md#getmetadata) +* [getPartitionTable](zipsource.md#getpartitiontable) +* [listenerCount](zipsource.md#listenercount) +* [listeners](zipsource.md#listeners) +* [on](zipsource.md#on) +* [once](zipsource.md#once) +* [open](zipsource.md#open) +* [prepare](zipsource.md#prepare) +* [prependListener](zipsource.md#prependlistener) +* [prependOnceListener](zipsource.md#prependoncelistener) +* [read](zipsource.md#read) +* [removeAllListeners](zipsource.md#removealllisteners) +* [removeListener](zipsource.md#removelistener) +* [setMaxListeners](zipsource.md#setmaxlisteners) +* [write](zipsource.md#write) +* [listenerCount](zipsource.md#listenercount-1) +* [register](zipsource.md#register) + +--- + +## Constructors + + + +### constructor + +⊕ **new ZipSource**(source: *[SourceDestination](sourcedestination.md)*, preferStreamSource?: *`boolean`*, match?: *`function`*): [ZipSource](zipsource.md) + +*Overrides [SourceSource](sourcesource.md).[constructor](sourcesource.md#constructor)* + +*Defined in [source-destination/zip.ts:350](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L350)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| source | [SourceDestination](sourcedestination.md) | - | +| `Default value` preferStreamSource | `boolean` | false | +| `Default value` match | `function` | matchSupportedExtensions | + +**Returns:** [ZipSource](zipsource.md) + +___ + +## Properties + + + +### `` implementation + +**● implementation**: *[RandomAccessZipSource](randomaccesszipsource.md) \| [StreamZipSource](streamzipsource.md)* + +*Defined in [source-destination/zip.ts:350](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L350)* + +___ + + +### `` match + +**● match**: *`function`* + +*Defined in [source-destination/zip.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L355)* + +#### Type declaration +▸(filename: *`string`*): `boolean` + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| filename | `string` | + +**Returns:** `boolean` + +___ + + +### `` preferStreamSource + +**● preferStreamSource**: *`boolean`* + +*Defined in [source-destination/zip.ts:354](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L354)* + +___ + + +### `` source + +**● source**: *[SourceDestination](sourcedestination.md)* + +*Inherited from [SourceSource](sourcesource.md).[source](sourcesource.md#source)* + +*Defined in [source-destination/source-source.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L22)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](sourcedestination.md).[imageExtensions](sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### `` mimetype + +**● mimetype**: *"application/zip"* = "application/zip" + +*Overrides [SourceDestination](sourcedestination.md).[mimetype](sourcedestination.md#mimetype)* + +*Defined in [source-destination/zip.ts:349](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L349)* + +___ + + +### `` requiresRandomReadableSource + +**● requiresRandomReadableSource**: *`boolean`* = false + +*Inherited from [SourceSource](sourcesource.md).[requiresRandomReadableSource](sourcesource.md#requiresrandomreadablesource)* + +*Defined in [source-destination/source-source.ts:20](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L20)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_close](sourcesource.md#_close)* + +*Overrides [SourceDestination](sourcedestination.md).[_close](sourcedestination.md#_close)* + +*Defined in [source-destination/source-source.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L30)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Overrides [SourceDestination](sourcedestination.md).[_getMetadata](sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/zip.ts:404](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L404)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceSource](sourcesource.md).[_open](sourcesource.md#_open)* + +*Overrides [SourceDestination](sourcedestination.md).[_open](sourcedestination.md#_open)* + +*Defined in [source-destination/source-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-source.ts#L26)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateReadStream](sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/zip.ts:373](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L373)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Overrides [SourceDestination](sourcedestination.md).[canCreateSparseReadStream](sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/zip.ts:383](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L383)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateSparseWriteStream](sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canCreateWriteStream](sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canRead](sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](sourcedestination.md).[canWrite](sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](sourcedestination.md).[close](sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(emitProgress?: *`boolean`*, start?: *`number`*, end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Overrides [SourceDestination](sourcedestination.md).[createReadStream](sourcedestination.md#createreadstream)* + +*Defined in [source-destination/zip.ts:388](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L388)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` emitProgress | `boolean` | false | +| `Default value` start | `number` | 0 | +| `Optional` end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +*Overrides [SourceDestination](sourcedestination.md).[createSparseReadStream](sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/zip.ts:397](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L397)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](../interfaces/sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[createSparseWriteStream](sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](../interfaces/sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](verifier.md) + +*Inherited from [SourceDestination](sourcedestination.md).[createVerifier](sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](../interfaces/blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](sourcedestination.md).[createWriteStream](sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](sourcedestination.md).[getBlocks](sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](../interfaces/blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](sourcedestination.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getInnerSource](sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](../interfaces/metadata.md)> + +*Inherited from [SourceDestination](sourcedestination.md).[getMetadata](sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](../interfaces/metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](sourcedestination.md).[getPartitionTable](sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Overrides [SourceDestination](sourcedestination.md).[open](sourcedestination.md#open)* + +*Defined in [source-destination/zip.ts:378](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L378)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` prepare + +▸ **prepare**(): `Promise`<`void`> + +*Defined in [source-destination/zip.ts:360](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/zip.ts#L360)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[read](sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](sourcedestination.md).[write](sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](sourcesource.md)*): `void` + +*Inherited from [SourceDestination](sourcedestination.md).[register](sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/enums/openflags.md b/doc/enums/openflags.md new file mode 100644 index 00000000..f4f8183c --- /dev/null +++ b/doc/enums/openflags.md @@ -0,0 +1,46 @@ +[etcher-sdk](../README.md) > [OpenFlags](../enums/openflags.md) + +# Enumeration: OpenFlags + +## Index + +### Enumeration members + +* [Read](openflags.md#read) +* [ReadWrite](openflags.md#readwrite) +* [WriteDevice](openflags.md#writedevice) + +--- + +## Enumeration members + + + +### Read + +**Read**: = fs.constants.O_RDONLY + +*Defined in [source-destination/file.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L47)* + +___ + + +### ReadWrite + +**ReadWrite**: = fs.constants.O_RDWR | fs.constants.O_CREAT + +*Defined in [source-destination/file.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L48)* + +___ + + +### WriteDevice + +**WriteDevice**: = fs.constants.O_RDWR | + fs.constants.O_NONBLOCK | + fs.constants.O_SYNC + +*Defined in [source-destination/file.ts:49](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/file.ts#L49)* + +___ + diff --git a/doc/interfaces/adaptersourcedestination.md b/doc/interfaces/adaptersourcedestination.md new file mode 100644 index 00000000..1434b861 --- /dev/null +++ b/doc/interfaces/adaptersourcedestination.md @@ -0,0 +1,828 @@ +[etcher-sdk](../README.md) > [AdapterSourceDestination](../interfaces/adaptersourcedestination.md) + +# Interface: AdapterSourceDestination + +## Hierarchy + +↳ [SourceDestination](../classes/sourcedestination.md) + +**↳ AdapterSourceDestination** + +## Implemented by + +* [BlockDevice](../classes/blockdevice.md) +* [DriverlessDevice](../classes/driverlessdevice.md) +* [UsbbootDrive](../classes/usbbootdrive.md) + +## Index + +### Properties + +* [description](adaptersourcedestination.md#description) +* [device](adaptersourcedestination.md#device) +* [devicePath](adaptersourcedestination.md#devicepath) +* [emitsProgress](adaptersourcedestination.md#emitsprogress) +* [isSystem](adaptersourcedestination.md#issystem) +* [mountpoints](adaptersourcedestination.md#mountpoints) +* [raw](adaptersourcedestination.md#raw) +* [size](adaptersourcedestination.md#size) +* [defaultMaxListeners](adaptersourcedestination.md#defaultmaxlisteners) +* [imageExtensions](adaptersourcedestination.md#imageextensions) +* [mimetype](adaptersourcedestination.md#mimetype) + +### Methods + +* [_close](adaptersourcedestination.md#_close) +* [_getMetadata](adaptersourcedestination.md#_getmetadata) +* [_open](adaptersourcedestination.md#_open) +* [addListener](adaptersourcedestination.md#addlistener) +* [canCreateReadStream](adaptersourcedestination.md#cancreatereadstream) +* [canCreateSparseReadStream](adaptersourcedestination.md#cancreatesparsereadstream) +* [canCreateSparseWriteStream](adaptersourcedestination.md#cancreatesparsewritestream) +* [canCreateWriteStream](adaptersourcedestination.md#cancreatewritestream) +* [canRead](adaptersourcedestination.md#canread) +* [canWrite](adaptersourcedestination.md#canwrite) +* [close](adaptersourcedestination.md#close) +* [createReadStream](adaptersourcedestination.md#createreadstream) +* [createSparseReadStream](adaptersourcedestination.md#createsparsereadstream) +* [createSparseWriteStream](adaptersourcedestination.md#createsparsewritestream) +* [createVerifier](adaptersourcedestination.md#createverifier) +* [createWriteStream](adaptersourcedestination.md#createwritestream) +* [emit](adaptersourcedestination.md#emit) +* [eventNames](adaptersourcedestination.md#eventnames) +* [getBlocks](adaptersourcedestination.md#getblocks) +* [getInnerSource](adaptersourcedestination.md#getinnersource) +* [getMaxListeners](adaptersourcedestination.md#getmaxlisteners) +* [getMetadata](adaptersourcedestination.md#getmetadata) +* [getPartitionTable](adaptersourcedestination.md#getpartitiontable) +* [listenerCount](adaptersourcedestination.md#listenercount) +* [listeners](adaptersourcedestination.md#listeners) +* [on](adaptersourcedestination.md#on) +* [once](adaptersourcedestination.md#once) +* [open](adaptersourcedestination.md#open) +* [prependListener](adaptersourcedestination.md#prependlistener) +* [prependOnceListener](adaptersourcedestination.md#prependoncelistener) +* [read](adaptersourcedestination.md#read) +* [removeAllListeners](adaptersourcedestination.md#removealllisteners) +* [removeListener](adaptersourcedestination.md#removelistener) +* [setMaxListeners](adaptersourcedestination.md#setmaxlisteners) +* [write](adaptersourcedestination.md#write) +* [listenerCount](adaptersourcedestination.md#listenercount-1) +* [register](adaptersourcedestination.md#register) + +--- + +## Properties + + + +### description + +**● description**: *`string`* + +*Defined in [scanner/adapters/adapter.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L27)* + +___ + + +### device + +**● device**: *`string` \| `null`* + +*Defined in [scanner/adapters/adapter.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L24)* + +___ + + +### devicePath + +**● devicePath**: *`string` \| `null`* + +*Defined in [scanner/adapters/adapter.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L25)* + +___ + + +### emitsProgress + +**● emitsProgress**: *`boolean`* + +*Defined in [scanner/adapters/adapter.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L30)* + +___ + + +### isSystem + +**● isSystem**: *`boolean`* + +*Defined in [scanner/adapters/adapter.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L26)* + +___ + + +### mountpoints + +**● mountpoints**: *`Array`<`object`>* + +*Defined in [scanner/adapters/adapter.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L28)* + +___ + + +### raw + +**● raw**: *`string` \| `null`* + +*Defined in [scanner/adapters/adapter.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L23)* + +___ + + +### size + +**● size**: *`number` \| `null`* + +*Defined in [scanner/adapters/adapter.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/adapter.ts#L29)* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + + +### `` imageExtensions + +**● imageExtensions**: *`string`[]* = [ + 'img', + 'iso', + 'bin', + 'dsk', + 'hddimg', + 'raw', + 'dmg', + 'sdcard', + 'rpi-sdimg', + 'wic', + ] + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[imageExtensions](../classes/sourcedestination.md#imageextensions)* + +*Defined in [source-destination/source-destination.ts:234](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L234)* + +___ + + +### ```` mimetype + +**● mimetype**: *`undefined` \| `string`* + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[mimetype](../classes/sourcedestination.md#mimetype)* + +*Defined in [source-destination/source-destination.ts:246](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L246)* + +___ + +## Methods + + + +### `` _close + +▸ **_close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[_close](../classes/sourcedestination.md#_close)* + +*Defined in [source-destination/source-destination.ts:355](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L355)* + +**Returns:** `Promise`<`void`> + +___ + + +### `` _getMetadata + +▸ **_getMetadata**(): `Promise`<[Metadata](metadata.md)> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[_getMetadata](../classes/sourcedestination.md#_getmetadata)* + +*Defined in [source-destination/source-destination.ts:289](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L289)* + +**Returns:** `Promise`<[Metadata](metadata.md)> + +___ + + +### `` _open + +▸ **_open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[_open](../classes/sourcedestination.md#_open)* + +*Defined in [source-destination/source-destination.ts:351](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L351)* + +**Returns:** `Promise`<`void`> + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:717* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### canCreateReadStream + +▸ **canCreateReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canCreateReadStream](../classes/sourcedestination.md#cancreatereadstream)* + +*Defined in [source-destination/source-destination.ts:266](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L266)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseReadStream + +▸ **canCreateSparseReadStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canCreateSparseReadStream](../classes/sourcedestination.md#cancreatesparsereadstream)* + +*Defined in [source-destination/source-destination.ts:270](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L270)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateSparseWriteStream + +▸ **canCreateSparseWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canCreateSparseWriteStream](../classes/sourcedestination.md#cancreatesparsewritestream)* + +*Defined in [source-destination/source-destination.ts:278](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L278)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canCreateWriteStream + +▸ **canCreateWriteStream**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canCreateWriteStream](../classes/sourcedestination.md#cancreatewritestream)* + +*Defined in [source-destination/source-destination.ts:274](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L274)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canRead + +▸ **canRead**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canRead](../classes/sourcedestination.md#canread)* + +*Defined in [source-destination/source-destination.ts:258](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L258)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### canWrite + +▸ **canWrite**(): `Promise`<`boolean`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[canWrite](../classes/sourcedestination.md#canwrite)* + +*Defined in [source-destination/source-destination.ts:262](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L262)* + +**Returns:** `Promise`<`boolean`> + +___ + + +### close + +▸ **close**(): `Promise`<`void`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[close](../classes/sourcedestination.md#close)* + +*Defined in [source-destination/source-destination.ts:344](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L344)* + +**Returns:** `Promise`<`void`> + +___ + + +### createReadStream + +▸ **createReadStream**(_emitProgress?: *`boolean`*, _start?: *`number`*, _end?: *`undefined` \| `number`*): `Promise`<`ReadableStream`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[createReadStream](../classes/sourcedestination.md#createreadstream)* + +*Defined in [source-destination/source-destination.ts:311](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L311)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _emitProgress | `boolean` | false | +| `Default value` _start | `number` | 0 | +| `Optional` _end | `undefined` \| `number` | - | + +**Returns:** `Promise`<`ReadableStream`> + +___ + + +### createSparseReadStream + +▸ **createSparseReadStream**(_generateChecksums?: *`boolean`*): `Promise`<[SparseReadable](sparsereadable.md)> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[createSparseReadStream](../classes/sourcedestination.md#createsparsereadstream)* + +*Defined in [source-destination/source-destination.ts:319](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L319)* + +**Parameters:** + +| Name | Type | Default value | +| ------ | ------ | ------ | +| `Default value` _generateChecksums | `boolean` | false | + +**Returns:** `Promise`<[SparseReadable](sparsereadable.md)> + +___ + + +### createSparseWriteStream + +▸ **createSparseWriteStream**(): `Promise`<[SparseWritable](sparsewritable.md)> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[createSparseWriteStream](../classes/sourcedestination.md#createsparsewritestream)* + +*Defined in [source-destination/source-destination.ts:333](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L333)* + +**Returns:** `Promise`<[SparseWritable](sparsewritable.md)> + +___ + + +### createVerifier + +▸ **createVerifier**(checksumOrBlocks: *`string` \| [BlocksWithChecksum](blockswithchecksum.md)[]*, size?: *`undefined` \| `number`*): [Verifier](../classes/verifier.md) + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[createVerifier](../classes/sourcedestination.md#createverifier)* + +*Defined in [source-destination/source-destination.ts:359](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L359)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| checksumOrBlocks | `string` \| [BlocksWithChecksum](blockswithchecksum.md)[] | +| `Optional` size | `undefined` \| `number` | + +**Returns:** [Verifier](../classes/verifier.md) + +___ + + +### createWriteStream + +▸ **createWriteStream**(): `Promise`<`WritableStream`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[createWriteStream](../classes/sourcedestination.md#createwritestream)* + +*Defined in [source-destination/source-destination.ts:329](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L329)* + +**Returns:** `Promise`<`WritableStream`> + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:727* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getBlocks + +▸ **getBlocks**(): `Promise`<[BlocksWithChecksum](blockswithchecksum.md)[]> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[getBlocks](../classes/sourcedestination.md#getblocks)* + +*Defined in [source-destination/source-destination.ts:325](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L325)* + +**Returns:** `Promise`<[BlocksWithChecksum](blockswithchecksum.md)[]> + +___ + + +### getInnerSource + +▸ **getInnerSource**(): `Promise`<[SourceDestination](../classes/sourcedestination.md)> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[getInnerSource](../classes/sourcedestination.md#getinnersource)* + +*Defined in [source-destination/source-destination.ts:426](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L426)* + +**Returns:** `Promise`<[SourceDestination](../classes/sourcedestination.md)> + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### getMetadata + +▸ **getMetadata**(): `Promise`<[Metadata](metadata.md)> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[getMetadata](../classes/sourcedestination.md#getmetadata)* + +*Defined in [source-destination/source-destination.ts:282](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L282)* + +**Returns:** `Promise`<[Metadata](metadata.md)> + +___ + + +### getPartitionTable + +▸ **getPartitionTable**(): `Promise`<`GetPartitionsResult` \| `undefined`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[getPartitionTable](../classes/sourcedestination.md#getpartitiontable)* + +*Defined in [source-destination/source-destination.ts:447](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L447)* + +**Returns:** `Promise`<`GetPartitionsResult` \| `undefined`> + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:718* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:719* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### open + +▸ **open**(): `Promise`<`void`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[open](../classes/sourcedestination.md#open)* + +*Defined in [source-destination/source-destination.ts:337](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L337)* + +**Returns:** `Promise`<`void`> + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### read + +▸ **read**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _sourceOffset: *`number`*): `Promise`<`ReadResult`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[read](../classes/sourcedestination.md#read)* + +*Defined in [source-destination/source-destination.ts:293](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L293)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _sourceOffset | `number` | + +**Returns:** `Promise`<`ReadResult`> + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(_buffer: *`Buffer`*, _bufferOffset: *`number`*, _length: *`number`*, _fileOffset: *`number`*): `Promise`<`WriteResult`> + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[write](../classes/sourcedestination.md#write)* + +*Defined in [source-destination/source-destination.ts:302](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L302)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| _buffer | `Buffer` | +| _bufferOffset | `number` | +| _length | `number` | +| _fileOffset | `number` | + +**Returns:** `Promise`<`WriteResult`> + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### `` register + +▸ **register**(Cls: *[SourceSource](../classes/sourcesource.md)*): `void` + +*Inherited from [SourceDestination](../classes/sourcedestination.md).[register](../classes/sourcedestination.md#register)* + +*Defined in [source-destination/source-destination.ts:252](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/source-destination.ts#L252)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| Cls | [SourceSource](../classes/sourcesource.md) | + +**Returns:** `void` + +___ + diff --git a/doc/interfaces/block.md b/doc/interfaces/block.md new file mode 100644 index 00000000..b0696ef8 --- /dev/null +++ b/doc/interfaces/block.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [Block](../interfaces/block.md) + +# Interface: Block + +## Hierarchy + +**Block** + +## Index + +### Properties + +* [length](block.md#length) +* [offset](block.md#offset) + +--- + +## Properties + + + +### length + +**● length**: *`number`* + +*Defined in [sparse-stream/shared.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L35)* + +___ + + +### offset + +**● offset**: *`number`* + +*Defined in [sparse-stream/shared.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L34)* + +___ + diff --git a/doc/interfaces/blockswithchecksum.md b/doc/interfaces/blockswithchecksum.md new file mode 100644 index 00000000..63a62c2b --- /dev/null +++ b/doc/interfaces/blockswithchecksum.md @@ -0,0 +1,48 @@ +[etcher-sdk](../README.md) > [BlocksWithChecksum](../interfaces/blockswithchecksum.md) + +# Interface: BlocksWithChecksum + +## Hierarchy + +**BlocksWithChecksum** + +## Index + +### Properties + +* [blocks](blockswithchecksum.md#blocks) +* [checksum](blockswithchecksum.md#checksum) +* [checksumType](blockswithchecksum.md#checksumtype) + +--- + +## Properties + + + +### blocks + +**● blocks**: *[Block](block.md)[]* + +*Defined in [sparse-stream/shared.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L41)* + +___ + + +### `` checksum + +**● checksum**: *`undefined` \| `string`* + +*Defined in [sparse-stream/shared.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L40)* + +___ + + +### `` checksumType + +**● checksumType**: *[ChecksumType](../#checksumtype)* + +*Defined in [sparse-stream/shared.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L39)* + +___ + diff --git a/doc/interfaces/drivelistdrive.md b/doc/interfaces/drivelistdrive.md new file mode 100644 index 00000000..1d4fcaf6 --- /dev/null +++ b/doc/interfaces/drivelistdrive.md @@ -0,0 +1,280 @@ +[etcher-sdk](../README.md) > [DrivelistDrive](../interfaces/drivelistdrive.md) + +# Interface: DrivelistDrive + +## Hierarchy + + `Drive` + +**↳ DrivelistDrive** + +## Index + +### Properties + +* [blockSize](drivelistdrive.md#blocksize) +* [busType](drivelistdrive.md#bustype) +* [busVersion](drivelistdrive.md#busversion) +* [description](drivelistdrive.md#description) +* [device](drivelistdrive.md#device) +* [devicePath](drivelistdrive.md#devicepath) +* [displayName](drivelistdrive.md#displayname) +* [enumerator](drivelistdrive.md#enumerator) +* [error](drivelistdrive.md#error) +* [icon](drivelistdrive.md#icon) +* [isCard](drivelistdrive.md#iscard) +* [isReadOnly](drivelistdrive.md#isreadonly) +* [isRemovable](drivelistdrive.md#isremovable) +* [isSCSI](drivelistdrive.md#isscsi) +* [isSystem](drivelistdrive.md#issystem) +* [isUAS](drivelistdrive.md#isuas) +* [isUSB](drivelistdrive.md#isusb) +* [isVirtual](drivelistdrive.md#isvirtual) +* [logicalBlockSize](drivelistdrive.md#logicalblocksize) +* [mountpoints](drivelistdrive.md#mountpoints) +* [raw](drivelistdrive.md#raw) +* [size](drivelistdrive.md#size) + +--- + +## Properties + + + +### blockSize + +**● blockSize**: *`number`* + +*Inherited from Drive.blockSize* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:6* + +___ + + +### busType + +**● busType**: *`string`* + +*Inherited from Drive.busType* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:7* + +___ + + +### busVersion + +**● busVersion**: *`null`* + +*Inherited from Drive.busVersion* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:8* + +___ + + +### description + +**● description**: *`string`* + +*Inherited from Drive.description* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:9* + +___ + + +### device + +**● device**: *`string`* + +*Inherited from Drive.device* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:10* + +___ + + +### devicePath + +**● devicePath**: *`string` \| `null`* + +*Inherited from Drive.devicePath* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:11* + +___ + + +### displayName + +**● displayName**: *`string`* + +*Defined in [scanner/adapters/block-device.ts:52](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L52)* + +___ + + +### enumerator + +**● enumerator**: *`string`* + +*Inherited from Drive.enumerator* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:12* + +___ + + +### error + +**● error**: *`null`* + +*Inherited from Drive.error* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:13* + +___ + + +### `` icon + +**● icon**: *`undefined` \| `string`* + +*Defined in [scanner/adapters/block-device.ts:53](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/scanner/adapters/block-device.ts#L53)* + +___ + + +### isCard + +**● isCard**: *`null`* + +*Inherited from Drive.isCard* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:14* + +___ + + +### isReadOnly + +**● isReadOnly**: *`boolean`* + +*Inherited from Drive.isReadOnly* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:15* + +___ + + +### isRemovable + +**● isRemovable**: *`boolean`* + +*Inherited from Drive.isRemovable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:16* + +___ + + +### isSCSI + +**● isSCSI**: *`boolean` \| `null`* + +*Inherited from Drive.isSCSI* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:17* + +___ + + +### isSystem + +**● isSystem**: *`boolean`* + +*Inherited from Drive.isSystem* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:18* + +___ + + +### isUAS + +**● isUAS**: *`null`* + +*Inherited from Drive.isUAS* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:19* + +___ + + +### isUSB + +**● isUSB**: *`boolean` \| `null`* + +*Inherited from Drive.isUSB* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:20* + +___ + + +### isVirtual + +**● isVirtual**: *`boolean` \| `null`* + +*Inherited from Drive.isVirtual* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:21* + +___ + + +### logicalBlockSize + +**● logicalBlockSize**: *`number`* + +*Inherited from Drive.logicalBlockSize* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:22* + +___ + + +### mountpoints + +**● mountpoints**: *`Mountpoint`[]* + +*Inherited from Drive.mountpoints* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:23* + +___ + + +### raw + +**● raw**: *`string`* + +*Inherited from Drive.raw* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:24* + +___ + + +### size + +**● size**: *`number` \| `null`* + +*Inherited from Drive.size* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/drivelist/js/index.d.ts:25* + +___ + diff --git a/doc/interfaces/execresult.md b/doc/interfaces/execresult.md new file mode 100644 index 00000000..8f331128 --- /dev/null +++ b/doc/interfaces/execresult.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [ExecResult](../interfaces/execresult.md) + +# Interface: ExecResult + +## Hierarchy + +**ExecResult** + +## Index + +### Properties + +* [stderr](execresult.md#stderr) +* [stdout](execresult.md#stdout) + +--- + +## Properties + + + +### stderr + +**● stderr**: *`string`* + +*Defined in [diskpart.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L33)* + +___ + + +### stdout + +**● stdout**: *`string`* + +*Defined in [diskpart.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/diskpart.ts#L32)* + +___ + diff --git a/doc/interfaces/metadata.md b/doc/interfaces/metadata.md new file mode 100644 index 00000000..627b229d --- /dev/null +++ b/doc/interfaces/metadata.md @@ -0,0 +1,198 @@ +[etcher-sdk](../README.md) > [Metadata](../interfaces/metadata.md) + +# Interface: Metadata + +## Hierarchy + +**Metadata** + +## Index + +### Properties + +* [blockMap](metadata.md#blockmap) +* [blockmappedSize](metadata.md#blockmappedsize) +* [blocks](metadata.md#blocks) +* [bytesToZeroOutFromTheBeginning](metadata.md#bytestozerooutfromthebeginning) +* [checksum](metadata.md#checksum) +* [checksumType](metadata.md#checksumtype) +* [compressedSize](metadata.md#compressedsize) +* [instructions](metadata.md#instructions) +* [isEtch](metadata.md#isetch) +* [isSizeEstimated](metadata.md#issizeestimated) +* [logo](metadata.md#logo) +* [name](metadata.md#name) +* [recommendedDriveSize](metadata.md#recommendeddrivesize) +* [releaseNotesUrl](metadata.md#releasenotesurl) +* [size](metadata.md#size) +* [supportUrl](metadata.md#supporturl) +* [url](metadata.md#url) +* [version](metadata.md#version) + +--- + +## Properties + + + +### `` blockMap + +**● blockMap**: *`BlockMap`* + +*Defined in [source-destination/metadata.ts:27](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L27)* + +___ + + +### `` blockmappedSize + +**● blockmappedSize**: *`undefined` \| `number`* + +*Defined in [source-destination/metadata.ts:25](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L25)* + +___ + + +### `` blocks + +**● blocks**: *[BlocksWithChecksum](blockswithchecksum.md)[]* + +*Defined in [source-destination/metadata.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L28)* + +___ + + +### `` bytesToZeroOutFromTheBeginning + +**● bytesToZeroOutFromTheBeginning**: *`undefined` \| `number`* + +*Defined in [source-destination/metadata.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L31)* + +___ + + +### `` checksum + +**● checksum**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L32)* + +___ + + +### `` checksumType + +**● checksumType**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L33)* + +___ + + +### `` compressedSize + +**● compressedSize**: *`undefined` \| `number`* + +*Defined in [source-destination/metadata.ts:24](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L24)* + +___ + + +### `` instructions + +**● instructions**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L29)* + +___ + + +### `` isEtch + +**● isEtch**: *`undefined` \| `false` \| `true`* + +*Defined in [source-destination/metadata.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L39)* + +___ + + +### `` isSizeEstimated + +**● isSizeEstimated**: *`undefined` \| `false` \| `true`* + +*Defined in [source-destination/metadata.ts:23](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L23)* + +___ + + +### `` logo + +**● logo**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L30)* + +___ + + +### `` name + +**● name**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L26)* + +___ + + +### `` recommendedDriveSize + +**● recommendedDriveSize**: *`undefined` \| `number`* + +*Defined in [source-destination/metadata.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L34)* + +___ + + +### `` releaseNotesUrl + +**● releaseNotesUrl**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L35)* + +___ + + +### `` size + +**● size**: *`undefined` \| `number`* + +*Defined in [source-destination/metadata.ts:22](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L22)* + +___ + + +### `` supportUrl + +**● supportUrl**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L36)* + +___ + + +### `` url + +**● url**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L37)* + +___ + + +### `` version + +**● version**: *`undefined` \| `string`* + +*Defined in [source-destination/metadata.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/metadata.ts#L38)* + +___ + diff --git a/doc/interfaces/multidestinationprogress.md b/doc/interfaces/multidestinationprogress.md new file mode 100644 index 00000000..ab0fdb1a --- /dev/null +++ b/doc/interfaces/multidestinationprogress.md @@ -0,0 +1,224 @@ +[etcher-sdk](../README.md) > [MultiDestinationProgress](../interfaces/multidestinationprogress.md) + +# Interface: MultiDestinationProgress + +## Hierarchy + + [MultiDestinationState](multidestinationstate.md) + +**↳ MultiDestinationProgress** + +## Index + +### Properties + +* [active](multidestinationprogress.md#active) +* [blockmappedSize](multidestinationprogress.md#blockmappedsize) +* [bytes](multidestinationprogress.md#bytes) +* [compressedSize](multidestinationprogress.md#compressedsize) +* [eta](multidestinationprogress.md#eta) +* [failed](multidestinationprogress.md#failed) +* [flashing](multidestinationprogress.md#flashing) +* [percentage](multidestinationprogress.md#percentage) +* [position](multidestinationprogress.md#position) +* [rootStreamPosition](multidestinationprogress.md#rootstreamposition) +* [rootStreamSpeed](multidestinationprogress.md#rootstreamspeed) +* [size](multidestinationprogress.md#size) +* [sparse](multidestinationprogress.md#sparse) +* [speed](multidestinationprogress.md#speed) +* [successful](multidestinationprogress.md#successful) +* [totalSpeed](multidestinationprogress.md#totalspeed) +* [type](multidestinationprogress.md#type) +* [verifying](multidestinationprogress.md#verifying) + +--- + +## Properties + + + +### active + +**● active**: *`number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[active](multidestinationstate.md#active)* + +*Defined in [multi-write.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L37)* + +___ + + +### `` blockmappedSize + +**● blockmappedSize**: *`undefined` \| `number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[blockmappedSize](multidestinationstate.md#blockmappedsize)* + +*Defined in [multi-write.ts:45](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L45)* + +___ + + +### bytes + +**● bytes**: *`number`* + +*Defined in [multi-write.ts:52](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L52)* + +___ + + +### `` compressedSize + +**● compressedSize**: *`undefined` \| `number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[compressedSize](multidestinationstate.md#compressedsize)* + +*Defined in [multi-write.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L44)* + +___ + + +### `` eta + +**● eta**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:57](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L57)* + +___ + + +### failed + +**● failed**: *`number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[failed](multidestinationstate.md#failed)* + +*Defined in [multi-write.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L40)* + +___ + + +### flashing + +**● flashing**: *`number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[flashing](multidestinationstate.md#flashing)* + +*Defined in [multi-write.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L38)* + +___ + + +### `` percentage + +**● percentage**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:56](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L56)* + +___ + + +### position + +**● position**: *`number`* + +*Defined in [multi-write.ts:53](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L53)* + +___ + + +### `` rootStreamPosition + +**● rootStreamPosition**: *`undefined` \| `number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[rootStreamPosition](multidestinationstate.md#rootstreamposition)* + +*Defined in [multi-write.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L47)* + +___ + + +### `` rootStreamSpeed + +**● rootStreamSpeed**: *`undefined` \| `number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[rootStreamSpeed](multidestinationstate.md#rootstreamspeed)* + +*Defined in [multi-write.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L48)* + +___ + + +### `` size + +**● size**: *`undefined` \| `number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[size](multidestinationstate.md#size)* + +*Defined in [multi-write.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L43)* + +___ + + +### `` sparse + +**● sparse**: *`undefined` \| `false` \| `true`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[sparse](multidestinationstate.md#sparse)* + +*Defined in [multi-write.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L46)* + +___ + + +### speed + +**● speed**: *`number`* + +*Defined in [multi-write.ts:54](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L54)* + +___ + + +### successful + +**● successful**: *`number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[successful](multidestinationstate.md#successful)* + +*Defined in [multi-write.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L41)* + +___ + + +### totalSpeed + +**● totalSpeed**: *`number`* + +*Defined in [multi-write.ts:55](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L55)* + +___ + + +### type + +**● type**: *[WriteStep](../#writestep)* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[type](multidestinationstate.md#type)* + +*Defined in [multi-write.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L42)* + +___ + + +### verifying + +**● verifying**: *`number`* + +*Inherited from [MultiDestinationState](multidestinationstate.md).[verifying](multidestinationstate.md#verifying)* + +*Defined in [multi-write.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L39)* + +___ + diff --git a/doc/interfaces/multidestinationstate.md b/doc/interfaces/multidestinationstate.md new file mode 100644 index 00000000..1406ee95 --- /dev/null +++ b/doc/interfaces/multidestinationstate.md @@ -0,0 +1,140 @@ +[etcher-sdk](../README.md) > [MultiDestinationState](../interfaces/multidestinationstate.md) + +# Interface: MultiDestinationState + +## Hierarchy + +**MultiDestinationState** + +↳ [MultiDestinationProgress](multidestinationprogress.md) + +## Index + +### Properties + +* [active](multidestinationstate.md#active) +* [blockmappedSize](multidestinationstate.md#blockmappedsize) +* [compressedSize](multidestinationstate.md#compressedsize) +* [failed](multidestinationstate.md#failed) +* [flashing](multidestinationstate.md#flashing) +* [rootStreamPosition](multidestinationstate.md#rootstreamposition) +* [rootStreamSpeed](multidestinationstate.md#rootstreamspeed) +* [size](multidestinationstate.md#size) +* [sparse](multidestinationstate.md#sparse) +* [successful](multidestinationstate.md#successful) +* [type](multidestinationstate.md#type) +* [verifying](multidestinationstate.md#verifying) + +--- + +## Properties + + + +### active + +**● active**: *`number`* + +*Defined in [multi-write.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L37)* + +___ + + +### `` blockmappedSize + +**● blockmappedSize**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:45](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L45)* + +___ + + +### `` compressedSize + +**● compressedSize**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:44](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L44)* + +___ + + +### failed + +**● failed**: *`number`* + +*Defined in [multi-write.ts:40](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L40)* + +___ + + +### flashing + +**● flashing**: *`number`* + +*Defined in [multi-write.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L38)* + +___ + + +### `` rootStreamPosition + +**● rootStreamPosition**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:47](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L47)* + +___ + + +### `` rootStreamSpeed + +**● rootStreamSpeed**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:48](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L48)* + +___ + + +### `` size + +**● size**: *`undefined` \| `number`* + +*Defined in [multi-write.ts:43](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L43)* + +___ + + +### `` sparse + +**● sparse**: *`undefined` \| `false` \| `true`* + +*Defined in [multi-write.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L46)* + +___ + + +### successful + +**● successful**: *`number`* + +*Defined in [multi-write.ts:41](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L41)* + +___ + + +### type + +**● type**: *[WriteStep](../#writestep)* + +*Defined in [multi-write.ts:42](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L42)* + +___ + + +### verifying + +**● verifying**: *`number`* + +*Defined in [multi-write.ts:39](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L39)* + +___ + diff --git a/doc/interfaces/operation.md b/doc/interfaces/operation.md new file mode 100644 index 00000000..f2f06bff --- /dev/null +++ b/doc/interfaces/operation.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [Operation](../interfaces/operation.md) + +# Interface: Operation + +## Hierarchy + +**Operation** + +## Index + +### Properties + +* [command](operation.md#command) +* [when](operation.md#when) + +--- + +## Properties + + + +### command + +**● command**: *[OperationCommand](../#operationcommand)* + +*Defined in [source-destination/configured-source/configure.ts:31](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L31)* + +___ + + +### when + +**● when**: *`any`* + +*Defined in [source-destination/configured-source/configure.ts:32](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/configure.ts#L32)* + +___ + diff --git a/doc/interfaces/pipesourcetodestinationsresult.md b/doc/interfaces/pipesourcetodestinationsresult.md new file mode 100644 index 00000000..51542f7a --- /dev/null +++ b/doc/interfaces/pipesourcetodestinationsresult.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [PipeSourceToDestinationsResult](../interfaces/pipesourcetodestinationsresult.md) + +# Interface: PipeSourceToDestinationsResult + +## Hierarchy + +**PipeSourceToDestinationsResult** + +## Index + +### Properties + +* [bytesWritten](pipesourcetodestinationsresult.md#byteswritten) +* [failures](pipesourcetodestinationsresult.md#failures) + +--- + +## Properties + + + +### bytesWritten + +**● bytesWritten**: *`number`* + +*Defined in [multi-write.ts:69](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L69)* + +___ + + +### failures + +**● failures**: *`Map`<[SourceDestination](../classes/sourcedestination.md), `Error`>* + +*Defined in [multi-write.ts:68](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/multi-write.ts#L68)* + +___ + diff --git a/doc/interfaces/progressevent.md b/doc/interfaces/progressevent.md new file mode 100644 index 00000000..88e2947a --- /dev/null +++ b/doc/interfaces/progressevent.md @@ -0,0 +1,48 @@ +[etcher-sdk](../README.md) > [ProgressEvent](../interfaces/progressevent.md) + +# Interface: ProgressEvent + +## Hierarchy + +**ProgressEvent** + +## Index + +### Properties + +* [bytes](progressevent.md#bytes) +* [position](progressevent.md#position) +* [speed](progressevent.md#speed) + +--- + +## Properties + + + +### bytes + +**● bytes**: *`number`* + +*Defined in [source-destination/progress.ts:29](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L29)* + +___ + + +### position + +**● position**: *`number`* + +*Defined in [source-destination/progress.ts:28](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L28)* + +___ + + +### speed + +**● speed**: *`number`* + +*Defined in [source-destination/progress.ts:30](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/progress.ts#L30)* + +___ + diff --git a/doc/interfaces/sourcetransform.md b/doc/interfaces/sourcetransform.md new file mode 100644 index 00000000..2b6ec6db --- /dev/null +++ b/doc/interfaces/sourcetransform.md @@ -0,0 +1,1371 @@ +[etcher-sdk](../README.md) > [SourceTransform](../interfaces/sourcetransform.md) + +# Interface: SourceTransform + +## Hierarchy + + `Transform` + +**↳ SourceTransform** + +## Implements + +* `ReadableStream` +* `Writable` + +## Index + +### Constructors + +* [constructor](sourcetransform.md#constructor) + +### Properties + +* [readable](sourcetransform.md#readable) +* [sourceStream](sourcetransform.md#sourcestream) +* [writable](sourcetransform.md#writable) +* [defaultMaxListeners](sourcetransform.md#defaultmaxlisteners) + +### Methods + +* [_read](sourcetransform.md#_read) +* [_transform](sourcetransform.md#_transform) +* [_write](sourcetransform.md#_write) +* [addListener](sourcetransform.md#addlistener) +* [emit](sourcetransform.md#emit) +* [end](sourcetransform.md#end) +* [eventNames](sourcetransform.md#eventnames) +* [getMaxListeners](sourcetransform.md#getmaxlisteners) +* [isPaused](sourcetransform.md#ispaused) +* [listenerCount](sourcetransform.md#listenercount) +* [listeners](sourcetransform.md#listeners) +* [on](sourcetransform.md#on) +* [once](sourcetransform.md#once) +* [pause](sourcetransform.md#pause) +* [pipe](sourcetransform.md#pipe) +* [prependListener](sourcetransform.md#prependlistener) +* [prependOnceListener](sourcetransform.md#prependoncelistener) +* [push](sourcetransform.md#push) +* [read](sourcetransform.md#read) +* [removeAllListeners](sourcetransform.md#removealllisteners) +* [removeListener](sourcetransform.md#removelistener) +* [resume](sourcetransform.md#resume) +* [setDefaultEncoding](sourcetransform.md#setdefaultencoding) +* [setEncoding](sourcetransform.md#setencoding) +* [setMaxListeners](sourcetransform.md#setmaxlisteners) +* [unpipe](sourcetransform.md#unpipe) +* [unshift](sourcetransform.md#unshift) +* [wrap](sourcetransform.md#wrap) +* [write](sourcetransform.md#write) +* [listenerCount](sourcetransform.md#listenercount-1) + +--- + +## Constructors + + + +### constructor + +⊕ **new SourceTransform**(opts?: *`TransformOptions`*): [SourceTransform](sourcetransform.md) + +*Inherited from Transform.__constructor* + +*Overrides Duplex.__constructor* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3901* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` opts | `TransformOptions` | + +**Returns:** [SourceTransform](sourcetransform.md) + +___ + +## Properties + + + +### readable + +**● readable**: *`boolean`* + +*Inherited from Readable.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3718* + +___ + + +### sourceStream + +**● sourceStream**: *`ReadableStream`* + +*Defined in [source-destination/compressed-source.ts:26](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/compressed-source.ts#L26)* + +___ + + +### writable + +**● writable**: *`boolean`* + +*Inherited from Duplex.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3885* + +___ + + +### `` defaultMaxListeners + +**● defaultMaxListeners**: *`number`* + +*Inherited from EventEmitter.defaultMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:715* + +___ + +## Methods + + + +### _read + +▸ **_read**(size: *`number`*): `void` + +*Inherited from Readable._read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3720* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| size | `number` | + +**Returns:** `void` + +___ + + +### _transform + +▸ **_transform**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Transform._transform* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3903* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### _write + +▸ **_write**(chunk: *`any`*, encoding: *`string`*, callback: *`Function`*): `void` + +*Inherited from Duplex._write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3887* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| encoding | `string` | +| callback | `Function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **addListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **addListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3741* + +Event emitter The defined events on documents including: + +1. close +2. data +3. end +4. readable +5. error + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3742* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3743* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3744* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3745* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.addListener* + +*Overrides EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3746* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +▸ **emit**(event: *"close"*): `boolean` + +▸ **emit**(event: *"data"*, chunk: *`Buffer` \| `string`*): `boolean` + +▸ **emit**(event: *"end"*): `boolean` + +▸ **emit**(event: *"readable"*): `boolean` + +▸ **emit**(event: *"error"*, err: *`Error`*): `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3748* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3749* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3750* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| chunk | `Buffer` \| `string` | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3751* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3752* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | + +**Returns:** `boolean` + +*Inherited from Readable.emit* + +*Overrides EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3753* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| err | `Error` | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, cb?: *`Function`*): `void` + +▸ **end**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3891* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3892* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from Duplex.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3893* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Overrides EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:728* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Overrides EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:725* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from Readable.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3725* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Overrides EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Overrides EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:726* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string`*, listener: *`Function`*): `this` + +▸ **on**(event: *"close"*, listener: *`function`*): `this` + +▸ **on**(event: *"data"*, listener: *`function`*): `this` + +▸ **on**(event: *"end"*, listener: *`function`*): `this` + +▸ **on**(event: *"readable"*, listener: *`function`*): `this` + +▸ **on**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3755* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3756* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3757* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3758* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3759* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.on* + +*Overrides EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3760* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string`*, listener: *`Function`*): `this` + +▸ **once**(event: *"close"*, listener: *`function`*): `this` + +▸ **once**(event: *"data"*, listener: *`function`*): `this` + +▸ **once**(event: *"end"*, listener: *`function`*): `this` + +▸ **once**(event: *"readable"*, listener: *`function`*): `this` + +▸ **once**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3762* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3763* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3764* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3765* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3766* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.once* + +*Overrides EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3767* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from Readable.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3723* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from Readable.pipe* + +*Overrides internal.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3726* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3769* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3770* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3771* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3772* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3773* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependListener* + +*Overrides EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3774* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **prependOnceListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **prependOnceListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3776* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3777* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3778* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3779* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3780* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.prependOnceListener* + +*Overrides EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3781* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *`any`*, encoding?: *`undefined` \| `string`*): `boolean` + +*Inherited from Readable.push* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3730* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `any` + +*Inherited from Readable.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3721* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `any` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Overrides EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:723* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string`*, listener: *`Function`*): `this` + +▸ **removeListener**(event: *"close"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"data"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"end"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"readable"*, listener: *`function`*): `this` + +▸ **removeListener**(event: *"error"*, listener: *`function`*): `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3783* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` | +| listener | `Function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3784* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "close" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3785* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "data" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3786* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "end" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3787* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "readable" | +| listener | `function` | + +**Returns:** `this` + +*Inherited from Readable.removeListener* + +*Overrides EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3788* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | "error" | +| listener | `function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from Readable.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3724* + +**Returns:** `this` + +___ + + +### setDefaultEncoding + +▸ **setDefaultEncoding**(encoding: *`string`*): `this` + +*Inherited from Duplex.setDefaultEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3890* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string`*): `void` + +*Inherited from Readable.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3722* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Overrides EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:724* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from Readable.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3727* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`any`*): `void` + +*Inherited from Readable.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3728* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `Readable` + +*Inherited from Readable.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3729* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `Readable` + +___ + + +### write + +▸ **write**(chunk: *`any`*, cb?: *`Function`*): `boolean` + +▸ **write**(chunk: *`any`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3888* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from Duplex.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:3889* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `any` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + + +### `` listenerCount + +▸ **listenerCount**(emitter: *`EventEmitter`*, event: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:714* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| emitter | `EventEmitter` | +| event | `string` \| `symbol` | + +**Returns:** `number` + +___ + diff --git a/doc/interfaces/sparsereadable.md b/doc/interfaces/sparsereadable.md new file mode 100644 index 00000000..295abd75 --- /dev/null +++ b/doc/interfaces/sparsereadable.md @@ -0,0 +1,509 @@ +[etcher-sdk](../README.md) > [SparseReadable](../interfaces/sparsereadable.md) + +# Interface: SparseReadable + +## Hierarchy + + `ReadableStream` + +**↳ SparseReadable** + +## Implemented by + +* [SparseFilterStream](../classes/sparsefilterstream.md) +* [SparseReadStream](../classes/sparsereadstream.md) + +## Index + +### Properties + +* [blocks](sparsereadable.md#blocks) +* [readable](sparsereadable.md#readable) + +### Methods + +* [addListener](sparsereadable.md#addlistener) +* [emit](sparsereadable.md#emit) +* [eventNames](sparsereadable.md#eventnames) +* [getMaxListeners](sparsereadable.md#getmaxlisteners) +* [isPaused](sparsereadable.md#ispaused) +* [listenerCount](sparsereadable.md#listenercount) +* [listeners](sparsereadable.md#listeners) +* [on](sparsereadable.md#on) +* [once](sparsereadable.md#once) +* [pause](sparsereadable.md#pause) +* [pipe](sparsereadable.md#pipe) +* [prependListener](sparsereadable.md#prependlistener) +* [prependOnceListener](sparsereadable.md#prependoncelistener) +* [push](sparsereadable.md#push) +* [read](sparsereadable.md#read) +* [removeAllListeners](sparsereadable.md#removealllisteners) +* [removeListener](sparsereadable.md#removelistener) +* [resume](sparsereadable.md#resume) +* [setEncoding](sparsereadable.md#setencoding) +* [setMaxListeners](sparsereadable.md#setmaxlisteners) +* [unpipe](sparsereadable.md#unpipe) +* [unshift](sparsereadable.md#unshift) +* [wrap](sparsereadable.md#wrap) + +--- + +## Properties + + + +### blocks + +**● blocks**: *[BlocksWithChecksum](blockswithchecksum.md)[]* + +*Defined in [sparse-stream/shared.ts:50](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L50)* + +___ + + +### readable + +**● readable**: *`boolean`* + +*Inherited from ReadableStream.readable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:386* + +___ + +## Methods + + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:369* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:377* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:382* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:375* + +**Returns:** `number` + +___ + + +### isPaused + +▸ **isPaused**(): `boolean` + +*Inherited from ReadableStream.isPaused* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:391* + +**Returns:** `boolean` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:378* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:376* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:370* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:371* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### pause + +▸ **pause**(): `this` + +*Inherited from ReadableStream.pause* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:389* + +**Returns:** `this` + +___ + + +### pipe + +▸ **pipe**<`T`>(destination: *`T`*, options?: *`undefined` \| `object`*): `T` + +*Inherited from ReadableStream.pipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:392* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| destination | `T` | +| `Optional` options | `undefined` \| `object` | + +**Returns:** `T` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:380* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:381* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### push + +▸ **push**(chunk: *[SparseStreamChunk](sparsestreamchunk.md)*): `boolean` + +*Defined in [sparse-stream/shared.ts:51](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L51)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | [SparseStreamChunk](sparsestreamchunk.md) | + +**Returns:** `boolean` + +___ + + +### read + +▸ **read**(size?: *`undefined` \| `number`*): `string` \| `Buffer` + +*Inherited from ReadableStream.read* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:387* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` size | `undefined` \| `number` | + +**Returns:** `string` \| `Buffer` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:373* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:372* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### resume + +▸ **resume**(): `this` + +*Inherited from ReadableStream.resume* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:390* + +**Returns:** `this` + +___ + + +### setEncoding + +▸ **setEncoding**(encoding: *`string` \| `null`*): `void` + +*Inherited from ReadableStream.setEncoding* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:388* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| encoding | `string` \| `null` | + +**Returns:** `void` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:374* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### unpipe + +▸ **unpipe**<`T`>(destination?: *[T]()*): `void` + +*Inherited from ReadableStream.unpipe* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:393* + +**Type parameters:** + +#### T : `WritableStream` +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` destination | [T]() | + +**Returns:** `void` + +___ + + +### unshift + +▸ **unshift**(chunk: *`string`*): `void` + +▸ **unshift**(chunk: *`Buffer`*): `void` + +*Inherited from ReadableStream.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:394* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `string` | + +**Returns:** `void` + +*Inherited from ReadableStream.unshift* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:395* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | `Buffer` | + +**Returns:** `void` + +___ + + +### wrap + +▸ **wrap**(oldStream: *`ReadableStream`*): `ReadableStream` + +*Inherited from ReadableStream.wrap* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:396* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| oldStream | `ReadableStream` | + +**Returns:** `ReadableStream` + +___ + diff --git a/doc/interfaces/sparsereaderstate.md b/doc/interfaces/sparsereaderstate.md new file mode 100644 index 00000000..0ec7fb71 --- /dev/null +++ b/doc/interfaces/sparsereaderstate.md @@ -0,0 +1,48 @@ +[etcher-sdk](../README.md) > [SparseReaderState](../interfaces/sparsereaderstate.md) + +# Interface: SparseReaderState + +## Hierarchy + +**SparseReaderState** + +## Index + +### Properties + +* [block](sparsereaderstate.md#block) +* [hasher](sparsereaderstate.md#hasher) +* [subBlock](sparsereaderstate.md#subblock) + +--- + +## Properties + + + +### block + +**● block**: *[BlocksWithChecksum](blockswithchecksum.md)* + +*Defined in [sparse-stream/shared.ts:81](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L81)* + +___ + + +### `` hasher + +**● hasher**: *[AnyHasher](../#anyhasher)* + +*Defined in [sparse-stream/shared.ts:83](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L83)* + +___ + + +### subBlock + +**● subBlock**: *[Block](block.md)* + +*Defined in [sparse-stream/shared.ts:82](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L82)* + +___ + diff --git a/doc/interfaces/sparsestreamchunk.md b/doc/interfaces/sparsestreamchunk.md new file mode 100644 index 00000000..e0c1fe1e --- /dev/null +++ b/doc/interfaces/sparsestreamchunk.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [SparseStreamChunk](../interfaces/sparsestreamchunk.md) + +# Interface: SparseStreamChunk + +## Hierarchy + +**SparseStreamChunk** + +## Index + +### Properties + +* [buffer](sparsestreamchunk.md#buffer) +* [position](sparsestreamchunk.md#position) + +--- + +## Properties + + + +### buffer + +**● buffer**: *`Buffer`* + +*Defined in [sparse-stream/shared.ts:45](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L45)* + +___ + + +### position + +**● position**: *`number`* + +*Defined in [sparse-stream/shared.ts:46](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/shared.ts#L46)* + +___ + diff --git a/doc/interfaces/sparsewritable.md b/doc/interfaces/sparsewritable.md new file mode 100644 index 00000000..19d07dec --- /dev/null +++ b/doc/interfaces/sparsewritable.md @@ -0,0 +1,420 @@ +[etcher-sdk](../README.md) > [SparseWritable](../interfaces/sparsewritable.md) + +# Interface: SparseWritable + +## Hierarchy + + `WritableStream` + +**↳ SparseWritable** + +## Implemented by + +* [SparseWriteStream](../classes/sparsewritestream.md) + +## Index + +### Properties + +* [writable](sparsewritable.md#writable) + +### Methods + +* [_write](sparsewritable.md#_write) +* [addListener](sparsewritable.md#addlistener) +* [emit](sparsewritable.md#emit) +* [end](sparsewritable.md#end) +* [eventNames](sparsewritable.md#eventnames) +* [getMaxListeners](sparsewritable.md#getmaxlisteners) +* [listenerCount](sparsewritable.md#listenercount) +* [listeners](sparsewritable.md#listeners) +* [on](sparsewritable.md#on) +* [once](sparsewritable.md#once) +* [prependListener](sparsewritable.md#prependlistener) +* [prependOnceListener](sparsewritable.md#prependoncelistener) +* [removeAllListeners](sparsewritable.md#removealllisteners) +* [removeListener](sparsewritable.md#removelistener) +* [setMaxListeners](sparsewritable.md#setmaxlisteners) +* [write](sparsewritable.md#write) + +--- + +## Properties + + + +### writable + +**● writable**: *`boolean`* + +*Inherited from WritableStream.writable* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:400* + +___ + +## Methods + + + +### _write + +▸ **_write**(chunk: *[SparseStreamChunk](sparsestreamchunk.md)*, encoding: *`string`*, callback: *`function`*): `void` + +*Defined in [sparse-stream/sparse-write-stream.ts:12](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/sparse-stream/sparse-write-stream.ts#L12)* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| chunk | [SparseStreamChunk](sparsestreamchunk.md) | +| encoding | `string` | +| callback | `function` | + +**Returns:** `void` + +___ + + +### addListener + +▸ **addListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.addListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:369* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### emit + +▸ **emit**(event: *`string` \| `symbol`*, ...args: *`any`[]*): `boolean` + +*Inherited from EventEmitter.emit* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:377* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| `Rest` args | `any`[] | + +**Returns:** `boolean` + +___ + + +### end + +▸ **end**(cb?: *`Function`*): `void` + +▸ **end**(buffer: *`Buffer`*, cb?: *`Function`*): `void` + +▸ **end**(str: *`string`*, cb?: *`Function`*): `void` + +▸ **end**(str: *`string`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `void` + +*Inherited from WritableStream.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:403* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from WritableStream.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:404* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from WritableStream.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:405* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| str | `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +*Inherited from WritableStream.end* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:406* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| str | `string` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `void` + +___ + + +### eventNames + +▸ **eventNames**(): (`string` \| `symbol`)[] + +*Inherited from EventEmitter.eventNames* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:382* + +**Returns:** (`string` \| `symbol`)[] + +___ + + +### getMaxListeners + +▸ **getMaxListeners**(): `number` + +*Inherited from EventEmitter.getMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:375* + +**Returns:** `number` + +___ + + +### listenerCount + +▸ **listenerCount**(type: *`string` \| `symbol`*): `number` + +*Inherited from EventEmitter.listenerCount* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:378* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| type | `string` \| `symbol` | + +**Returns:** `number` + +___ + + +### listeners + +▸ **listeners**(event: *`string` \| `symbol`*): `Function`[] + +*Inherited from EventEmitter.listeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:376* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | + +**Returns:** `Function`[] + +___ + + +### on + +▸ **on**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.on* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:370* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### once + +▸ **once**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.once* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:371* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependListener + +▸ **prependListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:380* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### prependOnceListener + +▸ **prependOnceListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.prependOnceListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:381* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### removeAllListeners + +▸ **removeAllListeners**(event?: *`string` \| `symbol`*): `this` + +*Inherited from EventEmitter.removeAllListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:373* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| `Optional` event | `string` \| `symbol` | + +**Returns:** `this` + +___ + + +### removeListener + +▸ **removeListener**(event: *`string` \| `symbol`*, listener: *`Function`*): `this` + +*Inherited from EventEmitter.removeListener* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:372* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| event | `string` \| `symbol` | +| listener | `Function` | + +**Returns:** `this` + +___ + + +### setMaxListeners + +▸ **setMaxListeners**(n: *`number`*): `this` + +*Inherited from EventEmitter.setMaxListeners* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:374* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| n | `number` | + +**Returns:** `this` + +___ + + +### write + +▸ **write**(buffer: *`Buffer` \| `string`*, cb?: *`Function`*): `boolean` + +▸ **write**(str: *`string`*, encoding?: *`undefined` \| `string`*, cb?: *`Function`*): `boolean` + +*Inherited from WritableStream.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:401* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| buffer | `Buffer` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +*Inherited from WritableStream.write* + +*Defined in /home/alexis/dev/resin.io/etcher-sdk-2/node_modules/@types/node/index.d.ts:402* + +**Parameters:** + +| Name | Type | +| ------ | ------ | +| str | `string` | +| `Optional` encoding | `undefined` \| `string` | +| `Optional` cb | `Function` | + +**Returns:** `boolean` + +___ + diff --git a/doc/interfaces/tmpfileresult.md b/doc/interfaces/tmpfileresult.md new file mode 100644 index 00000000..b4e21c85 --- /dev/null +++ b/doc/interfaces/tmpfileresult.md @@ -0,0 +1,38 @@ +[etcher-sdk](../README.md) > [TmpFileResult](../interfaces/tmpfileresult.md) + +# Interface: TmpFileResult + +## Hierarchy + +**TmpFileResult** + +## Index + +### Properties + +* [fd](tmpfileresult.md#fd) +* [path](tmpfileresult.md#path) + +--- + +## Properties + + + +### `` fd + +**● fd**: *`undefined` \| `number`* + +*Defined in [tmp.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L34)* + +___ + + +### path + +**● path**: *`string`* + +*Defined in [tmp.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/tmp.ts#L33)* + +___ + diff --git a/doc/interfaces/wificonfig.md b/doc/interfaces/wificonfig.md new file mode 100644 index 00000000..9022797a --- /dev/null +++ b/doc/interfaces/wificonfig.md @@ -0,0 +1,78 @@ +[etcher-sdk](../README.md) > [WifiConfig](../interfaces/wificonfig.md) + +# Interface: WifiConfig + +## Hierarchy + +**WifiConfig** + +## Index + +### Properties + +* [gateway](wificonfig.md#gateway) +* [ip](wificonfig.md#ip) +* [netmask](wificonfig.md#netmask) +* [routeMetric](wificonfig.md#routemetric) +* [wifiKey](wificonfig.md#wifikey) +* [wifiSsid](wificonfig.md#wifissid) + +--- + +## Properties + + + +### `` gateway + +**● gateway**: *`undefined` \| `string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:38](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L38)* + +___ + + +### `` ip + +**● ip**: *`undefined` \| `string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:36](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L36)* + +___ + + +### `` netmask + +**● netmask**: *`undefined` \| `string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:37](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L37)* + +___ + + +### `` routeMetric + +**● routeMetric**: *`number` \| `string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:35](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L35)* + +___ + + +### `` wifiKey + +**● wifiKey**: *`undefined` \| `string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:34](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L34)* + +___ + + +### wifiSsid + +**● wifiSsid**: *`string`* + +*Defined in [source-destination/configured-source/operations/configure.ts:33](https://github.com/resin-io-modules/etcher-sdk/blob/e34af4f/lib/source-destination/configured-source/operations/configure.ts#L33)* + +___ + diff --git a/package.json b/package.json index b61a744f..5b14e4ec 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,8 @@ "test": "npm run lint && mocha -r ts-node/register tests/**/*.spec.ts", "prettier": "prettier --config ./node_modules/resin-lint/config/.prettierrc --write \"lib/**/*.ts\" \"typings/**/*.ts\" \"examples/**/*.ts\" \"tests/**/*.ts\"", "lint": "resin-lint --typescript lib typings examples tests", - "build": "rimraf build && tsc", + "build": "rimraf build doc && tsc && npm run doc", + "doc": "typedoc --readme none --theme markdown --mode file --out doc lib/index.ts", "prepublish": "npm run build" }, "files": [ @@ -93,6 +94,8 @@ "rimraf": "^2.6.2", "sinon": "^6.1.3", "ts-node": "^7.0.1", + "typedoc": "^0.14.2", + "typedoc-plugin-markdown": "^1.2.0", "typescript": "^3.0.3", "yargs": "^11.0.0" }