Options
All
  • Public
  • Public/Protected
  • All
Menu

Class to generate UIs for downloading files

extends

UI

Hierarchy

  • UI
    • DownloadUI

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new DownloadUI(fullFilename: string, destination: string, total: number): DownloadUI
  • Instantiate a new DownloadUI

    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 DownloadUI

Properties

Private _getSpeed

_getSpeed: Function

Accessors

destination

  • get destination(): string

fullFilename

  • get fullFilename(): string

screen

  • get screen(): Screen

speed

  • get speed(): Function

total

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

    Returns number

Methods

buildUI

  • buildUI(barOptions?: ContribWidgets.GaugeOptions, boxOptions?: BoxOptions): Status
  • DownloadUI implementation of buildUI

    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

updateUI

  • updateUI(status: Status, written: number, data: string | Buffer, isFinished: boolean): void
  • DownloadUI implementation of updateUI

    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