API reference
@salmonui/data/json
88 exported symbols: 22 functions, 5 classes, 44 interfaces, 16 types and 1 constant. Each name links its page with the signature, docs and members.
import { … } from '@salmonui/data/json';Functions
createBatchingFetchTransportBatching HTTP transport: same-tick requests share one POST.createBatchingTransportMultiplexes every request issued in the same tick into one { v: 1, batch: [...] } call (lazy group children, facets, prefetch). A consumer that aborts is rejec…createFetchTransportOne HTTP request per protocol request.createJsonDataSourcecreateJsonPivotSourceRemote pivot source over the Salmon UI JSON protocol.decodeTuplesBrings response tuples into the client's field order and expands dictionary-encoded cells. Works in place on the freshly parsed arrays: when the server already…encodeRowsEncodes object rows as tuples (+ dictionaries); dates become epoch ms.fieldIndexIndex of each field in the tuple header.isRetryableErrorDefault retry predicate: network failures, 408, 429, and 5xx. Never aborts, 4xx, or protocol errors.isWirePivotRequestisWireWriteRequestnormalizeFilterOperatorCanonical built-in operator name, or null for a custom operator (sent verbatim).objectToTupleInverse of tuplesToObjects for one row (writes).serializeDataGridQueryDeterministic query serialization; identical to serializeDataGridQuery of @salmonui/data-grid/engine.structuralQueryKeyQuery identity without paging and expansion: cursor chains and infinite blocks are cached under it.toWherePredicateTop level: conditions on the same column fold left to right by their predicate; columns and groups are ANDed (Data Grid engine filter semantics).toWirePivotModelThe model as it travels: rejects client-only aggregators, drops formats and conditional formats, omits defaults. Throws ProtocolError with code pivot/unsupport…toWireQueryDataQuery to wire query. Paging is supplied by the caller (offset, cursor, or block).tupleColumnsReturns column definitions whose field reads a tuple slot: valueGetter is row => row[i] and valueSetter copies the tuple once. The id defaults to the field so…tupleRowIdgetRowId for tuple rows: the key slot as a string.tuplesToObjectsMaterializes tuples as objects (object row mode). One allocation per row.wirePivotModelKeyCanonical JSON of the wire model: equal models give equal bodies and cache keys.
Classes
CursorUnknownErrorThe cursor of the requested page is not known (jump without walking the chain).HttpErrorNon-2xx HTTP response. 4xx are not retried by default.ProtocolErrorerror member of a protocol response.RequestCanceledErroronRequest returned false.StaleResponseErrorA response arrived for a version older than one already applied on the same channel.
Interfaces
EncodeRowsOptionsFetchTransportOptionsJsonDataSourceJsonDataSourceOptionsJsonPivotSourceJsonPivotSourceOptionsPivotDrillThroughPageRaw rows behind one cell: objects, dates as Date.PivotDrillThroughQueryPivotRequestErrorEventPivotRequestEventPivotResponseEventPivotWindowQueryRemotePivotCellA cell as PivotCell. rawValue equals value and rowCount is 0: use drillThrough.RemotePivotEngineRemotePivotEngineOptionsRemotePivotHeaderA header node as PivotHeaderNode.RemotePivotMemberA member of a field (PivotMember).RemotePivotResultThe snapshot of a remote engine: a PivotResult over the loaded windows. Trees hold the header nodes of the loaded windows only; memberAt of a position outside…RequestErrorEventRequestEventResponseEventTransportContextTupleColumnDefLikeMinimal structural view of a Data Grid engine ColumnDef (only the members tuple mode fills).TupleColumnHooksWireBatchRequestWireBatchResponseWireConditionBuilt-in operators use the Data Grid engine names (startsWith, greaterThanOrEqual, ...).WireErrorWireGroupWirePivotAxisFieldAn axis field of a wire pivot model.WirePivotHeaderA header node of the window (PivotHeaderNode without axis and children).WirePivotModelThe pivot engine's PivotModel (@salmonui/pivot-table/engine), typed structurally so this package keeps no package imports. Plain JSON; the client sends it with…WirePivotRequestWirePivotResponseWirePivotValueFieldA value field of a wire pivot model; aggregate: 'custom' (a client function) cannot travel.WirePivotWindowA leaf-position window, end exclusive.WireQueryWireQueryOptionsWireReadRequestWireReadResponseWireWriteRequestWireWriteResponseWriteStateEventWhich rows and cells a write-state change touched.WriteStateSnapshot
Types
JsonTransportSends one protocol request and resolves with its response. Must honor signal.PivotJsonTransportA transport that also carries pivot requests (createJsonPivotSource).PivotRequestKindRemotePivotStatusRequestKindTupleRowUniversalJsonTransportThe built-in transports carry every request kind: usable as either transport type.WireAnyRequestEvery request kind, pivot included: what a PivotJsonTransport (pivot sources) carries.WireAnyResponseWireLiveMessageLive push message (any subscription channel: SSE, WebSocket, polling).WirePageWirePredicateWireRequestRead and write requests: what a JsonTransport (Data Grid sources) carries.WireResponseWireTupleWireType