Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Screen

Screen class provides methods to access screen content of a systems main display

Hierarchy

  • Screen

Index

Constructors

Methods

Object literals

Constructors

constructor

Methods

capture

  • capture(fileName: string, fileFormat?: FileType, filePath?: string, fileNamePrefix?: string, fileNamePostfix?: string): Promise<string>
  • capture captures a screenshot of a systems main display

    Parameters

    • fileName: string

      Basename for the generated screenshot

    • Default value fileFormat: FileType = FileType.PNG

      The FileType for the generated screenshot

    • Default value filePath: string = cwd()

      The output path for the generated screenshot (Default: {@link cwd})

    • Default value fileNamePrefix: string = ""

      Filename prefix for the generated screenshot (Default: empty)

    • Default value fileNamePostfix: string = ""

      Filename postfix for the generated screenshot (Default: empty)

    Returns Promise<string>

find

height

  • height(): Promise<number>
  • height returns the main screen height This refers to the hardware resolution. Screens with higher pixel density (e.g. retina displays in MacBooks) might have a higher height in in actual pixels

    Returns Promise<number>

on

  • on registers a callback which is triggered once a certain template image is found

    Parameters

    Returns void

waitFor

width

  • width(): Promise<number>
  • width returns the main screen width This refers to the hardware resolution. Screens with higher pixel density (e.g. retina displays in MacBooks) might have a higher width in in actual pixels

    Returns Promise<number>

Object literals

config

config: object

Config object for Screen class

confidence

confidence: number = 0.99

Configures the required matching percentage for template images to be declared as a match

resourceDirectory

resourceDirectory: string = cwd()

Configures the path from which template images are loaded from