[CI Skip] 0.33.1

This commit is contained in:
Travis CI
2018-11-22 13:34:27 +00:00
parent f82092e603
commit aac39f97e3
216 changed files with 1355 additions and 814 deletions
+140
View File
@@ -0,0 +1,140 @@
# Variables
<a id="branch_node_no_value"></a>
## `<Const>` BRANCH_NODE_NO_VALUE
**● BRANCH_NODE_NO_VALUE**: *`254`* = 254
*Defined in [constants.ts:10](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L10)*
___
<a id="branch_node_with_value"></a>
## `<Const>` BRANCH_NODE_WITH_VALUE
**● BRANCH_NODE_WITH_VALUE**: *`255`* = 255
*Defined in [constants.ts:11](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L11)*
___
<a id="empty_trie"></a>
## `<Const>` EMPTY_TRIE
**● EMPTY_TRIE**: *`0`* = 0
*Defined in [constants.ts:5](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L5)*
___
<a id="extension_node_big"></a>
## `<Const>` EXTENSION_NODE_BIG
**● EXTENSION_NODE_BIG**: *`253`* = 253
*Defined in [constants.ts:9](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L9)*
___
<a id="extension_node_offset"></a>
## `<Const>` EXTENSION_NODE_OFFSET
**● EXTENSION_NODE_OFFSET**: *`128`* = 128
*Defined in [constants.ts:8](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L8)*
___
<a id="extension_node_small_max"></a>
## `<Const>` EXTENSION_NODE_SMALL_MAX
**● EXTENSION_NODE_SMALL_MAX**: *`number`* = EXTENSION_NODE_BIG - 1
*Defined in [constants.ts:15](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L15)*
___
<a id="extension_node_threshold"></a>
## `<Const>` EXTENSION_NODE_THRESHOLD
**● EXTENSION_NODE_THRESHOLD**: *`number`* = EXTENSION_NODE_BIG - EXTENSION_NODE_OFFSET
*Defined in [constants.ts:13](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L13)*
___
<a id="leaf_node_big"></a>
## `<Const>` LEAF_NODE_BIG
**● LEAF_NODE_BIG**: *`127`* = 127
*Defined in [constants.ts:7](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L7)*
___
<a id="leaf_node_offset"></a>
## `<Const>` LEAF_NODE_OFFSET
**● LEAF_NODE_OFFSET**: *`1`* = 1
*Defined in [constants.ts:6](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L6)*
___
<a id="leaf_node_small_max"></a>
## `<Const>` LEAF_NODE_SMALL_MAX
**● LEAF_NODE_SMALL_MAX**: *`number`* = LEAF_NODE_BIG - 1
*Defined in [constants.ts:14](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L14)*
___
<a id="leaf_node_threshold"></a>
## `<Const>` LEAF_NODE_THRESHOLD
**● LEAF_NODE_THRESHOLD**: *`number`* = LEAF_NODE_BIG - LEAF_NODE_OFFSET
*Defined in [constants.ts:12](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L12)*
___
<a id="node_type_branch"></a>
## `<Const>` NODE_TYPE_BRANCH
**● NODE_TYPE_BRANCH**: *`1`* = 1
*Defined in [constants.ts:17](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L17)*
___
<a id="node_type_ext"></a>
## `<Const>` NODE_TYPE_EXT
**● NODE_TYPE_EXT**: *`2`* = 2
*Defined in [constants.ts:18](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L18)*
___
<a id="node_type_leaf"></a>
## `<Const>` NODE_TYPE_LEAF
**● NODE_TYPE_LEAF**: *`3`* = 3
*Defined in [constants.ts:19](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L19)*
___
<a id="node_type_null"></a>
## `<Const>` NODE_TYPE_NULL
**● NODE_TYPE_NULL**: *`0`* = 0
*Defined in [constants.ts:16](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/constants.ts#L16)*
___
+22
View File
@@ -0,0 +1,22 @@
# Functions
<a id="decode"></a>
## decode
▸ **decode**(input: * `null` &#124; `Uint8Array`*): `Uint8Array` &#124; `null` &#124; `Array`< `null` &#124; `Uint8Array` &#124; `Array`< `null` &#124; `Uint8Array`>>
*Defined in [decode.ts:86](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/decode.ts#L86)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| input | `null` &#124; `Uint8Array`|
**Returns:** `Uint8Array` &#124; `null` &#124; `Array`< `null` &#124; `Uint8Array` &#124; `Array`< `null` &#124; `Uint8Array`>>
___
+2
View File
@@ -0,0 +1,2 @@
+22
View File
@@ -0,0 +1,22 @@
# Functions
<a id="encode"></a>
## encode
▸ **encode**(input?: * `null` &#124; `Uint8Array` &#124; `Array`< `null` &#124; `Uint8Array`>*): `Uint8Array`
*Defined in [encode.ts:94](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/encode.ts#L94)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` input | `null` &#124; `Uint8Array` &#124; `Array`< `null` &#124; `Uint8Array`>|
**Returns:** `Uint8Array`
___
+2
View File
@@ -0,0 +1,2 @@
+2
View File
@@ -0,0 +1,2 @@
+2
View File
@@ -0,0 +1,2 @@
+124
View File
@@ -0,0 +1,124 @@
# Functions
<a id="addnibblesterminator"></a>
## addNibblesTerminator
▸ **addNibblesTerminator**(nibbles: *`Uint8Array`*): `Uint8Array`
*Defined in [nibbles.ts:31](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L31)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| nibbles | `Uint8Array` |
**Returns:** `Uint8Array`
___
<a id="decodenibbles"></a>
## decodeNibbles
▸ **decodeNibbles**(value: * `null` &#124; `Uint8Array`*): `Uint8Array`
*Defined in [nibbles.ts:52](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L52)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `null` &#124; `Uint8Array`|
**Returns:** `Uint8Array`
___
<a id="encodenibbles"></a>
## encodeNibbles
▸ **encodeNibbles**(nibbles: *`Uint8Array`*): `Uint8Array`
*Defined in [nibbles.ts:65](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L65)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| nibbles | `Uint8Array` |
**Returns:** `Uint8Array`
___
<a id="extractkey"></a>
## extractKey
▸ **extractKey**(key: * `null` &#124; `Uint8Array`*): `Uint8Array`
*Defined in [nibbles.ts:15](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L15)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `null` &#124; `Uint8Array`|
**Returns:** `Uint8Array`
___
<a id="extractnodekey"></a>
## extractNodeKey
▸ **extractNodeKey**(__namedParameters: *[`null` &#124; `Uint8Array`]*): `Uint8Array`
*Defined in [nibbles.ts:21](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L21)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| __namedParameters | [`null` &#124; `Uint8Array`] |
**Returns:** `Uint8Array`
___
<a id="isnibblesterminated"></a>
## isNibblesTerminated
▸ **isNibblesTerminated**(nibbles: *`Uint8Array`*): `boolean`
*Defined in [nibbles.ts:27](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L27)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| nibbles | `Uint8Array` |
**Returns:** `boolean`
___
<a id="removenibblesterminator"></a>
## removeNibblesTerminator
▸ **removeNibblesTerminator**(nibbles: *`Uint8Array`*): `Uint8Array`
*Defined in [nibbles.ts:44](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/nibbles.ts#L44)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| nibbles | `Uint8Array` |
**Returns:** `Uint8Array`
___
+15
View File
@@ -0,0 +1,15 @@
# Index
### Classes
* [BranchHeader](../classes/_nodeheader_.branchheader.md)
* [ExtensionHeader](../classes/_nodeheader_.extensionheader.md)
* [LeafHeader](../classes/_nodeheader_.leafheader.md)
* [NibbleHeader](../classes/_nodeheader_.nibbleheader.md)
* [NodeHeader](../classes/_nodeheader_.nodeheader.md)
* [Null](../classes/_nodeheader_.null.md)
---
@@ -0,0 +1,23 @@
# Functions
<a id="createbranch"></a>
## createBranch
▸ **createBranch**(value: * `Uint8Array` &#124; `null`*, hasChildren: *`Array`<`boolean`>*): `Uint8Array`
*Defined in [stream/createBranch.ts:10](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createBranch.ts#L10)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `Uint8Array` &#124; `null`|
| hasChildren | `Array`<`boolean`> |
**Returns:** `Uint8Array`
___
@@ -0,0 +1,16 @@
# Functions
<a id="createempty"></a>
## createEmpty
▸ **createEmpty**(): `Uint8Array`
*Defined in [stream/createEmpty.ts:7](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createEmpty.ts#L7)*
**Returns:** `Uint8Array`
___
@@ -0,0 +1,22 @@
# Functions
<a id="createextension"></a>
## createExtension
▸ **createExtension**(key: *`Uint8Array`*): `Uint8Array`
*Defined in [stream/createExtension.ts:7](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createExtension.ts#L7)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `Uint8Array` |
**Returns:** `Uint8Array`
___
@@ -0,0 +1,23 @@
# Functions
<a id="createleaf"></a>
## createLeaf
▸ **createLeaf**(key: *`Uint8Array`*, value: *`Uint8Array`*): `Uint8Array`
*Defined in [stream/createLeaf.ts:10](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createLeaf.ts#L10)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| key | `Uint8Array` |
| value | `Uint8Array` |
**Returns:** `Uint8Array`
___
@@ -0,0 +1,22 @@
# Functions
<a id="createsubstream"></a>
## createSubstream
▸ **createSubstream**(value: *`Uint8Array`*): `Uint8Array`
*Defined in [stream/createSubstream.ts:8](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createSubstream.ts#L8)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `Uint8Array` |
**Returns:** `Uint8Array`
___
@@ -0,0 +1,22 @@
# Functions
<a id="createvalue"></a>
## createValue
▸ **createValue**(value: * `null` &#124; `Uint8Array`*): `Uint8Array`
*Defined in [stream/createValue.ts:9](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/createValue.ts#L9)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `null` &#124; `Uint8Array`|
**Returns:** `Uint8Array`
___
@@ -0,0 +1,22 @@
# Functions
<a id="encbranch"></a>
## encBranch
▸ **encBranch**(value: * `Uint8Array` &#124; `null`*): `Uint8Array`
*Defined in [stream/endBranch.ts:7](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/stream/endBranch.ts#L7)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| value | `Uint8Array` &#124; `null`|
**Returns:** `Uint8Array`
___
@@ -0,0 +1,2 @@
@@ -0,0 +1,38 @@
# Functions
<a id="fromnibbles"></a>
## fromNibbles
▸ **fromNibbles**(input: *`Uint8Array`*): `Uint8Array`
*Defined in [util/fromNibbles.ts:20](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/util/fromNibbles.ts#L20)*
*__name__*: fromNibbles
*__signature__*: fromNibbles (nibbles: Uint8Array): Uint8Array
*__summary__*: Converts the input to Nibbles.
*__description__*: From an `Uint8Array` input, calculate and return a list of nibbles that makes up the input.
*__example__*:
```javascript
import { fromNibbles } from '@polkadot/trie-codec/util';
fromNibbles(new Uint8Array([4, 1, 2, 0])); // => Uint8Array([0x41, 0x20]
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| input | `Uint8Array` |
**Returns:** `Uint8Array`
___
@@ -0,0 +1,2 @@
@@ -0,0 +1,23 @@
# Functions
<a id="fusenibbles"></a>
## fuseNibbles
▸ **fuseNibbles**(nibbles: *`Uint8Array`*, isLeaf: *`boolean`*): `Uint8Array`
*Defined in [util/fuseNibbles.ts:12](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/util/fuseNibbles.ts#L12)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| nibbles | `Uint8Array` |
| isLeaf | `boolean` |
**Returns:** `Uint8Array`
___
+2
View File
@@ -0,0 +1,2 @@
@@ -0,0 +1,23 @@
# Functions
<a id="sharedprefixlength"></a>
## sharedPrefixLength
▸ **sharedPrefixLength**(first: *`Uint8Array`*, second: *`Uint8Array`*): `number`
*Defined in [util/sharedPrefixLength.ts:5](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/util/sharedPrefixLength.ts#L5)*
**Parameters:**
| Name | Type |
| ------ | ------ |
| first | `Uint8Array` |
| second | `Uint8Array` |
**Returns:** `number`
___
@@ -0,0 +1,38 @@
# Functions
<a id="tonibbles"></a>
## toNibbles
▸ **toNibbles**(input?: * `Uint8Array` &#124; `null`*): `Uint8Array`
*Defined in [util/toNibbles.ts:20](https://github.com/polkadot-js/common/blob/f82092e/packages/trie-codec/src/util/toNibbles.ts#L20)*
*__name__*: toNibbles
*__signature__*: toNibbles (input: Uint8Array): Uint8Array
*__summary__*: Converts the input to Nibbles.
*__description__*: From an `Uint8Array` input, calculate and return a list of nibbles that makes up the input.
*__example__*:
```javascript
import { toNibbles } from '@polkadot/trie-codec/util';
toNibbles(new Uint8Array([0x41, 0x20]); // => Uint8Array([4, 1, 2, 0])
```
**Parameters:**
| Name | Type |
| ------ | ------ |
| `Optional` input | `Uint8Array` &#124; `null`|
**Returns:** `Uint8Array`
___
@@ -0,0 +1,2 @@