MockQuerySource interface

Module @runic-artifex/views/mock in @runic-artifex/views 0.23.0

interface MockQuerySource

The rows of a mock query collection, in wire form, and how the mock serves them.

Properties

rows

readonly rows: readonly unknown[];

The rows in the source's own order, encoded as the client's wire rows.

key

readonly key: (row: unknown) => string;

The wire key of a row.

latency

readonly latency?: number;

Milliseconds each query-rows and query-index request takes, like a database: virtual time with manual scheduling. Defaults to 0.

custom

readonly custom?: Readonly<Record<string, (row: unknown, value: unknown) => boolean>>;

Custom filters by name: whether a row passes with the filter's value. A query with another custom filter is rejected.

query

readonly query?: RunicQuery;

The query the collection starts with.