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 b=JSON.parse('{"title":"Module: features/action","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/action.md","lastUpdated":null}'),c={name:"api/modules/features/action.md"},d=a('<h1 id="module-features-action" tabindex="-1">Module: features/action <a class="header-anchor" href="#module-features-action" aria-label="Permalink to "Module: features/action""></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="actionoptions" tabindex="-1">ActionOptions <a class="header-anchor" href="#actionoptions" aria-label="Permalink to "ActionOptions""></a></h3><p>• <strong>ActionOptions</strong>: <code>Object</code></p><p>An object that configures an <a href="./action#action">Action</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>autoStart?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code>></td><td style="text-align:left;">Whether or not the action should perform automatically when the cooldown is finished.</td></tr><tr><td style="text-align:left;"><code>barOptions?</code></td><td style="text-align:left;"><a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#partialtype" target="_blank" rel="noreferrer"><code>Partial</code></a><<a href="./bar#baroptions"><code>BarOptions</code></a>></td><td style="text-align:left;">A pass-through to the Bar used to display the cooldown progress for the action.</td></tr><tr><td style="text-align:left;"><code>canClick?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>boolean</code>></td><td style="text-align:left;">Whether or not the clickable may be clicked.</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>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> | { <code>description</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> ; <code>title?</code>: <a href="./feature#coercablecomponent"><code>CoercableComponent</code></a> }></td><td style="text-align:left;">The display to use for this clickable.</td></tr><tr><td style="text-align:left;"><code>duration</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></td><td style="text-align:left;">The cooldown during which the action cannot be performed again, in seconds.</td></tr><tr><td style="text-align:left;"><code>mark?</code></td><td style="text-align:left;"><a href="./../util/computed#computable"><code>Computable</code></a><<code>string</code> | <code>boolean</code>></td><td style="text-align:left;">Shows a marker on the corner of the feature.</td></tr><tr><td style="text-align:left;"><code>onClick</code></td><td style="text-align:left;">(<code>amount</code>: <a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>) => <code>void</code></td><td style="text-align:left;">A function that is called when the action is clicked.</td></tr><tr><td style="text-align:left;"><code>small?</code></td><td style="text-align:left;"><code>boolean</code></td><td style="text-align:left;">Toggles a smaller design for the feature.</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>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" 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/ba67ff4/src/features/action.tsx#L41" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:41</a></p><hr><h3 id="baseaction" tabindex="-1">BaseAction <a class="header-anchor" href="#baseaction" aria-label="Permalink to "BaseAction""></a></h3><p>• <strong>BaseAction</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./action#actionoptions">ActionOptions</a> to create an <a href="./action#action">Action</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>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>isHolding</code></td><td style="text-align:left;"><code>Ref</code><<code>boolean</code>></td><td style="text-align:left;">Whether or not the player is holding down the action. Actions will be considered clicked as soon as the cooldown completes when being held down.</td></tr><tr><td style="text-align:left;"><code>progress</code></td><td style="text-align:left;"><code>Ref</code><<a href="./../lib/break_eternity#decimalsource"><code>DecimalSource</code></a>></td><td style="text-align:left;">The current amount of progress through the cooldown.</td></tr><tr><td style="text-align:left;"><code>progressBar</code></td><td style="text-align:left;"><a href="./bar#genericbar"><code>GenericBar</code></a></td><td style="text-align:left;">The bar used to display the current cooldown progress.</td></tr><tr><td style="text-align:left;"><code>type</code></td><td style="text-align:left;">typeof <a href="./action#actiontype"><code>ActionType</code></a></td><td style="text-align:left;">A symbol that helps identify features of the same type.</td></tr><tr><td style="text-align:left;"><code>update</code></td><td style="text-align:left;">(<code>diff</code>: <code>number</code>) => <code>void</code></td><td style="text-align:left;">Update the cooldown the specified number of seconds</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/ba67ff4/src/features/action.tsx#L55" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:55</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="action" tabindex="-1">Action <a class="header-anchor" href="#action" aria-label="Permalink to "Action""></a></h3><p>Ƭ <strong>Action</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./action#baseaction"><code>BaseAction</code></a>, { <code>autoStart</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"autoStart"</code>], <code>false</code>> ; <code>canClick</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"canClick"</code>], <code>true</code>> ; <code>classes</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"classes"</code>]> ; <code>display</code>: <a href="./feature#jsxfunction"><code>JSXFunction</code></a> ; <code>duration</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"duration"</code>]> ; <code>mark</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"mark"</code>]> ; <code>onClick</code>: <code>VoidFunction</code> ; <code>style</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"style"</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 can be clicked upon, and then has a cooldown before it can be clicked again.</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="./action#actionoptions"><code>ActionOptions</code></a></td></tr></tbody></table><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/ba67ff4/src/features/action.tsx#L75" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:75</a></p><hr><h3 id="genericaction" tabindex="-1">GenericAction <a class="header-anchor" href="#genericaction" aria-label="Permalink to "GenericAction""></a></h3><p>Ƭ <strong>GenericAction</strong>: <a href="./feature#replace"><code>Replace</code></a><<a href="./action#action"><code>Action</code></a><<a href="./action#actionoptions"><code>ActionOptions</code></a>>, { <code>autoStart</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<code>boolean</code>> ; <code>canClick</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<code>boolean</code>> ; <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="./action#action">Action</a> object.</p><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/ba67ff4/src/features/action.tsx#L91" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:91</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="actiontype" tabindex="-1">ActionType <a class="header-anchor" href="#actiontype" aria-label="Permalink to "ActionType""></a></h3><p>• <code>Const</code> <strong>ActionType</strong>: typeof <a href="./action#actiontype"><code>ActionType</code></a></p><p>A symbol used to identify <a href="./action#action">Action</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/ba67ff4/src/features/action.tsx#L36" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:36</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createaction" tabindex="-1">createAction <a class="header-anchor" href="#createaction" aria-label="Permalink to "createAction""></a></h3><p>▸ <strong>createAction</strong><<code>T</code>>(<code>optionsFunc?</code>): <a href="./action#action"><code>Action</code></a><<code>T</code>></p><p>Lazily creates an action 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="./action#actionoptions"><code>ActionOptions</code></a><<code>T</code>></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="./action#baseaction"><code>BaseAction</code></a>, <a href="./action#genericaction"><code>GenericAction</code></a>></td><td style="text-align:left;">Action 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="./action#action"><code>Action</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/ba67ff4/src/features/action.tsx#L104" target="_blank" rel="noreferrer">profectus/src/features/action.tsx:104</a></p>',47),l=[d];function i(r,n,s,f,h,p){return o(),t("div",null,l)}const g=e(c,[["render",i]]);export{b as __pageData,g as default};
|