Types
import type { SearchResult, SuggestResult, BaseSearchResults, BaseSearchResponse, SearchResults } from "@arcgis/core/widgets/Search/types.js";
Since
ArcGIS Maps SDK for JavaScript 4.33

A module for importing types used in Search modules.

Type definitions

SearchResult

Type definition

The result object returned from a Search.search().

extent

Property
Type
Extent | null | undefined

The extent, or bounding box, of the returned feature. The value depends on the data source, with higher quality data sources returning extents closer to the feature obtained from the search.

feature

Property
Type
Graphic

The resulting feature or location obtained from the search.

target

Property
Type
Graphic

The target of the result, which is a Graphic used for either MapView goTo() or SceneView goTo() navigation.

name

Property
Type
string

The string name of the geocoded location.

key

Property
Type
string | number | null | undefined

The key related to the suggest result.

sourceIndex

Property
Type
number | null | undefined

The index.

SuggestResult

Type definition

The result object returned from a Search.suggest().

location

Property
Type
Point | undefined

The location of the suggest result.

text

Property
Type
string | null | undefined

The string name of the suggested location to geocode.

key

Property
Type
string | number | null | undefined

The key related to the suggest result.

sourceIndex

Property
Type
number | null | undefined

The index of the currently selected result.

BaseSearchResults

Type definition
Type parameters
<T>

Base interface of common search result properties returned from the Search.search() and Search.suggest() methods.

source

Property
Type
SupportedSearchSource

The source of the selected result.

sourceIndex

Property
Type
number

The source index.

error

Property
Type
EsriError | undefined

The error.

results

Property
Type
T[] | undefined

An array of results.

BaseSearchResponse

Type definition
Type parameters
<T>

Base interface of common response properties returned from the Search.search() and Search.suggest() methods.

activeSourceIndex

Property
Type
number

The index of the source from which suggestions are obtained. This value is -1 when all sources are selected.

searchTerm

Property
Type
string

The searched expression

numResults

Property
Type
number

The number of results.

errors

Property
Type
T[]

An array of errors.

results

Property
Type
T[]

An array of objects representing the results of search.

SearchResults

Type definition

The array of results returned from the Search.search().

SuggestResults

Type definition

The array of results returned from the Search.suggest().

SearchResponse

Type definition

When resolved, returns this response after calling Search.search().

SuggestResponse

Type definition

When resolved, returns this response after calling Search.suggest().

SearchItem

Type definition

SupportedSearchSource

Type definition

SearchDefaultSymbols

Type definition

point

Property
Type
SimpleMarkerSymbol | PictureMarkerSymbol | PointSymbol3D | TextSymbol | CIMSymbol | WebStyleSymbol

A SimpleMarkerSymbol, PictureMarkerSymbol, PointSymbol3D, TextSymbol, CIMSymbol, or WebStyleSymbol used for representing the point geometry that is being drawn for the search result. SimpleMarkerSymbol may also be used to symbolize point features in a SceneView. However, it is recommended you use PointSymbol3D instead.

polygon

Property
Type
SimpleFillSymbol | PolygonSymbol3D | CIMSymbol

A SimpleFillSymbol, PolygonSymbol3D, or CIMSymbol used for representing the polygon geometry that is being drawn for the search result. SimpleFillSymbol may also be used to symbolize polygon features in a SceneView. However, it is recommended you use PolygonSymbol3D instead.

polyline

Property
Type
SimpleLineSymbol | LineSymbol3D | CIMSymbol

A SimpleLineSymbol, LineSymbol3D, or CIMSymbol used for representing the polyline geometry that is being drawn for the search result. SimpleLineSymbol may also be used to symbolize polyline features in a SceneView. However, it is recommended you use LineSymbol3D instead.

SourcesHandler

Type definition

Parameters

ParameterTypeDescriptionRequired
options

The options object.

Returns
Collection<SupportedSearchSource>

SourcesHandlerOptions

Type definition

sources

Property
Type
Collection<SupportedSearchSource>

The collection of sources currently configured in the Search widget.

defaultSources

Property
Type
Collection<SupportedSearchSource>

The collection of default sources for the Search widget.

SearchGeometry

Type definition

SearchFilter

Type definition

geometry

Property
Type
SearchGeometry | undefined

The filter geometry for suggests or search results. Extent is the only supported geometry when working with locator sources. See Find Address Candidates for additional information.

where

Property
Type
string | undefined

The where clause specified for filtering suggests or search results.

GetParameters

Type definition

view

Property
Type
MapViewOrSceneView | null | undefined

Indicates the view provided using the source.

sourceIndex

Property
Type
number | null | undefined

Indicates the index of the search source.

spatialReference

Property
Type
SpatialReference | undefined

Indicates the spatial reference defined by the source.

GetResultsParameters

Type definition
Supertypes
GetParameters

exactMatch

Property
Type
boolean | null | undefined

The key field used to find the result.

location

Property
Type
Point | null | undefined

The location value used by the Search.

maxResults

Property
Type
number | null | undefined

Indicates the maximum number of search results to return.

suggestResult

Property
Type
SuggestResult

Indicates the Suggest Result that triggered the search for a result.

GetResultsCallback

Type definition

Function definition for the SearchSource.getResults property.

Parameters

ParameterTypeDescriptionRequired
params

An object that is passed as a parameter to get search results.

options

Additional options.

Returns
Promise<SearchResult[] | null | undefined>

When resolved, returns an object containing an array of search results.

GetSuggestionsCallback

Type definition

Function definition for the SearchSource.getSuggestions property.

Parameters

ParameterTypeDescriptionRequired
params

An object that is passed as a parameter to get search suggestions.

options

Additional options.

Returns
Promise<SuggestResult[] | null | undefined>

When resolved, returns an object containing an array of suggest results.

GetSuggestionsParameters

Type definition
Supertypes
GetParameters

suggestTerm

Property
Type
string

Indicates search term used to find a suggestion.

maxSuggestions

Property
Type
number | null | undefined

Indicates the maximum number of suggestions to return for the widget's input.