Registry
In-memory store mapping command names to their definitions.
Summary
Methods
Registry:set(commandDefinition: command.CommandDefinition)Registry:remove(name: string)Registry:get(name: string) → command.CommandDefinition?Registry:getAll() → { command.CommandDefinition }Functions
Registry.new() → RegistryProperties
Section titled “Properties”commands
Section titled “commands” Registry.commands :: {
{ [string]: command.CommandDefinition } }
{ [string]: command.CommandDefinition } }
Methods
Section titled “Methods”Registry : set ( commandDefinition ) -> ()
Adds or overwrites a command definition keyed by its name.
Parameters
| commandDefinition: CommandDefinition |
remove
Section titled “remove”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? |
getAll
Section titled “getAll”Registry : getAll ( ) -> { CommandDefinition }
Returns all registered command definitions as an array.
Returns
| CommandDefinition } |
Functions
Section titled “Functions”Registry . new ( ) -> Registry
Constructs a new empty registry.
Returns
| Registry |