profectus-docs/assets/api_modules_util_computed.md.88db1dec.js

1 line
10 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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 &quot;Module: util/computed&quot;"></a></h1><h2 id="type-aliases" tabindex="-1">Type Aliases <a class="header-anchor" href="#type-aliases" aria-label="Permalink to &quot;Type Aliases&quot;"></a></h2><h3 id="computable" tabindex="-1">Computable <a class="header-anchor" href="#computable" aria-label="Permalink to &quot;Computable&quot;"></a></h3><p>Ƭ <strong>Computable</strong>&lt;<code>T</code>&gt;: <code>T</code> | <code>Ref</code>&lt;<code>T</code>&gt; | () =&gt; <code>T</code></p><h4 id="type-parameters" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters" aria-label="Permalink to &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;ComputableKeysOf&quot;"></a></h3><p>Ƭ <strong>ComputableKeysOf</strong>&lt;<code>T</code>&gt;: <a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#picktype-keys" target="_blank" rel="noreferrer"><code>Pick</code></a>&lt;<code>T</code>, { [K in keyof T]: T[K] extends Computable&lt;unknown&gt; ? K : never }[keyof <code>T</code>]&gt;</p><h4 id="type-parameters-1" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-1" aria-label="Permalink to &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;GetComputableType&quot;"></a></h3><p>Ƭ <strong>GetComputableType</strong>&lt;<code>T</code>&gt;: <code>T</code> extends { <code>[DoNotCache]</code>: <code>true</code> } ? <code>T</code> : <code>T</code> extends () =&gt; infer S ? <code>Ref</code>&lt;<code>S</code>&gt; : <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 &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;GetComputableTypeWithDefault&quot;"></a></h3><p>Ƭ <strong>GetComputableTypeWithDefault</strong>&lt;<code>T</code>, <code>S</code>&gt;: <code>undefined</code> extends <code>T</code> ? <code>S</code> : <a href="./computed#getcomputabletype"><code>GetComputableType</code></a>&lt;<a href="https://www.typescriptlang.org/docs/handbook/utility-types.html#nonnullabletype" target="_blank" rel="noreferrer"><code>NonNullable</code></a>&lt;<code>T</code>&gt;&gt;</p><h4 id="type-parameters-3" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-3" aria-label="Permalink to &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;ProcessedComputable&quot;"></a></h3><p>Ƭ <strong>ProcessedComputable</strong>&lt;<code>T</code>&gt;: <code>T</code> | <code>Ref</code>&lt;<code>T</code>&gt;</p><h4 id="type-parameters-4" tabindex="-1">Type parameters <a class="header-anchor" href="#type-parameters-4" aria-label="Permalink to &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;UnwrapComputableType&quot;"></a></h3><p>Ƭ <strong>UnwrapComputableType</strong>&lt;<code>T</code>&gt;: <code>T</code> extends <code>Ref</code>&lt;infer S&gt; ? <code>S</code> : <code>T</code> extends () =&gt; 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 &quot;Type parameters&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;Variables&quot;"></a></h2><h3 id="donotcache" tabindex="-1">DoNotCache <a class="header-anchor" href="#donotcache" aria-label="Permalink to &quot;DoNotCache&quot;"></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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;Functions&quot;"></a></h2><h3 id="convertcomputable" tabindex="-1">convertComputable <a class="header-anchor" href="#convertcomputable" aria-label="Permalink to &quot;convertComputable&quot;"></a></h3><p>▸ <strong>convertComputable</strong>&lt;<code>T</code>&gt;(<code>obj</code>): <a href="./computed#processedcomputable"><code>ProcessedComputable</code></a>&lt;<code>T</code>&gt;</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>&lt;<code>T</code>&gt;</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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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 &quot;processComputable&quot;"></a></h3><p>▸ <strong>processComputable</strong>&lt;<code>T</code>, <code>S</code>&gt;(<code>obj</code>, <code>key</code>): asserts obj is T &amp; { [K in string | number | symbol]: ProcessedComputable&lt;UnwrapComputableType&lt;T[S]&gt;&gt; }</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 &quot;Defined in&quot;"></a></h4><p><a href="https://github.com/profectus-engine/Profectus/blob/b666e0c/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};