1 line
9.9 KiB
JavaScript
1 line
9.9 KiB
JavaScript
import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const u=JSON.parse('{"title":"Module: features/hotkey","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/features/hotkey.md","lastUpdated":null}'),r={name:"api/modules/features/hotkey.md"},d=o('<h1 id="module-features-hotkey" tabindex="-1">Module: features/hotkey <a class="header-anchor" href="#module-features-hotkey" aria-label="Permalink to "Module: features/hotkey""></a></h1><h2 id="interfaces" tabindex="-1">Interfaces <a class="header-anchor" href="#interfaces" aria-label="Permalink to "Interfaces""></a></h2><h3 id="basehotkey" tabindex="-1">BaseHotkey <a class="header-anchor" href="#basehotkey" aria-label="Permalink to "BaseHotkey""></a></h3><p>• <strong>BaseHotkey</strong>: <code>Object</code></p><p>The properties that are added onto a processed <a href="./hotkey#hotkeyoptions">HotkeyOptions</a> to create an <a href="./hotkey#hotkey">Hotkey</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>type</code></td><td style="text-align:left;">typeof <a href="./hotkey#hotkeytype"><code>HotkeyType</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/425e85a/src/features/hotkey.tsx#L40" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:40</a></p><hr><h3 id="hotkeyoptions" tabindex="-1">HotkeyOptions <a class="header-anchor" href="#hotkeyoptions" aria-label="Permalink to "HotkeyOptions""></a></h3><p>• <strong>HotkeyOptions</strong>: <code>Object</code></p><p>An object that configures a <a href="./hotkey#hotkey">Hotkey</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>description</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 description of this hotkey, to display in the settings.</td></tr><tr><td style="text-align:left;"><code>enabled?</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 this hotkey is currently enabled.</td></tr><tr><td style="text-align:left;"><code>key</code></td><td style="text-align:left;"><code>string</code></td><td style="text-align:left;">The key tied to this hotkey</td></tr><tr><td style="text-align:left;"><code>onPress</code></td><td style="text-align:left;"><code>VoidFunction</code></td><td style="text-align:left;">What to do upon pressing the key.</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/425e85a/src/features/hotkey.tsx#L26" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:26</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="generichotkey" tabindex="-1">GenericHotkey <a class="header-anchor" href="#generichotkey" aria-label="Permalink to "GenericHotkey""></a></h3><p>Ƭ <strong>GenericHotkey</strong>: <a href="./feature#replace"><code>Replace</code></a><<code>Hotkey</code><<a href="./hotkey#hotkeyoptions"><code>HotkeyOptions</code></a>>, { <code>enabled</code>: <a href="./../util/computed#processedcomputable"><code>ProcessedComputable</code></a><<code>boolean</code>> }></p><p>A type that matches any valid <a href="./hotkey#hotkey">Hotkey</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/425e85a/src/features/hotkey.tsx#L55" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:55</a></p><hr><h3 id="hotkey" tabindex="-1">Hotkey <a class="header-anchor" href="#hotkey" aria-label="Permalink to "Hotkey""></a></h3><p>Ƭ <strong>Hotkey</strong><<code>T</code>>: <a href="./feature#replace"><code>Replace</code></a><<code>T</code> & <a href="./hotkey#basehotkey"><code>BaseHotkey</code></a>, { <code>description</code>: <a href="./../util/computed#getcomputabletype"><code>GetComputableType</code></a><<code>T</code>[<code>"description"</code>]> ; <code>enabled</code>: <a href="./../util/computed#getcomputabletypewithdefault"><code>GetComputableTypeWithDefault</code></a><<code>T</code>[<code>"enabled"</code>], <code>true</code>> }></p><p>An object that represents a hotkey shortcut that performs an action upon a key sequence being pressed.</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="./hotkey#hotkeyoptions"><code>HotkeyOptions</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/425e85a/src/features/hotkey.tsx#L46" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:46</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="hotkeytype" tabindex="-1">HotkeyType <a class="header-anchor" href="#hotkeytype" aria-label="Permalink to "HotkeyType""></a></h3><p>• <code>Const</code> <strong>HotkeyType</strong>: typeof <a href="./hotkey#hotkeytype"><code>HotkeyType</code></a></p><p>A symbol used to identify <a href="./hotkey#hotkey">Hotkey</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/425e85a/src/features/hotkey.tsx#L21" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:21</a></p><hr><h3 id="hotkeys" tabindex="-1">hotkeys <a class="header-anchor" href="#hotkeys" aria-label="Permalink to "hotkeys""></a></h3><p>• <code>Const</code> <strong>hotkeys</strong>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#recordkeys-type" target="_blank" rel="noreferrer"><code>Record</code></a><<code>string</code>, <a href="./hotkey#generichotkey"><code>GenericHotkey</code></a> | <code>undefined</code>></p><p>A dictionary of all hotkeys.</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/425e85a/src/features/hotkey.tsx#L19" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:19</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="createhotkey" tabindex="-1">createHotkey <a class="header-anchor" href="#createhotkey" aria-label="Permalink to "createHotkey""></a></h3><p>▸ <strong>createHotkey</strong><<code>T</code>>(<code>optionsFunc</code>): <code>Hotkey</code><<code>T</code>></p><p>Lazily creates a hotkey 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="./hotkey#hotkeyoptions"><code>HotkeyOptions</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="./hotkey#basehotkey"><code>BaseHotkey</code></a>, <a href="./hotkey#generichotkey"><code>GenericHotkey</code></a>></td><td style="text-align:left;">Hotkey 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><code>Hotkey</code><<code>T</code>></p><h4 id="defined-in-6" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-6" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/425e85a/src/features/hotkey.tsx#L68" target="_blank" rel="noreferrer">profectus/src/features/hotkey.tsx:68</a></p>',53),n=[d];function s(l,i,h,c,y,f){return a(),t("div",null,n)}const k=e(r,[["render",s]]);export{u as __pageData,k as default};
|