Skip to main content Link Search Menu Expand Document (external link)

Usage overview

Added in v1.0.0


Table of contents


combinators

alternation

Signature

export declare const alternation: { (that: Usage): (self: Usage) => Usage; (self: Usage, that: Usage): Usage }

Added in v1.0.0

concat

Signature

export declare const concat: { (that: Usage): (self: Usage) => Usage; (self: Usage, that: Usage): Usage }

Added in v1.0.0

getHelp

Signature

export declare const getHelp: (self: Usage) => HelpDoc

Added in v1.0.0

optional

Signature

export declare const optional: (self: Usage) => Usage

Added in v1.0.0

repeated

Signature

export declare const repeated: (self: Usage) => Usage

Added in v1.0.0

constructors

empty

Signature

export declare const empty: Usage

Added in v1.0.0

enumerate

Signature

export declare const enumerate: {
  (config: CliConfig): (self: Usage) => Array<Span>
  (self: Usage, config: CliConfig): Array<Span>
}

Added in v1.0.0

mixed

Signature

export declare const mixed: Usage

Added in v1.0.0

named

Signature

export declare const named: (names: ReadonlyArray<string>, acceptedValues: Option<string>) => Usage

Added in v1.0.0

models

Alternation (interface)

Signature

export interface Alternation {
  readonly _tag: "Alternation"
  readonly left: Usage
  readonly right: Usage
}

Added in v1.0.0

Concat (interface)

Signature

export interface Concat {
  readonly _tag: "Concat"
  readonly left: Usage
  readonly right: Usage
}

Added in v1.0.0

Empty (interface)

Signature

export interface Empty {
  readonly _tag: "Empty"
}

Added in v1.0.0

Mixed (interface)

Signature

export interface Mixed {
  readonly _tag: "Mixed"
}

Added in v1.0.0

Named (interface)

Signature

export interface Named {
  readonly _tag: "Named"
  readonly names: ReadonlyArray<string>
  readonly acceptedValues: Option<string>
}

Added in v1.0.0

Optional (interface)

Signature

export interface Optional {
  readonly _tag: "Optional"
  readonly usage: Usage
}

Added in v1.0.0

Repeated (interface)

Signature

export interface Repeated {
  readonly _tag: "Repeated"
  readonly usage: Usage
}

Added in v1.0.0

Usage (type alias)

Signature

export type Usage = Empty | Mixed | Named | Optional | Repeated | Alternation | Concat

Added in v1.0.0