1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
import{_ as e,c as t,o as a,N as o}from"./chunks/framework.0799945b.js";const f=JSON.parse('{"title":"Module: util/computed","description":"","frontmatter":{"editLink":false},"headers":[],"relativePath":"api/modules/util/computed.md","lastUpdated":null}'),r={name:"api/modules/util/computed.md"},d=o('<h1 id="module-util-computed" tabindex="-1">Module: util/computed <a class="header-anchor" href="#module-util-computed" aria-label="Permalink to "Module: util/computed""></a></h1><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="computable" tabindex="-1">Computable <a class="header-anchor" href="#computable" aria-label="Permalink to "Computable""></a></h3><p>Ƭ <strong>Computable</strong><<code>T</code>>: <code>T</code> | <code>Ref</code><<code>T</code>> | () => <code>T</code></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></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></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/util/computed.ts#L8" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:8</a></p><hr><h3 id="computablekeysof" tabindex="-1">ComputableKeysOf <a class="header-anchor" href="#computablekeysof" aria-label="Permalink to "ComputableKeysOf""></a></h3><p>Ƭ <strong>ComputableKeysOf</strong><<code>T</code>>: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys" target="_blank" rel="noreferrer"><code>Pick</code></a><<code>T</code>, { [K in keyof T]: T[K] extends Computable<unknown> ? K : never }[keyof <code>T</code>]></p><h4 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></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/util/computed.ts#L22" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:22</a></p><hr><h3 id="getcomputabletype" tabindex="-1">GetComputableType <a class="header-anchor" href="#getcomputabletype" aria-label="Permalink to "GetComputableType""></a></h3><p>Ƭ <strong>GetComputableType</strong><<code>T</code>>: <code>T</code> extends { <code>[DoNotCache]</code>: <code>true</code> } ? <code>T</code> : <code>T</code> extends () => infer S ? <code>Ref</code><<code>S</code>> : <code>undefined</code> extends <code>T</code> ? <code>undefined</code> : <code>T</code></p><h4 id="type-parameters-2" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-2" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></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/util/computed.ts#L10" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:10</a></p><hr><h3 id="getcomputabletypewithdefault" tabindex="-1">GetComputableTypeWithDefault <a class="header-anchor" href="#getcomputabletypewithdefault" aria-label="Permalink to "GetComputableTypeWithDefault""></a></h3><p>Ƭ <strong>GetComputableTypeWithDefault</strong><<code>T</code>, <code>S</code>>: <code>undefined</code> extends <code>T</code> ? <code>S</code> : <a href="./computed#getcomputabletype"><code>GetComputableType</code></a><<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#nonnullabletype" target="_blank" rel="noreferrer"><code>NonNullable</code></a><<code>T</code>>></p><h4 id="type-parameters-3" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-3" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></td></tr><tr><td style="text-align:left;"><code>S</code></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/ba67ff4/src/util/computed.ts#L17" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:17</a></p><hr><h3 id="processedcomputable" tabindex="-1">ProcessedComputable <a class="header-anchor" href="#processedcomputable" aria-label="Permalink to "ProcessedComputable""></a></h3><p>Ƭ <strong>ProcessedComputable</strong><<code>T</code>>: <code>T</code> | <code>Ref</code><<code>T</code>></p><h4 id="type-parameters-4" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-4" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></td></tr></tbody></table><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/util/computed.ts#L9" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:9</a></p><hr><h3 id="unwrapcomputabletype" tabindex="-1">UnwrapComputableType <a class="header-anchor" href="#unwrapcomputabletype" aria-label="Permalink to "UnwrapComputableType""></a></h3><p>Ƭ <strong>UnwrapComputableType</strong><<code>T</code>>: <code>T</code> extends <code>Ref</code><infer S> ? <code>S</code> : <code>T</code> extends () => infer S ? <code>S</code> : <code>T</code></p><h4 id="type-parameters-5" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-5" aria-label="Permalink to "Type parameters""></a></h4><table><thead><tr><th style="text-align:left;">Name</th></tr></thead><tbody><tr><td style="text-align:left;"><code>T</code></td></tr></tbody></table><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/util/computed.ts#L20" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:20</a></p><h2 id="variables" tabindex="-1">Variables <a class="header-anchor" href="#variables" aria-label="Permalink to "Variables""></a></h2><h3 id="donotcache" tabindex="-1">DoNotCache <a class="header-anchor" href="#donotcache" aria-label="Permalink to "DoNotCache""></a></h3><p>• <code>Const</code> <strong>DoNotCache</strong>: typeof <a href="./computed#donotcache"><code>DoNotCache</code></a></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/ba67ff4/src/util/computed.ts#L6" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:6</a></p><h2 id="functions" tabindex="-1">Functions <a class="header-anchor" href="#functions" aria-label="Permalink to "Functions""></a></h2><h3 id="convertcomputable" tabindex="-1">convertComputable <a class="header-anchor" href="#convertcomputable" aria-label="Permalink to "convertComputable""></a></h3><p>▸ <strong>convertComputable</strong><<code>T</code>>(<code>obj</code>): <a href="./computed#processedcomputable"><code>ProcessedComputable</code></a><<code>T</code>></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>obj</code></td><td style="text-align:left;"><a href="./computed#computable"><code>Computable</code></a><<code>T</code>></td></tr></tbody></table><h4 id="defined-in-7" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-7" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/ba67ff4/src/util/computed.ts#L50" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:50</a></p><hr><h3 id="processcomputable" tabindex="-1">processComputable <a class="header-anchor" href="#processcomputable" aria-label="Permalink to "processComputable""></a></h3><p>▸ <strong>processComputable</strong><<code>T</code>, <code>S</code>>(<code>obj</code>, <code>key</code>): asserts obj is T & { [K in string | number | symbol]: ProcessedComputable<UnwrapComputableType<T[S]>> }</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>obj</code></td><td style="text-align:left;"><code>T</code></td></tr><tr><td style="text-align:left;"><code>key</code></td><td style="text-align:left;"><code>S</code></td></tr></tbody></table><h4 id="defined-in-8" tabindex="-1">Defined in <a class="header-anchor" href="#defined-in-8" aria-label="Permalink to "Defined in""></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/ba67ff4/src/util/computed.ts#L31" target="_blank" rel="noreferrer">profectus/src/util/computed.ts:31</a></p>',60),l=[d];function c(n,i,s,p,h,u){return a(),t("div",null,l)}const m=e(r,[["render",c]]);export{f as __pageData,m as default};
|