Skip to content
On this page

Module: util/computed

Type Aliases

Computable

Ƭ Computable<T>: T | Ref<T> | () => T

Type parameters

Name
T

Defined in

profectus/src/util/computed.ts:8


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:22


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:10


GetComputableTypeWithDefault

Ƭ GetComputableTypeWithDefault<T, S>: undefined extends T ? S : GetComputableType<NonNullable<T>>

Type parameters

Name
T
S

Defined in

profectus/src/util/computed.ts:17


ProcessedComputable

Ƭ ProcessedComputable<T>: T | Ref<T>

Type parameters

Name
T

Defined in

profectus/src/util/computed.ts:9


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:20

Variables

DoNotCache

Const DoNotCache: typeof DoNotCache

Defined in

profectus/src/util/computed.ts:6

Functions

convertComputable

convertComputable<T>(obj): ProcessedComputable<T>

NameType
objComputable<T>

Defined in

profectus/src/util/computed.ts:50


processComputable

processComputable<T, S>(obj, key): asserts obj is T & { [K in string | number | symbol]: ProcessedComputable<UnwrapComputableType<T[S]>> }

NameType
objT
keyS

Defined in

profectus/src/util/computed.ts:31