@kermodes/client 0.0.0-stage → 0.3.13-dev.68.g32b767a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/connection.d.ts +100 -0
- package/dist/frame.d.ts +17 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +287 -0
- package/dist/protocol.d.ts +73 -0
- package/package.json +19 -3
- package/README.md +0 -3
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { type ViewerBuffer, type ViewerChannel, type ViewerReply, type ViewerRequest, type ViewerState, type ViewportColumn } from './protocol';
|
|
2
|
+
/** A table the session publishes */
|
|
3
|
+
export type TableInfo = {
|
|
4
|
+
name: string;
|
|
5
|
+
columns: ViewportColumn[];
|
|
6
|
+
refreshing: boolean;
|
|
7
|
+
};
|
|
8
|
+
export type ConnectionStatus = 'connecting' | 'open' | 'closed';
|
|
9
|
+
/** The parts of a WebSocket the connection uses, so tests can stand in for one */
|
|
10
|
+
export interface SocketLike {
|
|
11
|
+
binaryType: BinaryType;
|
|
12
|
+
readonly readyState: number;
|
|
13
|
+
onopen: ((event: Event) => void) | null;
|
|
14
|
+
onclose: ((event: CloseEvent) => void) | null;
|
|
15
|
+
onerror: ((event: Event) => void) | null;
|
|
16
|
+
onmessage: ((event: MessageEvent) => void) | null;
|
|
17
|
+
send(data: string): void;
|
|
18
|
+
close(): void;
|
|
19
|
+
}
|
|
20
|
+
export type ConnectionOptions = {
|
|
21
|
+
createSocket?: (url: string) => SocketLike;
|
|
22
|
+
backoffMs?: number;
|
|
23
|
+
maxBackoffMs?: number;
|
|
24
|
+
};
|
|
25
|
+
/** One table open in the viewer over the shared socket */
|
|
26
|
+
export declare class SocketView implements ViewerChannel {
|
|
27
|
+
private readonly connection;
|
|
28
|
+
readonly id: number;
|
|
29
|
+
readonly table: string;
|
|
30
|
+
private current;
|
|
31
|
+
private replay;
|
|
32
|
+
private messageHandlers;
|
|
33
|
+
private stateHandlers;
|
|
34
|
+
private paused;
|
|
35
|
+
constructor(connection: KermodesConnection, id: number, table: string, columns: ViewportColumn[]);
|
|
36
|
+
send(message: ViewerRequest): void;
|
|
37
|
+
onMessage(handler: (header: ViewerReply, buffers: readonly ViewerBuffer[]) => void): () => void;
|
|
38
|
+
state(): ViewerState;
|
|
39
|
+
onState(handler: () => void): () => void;
|
|
40
|
+
/** Stop viewing the table */
|
|
41
|
+
close(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Stop the server sending this view anything while it is not shown (a hidden tab), keeping
|
|
44
|
+
* its sort and filters; `resume` starts again with the current window.
|
|
45
|
+
*/
|
|
46
|
+
pause(): void;
|
|
47
|
+
resume(): void;
|
|
48
|
+
/** @internal The messages that reopen this view on a new socket */
|
|
49
|
+
reopenMessages(): object[];
|
|
50
|
+
/** @internal */
|
|
51
|
+
receive(header: ViewerReply, buffers: readonly ViewerBuffer[]): void;
|
|
52
|
+
/** @internal */
|
|
53
|
+
update(changes: Partial<ViewerState>): void;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* One WebSocket to the gateway, shared by every open view. Lists the published
|
|
57
|
+
* tables, routes each view's messages by its id, and reconnects with backoff,
|
|
58
|
+
* reopening the views as they were (viewport, sort, filters).
|
|
59
|
+
*/
|
|
60
|
+
export declare class KermodesConnection {
|
|
61
|
+
private readonly url;
|
|
62
|
+
status: ConnectionStatus;
|
|
63
|
+
tables: readonly TableInfo[];
|
|
64
|
+
/** Views published for pages of the app's own, not listed among tables (`deployments`) */
|
|
65
|
+
pages: readonly string[];
|
|
66
|
+
lastError: string | null;
|
|
67
|
+
private socket;
|
|
68
|
+
private views;
|
|
69
|
+
private nextViewId;
|
|
70
|
+
private listeners;
|
|
71
|
+
private backoff;
|
|
72
|
+
private reconnectTimer;
|
|
73
|
+
private isClosed;
|
|
74
|
+
private retries;
|
|
75
|
+
private readonly createSocket;
|
|
76
|
+
private readonly initialBackoff;
|
|
77
|
+
private readonly maxBackoff;
|
|
78
|
+
constructor(url: string, { createSocket, backoffMs, maxBackoffMs, }?: ConnectionOptions);
|
|
79
|
+
/** Call `listener` when the status, the tables, or the last error change */
|
|
80
|
+
onChange(listener: () => void): () => void;
|
|
81
|
+
/** Open `table` in a new view */
|
|
82
|
+
open(table: string): SocketView;
|
|
83
|
+
/** Close the socket for good */
|
|
84
|
+
close(): void;
|
|
85
|
+
/** Ask for the tables list again */
|
|
86
|
+
refreshTables(): void;
|
|
87
|
+
/** @internal */
|
|
88
|
+
sendView(view: number, message: ViewerRequest): void;
|
|
89
|
+
/** @internal */
|
|
90
|
+
sendControl(view: number, type: 'pause' | 'resume'): void;
|
|
91
|
+
/** @internal */
|
|
92
|
+
closeView(view: number): void;
|
|
93
|
+
/** Opens `view` again after a delay that doubles with each try until its rows arrive */
|
|
94
|
+
private retry;
|
|
95
|
+
private sendText;
|
|
96
|
+
private notify;
|
|
97
|
+
private connect;
|
|
98
|
+
private receive;
|
|
99
|
+
private receiveText;
|
|
100
|
+
}
|
package/dist/frame.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type ViewerReply } from './protocol';
|
|
2
|
+
/** A binary frame's header: the viewer reply plus the view it is for */
|
|
3
|
+
export type FrameHeader = ViewerReply & {
|
|
4
|
+
view: number;
|
|
5
|
+
};
|
|
6
|
+
/** A binary frame from the gateway, split into its parts (views into the frame's bytes) */
|
|
7
|
+
export type Frame = {
|
|
8
|
+
header: FrameHeader;
|
|
9
|
+
rows: Uint8Array;
|
|
10
|
+
keys: Uint8Array;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Split a binary frame: a little-endian u32 header length, the header (JSON),
|
|
14
|
+
* a little-endian u32 rows length, the rows (Arrow IPC stream), then the keys
|
|
15
|
+
* for the rest of the frame.
|
|
16
|
+
*/
|
|
17
|
+
export declare function parseFrame(data: ArrayBuffer): Frame;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
// client/src/protocol.ts
|
|
2
|
+
function toBytes(buffer) {
|
|
3
|
+
return buffer instanceof ArrayBuffer ? new Uint8Array(buffer) : new Uint8Array(buffer.buffer, buffer.byteOffset, buffer.byteLength);
|
|
4
|
+
}
|
|
5
|
+
function toKeys(buffer) {
|
|
6
|
+
const bytes = toBytes(buffer);
|
|
7
|
+
return bytes.byteOffset % 8 === 0 ? new BigUint64Array(bytes.buffer, bytes.byteOffset, bytes.byteLength / 8) : new BigUint64Array(bytes.slice().buffer);
|
|
8
|
+
}
|
|
9
|
+
// client/src/frame.ts
|
|
10
|
+
var decoder = new TextDecoder;
|
|
11
|
+
function parseFrame(data) {
|
|
12
|
+
const view = new DataView(data);
|
|
13
|
+
const headerLength = view.getUint32(0, true);
|
|
14
|
+
const rowsAt = 4 + headerLength + 4;
|
|
15
|
+
if (rowsAt > data.byteLength) {
|
|
16
|
+
throw new Error(`frame of ${data.byteLength} bytes cut off in its header`);
|
|
17
|
+
}
|
|
18
|
+
const header = JSON.parse(decoder.decode(new Uint8Array(data, 4, headerLength)));
|
|
19
|
+
const rowsLength = view.getUint32(4 + headerLength, true);
|
|
20
|
+
const keysAt = rowsAt + rowsLength;
|
|
21
|
+
if (keysAt > data.byteLength || (data.byteLength - keysAt) % 8 !== 0) {
|
|
22
|
+
throw new Error(`frame of ${data.byteLength} bytes does not hold ${rowsLength} bytes of rows and whole keys`);
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
header,
|
|
26
|
+
rows: new Uint8Array(data, rowsAt, rowsLength),
|
|
27
|
+
keys: new Uint8Array(data, keysAt)
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
// client/src/connection.ts
|
|
31
|
+
var OPEN = 1;
|
|
32
|
+
|
|
33
|
+
class SocketView {
|
|
34
|
+
connection;
|
|
35
|
+
id;
|
|
36
|
+
table;
|
|
37
|
+
current;
|
|
38
|
+
replay = new Map;
|
|
39
|
+
messageHandlers = new Set;
|
|
40
|
+
stateHandlers = new Set;
|
|
41
|
+
paused = false;
|
|
42
|
+
constructor(connection, id, table, columns) {
|
|
43
|
+
this.connection = connection;
|
|
44
|
+
this.id = id;
|
|
45
|
+
this.table = table;
|
|
46
|
+
this.current = {
|
|
47
|
+
columns,
|
|
48
|
+
row_count: 0,
|
|
49
|
+
status: "opening…",
|
|
50
|
+
sort: [],
|
|
51
|
+
filters: {},
|
|
52
|
+
filter_errors: {},
|
|
53
|
+
applied: 0
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
send(message) {
|
|
57
|
+
if (message.type !== "fetch") {
|
|
58
|
+
this.replay.set(message.type, message);
|
|
59
|
+
}
|
|
60
|
+
this.connection.sendView(this.id, message);
|
|
61
|
+
}
|
|
62
|
+
onMessage(handler) {
|
|
63
|
+
this.messageHandlers.add(handler);
|
|
64
|
+
return () => {
|
|
65
|
+
this.messageHandlers.delete(handler);
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
state() {
|
|
69
|
+
return this.current;
|
|
70
|
+
}
|
|
71
|
+
onState(handler) {
|
|
72
|
+
this.stateHandlers.add(handler);
|
|
73
|
+
return () => {
|
|
74
|
+
this.stateHandlers.delete(handler);
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
close() {
|
|
78
|
+
this.connection.closeView(this.id);
|
|
79
|
+
}
|
|
80
|
+
pause() {
|
|
81
|
+
if (!this.paused) {
|
|
82
|
+
this.paused = true;
|
|
83
|
+
this.connection.sendControl(this.id, "pause");
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
resume() {
|
|
87
|
+
if (this.paused) {
|
|
88
|
+
this.paused = false;
|
|
89
|
+
this.connection.sendControl(this.id, "resume");
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
reopenMessages() {
|
|
93
|
+
const { replay } = this;
|
|
94
|
+
return [
|
|
95
|
+
{ type: "open", view: this.id, table: this.table },
|
|
96
|
+
...["filter", "sort", "viewport"].map((kind) => replay.get(kind)).filter((message) => message != null).map((message) => ({ ...message, view: this.id })),
|
|
97
|
+
...this.paused ? [{ type: "pause", view: this.id }] : []
|
|
98
|
+
];
|
|
99
|
+
}
|
|
100
|
+
receive(header, buffers) {
|
|
101
|
+
this.messageHandlers.forEach((handler) => handler(header, buffers));
|
|
102
|
+
}
|
|
103
|
+
update(changes) {
|
|
104
|
+
this.current = { ...this.current, ...changes };
|
|
105
|
+
this.stateHandlers.forEach((handler) => handler());
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
class KermodesConnection {
|
|
110
|
+
url;
|
|
111
|
+
status = "connecting";
|
|
112
|
+
tables = [];
|
|
113
|
+
pages = [];
|
|
114
|
+
lastError = null;
|
|
115
|
+
socket = null;
|
|
116
|
+
views = new Map;
|
|
117
|
+
nextViewId = 1;
|
|
118
|
+
listeners = new Set;
|
|
119
|
+
backoff;
|
|
120
|
+
reconnectTimer;
|
|
121
|
+
isClosed = false;
|
|
122
|
+
retries = new Map;
|
|
123
|
+
createSocket;
|
|
124
|
+
initialBackoff;
|
|
125
|
+
maxBackoff;
|
|
126
|
+
constructor(url, {
|
|
127
|
+
createSocket = (socketUrl) => new WebSocket(socketUrl),
|
|
128
|
+
backoffMs = 500,
|
|
129
|
+
maxBackoffMs = 1e4
|
|
130
|
+
} = {}) {
|
|
131
|
+
this.url = url;
|
|
132
|
+
this.createSocket = createSocket;
|
|
133
|
+
this.initialBackoff = backoffMs;
|
|
134
|
+
this.backoff = backoffMs;
|
|
135
|
+
this.maxBackoff = maxBackoffMs;
|
|
136
|
+
this.connect();
|
|
137
|
+
}
|
|
138
|
+
onChange(listener) {
|
|
139
|
+
this.listeners.add(listener);
|
|
140
|
+
return () => {
|
|
141
|
+
this.listeners.delete(listener);
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
open(table) {
|
|
145
|
+
const id = this.nextViewId;
|
|
146
|
+
this.nextViewId += 1;
|
|
147
|
+
const columns = this.tables.find((info) => info.name === table)?.columns ?? [];
|
|
148
|
+
const view = new SocketView(this, id, table, columns);
|
|
149
|
+
this.views.set(id, view);
|
|
150
|
+
if (this.socket?.readyState === OPEN) {
|
|
151
|
+
view.reopenMessages().forEach((message) => this.sendText(message));
|
|
152
|
+
}
|
|
153
|
+
return view;
|
|
154
|
+
}
|
|
155
|
+
close() {
|
|
156
|
+
this.isClosed = true;
|
|
157
|
+
clearTimeout(this.reconnectTimer);
|
|
158
|
+
this.socket?.close();
|
|
159
|
+
}
|
|
160
|
+
refreshTables() {
|
|
161
|
+
this.sendText({ type: "tables" });
|
|
162
|
+
}
|
|
163
|
+
sendView(view, message) {
|
|
164
|
+
this.sendText({ ...message, view });
|
|
165
|
+
}
|
|
166
|
+
sendControl(view, type) {
|
|
167
|
+
this.sendText({ type, view });
|
|
168
|
+
}
|
|
169
|
+
closeView(view) {
|
|
170
|
+
clearTimeout(this.retries.get(view)?.timer);
|
|
171
|
+
this.retries.delete(view);
|
|
172
|
+
if (this.views.delete(view)) {
|
|
173
|
+
this.sendText({ type: "close", view });
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
retry(view) {
|
|
177
|
+
const delay = this.retries.get(view.id)?.delay ?? this.initialBackoff;
|
|
178
|
+
const timer = setTimeout(() => {
|
|
179
|
+
if (this.views.has(view.id)) {
|
|
180
|
+
view.reopenMessages().forEach((message) => this.sendText(message));
|
|
181
|
+
}
|
|
182
|
+
}, delay);
|
|
183
|
+
this.retries.set(view.id, { timer, delay: Math.min(delay * 2, this.maxBackoff) });
|
|
184
|
+
}
|
|
185
|
+
sendText(message) {
|
|
186
|
+
if (this.socket?.readyState === OPEN) {
|
|
187
|
+
this.socket.send(JSON.stringify(message));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
notify() {
|
|
191
|
+
this.listeners.forEach((listener) => listener());
|
|
192
|
+
}
|
|
193
|
+
connect() {
|
|
194
|
+
this.status = "connecting";
|
|
195
|
+
this.notify();
|
|
196
|
+
const socket = this.createSocket(this.url);
|
|
197
|
+
socket.binaryType = "arraybuffer";
|
|
198
|
+
this.socket = socket;
|
|
199
|
+
socket.onopen = () => {
|
|
200
|
+
this.backoff = this.initialBackoff;
|
|
201
|
+
this.status = "open";
|
|
202
|
+
this.lastError = null;
|
|
203
|
+
this.notify();
|
|
204
|
+
this.retries.forEach(({ timer }) => clearTimeout(timer));
|
|
205
|
+
this.retries.clear();
|
|
206
|
+
this.views.forEach((view) => view.reopenMessages().forEach((message) => this.sendText(message)));
|
|
207
|
+
};
|
|
208
|
+
socket.onmessage = (event) => this.receive(event.data);
|
|
209
|
+
socket.onclose = () => {
|
|
210
|
+
if (this.socket !== socket) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
this.socket = null;
|
|
214
|
+
this.status = "closed";
|
|
215
|
+
this.views.forEach((view) => view.update({ error: "Reconnecting", retrying: true }));
|
|
216
|
+
this.notify();
|
|
217
|
+
if (!this.isClosed) {
|
|
218
|
+
this.reconnectTimer = setTimeout(() => this.connect(), this.backoff);
|
|
219
|
+
this.backoff = Math.min(this.backoff * 2, this.maxBackoff);
|
|
220
|
+
}
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
receive(data) {
|
|
224
|
+
if (typeof data === "string") {
|
|
225
|
+
this.receiveText(JSON.parse(data));
|
|
226
|
+
return;
|
|
227
|
+
}
|
|
228
|
+
const { header, rows, keys } = parseFrame(data);
|
|
229
|
+
if (header.type === "rows" && this.retries.has(header.view)) {
|
|
230
|
+
clearTimeout(this.retries.get(header.view)?.timer);
|
|
231
|
+
this.retries.delete(header.view);
|
|
232
|
+
}
|
|
233
|
+
this.views.get(header.view)?.receive(header, [rows, keys]);
|
|
234
|
+
}
|
|
235
|
+
receiveText(message) {
|
|
236
|
+
switch (message.type) {
|
|
237
|
+
case "tables": {
|
|
238
|
+
this.tables = message.tables;
|
|
239
|
+
this.pages = message.views ?? [];
|
|
240
|
+
this.views.forEach((view) => {
|
|
241
|
+
const info = message.tables.find((table) => table.name === view.table);
|
|
242
|
+
if (info != null && JSON.stringify(info.columns) !== JSON.stringify(view.state().columns)) {
|
|
243
|
+
view.update({ columns: info.columns });
|
|
244
|
+
}
|
|
245
|
+
});
|
|
246
|
+
this.notify();
|
|
247
|
+
break;
|
|
248
|
+
}
|
|
249
|
+
case "state": {
|
|
250
|
+
const { row_count, status, sort, filters, filter_errors, applied } = message;
|
|
251
|
+
this.views.get(message.view)?.update({
|
|
252
|
+
row_count,
|
|
253
|
+
status,
|
|
254
|
+
sort,
|
|
255
|
+
filters,
|
|
256
|
+
filter_errors,
|
|
257
|
+
applied,
|
|
258
|
+
error: null,
|
|
259
|
+
retrying: false
|
|
260
|
+
});
|
|
261
|
+
break;
|
|
262
|
+
}
|
|
263
|
+
case "error": {
|
|
264
|
+
const view = message.view == null ? undefined : this.views.get(message.view);
|
|
265
|
+
if (view == null) {
|
|
266
|
+
this.lastError = message.message;
|
|
267
|
+
this.notify();
|
|
268
|
+
} else {
|
|
269
|
+
view.update({ error: message.message, retrying: message.retry === true });
|
|
270
|
+
if (message.retry) {
|
|
271
|
+
this.retry(view);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
break;
|
|
275
|
+
}
|
|
276
|
+
default:
|
|
277
|
+
break;
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
export {
|
|
282
|
+
KermodesConnection,
|
|
283
|
+
SocketView,
|
|
284
|
+
parseFrame,
|
|
285
|
+
toBytes,
|
|
286
|
+
toKeys
|
|
287
|
+
};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/** A column of the viewed table, as the engine names its type */
|
|
2
|
+
export type ViewportColumn = {
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
};
|
|
6
|
+
/** One key of the table's sort, as the engine is asked for it */
|
|
7
|
+
export type SortKey = {
|
|
8
|
+
column: string;
|
|
9
|
+
descending: boolean;
|
|
10
|
+
};
|
|
11
|
+
/** What the engine side keeps in sync with the viewer */
|
|
12
|
+
export type ViewerState = {
|
|
13
|
+
columns: ViewportColumn[];
|
|
14
|
+
row_count: number;
|
|
15
|
+
status: string;
|
|
16
|
+
sort: SortKey[];
|
|
17
|
+
filters: Record<string, string>;
|
|
18
|
+
filter_errors: Record<string, string>;
|
|
19
|
+
applied: number;
|
|
20
|
+
error?: string | null;
|
|
21
|
+
retrying?: boolean;
|
|
22
|
+
};
|
|
23
|
+
/** Messages from the viewer to the engine side */
|
|
24
|
+
export type ViewerRequest = {
|
|
25
|
+
type: 'viewport';
|
|
26
|
+
top: number;
|
|
27
|
+
bottom: number;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'sort';
|
|
30
|
+
by: SortKey[];
|
|
31
|
+
request?: number;
|
|
32
|
+
} | {
|
|
33
|
+
type: 'filter';
|
|
34
|
+
filters: Record<string, string>;
|
|
35
|
+
request?: number;
|
|
36
|
+
} | {
|
|
37
|
+
type: 'fetch';
|
|
38
|
+
id: number;
|
|
39
|
+
start: number;
|
|
40
|
+
count: number;
|
|
41
|
+
};
|
|
42
|
+
/**
|
|
43
|
+
* Messages from the engine side. Both carry two buffers: an Arrow IPC stream of
|
|
44
|
+
* the rows (all columns, in `columns` order) and their keys as little-endian uint64.
|
|
45
|
+
*/
|
|
46
|
+
export type ViewerReply = {
|
|
47
|
+
type: 'rows';
|
|
48
|
+
start: number;
|
|
49
|
+
total: number;
|
|
50
|
+
cycle: number;
|
|
51
|
+
} | {
|
|
52
|
+
type: 'fetched';
|
|
53
|
+
id: number;
|
|
54
|
+
start: number;
|
|
55
|
+
total: number;
|
|
56
|
+
};
|
|
57
|
+
export type ViewerBuffer = ArrayBuffer | ArrayBufferView;
|
|
58
|
+
/**
|
|
59
|
+
* The viewer's link to the engine, whatever carries it: a notebook widget's
|
|
60
|
+
* comm, or a WebSocket in the web UI.
|
|
61
|
+
*/
|
|
62
|
+
export interface ViewerChannel {
|
|
63
|
+
send(message: ViewerRequest): void;
|
|
64
|
+
/** Call `handler` for each message; returns the function that stops it */
|
|
65
|
+
onMessage(handler: (header: ViewerReply, buffers: readonly ViewerBuffer[]) => void): () => void;
|
|
66
|
+
/** The current synced state */
|
|
67
|
+
state(): ViewerState;
|
|
68
|
+
/** Call `handler` after the synced state changes; returns the function that stops it */
|
|
69
|
+
onState(handler: () => void): () => void;
|
|
70
|
+
}
|
|
71
|
+
export declare function toBytes(buffer: ViewerBuffer): Uint8Array;
|
|
72
|
+
/** Row keys from their buffer, copied when the buffer is not 8-byte aligned */
|
|
73
|
+
export declare function toKeys(buffer: ViewerBuffer): BigUint64Array;
|
package/package.json
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kermodes/client",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.3.13-dev.68.g32b767a",
|
|
4
|
+
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/reecetec/kermodes.git",
|
|
8
|
+
"directory": "web/client"
|
|
9
|
+
},
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/index.js",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"exports": {
|
|
14
|
+
".": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"import": "./dist/index.js"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist"
|
|
21
|
+
]
|
|
6
22
|
}
|
package/README.md
DELETED