T

CommandsHandle

The handle createCommands returns, scoped to one owner.

type CommandsHandle = { … }

Members

register<T>(commands: CommandTree<T>): () => void

Adds commands. Registering a root name this owner already has replaces that whole command. Returns a function that removes this call's commands; it is safe to call twice or after a sweep.

unregister(name: string): void

Removes this owner's root command name with its subcommands. Does nothing when there is none.

Removes every command of this owner.