Sanity Library Reference Docs
    Preparing search index...

    Type Alias CollaborationCommentTargetAlpha

    CollaborationCommentTarget: {
        documentId: string;
        documentRevisionId?: string;
        documentType: string;
    } & (
        | {
            fieldValue?: CollaborationCommentFieldValue;
            path: string;
            range: CollaborationCommentRange;
        }
        | { fieldValue?: never; path?: string; range?: never }
    )

    Target for a top-level comment. Inline selections require both path and range; field-level comments may set path alone.

    The created comment stores this in a different shape: path becomes target.path.field, and range is resolved against the document into target.path.selection and contentSnapshot rather than being stored.

    An optional fieldValue is Portable Text covering the range. When set, the range is resolved from those blocks instead of from the live document.

    Type declaration

    • documentId: string
    • OptionaldocumentRevisionId?: string
    • documentType: string