Sanity Library Reference Docs
    Preparing search index...

    Interface ObjectFormNode<T, S>

    interface ObjectFormNode<
        T = { [key in string]: unknown },
        S extends ObjectSchemaType = ObjectSchemaType,
    > {
        __unstable_computeDiff: ComputeDiff<ProvenanceDiffAnnotation>;
        changed: boolean;
        compareValue?: T;
        displayInlineChanges?: boolean;
        focused?: boolean;
        focusPath: Path;
        groups: FormFieldGroup[];
        hasUpstreamVersion: boolean;
        id: string;
        level: number;
        members: ObjectMember[];
        path: Path;
        presence: FormNodePresence[];
        readOnly?: boolean;
        schemaType: S & { renderMembers?: ObjectRenderMembersCallback };
        validation: FormNodeValidation[];
        value: T;
    }

    Type Parameters

    Hierarchy (View Summary)

    Index

    Properties

    __unstable_computeDiff: ComputeDiff<ProvenanceDiffAnnotation>

    A function that takes any value and produces a diff between that value and the value the node is being compared to.

    This can be used to compute a diff optimistically.

    This is marked as unstable because the API may need to evolve as we iterate on the advanced version control functionality. It will be stabilised when that project has matured.

    changed: boolean

    Whether the current value is different to the value the node is being compared to.

    compareValue?: T

    The value the node is currently being compared to. This is taken from the upstream version, if the document has an upstream version. Otherwise, it's taken from the document's current value.

    You can use the hasUpstreamVersion prop to determine whether the document has an upstream version.

    displayInlineChanges?: boolean
    focused?: boolean

    Whether the node is focused.

    focusPath: Path

    The focus path of the form node.

    groups: FormFieldGroup[]
    hasUpstreamVersion: boolean

    Whether the document has an upstream version.

    id: string

    The unique identifier of the node.

    level: number

    The level of the node in the form hierarchy.

    members: ObjectMember[]
    path: Path

    The path of the node in the form hierarchy.

    presence: FormNodePresence[]
    readOnly?: boolean

    Whether the node is read-only.

    schemaType: S & { renderMembers?: ObjectRenderMembersCallback }

    The schema type of the node.

    validation: FormNodeValidation[]

    The validation markers of the node.

    value: T

    The value of the node.