Options
All
  • Public
  • Public/Protected
  • All
Menu

Class InquirerInteractionHelper

Hierarchy

Index

Constructors

constructor

Properties

data

data: function

Type declaration

    • Parameters

      • s: string

      Returns Promise<string | false | DriverError>

Methods

arrowUntilFocused

  • arrowUntilFocused(client: Driver, focused: string, predicate: function, arrow?: string, limit?: number): Promise<string>
  • Parameters

    • client: Driver
    • focused: string
    • predicate: function
        • (s: string): boolean
        • Parameters

          • s: string

          Returns boolean

    • Optional arrow: string
    • Optional limit: number

    Returns Promise<string>

clear

  • clear(): Promise<void>

commandTaking

  • commandTaking(ms: number, exitCode?: number, stdout?: string, stderr?: string): string
  • Parameters

    • ms: number
    • Optional exitCode: number
    • Optional stdout: string
    • Optional stderr: string

    Returns string

currentNotSelected

  • currentNotSelected(): Promise<string>
  • Returns Promise<string>

currentNotSelectedString

  • currentNotSelectedString(s: string): string
  • Parameters

    • s: string

    Returns string

currentSelected

  • currentSelected(): Promise<string>
  • Returns Promise<string>

destroy

  • destroy(): void

down

  • down(n: number): Promise<void>
  • Parameters

    • n: number

    Returns Promise<void>

execCommandTaking

  • execCommandTaking(ms: number, exitCode?: number, stdout?: string, stderr?: string): Promise<void>
  • Parameters

    • ms: number
    • Optional exitCode: number
    • Optional stdout: string
    • Optional stderr: string

    Returns Promise<void>

focusCheckboxListItem

  • focusCheckboxListItem(label: string): Promise<string>
  • Parameters

    • label: string

    Returns Promise<string>

focusFile

  • focusFile(codeFix: string): Promise<string>
  • Parameters

    • codeFix: string

    Returns Promise<string>

focusListItem

  • focusListItem(label: string): Promise<string>
  • Parameters

    • label: string

    Returns Promise<string>

getLastExitCode

  • getLastExitCode(): Promise<number>
  • Returns last process exit code or undefined if not possible. IMPORTANT: relies on $? and echo so most probably only works in unix (tested on macOs and Linux).

    This is useful on interactive applications that inquire some data and finally do some processing, in which they could fail with an excepiton. no matter if the processing takes time, we enter echo $? commands with an identifier that will be only executed after the application exits returning its exit code.

    However notice that while the app is running, althouhg not executed we are still writing to its stdin so use it when you know the app is no longer litening for relevant data, just makind final processing and exit, this is by waiting some time or in those cases where a key combination was presend to exit (q).

    TODO: example with "more" command

    Returns Promise<number>

getStrippedALlData

  • getStrippedALlData(): Promise<string>

isCodeFixOptionNotSelected

  • isCodeFixOptionNotSelected(option: string): Promise<boolean>
  • Parameters

    • option: string

    Returns Promise<boolean>

selected

  • selected(): Promise<string>
  • Returns Promise<string>

unSelectAll

  • unSelectAll(limit?: number): Promise<void>
  • Parameters

    • Optional limit: number

    Returns Promise<void>

waitForStrippedDataToInclude

  • waitForStrippedDataToInclude(s: string): Promise<string | false | DriverError>

Generated using TypeDoc