Home > vm-providers > VM
This interface is implemented by each virtual machine provider. It specifies the set of operations that can be done on a virtual machine, including sending keyboard and mouse events and destroying the virtual machine.
Signature:
export interface VM 
| Property | Type | Description | 
|---|---|---|
| tcpRedirections | readonly PortRedirection[] | Contains an array of TCP port redirections that are usable. Especially, all ports specified in VMConfig.redirectTCPPorts when calling the virtual machine factory should have a corresponding entry in this array. | 
| Method | Description | 
|---|---|
| destroy() | Stops and destroys the virtual machine. | 
| sendKeyDownEvent(key) | Sends a keydown event to the virtual machine. | 
| sendKeyUpEvent(key) | Sends a keyup event to the virtual machine. | 
| sendMouseDownEvent(button) | Sends a mousedown event to the virtual machine. | 
| sendMouseMoveEvent(position) | Sends an absolute mousemove event to the virtual machine. | 
| sendMouseUpEvent(button) | Sends a mouseup event to the virtual machine. | 
| takePNGScreenshot() | Takes a screenshot of the virtual machine and returns the corresponding PNG image. |