Nutrient Web SDK
    Preparing search index...

    A text comment made by the user that stems from an existing root annotation.

    Hierarchy

    • Record<
          {
              canSetGroup?: boolean;
              createdAt: Date;
              creatorName: null
              | string;
              customData: null | Record<string, unknown>;
              group?: null | string;
              id: null | string;
              isDeletable?: boolean;
              isEditable?: boolean;
              pageIndex: null | number;
              pdfObjectId: null | number;
              rootId: null | string;
              text: { format: "xhtml" | "plain"; value: null | string };
              updatedAt: Date;
          },
          this,
      > & Readonly<
          {
              canSetGroup?: boolean;
              createdAt: Date;
              creatorName: null
              | string;
              customData: null | Record<string, unknown>;
              group?: null | string;
              id: null | string;
              isDeletable?: boolean;
              isEditable?: boolean;
              pageIndex: null | number;
              pdfObjectId: null | number;
              rootId: null | string;
              text: { format: "xhtml" | "plain"; value: null | string };
              updatedAt: Date;
          },
      >
      • Comment
    Index

    Constructors

    • Parameters

      • Optionaloptions: Partial<
            {
                canSetGroup?: boolean;
                createdAt: Date;
                creatorName: null
                | string;
                customData: null | Record<string, unknown>;
                group?: null | string;
                id: null | string;
                isDeletable?: boolean;
                isEditable?: boolean;
                pageIndex: null | number;
                pdfObjectId: null | number;
                rootId: null | string;
                text: { format: "xhtml" | "plain"; value: null | string };
                updatedAt: Date;
            },
        >

      Returns NutrientViewer.Comment

    Properties

    canSetGroup?: boolean

    This property defines whether the user has permission to edit the group of this comment. The value of this field depends on the set of collaboration permissions defined in the JWT token.

    It is only available when collaboration permissions is enabled on Server-Backed deployments.

    createdAt: Date

    The time when the comment was created.

    creatorName: null | string

    The name of the person who created the comment.

    customData: null | Record<string, unknown>

    Arbitrary JSON-serializable data the user can attach to the comment.

    group?: null | string

    This property is used to define the permission scope for a particular comment.

    It is only available when collaboration permissions is enabled on Server-Backed deployments.

    id: null | string

    A unique identifier for the comment. When comment is created in the UI, the viewer has to generate a unique ID.

    isDeletable?: boolean

    This property defines whether this comment can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

    It is only available when collaboration permissions is enabled on Server-Backed deployments.

    isEditable?: boolean

    This property defines whether this comment can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

    It is only available when collaboration permissions is enabled on Server-Backed deployments.

    pageIndex: null | number

    The page index that this comment resides at.

    pdfObjectId: null | number

    If this comment is from the original PDF, then this ID is from that PDF note annotation that defined the comment.

    rootId: null | string

    The ID of the annotation that this comment stems from. In Nutrient Web SDK, this should be either a NutrientViewer.Annotations.MarkupAnnotation or a NutrientViewer.Annotations.CommentMarkerAnnotation.

    text: { format: "xhtml" | "plain"; value: null | string }

    The text of the comment in xhtml/plain text format.

    In case of XHTML, we support the following tags:

    • <b>: Bold
    • <i>: Italic
    • <span>: Font color, background color and underline using the style attribute (e.g. <span style="color: red; background-color: blue; text-decoration: underline">Hello</span>)
    • p: Paragraph. You can use this to add a newline between paragraphs.
    • a: Link. You can use this to add a link to the comment. The href attribute is required.
    updatedAt: Date

    The time when the comment was last updated.

    Methods

    • Returns IterableIterator<
          [
              keyof {
                  canSetGroup?: boolean;
                  createdAt: Date;
                  creatorName: null
                  | string;
                  customData: null | Record<string, unknown>;
                  group?: null | string;
                  id: null | string;
                  isDeletable?: boolean;
                  isEditable?: boolean;
                  pageIndex: null | number;
                  pdfObjectId: null | number;
                  rootId: null | string;
                  text: { format: "xhtml" | "plain"; value: null | string };
                  updatedAt: Date;
              },
              | undefined
              | null
              | string
              | number
              | boolean
              | Date
              | Record<string, unknown>
              | { format: "xhtml" | "plain"; value: null | string },
          ],
      >

    • Returns this

      Map#asImmutable

    • Returns this

      Map#asMutable

    • Returns a new instance of this Record type with all values set to their default values.

      Returns this

    • Returns a new instance of this Record type with the value for the specific key set to its default value.

      Type Parameters

      • K extends keyof {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }

      Parameters

      • key: K

      Returns this

      remove

    • Parameters

      Returns this

      removeIn

    • Parameters

      • other: any

      Returns boolean

    • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

      If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

      Type Parameters

      • K extends keyof {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }

      Parameters

      • key: K
      • OptionalnotSetValue: any

      Returns {
          canSetGroup?: boolean;
          createdAt: Date;
          creatorName: null | string;
          customData: null | Record<string, unknown>;
          group?: null | string;
          id: null | string;
          isDeletable?: boolean;
          isEditable?: boolean;
          pageIndex: null | number;
          pdfObjectId: null | number;
          rootId: null | string;
          text: { format: "xhtml" | "plain"; value: null | string };
          updatedAt: Date;
      }[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns any

    • A method that returns a set of user IDs that are mentioned in the comment.

      Returns NutrientViewer.Immutable.Set<string>

      An immutable set of user IDs that are mentioned in the comment.

      const ids = comment.getMentionedUserIds()
      
    • Parameters

      • key: string

      Returns key is
          | "id"
          | "pageIndex"
          | "pdfObjectId"
          | "createdAt"
          | "updatedAt"
          | "creatorName"
          | "customData"
          | "isAnonymous"
          | "group"
          | "text"
          | "isEditable"
          | "isDeletable"
          | "canSetGroup"
          | "rootId"

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      • ...collections: (
            | Partial<
                {
                    canSetGroup?: boolean;
                    createdAt: Date;
                    creatorName: null
                    | string;
                    customData: null | Record<string, unknown>;
                    group?: null | string;
                    id: null | string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    pageIndex: null | number;
                    pdfObjectId: null | number;
                    rootId: null | string;
                    text: { format: "xhtml" | "plain"; value: null | string };
                    updatedAt: Date;
                },
            >
            | Iterable<[string, any]>
        )[]

      Returns this

    • Parameters

      • ...collections: (
            | Partial<
                {
                    canSetGroup?: boolean;
                    createdAt: Date;
                    creatorName: null
                    | string;
                    customData: null | Record<string, unknown>;
                    group?: null | string;
                    id: null | string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    pageIndex: null | number;
                    pdfObjectId: null | number;
                    rootId: null | string;
                    text: { format: "xhtml" | "plain"; value: null | string };
                    updatedAt: Date;
                },
            >
            | Iterable<[string, any]>
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: any) => any
      • ...collections: (
            | Partial<
                {
                    canSetGroup?: boolean;
                    createdAt: Date;
                    creatorName: null
                    | string;
                    customData: null | Record<string, unknown>;
                    group?: null | string;
                    id: null | string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    pageIndex: null | number;
                    pdfObjectId: null | number;
                    rootId: null | string;
                    text: { format: "xhtml" | "plain"; value: null | string };
                    updatedAt: Date;
                },
            >
            | Iterable<[string, any]>
        )[]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • ...collections: any[]

      Returns this

    • Parameters

      • merger: (
            oldVal: any,
            newVal: any,
            key: keyof {
                canSetGroup?: boolean;
                createdAt: Date;
                creatorName: null | string;
                customData: null | Record<string, unknown>;
                group?: null | string;
                id: null | string;
                isDeletable?: boolean;
                isEditable?: boolean;
                pageIndex: null | number;
                pdfObjectId: null | number;
                rootId: null | string;
                text: { format: "xhtml" | "plain"; value: null | string };
                updatedAt: Date;
            },
        ) => any
      • ...collections: (
            | Partial<
                {
                    canSetGroup?: boolean;
                    createdAt: Date;
                    creatorName: null
                    | string;
                    customData: null | Record<string, unknown>;
                    group?: null | string;
                    id: null | string;
                    isDeletable?: boolean;
                    isEditable?: boolean;
                    pageIndex: null | number;
                    pdfObjectId: null | number;
                    rootId: null | string;
                    text: { format: "xhtml" | "plain"; value: null | string };
                    updatedAt: Date;
                },
            >
            | Iterable<[string, any]>
        )[]

      Returns this

    • Type Parameters

      • K extends keyof {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends keyof {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }

      Parameters

      • key: K
      • value: {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }[K]

      Returns this

    • Parameters

      Returns this

    • Deeply converts this Record to equivalent native JavaScript Object.

      Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

      Returns {
          canSetGroup?: any;
          createdAt: any;
          creatorName: any;
          customData: any;
          group?: any;
          id: any;
          isDeletable?: any;
          isEditable?: any;
          pageIndex: any;
          pdfObjectId: any;
          rootId: any;
          text: any;
          updatedAt: any;
      }

      • Optional ReadonlycanSetGroup?: any

        This property defines whether the user has permission to edit the group of this comment. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • createdAt: any

        The time when the comment was created.

      • creatorName: any

        The name of the person who created the comment.

      • customData: any

        Arbitrary JSON-serializable data the user can attach to the comment.

      • Optionalgroup?: any

        This property is used to define the permission scope for a particular comment.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • id: any

        A unique identifier for the comment. When comment is created in the UI, the viewer has to generate a unique ID.

      • Optional ReadonlyisDeletable?: any

        This property defines whether this comment can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • Optional ReadonlyisEditable?: any

        This property defines whether this comment can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • pageIndex: any

        The page index that this comment resides at.

      • pdfObjectId: any

        If this comment is from the original PDF, then this ID is from that PDF note annotation that defined the comment.

      • rootId: any

        The ID of the annotation that this comment stems from. In Nutrient Web SDK, this should be either a NutrientViewer.Annotations.MarkupAnnotation or a NutrientViewer.Annotations.CommentMarkerAnnotation.

      • text: any

        The text of the comment in xhtml/plain text format.

        In case of XHTML, we support the following tags:

        • <b>: Bold
        • <i>: Italic
        • <span>: Font color, background color and underline using the style attribute (e.g. <span style="color: red; background-color: blue; text-decoration: underline">Hello</span>)
        • p: Paragraph. You can use this to add a newline between paragraphs.
        • a: Link. You can use this to add a link to the comment. The href attribute is required.
      • updatedAt: any

        The time when the comment was last updated.

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns {
          canSetGroup?: boolean;
          createdAt: Date;
          creatorName: null | string;
          customData: null | Record<string, unknown>;
          group?: null | string;
          id: null | string;
          isDeletable?: boolean;
          isEditable?: boolean;
          pageIndex: null | number;
          pdfObjectId: null | number;
          rootId: null | string;
          text: { format: "xhtml" | "plain"; value: null | string };
          updatedAt: Date;
      }

      • Optional ReadonlycanSetGroup?: boolean

        This property defines whether the user has permission to edit the group of this comment. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • createdAt: Date

        The time when the comment was created.

      • creatorName: null | string

        The name of the person who created the comment.

      • customData: null | Record<string, unknown>

        Arbitrary JSON-serializable data the user can attach to the comment.

      • Optionalgroup?: null | string

        This property is used to define the permission scope for a particular comment.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • id: null | string

        A unique identifier for the comment. When comment is created in the UI, the viewer has to generate a unique ID.

      • Optional ReadonlyisDeletable?: boolean

        This property defines whether this comment can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • Optional ReadonlyisEditable?: boolean

        This property defines whether this comment can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • pageIndex: null | number

        The page index that this comment resides at.

      • pdfObjectId: null | number

        If this comment is from the original PDF, then this ID is from that PDF note annotation that defined the comment.

      • rootId: null | string

        The ID of the annotation that this comment stems from. In Nutrient Web SDK, this should be either a NutrientViewer.Annotations.MarkupAnnotation or a NutrientViewer.Annotations.CommentMarkerAnnotation.

      • text: { format: "xhtml" | "plain"; value: null | string }

        The text of the comment in xhtml/plain text format.

        In case of XHTML, we support the following tags:

        • <b>: Bold
        • <i>: Italic
        • <span>: Font color, background color and underline using the style attribute (e.g. <span style="color: red; background-color: blue; text-decoration: underline">Hello</span>)
        • p: Paragraph. You can use this to add a newline between paragraphs.
        • a: Link. You can use this to add a link to the comment. The href attribute is required.
      • updatedAt: Date

        The time when the comment was last updated.

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns {
          canSetGroup?: boolean;
          createdAt: Date;
          creatorName: null | string;
          customData: null | Record<string, unknown>;
          group?: null | string;
          id: null | string;
          isDeletable?: boolean;
          isEditable?: boolean;
          pageIndex: null | number;
          pdfObjectId: null | number;
          rootId: null | string;
          text: { format: "xhtml" | "plain"; value: null | string };
          updatedAt: Date;
      }

      • Optional ReadonlycanSetGroup?: boolean

        This property defines whether the user has permission to edit the group of this comment. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • createdAt: Date

        The time when the comment was created.

      • creatorName: null | string

        The name of the person who created the comment.

      • customData: null | Record<string, unknown>

        Arbitrary JSON-serializable data the user can attach to the comment.

      • Optionalgroup?: null | string

        This property is used to define the permission scope for a particular comment.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • id: null | string

        A unique identifier for the comment. When comment is created in the UI, the viewer has to generate a unique ID.

      • Optional ReadonlyisDeletable?: boolean

        This property defines whether this comment can be deleted or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • Optional ReadonlyisEditable?: boolean

        This property defines whether this comment can be edited or not. The value of this field depends on the set of collaboration permissions defined in the JWT token.

        It is only available when collaboration permissions is enabled on Server-Backed deployments.

      • pageIndex: null | number

        The page index that this comment resides at.

      • pdfObjectId: null | number

        If this comment is from the original PDF, then this ID is from that PDF note annotation that defined the comment.

      • rootId: null | string

        The ID of the annotation that this comment stems from. In Nutrient Web SDK, this should be either a NutrientViewer.Annotations.MarkupAnnotation or a NutrientViewer.Annotations.CommentMarkerAnnotation.

      • text: { format: "xhtml" | "plain"; value: null | string }

        The text of the comment in xhtml/plain text format.

        In case of XHTML, we support the following tags:

        • <b>: Bold
        • <i>: Italic
        • <span>: Font color, background color and underline using the style attribute (e.g. <span style="color: red; background-color: blue; text-decoration: underline">Hello</span>)
        • p: Paragraph. You can use this to add a newline between paragraphs.
        • a: Link. You can use this to add a link to the comment. The href attribute is required.
      • updatedAt: Date

        The time when the comment was last updated.

    • Returns Keyed<
          keyof {
              canSetGroup?: boolean;
              createdAt: Date;
              creatorName: null
              | string;
              customData: null | Record<string, unknown>;
              group?: null | string;
              id: null | string;
              isDeletable?: boolean;
              isEditable?: boolean;
              pageIndex: null | number;
              pdfObjectId: null | number;
              rootId: null | string;
              text: { format: "xhtml" | "plain"; value: null | string };
              updatedAt: Date;
          },
          | undefined
          | null
          | string
          | number
          | boolean
          | Date
          | Record<string, unknown>
          | { format: "xhtml" | "plain"; value: null | string },
      >

    • Type Parameters

      • K extends keyof {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }

      Parameters

      • key: K
      • updater: (
            value: {
                canSetGroup?: boolean;
                createdAt: Date;
                creatorName: null | string;
                customData: null | Record<string, unknown>;
                group?: null | string;
                id: null | string;
                isDeletable?: boolean;
                isEditable?: boolean;
                pageIndex: null | number;
                pdfObjectId: null | number;
                rootId: null | string;
                text: { format: "xhtml" | "plain"; value: null | string };
                updatedAt: Date;
            }[K],
        ) => {
            canSetGroup?: boolean;
            createdAt: Date;
            creatorName: null
            | string;
            customData: null | Record<string, unknown>;
            group?: null | string;
            id: null | string;
            isDeletable?: boolean;
            isEditable?: boolean;
            pageIndex: null | number;
            pdfObjectId: null | number;
            rootId: null | string;
            text: { format: "xhtml" | "plain"; value: null | string };
            updatedAt: Date;
        }[K]

      Returns this

    • Parameters

      • keyPath: Iterable<any>
      • updater: (value: any) => any

      Returns this

    • Returns boolean

      Map#wasAltered

    • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

      Parameters

      • mutator: (mutable: this) => any

      Returns this

      Map#withMutations