### Table of Contents - [constructor](#constructor) - [get](#get) - [set](#set) - [delete](#delete) - [done](#done) - [flush](#flush) - [emptyTreeState](#emptytreestate) - [ArrayConstructor](#arrayconstructor) - [getMerkleLink](#getmerklelink) ## constructor [index.js:17-25](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L17-L25 "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; alternatively, `opts.graph` can be used - `opts.graph` {object} an instance of [ipld-graph-builder](https://github.com/ipld/js-ipld-graph-builder); alternatively, `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. ## get [index.js:32-36](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L32-L36 "Source code on GitHub") gets a value given a key **Parameters** - `key` **any** Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## set [index.js:87-90](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L87-L90 "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:135-138](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L135-L138 "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:197-203](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L197-L203 "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:219-222](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L219-L222 "Source code on GitHub") creates a merkle root for the current tree and stores the data persistently Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## emptyTreeState [index.js:248-250](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L248-L250 "Source code on GitHub") returns the state of an empty tree ## ArrayConstructor [index.js:256-258](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L256-L258 "Source code on GitHub") returns an Uint1Array constructor which is used to represent keys Returns **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** ## getMerkleLink [index.js:265-267](https://github.com/dfinity/js-dfinity-radix-tree/blob/3228beb1ebc4a9921b555fd514ede84f91ce5bf9/index.js#L265-L267 "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)**