### Table of Contents - [constructor](#constructor) - [send](#send) - [getActor](#getactor) - [createActor](#createactor) - [createStateRoot](#createstateroot) - [registerContainer](#registercontainer) ## constructor [index.js:10-15](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L10-L15 "Source code on GitHub") The Hypervisor manages the container instances by instantiating them and destorying them when possible. It also facilitates localating Containers **Parameters** - `tree` **Tree** a [radix tree](https://github.com/dfinity/js-dfinity-radix-tree) to store the state ## send [index.js:23-27](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L23-L27 "Source code on GitHub") sends a message **Parameters** - `cap` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the capabilitly used to send the message - `message` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the [message](https://github.com/primea/js-primea-message) to send Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** a promise that resolves once the receiving container is loaded ## getActor [index.js:52-63](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L52-L63 "Source code on GitHub") gets an existsing actor **Parameters** - `id` **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** the actor's ID Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## createActor [index.js:71-95](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L71-L95 "Source code on GitHub") creates an instance of an Actor **Parameters** - `type` **Integer** the type id for the container - `message` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** an intial [message](https://github.com/primea/js-primea-message) to send newly created actor - `id` **[Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object)** the id for the actor (optional, default `{nonce:this.nonce,parent:null}`) ## createStateRoot [index.js:108-111](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L108-L111 "Source code on GitHub") creates a state root starting from a given container and a given number of ticks **Parameters** - `ticks` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of ticks at which to create the state root Returns **[Promise](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise)** ## registerContainer [index.js:119-124](https://github.com/primea/js-primea-hypervisor/blob/4d548116a6a4d4ceeda766ea686a328148cb029b/index.js#L119-L124 "Source code on GitHub") regirsters a container with the hypervisor **Parameters** - `Constructor` **Class** a Class for instantiating the container - `args` **any** any args that the contructor takes - `typeId` **Integer** the container's type identification ID (optional, default `Constructor.typeId`)