Module: util/computed
Type aliases
Computable
Ƭ Computable<T
>: T
| Ref
<T
> | () => T
Type parameters
Name |
---|
T |
Defined in
profectus/src/util/computed.ts:6
ComputableKeysOf
Ƭ ComputableKeysOf<T
>: Pick
<T
, { [K
in keyof T
]: T
[K
] extends Computable
<unknown
> ? K
: never
}[keyof T
]>
Type parameters
Name |
---|
T |
Defined in
profectus/src/util/computed.ts:20
GetComputableType
Ƭ GetComputableType<T
>: T
extends { [DoNotCache]
: true
} ? T
: T
extends () => infer S ? Ref
<S
> : undefined
extends T
? undefined
: T
Type parameters
Name |
---|
T |
Defined in
profectus/src/util/computed.ts:8
GetComputableTypeWithDefault
Ƭ GetComputableTypeWithDefault<T
, S
>: undefined
extends T
? S
: GetComputableType
<NonNullable
<T
>>
Type parameters
Name |
---|
T |
S |
Defined in
profectus/src/util/computed.ts:15
ProcessedComputable
Ƭ ProcessedComputable<T
>: T
| Ref
<T
>
Type parameters
Name |
---|
T |
Defined in
profectus/src/util/computed.ts:7
UnwrapComputableType
Ƭ UnwrapComputableType<T
>: T
extends Ref
<infer S> ? S
: T
extends () => infer S ? S
: T
Type parameters
Name |
---|
T |
Defined in
profectus/src/util/computed.ts:18
Variables
DoNotCache
• Const
DoNotCache: typeof DoNotCache
Defined in
profectus/src/util/computed.ts:4
Functions
convertComputable
▸ convertComputable<T
>(obj
): ProcessedComputable
<T
>
Type parameters
Name |
---|
T |
Parameters
Name | Type |
---|---|
obj | Computable <T > |
Returns
Defined in
profectus/src/util/computed.ts:42
processComputable
▸ processComputable<T
, S
>(obj
, key
): asserts obj
is T
& { [K
in string
| number
| symbol
]: ProcessedComputable
<UnwrapComputableType
<T
[S
]>> }
Type parameters
Name | Type |
---|---|
T | T |
S | extends string | number | symbol |
Parameters
Name | Type |
---|---|
obj | T |
key | S |
Returns
asserts obj
is T
& { [K
in string
| number
| symbol
]: ProcessedComputable
<UnwrapComputableType
<T
[S
]>> }