tabulark 0.0.4 → 0.1.0
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/CHANGELOG.md +16 -0
- package/README.md +215 -110
- package/THIRD_PARTY_NOTICES.md +37 -0
- package/dist/adapters.d.ts +62 -0
- package/dist/arrow.d.ts +3 -0
- package/dist/arrow.js +2 -0
- package/dist/arrow.js.map +7 -0
- package/dist/client.d.ts +76 -0
- package/dist/errors.d.ts +19 -0
- package/dist/excel.d.ts +3 -0
- package/dist/excel.js +2 -0
- package/dist/excel.js.map +7 -0
- package/dist/experimental.d.ts +13 -0
- package/dist/experimental.js +2 -0
- package/dist/experimental.js.map +7 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +7 -0
- package/dist/model.d.ts +389 -0
- package/dist/official-adapter-manifest.d.ts +31 -0
- package/dist/parquet.d.ts +3 -0
- package/dist/parquet.js +2 -0
- package/dist/parquet.js.map +7 -0
- package/dist/protocol.d.ts +54 -0
- package/dist/range-cache.d.ts +28 -0
- package/dist/rpc-client.d.ts +18 -0
- package/dist/view/accessible-grid.d.ts +36 -0
- package/dist/view/canvas-painter.d.ts +91 -0
- package/dist/view/canvas-table-view-public.d.ts +58 -0
- package/dist/view/canvas-table-view.d.ts +32 -0
- package/dist/view/controller.d.ts +34 -0
- package/dist/view/layout.d.ts +34 -0
- package/dist/view/selection.d.ts +7 -0
- package/dist/view/types.d.ts +184 -0
- package/dist/wasm/arrow/tabulark_arrow.d.ts +126 -0
- package/dist/wasm/arrow/tabulark_arrow.js +771 -0
- package/dist/wasm/arrow/tabulark_arrow_bg.wasm +0 -0
- package/dist/wasm/arrow/tabulark_arrow_bg.wasm.d.ts +25 -0
- package/dist/wasm/delimited/tabulark_delimited.d.ts +131 -0
- package/dist/wasm/delimited/tabulark_delimited.js +845 -0
- package/dist/wasm/delimited/tabulark_delimited_bg.wasm +0 -0
- package/dist/wasm/delimited/tabulark_delimited_bg.wasm.d.ts +26 -0
- package/dist/wasm/excel/tabulark_excel.d.ts +121 -0
- package/dist/wasm/excel/tabulark_excel.js +766 -0
- package/dist/wasm/excel/tabulark_excel_bg.wasm +0 -0
- package/dist/wasm/excel/tabulark_excel_bg.wasm.d.ts +25 -0
- package/dist/wasm/parquet/tabulark_parquet.d.ts +121 -0
- package/dist/wasm/parquet/tabulark_parquet.js +754 -0
- package/dist/wasm/parquet/tabulark_parquet_bg.wasm +0 -0
- package/dist/wasm/parquet/tabulark_parquet_bg.wasm.d.ts +25 -0
- package/dist/worker/wasm-adapter.d.ts +57 -0
- package/dist/worker/worker-errors.d.ts +9 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +2 -0
- package/dist/worker.js.map +7 -0
- package/package.json +55 -12
- package/js/index.d.ts +0 -18
- package/js/index.js +0 -26
package/dist/model.d.ts
ADDED
|
@@ -0,0 +1,389 @@
|
|
|
1
|
+
import { BATCH_LAYOUT_VERSION } from "./protocol.js";
|
|
2
|
+
export declare const DEFAULT_MEMORY_BUDGET_BYTES: number;
|
|
3
|
+
export declare const MAX_ARRAY_BUFFER_BYTES: number;
|
|
4
|
+
export declare const MAX_RANGE_CELLS = 250000;
|
|
5
|
+
export declare const DEFAULT_TO_ROWS_CELL_LIMIT = 10000;
|
|
6
|
+
export declare const MAX_NESTING_DEPTH = 64;
|
|
7
|
+
export declare const MAX_SOURCES = 2;
|
|
8
|
+
export declare const MAX_ACTIVE_RANGES = 2;
|
|
9
|
+
export declare const MAX_RANGE_WAITERS = 8;
|
|
10
|
+
export interface MemoryBudgetLimits {
|
|
11
|
+
readonly memoryBudgetBytes: number;
|
|
12
|
+
/** Shared retained capacity allocated among the adapters actually registered. */
|
|
13
|
+
readonly adapterRuntimePoolBytes: number;
|
|
14
|
+
/** Maximum transient/decoded budget retained by one active adapter operation. */
|
|
15
|
+
readonly operationBudgetBytes: number;
|
|
16
|
+
readonly indexBudgetBytes: number;
|
|
17
|
+
readonly adapterTileCacheBudgetBytes: number;
|
|
18
|
+
readonly workerRangeCacheBytes: number;
|
|
19
|
+
readonly workerDatasetRangeCacheBytes: number;
|
|
20
|
+
readonly mainThreadRangeCacheBytes: number;
|
|
21
|
+
readonly maxFieldBytes: number;
|
|
22
|
+
readonly maxBatchBytes: number;
|
|
23
|
+
readonly maxArrayBufferBytes: number;
|
|
24
|
+
readonly maxSources: number;
|
|
25
|
+
readonly maxActiveRanges: number;
|
|
26
|
+
readonly maxRangeWaiters: number;
|
|
27
|
+
}
|
|
28
|
+
/** Derives every bounded runtime allocation from one engine-wide budget. */
|
|
29
|
+
export declare function deriveMemoryBudgetLimits(memoryBudgetBytes: number): MemoryBudgetLimits;
|
|
30
|
+
export type MemoryResourceKind = "adapter-runtime" | "source-staging" | "compressed-page" | "decompression" | "opened-worksheet" | "batch" | "range-cache";
|
|
31
|
+
export interface MemoryReservation {
|
|
32
|
+
readonly resource: MemoryResourceKind;
|
|
33
|
+
readonly bytes: number;
|
|
34
|
+
release(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Single-accounting ledger for Worker-owned bounded allocations.
|
|
38
|
+
*
|
|
39
|
+
* A reservation is deliberately idempotent so cancellation, close and failure
|
|
40
|
+
* races can all execute their normal cleanup paths without double accounting.
|
|
41
|
+
*/
|
|
42
|
+
export declare class MemoryReservationLedger {
|
|
43
|
+
#private;
|
|
44
|
+
constructor(capacityBytes: number);
|
|
45
|
+
get capacityBytes(): number;
|
|
46
|
+
get usedBytes(): number;
|
|
47
|
+
get availableBytes(): number;
|
|
48
|
+
reserve(resource: MemoryResourceKind, bytes: number): MemoryReservation;
|
|
49
|
+
}
|
|
50
|
+
export type AxisExtent = Readonly<{
|
|
51
|
+
kind: "exact";
|
|
52
|
+
value: number;
|
|
53
|
+
}> | Readonly<{
|
|
54
|
+
kind: "at-least";
|
|
55
|
+
value: number;
|
|
56
|
+
}> | Readonly<{
|
|
57
|
+
kind: "unknown";
|
|
58
|
+
}>;
|
|
59
|
+
export interface TableExtent {
|
|
60
|
+
readonly rows: AxisExtent;
|
|
61
|
+
readonly columns: AxisExtent;
|
|
62
|
+
}
|
|
63
|
+
export type TimeUnit = "second" | "millisecond" | "microsecond" | "nanosecond";
|
|
64
|
+
export type IntervalUnit = "year-month" | "day-time" | "month-day-nano";
|
|
65
|
+
export interface ArrowField {
|
|
66
|
+
readonly name: string;
|
|
67
|
+
readonly nullable: boolean;
|
|
68
|
+
readonly dataType: ArrowDataType;
|
|
69
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
70
|
+
}
|
|
71
|
+
interface SimpleDataType<Type extends string> {
|
|
72
|
+
readonly type: Type;
|
|
73
|
+
}
|
|
74
|
+
/** A recursive representation of every arrow-schema 59.1.0 built-in DataType. */
|
|
75
|
+
export type ArrowDataType = SimpleDataType<"null" | "unknown" | "boolean" | "int8" | "int16" | "int32" | "int64" | "uint8" | "uint16" | "uint32" | "uint64" | "float16" | "float32" | "float64" | "date32" | "date64" | "binary" | "large-binary" | "binary-view" | "utf8" | "large-utf8" | "utf8-view"> | Readonly<{
|
|
76
|
+
type: "timestamp";
|
|
77
|
+
unit: TimeUnit;
|
|
78
|
+
timezone?: string;
|
|
79
|
+
}> | Readonly<{
|
|
80
|
+
type: "time32" | "time64" | "duration";
|
|
81
|
+
unit: TimeUnit;
|
|
82
|
+
}> | Readonly<{
|
|
83
|
+
type: "interval";
|
|
84
|
+
unit: IntervalUnit;
|
|
85
|
+
}> | Readonly<{
|
|
86
|
+
type: "fixed-size-binary";
|
|
87
|
+
byteWidth: number;
|
|
88
|
+
}> | Readonly<{
|
|
89
|
+
type: "decimal32" | "decimal64" | "decimal128" | "decimal256";
|
|
90
|
+
precision: number;
|
|
91
|
+
scale: number;
|
|
92
|
+
}> | Readonly<{
|
|
93
|
+
type: "list" | "large-list" | "list-view" | "large-list-view";
|
|
94
|
+
field: ArrowField;
|
|
95
|
+
}> | Readonly<{
|
|
96
|
+
type: "fixed-size-list";
|
|
97
|
+
field: ArrowField;
|
|
98
|
+
listSize: number;
|
|
99
|
+
}> | Readonly<{
|
|
100
|
+
type: "struct";
|
|
101
|
+
fields: readonly ArrowField[];
|
|
102
|
+
}> | Readonly<{
|
|
103
|
+
type: "union";
|
|
104
|
+
mode: "sparse" | "dense";
|
|
105
|
+
fields: readonly Readonly<{
|
|
106
|
+
typeId: number;
|
|
107
|
+
field: ArrowField;
|
|
108
|
+
}>[];
|
|
109
|
+
}> | Readonly<{
|
|
110
|
+
type: "dictionary";
|
|
111
|
+
indexType: ArrowDataType;
|
|
112
|
+
valueType: ArrowDataType;
|
|
113
|
+
ordered?: boolean;
|
|
114
|
+
}> | Readonly<{
|
|
115
|
+
type: "map";
|
|
116
|
+
entries: ArrowField;
|
|
117
|
+
keysSorted: boolean;
|
|
118
|
+
}> | Readonly<{
|
|
119
|
+
type: "run-end-encoded";
|
|
120
|
+
runEnds: ArrowField;
|
|
121
|
+
values: ArrowField;
|
|
122
|
+
}> | Readonly<{
|
|
123
|
+
type: "extension";
|
|
124
|
+
name: string;
|
|
125
|
+
metadata?: string;
|
|
126
|
+
storageType: ArrowDataType;
|
|
127
|
+
}>;
|
|
128
|
+
export interface ColumnSchema {
|
|
129
|
+
readonly id: string;
|
|
130
|
+
readonly name: string;
|
|
131
|
+
readonly index: number;
|
|
132
|
+
readonly dataType: ArrowDataType;
|
|
133
|
+
readonly nullable: boolean;
|
|
134
|
+
readonly metadata?: Readonly<Record<string, string>>;
|
|
135
|
+
}
|
|
136
|
+
export interface TableCapabilities {
|
|
137
|
+
readonly randomAccess: "indexed-prefix" | "full";
|
|
138
|
+
readonly typedValues: boolean;
|
|
139
|
+
readonly search: boolean;
|
|
140
|
+
readonly sort: boolean;
|
|
141
|
+
readonly filter: boolean;
|
|
142
|
+
readonly multiTable: boolean;
|
|
143
|
+
readonly [name: string]: unknown;
|
|
144
|
+
}
|
|
145
|
+
export interface TableMetadata {
|
|
146
|
+
readonly tableId: string;
|
|
147
|
+
readonly name: string;
|
|
148
|
+
readonly revision: number;
|
|
149
|
+
readonly extent: Readonly<TableExtent>;
|
|
150
|
+
readonly schema: Readonly<{
|
|
151
|
+
readonly version: number;
|
|
152
|
+
readonly columns: readonly Readonly<ColumnSchema>[];
|
|
153
|
+
}>;
|
|
154
|
+
readonly capabilities: Readonly<TableCapabilities>;
|
|
155
|
+
}
|
|
156
|
+
export type WorksheetVisibility = "visible" | "hidden" | "very-hidden";
|
|
157
|
+
/** One sparse row or column override supplied by a spreadsheet presentation. */
|
|
158
|
+
export interface PresentationAxisEntry {
|
|
159
|
+
readonly index: number;
|
|
160
|
+
/** CSS pixel extent when the source supplies an explicit dimension. */
|
|
161
|
+
readonly size?: number;
|
|
162
|
+
readonly hidden?: boolean;
|
|
163
|
+
}
|
|
164
|
+
export interface PresentationColor {
|
|
165
|
+
/** CSS-compatible resolved color, when the workbook supplied one. */
|
|
166
|
+
readonly css?: string;
|
|
167
|
+
}
|
|
168
|
+
export interface PresentationFont {
|
|
169
|
+
readonly family?: string;
|
|
170
|
+
readonly size?: number;
|
|
171
|
+
readonly bold?: boolean;
|
|
172
|
+
readonly italic?: boolean;
|
|
173
|
+
readonly underline?: boolean;
|
|
174
|
+
readonly color?: PresentationColor;
|
|
175
|
+
}
|
|
176
|
+
export interface PresentationBorderSide {
|
|
177
|
+
readonly style?: "none" | "thin" | "medium" | "thick" | "dashed" | "dotted" | "double";
|
|
178
|
+
readonly color?: PresentationColor;
|
|
179
|
+
}
|
|
180
|
+
/** Static cell styling that 0.1 preserves from spreadsheet input. */
|
|
181
|
+
export interface PresentationStyle {
|
|
182
|
+
readonly numberFormat?: string;
|
|
183
|
+
readonly font?: PresentationFont;
|
|
184
|
+
readonly foregroundColor?: PresentationColor;
|
|
185
|
+
readonly backgroundColor?: PresentationColor;
|
|
186
|
+
readonly fillColor?: PresentationColor;
|
|
187
|
+
readonly borders?: Readonly<{
|
|
188
|
+
readonly top?: PresentationBorderSide;
|
|
189
|
+
readonly right?: PresentationBorderSide;
|
|
190
|
+
readonly bottom?: PresentationBorderSide;
|
|
191
|
+
readonly left?: PresentationBorderSide;
|
|
192
|
+
}>;
|
|
193
|
+
readonly horizontalAlignment?: "general" | "left" | "center" | "right" | "justify";
|
|
194
|
+
readonly verticalAlignment?: "top" | "center" | "bottom" | "justify";
|
|
195
|
+
readonly wrapText?: boolean;
|
|
196
|
+
}
|
|
197
|
+
export interface MergedCellRegion {
|
|
198
|
+
readonly rowStart: number;
|
|
199
|
+
readonly rowEnd: number;
|
|
200
|
+
readonly columnStart: number;
|
|
201
|
+
readonly columnEnd: number;
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* Presentation metadata for a worksheet. It is intentionally static: formula
|
|
205
|
+
* calculation and document round-tripping are outside the 0.1 contract.
|
|
206
|
+
*/
|
|
207
|
+
export interface SpreadsheetPresentation {
|
|
208
|
+
readonly kind: "spreadsheet-v1";
|
|
209
|
+
readonly tableId: string;
|
|
210
|
+
readonly revision: number;
|
|
211
|
+
readonly visibility: WorksheetVisibility;
|
|
212
|
+
readonly frozenRows: number;
|
|
213
|
+
readonly frozenColumns: number;
|
|
214
|
+
readonly rows: readonly PresentationAxisEntry[];
|
|
215
|
+
readonly columns: readonly PresentationAxisEntry[];
|
|
216
|
+
/** Deduplicated styles addressed by `SpreadsheetPresentationRange.styleIds`. */
|
|
217
|
+
readonly styles: readonly PresentationStyle[];
|
|
218
|
+
}
|
|
219
|
+
export type TablePresentation = SpreadsheetPresentation;
|
|
220
|
+
export interface SpreadsheetPresentationRange {
|
|
221
|
+
readonly kind: "spreadsheet-v1";
|
|
222
|
+
readonly tableId: string;
|
|
223
|
+
readonly revision: number;
|
|
224
|
+
readonly range: Readonly<ReturnedRange>;
|
|
225
|
+
/** Rows and columns are exactly aligned with `range`; null means no style. */
|
|
226
|
+
readonly styleIds: readonly (readonly (number | null)[])[];
|
|
227
|
+
readonly mergedCells: readonly MergedCellRegion[];
|
|
228
|
+
/** Sparse layout entries that intersect this requested range. */
|
|
229
|
+
readonly rows: readonly PresentationAxisEntry[];
|
|
230
|
+
readonly columns: readonly PresentationAxisEntry[];
|
|
231
|
+
}
|
|
232
|
+
export type PresentationRange = SpreadsheetPresentationRange;
|
|
233
|
+
export interface TableDescriptor {
|
|
234
|
+
readonly id: string;
|
|
235
|
+
readonly name: string;
|
|
236
|
+
}
|
|
237
|
+
export interface RangeRequest {
|
|
238
|
+
readonly rowStart: number;
|
|
239
|
+
readonly rowCount: number;
|
|
240
|
+
readonly columnStart: number;
|
|
241
|
+
readonly columnCount: number;
|
|
242
|
+
}
|
|
243
|
+
export interface ReturnedRange extends RangeRequest {
|
|
244
|
+
}
|
|
245
|
+
/** A byte region in the batch's deduplicated buffer pool. */
|
|
246
|
+
export interface BatchBufferRegion {
|
|
247
|
+
readonly buffer: number;
|
|
248
|
+
readonly byteOffset?: number;
|
|
249
|
+
readonly byteLength?: number;
|
|
250
|
+
/** First bit for bitmap regions; ignored for byte-oriented regions. */
|
|
251
|
+
readonly bitOffset?: number;
|
|
252
|
+
}
|
|
253
|
+
/** UTF-8 text generated by Rust for rendering, ARIA, width measurement and copy. */
|
|
254
|
+
export interface DisplayColumnDescriptor {
|
|
255
|
+
readonly encoding: "utf8";
|
|
256
|
+
readonly data: BatchBufferRegion;
|
|
257
|
+
readonly offsets: BatchBufferRegion;
|
|
258
|
+
readonly validity?: BatchBufferRegion;
|
|
259
|
+
/** Logical offset into the display arrays, for sliced batches. */
|
|
260
|
+
readonly offset?: number;
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Recursive Arrow ArrayData layout. Buffer regions always point into the
|
|
264
|
+
* enclosing TableBatch buffer pool; encoded dictionaries and run ends remain
|
|
265
|
+
* visible in this descriptor even though `toRows()` returns logical values.
|
|
266
|
+
*/
|
|
267
|
+
export interface NativeColumnDescriptor {
|
|
268
|
+
/** Rust ArrayData layout encoding (for example `dictionary` or `run-end-encoded`). */
|
|
269
|
+
readonly encoding?: string;
|
|
270
|
+
readonly dataType: ArrowDataType;
|
|
271
|
+
readonly length: number;
|
|
272
|
+
readonly offset?: number;
|
|
273
|
+
readonly validity?: BatchBufferRegion;
|
|
274
|
+
readonly values?: BatchBufferRegion;
|
|
275
|
+
readonly offsets?: BatchBufferRegion;
|
|
276
|
+
readonly sizes?: BatchBufferRegion;
|
|
277
|
+
readonly data?: BatchBufferRegion;
|
|
278
|
+
readonly typeIds?: BatchBufferRegion;
|
|
279
|
+
readonly unionOffsets?: BatchBufferRegion;
|
|
280
|
+
readonly variadicBuffers?: readonly BatchBufferRegion[];
|
|
281
|
+
readonly children?: readonly NativeColumnDescriptor[];
|
|
282
|
+
readonly dictionary?: NativeColumnDescriptor;
|
|
283
|
+
readonly runEnds?: NativeColumnDescriptor;
|
|
284
|
+
readonly typeId?: number;
|
|
285
|
+
}
|
|
286
|
+
/** @internal Layout-v1 column descriptor received from an official WASM runtime. */
|
|
287
|
+
export interface WireTableBatchColumn {
|
|
288
|
+
readonly columnId: string;
|
|
289
|
+
readonly native: NativeColumnDescriptor;
|
|
290
|
+
readonly display: DisplayColumnDescriptor;
|
|
291
|
+
}
|
|
292
|
+
export interface DecimalValue {
|
|
293
|
+
readonly kind: "decimal";
|
|
294
|
+
readonly unscaled: bigint;
|
|
295
|
+
readonly precision: number;
|
|
296
|
+
readonly scale: number;
|
|
297
|
+
}
|
|
298
|
+
export interface TemporalValue {
|
|
299
|
+
readonly kind: "date32" | "date64" | "time32" | "time64" | "timestamp" | "duration";
|
|
300
|
+
readonly value: number | bigint;
|
|
301
|
+
readonly unit?: TimeUnit;
|
|
302
|
+
readonly timezone?: string;
|
|
303
|
+
}
|
|
304
|
+
export interface IntervalValue {
|
|
305
|
+
readonly kind: "interval";
|
|
306
|
+
readonly unit: IntervalUnit;
|
|
307
|
+
readonly months?: number;
|
|
308
|
+
readonly days?: number;
|
|
309
|
+
readonly milliseconds?: number;
|
|
310
|
+
readonly nanoseconds?: bigint;
|
|
311
|
+
}
|
|
312
|
+
export interface UnionValue {
|
|
313
|
+
readonly kind: "union";
|
|
314
|
+
readonly typeId: number;
|
|
315
|
+
readonly value: NativeValue | null;
|
|
316
|
+
}
|
|
317
|
+
export interface MapEntryValue {
|
|
318
|
+
readonly key: NativeValue | null;
|
|
319
|
+
readonly value: NativeValue | null;
|
|
320
|
+
}
|
|
321
|
+
export interface NativeListValue extends ReadonlyArray<NativeValue | null> {
|
|
322
|
+
}
|
|
323
|
+
export interface NativeStructValue {
|
|
324
|
+
readonly [name: string]: NativeValue | null;
|
|
325
|
+
}
|
|
326
|
+
export interface NativeMapValue extends ReadonlyArray<Readonly<MapEntryValue>> {
|
|
327
|
+
}
|
|
328
|
+
export type NativeValue = boolean | number | bigint | string | Uint8Array | DecimalValue | TemporalValue | IntervalValue | UnionValue | NativeListValue | NativeStructValue | NativeMapValue;
|
|
329
|
+
export interface ToRowsOptions {
|
|
330
|
+
/** Maximum decoded cells. Defaults to 10,000. */
|
|
331
|
+
readonly maxCells?: number;
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Logical, column-oriented access to one returned batch column.
|
|
335
|
+
*
|
|
336
|
+
* Values are indexed relative to `TableBatch.range.rowStart`; physical buffer
|
|
337
|
+
* regions and adapter transport details intentionally remain private.
|
|
338
|
+
*/
|
|
339
|
+
export interface TableBatchColumn {
|
|
340
|
+
readonly columnId: string;
|
|
341
|
+
readonly columnIndex: number;
|
|
342
|
+
readonly rowCount: number;
|
|
343
|
+
getValue(rowOffset: number): NativeValue | null;
|
|
344
|
+
getDisplayValue(rowOffset: number): string | null;
|
|
345
|
+
toValues(options?: ToRowsOptions): (NativeValue | null)[];
|
|
346
|
+
toDisplayValues(options?: ToRowsOptions): (string | null)[];
|
|
347
|
+
}
|
|
348
|
+
/** Stable logical batch contract. Wire buffers and ABI layout stay private. */
|
|
349
|
+
export interface TableBatch {
|
|
350
|
+
readonly tableId: string;
|
|
351
|
+
readonly revision: number;
|
|
352
|
+
readonly schemaVersion: number;
|
|
353
|
+
readonly range: Readonly<ReturnedRange>;
|
|
354
|
+
readonly columns: readonly TableBatchColumn[];
|
|
355
|
+
readonly complete: boolean;
|
|
356
|
+
toRows(options?: ToRowsOptions): (NativeValue | null)[][];
|
|
357
|
+
toDisplayRows(options?: ToRowsOptions): (string | null)[][];
|
|
358
|
+
}
|
|
359
|
+
export type WireBatchBuffer = ArrayBuffer | ArrayBufferView;
|
|
360
|
+
export interface WireTableBatch {
|
|
361
|
+
readonly layoutVersion: typeof BATCH_LAYOUT_VERSION;
|
|
362
|
+
readonly tableId: string;
|
|
363
|
+
readonly revision: number;
|
|
364
|
+
readonly schemaVersion: number;
|
|
365
|
+
readonly range: ReturnedRange;
|
|
366
|
+
readonly buffers: readonly WireBatchBuffer[];
|
|
367
|
+
readonly columns: readonly WireTableBatchColumn[];
|
|
368
|
+
readonly complete: boolean;
|
|
369
|
+
}
|
|
370
|
+
/** Owns and validates one generic layout-v1 batch received from the Worker. */
|
|
371
|
+
export declare class ColumnarTableBatch implements TableBatch {
|
|
372
|
+
#private;
|
|
373
|
+
readonly tableId: string;
|
|
374
|
+
readonly revision: number;
|
|
375
|
+
readonly schemaVersion: number;
|
|
376
|
+
readonly range: Readonly<ReturnedRange>;
|
|
377
|
+
readonly columns: readonly TableBatchColumn[];
|
|
378
|
+
readonly complete: boolean;
|
|
379
|
+
constructor(value: WireTableBatch);
|
|
380
|
+
toRows(options?: ToRowsOptions): (NativeValue | null)[][];
|
|
381
|
+
toDisplayRows(options?: ToRowsOptions): (string | null)[][];
|
|
382
|
+
}
|
|
383
|
+
export declare function validateRange(request: RangeRequest): RangeRequest;
|
|
384
|
+
export declare function normalizeMetadata(value: TableMetadata): Readonly<TableMetadata>;
|
|
385
|
+
/** Normalizes a protocol DataType and rejects cycles or excessive nesting. */
|
|
386
|
+
export declare function normalizeDataType(value: unknown, depth?: number): ArrowDataType;
|
|
387
|
+
export declare function assertNonNegativeSafeInteger(value: unknown, name: string): asserts value is number;
|
|
388
|
+
export declare function assertPositiveSafeInteger(value: unknown, name: string): asserts value is number;
|
|
389
|
+
export {};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
export type OfficialAdapterId = "tabulark:delimited" | "tabulark:arrow-ipc" | "tabulark:parquet" | "tabulark:excel";
|
|
2
|
+
export type OfficialSourceAccess = "streaming" | "range" | "staged";
|
|
3
|
+
export interface OfficialAdapterManifestEntry {
|
|
4
|
+
readonly id: OfficialAdapterId;
|
|
5
|
+
readonly entrypoint: "." | "./arrow" | "./parquet" | "./excel";
|
|
6
|
+
readonly exportName: string;
|
|
7
|
+
readonly wasm: Readonly<{
|
|
8
|
+
readonly packageName: string;
|
|
9
|
+
readonly crateArtifact: string;
|
|
10
|
+
readonly outputName: string;
|
|
11
|
+
readonly outputDirectory: string;
|
|
12
|
+
readonly modulePath: string;
|
|
13
|
+
readonly runtimeExport: "WasmRuntime";
|
|
14
|
+
}>;
|
|
15
|
+
readonly options: Readonly<{
|
|
16
|
+
readonly allowedKeys: readonly string[];
|
|
17
|
+
}>;
|
|
18
|
+
readonly resources: Readonly<{
|
|
19
|
+
readonly sourceAccess: OfficialSourceAccess;
|
|
20
|
+
readonly supportsPresentation: boolean;
|
|
21
|
+
readonly runtimeWeight: number;
|
|
22
|
+
}>;
|
|
23
|
+
}
|
|
24
|
+
/** Runtime IDs are derived from the manifest rather than repeated in code. */
|
|
25
|
+
export declare const OFFICIAL_ADAPTER_IDS: readonly OfficialAdapterId[];
|
|
26
|
+
/** The sole internal source of truth for built-in IDs, artifacts and host policy. */
|
|
27
|
+
export declare const OFFICIAL_ADAPTER_MANIFEST: readonly OfficialAdapterManifestEntry[];
|
|
28
|
+
export declare function isOfficialAdapterId(value: unknown): value is OfficialAdapterId;
|
|
29
|
+
export declare function officialAdapterManifestEntry(id: OfficialAdapterId): OfficialAdapterManifestEntry;
|
|
30
|
+
/** Resolves an official wrapper relative to the bundle that hosts this code. */
|
|
31
|
+
export declare function officialAdapterModuleUrl(id: OfficialAdapterId): string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { type ParquetAdapterOptions } from "./adapters.js";
|
|
2
|
+
/** Opens Apache Parquet input through the lazy official Parquet WASM artifact. */
|
|
3
|
+
export declare const parquetAdapter: import("./adapters.js").AdapterDescriptor<"tabulark:parquet", import("./adapters.js").ParquetAdapterOptions>;
|
package/dist/parquet.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var OFFICIAL_ADAPTER=Symbol.for("tabulark.official-adapter.v2");function createOfficialAdapter(id){const marker=Object.freeze({id});return Object.freeze({id,kind:"official",[OFFICIAL_ADAPTER]:marker})}var delimitedAdapter=createOfficialAdapter("tabulark:delimited");function createParquetAdapter(){return createOfficialAdapter("tabulark:parquet")}var parquetAdapter=createParquetAdapter();export{parquetAdapter};
|
|
2
|
+
//# sourceMappingURL=parquet.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../js/adapters.ts", "../js/parquet.ts"],
|
|
4
|
+
"sourcesContent": ["import {\n isOfficialAdapterId,\n officialAdapterManifestEntry,\n type OfficialAdapterId,\n} from \"./official-adapter-manifest.js\";\n\nexport type { OfficialAdapterId } from \"./official-adapter-manifest.js\";\n\nexport type DelimitedDialect = \"csv\" | \"tsv\";\nexport type HeaderMode = \"first-row\" | \"none\";\nexport type ParseMode = \"lenient\" | \"strict\";\n\n/** Options understood by the built-in delimited adapter. */\nexport interface DelimitedAdapterOptions {\n /** Defaults to `csv`. No filename-based selection is performed. */\n readonly dialect?: DelimitedDialect;\n readonly header?: HeaderMode;\n readonly mode?: ParseMode;\n /** One ASCII delimiter byte. Overrides the dialect default when supplied. */\n readonly delimiter?: string;\n /** Optional display name for the source. */\n readonly sourceName?: string;\n}\n\nexport type ArrowIpcContainer = \"auto\" | \"file\" | \"stream\";\n\n/** Options understood by the built-in Arrow IPC adapter. */\nexport interface ArrowIpcAdapterOptions {\n /** Defaults to `auto`; format detection belongs to the Arrow adapter. */\n readonly container?: ArrowIpcContainer;\n /** Optional display name for the source. */\n readonly sourceName?: string;\n}\n\n/** Options understood by the built-in Parquet adapter. */\nexport interface ParquetAdapterOptions {\n /** Optional display name for the source. */\n readonly sourceName?: string;\n}\n\nexport type ExcelFormat = \"auto\" | \"xls\" | \"xlsx\";\n\n/** Options understood by the built-in Excel adapter. */\nexport interface ExcelAdapterOptions {\n /** Defaults to `auto`; the adapter identifies the file from its signature. */\n readonly format?: ExcelFormat;\n /** Optional display name for the source. */\n readonly sourceName?: string;\n}\n\n/**\n * A frozen descriptor for one built-in adapter.\n *\n * Descriptors select a named official artifact only. They are deliberately not\n * factories and cannot carry a module URL or a third-party implementation.\n */\nexport interface AdapterDescriptor<\n Id extends OfficialAdapterId = OfficialAdapterId,\n Options = unknown,\n> {\n readonly id: Id;\n readonly kind: \"official\";\n /** Carries the option type without exposing a runtime extension point. */\n readonly __options?: Options;\n}\n\ninterface InternalAdapterDescriptor<\n Id extends OfficialAdapterId = OfficialAdapterId,\n Options = unknown,\n> extends AdapterDescriptor<Id, Options> {\n readonly [OFFICIAL_ADAPTER]: Readonly<{ readonly id: Id }>;\n}\n\n/**\n * A process-global symbol permits descriptors from separately bundled stable\n * entrypoints to be recognized. It conveys no capability: the manifest below\n * still owns the selected module URL and resource policy.\n */\nconst OFFICIAL_ADAPTER = Symbol.for(\"tabulark.official-adapter.v2\");\n\nexport interface AdapterRegistration {\n readonly id: OfficialAdapterId;\n}\n\nfunction createOfficialAdapter<Id extends OfficialAdapterId, Options>(\n id: Id,\n): AdapterDescriptor<Id, Options> {\n const marker = Object.freeze({ id });\n return Object.freeze({\n id,\n kind: \"official\" as const,\n [OFFICIAL_ADAPTER]: marker,\n }) as InternalAdapterDescriptor<Id, Options>;\n}\n\n/** The built-in RFC-style delimited text adapter. */\nexport const delimitedAdapter = createOfficialAdapter<\n \"tabulark:delimited\",\n DelimitedAdapterOptions\n>(\"tabulark:delimited\");\n\n/** @internal Used by the stable `/arrow` entrypoint. */\nexport function createArrowIpcAdapter(): AdapterDescriptor<\"tabulark:arrow-ipc\", ArrowIpcAdapterOptions> {\n return createOfficialAdapter<\"tabulark:arrow-ipc\", ArrowIpcAdapterOptions>(\"tabulark:arrow-ipc\");\n}\n\n/** @internal Used by the stable `/parquet` entrypoint. */\nexport function createParquetAdapter(): AdapterDescriptor<\"tabulark:parquet\", ParquetAdapterOptions> {\n return createOfficialAdapter<\"tabulark:parquet\", ParquetAdapterOptions>(\"tabulark:parquet\");\n}\n\n/** @internal Used by the stable `/excel` entrypoint. */\nexport function createExcelAdapter(): AdapterDescriptor<\"tabulark:excel\", ExcelAdapterOptions> {\n return createOfficialAdapter<\"tabulark:excel\", ExcelAdapterOptions>(\"tabulark:excel\");\n}\n\n/** @internal Validates and extracts the non-public Worker registration. */\nexport function resolveOfficialAdapter(value: unknown): AdapterRegistration | undefined {\n if (!isRecord(value) || !Object.isFrozen(value) || !isOfficialAdapterId(value.id) || value.kind !== \"official\") {\n return undefined;\n }\n const marker = value[OFFICIAL_ADAPTER];\n if (!isRecord(marker) || marker.id !== value.id) {\n return undefined;\n }\n // A marker may be recreated by another bundle, but it conveys no URL or\n // implementation capability: it can select only a manifest-owned ID.\n officialAdapterManifestEntry(value.id);\n return Object.freeze({ id: value.id });\n}\n\nfunction isRecord(value: unknown): value is Record<PropertyKey, unknown> {\n return typeof value === \"object\" && value !== null;\n}\n", "export { type ParquetAdapterOptions } from \"./adapters.js\";\n\nimport { createParquetAdapter } from \"./adapters.js\";\n\n/** Opens Apache Parquet input through the lazy official Parquet WASM artifact. */\nexport const parquetAdapter = createParquetAdapter();\n"],
|
|
5
|
+
"mappings": "AA8EA,IAAM,iBAAmB,OAAO,IAAI,8BAA8B,EAMlE,SAAS,sBACP,GACgC,CAChC,MAAM,OAAS,OAAO,OAAO,CAAE,EAAG,CAAC,EACnC,OAAO,OAAO,OAAO,CACnB,GACA,KAAM,WACN,CAAC,gBAAgB,EAAG,MACtB,CAAC,CACH,CAGO,IAAM,iBAAmB,sBAG9B,oBAAoB,EAQf,SAAS,sBAAqF,CACnG,OAAO,sBAAiE,kBAAkB,CAC5F,CCxGO,IAAM,eAAiB,qBAAqB",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/** Version 3 introduces multi-table presentation and discriminated adapter steps. */
|
|
2
|
+
export declare const PROTOCOL_VERSION: 3;
|
|
3
|
+
/** Version of the private, built-in Rust adapter contract. */
|
|
4
|
+
export declare const ADAPTER_API_VERSION: 2;
|
|
5
|
+
/** Version of the descriptor + deduplicated-buffer batch transport. */
|
|
6
|
+
export declare const BATCH_LAYOUT_VERSION: 1;
|
|
7
|
+
export type ProtocolVersion = typeof PROTOCOL_VERSION;
|
|
8
|
+
export type Operation = "hello" | "openSource" | "listTables" | "openTable" | "getMetadata" | "getPresentation" | "readPresentationRange" | "readRange" | "cancel" | "closeTable" | "closeSource" | "shutdown";
|
|
9
|
+
export interface ProtocolRequest<T = unknown> {
|
|
10
|
+
readonly protocolVersion: ProtocolVersion;
|
|
11
|
+
readonly requestId: string;
|
|
12
|
+
readonly op: Operation;
|
|
13
|
+
readonly payload: T;
|
|
14
|
+
}
|
|
15
|
+
export type ResponseKind = "hello" | "dataset" | "tables" | "table" | "metadata" | "presentation" | "presentationRange" | "batch" | "acknowledged";
|
|
16
|
+
export interface ProtocolResult<T = unknown> {
|
|
17
|
+
readonly kind: ResponseKind;
|
|
18
|
+
readonly data?: T;
|
|
19
|
+
}
|
|
20
|
+
export interface ProtocolSuccess<T = unknown> {
|
|
21
|
+
readonly protocolVersion: ProtocolVersion;
|
|
22
|
+
readonly requestId: string;
|
|
23
|
+
readonly status: "success";
|
|
24
|
+
readonly result: ProtocolResult<T>;
|
|
25
|
+
}
|
|
26
|
+
export interface SerializedError {
|
|
27
|
+
readonly code: string;
|
|
28
|
+
readonly message: string;
|
|
29
|
+
readonly retryable: boolean;
|
|
30
|
+
readonly details?: unknown;
|
|
31
|
+
}
|
|
32
|
+
export interface ProtocolFailure {
|
|
33
|
+
readonly protocolVersion: ProtocolVersion;
|
|
34
|
+
readonly requestId: string;
|
|
35
|
+
readonly status: "failure";
|
|
36
|
+
readonly error: SerializedError;
|
|
37
|
+
}
|
|
38
|
+
export type ProtocolResponse<T = unknown> = ProtocolSuccess<T> | ProtocolFailure;
|
|
39
|
+
export type RuntimeEventName = "progress" | "metadata" | "warning" | "closed" | "runtimeError";
|
|
40
|
+
export interface ProtocolEvent<T = unknown> {
|
|
41
|
+
readonly protocolVersion: ProtocolVersion;
|
|
42
|
+
readonly requestId?: string;
|
|
43
|
+
readonly event: RuntimeEventName;
|
|
44
|
+
/** Required for dataset/table events; omitted only by a process-wide runtimeError. */
|
|
45
|
+
readonly datasetHandle?: string;
|
|
46
|
+
readonly tableHandle?: string;
|
|
47
|
+
readonly tableId?: string;
|
|
48
|
+
/** Revision associated with a table-scoped event, when known. */
|
|
49
|
+
readonly revision?: number;
|
|
50
|
+
readonly payload: T;
|
|
51
|
+
}
|
|
52
|
+
export declare function isProtocolResponse(value: unknown): value is ProtocolResponse;
|
|
53
|
+
export declare function isProtocolEvent(value: unknown): value is ProtocolEvent;
|
|
54
|
+
export declare function isRecord(value: unknown): value is Record<string, unknown>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { RangeRequest, WireTableBatch } from "./model.js";
|
|
2
|
+
export declare class PermitQueueFullError extends Error {
|
|
3
|
+
readonly maxWaiters: number;
|
|
4
|
+
constructor(maxWaiters: number);
|
|
5
|
+
}
|
|
6
|
+
/** A small FIFO permit queue whose pending acquisitions can be cancelled by key. */
|
|
7
|
+
export declare class AsyncPermitQueue {
|
|
8
|
+
#private;
|
|
9
|
+
constructor(maxActive: number, maxWaiters: number);
|
|
10
|
+
acquire(key: string): Promise<() => void>;
|
|
11
|
+
cancel(key: string, reason: unknown): boolean;
|
|
12
|
+
}
|
|
13
|
+
/** A byte-bounded least-recently-used cache. */
|
|
14
|
+
export declare class ByteLruCache<T> {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(maxBytes: number, options?: Readonly<{
|
|
17
|
+
onRemove?: (key: string, value: T, byteLength: number) => void;
|
|
18
|
+
}>);
|
|
19
|
+
get maxBytes(): number;
|
|
20
|
+
get(key: string): T | undefined;
|
|
21
|
+
set(key: string, value: T, byteLength: number): void;
|
|
22
|
+
deleteWhere(predicate: (key: string, value: T) => boolean): void;
|
|
23
|
+
clear(): void;
|
|
24
|
+
}
|
|
25
|
+
export declare function rangeCacheKey(owner: string, revision: number, schemaVersion: number, range: RangeRequest): string;
|
|
26
|
+
export declare function rangeCacheKeyBelongsTo(key: string, owner: string): boolean;
|
|
27
|
+
export declare function cloneWireTableBatch(batch: WireTableBatch): WireTableBatch;
|
|
28
|
+
export declare function wireBatchByteLength(batch: WireTableBatch): number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { TabularkError } from "./errors.js";
|
|
2
|
+
import { type Operation, type ProtocolEvent, type ResponseKind } from "./protocol.js";
|
|
3
|
+
type EventListener = (event: ProtocolEvent) => void;
|
|
4
|
+
type FailureListener = (error: TabularkError) => void;
|
|
5
|
+
interface RequestOptions {
|
|
6
|
+
readonly transfer?: Transferable[];
|
|
7
|
+
readonly signal?: AbortSignal;
|
|
8
|
+
readonly timeoutMs?: number;
|
|
9
|
+
}
|
|
10
|
+
/** Main-thread request multiplexer for one dedicated Worker. */
|
|
11
|
+
export declare class WorkerRpcClient {
|
|
12
|
+
#private;
|
|
13
|
+
constructor(worker: Worker, onEvent: EventListener, onFailure?: FailureListener);
|
|
14
|
+
request<T>(op: Operation, payload: unknown, expectedKind: ResponseKind, options?: RequestOptions): Promise<T>;
|
|
15
|
+
shutdown(timeoutMs?: number): Promise<void>;
|
|
16
|
+
terminate(error?: TabularkError, notifyFailure?: boolean): void;
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export interface AccessibleGridColumn {
|
|
2
|
+
readonly index: number;
|
|
3
|
+
readonly name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AccessibleGridCell {
|
|
6
|
+
readonly rowIndex: number;
|
|
7
|
+
readonly columnIndex: number;
|
|
8
|
+
readonly value: string | null | undefined;
|
|
9
|
+
readonly selected: boolean;
|
|
10
|
+
readonly active: boolean;
|
|
11
|
+
readonly rowSpan?: number;
|
|
12
|
+
readonly columnSpan?: number;
|
|
13
|
+
}
|
|
14
|
+
export interface AccessibleGridRow {
|
|
15
|
+
readonly index: number;
|
|
16
|
+
readonly cells: readonly AccessibleGridCell[];
|
|
17
|
+
}
|
|
18
|
+
export interface AccessibleGridSnapshot {
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly exactRowCount?: number;
|
|
21
|
+
readonly columnCount: number;
|
|
22
|
+
readonly columns: readonly AccessibleGridColumn[];
|
|
23
|
+
readonly rows: readonly AccessibleGridRow[];
|
|
24
|
+
readonly busy: boolean;
|
|
25
|
+
readonly status?: string;
|
|
26
|
+
}
|
|
27
|
+
/** A viewport-bounded semantic counterpart to the visual Canvas table. */
|
|
28
|
+
export declare class AccessibleViewportGrid {
|
|
29
|
+
#private;
|
|
30
|
+
readonly element: HTMLDivElement;
|
|
31
|
+
readonly statusElement: HTMLDivElement;
|
|
32
|
+
constructor(ownerDocument: Document, label?: string);
|
|
33
|
+
update(snapshot: AccessibleGridSnapshot): void;
|
|
34
|
+
focus(options?: FocusOptions): void;
|
|
35
|
+
destroy(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import type { MergedCellRegion, PresentationStyle } from "../model.js";
|
|
2
|
+
export interface CanvasPaintColumn {
|
|
3
|
+
readonly index: number;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
/** Viewport-relative x coordinate, including the pinned row gutter offset. */
|
|
6
|
+
readonly x: number;
|
|
7
|
+
readonly width: number;
|
|
8
|
+
readonly frozen?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface CanvasPaintCell {
|
|
11
|
+
readonly columnIndex: number;
|
|
12
|
+
readonly value: string | null | undefined;
|
|
13
|
+
readonly style?: PresentationStyle;
|
|
14
|
+
/** The cell is painted by its merge anchor rather than its own grid slot. */
|
|
15
|
+
readonly coveredByMerge?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface CanvasPaintRow {
|
|
18
|
+
readonly index: number;
|
|
19
|
+
/** Viewport-relative y coordinate, including the pinned header offset. */
|
|
20
|
+
readonly y: number;
|
|
21
|
+
readonly height: number;
|
|
22
|
+
readonly frozen?: boolean;
|
|
23
|
+
readonly cells: readonly CanvasPaintCell[];
|
|
24
|
+
}
|
|
25
|
+
export interface CanvasPaintMergedCell {
|
|
26
|
+
readonly region: Readonly<MergedCellRegion>;
|
|
27
|
+
readonly x: number;
|
|
28
|
+
readonly y: number;
|
|
29
|
+
readonly width: number;
|
|
30
|
+
readonly height: number;
|
|
31
|
+
readonly value: string | null | undefined;
|
|
32
|
+
readonly style?: PresentationStyle;
|
|
33
|
+
/** A pane-clipped continuation; only the anchor fragment paints the value. */
|
|
34
|
+
readonly continuation?: boolean;
|
|
35
|
+
}
|
|
36
|
+
export interface CanvasPaintSelection {
|
|
37
|
+
readonly rowStart: number;
|
|
38
|
+
/** Exclusive table row bound. */
|
|
39
|
+
readonly rowEnd: number;
|
|
40
|
+
readonly columnStart: number;
|
|
41
|
+
/** Exclusive table column bound. */
|
|
42
|
+
readonly columnEnd: number;
|
|
43
|
+
}
|
|
44
|
+
export interface CanvasPaintActiveCell {
|
|
45
|
+
readonly rowIndex: number;
|
|
46
|
+
readonly columnIndex: number;
|
|
47
|
+
}
|
|
48
|
+
export interface CanvasPaintSnapshot {
|
|
49
|
+
readonly width: number;
|
|
50
|
+
readonly height: number;
|
|
51
|
+
readonly headerHeight: number;
|
|
52
|
+
readonly rowGutterWidth: number;
|
|
53
|
+
readonly columns: readonly CanvasPaintColumn[];
|
|
54
|
+
readonly rows: readonly CanvasPaintRow[];
|
|
55
|
+
readonly mergedCells?: readonly CanvasPaintMergedCell[];
|
|
56
|
+
readonly selection?: CanvasPaintSelection;
|
|
57
|
+
readonly activeCell?: CanvasPaintActiveCell;
|
|
58
|
+
readonly busy: boolean;
|
|
59
|
+
}
|
|
60
|
+
export interface CanvasTableTheme {
|
|
61
|
+
readonly background: string;
|
|
62
|
+
readonly foreground: string;
|
|
63
|
+
readonly mutedForeground: string;
|
|
64
|
+
readonly headerBackground: string;
|
|
65
|
+
readonly headerForeground: string;
|
|
66
|
+
readonly alternateRowBackground: string;
|
|
67
|
+
readonly gridLine: string;
|
|
68
|
+
readonly selectionBackground: string;
|
|
69
|
+
readonly selectionBorder: string;
|
|
70
|
+
readonly activeCellBorder: string;
|
|
71
|
+
readonly loadingBackground: string;
|
|
72
|
+
readonly font: string;
|
|
73
|
+
readonly headerFont: string;
|
|
74
|
+
}
|
|
75
|
+
export declare const DEFAULT_CANVAS_TABLE_THEME: Readonly<CanvasTableTheme>;
|
|
76
|
+
/** Resolves author-independent system colors for Windows High Contrast and other forced palettes. */
|
|
77
|
+
export declare function forcedColorsCanvasTableTheme(base?: Readonly<CanvasTableTheme>): Readonly<CanvasTableTheme>;
|
|
78
|
+
/** Paints one viewport frame and keeps the backing store device-pixel aware. */
|
|
79
|
+
export declare class CanvasTablePainter {
|
|
80
|
+
#private;
|
|
81
|
+
readonly canvas: HTMLCanvasElement;
|
|
82
|
+
constructor(canvas: HTMLCanvasElement, options?: {
|
|
83
|
+
readonly theme?: Partial<CanvasTableTheme>;
|
|
84
|
+
readonly maxDevicePixelRatio?: number;
|
|
85
|
+
readonly forcedColors?: boolean;
|
|
86
|
+
});
|
|
87
|
+
setTheme(theme: Readonly<CanvasTableTheme>, options?: {
|
|
88
|
+
readonly forcedColors?: boolean;
|
|
89
|
+
}): void;
|
|
90
|
+
paint(snapshot: CanvasPaintSnapshot): void;
|
|
91
|
+
}
|