gunshi / definition / lazy
Function: lazy()
Define a lazy command with or without definition.
Param
A command loader function that returns a command definition
Param
An optional command definition
Call Signature
ts
function lazy<A>(loader): LazyCommand<{
args: A;
extensions: {
};
}>;Define a lazy command
Type Parameters
| Type Parameter |
|---|
A extends Args |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<{ args: A; extensions: { }; }> | A command loader |
Returns
LazyCommand<{ args: A; extensions: { }; }>
A lazy command loader
Call Signature
ts
function lazy<A>(loader, definition): LazyCommand<{
args: A;
extensions: {
};
}>;Define a lazy command with definition.
Type Parameters
| Type Parameter |
|---|
A extends Args |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<{ args: A; extensions: { }; }> | A command loader function that returns a command definition |
definition | Command<{ args: A; extensions: { }; }> | An optional command definition |
Returns
LazyCommand<{ args: A; extensions: { }; }>
A lazy command that can be executed later
Call Signature
ts
function lazy<E>(loader): LazyCommand<{
args: Args;
extensions: E;
}>;Define a lazy command
Type Parameters
| Type Parameter |
|---|
E extends ExtendContext |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<{ args: Args; extensions: E; }> | A command loader |
Returns
LazyCommand<{ args: Args; extensions: E; }>
A lazy command loader
Call Signature
ts
function lazy<E>(loader, definition): LazyCommand<{
args: Args;
extensions: E;
}>;Define a lazy command with definition.
Type Parameters
| Type Parameter |
|---|
E extends ExtendContext |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<{ args: Args; extensions: E; }> | A command loader function that returns a command definition |
definition | Command<{ args: Args; extensions: E; }> | An optional command definition |
Returns
LazyCommand<{ args: Args; extensions: E; }>
A lazy command that can be executed later
Call Signature
ts
function lazy<G>(loader): LazyCommand<G>;Define a lazy command
Type Parameters
| Type Parameter | Default type |
|---|---|
G extends GunshiParamsConstraint | DefaultGunshiParams |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<G> | A command loader |
Returns
LazyCommand<G>
A lazy command loader
Call Signature
ts
function lazy<G>(loader, definition): LazyCommand<G>;Define a lazy command with definition.
Type Parameters
| Type Parameter | Default type |
|---|---|
G extends GunshiParamsConstraint | DefaultGunshiParams |
Parameters
| Parameter | Type | Description |
|---|---|---|
loader | CommandLoader<G> | A command loader function that returns a command definition |
definition | Command<G> | An optional command definition |
Returns
LazyCommand<G>
A lazy command that can be executed later
