@lacrypta/nomad v0.0.0 / Enclosure
A VM enclosure interface wrapper object.
get enclosure(): string
Getter used to retrieve the wrapped enclosure.
string
get vm(): VM
Getter used to retrieve the wrapped VM.
execute(dependency: Dependency, args?: ArgumentsMap): Promise<unknown>
Execute the given Dependency with the given arguments map in the wrapped VM under the wrapped enclosure.
• dependency: Dependency
The Dependency to execute.
• args?: ArgumentsMap
The arguments map to execute with.
Promise
<unknown
>
A Promise that resolves with the Dependency’s execution result, and rejects with an Error in case errors occurred.
getSubEnclosures(depth?: number): Promise<string[]>
List the wrapped enclosure’s sub enclosures.
• depth?: number
Maximum enclosure depth to retrieve results for, defaults to retrieving all.
Promise
<string
[]>
A Promise that resolves with a list of sub enclosures if successful, and rejects with an Error in case errors occur.
install(dependency: Dependency): Promise<void>
Install the given Dependency on the wrapped VM under the wrapped enclosure.
• dependency: Dependency
The Dependency to install.
Promise
<void
>
A Promise that resolves with void
if the Dependency was correctly installed, and rejects with an Error in case errors occurred.
installAll(dependencies: Iterable<Dependency>): Promise<void>
Install the given Dependency iterable, by sorting them topologically and installing each one in turn.
• dependencies: Iterable
<Dependency
>
Dependencies to install.
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.
isMuted(): Promise<boolean>
Determine whether the wrapped enclosure is muted.
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.
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.
• target: string
“Destination” enclosure to use.
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.
listInstalled(): Promise<string[]>
List the dependencies (user-level and predefined) installed on the wrapped enclosure or its prefixes
Promise
<string
[]>
A Promise that resolves with a list of installed dependency names if successful, and rejects with an Error in case errors occur.
listLinkedFrom(): Promise<string[]>
List the enclosures that link to the wrapped one.
Promise
<string
[]>
A Promise that resolves with a list of linked-from enclosures if successful, and rejects with an Error in case errors occur.
listLinksTo(): Promise<string[]>
List the enclosures the wrapped one is linked to.
Promise
<string
[]>
A Promise that resolves with a list of linked-to enclosures if successful, and rejects with an Error in case errors occur.
mute(): Promise<boolean>
Mute the wrapped enclosure, so that events cast on it are no longer propagated to the wrapped VM.
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.
off(callback: EventCallback): this
Remove the given callback from the listeners set.
• callback: EventCallback
The callback to remove.
this
this
, for chaining.
on(filter: string, callback: EventCallback): this
Attach the given callback to the EventCaster, triggered on events matching the given filter.
• filter: string
Event name filter to assign the listener to.
• callback: EventCallback
Callback to call on a matching event being cast.
this
this
, for chaining.
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.
• filter: string
Event name filter to assign the listener to.
• callback: EventCallback
Callback to call on a matching event being cast.
this
this
, for chaining.
predefine(name: string, callback: AnyFunction): Promise<void>
Add a predefined function to the VM’s list under the wrapped enclosure.
• name: string
Function name to add.
• callback: AnyFunction
Function callback to use.
Promise
<void
>
A Promise that resolves with void
if the Function was correctly predefined, and rejects with an Error in case errors occurred.
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.
• target: string
“Destination” enclosure to use.
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.
unmute(): Promise<boolean>
Unmute the wrapped enclosure, so that events cast on it are propagated to wrapped VM.
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.