View as Markdown

API reference: @salmonui/data/json

WireReadResponseinterface

import type { WireReadResponse } from '@salmonui/data/json';

Also exported from @salmonui/data.

interface WireReadResponse {
    readonly v: 1;
    readonly id: string;
    readonly fields: readonly string[];
    readonly types?: readonly WireType[];
    readonly rows: readonly WireTuple[];
    readonly dict?: Readonly<Record<string, readonly string[]>>;
    readonly total?: number;
    readonly next?: string | null;
    readonly prev?: string | null;
    readonly aggregates?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
    readonly groups?: readonly WireGroup[];
    readonly childCounts?: readonly number[];
    readonly parents?: readonly Json[];
    readonly depths?: readonly number[];
    readonly facet?: {
        readonly field: string;
        readonly entries: readonly (readonly [
            key: string,
            label: string,
            count: number
        ])[];
        readonly complete: boolean;
    };
    readonly error?: WireError;
}
WireReadResponse members (16)
NameSignatureDescription
vreadonly v: 1;
idreadonly id: string;
fieldsreadonly fields: readonly string[];
typesoptionalreadonly types?: readonly WireType[];
rowsreadonly rows: readonly WireTuple[];
dictoptionalreadonly dict?: Readonly<Record<string, readonly string[]>>;

Dictionary encoding: that field's cells are indexes into the list.

totaloptionalreadonly total?: number;
nextoptionalreadonly next?: string | null;

Cursor of the next page; null on the last page.

prevoptionalreadonly prev?: string | null;
aggregatesoptionalreadonly aggregates?: Readonly<Record<string, Readonly<Record<string, unknown>>>>;
groupsoptionalreadonly groups?: readonly WireGroup[];

Group level of a lazy group load (instead of rows).

childCountsoptionalreadonly childCounts?: readonly number[];

Tree loads: child count per row (0 = leaf), parallel to rows; filtered reads count the kept children only.

parentsoptionalreadonly parents?: readonly Json[];

Tree loads that return more than one level (a filtered read with the ancestor chain, or a whole subtree): the parent key per row (null: a root), parallel to rows, in pre-order. Omitted: every row is a child of the requested parent.

depthsoptionalreadonly depths?: readonly number[];

Depth per row relative to the requested level (0: a child of parent), parallel to rows.

facetoptionalreadonly facet?: { readonly field: string; readonly entries: readonly (readonly [ key: string, label: string, count: number ])[]; readonly complete: boolean; };
erroroptionalreadonly error?: WireError;