Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Frame

Frame Class Provide the necessary string output to form a frame around any content

import { Frame } from '@maximva/examenopdracht-maximva'

enum DisplaySize {
     regular,
     large
}
const numberOfDigits = 5
const frame: Frame = new Frame(numberOfDigits, DisplaySize.large)
console.log(frame.getHorizontalEdge(EdgePosition.top)) // "__________"

Hierarchy

  • Frame

Index

Constructors

constructor

  • Create new instance of Frame

    Parameters

    • numberOfDigits: number

      the number of digits that need to fit in the frame

    • sizeSetting: DisplaySize

      the size to determine the width of a single digit

    Returns Frame

Properties

Private _padding

_padding: number = 2

Private _width

_width: number

numberOfDigits

numberOfDigits: number

the number of digits that need to fit in the frame

sizeSetting

sizeSetting: DisplaySize

the size to determine the width of a single digit

Accessors

padding

  • get padding(): string
  • Returns the necessary padding to insert before or after the content

    Returns string

Methods

getAffix

  • getAffix(affix: Affix): string
  • Return a string with a prefix or suffix to complete the frame along the side edges

    Parameters

    • affix: Affix

      To determine if it is a prefix or a suffix (comes before or after the content)

    Returns string

getHorizontalEdge

  • Return a string with a top or bottom edge with the width of the content + padding

    Parameters

    • position: EdgePosition

      To determine if it's the top or bottom edge

    Returns string

Generated using TypeDoc