Skip to content

Type Alias: LazyCommand<G, D>

Lazy command interface.

Lazy command that's not loaded until it is executed.

Signature

ts
export type LazyCommand<
  G extends GunshiParamsConstraint = DefaultGunshiParams,
  D extends Partial<Command<G>> = {}
> = { (): Awaitable<Command<G> | CommandRunner<G>> } & (D extends { name: infer N } ? { commandName: N } : { commandName?: string }) & Omit<D, 'name' | 'run'> & Partial<Omit<Command<G>, keyof D | 'run' | 'name'>>

Type Parameters

NameDescription
G extends GunshiParamsConstraint = DefaultGunshiParamsThe Gunshi parameters constraint
D extends Partial<Command<G>> = {}The partial command definition provided to lazy function

Released under the MIT License.