Skip to content

Interface: SubCommandable

Sub-command entry type for use in subCommands.

This type uses a loose structural match to bypass TypeScript's contravariance issues with function parameters, allowing any Command or LazyCommand to be used as a sub-command.

Since

v0.27.1

Signature

ts
export interface SubCommandable

Indexable

ts
[key: string]: any

Index signature to allow additional properties

Properties

NameTypeDescription
args (optional)Args | Record<string, any>see Command.args
commandName (optional)stringsee LazyCommand.commandName
description (optional)stringsee Command.description
entry (optional)booleansee Command.entry
examples (optional)string | ((...args: any[]) => any)see Command.examples
internal (optional)booleansee Command.internal
name (optional)stringsee Command.name
rendering (optional)anysee Command.rendering
run (optional)(...args: any[]) => anysee Command.run
subCommands (optional)Record<string, any> | Map<string, any>Nested sub-commands for this command. Since v0.28.0
toKebab (optional)booleansee Command.toKebab

run Parameters

NameTypeDescription
argsany[]

run Returns

any

Released under the MIT License.