mirror of
https://github.com/Mintplex-Labs/nut.js.git
synced 2026-07-21 01:15:22 -04:00
643 lines
36 KiB
HTML
643 lines
36 KiB
HTML
<!doctype html>
|
|
<html class="default no-js">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<title>Screen | @nut-tree/nut-js</title>
|
|
<meta name="description" content="Documentation for @nut-tree/nut-js">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<link rel="stylesheet" href="../assets/css/main.css">
|
|
</head>
|
|
<body>
|
|
<header>
|
|
<div class="tsd-page-toolbar">
|
|
<div class="container">
|
|
<div class="table-wrap">
|
|
<div class="table-cell" id="tsd-search" data-index="../assets/js/search.json" data-base="..">
|
|
<div class="field">
|
|
<label for="tsd-search-field" class="tsd-widget search no-caption">Search</label>
|
|
<input id="tsd-search-field" type="text" />
|
|
</div>
|
|
<ul class="results">
|
|
<li class="state loading">Preparing search index...</li>
|
|
<li class="state failure">The search index is not available</li>
|
|
</ul>
|
|
<a href="../index.html" class="title">@nut-tree/nut-js</a>
|
|
</div>
|
|
<div class="table-cell" id="tsd-widgets">
|
|
<div id="tsd-filter">
|
|
<a href="#" class="tsd-widget options no-caption" data-toggle="options">Options</a>
|
|
<div class="tsd-filter-group">
|
|
<div class="tsd-select" id="tsd-filter-visibility">
|
|
<span class="tsd-select-label">All</span>
|
|
<ul class="tsd-select-list">
|
|
<li data-value="public">Public</li>
|
|
<li data-value="protected">Public/Protected</li>
|
|
<li data-value="private" class="selected">All</li>
|
|
</ul>
|
|
</div>
|
|
<input type="checkbox" id="tsd-filter-inherited" checked />
|
|
<label class="tsd-widget" for="tsd-filter-inherited">Inherited</label>
|
|
</div>
|
|
</div>
|
|
<a href="#" class="tsd-widget menu no-caption" data-toggle="menu">Menu</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="tsd-page-title">
|
|
<div class="container">
|
|
<ul class="tsd-breadcrumb">
|
|
<li>
|
|
<a href="../globals.html">Globals</a>
|
|
</li>
|
|
<li>
|
|
<a href="screen.html">Screen</a>
|
|
</li>
|
|
</ul>
|
|
<h1>Class Screen</h1>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<div class="container container-main">
|
|
<div class="row">
|
|
<div class="col-8 col-content">
|
|
<section class="tsd-panel tsd-comment">
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html">Screen</a> class provides methods to access screen content of a systems main display</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-hierarchy">
|
|
<h3>Hierarchy</h3>
|
|
<ul class="tsd-hierarchy">
|
|
<li>
|
|
<span class="target">Screen</span>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-index-group">
|
|
<h2>Index</h2>
|
|
<section class="tsd-panel tsd-index-panel">
|
|
<div class="tsd-index-content">
|
|
<section class="tsd-index-section ">
|
|
<h3>Constructors</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><a href="screen.html#constructor" class="tsd-kind-icon">constructor</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Methods</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#capture" class="tsd-kind-icon">capture</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#captureregion" class="tsd-kind-icon">capture<wbr>Region</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#find" class="tsd-kind-icon">find</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#height" class="tsd-kind-icon">height</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#highlight" class="tsd-kind-icon">highlight</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#on" class="tsd-kind-icon">on</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#waitfor" class="tsd-kind-icon">wait<wbr>For</a></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><a href="screen.html#width" class="tsd-kind-icon">width</a></li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-index-section ">
|
|
<h3>Object literals</h3>
|
|
<ul class="tsd-index-list">
|
|
<li class="tsd-kind-object-literal tsd-parent-kind-class"><a href="screen.html#config" class="tsd-kind-icon">config</a></li>
|
|
</ul>
|
|
</section>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Constructors</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-constructor tsd-parent-kind-class">
|
|
<a name="constructor" class="tsd-anchor"></a>
|
|
<h3>constructor</h3>
|
|
<ul class="tsd-signatures tsd-kind-constructor tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">new <wbr>Screen<span class="tsd-signature-symbol">(</span>vision<span class="tsd-signature-symbol">: </span><a href="visionadapter.html" class="tsd-signature-type">VisionAdapter</a>, findHooks<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../globals.html#findhookcallback" class="tsd-signature-type">FindHookCallback</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><a href="screen.html" class="tsd-signature-type">Screen</a></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L47">screen.class.ts:47</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html">Screen</a> class constructor</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>vision: <a href="visionadapter.html" class="tsd-signature-type">VisionAdapter</a></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="visionadapter.html">VisionAdapter</a> instance which bundles access to screen and / or computer vision related APIs</p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> findHooks: <span class="tsd-signature-type">Map</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">, </span><a href="../globals.html#findhookcallback" class="tsd-signature-type">FindHookCallback</a><span class="tsd-signature-symbol">[]</span><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol"> = new Map<string, FindHookCallback[]>()</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>A {@link Map} of <a href="../globals.html#findhookcallback">FindHookCallback</a> methods assigned to a template image filename</p>
|
|
</div>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <a href="screen.html" class="tsd-signature-type">Screen</a></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Methods</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="capture" class="tsd-anchor"></a>
|
|
<h3>capture</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">capture<span class="tsd-signature-symbol">(</span>fileName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, fileFormat<span class="tsd-signature-symbol">?: </span><a href="../enums/filetype.html" class="tsd-signature-type">FileType</a>, filePath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, fileNamePrefix<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, fileNamePostfix<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L195">screen.class.ts:195</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#capture">capture</a> captures a screenshot of a systems main display</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>fileName: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Basename for the generated screenshot</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileFormat: <a href="../enums/filetype.html" class="tsd-signature-type">FileType</a><span class="tsd-signature-symbol"> = FileType.PNG</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The <a href="../enums/filetype.html">FileType</a> for the generated screenshot</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> filePath: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = cwd()</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The output path for the generated screenshot (Default: {@link cwd})</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileNamePrefix: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ""</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename prefix for the generated screenshot (Default: empty)</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileNamePostfix: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ""</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename postfix for the generated screenshot (Default: empty)</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="captureregion" class="tsd-anchor"></a>
|
|
<h3>capture<wbr>Region</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">capture<wbr>Region<span class="tsd-signature-symbol">(</span>fileName<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, regionToCapture<span class="tsd-signature-symbol">: </span><a href="region.html" class="tsd-signature-type">Region</a>, fileFormat<span class="tsd-signature-symbol">?: </span><a href="../enums/filetype.html" class="tsd-signature-type">FileType</a>, filePath<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, fileNamePrefix<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span>, fileNamePostfix<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L220">screen.class.ts:220</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#captureregion">captureRegion</a> captures a screenshot of a region on the systems main display</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>fileName: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Basename for the generated screenshot</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>regionToCapture: <a href="region.html" class="tsd-signature-type">Region</a></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The region of the screen to capture in the screenshot</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileFormat: <a href="../enums/filetype.html" class="tsd-signature-type">FileType</a><span class="tsd-signature-symbol"> = FileType.PNG</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The <a href="../enums/filetype.html">FileType</a> for the generated screenshot</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> filePath: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = cwd()</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The output path for the generated screenshot (Default: {@link cwd})</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileNamePrefix: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ""</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename prefix for the generated screenshot (Default: empty)</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> fileNamePostfix: <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = ""</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename postfix for the generated screenshot (Default: empty)</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">string</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="find" class="tsd-anchor"></a>
|
|
<h3>find</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">find<span class="tsd-signature-symbol">(</span>templateImageFilename<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, params<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">LocationParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L82">screen.class.ts:82</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#find">find</a> will search for a template image on a systems main screen</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>templateImageFilename: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename of the template image, relative to <a href="screen.html#config.resourcedirectory">Screen.config.resourceDirectory</a></p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagOptional">Optional</span> params: <span class="tsd-signature-type">LocationParameters</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>{@link LocationParameters} which are used to fine tune search region and / or match confidence</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="height" class="tsd-anchor"></a>
|
|
<h3>height</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">height<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L73">screen.class.ts:73</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#height">height</a> 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</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="highlight" class="tsd-anchor"></a>
|
|
<h3>highlight</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">highlight<span class="tsd-signature-symbol">(</span>regionToHighlight<span class="tsd-signature-symbol">: </span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L157">screen.class.ts:157</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#highlight">highlight</a> highlights a screen <a href="region.html">Region</a> for a certain duration by overlaying it with an opaque highlight window</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>regionToHighlight: <a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol"> | </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The <a href="region.html">Region</a> to highlight</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="on" class="tsd-anchor"></a>
|
|
<h3>on</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">on<span class="tsd-signature-symbol">(</span>templateImageFilename<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, callback<span class="tsd-signature-symbol">: </span><a href="../globals.html#findhookcallback" class="tsd-signature-type">FindHookCallback</a><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">void</span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L182">screen.class.ts:182</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#on">on</a> registeres a callback which is triggered once a certain template image is found</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>templateImageFilename: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Template image to trigger the callback on</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5>callback: <a href="../globals.html#findhookcallback" class="tsd-signature-type">FindHookCallback</a></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>The <a href="../globals.html#findhookcallback">FindHookCallback</a> function to trigger</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">void</span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="waitfor" class="tsd-anchor"></a>
|
|
<h3>wait<wbr>For</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">wait<wbr>For<span class="tsd-signature-symbol">(</span>templateImageFilename<span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">string</span>, timeoutMs<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">number</span>, params<span class="tsd-signature-symbol">?: </span><span class="tsd-signature-type">LocationParameters</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L169">screen.class.ts:169</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#waitfor">waitFor</a> searches for a template image for a specified duration</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-parameters-title">Parameters</h4>
|
|
<ul class="tsd-parameters">
|
|
<li>
|
|
<h5>templateImageFilename: <span class="tsd-signature-type">string</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Filename of the template image, relative to <a href="screen.html#config.resourcedirectory">Screen.config.resourceDirectory</a></p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagDefault value">Default value</span> timeoutMs: <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 5000</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>Timeout in milliseconds after which <a href="screen.html#waitfor">waitFor</a> fails</p>
|
|
</div>
|
|
</li>
|
|
<li>
|
|
<h5><span class="tsd-flag ts-flagOptional">Optional</span> params: <span class="tsd-signature-type">LocationParameters</span></h5>
|
|
<div class="tsd-comment tsd-typography">
|
|
<p>{@link LocationParameters} which are used to fine tune search region and / or match confidence</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><a href="region.html" class="tsd-signature-type">Region</a><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-method tsd-parent-kind-class">
|
|
<a name="width" class="tsd-anchor"></a>
|
|
<h3>width</h3>
|
|
<ul class="tsd-signatures tsd-kind-method tsd-parent-kind-class">
|
|
<li class="tsd-signature tsd-kind-icon">width<span class="tsd-signature-symbol">(</span><span class="tsd-signature-symbol">)</span><span class="tsd-signature-symbol">: </span><span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></li>
|
|
</ul>
|
|
<ul class="tsd-descriptions">
|
|
<li class="tsd-description">
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L64">screen.class.ts:64</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p><a href="screen.html#width">width</a> 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</p>
|
|
</div>
|
|
</div>
|
|
<h4 class="tsd-returns-title">Returns <span class="tsd-signature-type">Promise</span><span class="tsd-signature-symbol"><</span><span class="tsd-signature-type">number</span><span class="tsd-signature-symbol">></span></h4>
|
|
</li>
|
|
</ul>
|
|
</section>
|
|
</section>
|
|
<section class="tsd-panel-group tsd-member-group ">
|
|
<h2>Object literals</h2>
|
|
<section class="tsd-panel tsd-member tsd-kind-object-literal tsd-parent-kind-class">
|
|
<a name="config" class="tsd-anchor"></a>
|
|
<h3>config</h3>
|
|
<div class="tsd-signature tsd-kind-icon">config<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">object</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L23">screen.class.ts:23</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Config object for <a href="screen.html">Screen</a> class</p>
|
|
</div>
|
|
</div>
|
|
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
|
|
<a name="config.autohighlight" class="tsd-anchor"></a>
|
|
<h3>auto<wbr>Highlight</h3>
|
|
<div class="tsd-signature tsd-kind-icon">auto<wbr>Highlight<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">boolean</span><span class="tsd-signature-symbol"> = false</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L32">screen.class.ts:32</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Configure whether to auto highlight all search results or not</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
|
|
<a name="config.confidence" class="tsd-anchor"></a>
|
|
<h3>confidence</h3>
|
|
<div class="tsd-signature tsd-kind-icon">confidence<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0.99</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L27">screen.class.ts:27</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Configures the required matching percentage for template images to be declared as a match</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
|
|
<a name="config.highlightdurationms" class="tsd-anchor"></a>
|
|
<h3>highlight<wbr>Duration<wbr>Ms</h3>
|
|
<div class="tsd-signature tsd-kind-icon">highlight<wbr>Duration<wbr>Ms<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 500</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L36">screen.class.ts:36</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Configure highlighting duration</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
|
|
<a name="config.highlightopacity" class="tsd-anchor"></a>
|
|
<h3>highlight<wbr>Opacity</h3>
|
|
<div class="tsd-signature tsd-kind-icon">highlight<wbr>Opacity<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">number</span><span class="tsd-signature-symbol"> = 0.25</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L41">screen.class.ts:41</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Configure opacity of highlight window</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<section class="tsd-panel tsd-member tsd-kind-variable tsd-parent-kind-object-literal">
|
|
<a name="config.resourcedirectory" class="tsd-anchor"></a>
|
|
<h3>resource<wbr>Directory</h3>
|
|
<div class="tsd-signature tsd-kind-icon">resource<wbr>Directory<span class="tsd-signature-symbol">:</span> <span class="tsd-signature-type">string</span><span class="tsd-signature-symbol"> = cwd()</span></div>
|
|
<aside class="tsd-sources">
|
|
<ul>
|
|
<li>Defined in <a href="https://github.com/nut-tree/nut.js/blob/3aa660c/lib/screen.class.ts#L46">screen.class.ts:46</a></li>
|
|
</ul>
|
|
</aside>
|
|
<div class="tsd-comment tsd-typography">
|
|
<div class="lead">
|
|
<p>Configures the path from which template images are loaded from</p>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
</section>
|
|
</section>
|
|
</div>
|
|
<div class="col-4 col-menu menu-sticky-wrap menu-highlight">
|
|
<nav class="tsd-navigation primary">
|
|
<ul>
|
|
<li class="globals ">
|
|
<a href="../globals.html"><em>Globals</em></a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<nav class="tsd-navigation secondary menu-sticky">
|
|
<ul class="before-current">
|
|
</ul>
|
|
<ul class="current">
|
|
<li class="current tsd-kind-class">
|
|
<a href="screen.html" class="tsd-kind-icon">Screen</a>
|
|
<ul>
|
|
<li class=" tsd-kind-constructor tsd-parent-kind-class">
|
|
<a href="screen.html#constructor" class="tsd-kind-icon">constructor</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#capture" class="tsd-kind-icon">capture</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#captureregion" class="tsd-kind-icon">capture<wbr>Region</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#find" class="tsd-kind-icon">find</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#height" class="tsd-kind-icon">height</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#highlight" class="tsd-kind-icon">highlight</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#on" class="tsd-kind-icon">on</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#waitfor" class="tsd-kind-icon">wait<wbr>For</a>
|
|
</li>
|
|
<li class=" tsd-kind-method tsd-parent-kind-class">
|
|
<a href="screen.html#width" class="tsd-kind-icon">width</a>
|
|
</li>
|
|
<li class=" tsd-kind-object-literal tsd-parent-kind-class">
|
|
<a href="screen.html#config" class="tsd-kind-icon">config</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="after-current">
|
|
</ul>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<footer>
|
|
<div class="container">
|
|
<h2>Legend</h2>
|
|
<div class="tsd-legend-group">
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-constructor tsd-parent-kind-class"><span class="tsd-kind-icon">Constructor</span></li>
|
|
<li class="tsd-kind-property tsd-parent-kind-class"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-interface"><span class="tsd-kind-icon">Property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-interface"><span class="tsd-kind-icon">Method</span></li>
|
|
</ul>
|
|
<ul class="tsd-legend">
|
|
<li class="tsd-kind-property tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static property</span></li>
|
|
<li class="tsd-kind-method tsd-parent-kind-class tsd-is-static"><span class="tsd-kind-icon">Static method</span></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</footer>
|
|
<div class="overlay"></div>
|
|
<script src="../assets/js/main.js"></script>
|
|
<script>if (location.protocol == 'file:') document.write('<script src="../assets/js/search.js"><' + '/script>');</script>
|
|
</body>
|
|
</html> |