Restate Typescript SDK
    Preparing search index...

    Serializer/deserializer pair for any Restate-managed value of type T — handler inputs and outputs, service state, side-effect results, awakeables, durable promises, and so on.

    A Serde<T> is responsible for two conversions:

    • Wire format: serialize / deserialize convert a value T to and from the raw bytes that flow over the network and get stored in the journal.
    • JSON preview (optional): preview.toJsonString / preview.fromJsonString convert a value T to and from a JSON string, used by tooling to render and edit values that humans can read.

    It also advertises metadata (contentType, jsonSchema) that surfaces in service discovery.

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Properties

    contentType: string = "application/json"

    MIME type of the bytes produced by serialize (and accepted by deserialize).

    jsonSchema?: object

    Optional JSON Schema describing the logical shape of T. Surfaced in discovery so that tooling can generate forms, auto-complete payloads, etc. Has no effect on serialization at runtime.

    Methods

    • Convert a value of type T into its on-the-wire bytes. This is the format Restate sends between services and persists in the journal.

      Must be the inverse of deserializedeserialize(serialize(v)) should produce a value equivalent to v.

      Parameters

      • value: T

      Returns Uint8Array