gunshi / context / createCommandContext
Function: createCommandContext()
ts
function createCommandContext<G, V, C, E>(param): Promise<object extends ExtractExtensions<E> ? Readonly<CommandContext<G>> : Readonly<CommandContext<GunshiParams<{
args: G["args"];
extensions: ExtractExtensions<E>;
}>>>>;
Create a command context
Type Parameters
Type Parameter | Default type |
---|---|
G extends GunshiParams <any > | DefaultGunshiParams |
V extends object | ArgValues <G ["args" ]> |
C extends | Command <G > | LazyCommand <G > | Command <G > |
E extends Record <string , CommandContextExtension <{ }>> | object |
Parameters
Parameter | Type | Description |
---|---|---|
param | CommandContextParams <G , V , C , E > | A CommandContextParams | parameters to create a command context |
Returns
Promise
<object
extends ExtractExtensions
<E
> ? Readonly
<CommandContext
<G
>> : Readonly
<CommandContext
<GunshiParams
<{ args
: G
["args"
]; extensions
: ExtractExtensions
<E
>; }>>>>
A command context, which is readonly