UNPKG

@jondotsoy/flags

Version:

A Javascript arguments processor

19 lines (18 loc) 1.09 kB
import { Builder } from "./Builder.js"; import { Spec, type ParseResultType, type RedefineInitialValue, type RedefineParseResult } from "./Spec.js"; import type { Accumulate } from "../dtos/Accumulate.js"; import type { Refine } from "../dtos/Refine.js"; import { BooleanCommandBuilder } from "./BooleanCommandBuilder.js"; export declare class CommandBuilder<T extends Spec<any, any>> extends Builder<T> { initial<U>(initial: U): CommandBuilder<RedefineInitialValue<T, U>>; accumulate(accumulate: Accumulate): CommandBuilder<T>; refine<U>(refine: Refine): CommandBuilder<RedefineParseResult<T, U>>; metadata(values: Record<string, any>): CommandBuilder<T>; describe(description: string): CommandBuilder<T>; required(): CommandBuilder<T>; string(): this; boolean(): BooleanCommandBuilder<Spec<boolean, boolean>>; transform<T>(transform: (value: ParseResultType<this["spec"]>) => T): CommandBuilder<Spec<any, T>>; restArgs(): CommandBuilder<RedefineParseResult<T, string[]>>; static create(argumentMatch: string): CommandBuilder<Spec<null, string>>; }