profectus-docs/assets/api_modules_game_layers.md.37dc1edf.js

2 lines
34 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o as a,N as r}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: game/layers","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/game/layers.md","lastUpdated":null}'),o={name:"api/modules/game/layers.md"},d=r('<h1 id="module-game-layers" tabindex="-1">Module: game/layers <a class="header-anchor" href="#module-game-layers" aria-label="Permalink to &quot;Module: game/layers&quot;"></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to &quot;Interfaces&quot;"></a></h2><h3 id="baselayer" tabindex="-1">BaseLayer <a class="header-anchor" href="#baselayer" aria-label="Permalink to &quot;BaseLayer&quot;"></a></h3><p> <strong>BaseLayer</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./layers#layeroptions">LayerOptions</a> to create a <a href="./layers#layer">Layer</a></p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th><th style="text-align:left;">Description</th></tr></thead><tbody><tr><td style="text-align:left;"><code>emit</code></td><td style="text-align:left;">&lt;K&gt;(...<code>args</code>: [<code>K</code>, ...Parameters&lt;LayerEvents[K]&gt;[]]) =&gt; <code>void</code></td><td style="text-align:left;">A function to emit a <a href="./layers#layerevents">LayerEvents</a> event to this layer.</td></tr><tr><td style="text-align:left;"><code>emitter</code></td><td style="text-align:left;"><code>Emitter</code>&lt;<a href="./layers#layerevents"><code>LayerEvents</code></a>&gt;</td><td style="text-align:left;">An emitter for sending <a href="./layers#layerevents">LayerEvents</a> events for this layer.</td></tr><tr><td style="text-align:left;"><code>id</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">The ID of the layer. Populated from the <a href="./layers#createlayer">createLayer</a> parameters. Used for saving and tracking open tabs.</td></tr><tr><td style="text-align:left;"><code>minimized</code></td><td style="text-align:left;"><a href="./persistence#persistent"><code>Persistent</code></a>&lt;<code>boolean</code>&gt;</td><td style="text-align:left;">A persistent ref tracking if the tab is minimized or not.</td></tr><tr><td style="text-align:left;"><code>nodes</code></td><td style="text-align:left;"><code>Ref</code>&lt;<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a>&lt;<code>string</code>, <code>undefined</code> | <a href="./layers#featurenode"><code>FeatureNode</code></a>&gt;&gt;</td><td style="text-align:left;">A map of <a href="./layers#featurenode">FeatureNode</a>s present in this layer&#39;s ContextComponent component.</td></tr><tr><td style="text-align:left;"><code>on</code></td><td style="text-align:left;">(...<code>args</code>: [event: keyof LayerEvents, cb: Function | Function | Function]) =&gt; <code>Unsubscribe</code></td><td style="text-align:left;">A function to register an event listener on <a href="./layers#emitter">emitter</a>.</td></tr></tbody></table><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/c9ca859/src/game/layers.tsx#L148" target="_blank" rel="noreferrer">profectus/src/game/layers.tsx:148</a></p><hr><h3 id="featurenode" tabindex="-1">FeatureNode <a class="header-anchor" href="#featurenode" aria-label="Permalink to &quot;FeatureNode&quot;"></a></h3><p> <strong>FeatureNode</strong>: <code>Object</code></p><p>A feature&#39;s node in the DOM that has its size tracked.</p><table><thead><tr><th style="text-align:left;">Name</th><th style="text-align:left;">Type</th></tr></thead><tbody><tr><td style="text-align:left;"><code>element</code></td><td style="text-align:left;"><a href="https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement" target="_bl