1 line
15 KiB
JavaScript
1 line
15 KiB
JavaScript
import{_ as e,c as t,o,N as a}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/infoboxes/infobox","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/infobox.md","lastUpdated":null}'),l={name:"api/modules/features/infobox.md"},d=a('<h1 id="module-features-infoboxes-infobox" tabindex="-1">Module: features/infoboxes/infobox <a class="header-anchor" href="#module-features-infoboxes-infobox" aria-label="Permalink to "Module: features/infoboxes/infobox""></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="baseinfobox" tabindex="-1">BaseInfobox <a class="header-anchor" href="#baseinfobox" aria-label="Permalink to "BaseInfobox""></a></h3><p>• <strong>BaseInfobox</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./infobox#infoboxoptions">InfoboxOptions</a> to create an <a href="./infobox#infobox">Infobox</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>[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;">() => <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>unknown</code>></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>collapsed</code></td><td style="text-align:left;"><a href="./../game/persistence#persistent"><code>Persistent</code></a><<code>boolean</code>></td><td style="text-align:left;">Whether or not this infobox is collapsed.</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>type</code></td><td style="text-align:left;">typeof <a href="./infobox#infoboxtype"><code>InfoboxType</code></a></td><td style="text-align:left;">A symbol that helps identify features of the same type.</td></tr></tbody></table><h4 id="defined-in" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L50" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:50</a></p><hr><h3 id="infoboxoptions" tabindex="-1">InfoboxOptions <a class="header-anchor" href="#infoboxoptions" aria-label="Permalink to "InfoboxOptions""></a></h3><p>• <strong>InfoboxOptions</strong>: <code>Object</code></p><p>An object that configures an <a href="./infobox#infobox">Infobox</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>bodyStyle?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#stylevalue"><code>StyleValue</code></a>></td><td style="text-align:left;">CSS to apply to the body of the infobox.</td></tr><tr><td style="text-align:left;"><code>classes?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <code>boolean</code>>></td><td style="text-align:left;">Dictionary of CSS classes to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>color?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>string</code>></td><td style="text-align:left;">The background color of the Infobox.</td></tr><tr><td style="text-align:left;"><code>display</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#coercablecomponent"><code>CoercableComponent</code></a>></td><td style="text-align:left;">The main text that appears in the display.</td></tr><tr><td style="text-align:left;"><code>style?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#stylevalue"><code>StyleValue</code></a>></td><td style="text-align:left;">CSS to apply to this feature.</td></tr><tr><td style="text-align:left;"><code>title</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#coercablecomponent"><code>CoercableComponent</code></a>></td><td style="text-align:left;">A header to appear at the top of the display.</td></tr><tr><td style="text-align:left;"><code>titleStyle?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./feature#stylevalue"><code>StyleValue</code></a>></td><td style="text-align:left;">CSS to apply to the title of the infobox.</td></tr><tr><td style="text-align:left;"><code>visibility?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code> | <a href="./feature#visibility"><code>Visibility</code></a>></td><td style="text-align:left;">Whether this clickable should be visible.</td></tr></tbody></table><h4 id="defined-in-1" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-1" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L28" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:28</a></p><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to "Type Aliases""></a></h2><h3 id="genericinfobox" tabindex="-1">GenericInfobox <a class="header-anchor" href="#genericinfobox" aria-label="Permalink to "GenericInfobox""></a></h3><p>Ƭ <strong>GenericInfobox</strong>: <a href="./feature#replace"><code>Replace</code></a><<a href="./infobox#infobox"><code>Infobox</code></a><<a href="./infobox#infoboxoptions"><code>InfoboxOptions</code></a>>, { <code>visibility</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<a href="./feature#visibility"><code>Visibility</code></a> | <code>boolean</code>> }></p><p>A type that matches any valid <a href="./infobox#infobox">Infobox</a> object.</p><h4 id="defined-in-2" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-2" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L79" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:79</a></p><hr><h3 id="infobox" tabindex="-1">Infobox <a class="header-anchor" href="#infobox" aria-label="Permalink to "Infobox""></a></h3><p>Ƭ <strong>Infobox</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./infobox#baseinfobox"><code>BaseInfobox</code></a>, { <code>bodyStyle</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"bodyStyle"</code>]> ; <code>classes</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"classes"</code>]> ; <code>color</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"color"</code>]> ; <code>display</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"display"</code>]> ; <code>style</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"style"</code>]> ; <code>title</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"title"</code>]> ; <code>titleStyle</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"titleStyle"</code>]> ; <code>visibility</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"visibility"</code>], <a href="./feature#visible"><code>Visible</code></a>> }></p><p>An object that represents a feature that displays information in a collapsible way.</p><h4 id="type-parameters" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to "Type parameters""></a></h4><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>T</code></td><td style="text-align:left;">extends <a href="./infobox#infoboxoptions"><code>InfoboxOptions</code></a></td></tr></tbody></table><h4 id="defined-in-3" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-3" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L64" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:64</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="infoboxtype" tabindex="-1">InfoboxType <a class="header-anchor" href="#infoboxtype" aria-label="Permalink to "InfoboxType""></a></h3><p>• <code>Const</code> <strong>InfoboxType</strong>: typeof <a href="./infobox#infoboxtype"><code>InfoboxType</code></a></p><p>A symbol used to identify <a href="./infobox#infobox">Infobox</a> features.</p><h4 id="defined-in-4" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-4" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L23" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:23</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createinfobox" tabindex="-1">createInfobox <a class="header-anchor" href="#createinfobox" aria-label="Permalink to "createInfobox""></a></h3><p>▸ <strong>createInfobox</strong><<code>T</code>>(<code>optionsFunc</code>): <a href="./infobox#infobox"><code>Infobox</code></a><<code>T</code>></p><p>Lazily creates an infobox with the given options.</p><h5 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to "Type parameters""></a></h5><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>T</code></td><td style="text-align:left;">extends <a href="./infobox#infoboxoptions"><code>InfoboxOptions</code></a></td></tr></tbody></table><h5 id="parameters" tabindex="-1">Parameters <a class="header-anchor" href="#parameters" aria-label="Permalink to "Parameters""></a></h5><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>optionsFunc</code></td><td style="text-align:left;"><a href="./feature#optionsfunc"><code>OptionsFunc</code></a><<code>T</code>, <a href="./infobox#baseinfobox"><code>BaseInfobox</code></a>, <a href="./infobox#genericinfobox"><code>GenericInfobox</code></a>></td><td style="text-align:left;">Infobox options.</td></tr></tbody></table><h5 id="returns" tabindex="-1">Returns <a class="header-anchor" href="#returns" aria-label="Permalink to "Returns""></a></h5><p><a href="./infobox#infobox"><code>Infobox</code></a><<code>T</code>></p><h4 id="defined-in-5" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-5" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/src/features/infoboxes/infobox.ts#L90" target="_blank" rel="noreferrer">profectus/src/features/infoboxes/infobox.ts:90</a></p><h2 id="components" tabindex="-1">Components <a class="header-anchor" href="#components" aria-label="Permalink to "Components""></a></h2><h3 id="infobox-component" tabindex="-1">Infobox Component <a class="header-anchor" href="#infobox-component" aria-label="Permalink to "Infobox Component""></a></h3><h4 id="props" tabindex="-1">Props <a class="header-anchor" href="#props" aria-label="Permalink to "Props""></a></h4><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>visibility</code>*</td><td style="text-align:left;"><code>processedPropType<Visibility | boolean>(Number, Boolean)</code></td></tr><tr><td style="text-align:left;"><code>display</code>*</td><td style="text-align:left;"><code>processedPropType<CoercableComponent>(Object, String, Function)</code></td></tr><tr><td style="text-align:left;"><code>title</code>*</td><td style="text-align:left;"><code>processedPropType<CoercableComponent>(Object, String, Function)</code></td></tr><tr><td style="text-align:left;"><code>color</code></td><td style="text-align:left;"><code>processedPropType<string>(String)</code></td></tr><tr><td style="text-align:left;"><code>collapsed</code>*</td><td style="text-align:left;"><code>Ref<boolean></code></td></tr><tr><td style="text-align:left;"><code>style</code></td><td style="text-align:left;"><code>processedPropType<StyleValue>(Object, String, Array)</code></td></tr><tr><td style="text-align:left;"><code>titleStyle</code></td><td style="text-align:left;"><code>processedPropType<StyleValue>(Object, String, Array)</code></td></tr><tr><td style="text-align:left;"><code>bodyStyle</code></td><td style="text-align:left;"><code>processedPropType<StyleValue>(Object, String, Array)</code></td></tr><tr><td style="text-align:left;"><code>classes</code></td><td style="text-align:left;"><code>processedPropType<Record<string, boolean>>(Object)</code></td></tr><tr><td style="text-align:left;"><code>id</code>*</td><td style="text-align:left;"><code>string</code></td></tr></tbody></table>',51),r=[d];function n(i,c,s,f,b,p){return o(),t("div",null,r)}const x=e(l,[["render",n]]);export{u as __pageData,x as default};
|