# SuggestionProviderControls

How the suggestion contract scripts a provider. A real adapter implements
these by mocking its network layer, typically `fetch`.

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

## Signature

```ts
import type { SuggestionProviderControls } from "@mapcairn/core/contracts";
 
interface SuggestionProviderControls
```

## Methods

### hold

```ts
hold(): void;
```

Keeps the next request pending until its signal aborts.

### respondWithOversizeAnswer

```ts
respondWithOversizeAnswer(): void;
```

Makes every later request read an answer larger than whatever limit the
provider applies to the size of an answer. A provider is free to choose
its limit (the subject can lower it so the answer stays small), and the
suite requires only that the answer is refused.

### willFail

```ts
willFail(kind: SearchErrorKind): void;
```

Makes every later request fail the way `kind` describes.

- `kind` (`SearchErrorKind`)

### willReturn

```ts
willReturn(results: readonly SearchResult[]): void;
```

Makes the provider answer every later `suggest` with these results.

- `results` (`readonly SearchResult[]`)

## See also

- [`SearchErrorKind`](https://docs.mapcairn.com/api/core/SearchErrorKind.md)
- [`SearchResult`](https://docs.mapcairn.com/api/core/SearchResult.md)

Source: [packages/core/src/contracts/suggestionProvider.contract.ts:16](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/contracts/suggestionProvider.contract.ts#L16)
