Skip to main content

Class: Args

Constructors

constructor

new Args(message, command, parser, context)

Parameters

NameType
messageMessage<boolean>
commandMessageCommand
parserArgumentStream
contextMessageCommandContext

Defined in

projects/framework/src/lib/parsers/Args.ts:58

Properties

command

Readonly command: MessageCommand

Defined in

projects/framework/src/lib/parsers/Args.ts:39


commandContext

Readonly commandContext: MessageCommandContext

Defined in

projects/framework/src/lib/parsers/Args.ts:44


message

Readonly message: Message<boolean>

Defined in

projects/framework/src/lib/parsers/Args.ts:34


parser

Protected Readonly parser: ArgumentStream

Defined in

projects/framework/src/lib/parsers/Args.ts:49


states

Private Readonly states: State[] = []

Defined in

projects/framework/src/lib/parsers/Args.ts:56

Accessors

finished

get finished(): boolean

Returns

boolean

Defined in

projects/framework/src/lib/parsers/Args.ts:632

Methods

getFlags

getFlags(...keys): boolean

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

boolean

Defined in

projects/framework/src/lib/parsers/Args.ts:569


getOption

getOption(...keys): Option<string>

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

Option<string>

Defined in

projects/framework/src/lib/parsers/Args.ts:589


getOptions

getOptions(...keys): Option<readonly string[]>

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

Option<readonly string[]>

Defined in

projects/framework/src/lib/parsers/Args.ts:609


missingArguments

Protected missingArguments(): Err<UserError>

Returns

Err<UserError>

Defined in

projects/framework/src/lib/parsers/Args.ts:654


next

next(): string

Returns

string

Defined in

projects/framework/src/lib/parsers/Args.ts:530

next<T>(cb): T

Type parameters

NameDescription
T-

Parameters

NameTypeDescription
cbArgsNextCallback<T>

Returns

T

Defined in

projects/framework/src/lib/parsers/Args.ts:547


nextMaybe

nextMaybe(): Option<string>

Returns

Option<string>

Defined in

projects/framework/src/lib/parsers/Args.ts:497

nextMaybe<T>(cb): Option<T>

Type parameters

NameDescription
T-

Parameters

NameTypeDescription
cbArgsNextCallback<T>

Returns

Option<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:515


peek

peek<T>(type): Promise<T>

Type parameters

Name
T

Parameters

NameTypeDescription
type() => Result<T>

Returns

Promise<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:442

peek<T>(type, options?): Promise<T>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:465

peek<K>(type, options?): Promise<ArgType[K]>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK | () => Result<ArgType[K]>
options?ArgOptions-

Returns

Promise<ArgType[K]>

Defined in

projects/framework/src/lib/parsers/Args.ts:481


peekResult

peekResult<T>(type): Promise<ResultType<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
type() => Result<T>

Returns

Promise<ResultType<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:366

peekResult<T>(type, options?): Promise<ResultType<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<ResultType<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:385

peekResult<K>(type, options?): Promise<ResultType<ArgType[K]>>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK | () => Awaitable<Result<ArgType[K]>>
options?ArgOptions-

Returns

Promise<ResultType<ArgType[K]>>

Defined in

projects/framework/src/lib/parsers/Args.ts:406


pick

pick<T>(type, options?): Promise<T>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:147

pick<K>(type, options?): Promise<ArgType[K]>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?ArgOptions-

Returns

Promise<ArgType[K]>

Defined in

projects/framework/src/lib/parsers/Args.ts:160


pickResult

pickResult<T>(type, options?): Promise<ResultType<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<ResultType<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:91

pickResult<K>(type, options?): Promise<ResultType<ArgType[K]>>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?ArgOptions-

Returns

Promise<ResultType<ArgType[K]>>

Defined in

projects/framework/src/lib/parsers/Args.ts:108


repeat

repeat<T>(type, options?): Promise<T[]>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?RepeatArgOptions-

Returns

Promise<T[]>

Defined in

projects/framework/src/lib/parsers/Args.ts:326

repeat<K>(type, options?): Promise<ArgType[K][]>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?RepeatArgOptions-

Returns

Promise<ArgType[K][]>

Defined in

projects/framework/src/lib/parsers/Args.ts:338


repeatResult

repeatResult<T>(type, options?): Promise<ArrayResultType<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?RepeatArgOptions-

Returns

Promise<ArrayResultType<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:265

repeatResult<K>(type, options?): Promise<ArrayResultType<ArgType[K]>>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?RepeatArgOptions-

Returns

Promise<ArrayResultType<ArgType[K]>>

Defined in

projects/framework/src/lib/parsers/Args.ts:279


resolveArgument

Private resolveArgument<T>(arg): undefined | IArgument<T>

Type parameters

Name
T

Parameters

NameTypeDescription
argkeyof ArgType | IArgument<T>

Returns

undefined | IArgument<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:662


rest

rest<T>(type, options?): Promise<T>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:232

rest<K>(type, options?): Promise<ArgType[K]>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?ArgOptions-

Returns

Promise<ArgType[K]>

Defined in

projects/framework/src/lib/parsers/Args.ts:245


restResult

restResult<T>(type, options?): Promise<ResultType<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
typeIArgument<T>
options?ArgOptions-

Returns

Promise<ResultType<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:180

restResult<K>(type, options?): Promise<ResultType<ArgType[K]>>

Type parameters

NameType
Kextends keyof ArgType

Parameters

NameTypeDescription
typeK
options?ArgOptions-

Returns

Promise<ResultType<ArgType[K]>>

Defined in

projects/framework/src/lib/parsers/Args.ts:197


restore

restore(): void

Returns

void

Defined in

projects/framework/src/lib/parsers/Args.ts:625


save

save(): void

Returns

void

Defined in

projects/framework/src/lib/parsers/Args.ts:617


start

start(): Args

Returns

Args

Defined in

projects/framework/src/lib/parsers/Args.ts:68


toJSON

toJSON(): Object

Returns

Object

NameType
commandMessageCommand
commandContextMessageCommandContext
messageMessage<boolean>

Defined in

projects/framework/src/lib/parsers/Args.ts:639


unavailableArgument

Protected unavailableArgument<T>(type): Err<UserError>

Type parameters

Name
T

Parameters

NameType
typestring | IArgument<T>

Returns

Err<UserError>

Defined in

projects/framework/src/lib/parsers/Args.ts:643


error

Static error<T>(options): Err<ArgumentError<T>>

Type parameters

Name
T

Parameters

NameTypeDescription
optionsOptions<T>

Returns

Err<ArgumentError<T>>

Defined in

projects/framework/src/lib/parsers/Args.ts:687


make

Static make<T>(cb, name?): IArgument<T>

Type parameters

Name
T

Parameters

NameTypeDefault valueDescription
cb(parameter: string, context: Context<T>) => AwaitableResult<T>undefined
namestring''-

Returns

IArgument<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:671


ok

Static ok<T>(value): Ok<T>

Type parameters

Name
T

Parameters

NameTypeDescription
valueT

Returns

Ok<T>

Defined in

projects/framework/src/lib/parsers/Args.ts:679