Wplace-BlueMarble/docs/module.exports.html
2025-08-08 16:10:50 -04:00

1130 lines
No EOL
19 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Class: exports</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="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Class: exports</h1>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">(name, version)</span><span class="type-signature"></span></h2>
<div class="class-description">The overlay builder for the Blue Marble script.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">(name, version)</span><span class="type-signature"></span></h4>
<div class="description">
This class handles the overlay UI for the Blue Marble script.
</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>name</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The name of the userscript</td>
</tr>
<tr>
<td class="name"><code>version</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="description last">The version of the userscript</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>0.0.2</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Overlay.js.html">Overlay.js</a>, <a href="Overlay.js.html#line25">line 25</a>
</li></ul></dd>
<dt class="tag-see">See:</dt>
<dd class="tag-see">
<ul>
<li>Overlay</li>
</ul>
</dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>const overlay = new Overlay();
overlay.addDiv({ 'id': 'overlay' })
.addDiv({ 'id': 'header' })
.addHeader(1, {'textContent': 'Your Overlay'}).buildElement()
.addP({'textContent': 'This is your overlay. It is versatile.'}).buildElement()
.buildElement() // Marks the end of the header &lt;div>
.addHr().buildElement()
.buildOverlay(document.body);
// Output:
// (Assume &lt;body> already exists in the webpage)
&lt;body>
&lt;div id="overlay">
&lt;div id="header">
&lt;h1>Your Overlay&lt;/h1>
&lt;p>This is your overlay. It is versatile.&lt;/p>
&lt;/div>
&lt;hr>
&lt;/div>
&lt;/body></code></pre>
</div>
</article>
</section>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">This class contains all MutationObservers used (which is 1 probably).
This is not an object, but rather a "collection" of functions (in a class).</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
The constructor for the observer class
</div>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>0.43.2</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="observers.js.html">observers.js</a>, <a href="observers.js.html#line5">line 5</a>
</li></ul></dd>
</dl>
</div>
</article>
</section>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">()</span><span class="type-signature"></span></h2>
<div class="class-description">Manages the template system.
This class handles all external requests for template modification, creation, and analysis.
It serves as the central coordinator between template instances and the user interface.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
The constructor for the TemplateManager class.
</div>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>0.55.8</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="templateManager.js.html">templateManager.js</a>, <a href="templateManager.js.html#line36">line 36</a>
</li></ul></dd>
</dl>
<h5>Example</h5>
<pre class="prettyprint"><code>// JSON structure for a template
{
"whoami": "BlueMarble",
"scriptVersion": "1.13.0",
"schemaVersion": "2.1.0",
"templates": {
"0 $Z": {
"name": "My Template",
"enabled": true,
"tiles": {
"1231,0047,183,593": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA",
"1231,0048,183,000": "data:image/png;AAAFCAYAAACNbyblAAAAHElEQVQI12P4"
}
},
"1 $Z": {
"name": "My Template",
"URL": "https://github.com/SwingTheVine/Wplace-BlueMarble/blob/main/dist/assets/Favicon.png",
"URLType": "template",
"enabled": false,
"tiles": {
"375,1846,276,188": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA",
"376,1846,000,188": "data:image/png;AAAFCAYAAACNbyblAAAAHElEQVQI12P4"
}
}
}
}</code></pre>
</div>
</article>
</section>
<section>
<header>
<h2><span class="attribs"><span class="type-signature"></span></span>exports<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h2>
<div class="class-description">An instance of a template.
Handles all mathematics, manipulation, and analysis regarding a single template.</div>
</header>
<article>
<div class="container-overview">
<h2>Constructor</h2>
<h4 class="name" id="exports"><span class="type-signature"></span>new exports<span class="signature">(params<span class="signature-attributes">opt</span>)</span><span class="type-signature"></span></h4>
<div class="description">
The constructor for the Template class with enhanced pixel tracking.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</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="attributes">
&lt;optional><br>
</td>
<td class="default">
{}
</td>
<td class="description last">Object containing all optional parameters
<h6>Properties</h6>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th>Default</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>displayName</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
'My template'
</td>
<td class="description last">The display name of the template</td>
</tr>
<tr>
<td class="name"><code>sortID</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0
</td>
<td class="description last">The sort number of the template for rendering priority</td>
</tr>
<tr>
<td class="name"><code>authorID</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
''
</td>
<td class="description last">The user ID of the person who exported the template (prevents sort ID collisions)</td>
</tr>
<tr>
<td class="name"><code>url</code></td>
<td class="type">
<span class="param-type">string</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
''
</td>
<td class="description last">The URL to the source image</td>
</tr>
<tr>
<td class="name"><code>file</code></td>
<td class="type">
<span class="param-type">File</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last">The template file (pre-processed File or processed bitmap)</td>
</tr>
<tr>
<td class="name"><code>coords</code></td>
<td class="type">
<span class="param-type">Array.&lt;number></span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last">The coordinates of the top left corner as (tileX, tileY, pixelX, pixelY)</td>
</tr>
<tr>
<td class="name"><code>chunked</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
null
</td>
<td class="description last">The affected chunks of the template, and their template for each chunk</td>
</tr>
<tr>
<td class="name"><code>tileSize</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
1000
</td>
<td class="description last">The size of a tile in pixels (assumes square tiles)</td>
</tr>
<tr>
<td class="name"><code>pixelCount</code></td>
<td class="type">
<span class="param-type">number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="default">
0
</td>
<td class="description last">Total number of pixels in the template (calculated automatically during processing)</td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-since">Since:</dt>
<dd class="tag-since"><ul class="dummy"><li>0.65.2</li></ul></dd>
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="Template.js.html">Template.js</a>, <a href="Template.js.html#line7">line 7</a>
</li></ul></dd>
</dl>
</div>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="module.exports.html">exports</a></li><li><a href="module.exports_module.exports.html">exports</a></li></ul><h3>Global</h3><ul><li><a href="global.html#addBr">addBr</a></li><li><a href="global.html#addButton">addButton</a></li><li><a href="global.html#addButtonHelp">addButtonHelp</a></li><li><a href="global.html#addCheckbox">addCheckbox</a></li><li><a href="global.html#addDiv">addDiv</a></li><li><a href="global.html#addHeader">addHeader</a></li><li><a href="global.html#addHr">addHr</a></li><li><a href="global.html#addImg">addImg</a></li><li><a href="global.html#addInput">addInput</a></li><li><a href="global.html#addInputFile">addInputFile</a></li><li><a href="global.html#addP">addP</a></li><li><a href="global.html#addSmall">addSmall</a></li><li><a href="global.html#addTextarea">addTextarea</a></li><li><a href="global.html#base64ToUint8">base64ToUint8</a></li><li><a href="global.html#buildElement">buildElement</a></li><li><a href="global.html#buildOverlay">buildOverlay</a></li><li><a href="global.html#buildOverlayMain">buildOverlayMain</a></li><li><a href="global.html#consoleError">consoleError</a></li><li><a href="global.html#consoleLog">consoleLog</a></li><li><a href="global.html#consoleWarn">consoleWarn</a></li><li><a href="global.html#createJSON">createJSON</a></li><li><a href="global.html#createObserverBody">createObserverBody</a></li><li><a href="global.html#createTemplate">createTemplate</a></li><li><a href="global.html#createTemplateTiles">createTemplateTiles</a></li><li><a href="global.html#deleteTemplate">deleteTemplate</a></li><li><a href="global.html#disableTemplate">disableTemplate</a></li><li><a href="global.html#drawTemplateOnTile">drawTemplateOnTile</a></li><li><a href="global.html#escapeHTML">escapeHTML</a></li><li><a href="global.html#getObserverBody">getObserverBody</a></li><li><a href="global.html#handleDisplayError">handleDisplayError</a></li><li><a href="global.html#handleDisplayStatus">handleDisplayStatus</a></li><li><a href="global.html#handleDrag">handleDrag</a></li><li><a href="global.html#importJSON">importJSON</a></li><li><a href="global.html#inject">inject</a></li><li><a href="global.html#negativeSafeModulo">negativeSafeModulo</a></li><li><a href="global.html#numberToEncoded">numberToEncoded</a></li><li><a href="global.html#observe">observe</a></li><li><a href="global.html#observeBlack">observeBlack</a></li><li><a href="global.html#serverTPtoDisplayTP">serverTPtoDisplayTP</a></li><li><a href="global.html#setApiManager">setApiManager</a></li><li><a href="global.html#setTemplatesShouldBeDrawn">setTemplatesShouldBeDrawn</a></li><li><a href="global.html#spontaneousResponseListener">spontaneousResponseListener</a></li><li><a href="global.html#uint8ToBase64">uint8ToBase64</a></li><li><a href="global.html#updateInnerHTML">updateInnerHTML</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 4.0.4</a> on Fri Aug 08 2025 16:09:33 GMT-0400 (Eastern Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>