profectus-docs/assets/api_modules_features_grid.md.44a0d8eb.js

2 lines
25 KiB
JavaScript
Raw Normal View History

import{_ as e,c as t,o as d,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/grids/grid","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/grid.md","lastUpdated":null}'),a={name:"api/modules/features/grid.md"},l=o('<h1 id="module-features-grids-grid" tabindex="-1">Module: features/grids/grid <a class="header-anchor" href="#module-features-grids-grid" aria-label="Permalink to &quot;Module: features/grids/grid&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="basegrid" tabindex="-1">BaseGrid <a class="header-anchor" href="#basegrid" aria-label="Permalink to &quot;BaseGrid&quot;"></a></h3><p> <strong>BaseGrid</strong>: <code>Object</code></p><p>The properties that are added onto a processed BoardOptions to create a Board.</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>[Component]</code></td><td style="text-align:left;"><a href="./feature#genericcomponent"><code>GenericComponent</code></a></td><td style="text-align:left;">The Vue component used to render this feature.</td></tr><tr><td style="text-align:left;"><code>[GatherProps]</code></td><td style="text-align:left;">() =&gt; <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>unknown</code>&gt;</td><td style="text-align:left;">A function to gather the props the vue component requires for this feature.</td></tr><tr><td style="text-align:left;"><code>cellState</code></td><td style="text-align:left;"><a href="./../game/persistence#persistent"><code>Persistent</code></a>&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>number</code>, <a href="./../game/persistence#state"><code>State</code></a>&gt;&gt;</td><td style="text-align:left;">The persistent state of this grid, which is a dictionary of cell states.</td></tr><tr><td style="text-align:left;"><code>cells</code></td><td style="text-align:left;"><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>number</code>, <a href="./grid#gridcell"><code>GridCell</code></a>&gt;</td><td style="text-align:left;">A dictionary of cells within this grid.</td></tr><tr><td style="text-align:left;"><code>getID</code></td><td style="text-align:left;">(<code>id</code>: <code>string</code> | <code>number</code>, <code>state</code>: <a href="./../game/persistence#state"><code>State</code></a>) =&gt; <code>string</code></td><td style="text-align:left;">Get the auto-generated ID for identifying a specific cell of this grid that appears in the DOM. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>getState</code></td><td style="text-align:left;">(<code>id</code>: <code>string</code> | <code>number</code>) =&gt; <a href="./../game/persistence#state"><code>State</code></a></td><td style="text-align:left;">Get the persistent state of the given cell.</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;">An auto-generated ID for identifying features that appear in the DOM. Will not persist between refreshes or updates.</td></tr><tr><td style="text-align:left;"><code>setState</code></td><td style="text-align:left;">(<code>id</code>: <code>string</code> | <code>number</code>, <code>state</code>: <a href="./../game/persistence#state"><code>State</code></a>) =&gt; <code>void</code></td><td style="text-align:left;">Set the persistent state of the given cell.</td></tr><tr><td style