Options
All
  • Public
  • Public/Protected
  • All
Menu

@nut-tree/nut-js

Index

Type aliases

FindHookCallback

FindHookCallback: (target: MatchResult) => Promise<void>

Type declaration

StringOrKey

StringOrKey: string[] | Key[]

Variables

libnut

libnut: "/home/runner/work/nut.js/nut.js/node_modules/@nut-tree/libnut/index"

Functions

Const busyWaitForNanoSeconds

  • busyWaitForNanoSeconds(duration: number): Promise<unknown>

Const centerOf

Const createMovementApi

createResultForInvalidSearch

Const createWindowApi

debugImage

  • debugImage(image: Mat, filename: string, suffix?: undefined | string): void

determineROI

determineScaledSearchRegion

Const fromImageWithAlphaChannel

  • fromImageWithAlphaChannel(img: Image, roi?: Region): Promise<Mat>
  • fromImageWithAlphaChannel should provide a way to create a library specific image with alpha channel from an abstract Image object holding raw data and image dimension

    memberof

    VisionProviderInterface

    Parameters

    Returns Promise<Mat>

    An image

Const fromImageWithoutAlphaChannel

  • fromImageWithoutAlphaChannel(img: Image, roi?: Region): Promise<Mat>
  • fromImageWithoutAlphaChannel should provide a way to create a library specific image without alpha channel from an abstract Image object holding raw data and image dimension

    memberof

    VisionProviderInterface

    Parameters

    Returns Promise<Mat>

    An image

Const generateOutputPath

  • generateOutputPath(filename: string, params?: undefined | { path?: undefined | string; postfix?: undefined | string; prefix?: undefined | string; type?: FileType }): string
  • generateOutputPath is used to assemble full file path from a filename and various parameters

    Parameters

    • filename: string

      The base filename

    • Optional params: undefined | { path?: undefined | string; postfix?: undefined | string; prefix?: undefined | string; type?: FileType }

      A config object which allows to configure FileType, base path, filename prefix and filename postfix

    Returns string

Const inputIsString

  • inputIsString(input: string[] | Key[]): input is string[]

isValidSearch

  • isValidSearch(needle: Mat, haystack: Mat): boolean

Const linear

  • linear(amountOfSteps: number, speedInPixelsPerSecond: number): number[]

loadHaystack

loadNeedle

  • loadNeedle(image: Image): Promise<Mat>

lowerBound

  • lowerBound(value: number, boundary: number, minValue: number): number

matchImages

  • matchImages(haystack: Mat, needle: Mat): Promise<MatchResult>

Const randomPointIn

scaleImage

  • scaleImage(image: Mat, scaleFactor: number): Promise<Mat>

scaleLocation

  • scaleLocation(result: Region, scaleFactor: number): Region

Const sleep

  • sleep(ms: number): Promise<unknown>

timeout

  • timeout<R>(updateIntervalMs: number, maxDurationMs: number, action: (...params: any) => Promise<R>, config?: TimoutConfig): Promise<R>
  • Type parameters

    • R

    Parameters

    • updateIntervalMs: number
    • maxDurationMs: number
    • action: (...params: any) => Promise<R>
        • (...params: any): Promise<R>
        • Parameters

          • Rest ...params: any

          Returns Promise<R>

    • Optional config: TimoutConfig

    Returns Promise<R>

Const toBeAt

  • toBeAt(received: Mouse, position: Point): Promise<{ pass: boolean; message: any }>

Const toBeIn

  • toBeIn(received: Mouse, region: Region): Promise<{ pass: boolean; message: any }>

Const toShow

  • toShow(received: Screen, needle: string, confidence?: undefined | number): Promise<{ pass: boolean; message: any }>

upperBound

  • upperBound(value: number, boundary: number, maxValue: number): number

Object literals

Const jestMatchers

jestMatchers: object

toBeAt

toBeAt: toBeAt

toBeIn

toBeIn: toBeIn

toShow

toShow: toShow