# RoutingProviderControls

How the routing 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 { RoutingProviderControls } from "@mapcairn/core/contracts";
 
interface RoutingProviderControls
```

## 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: ScriptedRoutingFailure): void;
```

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

- `kind` (`ScriptedRoutingFailure`)

### willReturnArea

```ts
willReturnArea(result: ReachableAreaResult): void;
```

Makes every later `reachableArea` answer with these areas.

- `result` (`ReachableAreaResult`)

### willReturnRoute

```ts
willReturnRoute(result: RouteResult): void;
```

Makes every later `route` answer with this route.

- `result` (`RouteResult`)

## See also

- [`ScriptedRoutingFailure`](https://docs.mapcairn.com/api/core/contracts/ScriptedRoutingFailure.md)
- [`ReachableAreaResult`](https://docs.mapcairn.com/api/core/ReachableAreaResult.md)
- [`RouteResult`](https://docs.mapcairn.com/api/core/RouteResult.md)

Source: [packages/core/src/contracts/routingProvider.contract.ts:23](https://github.com/MapCairn/mapcairn/blob/main/packages/core/src/contracts/routingProvider.contract.ts#L23)
