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

Constructors

Properties

config: ScreenConfig = ...

Methods

  • capture captures a screenshot of a systems main display

    Parameters

    • fileName: string

      Basename for the generated screenshot

    • fileFormat: FileType = FileType.PNG

      The FileType for the generated screenshot

    • filePath: string = ...

      The output path for the generated screenshot (Default: cwd)

    • fileNamePrefix: string = ""

      Filename prefix for the generated screenshot (Default: empty)

    • fileNamePostfix: string = ""

      Filename postfix for the generated screenshot (Default: empty)

    Returns Promise<string>

  • captureRegion captures a screenshot of a region on the systems main display

    Parameters

    • fileName: string

      Basename for the generated screenshot

    • regionToCapture: Region | Promise<Region>

      The region of the screen to capture in the screenshot

    • fileFormat: FileType = FileType.PNG

      The FileType for the generated screenshot

    • filePath: string = ...

      The output path for the generated screenshot (Default: cwd)

    • fileNamePrefix: string = ""

      Filename prefix for the generated screenshot (Default: empty)

    • fileNamePostfix: string = ""

      Filename postfix for the generated screenshot (Default: empty)

    Returns Promise<string>

  • 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>

  • 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>

Generated using TypeDoc