diff --git a/docs/api-reference/api-reference.md b/docs/api-reference/api-reference.md index fe67fb11..e764d193 100644 --- a/docs/api-reference/api-reference.md +++ b/docs/api-reference/api-reference.md @@ -7,11 +7,52 @@ sidebar_label: Overview Here are the links to our auto-generated API documentation. +### Namespaces + +- [Utils.Bytes](./modules/utils.bytes.md) +- [Utils.Data](./modules/utils.data.md) +- [Utils.Files](./modules/utils.file.md) +- [Utils.Hex](./modules/utils.hex.md) +- [Utils.Tar](./modules/utils.tar.md) + ### Classes -- [Bee](./api-reference/classes/bee) -- [BeeDebug](./api-reference/classes/beedebug) +- [Bee](./classes/bee.md) +- [BeeArgumentError](./classes/beeargumenterror.md) +- [BeeDebug](./classes/beedebug.md) +- [BeeError](./classes/beeerror.md) +- [BeeRequestError](./classes/beerequesterror.md) +- [BeeResponseError](./classes/beeresponseerror.md) + +### Interfaces + +- [BeeResponse](./interfaces/beeresponse.md) +- [CollectionEntry](./interfaces/collectionentry.md) +- [CollectionUploadOptions](./interfaces/collectionuploadoptions.md) +- [Dictionary](./interfaces/dictionary.md) +- [DownloadOptions](./interfaces/downloadoptions.md) +- [FileData](./interfaces/filedata.md) +- [FileHeaders](./interfaces/fileheaders.md) +- [FileUploadOptions](./interfaces/fileuploadoptions.md) +- [PssMessageHandler](./interfaces/pssmessagehandler.md) +- [PssSubscription](./interfaces/psssubscription.md) +- [ReferenceResponse](./interfaces/referenceresponse.md) +- [Tag](./interfaces/tag.md) +- [UploadHeaders](./interfaces/uploadheaders.md) +- [UploadOptions](./interfaces/uploadoptions.md) + +### Type aliases + +- [Address](./typealiases/typealiases.md#address) +- [AddressPrefix](./typealiases/typealiases.md#addressprefix) +- [BrandedString](./typealiases/typealiases.md#brandedstring) +- [BrandedType](./typealiases/typealiases.md#brandedtype) +- [Collection](./typealiases/typealiases.md#collection) +- [FlavoredType](./typealiases/typealiases.md#flavoredtype) +- [PublicKey](./typealiases/typealiases.md#publickey) +- [Reference](./typealiases/typealiases.md#reference) -### default +### Variables -Renames and exports: [Bee](./api-reference/classes/bee) \ No newline at end of file +- [ENCRYPTED\_REFERENCE\_LENGTH](./variables/variables.md#encrypted_reference_length) +- [REFERENCE\_LENGTH](./variables/variables.md#reference_length) \ No newline at end of file diff --git a/docs/api-reference/classes/bee.md b/docs/api-reference/classes/bee.md index ada464ac..e36ef295 100644 --- a/docs/api-reference/classes/bee.md +++ b/docs/api-reference/classes/bee.md @@ -1,6 +1,6 @@ --- -title: Bee hide_title: true +title: Bee --- # Class: Bee @@ -11,249 +11,249 @@ The Bee class provides a way of interacting with the Bee APIs based on the provi ## Hierarchy -- **Bee** +* **Bee** ## Table of contents ### Constructors -- [constructor](bee#constructor) +- [constructor](bee.md#constructor) ### Properties -- [url](bee#url) +- [url](bee.md#url) ### Methods -- [createTag](bee#createtag) -- [downloadData](bee#downloaddata) -- [downloadFile](bee#downloadfile) -- [downloadFileFromCollection](bee#downloadfilefromcollection) -- [downloadReadableData](bee#downloadreadabledata) -- [downloadReadableFile](bee#downloadreadablefile) -- [downloadReadableFileFromCollection](bee#downloadreadablefilefromcollection) -- [pinCollection](bee#pincollection) -- [pinData](bee#pindata) -- [pinFile](bee#pinfile) -- [pssReceive](bee#pssreceive) -- [pssSend](bee#psssend) -- [pssSubscribe](bee#psssubscribe) -- [retrieveTag](bee#retrievetag) -- [unpinCollection](bee#unpincollection) -- [unpinData](bee#unpindata) -- [unpinFile](bee#unpinfile) -- [uploadData](bee#uploaddata) -- [uploadFile](bee#uploadfile) -- [uploadFiles](bee#uploadfiles) -- [uploadFilesFromDirectory](bee#uploadfilesfromdirectory) +- [createTag](bee.md#createtag) +- [downloadData](bee.md#downloaddata) +- [downloadFile](bee.md#downloadfile) +- [downloadFileFromCollection](bee.md#downloadfilefromcollection) +- [downloadReadableData](bee.md#downloadreadabledata) +- [downloadReadableFile](bee.md#downloadreadablefile) +- [downloadReadableFileFromCollection](bee.md#downloadreadablefilefromcollection) +- [pinCollection](bee.md#pincollection) +- [pinData](bee.md#pindata) +- [pinFile](bee.md#pinfile) +- [pssReceive](bee.md#pssreceive) +- [pssSend](bee.md#psssend) +- [pssSubscribe](bee.md#psssubscribe) +- [retrieveTag](bee.md#retrievetag) +- [unpinCollection](bee.md#unpincollection) +- [unpinData](bee.md#unpindata) +- [unpinFile](bee.md#unpinfile) +- [uploadData](bee.md#uploaddata) +- [uploadFile](bee.md#uploadfile) +- [uploadFiles](bee.md#uploadfiles) +- [uploadFilesFromDirectory](bee.md#uploadfilesfromdirectory) ## Constructors ### constructor -\+ **new Bee**(`url`: _string_): [_Bee_](bee) +\+ **new Bee**(`url`: *string*): [*Bee*](bee.md) #### Parameters: -| Name | Type | -| ----- | -------- | -| `url` | _string_ | +Name | Type | +------ | ------ | +`url` | *string* | -**Returns:** [_Bee_](bee) +**Returns:** [*Bee*](bee.md) -Defined in: [index.ts:29](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L29) +Defined in: [src/bee.ts:30](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L30) ## Properties ### url -• `Readonly` **url**: _string_ +• `Readonly` **url**: *string* ## Methods ### createTag -▸ **createTag**(): _Promise_ +▸ **createTag**(): *Promise*<[*Tag*](../interfaces/tag.md)\> Create new tag -**Returns:** _Promise_ +**Returns:** *Promise*<[*Tag*](../interfaces/tag.md)\> -Defined in: [index.ts:161](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L161) +Defined in: [src/bee.ts:167](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L167) ---- +___ ### downloadData -▸ **downloadData**(`reference`: _string_): _Promise_<_Uint8Array_\> +▸ **downloadData**(`reference`: *string*): *Promise*<*Uint8Array*\> Download data as a byte array #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee data reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee data reference | -**Returns:** _Promise_<_Uint8Array_\> +**Returns:** *Promise*<*Uint8Array*\> -Defined in: [index.ts:49](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L49) +Defined in: [src/bee.ts:50](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L50) ---- +___ ### downloadFile -▸ **downloadFile**(`reference`: _string_): _Promise_<_FileData_<_Uint8Array_\>\> +▸ **downloadFile**(`reference`: *string*): *Promise*<[*FileData*](../interfaces/filedata.md)<*Uint8Array*\>\> Download single file as a byte array #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee file reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee file reference | -**Returns:** _Promise_<_FileData_<_Uint8Array_\>\> +**Returns:** *Promise*<[*FileData*](../interfaces/filedata.md)<*Uint8Array*\>\> -Defined in: [index.ts:84](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L84) +Defined in: [src/bee.ts:94](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L94) ---- +___ ### downloadFileFromCollection -▸ **downloadFileFromCollection**(`reference`: _string_, `path?`: _string_): _Promise_<_FileData_<_Uint8Array_\>\> +▸ **downloadFileFromCollection**(`reference`: *string*, `path?`: *string*): *Promise*<[*FileData*](../interfaces/filedata.md)<*Uint8Array*\>\> Download single file as a byte array from collection given using the path #### Parameters: -| Name | Type | Default value | Description | -| ----------- | -------- | ------------- | -------------------------------------------- | -| `reference` | _string_ | - | Bee collection reference | -| `path` | _string_ | '' | Path of the requested file in the collection | +Name | Type | Default value | Description | +------ | ------ | ------ | ------ | +`reference` | *string* | - | Bee collection reference | +`path` | *string* | '' | Path of the requested file in the collection | -**Returns:** _Promise_<_FileData_<_Uint8Array_\>\> +**Returns:** *Promise*<[*FileData*](../interfaces/filedata.md)<*Uint8Array*\>\> file in byte array with metadata -Defined in: [index.ts:142](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L142) +Defined in: [src/bee.ts:148](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L148) ---- +___ ### downloadReadableData -▸ **downloadReadableData**(`reference`: _string_): _Promise_<_Readable_\> +▸ **downloadReadableData**(`reference`: *string*): *Promise*<*Readable*\> Download data as a readable stream #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee data reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee data reference | -**Returns:** _Promise_<_Readable_\> +**Returns:** *Promise*<*Readable*\> -Defined in: [index.ts:58](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L58) +Defined in: [src/bee.ts:59](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L59) ---- +___ ### downloadReadableFile -▸ **downloadReadableFile**(`reference`: _string_): _Promise_<_FileData_<_Readable_\>\> +▸ **downloadReadableFile**(`reference`: *string*): *Promise*<[*FileData*](../interfaces/filedata.md)<*Readable*\>\> Download single file as a readable stream #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee file reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee file reference | -**Returns:** _Promise_<_FileData_<_Readable_\>\> +**Returns:** *Promise*<[*FileData*](../interfaces/filedata.md)<*Readable*\>\> -Defined in: [index.ts:93](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L93) +Defined in: [src/bee.ts:103](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L103) ---- +___ ### downloadReadableFileFromCollection -▸ **downloadReadableFileFromCollection**(`reference`: _string_, `path?`: _string_): _Promise_<_FileData_<_Readable_\>\> +▸ **downloadReadableFileFromCollection**(`reference`: *string*, `path?`: *string*): *Promise*<[*FileData*](../interfaces/filedata.md)<*Readable*\>\> Download single file as a readable stream from collection given using the path #### Parameters: -| Name | Type | Default value | Description | -| ----------- | -------- | ------------- | -------------------------------------------- | -| `reference` | _string_ | - | Bee collection reference | -| `path` | _string_ | '' | Path of the requested file in the collection | +Name | Type | Default value | Description | +------ | ------ | ------ | ------ | +`reference` | *string* | - | Bee collection reference | +`path` | *string* | '' | Path of the requested file in the collection | -**Returns:** _Promise_<_FileData_<_Readable_\>\> +**Returns:** *Promise*<[*FileData*](../interfaces/filedata.md)<*Readable*\>\> file in readable stream with metadata -Defined in: [index.ts:154](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L154) +Defined in: [src/bee.ts:160](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L160) ---- +___ ### pinCollection -▸ **pinCollection**(`reference`: _string_): _Promise_ +▸ **pinCollection**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Pin collection with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------------ | -| `reference` | _string_ | Bee collection reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee collection reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:197](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L197) +Defined in: [src/bee.ts:203](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L203) ---- +___ ### pinData -▸ **pinData**(`reference`: _string_): _Promise_ +▸ **pinData**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Pin data with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee data reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee data reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:215](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L215) +Defined in: [src/bee.ts:221](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L221) ---- +___ ### pinFile -▸ **pinFile**(`reference`: _string_): _Promise_ +▸ **pinFile**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Pin file with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee file reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee file reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:179](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L179) +Defined in: [src/bee.ts:185](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L185) ---- +___ ### pssReceive -▸ **pssReceive**(`topic`: _string_, `timeoutMsec?`: _number_): _Promise_<_Uint8Array_\> +▸ **pssReceive**(`topic`: *string*, `timeoutMsec?`: *number*): *Promise*<*Uint8Array*\> Receive message with Postal Service for Swarm @@ -269,179 +269,179 @@ an error will be thrown. #### Parameters: -| Name | Type | Default value | Description | -| ------------- | -------- | ------------- | ----------------------- | -| `topic` | _string_ | - | Topic name | -| `timeoutMsec` | _number_ | 0 | Timeout in milliseconds | +Name | Type | Default value | Description | +------ | ------ | ------ | ------ | +`topic` | *string* | - | Topic name | +`timeoutMsec` | *number* | 0 | Timeout in milliseconds | -**Returns:** _Promise_<_Uint8Array_\> +**Returns:** *Promise*<*Uint8Array*\> Message in byte array -Defined in: [index.ts:309](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L309) +Defined in: [src/bee.ts:315](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L315) ---- +___ ### pssSend -▸ **pssSend**(`topic`: _string_, `target`: _string_, `data`: _string_ \| _Uint8Array_, `recipient?`: _string_): _Promise_ +▸ **pssSend**(`topic`: *string*, `target`: *string*, `data`: *string* \| *Uint8Array*, `recipient?`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Send to recipient or target with Postal Service for Swarm #### Parameters: -| Name | Type | Description | -| ------------ | ------------------------ | ----------------------------- | -| `topic` | _string_ | Topic name | -| `target` | _string_ | Target message address prefix | -| `data` | _string_ \| _Uint8Array_ | Message to be sent | -| `recipient?` | _string_ | Recipient public key | +Name | Type | Description | +------ | ------ | ------ | +`topic` | *string* | Topic name | +`target` | *string* | Target message address prefix | +`data` | *string* \| *Uint8Array* | Message to be sent | +`recipient?` | *string* | Recipient public key | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:237](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L237) +Defined in: [src/bee.ts:243](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L243) ---- +___ ### pssSubscribe -▸ **pssSubscribe**(`topic`: _string_, `handler`: PssMessageHandler): PssSubscription +▸ **pssSubscribe**(`topic`: *string*, `handler`: [*PssMessageHandler*](../interfaces/pssmessagehandler.md)): [*PssSubscription*](../interfaces/psssubscription.md) Subscribe to messages with Postal Service for Swarm #### Parameters: -| Name | Type | Description | -| --------- | ----------------- | ------------------------- | -| `topic` | _string_ | Topic name | -| `handler` | PssMessageHandler | Message handler interface | +Name | Type | Description | +------ | ------ | ------ | +`topic` | *string* | Topic name | +`handler` | [*PssMessageHandler*](../interfaces/pssmessagehandler.md) | Message handler interface | -**Returns:** PssSubscription +**Returns:** [*PssSubscription*](../interfaces/psssubscription.md) Subscription to a given topic -Defined in: [index.ts:254](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L254) +Defined in: [src/bee.ts:260](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L260) ---- +___ ### retrieveTag -▸ **retrieveTag**(`tagUid`: _number_ \| Tag): _Promise_ +▸ **retrieveTag**(`tagUid`: *number* \| [*Tag*](../interfaces/tag.md)): *Promise*<[*Tag*](../interfaces/tag.md)\> Retrieve tag information from Bee node #### Parameters: -| Name | Type | -| -------- | --------------- | -| `tagUid` | _number_ \| Tag | +Name | Type | +------ | ------ | +`tagUid` | *number* \| [*Tag*](../interfaces/tag.md) | -**Returns:** _Promise_ +**Returns:** *Promise*<[*Tag*](../interfaces/tag.md)\> -Defined in: [index.ts:170](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L170) +Defined in: [src/bee.ts:176](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L176) ---- +___ ### unpinCollection -▸ **unpinCollection**(`reference`: _string_): _Promise_ +▸ **unpinCollection**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Unpin collection with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------------ | -| `reference` | _string_ | Bee collection reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee collection reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:206](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L206) +Defined in: [src/bee.ts:212](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L212) ---- +___ ### unpinData -▸ **unpinData**(`reference`: _string_): _Promise_ +▸ **unpinData**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Unpin data with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee data reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee data reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:224](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L224) +Defined in: [src/bee.ts:230](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L230) ---- +___ ### unpinFile -▸ **unpinFile**(`reference`: _string_): _Promise_ +▸ **unpinFile**(`reference`: *string*): *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> Unpin file with given reference #### Parameters: -| Name | Type | Description | -| ----------- | -------- | ------------------ | -| `reference` | _string_ | Bee file reference | +Name | Type | Description | +------ | ------ | ------ | +`reference` | *string* | Bee file reference | -**Returns:** _Promise_ +**Returns:** *Promise*<[*BeeResponse*](../interfaces/beeresponse.md)\> -Defined in: [index.ts:188](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L188) +Defined in: [src/bee.ts:194](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L194) ---- +___ ### uploadData -▸ **uploadData**(`data`: _string_ \| _Uint8Array_, `options?`: UploadOptions): _Promise_<_string_\> +▸ **uploadData**(`data`: *string* \| *Uint8Array*, `options?`: [*UploadOptions*](../interfaces/uploadoptions.md)): *Promise*<*string*\> Upload data to a Bee node #### Parameters: -| Name | Type | Description | -| ---------- | ------------------------ | ------------------------------------------------------------- | -| `data` | _string_ \| _Uint8Array_ | Data to be uploaded | -| `options?` | UploadOptions | Aditional options like tag, encryption, pinning, content-type | +Name | Type | Description | +------ | ------ | ------ | +`data` | *string* \| *Uint8Array* | Data to be uploaded | +`options?` | [*UploadOptions*](../interfaces/uploadoptions.md) | Aditional options like tag, encryption, pinning, content-type | -**Returns:** _Promise_<_string_\> +**Returns:** *Promise*<*string*\> reference is a content hash of the data -Defined in: [index.ts:40](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L40) +Defined in: [src/bee.ts:41](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L41) ---- +___ ### uploadFile -▸ **uploadFile**(`data`: _string_ \| _Uint8Array_ \| _Readable_, `name?`: _string_, `options?`: FileUploadOptions): _Promise_<_string_\> +▸ **uploadFile**(`data`: *string* \| *Uint8Array* \| *Readable* \| File, `name?`: *string*, `options?`: [*FileUploadOptions*](../interfaces/fileuploadoptions.md)): *Promise*<*string*\> Upload single file to a Bee node #### Parameters: -| Name | Type | Description | -| ---------- | -------------------------------------- | ------------------------------------------------------------- | -| `data` | _string_ \| _Uint8Array_ \| _Readable_ | Data to be uploaded | -| `name?` | _string_ | Name of the uploaded file | -| `options?` | FileUploadOptions | Aditional options like tag, encryption, pinning, content-type | +Name | Type | Description | +------ | ------ | ------ | +`data` | *string* \| *Uint8Array* \| *Readable* \| File | Data or file to be uploaded | +`name?` | *string* | Name of the uploaded file (optional) | +`options?` | [*FileUploadOptions*](../interfaces/fileuploadoptions.md) | Aditional options like tag, encryption, pinning, content-type | -**Returns:** _Promise_<_string_\> +**Returns:** *Promise*<*string*\> reference is a content hash of the file -Defined in: [index.ts:71](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L71) +Defined in: [src/bee.ts:72](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L72) ---- +___ ### uploadFiles -▸ **uploadFiles**(`fileList`: FileList \| File[], `options?`: CollectionUploadOptions): _Promise_<_string_\> +▸ **uploadFiles**(`fileList`: FileList \| File[], `options?`: [*CollectionUploadOptions*](../interfaces/collectionuploadoptions.md)): *Promise*<*string*\> Upload collection of files to a Bee node @@ -449,22 +449,22 @@ Uses the FileList API from the browser. #### Parameters: -| Name | Type | Description | -| ---------- | ----------------------- | ------------------------------------------------ | -| `fileList` | FileList \| File[] | list of files to be uploaded | -| `options?` | CollectionUploadOptions | Additional options like tag, encryption, pinning | +Name | Type | Description | +------ | ------ | ------ | +`fileList` | FileList \| File[] | list of files to be uploaded | +`options?` | [*CollectionUploadOptions*](../interfaces/collectionuploadoptions.md) | Additional options like tag, encryption, pinning | -**Returns:** _Promise_<_string_\> +**Returns:** *Promise*<*string*\> reference of the collection of files -Defined in: [index.ts:107](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L107) +Defined in: [src/bee.ts:117](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L117) ---- +___ ### uploadFilesFromDirectory -▸ **uploadFilesFromDirectory**(`dir`: _string_, `recursive?`: _boolean_, `options?`: CollectionUploadOptions): _Promise_<_string_\> +▸ **uploadFilesFromDirectory**(`dir`: *string*, `recursive?`: *boolean*, `options?`: [*CollectionUploadOptions*](../interfaces/collectionuploadoptions.md)): *Promise*<*string*\> Upload collection of files to a Bee node @@ -472,14 +472,14 @@ Uses the `fs` module of Node.js #### Parameters: -| Name | Type | Default value | Description | -| ----------- | ----------------------- | ------------- | --------------------------------------------------------- | -| `dir` | _string_ | - | the path of the files to be uploaded | -| `recursive` | _boolean_ | true | specifies if the directory should be recursively uploaded | -| `options?` | CollectionUploadOptions | - | Additional options like tag, encryption, pinning | +Name | Type | Default value | Description | +------ | ------ | ------ | ------ | +`dir` | *string* | - | the path of the files to be uploaded | +`recursive` | *boolean* | true | specifies if the directory should be recursively uploaded | +`options?` | [*CollectionUploadOptions*](../interfaces/collectionuploadoptions.md) | - | Additional options like tag, encryption, pinning | -**Returns:** _Promise_<_string_\> +**Returns:** *Promise*<*string*\> reference of the collection of files -Defined in: [index.ts:124](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L124) +Defined in: [src/bee.ts:134](https://github.com/ethersphere/bee-js/blob/313830a/src/bee.ts#L134) diff --git a/docs/api-reference/classes/beeargumenterror.md b/docs/api-reference/classes/beeargumenterror.md new file mode 100644 index 00000000..86d8fc49 --- /dev/null +++ b/docs/api-reference/classes/beeargumenterror.md @@ -0,0 +1,125 @@ +--- +hide_title: true +title: BeeArgumentError +--- + +# Class: BeeArgumentError + +## Hierarchy + +* [*BeeError*](beeerror.md) + + ↳ **BeeArgumentError** + +## Table of contents + +### Constructors + +- [constructor](beeargumenterror.md#constructor) + +### Properties + +- [message](beeargumenterror.md#message) +- [name](beeargumenterror.md#name) +- [prepareStackTrace](beeargumenterror.md#preparestacktrace) +- [stack](beeargumenterror.md#stack) +- [stackTraceLimit](beeargumenterror.md#stacktracelimit) +- [value](beeargumenterror.md#value) + +### Methods + +- [captureStackTrace](beeargumenterror.md#capturestacktrace) + +## Constructors + +### constructor + +\+ **new BeeArgumentError**(`message`: *string*, `value`: *unknown*): [*BeeArgumentError*](beeargumenterror.md) + +#### Parameters: + +Name | Type | +------ | ------ | +`message` | *string* | +`value` | *unknown* | + +**Returns:** [*BeeArgumentError*](beeargumenterror.md) + +Inherited from: [BeeError](beeerror.md) + +Defined in: [src/utils/error.ts:7](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/error.ts#L7) + +## Properties + +### message + +• **message**: *string* + +Inherited from: [BeeError](beeerror.md).[message](beeerror.md#message) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +Inherited from: [BeeError](beeerror.md).[name](beeerror.md#name) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### prepareStackTrace + +• `Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any* + +Optional override for formatting stack traces + +**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + +Defined in: node_modules/@types/node/globals.d.ts:11 + +___ + +### stack + +• `Optional` **stack**: *undefined* \| *string* + +Inherited from: [BeeError](beeerror.md).[stack](beeerror.md#stack) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### stackTraceLimit + +• **stackTraceLimit**: *number* + +Defined in: node_modules/@types/node/globals.d.ts:13 + +___ + +### value + +• `Readonly` **value**: *unknown* + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void* + +Create .stack property on a target object + +#### Parameters: + +Name | Type | +------ | ------ | +`targetObject` | *object* | +`constructorOpt?` | Function | + +**Returns:** *void* + +Defined in: node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/beedebug.md b/docs/api-reference/classes/beedebug.md index a3905758..173994e0 100644 --- a/docs/api-reference/classes/beedebug.md +++ b/docs/api-reference/classes/beedebug.md @@ -1,6 +1,6 @@ --- -title: BeeDebug hide_title: true +title: BeeDebug --- # Class: BeeDebug @@ -17,22 +17,36 @@ The BeeDebug class provides a way of interacting with the Bee debug APIs based o ### Constructors -- [constructor](beedebug#constructor) +- [constructor](beedebug.md#constructor) ### Properties -- [url](beedebug#url) +- [url](beedebug.md#url) ### Methods -- [getOverlayAddress](beedebug#getoverlayaddress) -- [getPssPublicKey](beedebug#getpsspublickey) +- [cashoutLastCheque](beedebug.md#cashoutlastcheque) +- [depositTokens](beedebug.md#deposittokens) +- [getAllBalances](beedebug.md#getallbalances) +- [getAllSettlements](beedebug.md#getallsettlements) +- [getChequebookAddress](beedebug.md#getchequebookaddress) +- [getChequeubookBalance](beedebug.md#getchequeubookbalance) +- [getLastCashoutAction](beedebug.md#getlastcashoutaction) +- [getLastCheques](beedebug.md#getlastcheques) +- [getLastChequesForPeer](beedebug.md#getlastchequesforpeer) +- [getOverlayAddress](beedebug.md#getoverlayaddress) +- [getPastDueConsumptionBalances](beedebug.md#getpastdueconsumptionbalances) +- [getPastDueConsumptionPeerBalance](beedebug.md#getpastdueconsumptionpeerbalance) +- [getPeerBalance](beedebug.md#getpeerbalance) +- [getPssPublicKey](beedebug.md#getpsspublickey) +- [getSettlements](beedebug.md#getsettlements) +- [withdrawTokens](beedebug.md#withdrawtokens) ## Constructors ### constructor -\+ **new BeeDebug**(`url`: *string*): [*BeeDebug*](beedebug) +\+ **new BeeDebug**(`url`: *string*): [*BeeDebug*](beedebug.md) #### Parameters: @@ -40,9 +54,9 @@ Name | Type | ------ | ------ | `url` | *string* | -**Returns:** [*BeeDebug*](beedebug) +**Returns:** [*BeeDebug*](beedebug.md) -Defined in: [index.ts:342](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L342) +Defined in: [src/bee-debug.ts:12](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L12) ## Properties @@ -52,13 +66,193 @@ Defined in: [index.ts:342](https://github.com/ethersphere/bee-js/blob/2fef9c4/sr ## Methods +### cashoutLastCheque + +▸ **cashoutLastCheque**(`address`: *string*): *Promise* + +Cashout the last cheque for the peer + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:111](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L111) + +___ + +### depositTokens + +▸ **depositTokens**(`amount`: *number*): *Promise* + +Deposit tokens from overlay address into chequebook + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`amount` | *number* | Amount of tokens to deposit | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:120](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L120) + +___ + +### getAllBalances + +▸ **getAllBalances**(): *Promise* + +Get the balances with all known peers including prepaid services + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:34](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L34) + +___ + +### getAllSettlements + +▸ **getAllSettlements**(): *Promise* + +Get settlements with all known peers and total amount sent or received + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:149](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L149) + +___ + +### getChequebookAddress + +▸ **getChequebookAddress**(): *Promise* + +Get the address of the chequebook contract used + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:70](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L70) + +___ + +### getChequeubookBalance + +▸ **getChequeubookBalance**(): *Promise* + +Get the balance of the chequebook + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:77](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L77) + +___ + +### getLastCashoutAction + +▸ **getLastCashoutAction**(`address`: *string*): *Promise* + +Get last cashout action for the peer + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:102](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L102) + +___ + +### getLastCheques + +▸ **getLastCheques**(): *Promise* + +Get last cheques for all peers + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:84](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L84) + +___ + +### getLastChequesForPeer + +▸ **getLastChequesForPeer**(`address`: *string*): *Promise* + +Get last cheques for the peer + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:93](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L93) + +___ + ### getOverlayAddress ▸ **getOverlayAddress**(): *Promise*<*string*\> **Returns:** *Promise*<*string*\> -Defined in: [index.ts:345](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L345) +Defined in: [src/bee-debug.ts:15](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L15) + +___ + +### getPastDueConsumptionBalances + +▸ **getPastDueConsumptionBalances**(): *Promise* + +Get the past due consumption balances with all known peers + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:50](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L50) + +___ + +### getPastDueConsumptionPeerBalance + +▸ **getPastDueConsumptionPeerBalance**(`address`: *string*): *Promise* + +Get the past due consumption balance with a specific peer + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:59](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L59) + +___ + +### getPeerBalance + +▸ **getPeerBalance**(`address`: *string*): *Promise* + +Get the balances with a specific peer including prepaid services + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:43](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L43) ___ @@ -68,4 +262,40 @@ ___ **Returns:** *Promise*<*string*\> -Defined in: [index.ts:351](https://github.com/ethersphere/bee-js/blob/2fef9c4/src/index.ts#L351) +Defined in: [src/bee-debug.ts:21](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L21) + +___ + +### getSettlements + +▸ **getSettlements**(`address`: *string*): *Promise* + +Get amount of sent and received from settlements with a peer + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`address` | *string* | Swarm address of peer | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:142](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L142) + +___ + +### withdrawTokens + +▸ **withdrawTokens**(`amount`: *number*): *Promise* + +Withdraw tokens from the chequebook to the overlay address + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`amount` | *number* | Amount of tokens to withdraw | + +**Returns:** *Promise* + +Defined in: [src/bee-debug.ts:129](https://github.com/ethersphere/bee-js/blob/313830a/src/bee-debug.ts#L129) diff --git a/docs/api-reference/classes/beeerror.md b/docs/api-reference/classes/beeerror.md new file mode 100644 index 00000000..1109540b --- /dev/null +++ b/docs/api-reference/classes/beeerror.md @@ -0,0 +1,115 @@ +--- +hide_title: true +title: BeeError +--- + +# Class: BeeError + +## Hierarchy + +* *Error* + + ↳ **BeeError** + + ↳↳ [*BeeArgumentError*](beeargumenterror.md) + + ↳↳ [*BeeRequestError*](beerequesterror.md) + + ↳↳ [*BeeResponseError*](beeresponseerror.md) + +## Table of contents + +### Constructors + +- [constructor](beeerror.md#constructor) + +### Properties + +- [message](beeerror.md#message) +- [name](beeerror.md#name) +- [stack](beeerror.md#stack) +- [prepareStackTrace](beeerror.md#preparestacktrace) +- [stackTraceLimit](beeerror.md#stacktracelimit) + +### Methods + +- [captureStackTrace](beeerror.md#capturestacktrace) + +## Constructors + +### constructor + +\+ **new BeeError**(`message`: *string*): [*BeeError*](beeerror.md) + +#### Parameters: + +Name | Type | +------ | ------ | +`message` | *string* | + +**Returns:** [*BeeError*](beeerror.md) + +Defined in: [src/utils/error.ts:1](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/error.ts#L1) + +## Properties + +### message + +• **message**: *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### stack + +• `Optional` **stack**: *undefined* \| *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### prepareStackTrace + +▪ `Optional` `Static` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any* + +Optional override for formatting stack traces + +**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + +Defined in: node_modules/@types/node/globals.d.ts:11 + +___ + +### stackTraceLimit + +▪ `Static` **stackTraceLimit**: *number* + +Defined in: node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ `Static`**captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void* + +Create .stack property on a target object + +#### Parameters: + +Name | Type | +------ | ------ | +`targetObject` | *object* | +`constructorOpt?` | Function | + +**Returns:** *void* + +Defined in: node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/beerequesterror.md b/docs/api-reference/classes/beerequesterror.md new file mode 100644 index 00000000..fd6bac96 --- /dev/null +++ b/docs/api-reference/classes/beerequesterror.md @@ -0,0 +1,117 @@ +--- +hide_title: true +title: BeeRequestError +--- + +# Class: BeeRequestError + +## Hierarchy + +* [*BeeError*](beeerror.md) + + ↳ **BeeRequestError** + +## Table of contents + +### Constructors + +- [constructor](beerequesterror.md#constructor) + +### Properties + +- [message](beerequesterror.md#message) +- [name](beerequesterror.md#name) +- [prepareStackTrace](beerequesterror.md#preparestacktrace) +- [stack](beerequesterror.md#stack) +- [stackTraceLimit](beerequesterror.md#stacktracelimit) + +### Methods + +- [captureStackTrace](beerequesterror.md#capturestacktrace) + +## Constructors + +### constructor + +\+ **new BeeRequestError**(`message`: *string*): [*BeeRequestError*](beerequesterror.md) + +#### Parameters: + +Name | Type | +------ | ------ | +`message` | *string* | + +**Returns:** [*BeeRequestError*](beerequesterror.md) + +Inherited from: [BeeError](beeerror.md) + +Defined in: [src/utils/error.ts:13](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/error.ts#L13) + +## Properties + +### message + +• **message**: *string* + +Inherited from: [BeeError](beeerror.md).[message](beeerror.md#message) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +Inherited from: [BeeError](beeerror.md).[name](beeerror.md#name) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### prepareStackTrace + +• `Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any* + +Optional override for formatting stack traces + +**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + +Defined in: node_modules/@types/node/globals.d.ts:11 + +___ + +### stack + +• `Optional` **stack**: *undefined* \| *string* + +Inherited from: [BeeError](beeerror.md).[stack](beeerror.md#stack) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### stackTraceLimit + +• **stackTraceLimit**: *number* + +Defined in: node_modules/@types/node/globals.d.ts:13 + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void* + +Create .stack property on a target object + +#### Parameters: + +Name | Type | +------ | ------ | +`targetObject` | *object* | +`constructorOpt?` | Function | + +**Returns:** *void* + +Defined in: node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/classes/beeresponseerror.md b/docs/api-reference/classes/beeresponseerror.md new file mode 100644 index 00000000..af4c60ad --- /dev/null +++ b/docs/api-reference/classes/beeresponseerror.md @@ -0,0 +1,125 @@ +--- +hide_title: true +title: BeeResponseError +--- + +# Class: BeeResponseError + +## Hierarchy + +* [*BeeError*](beeerror.md) + + ↳ **BeeResponseError** + +## Table of contents + +### Constructors + +- [constructor](beeresponseerror.md#constructor) + +### Properties + +- [message](beeresponseerror.md#message) +- [name](beeresponseerror.md#name) +- [prepareStackTrace](beeresponseerror.md#preparestacktrace) +- [stack](beeresponseerror.md#stack) +- [stackTraceLimit](beeresponseerror.md#stacktracelimit) +- [status](beeresponseerror.md#status) + +### Methods + +- [captureStackTrace](beeresponseerror.md#capturestacktrace) + +## Constructors + +### constructor + +\+ **new BeeResponseError**(`status`: *number*, `message`: *string*): [*BeeResponseError*](beeresponseerror.md) + +#### Parameters: + +Name | Type | +------ | ------ | +`status` | *number* | +`message` | *string* | + +**Returns:** [*BeeResponseError*](beeresponseerror.md) + +Inherited from: [BeeError](beeerror.md) + +Defined in: [src/utils/error.ts:19](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/error.ts#L19) + +## Properties + +### message + +• **message**: *string* + +Inherited from: [BeeError](beeerror.md).[message](beeerror.md#message) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:974 + +___ + +### name + +• **name**: *string* + +Inherited from: [BeeError](beeerror.md).[name](beeerror.md#name) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:973 + +___ + +### prepareStackTrace + +• `Optional` **prepareStackTrace**: *undefined* \| (`err`: Error, `stackTraces`: CallSite[]) => *any* + +Optional override for formatting stack traces + +**`see`** https://github.com/v8/v8/wiki/Stack%20Trace%20API#customizing-stack-traces + +Defined in: node_modules/@types/node/globals.d.ts:11 + +___ + +### stack + +• `Optional` **stack**: *undefined* \| *string* + +Inherited from: [BeeError](beeerror.md).[stack](beeerror.md#stack) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:975 + +___ + +### stackTraceLimit + +• **stackTraceLimit**: *number* + +Defined in: node_modules/@types/node/globals.d.ts:13 + +___ + +### status + +• `Readonly` **status**: *number* + +## Methods + +### captureStackTrace + +▸ **captureStackTrace**(`targetObject`: *object*, `constructorOpt?`: Function): *void* + +Create .stack property on a target object + +#### Parameters: + +Name | Type | +------ | ------ | +`targetObject` | *object* | +`constructorOpt?` | Function | + +**Returns:** *void* + +Defined in: node_modules/@types/node/globals.d.ts:4 diff --git a/docs/api-reference/interfaces/beeresponse.md b/docs/api-reference/interfaces/beeresponse.md new file mode 100644 index 00000000..254da0df --- /dev/null +++ b/docs/api-reference/interfaces/beeresponse.md @@ -0,0 +1,33 @@ +--- +hide_title: true +title: BeeResponse +--- + +# Interface: BeeResponse + +## Hierarchy + +* **BeeResponse** + +## Table of contents + +### Properties + +- [code](beeresponse.md#code) +- [message](beeresponse.md#message) + +## Properties + +### code + +• **code**: *number* + +Defined in: [src/types/index.ts:89](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L89) + +___ + +### message + +• **message**: *string* + +Defined in: [src/types/index.ts:88](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L88) diff --git a/docs/api-reference/interfaces/collectionentry.md b/docs/api-reference/interfaces/collectionentry.md new file mode 100644 index 00000000..1e729600 --- /dev/null +++ b/docs/api-reference/interfaces/collectionentry.md @@ -0,0 +1,41 @@ +--- +hide_title: true +title: CollectionEntry +--- + +# Interface: CollectionEntry + +Object represents a file and some of its metadata in [[Directory]] object. + +## Type parameters + +Name | +------ | +`T` | + +## Hierarchy + +* **CollectionEntry** + +## Table of contents + +### Properties + +- [data](collectionentry.md#data) +- [path](collectionentry.md#path) + +## Properties + +### data + +• **data**: T + +Defined in: [src/types/index.ts:64](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L64) + +___ + +### path + +• **path**: *string* + +Defined in: [src/types/index.ts:69](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L69) diff --git a/docs/api-reference/interfaces/collectionuploadoptions.md b/docs/api-reference/interfaces/collectionuploadoptions.md new file mode 100644 index 00000000..5b546b3f --- /dev/null +++ b/docs/api-reference/interfaces/collectionuploadoptions.md @@ -0,0 +1,68 @@ +--- +hide_title: true +title: CollectionUploadOptions +--- + +# Interface: CollectionUploadOptions + +## Hierarchy + +* [*UploadOptions*](uploadoptions.md) + + ↳ **CollectionUploadOptions** + +## Table of contents + +### Properties + +- [encrypt](collectionuploadoptions.md#encrypt) +- [errorDocument](collectionuploadoptions.md#errordocument) +- [indexDocument](collectionuploadoptions.md#indexdocument) +- [pin](collectionuploadoptions.md#pin) +- [tag](collectionuploadoptions.md#tag) + +## Properties + +### encrypt + +• `Optional` **encrypt**: *undefined* \| *boolean* + +Inherited from: [UploadOptions](uploadoptions.md).[encrypt](uploadoptions.md#encrypt) + +Defined in: [src/types/index.ts:18](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L18) + +___ + +### errorDocument + +• `Optional` **errorDocument**: *undefined* \| *string* + +Defined in: [src/types/index.ts:29](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L29) + +___ + +### indexDocument + +• `Optional` **indexDocument**: *undefined* \| *string* + +Defined in: [src/types/index.ts:28](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L28) + +___ + +### pin + +• `Optional` **pin**: *undefined* \| *boolean* + +Inherited from: [UploadOptions](uploadoptions.md).[pin](uploadoptions.md#pin) + +Defined in: [src/types/index.ts:17](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L17) + +___ + +### tag + +• `Optional` **tag**: *undefined* \| *number* + +Inherited from: [UploadOptions](uploadoptions.md).[tag](uploadoptions.md#tag) + +Defined in: [src/types/index.ts:19](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L19) diff --git a/docs/api-reference/interfaces/dictionary.md b/docs/api-reference/interfaces/dictionary.md new file mode 100644 index 00000000..98e383e9 --- /dev/null +++ b/docs/api-reference/interfaces/dictionary.md @@ -0,0 +1,20 @@ +--- +hide_title: true +title: Dictionary +--- + +# Interface: Dictionary + +## Type parameters + +Name | +------ | +`T` | + +## Hierarchy + +* **Dictionary** + +## Indexable + +▪ [Key: *string*]: T diff --git a/docs/api-reference/interfaces/downloadoptions.md b/docs/api-reference/interfaces/downloadoptions.md new file mode 100644 index 00000000..9ee8e4c2 --- /dev/null +++ b/docs/api-reference/interfaces/downloadoptions.md @@ -0,0 +1,24 @@ +--- +hide_title: true +title: DownloadOptions +--- + +# Interface: DownloadOptions + +## Hierarchy + +* **DownloadOptions** + +## Table of contents + +### Properties + +- [timeout](downloadoptions.md#timeout) + +## Properties + +### timeout + +• `Optional` **timeout**: *undefined* \| *number* + +Defined in: [src/types/index.ts:33](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L33) diff --git a/docs/api-reference/interfaces/filedata.md b/docs/api-reference/interfaces/filedata.md new file mode 100644 index 00000000..855baf5a --- /dev/null +++ b/docs/api-reference/interfaces/filedata.md @@ -0,0 +1,65 @@ +--- +hide_title: true +title: FileData +--- + +# Interface: FileData + +## Type parameters + +Name | +------ | +`T` | + +## Hierarchy + +* [*FileHeaders*](fileheaders.md) + + ↳ **FileData** + +## Table of contents + +### Properties + +- [contentType](filedata.md#contenttype) +- [data](filedata.md#data) +- [name](filedata.md#name) +- [tagUid](filedata.md#taguid) + +## Properties + +### contentType + +• `Optional` **contentType**: *undefined* \| *string* + +Inherited from: [FileHeaders](fileheaders.md).[contentType](fileheaders.md#contenttype) + +Defined in: [src/types/index.ts:53](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L53) + +___ + +### data + +• **data**: T + +Defined in: [src/types/index.ts:57](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L57) + +___ + +### name + +• `Optional` **name**: *undefined* \| *string* + +Inherited from: [FileHeaders](fileheaders.md).[name](fileheaders.md#name) + +Defined in: [src/types/index.ts:51](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L51) + +___ + +### tagUid + +• `Optional` **tagUid**: *undefined* \| *number* + +Inherited from: [FileHeaders](fileheaders.md).[tagUid](fileheaders.md#taguid) + +Defined in: [src/types/index.ts:52](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L52) diff --git a/docs/api-reference/interfaces/fileheaders.md b/docs/api-reference/interfaces/fileheaders.md new file mode 100644 index 00000000..83a3d43e --- /dev/null +++ b/docs/api-reference/interfaces/fileheaders.md @@ -0,0 +1,44 @@ +--- +hide_title: true +title: FileHeaders +--- + +# Interface: FileHeaders + +## Hierarchy + +* **FileHeaders** + + ↳ [*FileData*](filedata.md) + +## Table of contents + +### Properties + +- [contentType](fileheaders.md#contenttype) +- [name](fileheaders.md#name) +- [tagUid](fileheaders.md#taguid) + +## Properties + +### contentType + +• `Optional` **contentType**: *undefined* \| *string* + +Defined in: [src/types/index.ts:53](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L53) + +___ + +### name + +• `Optional` **name**: *undefined* \| *string* + +Defined in: [src/types/index.ts:51](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L51) + +___ + +### tagUid + +• `Optional` **tagUid**: *undefined* \| *number* + +Defined in: [src/types/index.ts:52](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L52) diff --git a/docs/api-reference/interfaces/fileuploadoptions.md b/docs/api-reference/interfaces/fileuploadoptions.md new file mode 100644 index 00000000..2e39d18f --- /dev/null +++ b/docs/api-reference/interfaces/fileuploadoptions.md @@ -0,0 +1,68 @@ +--- +hide_title: true +title: FileUploadOptions +--- + +# Interface: FileUploadOptions + +## Hierarchy + +* [*UploadOptions*](uploadoptions.md) + + ↳ **FileUploadOptions** + +## Table of contents + +### Properties + +- [contentType](fileuploadoptions.md#contenttype) +- [encrypt](fileuploadoptions.md#encrypt) +- [pin](fileuploadoptions.md#pin) +- [size](fileuploadoptions.md#size) +- [tag](fileuploadoptions.md#tag) + +## Properties + +### contentType + +• `Optional` **contentType**: *undefined* \| *string* + +Defined in: [src/types/index.ts:24](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L24) + +___ + +### encrypt + +• `Optional` **encrypt**: *undefined* \| *boolean* + +Inherited from: [UploadOptions](uploadoptions.md).[encrypt](uploadoptions.md#encrypt) + +Defined in: [src/types/index.ts:18](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L18) + +___ + +### pin + +• `Optional` **pin**: *undefined* \| *boolean* + +Inherited from: [UploadOptions](uploadoptions.md).[pin](uploadoptions.md#pin) + +Defined in: [src/types/index.ts:17](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L17) + +___ + +### size + +• `Optional` **size**: *undefined* \| *number* + +Defined in: [src/types/index.ts:23](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L23) + +___ + +### tag + +• `Optional` **tag**: *undefined* \| *number* + +Inherited from: [UploadOptions](uploadoptions.md).[tag](uploadoptions.md#tag) + +Defined in: [src/types/index.ts:19](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L19) diff --git a/docs/api-reference/interfaces/pssmessagehandler.md b/docs/api-reference/interfaces/pssmessagehandler.md new file mode 100644 index 00000000..5841b238 --- /dev/null +++ b/docs/api-reference/interfaces/pssmessagehandler.md @@ -0,0 +1,33 @@ +--- +hide_title: true +title: PssMessageHandler +--- + +# Interface: PssMessageHandler + +## Hierarchy + +* **PssMessageHandler** + +## Table of contents + +### Properties + +- [onError](pssmessagehandler.md#onerror) +- [onMessage](pssmessagehandler.md#onmessage) + +## Properties + +### onError + +• **onError**: (`error`: [*BeeError*](../classes/beeerror.md), `subscription`: [*PssSubscription*](psssubscription.md)) => *void* + +Defined in: [src/types/index.ts:84](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L84) + +___ + +### onMessage + +• **onMessage**: (`message`: *Uint8Array*, `subscription`: [*PssSubscription*](psssubscription.md)) => *void* + +Defined in: [src/types/index.ts:83](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L83) diff --git a/docs/api-reference/interfaces/psssubscription.md b/docs/api-reference/interfaces/psssubscription.md new file mode 100644 index 00000000..3a59434a --- /dev/null +++ b/docs/api-reference/interfaces/psssubscription.md @@ -0,0 +1,33 @@ +--- +hide_title: true +title: PssSubscription +--- + +# Interface: PssSubscription + +## Hierarchy + +* **PssSubscription** + +## Table of contents + +### Properties + +- [cancel](psssubscription.md#cancel) +- [topic](psssubscription.md#topic) + +## Properties + +### cancel + +• **cancel**: () => *void* + +Defined in: [src/types/index.ts:79](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L79) + +___ + +### topic + +• `Readonly` **topic**: *string* + +Defined in: [src/types/index.ts:78](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L78) diff --git a/docs/api-reference/interfaces/referenceresponse.md b/docs/api-reference/interfaces/referenceresponse.md new file mode 100644 index 00000000..61296a0b --- /dev/null +++ b/docs/api-reference/interfaces/referenceresponse.md @@ -0,0 +1,24 @@ +--- +hide_title: true +title: ReferenceResponse +--- + +# Interface: ReferenceResponse + +## Hierarchy + +* **ReferenceResponse** + +## Table of contents + +### Properties + +- [reference](referenceresponse.md#reference) + +## Properties + +### reference + +• **reference**: *string* + +Defined in: [src/types/index.ts:93](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L93) diff --git a/docs/api-reference/interfaces/tag.md b/docs/api-reference/interfaces/tag.md new file mode 100644 index 00000000..99277681 --- /dev/null +++ b/docs/api-reference/interfaces/tag.md @@ -0,0 +1,60 @@ +--- +hide_title: true +title: Tag +--- + +# Interface: Tag + +## Hierarchy + +* **Tag** + +## Table of contents + +### Properties + +- [processed](tag.md#processed) +- [startedAt](tag.md#startedat) +- [synced](tag.md#synced) +- [total](tag.md#total) +- [uid](tag.md#uid) + +## Properties + +### processed + +• **processed**: *number* + +Defined in: [src/types/index.ts:44](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L44) + +___ + +### startedAt + +• **startedAt**: *string* + +Defined in: [src/types/index.ts:47](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L47) + +___ + +### synced + +• **synced**: *number* + +Defined in: [src/types/index.ts:45](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L45) + +___ + +### total + +• **total**: *number* + +Defined in: [src/types/index.ts:43](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L43) + +___ + +### uid + +• **uid**: *number* + +Defined in: [src/types/index.ts:46](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L46) diff --git a/docs/api-reference/interfaces/uploadheaders.md b/docs/api-reference/interfaces/uploadheaders.md new file mode 100644 index 00000000..df4a371b --- /dev/null +++ b/docs/api-reference/interfaces/uploadheaders.md @@ -0,0 +1,42 @@ +--- +hide_title: true +title: UploadHeaders +--- + +# Interface: UploadHeaders + +## Hierarchy + +* **UploadHeaders** + +## Table of contents + +### Properties + +- [swarm-encrypt](uploadheaders.md#swarm-encrypt) +- [swarm-pin](uploadheaders.md#swarm-pin) +- [swarm-tag](uploadheaders.md#swarm-tag) + +## Properties + +### swarm-encrypt + +• `Optional` **swarm-encrypt**: *undefined* \| *string* + +Defined in: [src/types/index.ts:37](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L37) + +___ + +### swarm-pin + +• `Optional` **swarm-pin**: *undefined* \| *string* + +Defined in: [src/types/index.ts:36](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L36) + +___ + +### swarm-tag + +• `Optional` **swarm-tag**: *undefined* \| *string* + +Defined in: [src/types/index.ts:38](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L38) diff --git a/docs/api-reference/interfaces/uploadoptions.md b/docs/api-reference/interfaces/uploadoptions.md new file mode 100644 index 00000000..c1b953a3 --- /dev/null +++ b/docs/api-reference/interfaces/uploadoptions.md @@ -0,0 +1,46 @@ +--- +hide_title: true +title: UploadOptions +--- + +# Interface: UploadOptions + +## Hierarchy + +* **UploadOptions** + + ↳ [*FileUploadOptions*](fileuploadoptions.md) + + ↳ [*CollectionUploadOptions*](collectionuploadoptions.md) + +## Table of contents + +### Properties + +- [encrypt](uploadoptions.md#encrypt) +- [pin](uploadoptions.md#pin) +- [tag](uploadoptions.md#tag) + +## Properties + +### encrypt + +• `Optional` **encrypt**: *undefined* \| *boolean* + +Defined in: [src/types/index.ts:18](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L18) + +___ + +### pin + +• `Optional` **pin**: *undefined* \| *boolean* + +Defined in: [src/types/index.ts:17](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L17) + +___ + +### tag + +• `Optional` **tag**: *undefined* \| *number* + +Defined in: [src/types/index.ts:19](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L19) diff --git a/docs/api-reference/interfaces/utils.bytes.bytes.md b/docs/api-reference/interfaces/utils.bytes.bytes.md new file mode 100644 index 00000000..a2f4e86f --- /dev/null +++ b/docs/api-reference/interfaces/utils.bytes.bytes.md @@ -0,0 +1,657 @@ +--- +hide_title: true +title: Utils.Bytes.Bytes +--- + +# Interface: Bytes + +[Utils](../modules/utils.md).[Bytes](../modules/utils.bytes.md).Bytes + +Helper type for dealing with fixed size byte arrays. + +It changes the type of `length` property of `Uint8Array` to the +generic `Length` type parameter which is runtime compatible with +the original, because it extends from the `number` type. + +## Type parameters + +Name | Type | +------ | ------ | +`Length` | *number* | + +## Hierarchy + +* *Uint8Array* + + ↳ **Bytes** + +## Table of contents + +### Properties + +- [BYTES\_PER\_ELEMENT](utils.bytes.bytes.md#bytes_per_element) +- [[Symbol.toStringTag]](utils.bytes.bytes.md#[symbol.tostringtag]) +- [buffer](utils.bytes.bytes.md#buffer) +- [byteLength](utils.bytes.bytes.md#bytelength) +- [byteOffset](utils.bytes.bytes.md#byteoffset) +- [length](utils.bytes.bytes.md#length) + +### Methods + +- [[Symbol.iterator]](utils.bytes.bytes.md#[symbol.iterator]) +- [copyWithin](utils.bytes.bytes.md#copywithin) +- [entries](utils.bytes.bytes.md#entries) +- [every](utils.bytes.bytes.md#every) +- [fill](utils.bytes.bytes.md#fill) +- [filter](utils.bytes.bytes.md#filter) +- [find](utils.bytes.bytes.md#find) +- [findIndex](utils.bytes.bytes.md#findindex) +- [forEach](utils.bytes.bytes.md#foreach) +- [includes](utils.bytes.bytes.md#includes) +- [indexOf](utils.bytes.bytes.md#indexof) +- [join](utils.bytes.bytes.md#join) +- [keys](utils.bytes.bytes.md#keys) +- [lastIndexOf](utils.bytes.bytes.md#lastindexof) +- [map](utils.bytes.bytes.md#map) +- [reduce](utils.bytes.bytes.md#reduce) +- [reduceRight](utils.bytes.bytes.md#reduceright) +- [reverse](utils.bytes.bytes.md#reverse) +- [set](utils.bytes.bytes.md#set) +- [slice](utils.bytes.bytes.md#slice) +- [some](utils.bytes.bytes.md#some) +- [sort](utils.bytes.bytes.md#sort) +- [subarray](utils.bytes.bytes.md#subarray) +- [toLocaleString](utils.bytes.bytes.md#tolocalestring) +- [toString](utils.bytes.bytes.md#tostring) +- [valueOf](utils.bytes.bytes.md#valueof) +- [values](utils.bytes.bytes.md#values) + +## Properties + +### BYTES\_PER\_ELEMENT + +• `Readonly` **BYTES\_PER\_ELEMENT**: *number* + +The size in bytes of each element in the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2030 + +___ + +### [Symbol.toStringTag] + +• `Readonly` **[Symbol.toStringTag]**: *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:282 + +___ + +### buffer + +• `Readonly` **buffer**: ArrayBufferLike + +The ArrayBuffer instance referenced by the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2035 + +___ + +### byteLength + +• `Readonly` **byteLength**: *number* + +The length in bytes of the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2040 + +___ + +### byteOffset + +• `Readonly` **byteOffset**: *number* + +The offset in bytes of the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2045 + +___ + +### length + +• `Readonly` **length**: Length + +Defined in: [src/utils/bytes.ts:9](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L9) + +## Methods + +### [Symbol.iterator] + +▸ **[Symbol.iterator]**(): *IterableIterator*<*number*\> + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:279 + +___ + +### copyWithin + +▸ **copyWithin**(`target`: *number*, `start`: *number*, `end?`: *number*): [*Bytes*](utils.bytes.bytes.md) + +Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`target` | *number* | If target is negative, it is treated as length+target where length is the length of the array. | +`start` | *number* | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. | +`end?` | *number* | If not specified, length of the this object is used as its default value. | + +**Returns:** [*Bytes*](utils.bytes.bytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2056 + +___ + +### entries + +▸ **entries**(): *IterableIterator*<[*number*, *number*]\> + +Returns an array of key, value pairs for every entry in the array + +**Returns:** *IterableIterator*<[*number*, *number*]\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:283 + +___ + +### every + +▸ **every**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown*, `thisArg?`: *any*): *boolean* + +Determines whether all the members of an array satisfy the specified test. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown* | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2066 + +___ + +### fill + +▸ **fill**(`value`: *number*, `start?`: *number*, `end?`: *number*): [*Bytes*](utils.bytes.bytes.md) + +Returns the this object after filling the section identified by start and end with value + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`value` | *number* | value to fill array section with | +`start?` | *number* | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. | +`end?` | *number* | index to stop filling the array at. If end is negative, it is treated as length+end. | + +**Returns:** [*Bytes*](utils.bytes.bytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2076 + +___ + +### filter + +▸ **filter**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *any*, `thisArg?`: *any*): *Uint8Array* + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *any* | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2085 + +___ + +### find + +▸ **find**(`predicate`: (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean*, `thisArg?`: *any*): *undefined* \| *number* + +Returns the value of the first element in the array where predicate is true, and undefined +otherwise. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean* | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. | +`thisArg?` | *any* | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +**Returns:** *undefined* \| *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2096 + +___ + +### findIndex + +▸ **findIndex**(`predicate`: (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean*, `thisArg?`: *any*): *number* + +Returns the index of the first element in the array where predicate is true, and -1 +otherwise. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean* | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. | +`thisArg?` | *any* | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2107 + +___ + +### forEach + +▸ **forEach**(`callbackfn`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *void*, `thisArg?`: *any*): *void* + +Performs the specified action for each element in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *void* | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *void* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2116 + +___ + +### includes + +▸ **includes**(`searchElement`: *number*, `fromIndex?`: *number*): *boolean* + +Determines whether an array includes a certain element, returning true or false as appropriate. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The element to search for. | +`fromIndex?` | *number* | The position in this array at which to begin searching for searchElement. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es2016.array.include.d.ts:54 + +___ + +### indexOf + +▸ **indexOf**(`searchElement`: *number*, `fromIndex?`: *number*): *number* + +Returns the index of the first occurrence of a value in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The value to locate in the array. | +`fromIndex?` | *number* | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2124 + +___ + +### join + +▸ **join**(`separator?`: *string*): *string* + +Adds all the elements of an array separated by the specified separator string. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`separator?` | *string* | A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. | + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2131 + +___ + +### keys + +▸ **keys**(): *IterableIterator*<*number*\> + +Returns an list of keys in the array + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:287 + +___ + +### lastIndexOf + +▸ **lastIndexOf**(`searchElement`: *number*, `fromIndex?`: *number*): *number* + +Returns the index of the last occurrence of a value in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The value to locate in the array. | +`fromIndex?` | *number* | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2139 + +___ + +### map + +▸ **map**(`callbackfn`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *number*, `thisArg?`: *any*): *Uint8Array* + +Calls a defined callback function on each element of an array, and returns an array that +contains the results. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2154 + +___ + +### reduce + +▸ **reduce**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*): *number* + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2166 + +▸ **reduce**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*, `initialValue`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | +`initialValue` | *number* | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2167 + +▸ **reduce**(`callbackfn`: (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U, `initialValue`: U): U + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Type parameters: + +Name | +------ | +`U` | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | +`initialValue` | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +**Returns:** U + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2179 + +___ + +### reduceRight + +▸ **reduceRight**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*): *number* + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2191 + +▸ **reduceRight**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*, `initialValue`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | +`initialValue` | *number* | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2192 + +▸ **reduceRight**(`callbackfn`: (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U, `initialValue`: U): U + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Type parameters: + +Name | +------ | +`U` | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | +`initialValue` | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +**Returns:** U + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2204 + +___ + +### reverse + +▸ **reverse**(): *Uint8Array* + +Reverses the elements in an Array. + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2209 + +___ + +### set + +▸ **set**(`array`: *ArrayLike*<*number*\>, `offset?`: *number*): *void* + +Sets a value or an array of values. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`array` | *ArrayLike*<*number*\> | A typed or untyped array of values to set. | +`offset?` | *number* | The index in the current array at which the values are to be written. | + +**Returns:** *void* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2216 + +___ + +### slice + +▸ **slice**(`start?`: *number*, `end?`: *number*): *Uint8Array* + +Returns a section of an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`start?` | *number* | The beginning of the specified portion of the array. | +`end?` | *number* | The end of the specified portion of the array. This is exclusive of the element at the index 'end'. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2223 + +___ + +### some + +▸ **some**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown*, `thisArg?`: *any*): *boolean* + +Determines whether the specified callback function returns true for any element of an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown* | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2233 + +___ + +### sort + +▸ **sort**(`compareFn?`: (`a`: *number*, `b`: *number*) => *number*): [*Bytes*](utils.bytes.bytes.md) + +Sorts an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`compareFn?` | (`a`: *number*, `b`: *number*) => *number* | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` | + +**Returns:** [*Bytes*](utils.bytes.bytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2244 + +___ + +### subarray + +▸ **subarray**(`begin?`: *number*, `end?`: *number*): *Uint8Array* + +Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements +at begin, inclusive, up to end, exclusive. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`begin?` | *number* | The index of the beginning of the array. | +`end?` | *number* | The index of the end of the array. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2252 + +___ + +### toLocaleString + +▸ **toLocaleString**(): *string* + +Converts a number to a string by using the current locale. + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2257 + +___ + +### toString + +▸ **toString**(): *string* + +Returns a string representation of an array. + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2262 + +___ + +### valueOf + +▸ **valueOf**(): *Uint8Array* + +Returns the primitive value of the specified object. + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2265 + +___ + +### values + +▸ **values**(): *IterableIterator*<*number*\> + +Returns an list of values in the array + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:291 diff --git a/docs/api-reference/interfaces/utils.bytes.flexbytes.md b/docs/api-reference/interfaces/utils.bytes.flexbytes.md new file mode 100644 index 00000000..500e4201 --- /dev/null +++ b/docs/api-reference/interfaces/utils.bytes.flexbytes.md @@ -0,0 +1,680 @@ +--- +hide_title: true +title: Utils.Bytes.FlexBytes +--- + +# Interface: FlexBytes + +[Utils](../modules/utils.md).[Bytes](../modules/utils.bytes.md).FlexBytes + +Helper type for dealing with flexible sized byte arrays. + +The actual min and and max values are not stored in runtime, they +are only there to differentiate the type from the Uint8Array at +compile time. + +**`see`** BrandedType + +## Type parameters + +Name | Type | +------ | ------ | +`Min` | *number* | +`Max` | *number* | + +## Hierarchy + +* *Uint8Array* + + ↳ **FlexBytes** + +## Table of contents + +### Properties + +- [BYTES\_PER\_ELEMENT](utils.bytes.flexbytes.md#bytes_per_element) +- [[Symbol.toStringTag]](utils.bytes.flexbytes.md#[symbol.tostringtag]) +- [\_\_max\_\_](utils.bytes.flexbytes.md#__max__) +- [\_\_min\_\_](utils.bytes.flexbytes.md#__min__) +- [buffer](utils.bytes.flexbytes.md#buffer) +- [byteLength](utils.bytes.flexbytes.md#bytelength) +- [byteOffset](utils.bytes.flexbytes.md#byteoffset) +- [length](utils.bytes.flexbytes.md#length) + +### Methods + +- [[Symbol.iterator]](utils.bytes.flexbytes.md#[symbol.iterator]) +- [copyWithin](utils.bytes.flexbytes.md#copywithin) +- [entries](utils.bytes.flexbytes.md#entries) +- [every](utils.bytes.flexbytes.md#every) +- [fill](utils.bytes.flexbytes.md#fill) +- [filter](utils.bytes.flexbytes.md#filter) +- [find](utils.bytes.flexbytes.md#find) +- [findIndex](utils.bytes.flexbytes.md#findindex) +- [forEach](utils.bytes.flexbytes.md#foreach) +- [includes](utils.bytes.flexbytes.md#includes) +- [indexOf](utils.bytes.flexbytes.md#indexof) +- [join](utils.bytes.flexbytes.md#join) +- [keys](utils.bytes.flexbytes.md#keys) +- [lastIndexOf](utils.bytes.flexbytes.md#lastindexof) +- [map](utils.bytes.flexbytes.md#map) +- [reduce](utils.bytes.flexbytes.md#reduce) +- [reduceRight](utils.bytes.flexbytes.md#reduceright) +- [reverse](utils.bytes.flexbytes.md#reverse) +- [set](utils.bytes.flexbytes.md#set) +- [slice](utils.bytes.flexbytes.md#slice) +- [some](utils.bytes.flexbytes.md#some) +- [sort](utils.bytes.flexbytes.md#sort) +- [subarray](utils.bytes.flexbytes.md#subarray) +- [toLocaleString](utils.bytes.flexbytes.md#tolocalestring) +- [toString](utils.bytes.flexbytes.md#tostring) +- [valueOf](utils.bytes.flexbytes.md#valueof) +- [values](utils.bytes.flexbytes.md#values) + +## Properties + +### BYTES\_PER\_ELEMENT + +• `Readonly` **BYTES\_PER\_ELEMENT**: *number* + +The size in bytes of each element in the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2030 + +___ + +### [Symbol.toStringTag] + +• `Readonly` **[Symbol.toStringTag]**: *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:282 + +___ + +### \_\_max\_\_ + +• `Readonly` **\_\_max\_\_**: Max + +Defined in: [src/utils/bytes.ts:22](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L22) + +___ + +### \_\_min\_\_ + +• `Readonly` **\_\_min\_\_**: Min + +Defined in: [src/utils/bytes.ts:21](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L21) + +___ + +### buffer + +• `Readonly` **buffer**: ArrayBufferLike + +The ArrayBuffer instance referenced by the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2035 + +___ + +### byteLength + +• `Readonly` **byteLength**: *number* + +The length in bytes of the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2040 + +___ + +### byteOffset + +• `Readonly` **byteOffset**: *number* + +The offset in bytes of the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2045 + +___ + +### length + +• `Readonly` **length**: *number* + +The length of the array. + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2144 + +## Methods + +### [Symbol.iterator] + +▸ **[Symbol.iterator]**(): *IterableIterator*<*number*\> + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:279 + +___ + +### copyWithin + +▸ **copyWithin**(`target`: *number*, `start`: *number*, `end?`: *number*): [*FlexBytes*](utils.bytes.flexbytes.md) + +Returns the this object after copying a section of the array identified by start and end +to the same array starting at position target + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`target` | *number* | If target is negative, it is treated as length+target where length is the length of the array. | +`start` | *number* | If start is negative, it is treated as length+start. If end is negative, it is treated as length+end. | +`end?` | *number* | If not specified, length of the this object is used as its default value. | + +**Returns:** [*FlexBytes*](utils.bytes.flexbytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2056 + +___ + +### entries + +▸ **entries**(): *IterableIterator*<[*number*, *number*]\> + +Returns an array of key, value pairs for every entry in the array + +**Returns:** *IterableIterator*<[*number*, *number*]\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:283 + +___ + +### every + +▸ **every**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown*, `thisArg?`: *any*): *boolean* + +Determines whether all the members of an array satisfy the specified test. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown* | A function that accepts up to three arguments. The every method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value false, or until the end of the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2066 + +___ + +### fill + +▸ **fill**(`value`: *number*, `start?`: *number*, `end?`: *number*): [*FlexBytes*](utils.bytes.flexbytes.md) + +Returns the this object after filling the section identified by start and end with value + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`value` | *number* | value to fill array section with | +`start?` | *number* | index to start filling the array at. If start is negative, it is treated as length+start where length is the length of the array. | +`end?` | *number* | index to stop filling the array at. If end is negative, it is treated as length+end. | + +**Returns:** [*FlexBytes*](utils.bytes.flexbytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2076 + +___ + +### filter + +▸ **filter**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *any*, `thisArg?`: *any*): *Uint8Array* + +Returns the elements of an array that meet the condition specified in a callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *any* | A function that accepts up to three arguments. The filter method calls the predicate function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2085 + +___ + +### find + +▸ **find**(`predicate`: (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean*, `thisArg?`: *any*): *undefined* \| *number* + +Returns the value of the first element in the array where predicate is true, and undefined +otherwise. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean* | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, find immediately returns that element value. Otherwise, find returns undefined. | +`thisArg?` | *any* | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +**Returns:** *undefined* \| *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2096 + +___ + +### findIndex + +▸ **findIndex**(`predicate`: (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean*, `thisArg?`: *any*): *number* + +Returns the index of the first element in the array where predicate is true, and -1 +otherwise. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `obj`: *Uint8Array*) => *boolean* | find calls predicate once for each element of the array, in ascending order, until it finds one where predicate returns true. If such an element is found, findIndex immediately returns that element index. Otherwise, findIndex returns -1. | +`thisArg?` | *any* | If provided, it will be used as the this value for each invocation of predicate. If it is not provided, undefined is used instead. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2107 + +___ + +### forEach + +▸ **forEach**(`callbackfn`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *void*, `thisArg?`: *any*): *void* + +Performs the specified action for each element in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *void* | A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *void* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2116 + +___ + +### includes + +▸ **includes**(`searchElement`: *number*, `fromIndex?`: *number*): *boolean* + +Determines whether an array includes a certain element, returning true or false as appropriate. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The element to search for. | +`fromIndex?` | *number* | The position in this array at which to begin searching for searchElement. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es2016.array.include.d.ts:54 + +___ + +### indexOf + +▸ **indexOf**(`searchElement`: *number*, `fromIndex?`: *number*): *number* + +Returns the index of the first occurrence of a value in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The value to locate in the array. | +`fromIndex?` | *number* | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2124 + +___ + +### join + +▸ **join**(`separator?`: *string*): *string* + +Adds all the elements of an array separated by the specified separator string. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`separator?` | *string* | A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma. | + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2131 + +___ + +### keys + +▸ **keys**(): *IterableIterator*<*number*\> + +Returns an list of keys in the array + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:287 + +___ + +### lastIndexOf + +▸ **lastIndexOf**(`searchElement`: *number*, `fromIndex?`: *number*): *number* + +Returns the index of the last occurrence of a value in an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`searchElement` | *number* | The value to locate in the array. | +`fromIndex?` | *number* | The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2139 + +___ + +### map + +▸ **map**(`callbackfn`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *number*, `thisArg?`: *any*): *Uint8Array* + +Calls a defined callback function on each element of an array, and returns an array that +contains the results. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2154 + +___ + +### reduce + +▸ **reduce**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*): *number* + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2166 + +▸ **reduce**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*, `initialValue`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | +`initialValue` | *number* | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2167 + +▸ **reduce**(`callbackfn`: (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U, `initialValue`: U): U + +Calls the specified callback function for all the elements in an array. The return value of +the callback function is the accumulated result, and is provided as an argument in the next +call to the callback function. + +#### Type parameters: + +Name | +------ | +`U` | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U | A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array. | +`initialValue` | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +**Returns:** U + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2179 + +___ + +### reduceRight + +▸ **reduceRight**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*): *number* + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2191 + +▸ **reduceRight**(`callbackfn`: (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number*, `initialValue`: *number*): *number* + +#### Parameters: + +Name | Type | +------ | ------ | +`callbackfn` | (`previousValue`: *number*, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => *number* | +`initialValue` | *number* | + +**Returns:** *number* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2192 + +▸ **reduceRight**(`callbackfn`: (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U, `initialValue`: U): U + +Calls the specified callback function for all the elements in an array, in descending order. +The return value of the callback function is the accumulated result, and is provided as an +argument in the next call to the callback function. + +#### Type parameters: + +Name | +------ | +`U` | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`callbackfn` | (`previousValue`: U, `currentValue`: *number*, `currentIndex`: *number*, `array`: *Uint8Array*) => U | A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array. | +`initialValue` | U | If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value. | + +**Returns:** U + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2204 + +___ + +### reverse + +▸ **reverse**(): *Uint8Array* + +Reverses the elements in an Array. + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2209 + +___ + +### set + +▸ **set**(`array`: *ArrayLike*<*number*\>, `offset?`: *number*): *void* + +Sets a value or an array of values. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`array` | *ArrayLike*<*number*\> | A typed or untyped array of values to set. | +`offset?` | *number* | The index in the current array at which the values are to be written. | + +**Returns:** *void* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2216 + +___ + +### slice + +▸ **slice**(`start?`: *number*, `end?`: *number*): *Uint8Array* + +Returns a section of an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`start?` | *number* | The beginning of the specified portion of the array. | +`end?` | *number* | The end of the specified portion of the array. This is exclusive of the element at the index 'end'. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2223 + +___ + +### some + +▸ **some**(`predicate`: (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown*, `thisArg?`: *any*): *boolean* + +Determines whether the specified callback function returns true for any element of an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`predicate` | (`value`: *number*, `index`: *number*, `array`: *Uint8Array*) => *unknown* | A function that accepts up to three arguments. The some method calls the predicate function for each element in the array until the predicate returns a value which is coercible to the Boolean value true, or until the end of the array. | +`thisArg?` | *any* | An object to which the this keyword can refer in the predicate function. If thisArg is omitted, undefined is used as the this value. | + +**Returns:** *boolean* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2233 + +___ + +### sort + +▸ **sort**(`compareFn?`: (`a`: *number*, `b`: *number*) => *number*): [*FlexBytes*](utils.bytes.flexbytes.md) + +Sorts an array. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`compareFn?` | (`a`: *number*, `b`: *number*) => *number* | Function used to determine the order of the elements. It is expected to return a negative value if first argument is less than second argument, zero if they're equal and a positive value otherwise. If omitted, the elements are sorted in ascending, ASCII character order. ```ts [11,2,22,1].sort((a, b) => a - b) ``` | + +**Returns:** [*FlexBytes*](utils.bytes.flexbytes.md) + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2244 + +___ + +### subarray + +▸ **subarray**(`begin?`: *number*, `end?`: *number*): *Uint8Array* + +Gets a new Uint8Array view of the ArrayBuffer store for this array, referencing the elements +at begin, inclusive, up to end, exclusive. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`begin?` | *number* | The index of the beginning of the array. | +`end?` | *number* | The index of the end of the array. | + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2252 + +___ + +### toLocaleString + +▸ **toLocaleString**(): *string* + +Converts a number to a string by using the current locale. + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2257 + +___ + +### toString + +▸ **toString**(): *string* + +Returns a string representation of an array. + +**Returns:** *string* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2262 + +___ + +### valueOf + +▸ **valueOf**(): *Uint8Array* + +Returns the primitive value of the specified object. + +**Returns:** *Uint8Array* + +Defined in: node_modules/typescript/lib/lib.es5.d.ts:2265 + +___ + +### values + +▸ **values**(): *IterableIterator*<*number*\> + +Returns an list of values in the array + +**Returns:** *IterableIterator*<*number*\> + +Defined in: node_modules/typescript/lib/lib.es2015.iterable.d.ts:291 diff --git a/docs/api-reference/modules/utils.bytes.md b/docs/api-reference/modules/utils.bytes.md new file mode 100644 index 00000000..b60adead --- /dev/null +++ b/docs/api-reference/modules/utils.bytes.md @@ -0,0 +1,200 @@ +--- +hide_title: true +title: Utils.Bytes +--- + +# Namespace: Utils.Bytes + +## Table of contents + +### Interfaces + +- [Bytes](../interfaces/utils.bytes.bytes.md) +- [FlexBytes](../interfaces/utils.bytes.flexbytes.md) + +### Functions + +- [bytesAtOffset](utils.bytes.md#bytesatoffset) +- [bytesEqual](utils.bytes.md#bytesequal) +- [flexBytesAtOffset](utils.bytes.md#flexbytesatoffset) +- [isBytes](utils.bytes.md#isbytes) +- [isFlexBytes](utils.bytes.md#isflexbytes) +- [verifyBytes](utils.bytes.md#verifybytes) +- [verifyFlexBytes](utils.bytes.md#verifyflexbytes) + +## Functions + +### bytesAtOffset + +▸ **bytesAtOffset**(`offset`: *number*, `length`: Length, `data`: Uint8Array): [*Bytes*](../interfaces/utils.bytes.bytes.md) + +Return `length` bytes starting from `offset` + +#### Type parameters: + +Name | Type | +------ | ------ | +`Length` | *number* | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`offset` | *number* | The offset to start from | +`length` | Length | The length of data to be returned | +`data` | Uint8Array | The original data | + +**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md) + +Defined in: [src/utils/bytes.ts:88](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L88) + +___ + +### bytesEqual + +▸ **bytesEqual**(`a`: Uint8Array, `b`: Uint8Array): *boolean* + +Returns true if two byte arrays are equal + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`a` | Uint8Array | Byte array to compare | +`b` | Uint8Array | Byte array to compare | + +**Returns:** *boolean* + +Defined in: [src/utils/bytes.ts:115](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L115) + +___ + +### flexBytesAtOffset + +▸ **flexBytesAtOffset**(`offset`: *number*, `_min`: Min, `_max`: Max, `data`: Uint8Array): [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md) + +Return flex bytes starting from `offset` + +#### Type parameters: + +Name | Type | +------ | ------ | +`Min` | *number* | +`Max` | *number* | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`offset` | *number* | The offset to start from | +`_min` | Min | The minimum size of the data | +`_max` | Max | The maximum size of the data | +`data` | Uint8Array | The original data | + +**Returns:** [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md) + +Defined in: [src/utils/bytes.ts:100](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L100) + +___ + +### isBytes + +▸ **isBytes**(`length`: Length, `b`: Uint8Array): b is Bytes + +Type guard for Bytes\ type + +#### Type parameters: + +Name | Type | +------ | ------ | +`Length` | *number* | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`length` | Length | The length of the byte array | +`b` | Uint8Array | The byte array | + +**Returns:** b is Bytes + +Defined in: [src/utils/bytes.ts:31](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L31) + +___ + +### isFlexBytes + +▸ **isFlexBytes**(`min`: Min, `max`: Max, `b`: Uint8Array): b is FlexBytes + +Type guard for FlexBytes type + +#### Type parameters: + +Name | Type | Default | +------ | ------ | ------ | +`Min` | *number* | - | +`Max` | *number* | Min | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`min` | Min | Minimum size of the array | +`max` | Max | Maximum size of the array | +`b` | Uint8Array | The byte array | + +**Returns:** b is FlexBytes + +Defined in: [src/utils/bytes.ts:55](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L55) + +___ + +### verifyBytes + +▸ **verifyBytes**(`length`: Length, `b`: Uint8Array): [*Bytes*](../interfaces/utils.bytes.bytes.md) \| *never* + +Verifies if a byte array has a certain length + +#### Type parameters: + +Name | Type | +------ | ------ | +`Length` | *number* | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`length` | Length | The specified length | +`b` | Uint8Array | The byte array | + +**Returns:** [*Bytes*](../interfaces/utils.bytes.bytes.md) \| *never* + +Defined in: [src/utils/bytes.ts:41](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L41) + +___ + +### verifyFlexBytes + +▸ **verifyFlexBytes**(`min`: Min, `max`: Max, `b`: Uint8Array): [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md) \| *never* + +Verifies if a byte array has a certain length between min and max + +#### Type parameters: + +Name | Type | Default | +------ | ------ | ------ | +`Min` | *number* | - | +`Max` | *number* | Min | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`min` | Min | Minimum size of the array | +`max` | Max | Maximum size of the array | +`b` | Uint8Array | The byte array | + +**Returns:** [*FlexBytes*](../interfaces/utils.bytes.flexbytes.md) \| *never* + +Defined in: [src/utils/bytes.ts:70](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/bytes.ts#L70) diff --git a/docs/api-reference/modules/utils.data.md b/docs/api-reference/modules/utils.data.md new file mode 100644 index 00000000..d280cf4e --- /dev/null +++ b/docs/api-reference/modules/utils.data.md @@ -0,0 +1,45 @@ +--- +hide_title: true +title: Utils.Data +--- + +# Namespace: Utils.Data + +## Table of contents + +### Functions + +- [prepareData](utils.data.md#preparedata) +- [prepareWebsocketData](utils.data.md#preparewebsocketdata) + +## Functions + +### prepareData + +▸ **prepareData**(`data`: *string* \| ArrayBuffer \| Uint8Array \| Readable): Uint8Array \| Readable + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | *string* \| ArrayBuffer \| Uint8Array \| Readable | + +**Returns:** Uint8Array \| Readable + +Defined in: [src/utils/data.ts:4](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/data.ts#L4) + +___ + +### prepareWebsocketData + +▸ **prepareWebsocketData**(`data`: Data): Uint8Array + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | Data | + +**Returns:** Uint8Array + +Defined in: [src/utils/data.ts:14](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/data.ts#L14) diff --git a/docs/api-reference/modules/utils.file.md b/docs/api-reference/modules/utils.file.md new file mode 100644 index 00000000..bb08c7ff --- /dev/null +++ b/docs/api-reference/modules/utils.file.md @@ -0,0 +1,52 @@ +--- +hide_title: true +title: Utils.File +--- + +# Namespace: Utils.File + +## Table of contents + +### Functions + +- [fileArrayBuffer](utils.file.md#filearraybuffer) +- [isFile](utils.file.md#isfile) + +## Functions + +### fileArrayBuffer + +▸ **fileArrayBuffer**(`file`: File): *Promise* + +Compatibility helper for browsers where the `arrayBuffer function is +missing from `File` objects. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`file` | File | A File object | + +**Returns:** *Promise* + +Defined in: [src/utils/file.ts:29](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/file.ts#L29) + +___ + +### isFile + +▸ **isFile**(`file`: *unknown*): file is File + +Compatibility functions for working with File API objects + +https://developer.mozilla.org/en-US/docs/Web/API/File + +#### Parameters: + +Name | Type | +------ | ------ | +`file` | *unknown* | + +**Returns:** file is File + +Defined in: [src/utils/file.ts:7](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/file.ts#L7) diff --git a/docs/api-reference/modules/utils.hex.md b/docs/api-reference/modules/utils.hex.md new file mode 100644 index 00000000..78b8dae8 --- /dev/null +++ b/docs/api-reference/modules/utils.hex.md @@ -0,0 +1,131 @@ +--- +hide_title: true +title: Utils.Hex +--- + +# Namespace: Utils.Hex + +## Table of contents + +### Type aliases + +- [HexString](utils.hex.md#hexstring) + +### Functions + +- [bytesToHex](utils.hex.md#bytestohex) +- [hexToBytes](utils.hex.md#hextobytes) +- [isHexString](utils.hex.md#ishexstring) +- [stripHexPrefix](utils.hex.md#striphexprefix) +- [verifyHex](utils.hex.md#verifyhex) + +## Type aliases + +### HexString + +Ƭ **HexString**: [*BrandedString*](../typealiases/typealiases.md#brandedstring)<*HexString*\> + +Nominal type to represent hex strings + +Defined in: [src/utils/hex.ts:6](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L6) + +## Functions + +### bytesToHex + +▸ **bytesToHex**(`bytes`: Uint8Array, `withPrefix?`: *boolean*): [*HexString*](utils.hex.md#hexstring) + +Converts array of number or Uint8Array to hex string. + +Optionally provides a the '0x' prefix. + +#### Parameters: + +Name | Type | Default value | Description | +------ | ------ | ------ | ------ | +`bytes` | Uint8Array | - | The input array | +`withPrefix` | *boolean* | false | Provides '0x' prefix when true (default: false) | + +**Returns:** [*HexString*](utils.hex.md#hexstring) + +Defined in: [src/utils/hex.ts:41](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L41) + +___ + +### hexToBytes + +▸ **hexToBytes**(`hex`: [*HexString*](utils.hex.md#hexstring)): Uint8Array + +Converts a hex string to Uint8Array + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`hex` | [*HexString*](utils.hex.md#hexstring) | string input | + +**Returns:** Uint8Array + +Defined in: [src/utils/hex.ts:22](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L22) + +___ + +### isHexString + +▸ **isHexString**(`s`: *string*): s is BrandedType + +Type guard for HexStrings + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`s` | *string* | string input | + +**Returns:** s is BrandedType + +Defined in: [src/utils/hex.ts:54](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L54) + +___ + +### stripHexPrefix + +▸ **stripHexPrefix**(`hex`: T): T + +Strips the '0x' hex prefix from a string + +#### Type parameters: + +Name | Type | +------ | ------ | +`T` | *string* | + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`hex` | T | string input | + +**Returns:** T + +Defined in: [src/utils/hex.ts:13](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L13) + +___ + +### verifyHex + +▸ **verifyHex**(`s`: *string*): [*HexString*](utils.hex.md#hexstring) \| *never* + +Verifies if the provided input is a HexString. + +#### Parameters: + +Name | Type | Description | +------ | ------ | ------ | +`s` | *string* | string input | + +**Returns:** [*HexString*](utils.hex.md#hexstring) \| *never* + +HexString or throws error + +Defined in: [src/utils/hex.ts:65](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/hex.ts#L65) diff --git a/docs/api-reference/modules/utils.tar.md b/docs/api-reference/modules/utils.tar.md new file mode 100644 index 00000000..c70dd57c --- /dev/null +++ b/docs/api-reference/modules/utils.tar.md @@ -0,0 +1,28 @@ +--- +hide_title: true +title: Utils.Tar +--- + +# Namespace: Utils.Tar + +## Table of contents + +### Functions + +- [makeTar](utils.tar.md#maketar) + +## Functions + +### makeTar + +▸ **makeTar**(`data`: [*Collection*](../typealiases/typealiases.md#collection)): Uint8Array + +#### Parameters: + +Name | Type | +------ | ------ | +`data` | [*Collection*](../typealiases/typealiases.md#collection) | + +**Returns:** Uint8Array + +Defined in: [src/utils/tar.ts:22](https://github.com/ethersphere/bee-js/blob/313830a/src/utils/tar.ts#L22) diff --git a/docs/api-reference/typealiases/typealiases.md b/docs/api-reference/typealiases/typealiases.md new file mode 100644 index 00000000..68cb1295 --- /dev/null +++ b/docs/api-reference/typealiases/typealiases.md @@ -0,0 +1,100 @@ +--- +hide_title: true +title: Type Aliases +--- + +## Type aliases + +### Address + +Ƭ **Address**: *string* + +Defined in: [src/types/index.ts:10](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L10) + +___ + +### AddressPrefix + +Ƭ **AddressPrefix**: [*Address*](#address) + +Defined in: [src/types/index.ts:11](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L11) + +___ + +### BrandedString + +Ƭ **BrandedString**: [*BrandedType*](#brandedtype)<*string*, N\> + +#### Type parameters: + +Name | +------ | +`N` | + +Defined in: [src/types/index.ts:103](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L103) + +___ + +### BrandedType + +Ƭ **BrandedType**: T & { `__tag__`: N } + +These type are used to create new nominal types + +See https://spin.atomicobject.com/2018/01/15/typescript-flexible-nominal-typing/ + +#### Type parameters: + +Name | +------ | +`T` | +`N` | + +Defined in: [src/types/index.ts:101](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L101) + +___ + +### Collection + +Ƭ **Collection**: [*CollectionEntry*](../interfaces/collectionentry.md)[] + +Represents Collections + +#### Type parameters: + +Name | +------ | +`T` | + +Defined in: [src/types/index.ts:75](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L75) + +___ + +### FlavoredType + +Ƭ **FlavoredType**: T & { `__tag__?`: N } + +#### Type parameters: + +Name | +------ | +`T` | +`N` | + +Defined in: [src/types/index.ts:105](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L105) + +___ + +### PublicKey + +Ƭ **PublicKey**: *string* + +Defined in: [src/types/index.ts:8](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L8) + +___ + +### Reference + +Ƭ **Reference**: *string* + +Defined in: [src/types/index.ts:7](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L7) diff --git a/docs/api-reference/variables/variables.md b/docs/api-reference/variables/variables.md new file mode 100644 index 00000000..440dd169 --- /dev/null +++ b/docs/api-reference/variables/variables.md @@ -0,0 +1,20 @@ +--- +hide_title: true +title: Variables +--- + +## Variables + +### ENCRYPTED\_REFERENCE\_LENGTH + +• `Const` **ENCRYPTED\_REFERENCE\_LENGTH**: *number* + +Defined in: [src/types/index.ts:14](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L14) + +___ + +### REFERENCE\_LENGTH + +• `Const` **REFERENCE\_LENGTH**: *64*= 64 + +Defined in: [src/types/index.ts:13](https://github.com/ethersphere/bee-js/blob/313830a/src/types/index.ts#L13) \ No newline at end of file diff --git a/docs/user-documentation/track-upload.md b/docs/user-documentation/track-upload.md index ac87eda6..7a82f3c9 100644 --- a/docs/user-documentation/track-upload.md +++ b/docs/user-documentation/track-upload.md @@ -104,7 +104,7 @@ await bee.uploadFilesToCollection("./", true, { tag }) ## Retrieve tag -Each time you want to check the upload status, you can use the `retrieveTag` function +Each time you want to check the upload status, you can use the `retrieveTag` function.