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:676

Methods

getFlags

getFlags(...keys): boolean

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

boolean

Defined in

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


getOption

getOption(...keys): null | string

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

null | string

Defined in

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


getOptionResult

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

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

Option<string>

Defined in

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


getOptions

getOptions(...keys): null | readonly string[]

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

null | readonly string[]

Defined in

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


getOptionsResult

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

Parameters

NameTypeDescription
...keysreadonly string[]

Returns

Option<readonly string[]>

Defined in

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


missingArguments

Protected missingArguments(): Err<UserError>

Returns

Err<UserError>

Defined in

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


next

next(): string

Returns

string

Defined in

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

next<T>(cb): T

Type parameters

NameDescription
T-

Parameters

NameTypeDescription
cbArgsNextCallback<T>

Returns

T

Defined in

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


nextMaybe

nextMaybe(): Option<string>

Returns

Option<string>

Defined in

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

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:512


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:439

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:462

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:478


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:363

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:382

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:403


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:323

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:335


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:262

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:276


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:706


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:229

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:242


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:669


save

save(): void

Returns

void

Defined in

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


start

start(): Args

Returns

Args

Defined in

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


toJSON

toJSON(): ArgsJson

Returns

ArgsJson

Defined in

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


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:687


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:731


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:715


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:723