Nutrient Web SDK

Class SearchState

The current state of the search indicators inside the web view.

You can update the search state using Instance#setSearchState.

Class

Hierarchy

RecordSearchState

Properties

number

The currently focused result. -1 if no item is focused yet.

Default Value

-1

isFocused

Readonly
boolean

Indicates that the search input has focus.

isLoading

Readonly
boolean

Indicates that we're currently loading search requests.

number

Current minimum search query length. When using the UI or the API function NutrientViewer.Instance#search, any query shorter than this number will not be performed.

In Server mode, this value is retrieved from the server at load time.

The default value is 1 (not configurable) in Standalone mode, and 3 in Server mode (configurable in the server).

results

Readonly

The latest search results. These will be rendered as highlights in the page view.

term

Readonly
string

The current search term. Changing this term will not start a search. Please use NutrientViewer.Instance#startUISearch for that purpose.

Immutable Record API

31
string

The name provided to Record(values, name) can be accessed with displayName.

  • Returns

    IterableIterator<
    [
    keyof { … },
    | string
    | number
    | boolean
    | NutrientViewer.Immutable.List<NutrientViewer.SearchResult>
    ]
    >
  • Returns

    this

    See Also

    • Map#asImmutable

  • Returns

    this

    See Also

    • 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 { … }

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Parameters

    otherunknown

    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 { … }

    Parameters

    keyK
    notSetValueunknown
    Optional

    Returns

    { … }[K]
  • Type Parameters

    T

    Parameters

    keystring
    notSetValueT

    Returns

  • Parameters

    keyPathIterable<unknown>

    Returns

    unknown
  • Parameters

    keystring

    Returns

    key is
    | "minSearchQueryLength"
    | "isFocused"
    | "isLoading"
    | "term"
    | "focusedResultIndex"
    | "results"
  • Returns

    number
  • Parameters

    keyPathIterable<unknown>

    Returns

    boolean
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger(oldVal: unknown, newVal: unknown, key: unknown) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    ...collectionsunknown[]

    Returns

    this
  • Parameters

    merger
    (oldVal: unknown, newVal: unknown, key: keyof { … }) => unknown
    ...collections
    (Iterable<[string, unknown], any, any> | Partial<{ … }>)[]

    Returns

    this
  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK

    Returns

    this
  • Parameters

    keyPathIterable<unknown>

    Returns

    this
  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK
    value
    { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    valueunknown

    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

    { … }
    • focusedResultIndex: number

      The currently focused result. -1 if no item is focused yet.

      Default Value

      -1
    • isFocused: boolean

      Indicates that the search input has focus.

    • isLoading: boolean

      Indicates that we're currently loading search requests.

    • Readonly
      minSearchQueryLength: number

      Current minimum search query length. When using the UI or the API function NutrientViewer.Instance#search, any query shorter than this number will not be performed.

      In Server mode, this value is retrieved from the server at load time.

      The default value is 1 (not configurable) in Standalone mode, and 3 in Server mode (configurable in the server).

    • results: unknown

      The latest search results. These will be rendered as highlights in the page view.

    • term: string

      The current search term. Changing this term will not start a search. Please use NutrientViewer.Instance#startUISearch for that purpose.

  • Shallowly converts this Record to equivalent native JavaScript Object.

    Returns

    { … }
    • focusedResultIndex: number

      The currently focused result. -1 if no item is focused yet.

      Default Value

      -1
    • isFocused: boolean

      Indicates that the search input has focus.

    • isLoading: boolean

      Indicates that we're currently loading search requests.

    • Readonly
      minSearchQueryLength: number

      Current minimum search query length. When using the UI or the API function NutrientViewer.Instance#search, any query shorter than this number will not be performed.

      In Server mode, this value is retrieved from the server at load time.

      The default value is 1 (not configurable) in Standalone mode, and 3 in Server mode (configurable in the server).

    • results: NutrientViewer.Immutable.List<NutrientViewer.SearchResult>

      The latest search results. These will be rendered as highlights in the page view.

    • term: string

      The current search term. Changing this term will not start a search. Please use NutrientViewer.Instance#startUISearch for that purpose.

  • Shallowly converts this Record to equivalent JavaScript Object.

    Returns

    { … }
    • focusedResultIndex: number

      The currently focused result. -1 if no item is focused yet.

      Default Value

      -1
    • isFocused: boolean

      Indicates that the search input has focus.

    • isLoading: boolean

      Indicates that we're currently loading search requests.

    • Readonly
      minSearchQueryLength: number

      Current minimum search query length. When using the UI or the API function NutrientViewer.Instance#search, any query shorter than this number will not be performed.

      In Server mode, this value is retrieved from the server at load time.

      The default value is 1 (not configurable) in Standalone mode, and 3 in Server mode (configurable in the server).

    • results: NutrientViewer.Immutable.List<NutrientViewer.SearchResult>

      The latest search results. These will be rendered as highlights in the page view.

    • term: string

      The current search term. Changing this term will not start a search. Please use NutrientViewer.Instance#startUISearch for that purpose.

  • Type Parameters

    K
    extends keyof { … }

    Parameters

    keyK
    updater
    (value: { … }[K]) => { … }[K]

    Returns

    this
  • Parameters

    keyPathIterable<unknown>
    updater(value: unknown) => unknown

    Returns

    this
  • Returns

    boolean

    See Also

    • 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) => unknown

    Returns

    this

    See Also

    • Map#withMutations