Nutrient Web SDK
    Preparing search index...

    Class TextSelection

    Information about the currently selected text in the PDF. You can listen for changes using the NutrientViewer.EventName.TEXT_SELECTION_CHANGE.

    Example

    Read the currently selected text of an Instance

    const textSelection = instance.getTextSelection();
    textSelection.getText().then(text => console.log(text));
    

    Register a "textSelection.change" event listener

    instance.addEventListener("textSelection.change", (textSelection) => {
      if (textSelection) {
        console.log("text is selected");
      } else {
        console.log("no text is selected");
      }
    });
    

    Hierarchy

    • Record<
          {
              endNestedContentBlockId: string
              | null;
              endNode: Text | null;
              endOffset: number | null;
              endPageIndex: number | null;
              endTextLineId: number | null;
              getBoundingClientRect:
                  | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                  | null;
              getSelectedRectsPerPage:
                  | (
                      () => Promise<
                          NutrientViewer.Immutable.List<
                              {
                                  pageIndex: number;
                                  rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                              },
                          >,
                      >
                  )
                  | null;
              getSelectedTextLines: | (
                  () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
              )
              | null;
              getText: (() => Promise<string>) | null;
              startNestedContentBlockId: string | null;
              startNode: Text | null;
              startOffset: number | null;
              startPageIndex: number | null;
              startTextLineId: number | null;
          },
          this,
      > & Readonly<
          {
              endNestedContentBlockId: string
              | null;
              endNode: Text | null;
              endOffset: number | null;
              endPageIndex: number | null;
              endTextLineId: number | null;
              getBoundingClientRect:
                  | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                  | null;
              getSelectedRectsPerPage:
                  | (
                      () => Promise<
                          NutrientViewer.Immutable.List<
                              {
                                  pageIndex: number;
                                  rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                              },
                          >,
                      >
                  )
                  | null;
              getSelectedTextLines: | (
                  () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
              )
              | null;
              getText: (() => Promise<string>) | null;
              startNestedContentBlockId: string | null;
              startNode: Text | null;
              startOffset: number | null;
              startPageIndex: number | null;
              startTextLineId: number | null;
          },
      >
      • TextSelection
    Index

    Properties

    endNestedContentBlockId: string

    The NutrientViewer.TextLine#id of the last text line of this text selection.

    endNode: Text

    The HTML Text node at the end of this text selection.

    endOffset: number

    The HTML Text node offset of at the end of this text selection.

    endPageIndex: number

    The page index where the text selection ends.

    endTextLineId: number

    The NutrientViewer.TextLine#id of the last text line of this text selection.

    getBoundingClientRect: () => Promise<NutrientViewer.Geometry.Rect | null>

    Returns the bounding box in client coordinates of the current text selection, or null if the selection has been programmatically collapsed.

    Type Declaration

    const textSelection = instance.getTextSelection();
    textSelection.getBoundingClientRect().then(rect => console.log(rect));
    getSelectedRectsPerPage: () => Promise<
        NutrientViewer.Immutable.List<
            {
                pageIndex: number;
                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
            },
        >,
    >

    Returns the individually selected text rectangles in the PDF page space for each page. This can be used to create e.g. NutrientViewer.Annotations.MarkupAnnotations at the current selection.

    Type Declaration

    const textSelection = instance.getTextSelection();
    textSelection.getSelectedRectsPerPage().then(rectsPerPage => {
    rectsPerPage.map(({ pageIndex, rects }) => {
    // We need to create one annotation per page.
    const annotation = new NutrientViewer.Annotations.HighlightAnnotation({
    pageIndex,
    boundingBox: NutrientViewer.Geometry.Rect.union(rects),
    rects,
    });
    instance.create(annotation);
    });
    });
    getSelectedTextLines: () => Promise<
        NutrientViewer.Immutable.List<NutrientViewer.TextLine>,
    >

    Returns an immutable list of all NutrientViewer.TextLines of this text selection.

    Type Declaration

    const textSelection = instance.getTextSelection();
    textSelection.getSelectedTextLines().then(lines => console.log(lines));
    getText: () => Promise<string>

    Returns the text of this text selection. Text blocks will be joined by a new line character (\n).

    Type Declaration

      • (): Promise<string>
      • Returns Promise<string>

        A promise that resolves to the text.

    const textSelection = instance.getTextSelection();
    textSelection.getText().then(text => console.log(text));
    startNestedContentBlockId: string

    The NutrientViewer.TextLine#id of the first text line of this text selection.

    startNode: Text

    The HTML Text node at the start of this text selection.

    startOffset: number

    The HTML Text node offset of at the start of this text selection.

    startPageIndex: number

    The page index where the text selection starts.

    startTextLineId: number

    The NutrientViewer.TextLine#id of the first text line of this text selection.

    Methods

    • Returns IterableIterator<
          [
              keyof {
                  endNestedContentBlockId: string
                  | null;
                  endNode: Text | null;
                  endOffset: number | null;
                  endPageIndex: number | null;
                  endTextLineId: number | null;
                  getBoundingClientRect:
                      | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                      | null;
                  getSelectedRectsPerPage:
                      | (
                          () => Promise<
                              NutrientViewer.Immutable.List<
                                  {
                                      pageIndex: number;
                                      rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                  },
                              >,
                          >
                      )
                      | null;
                  getSelectedTextLines: | (
                      () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                  )
                  | null;
                  getText: (() => Promise<string>) | null;
                  startNestedContentBlockId: string | null;
                  startNode: Text | null;
                  startOffset: number | null;
                  startPageIndex: number | null;
                  startTextLineId: number | null;
              },
              | string
              | number
              | Text
              | (() => Promise<string>)
              | (() => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>)
              | (() => Promise<NutrientViewer.Geometry.Rect | null>)
              | (
                  () => Promise<
                      NutrientViewer.Immutable.List<
                          {
                              pageIndex: number;
                              rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                          },
                      >,
                  >
              )
              | null,
          ],
      >

    • 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 {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }

      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 {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }

      Parameters

      • key: K
      • OptionalnotSetValue: any

      Returns {
          endNestedContentBlockId: string | null;
          endNode: Text | null;
          endOffset: number | null;
          endPageIndex: number | null;
          endTextLineId: number | null;
          getBoundingClientRect:
              | (() => Promise<NutrientViewer.Geometry.Rect | null>)
              | null;
          getSelectedRectsPerPage:
              | (
                  () => Promise<
                      NutrientViewer.Immutable.List<
                          {
                              pageIndex: number;
                              rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                          },
                      >,
                  >
              )
              | null;
          getSelectedTextLines: | (
              () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
          )
          | null;
          getText: (() => Promise<string>) | null;
          startNestedContentBlockId: string | null;
          startNode: Text | null;
          startOffset: number | null;
          startPageIndex: number | null;
          startTextLineId: number | null;
      }[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns any

    • Parameters

      • key: string

      Returns key is
          | "startTextLineId"
          | "startNestedContentBlockId"
          | "startPageIndex"
          | "startNode"
          | "startOffset"
          | "endNestedContentBlockId"
          | "endTextLineId"
          | "endPageIndex"
          | "endNode"
          | "endOffset"
          | "getText"
          | "getSelectedTextLines"
          | "getBoundingClientRect"
          | "getSelectedRectsPerPage"

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      • ...collections: (
            | Iterable<[string, any], any, any>
            | Partial<
                {
                    endNestedContentBlockId: string
                    | null;
                    endNode: Text | null;
                    endOffset: number | null;
                    endPageIndex: number | null;
                    endTextLineId: number | null;
                    getBoundingClientRect:
                        | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                        | null;
                    getSelectedRectsPerPage:
                        | (
                            () => Promise<
                                NutrientViewer.Immutable.List<
                                    {
                                        pageIndex: number;
                                        rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                    },
                                >,
                            >
                        )
                        | null;
                    getSelectedTextLines: | (
                        () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                    )
                    | null;
                    getText: (() => Promise<string>) | null;
                    startNestedContentBlockId: string | null;
                    startNode: Text | null;
                    startOffset: number | null;
                    startPageIndex: number | null;
                    startTextLineId: number | null;
                },
            >
        )[]

      Returns this

    • Parameters

      • ...collections: (
            | Iterable<[string, any], any, any>
            | Partial<
                {
                    endNestedContentBlockId: string
                    | null;
                    endNode: Text | null;
                    endOffset: number | null;
                    endPageIndex: number | null;
                    endTextLineId: number | null;
                    getBoundingClientRect:
                        | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                        | null;
                    getSelectedRectsPerPage:
                        | (
                            () => Promise<
                                NutrientViewer.Immutable.List<
                                    {
                                        pageIndex: number;
                                        rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                    },
                                >,
                            >
                        )
                        | null;
                    getSelectedTextLines: | (
                        () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                    )
                    | null;
                    getText: (() => Promise<string>) | null;
                    startNestedContentBlockId: string | null;
                    startNode: Text | null;
                    startOffset: number | null;
                    startPageIndex: number | null;
                    startTextLineId: number | null;
                },
            >
        )[]

      Returns this

    • Parameters

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

      Returns this

    • Parameters

      • merger: (oldVal: any, newVal: any, key: any) => any
      • ...collections: (
            | Iterable<[string, any], any, any>
            | Partial<
                {
                    endNestedContentBlockId: string
                    | null;
                    endNode: Text | null;
                    endOffset: number | null;
                    endPageIndex: number | null;
                    endTextLineId: number | null;
                    getBoundingClientRect:
                        | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                        | null;
                    getSelectedRectsPerPage:
                        | (
                            () => Promise<
                                NutrientViewer.Immutable.List<
                                    {
                                        pageIndex: number;
                                        rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                    },
                                >,
                            >
                        )
                        | null;
                    getSelectedTextLines: | (
                        () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                    )
                    | null;
                    getText: (() => Promise<string>) | null;
                    startNestedContentBlockId: string | null;
                    startNode: Text | null;
                    startOffset: number | null;
                    startPageIndex: number | null;
                    startTextLineId: number | null;
                },
            >
        )[]

      Returns this

    • Parameters

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

      Returns this

    • Parameters

      • merger: (
            oldVal: any,
            newVal: any,
            key: keyof {
                endNestedContentBlockId: string | null;
                endNode: Text | null;
                endOffset: number | null;
                endPageIndex: number | null;
                endTextLineId: number | null;
                getBoundingClientRect:
                    | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                    | null;
                getSelectedRectsPerPage:
                    | (
                        () => Promise<
                            NutrientViewer.Immutable.List<
                                {
                                    pageIndex: number;
                                    rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                },
                            >,
                        >
                    )
                    | null;
                getSelectedTextLines: | (
                    () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                )
                | null;
                getText: (() => Promise<string>) | null;
                startNestedContentBlockId: string | null;
                startNode: Text | null;
                startOffset: number | null;
                startPageIndex: number | null;
                startTextLineId: number | null;
            },
        ) => any
      • ...collections: (
            | Iterable<[string, any], any, any>
            | Partial<
                {
                    endNestedContentBlockId: string
                    | null;
                    endNode: Text | null;
                    endOffset: number | null;
                    endPageIndex: number | null;
                    endTextLineId: number | null;
                    getBoundingClientRect:
                        | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                        | null;
                    getSelectedRectsPerPage:
                        | (
                            () => Promise<
                                NutrientViewer.Immutable.List<
                                    {
                                        pageIndex: number;
                                        rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                    },
                                >,
                            >
                        )
                        | null;
                    getSelectedTextLines: | (
                        () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                    )
                    | null;
                    getText: (() => Promise<string>) | null;
                    startNestedContentBlockId: string | null;
                    startNode: Text | null;
                    startOffset: number | null;
                    startPageIndex: number | null;
                    startTextLineId: number | null;
                },
            >
        )[]

      Returns this

    • Type Parameters

      • K extends keyof {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends keyof {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }

      Parameters

      • key: K
      • value: {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }[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 {
          endNestedContentBlockId: any;
          endNode: any;
          endOffset: any;
          endPageIndex: any;
          endTextLineId: any;
          getBoundingClientRect: any;
          getSelectedRectsPerPage: any;
          getSelectedTextLines: any;
          getText: any;
          startNestedContentBlockId: any;
          startNode: any;
          startOffset: any;
          startPageIndex: any;
          startTextLineId: any;
      }

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns {
          endNestedContentBlockId: string | null;
          endNode: Text | null;
          endOffset: number | null;
          endPageIndex: number | null;
          endTextLineId: number | null;
          getBoundingClientRect:
              | (() => Promise<NutrientViewer.Geometry.Rect | null>)
              | null;
          getSelectedRectsPerPage:
              | (
                  () => Promise<
                      NutrientViewer.Immutable.List<
                          {
                              pageIndex: number;
                              rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                          },
                      >,
                  >
              )
              | null;
          getSelectedTextLines: | (
              () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
          )
          | null;
          getText: (() => Promise<string>) | null;
          startNestedContentBlockId: string | null;
          startNode: Text | null;
          startOffset: number | null;
          startPageIndex: number | null;
          startTextLineId: number | null;
      }

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns {
          endNestedContentBlockId: string | null;
          endNode: Text | null;
          endOffset: number | null;
          endPageIndex: number | null;
          endTextLineId: number | null;
          getBoundingClientRect:
              | (() => Promise<NutrientViewer.Geometry.Rect | null>)
              | null;
          getSelectedRectsPerPage:
              | (
                  () => Promise<
                      NutrientViewer.Immutable.List<
                          {
                              pageIndex: number;
                              rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                          },
                      >,
                  >
              )
              | null;
          getSelectedTextLines: | (
              () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
          )
          | null;
          getText: (() => Promise<string>) | null;
          startNestedContentBlockId: string | null;
          startNode: Text | null;
          startOffset: number | null;
          startPageIndex: number | null;
          startTextLineId: number | null;
      }

    • Returns Keyed<
          keyof {
              endNestedContentBlockId: string
              | null;
              endNode: Text | null;
              endOffset: number | null;
              endPageIndex: number | null;
              endTextLineId: number | null;
              getBoundingClientRect:
                  | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                  | null;
              getSelectedRectsPerPage:
                  | (
                      () => Promise<
                          NutrientViewer.Immutable.List<
                              {
                                  pageIndex: number;
                                  rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                              },
                          >,
                      >
                  )
                  | null;
              getSelectedTextLines: | (
                  () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
              )
              | null;
              getText: (() => Promise<string>) | null;
              startNestedContentBlockId: string | null;
              startNode: Text | null;
              startOffset: number | null;
              startPageIndex: number | null;
              startTextLineId: number | null;
          },
          | string
          | number
          | Text
          | (() => Promise<string>)
          | (() => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>)
          | (() => Promise<NutrientViewer.Geometry.Rect | null>)
          | (
              () => Promise<
                  NutrientViewer.Immutable.List<
                      {
                          pageIndex: number;
                          rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                      },
                  >,
              >
          )
          | null,
      >

    • Type Parameters

      • K extends keyof {
            endNestedContentBlockId: string | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }

      Parameters

      • key: K
      • updater: (
            value: {
                endNestedContentBlockId: string | null;
                endNode: Text | null;
                endOffset: number | null;
                endPageIndex: number | null;
                endTextLineId: number | null;
                getBoundingClientRect:
                    | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                    | null;
                getSelectedRectsPerPage:
                    | (
                        () => Promise<
                            NutrientViewer.Immutable.List<
                                {
                                    pageIndex: number;
                                    rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                                },
                            >,
                        >
                    )
                    | null;
                getSelectedTextLines: | (
                    () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
                )
                | null;
                getText: (() => Promise<string>) | null;
                startNestedContentBlockId: string | null;
                startNode: Text | null;
                startOffset: number | null;
                startPageIndex: number | null;
                startTextLineId: number | null;
            }[K],
        ) => {
            endNestedContentBlockId: string
            | null;
            endNode: Text | null;
            endOffset: number | null;
            endPageIndex: number | null;
            endTextLineId: number | null;
            getBoundingClientRect:
                | (() => Promise<NutrientViewer.Geometry.Rect | null>)
                | null;
            getSelectedRectsPerPage:
                | (
                    () => Promise<
                        NutrientViewer.Immutable.List<
                            {
                                pageIndex: number;
                                rects: NutrientViewer.Immutable.List<NutrientViewer.Geometry.Rect>;
                            },
                        >,
                    >
                )
                | null;
            getSelectedTextLines: | (
                () => Promise<NutrientViewer.Immutable.List<NutrientViewer.TextLine>>
            )
            | null;
            getText: (() => Promise<string>) | null;
            startNestedContentBlockId: string | null;
            startNode: Text | null;
            startOffset: number | null;
            startPageIndex: number | null;
            startTextLineId: number | null;
        }[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