API reference@evolu/common › Types

TypeScript utility types.

Functions

FunctionDescription
instanceCreates the runtime identity property required by Instance.
isInstanceCreates a realm-neutral predicate for one Instance name.
isPromiseLikeType guard to check if a value is a PromiseLike.

Interfaces

InterfaceDescription
InstanceRealm-neutral runtime identity for a TypeScript interface.
ValueWithLengthA value with a numeric length.

Type Aliases

Type AliasDescription
AwaitableA value that can be awaited.
CallbackA function that receives a value and returns nothing.
CallbackWithTeardownA function that receives a value and optionally returns a teardown function.
CompileTimeErrorCreates a readable compiler-facing error message.
DistributiveOmitRemoves keys from each member of a union.
IsSameTypeReturns whether two types are identical according to TypeScript.
IsUnionReturns whether a type is a union.
KeysOfUnionReturns every property key present in any member of a union.
LiteralString, number, bigint, boolean, undefined, null
NullablePartialMakes properties optional if they accept null as a value.
ParameterIntersectionIntersects the parameter types of a union of unary functions.
PartialPropMakes a specific property of an object optional while keeping others unchanged.
PredicateChecks a condition on a value and returns a boolean.
PredicateWithIndexChecks a condition on a value at a given index and returns a boolean.
RefinementA type guard function that refines type A to a narrower type B.
RefinementWithIndexA type guard function that refines type A to a narrower type B at a given index.
SimplifySimplify an intersection type into a single mapped type.
UnionToIntersectionConverts a union to an intersection.
WidenLiteralInfers a broader type from a specific literal value type.
WritableRemoves readonly modifier from all properties of a type.