Skip to content

Registry

In-memory store mapping command names to their definitions.

Registry.commands  :: {
{ [string]: command.CommandDefinition } }
Registry : set ( commandDefinition )  -> ()

Adds or overwrites a command definition keyed by its name.

Parameters

commandDefinition: CommandDefinition
Registry : remove ( name )  -> ()

Removes a command definition by name.

Parameters

name: string
Registry : get ( name )  -> CommandDefinition?

Returns the definition for a single command, or nil if not registered.

Parameters

name: string

Returns

CommandDefinition?
Registry : getAll ( )  -> { CommandDefinition }

Returns all registered command definitions as an array.

Returns

CommandDefinition }
Registry . new ( )  -> Registry

Constructs a new empty registry.

Returns

Registry