Skip to main content

FeatureQueryControls

How the feature query contract scripts a query. 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​

import type { FeatureQueryControls } from "@mapcairn/core/contracts";

interface FeatureQueryControls

Methods​

failWith​

failWith(kind: ScriptedFeatureQueryFailure): void;

Makes every later query fail the way kind describes.

  • kind (ScriptedFeatureQueryFailure)

hold​

hold(): () => void;

Keeps later queries pending until the returned function is called.

respondWith​

respondWith(hits: readonly SelectionHit[]): void;

Makes every later query find exactly these features inside CONTRACT_AREA, whichever layers they are in. The query itself keeps only the layers it was asked about and the number it was asked for.

  • hits (readonly SelectionHit[])

See also​

Source: packages/core/src/contracts/featureQuery.contract.ts:22