# SearchProvider

Finds places by name. Implementations throw `SearchError` for offline,
rate-limited or failed requests and `PortAbortError` when the signal fires.
When a search runs, and cancelling a superseded one, belong to one ui hook.
A service's own usage limits (such as Nominatim's one request per second)
belong to its implementation, since every caller shares them.

This is an interface exported by `@mapcairn/sdk/browser`, checked against version 0.2.0.

## Signature

```ts
import type { SearchProvider } from "@mapcairn/sdk/browser";
 
interface SearchProvider
```

## Methods

### reverse

```ts
reverse(position: LatLng, options?: Pick<SearchOptions, "signal">): Promise<SearchResult | null>;
```

Finds the place at a position, or `null` when there is none.

- `position` (`LatLng`)
- `options?` (`Pick<SearchOptions, "signal">`)

### search

```ts
search(query: string, options?: SearchOptions): Promise<readonly SearchResult[]>;
```

Finds places that match the text. A blank query resolves to an empty list.

- `query` (`string`)
- `options?` (`SearchOptions`)

## See also

- [`LatLng`](https://docs.mapcairn.com/api/sdk/browser/LatLng.md)
- [`SearchOptions`](https://docs.mapcairn.com/api/sdk/browser/SearchOptions.md)
- [`SearchResult`](https://docs.mapcairn.com/api/sdk/browser/SearchResult.md)
