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

Hierarchy

  • ScreenClass

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>

  • findAll will search for every occurrence of a given search input on a systems main screen

    Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    Returns Promise<Region[]>

  • Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    • searchInput: { by: { color: RGBA }; id: string; type: "color" } | Promise<{ by: { color: RGBA }; id: string; type: "color" }>
    • Optional params: OptionalSearchParameters<PROVIDER_DATA_TYPE>

    Returns Promise<Point[]>

  • Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    • searchInput: { by: { title: string | RegExp }; id: string; type: "window" } | Promise<{ by: { title: string | RegExp }; id: string; type: "window" }>
    • Optional params: OptionalSearchParameters<PROVIDER_DATA_TYPE>

    Returns Promise<Window[]>

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

  • waitFor searches for a template image for a specified duration

    Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    • searchInput: RegionResultFindInput | Promise<RegionResultFindInput>

      Filename of the template image, relative to ScreenClass.config.resourceDirectory, or an Image

    • Optional timeoutMs: number

      Timeout in milliseconds after which waitFor fails

    • Optional updateInterval: number

      Update interval in milliseconds to retry search

    • Optional params: OptionalSearchParameters<PROVIDER_DATA_TYPE>

      OptionalSearchParameters which are used to fine tune search region and / or match confidence

    Returns Promise<Region>

  • Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    • searchInput: { by: { color: RGBA }; id: string; type: "color" } | Promise<{ by: { color: RGBA }; id: string; type: "color" }>
    • Optional timeoutMs: number
    • Optional updateInterval: number
    • Optional params: OptionalSearchParameters<PROVIDER_DATA_TYPE>

    Returns Promise<Point>

  • Type Parameters

    Type Parameters

    • PROVIDER_DATA_TYPE

    Parameters

    • searchInput: { by: { title: string | RegExp }; id: string; type: "window" } | Promise<{ by: { title: string | RegExp }; id: string; type: "window" }>
    • Optional timeoutMs: number
    • Optional updateInterval: number
    • Optional params: OptionalSearchParameters<PROVIDER_DATA_TYPE>

    Returns Promise<Window>

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