langchain.js
    Preparing search index...

    Type Alias ExtractUpdateType<Schema, FallbackBase>

    ExtractUpdateType: Schema extends AnnotationRoot<infer SD>
        ? UpdateType<SD>
        : UpdateType<ToStateDefinition<Schema>> extends infer U
            ? [U] extends [never] ? Partial<FallbackBase> : U
            : Partial<FallbackBase>

    Extract the Update type from any supported schema type.

    The Update type represents what a node can return to update the state. All fields are optional since nodes only need to return the fields they modify.

    Supports:

    • StateSchema
    • AnnotationRoot
    • StateDefinition (internal channel definitions)
    • InteropZodObject (Zod v3/v4 object schemas)

    Type Parameters

    • Schema

      The schema type to extract update type from

    • FallbackBase = Schema

      Base type for fallback (will be partialized), defaults to Schema