Restate Typescript SDK
    Preparing search index...

    Interface State<TState>

    Read-write state, for handlers running under an ObjectContext or WorkflowContext. Extends SharedState with mutation methods.

    Writes are synchronous in the SDK — the journal entry is recorded immediately, no yield required — so set / clear / clearAll return void rather than Operation<void>.

    interface State<TState extends TypedState = UntypedState> {
        clear<TKey extends string | number | symbol>(
            name: TState extends UntypedState ? string : TKey,
        ): void;
        clearAll(): void;
        get<TValue, TKey extends string | number | symbol = string>(
            name: TState extends UntypedState ? string : TKey,
            serde?: Serde<TState extends UntypedState ? TValue : TState[TKey]>,
        ): Future<(TState extends UntypedState ? TValue : TState[TKey]) | null>;
        keys(): Future<string[]>;
        set<TValue, TKey extends string | number | symbol = string>(
            name: TState extends UntypedState ? string : TKey,
            value: TState extends UntypedState ? TValue : TState[TKey],
            serde?: Serde<TState extends UntypedState ? TValue : TState[TKey]>,
        ): void;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Methods