nomad

@lacrypta/nomad v0.0.0 / Enclosure

Interface: Enclosure

A VM enclosure interface wrapper object.

Extends

Accessors

enclosure

get enclosure(): string

Getter used to retrieve the wrapped enclosure.

Returns

string

Defined in

vm.ts:331


vm

get vm(): VM

Getter used to retrieve the wrapped VM.

Returns

VM

Defined in

vm.ts:337

Methods

execute()

execute(dependency: Dependency, args?: ArgumentsMap): Promise<unknown>

Execute the given Dependency with the given arguments map in the wrapped VM under the wrapped enclosure.

Parameters

dependency: Dependency

The Dependency to execute.

args?: ArgumentsMap

The arguments map to execute with.

Returns

Promise<unknown>

A Promise that resolves with the Dependency’s execution result, and rejects with an Error in case errors occurred.

Defined in

vm.ts:325


getSubEnclosures()

getSubEnclosures(depth?: number): Promise<string[]>

List the wrapped enclosure’s sub enclosures.

Parameters

depth?: number

Maximum enclosure depth to retrieve results for, defaults to retrieving all.

Returns

Promise<string[]>

A Promise that resolves with a list of sub enclosures if successful, and rejects with an Error in case errors occur.

Defined in

vm.ts:345


install()

install(dependency: Dependency): Promise<void>

Install the given Dependency on the wrapped VM under the wrapped enclosure.

Parameters

dependency: Dependency

The Dependency to install.

Returns

Promise<void>

A Promise that resolves with void if the Dependency was correctly installed, and rejects with an Error in case errors occurred.

Defined in

vm.ts:353


installAll()

installAll(dependencies: Iterable<Dependency>): Promise<void>

Install the given Dependency iterable, by sorting them topologically and installing each one in turn.

Parameters

dependencies: Iterable<Dependency>

Dependencies to install.

Returns

Promise<void>

A Promise that resolves with void if every Dependency in the iterable was correctly installed, and rejects with an Error in case errors occurred.

Defined in

vm.ts:361


isMuted()

isMuted(): Promise<boolean>

Determine whether the wrapped enclosure is muted.

Returns

Promise<boolean>

A Promise that resolves with a boolean value indicating whether the wrapped enclosure is muted if successful, and rejects with an Error in case errors occur.

Defined in

vm.ts:368


link(target: string): Promise<boolean>

Link the wrapped enclosure to another, so that events cast on the wrapped enclosure are also handled in the other.

Parameters

target: string

“Destination” enclosure to use.

Returns

Promise<boolean>

A Promise that resolves with a boolean value if enclosure linking completed successfully (the value itself determining if a new link was added), and rejects with an Error in case errors occur.

Defined in

vm.ts:376


listInstalled()

listInstalled(): Promise<string[]>

List the dependencies (user-level and predefined) installed on the wrapped enclosure or its prefixes

Returns

Promise<string[]>

A Promise that resolves with a list of installed dependency names if successful, and rejects with an Error in case errors occur.

Defined in

vm.ts:383


listLinkedFrom()

listLinkedFrom(): Promise<string[]>

List the enclosures that link to the wrapped one.

Returns

Promise<string[]>

A Promise that resolves with a list of linked-from enclosures if successful, and rejects with an Error in case errors occur.

Defined in

vm.ts:390


listLinksTo()

listLinksTo(): Promise<string[]>

List the enclosures the wrapped one is linked to.

Returns

Promise<string[]>

A Promise that resolves with a list of linked-to enclosures if successful, and rejects with an Error in case errors occur.

Defined in

vm.ts:397


mute()

mute(): Promise<boolean>

Mute the wrapped enclosure, so that events cast on it are no longer propagated to the wrapped VM.

Returns

Promise<boolean>

A Promise that resolves with the previous muting status if enclosure muting completed successfully, and rejects with an Error in case errors occur.

Defined in

vm.ts:404


off()

off(callback: EventCallback): this

Remove the given callback from the listeners set.

Parameters

callback: EventCallback

The callback to remove.

Returns

this

this, for chaining.

Inherited from

EventCaster.off

Defined in

eventCaster.ts:120


on()

on(filter: string, callback: EventCallback): this

Attach the given callback to the EventCaster, triggered on events matching the given filter.

Parameters

filter: string

Event name filter to assign the listener to.

callback: EventCallback

Callback to call on a matching event being cast.

Returns

this

this, for chaining.

Inherited from

EventCaster.on

Defined in

eventCaster.ts:129


once()

once(filter: string, callback: EventCallback): this

Attach the given callback to the EventCaster, triggered on events matching the given filter, and removed upon being called once.

Parameters

filter: string

Event name filter to assign the listener to.

callback: EventCallback

Callback to call on a matching event being cast.

Returns

this

this, for chaining.

Inherited from

EventCaster.once

Defined in

eventCaster.ts:138


predefine()

predefine(name: string, callback: AnyFunction): Promise<void>

Add a predefined function to the VM’s list under the wrapped enclosure.

Parameters

name: string

Function name to add.

callback: AnyFunction

Function callback to use.

Returns

Promise<void>

A Promise that resolves with void if the Function was correctly predefined, and rejects with an Error in case errors occurred.

Defined in

vm.ts:413


unlink(target: string): Promise<boolean>

Unlink the wrapped enclosure from another, so that events cast on the wrapped enclosure are no longer handled in the other.

Parameters

target: string

“Destination” enclosure to use.

Returns

Promise<boolean>

A Promise that resolves with a boolean indicating whether the target enclosure was previously linked if enclosure unlinking completed successfully, and rejects with an Error in case errors occur.

Defined in

vm.ts:421


unmute()

unmute(): Promise<boolean>

Unmute the wrapped enclosure, so that events cast on it are propagated to wrapped VM.

Returns

Promise<boolean>

A Promise that resolves with he previous muting status if enclosure un-muting completed successfully, and rejects with an Error in case errors occur.

Defined in

vm.ts:428