docs/SketchTool.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>SketchTool - Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="https://code.ionicframework.com/ionicons/2.0.1/css/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="SketchTool.html">SketchTool</a><ul class='methods'><li data-type='method'><a href="SketchTool.html#exportCall">exportCall</a></li><li data-type='method'><a href="SketchTool.html#getArgs">getArgs</a></li><li data-type='method'><a href="SketchTool.html#listCall">listCall</a></li><li data-type='method'><a href="SketchTool.html#runCommand">runCommand</a></li><li data-type='method'><a href="SketchTool.html#toolOptions">toolOptions</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">SketchTool</h1>
<section>
<header>
<h2>
SketchTool
</h2>
<div class="class-description">SketchTool Class</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="SketchTool"><span class="type-signature"></span>new SketchTool<span class="signature">(params)</span><span class="type-signature"></span></h4>
<div class="description">
Constructor
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Params to be set into this instance</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line17">line 17</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id="exportCall"><span class="type-signature"></span>exportCall<span class="signature">(type, params)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Call the exports function with subcommands using `type`
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Subcommand to be run, eg: artboards, layers, etc.</td>
</tr>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Parameters to be sent with this subcommand</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line115">line 115</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Promise
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="getArgs"><span class="type-signature"></span>getArgs<span class="signature">(params)</span><span class="type-signature"> → {Array}</span></h4>
<div class="description">
Get a list of valid options in the format spawn needs
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Key values of the options we want to pass to sketchtool</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line100">line 100</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Array of options formatted in spawns format
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id="listCall"><span class="type-signature"></span>listCall<span class="signature">(type, params)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Call the list function with subcommand using `type`
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>type</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Subcommand to be run, eg: artboards, formats, etc.</td>
</tr>
<tr>
<td class="name"><code>params</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="description last">Parameters to be sent with this command</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Promise
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="runCommand"><span class="type-signature"></span>runCommand<span class="signature">(command, args)</span><span class="type-signature"> → {Promise}</span></h4>
<div class="description">
Spawn a child process of sketch-tool and run a given command with parameters
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>command</code></td>
<td class="type">
<span class="param-type">String</span>
</td>
<td class="description last">Command to be run</td>
</tr>
<tr>
<td class="name"><code>args</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="description last">Command arguments to be sent with the command</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line127">line 127</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Promise
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Promise</span>
</dd>
</dl>
<h4 class="name" id="toolOptions"><span class="type-signature"></span>toolOptions<span class="signature">()</span><span class="type-signature"> → {Array}</span></h4>
<div class="description">
Sketch Tool CLI options
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="index.js.html">index.js</a>, <a href="index.js.html#line57">line 57</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
List of cli options
</div>
<dl class="param-type">
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.0</a> on Thu Sep 01 2016 13:49:13 GMT-0400 (EDT) using the Minami theme.
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>