Options
All
  • Public
  • Public/Protected
  • All
Menu

Class UI

Base class to be extended for different types of UI

Hierarchy

Index

Constructors

Protected constructor

  • new UI(fullFilename: string, destination: string, total: number): UI
  • Base constructor to be extended for UIs

    Parameters

    • fullFilename: string

      The filename in the format filename.extension

    • destination: string

      The path to store the file

    • total: number

      The total amount of bytes of the file to be transferred

    Returns UI

Properties

Private _destination

_destination: string

Private _fullFilename

_fullFilename: string

Private _screen

_screen: Screen
param

The blessed screen instance to be initialized

Private _total

_total: number

Accessors

destination

  • get destination(): string
  • Getter for destination

    Returns string

fullFilename

  • get fullFilename(): string
  • Getter for fullFilename

    Returns string

screen

  • get screen(): Screen
  • Getter for screen

    Returns Screen

total

  • get total(): number
  • Getter for the total amount of bytes

    Returns number

Methods

Abstract buildUI

  • buildUI(barOptions?: ContribWidgets.GaugeOptions, boxOptions?: BoxOptions): Status
  • Builds the initial UI

    Parameters

    • Optional barOptions: ContribWidgets.GaugeOptions

      Options for the gauge progress bar to be displayed in the UI

    • Optional boxOptions: BoxOptions

      Options for the text box to be displayed in the UI

    Returns Status

    The current Status of the rendered elements

Abstract updateUI

  • updateUI(status: Status, written: number, data: string | Buffer, isFinished: boolean): void
  • Updates the UI information

    Parameters

    • status: Status

      The current status object to be updated

    • written: number

      The amount of bytes written to the file

    • data: string | Buffer

      The amount of bytes transferred

    • isFinished: boolean

      Check if the download has finished

    Returns void

Generated using TypeDoc