### Table of Contents - [constructor](#constructor) - [getSubTree](#getsubtree) - [get](#get) - [set](#set) - [delete](#delete) - [done](#done) - [flush](#flush) - [emptyTreeState](#emptytreestate) - [ArrayConstructor](#arrayconstructor) - [getMerkleLink](#getmerklelink) ## constructor [index.js:17-26](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L17-L26 "Source code on GitHub") **Parameters** - `opts` - `opts.root` {object} a merkle root to a radix tree. If none, RadixTree will create an new root. - `opts.db` {object} a level db instance alternitly `opts.graph` can be used - `opts.graph` {object} an instance of [ipld-graph-builder](https://github.com/ipld/js-ipld-graph-builder) alternitvly `opts.dag` can be used - `opts.dag` {object} an instance if [ipfs.dag](https://github.com/ipfs/js-ipfs#dag). If there is no `opts.graph` this will be used to create a new graph instance. ## getSubTree [index.js:33-38](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L33-L38 "Source code on GitHub") creates a new instance of RadixTree that is the subTree of the given key **Parameters** - `key` **any** - `decode` Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** resolve to the new instance of RadixTree ## get [index.js:45-50](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L45-L50 "Source code on GitHub") gets a value given a key **Parameters** - `key` **any** - `decode` Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## set [index.js:100-103](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L100-L103 "Source code on GitHub") stores a value at a given key **Parameters** - `key` **any** - `value` Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## delete [index.js:148-151](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L148-L151 "Source code on GitHub") deletes a value at a given key **Parameters** - `key` **any** Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## done [index.js:210-216](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L210-L216 "Source code on GitHub") returns a promise that resolve when the tree is done with all of its writes Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## flush [index.js:232-235](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L232-L235 "Source code on GitHub") creates a merkle root for the current tree and stores the data perstantly Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## emptyTreeState [index.js:265-267](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L265-L267 "Source code on GitHub") returns the state of an empty tree ## ArrayConstructor [index.js:273-275](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L273-L275 "Source code on GitHub") returns an Uint1Array constructir which is used to repersent keys Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## getMerkleLink [index.js:282-284](https://github.com/dfinity/js-dfinity-radix-tree/blob/f2549aeaac0dc25adbecd0d5c3e4acb0f9c5ca94/index.js#L282-L284 "Source code on GitHub") returns a merkle link for some given data **Parameters** - `data` **[Buffer](https://nodejs.org/api/buffer.html)** the data which you would like to hash Returns **[Buffer](https://nodejs.org/api/buffer.html)**