-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.ts
More file actions
189 lines (171 loc) · 6.57 KB
/
Copy pathindex.ts
File metadata and controls
189 lines (171 loc) · 6.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/**
* Interactive Data Table Library
*
* A client-side JavaScript library for interactive, explorable data tables
* using DuckDB WASM for in-browser analytics.
*
* This is the root entry (`@jeyabbalas/data-table`) — the public surface.
* Advanced building blocks (low-level state, UI components, export helpers,
* visualization internals, persistence snapshot serializers, `AutoSave`)
* live at `@jeyabbalas/data-table/advanced`.
*/
declare const __DT_VERSION__: string;
/**
* Library semantic-version string. Matches `package.json#version`.
*
* Substituted at build time via Vite's `define` (see `vite.config.ts`)
* so the published value can never drift from the manifest.
*/
export const VERSION: string = __DT_VERSION__;
// ---- Facade ----
// High-level entry point for most consumers. Wraps worker + state + actions
// + container + visualizations + persistence + presets + undo/redo + export
// into a single `createDataTable()` call.
export { createDataTable } from './DataTable';
export type { DataTable, CreateDataTableOptions, ColorScheme } from './DataTable';
export type { TableEvents, TableEventName, TableErrorSource } from './core/TableEvents';
// ---- Typed error model ----
// All library errors extend `DataTableError`; catch sites narrow via
// `instanceof` and branch on `err.code`.
export {
DataTableError,
WorkerInitError,
WorkerTerminatedError,
QueryError,
LoadError,
SQLValidationError,
DerivedColumnError,
PersistenceError,
AnnotationError,
ExportError,
ConfigurationError,
DestroyedError,
} from './core/errors';
export type { DataTableErrorOptions } from './core/errors';
// ---- Core types ----
export type {
DataType,
ColumnSchema,
Filter,
FilterType,
SortColumn,
SortDirection,
RowId,
ColumnHeaderTooltipContent,
ColumnHeaderTooltipItem,
} from './core/types';
export { ROWID_COLUMN } from './core/types';
export type { GetColumnValuesOptions } from './core/Actions';
// ---- Filter shapes ----
export type {
RangeFilter,
PointFilter,
SetFilter,
NotSetFilter,
NullFilter,
PatternFilter,
RawSQLFilter,
} from './filters/FilterTypes';
// ---- SQL-authoring helpers ----
// For consumers building raw SQL on top of the bridge (e.g. custom SELECTs,
// data-quality rule authoring). Filter-object → WHERE-clause conversion is
// handled internally; consumers construct `Filter[]` via `table.actions`.
export { quoteIdentifier, formatSQLValue, filtersToWhereClause } from './filters/FilterSQL';
// ---- Filter presets ----
export { FilterPresetManager } from './filters/FilterPresets';
export type { FilterPreset, FilterPresetCollection } from './filters/FilterPresetTypes';
// ---- Data layer ----
// Exposed for consumers pre-constructing a bridge or passing custom
// load options (progress callbacks, abort signals, format overrides).
export { WorkerBridge } from './data/WorkerBridge';
export type {
LoadOptions,
LoadDataResult,
WorkerBridgeOptions,
QueryOptions,
} from './data/WorkerBridge';
export type { QueryCacheOptions } from './data/QueryCache';
export type { DataFormat, LoadResult } from './data/DataLoader';
// ---- Persistence ----
// `SessionStore` is injectable for apps that manage their own storage.
// `serializeFilter` / `deserializeFilter` let apps round-trip filter
// state into their own stores (URL params, cloud sync, etc.).
export { SessionStore, serializeFilter, deserializeFilter } from './persistence/SessionStore';
export type { SessionStoreOptions } from './persistence/SessionStore';
export type {
SerializedFilter,
SerializedRangeFilter,
SerializedPointFilter,
SerializedSetFilter,
SerializedNotSetFilter,
DateWrapper,
} from './persistence/types';
// ---- Annotations ----
// Programmatic row / column / cell annotation overlay exposed on
// `table.annotations`. Types let consumers build JSON payloads for
// `loadJSON` without constructing a store by hand.
export type {
Annotation,
AnnotationScope,
AnnotationSeverity,
RowAnnotation,
ColumnAnnotation,
CellAnnotation,
AnnotationFile,
AnnotationChangePayload,
AnnotationChangeHandler,
NewAnnotation,
SeverityFilter,
} from './annotations/types';
export { ANNOTATION_FILE_VERSION } from './annotations/types';
// ---- Visualization registry ----
// Register custom visualizations per-instance via `createDataTable({
// visualizationRegistry })`, or globally via `defaultVisualizationRegistry`.
export {
VisualizationRegistry,
defaultVisualizationRegistry,
} from './visualizations/VisualizationRegistry';
export type {
VisualizationRegistration,
VisualizationConstructor,
} from './visualizations/VisualizationRegistry';
// ---- Stats panel registry ----
// Register a `BaseStatsPanel` subclass to replace the library's built-in
// two-line stats display in a column header with your own rendering. Same
// per-instance isolation semantics as `visualizationRegistry`. Empty by
// default — when no registration matches a column's type, the library
// falls back to its built-in HTML formatter.
export { StatsPanelRegistry, defaultStatsPanelRegistry } from './visualizations/StatsPanelRegistry';
export type {
StatsPanelRegistration,
StatsPanelConstructor,
} from './visualizations/StatsPanelRegistry';
// ---- Derived columns ----
// Types consumers need when passing initial derived-column definitions
// or when injecting a custom expression editor.
export type {
DerivedColumnKind,
VectorDataType,
ExpressionColumnDef,
VectorColumnDef,
DerivedColumnDef,
CompletionContext,
} from './derived/types';
export type { ExpressionEditor, ExpressionEditorFactory } from './derived/ExpressionEditorTypes';
// ---- Progress reporting ----
export type { ProgressInfo, ProgressCallback, ProgressStage } from './core/Progress';
// ---- Internationalization ----
// Pass `messages: DeepPartial<Strings>` to `createDataTable` to override any
// user-facing string. `defaultStrings` holds the English defaults;
// `mergeStrings` applies overrides recursively (functions replace wholesale).
export { defaultStrings, mergeStrings } from './core/Strings';
export type { Strings, DeepPartial } from './core/Strings';
// ---- Stylesheet presence detection ----
// Pair the sync getter with the `warning` event (code `STYLESHEET_MISSING`):
// the getter is useful for pre-mount checks, the event for logging.
export { isStylesheetLoaded } from './core/stylesheet';
// ---- Browser feature detection ----
// Sync probe of the browser APIs the library relies on. Pair with
// `strictBrowserCheck: true` on `createDataTable` for fail-fast init.
export { checkBrowserSupport } from './core/checkBrowserSupport';
export type { BrowserSupport } from './core/checkBrowserSupport';