@squareys/webdecks-sdk - v0.0.0
    Preparing search index...

    Class FindSession

    A headless find/replace session over the document body. Created by Document.find. Navigation moves the document selection onto each match; replace rewrites the matching text (adopting the match's leading-run formatting) and repaints. The session is stateful in the engine — one is live at a time, so re-query with FindSession.refresh rather than juggling several. flags bits: 1 = match case, 2 = whole word.

    Index
    • get matchCount(): number

      The number of matches for the current query.

      Returns number

    • get currentIndex(): number

      The index of the highlighted match, or -1 when there is none.

      Returns number

    • Move to the next match (wrapping), selecting it; returns whether one was found.

      Returns boolean

    • Move to the previous match (wrapping), selecting it; returns whether one was found.

      Returns boolean

    • Replace the current match with replacement; returns whether the text changed.

      Parameters

      • replacement: string

      Returns boolean

    • Replace every match with replacement; returns the number of occurrences changed.

      Parameters

      • replacement: string

      Returns number

    • Re-run the search with a new query and/or flags; returns the match count.

      Parameters

      • query: string
      • flags: number = 0

      Returns number