Skip to main content
Version: v1

Serializable TypeAlias

Used to constrain a type 'T' to types that Fluid can intrinsically serialize. Produces a compile-time error if T contains non-serializable members.

Signature

export declare type Serializable<T = any> = Jsonable<T, IFluidHandle>;

Type Parameters

Parameter Default Description
T any

Remarks

See Jsonable for caveats regarding serialization of undefined, non-finite numbers, and circular references.

Important: T extends Serializable<T> is generally incorrect. (Any value of T extends the serializable subset of itself.)

Example

Typical usage:

function serialize<T>(value: Serializable<T>) { ... }