react-semaphor 0.1.320 → 0.1.322

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.
Files changed (48) hide show
  1. package/dist/brand-studio/index.cjs +1 -1
  2. package/dist/brand-studio/index.js +4 -4
  3. package/dist/briefings/index.cjs +1 -1
  4. package/dist/briefings/index.js +278 -208
  5. package/dist/chunks/{braces-NfG5hX2c.js → braces-C7BeIXvM.js} +1 -1
  6. package/dist/chunks/{braces-CDPz6CF2.js → braces-ZjRH2Kl7.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog-CFXQBJ4A.js → calendar-preferences-dialog-CZqePF6B.js} +1 -1
  8. package/dist/chunks/{calendar-preferences-dialog-B7Z8OnuZ.js → calendar-preferences-dialog-t0OOALVd.js} +3 -3
  9. package/dist/chunks/{chevrons-up-down-BsdQRmJL.js → chevrons-up-down-CA-XvN1o.js} +1 -1
  10. package/dist/chunks/{chevrons-up-down-DiWloubI.js → chevrons-up-down-Cuilz9aY.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-DB16djcj.js → dashboard-briefing-launcher-BYbnbZ9e.js} +933 -910
  12. package/dist/chunks/{dashboard-briefing-launcher-DjDpGyD7.js → dashboard-briefing-launcher-d1_fm91W.js} +17 -17
  13. package/dist/chunks/dashboard-controls-B3HHMRPC.js +52 -0
  14. package/dist/chunks/dashboard-controls-BuChCKDm.js +2246 -0
  15. package/dist/chunks/{dashboard-json-C8-kkiyT.js → dashboard-json-DgoYjD0O.js} +2 -2
  16. package/dist/chunks/{dashboard-json-2nyFJ_-w.js → dashboard-json-M5-VFCtZ.js} +1 -1
  17. package/dist/chunks/{edit-dashboard-visual-BP77bJFI.js → edit-dashboard-visual-BH8DP1qq.js} +1 -1
  18. package/dist/chunks/{edit-dashboard-visual-D6oiTlXr.js → edit-dashboard-visual-DP31ytwJ.js} +6 -6
  19. package/dist/chunks/{index-Clw0hJzi.js → index-ChmS5nsv.js} +28873 -28145
  20. package/dist/chunks/{index-D8eouWYC.js → index-CodH6sqg.js} +217 -212
  21. package/dist/chunks/{palette-CJTdBzJB.js → palette-CanPG11m.js} +1 -1
  22. package/dist/chunks/{palette-BlxLchHy.js → palette-D96DOM7E.js} +1 -1
  23. package/dist/chunks/resource-management-panel-D3vO68dH.js +6 -0
  24. package/dist/chunks/{resource-management-panel-HcRJRZHO.js → resource-management-panel-gt__S0Pb.js} +451 -369
  25. package/dist/chunks/{save-B8x5Vi0W.js → save-CqrBQKG6.js} +1 -1
  26. package/dist/chunks/{save-DVRQBMeb.js → save-DxkSzUTZ.js} +1 -1
  27. package/dist/chunks/{switch-DPaKnsb8.js → switch-BXICAlvS.js} +2 -2
  28. package/dist/chunks/{switch-sauemjyY.js → switch-Deo2Ltmj.js} +133 -133
  29. package/dist/chunks/{use-create-flow-overlay-state-CdCldE6J.js → use-create-flow-overlay-state-BZaSpL-c.js} +1 -1
  30. package/dist/chunks/{use-create-flow-overlay-state-75l5mrVp.js → use-create-flow-overlay-state-OA3iI54p.js} +104 -104
  31. package/dist/chunks/{use-visual-utils-CMdEUnM5.js → use-visual-utils-CMucAqbS.js} +1 -1
  32. package/dist/chunks/{use-visual-utils-Bd4Cf9_B.js → use-visual-utils-CsXS-Zeh.js} +20 -20
  33. package/dist/dashboard/index.cjs +1 -1
  34. package/dist/dashboard/index.js +1 -1
  35. package/dist/dashboard-authoring/index.cjs +3 -0
  36. package/dist/dashboard-authoring/index.js +532 -0
  37. package/dist/index.cjs +1 -1
  38. package/dist/index.js +131 -130
  39. package/dist/style.css +1 -1
  40. package/dist/surfboard/index.cjs +1 -1
  41. package/dist/surfboard/index.js +2 -2
  42. package/dist/types/briefings.d.ts +15 -0
  43. package/dist/types/dashboard-authoring.d.ts +2703 -0
  44. package/dist/types/main.d.ts +145 -0
  45. package/package.json +6 -1
  46. package/dist/chunks/dashboard-controls-BisfskDD.js +0 -52
  47. package/dist/chunks/dashboard-controls-DPStW1kd.js +0 -1999
  48. package/dist/chunks/resource-management-panel-DTvY5OIq.js +0 -6
@@ -0,0 +1,2703 @@
1
+ import { ColumnSizingState } from '@tanstack/react-table';
2
+ import { FontSpec } from 'chart.js';
3
+
4
+ declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
5
+
6
+ declare type AIContext = {
7
+ selectedEntities: SelectedEntities;
8
+ fileAttachments?: FileAttachment[];
9
+ };
10
+
11
+ declare type AIScopeTable = {
12
+ connectionId: string;
13
+ connectionType: string;
14
+ databaseName: string;
15
+ schemaName: string;
16
+ tableName: string;
17
+ datamodelId: string;
18
+ datamodelName: string;
19
+ };
20
+
21
+ export declare function applyDashboardChangePlan(input: {
22
+ dashboard: TDashboard;
23
+ changePlan: DashboardChangePlan;
24
+ cardArtifacts: GeneratedDashboardCardArtifact[];
25
+ }): DashboardChangeCompileResult;
26
+
27
+ declare type AxisConfig = {
28
+ enabled?: boolean;
29
+ name?: {
30
+ enabled: boolean;
31
+ text?: string;
32
+ /** Font size for the axis title */
33
+ fontSize?: number;
34
+ /** Font weight for the axis title */
35
+ fontWeight?: 'normal' | 'bold';
36
+ };
37
+ position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
38
+ labels?: {
39
+ enabled: boolean;
40
+ rotation?: 'auto' | 0 | 45 | 90 | -45 | -90;
41
+ };
42
+ formatMode?: 'inherit' | 'override';
43
+ formatOptions?: TFormatOptions;
44
+ scale?: {
45
+ min?: number | 'auto';
46
+ max?: number | 'auto';
47
+ stepSize?: number | 'auto';
48
+ };
49
+ };
50
+
51
+ declare interface BaseColumn {
52
+ id: string;
53
+ name: string;
54
+ label?: string;
55
+ type: ColumnType;
56
+ table?: string;
57
+ }
58
+
59
+ declare type BaseCustomCard = {
60
+ cardId: string;
61
+ replaceDefault?: boolean;
62
+ };
63
+
64
+ declare type BaseFilter = {
65
+ filterId: TFilter['id'];
66
+ expression?: string;
67
+ name: string;
68
+ valueType: 'string' | 'number' | 'date' | 'boolean';
69
+ connectionType?: 'database' | 'api';
70
+ dataType?: string;
71
+ fieldMeta?: FilterFieldMeta;
72
+ semanticContext?: FilterSemanticContext;
73
+ };
74
+
75
+ declare type Breakpoint = 'lg' | 'md' | 'sm' | 'xs' | 'xxs';
76
+
77
+ declare type CacheConfig = {
78
+ ttl: string;
79
+ status: 'on' | 'on-refresh' | 'off';
80
+ };
81
+
82
+ /**
83
+ * Formula metadata for calculated fields (UI-only metadata)
84
+ * This is supplementary data to help the UI display and edit calculated fields.
85
+ * The `expression` field remains the source of truth for the backend.
86
+ *
87
+ * IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
88
+ * Both are generated together from the same dialog inputs, preventing drift.
89
+ */
90
+ declare interface CalculatedFieldFormula {
91
+ operation: CalculatedFieldOperation;
92
+ /**
93
+ * Array of full MetricField objects used as inputs to the calculated field.
94
+ *
95
+ * Storing complete Field objects eliminates the need for runtime lookups and ensures:
96
+ * - Table alias resolution works with schema-qualified tables (Issue 1)
97
+ * - All field metadata is available even if the input field isn't selected on the card (Issue 2)
98
+ * - Aggregate functions, filters, and entity info are preserved
99
+ *
100
+ * Each input field contains complete metadata:
101
+ * - name, entityId, entityName, qualifiedEntityName (for table qualification)
102
+ * - aggregate (for proper post-aggregation: SUM(sales) / COUNT(orders))
103
+ * - parameters.filters (for filtered metrics)
104
+ * - dataType and other properties
105
+ *
106
+ * Example: [
107
+ * {name: 'sales', aggregate: 'SUM', entityName: 'sales_data', ...},
108
+ * {name: 'order_id', aggregate: 'COUNT', entityName: 'sales_data', ...}
109
+ * ]
110
+ */
111
+ inputFields: Array<MetricField | GroupByField>;
112
+ /**
113
+ * Constant value used in scale operations (e.g., multiply by 0.15)
114
+ * Only applicable for 'scale' operation type
115
+ */
116
+ constant?: number;
117
+ }
118
+
119
+ /**
120
+ * Operations supported for calculated fields
121
+ */
122
+ declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
123
+
124
+ declare interface CardConfig {
125
+ groupByColumns?: GroupByField[];
126
+ metricColumns?: MetricField[];
127
+ pivotByColumns?: PivotByField[];
128
+ sortByColumns?: SortByField[];
129
+ detailColumns?: DetailField[];
130
+ /** Preserves non-detail config when switching to detail tables. */
131
+ detailTableBackup?: DetailTableBackupConfig;
132
+ filters?: FilterGroup;
133
+ joinPlan?: JoinPlan;
134
+ rowLimit?: number;
135
+ /**
136
+ * One or more hierarchies that define drillable paths through dimensions.
137
+ */
138
+ drillHierarchies?: DrillHierarchy[];
139
+ /**
140
+ * Optional list of dimensions allowed for dynamic drill-down across this card.
141
+ * Used only when drill steps contain `mode: 'dynamicDrill'` or `type: 'dynamic'`.
142
+ */
143
+ allowedDrillTargets?: Field[];
144
+ /**
145
+ * NOT UOptional preload settings for inline drill previews
146
+ */
147
+ inlineDrillPreview?: {
148
+ enabled: boolean;
149
+ limit: number;
150
+ mode: 'lazy' | 'preloaded';
151
+ };
152
+ /**
153
+ * Configuration for on-click dashboard filters triggered by this card.
154
+ */
155
+ clickFilterInteractions?: ClickFilterInteraction[];
156
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
157
+ targetValue?: number;
158
+ showComparisonInLegend?: boolean;
159
+ showTrendline?: boolean;
160
+ trendlineWindow?: number;
161
+ trendlineGranularity?: 'day' | 'week' | 'month';
162
+ summary?: {
163
+ enabled?: boolean;
164
+ showOnCard?: boolean;
165
+ includeInDashboardSummary?: boolean;
166
+ breakdownDimensions?: GroupByField[];
167
+ };
168
+ rowAggregates?: Array<{
169
+ label?: string;
170
+ function: AggregateFunction;
171
+ groupLevel: string | 'ALL';
172
+ }>;
173
+ columnAggregates?: Array<{
174
+ label?: string;
175
+ function: AggregateFunction;
176
+ pivotLevel: string | 'ALL';
177
+ }>;
178
+ }
179
+
180
+ declare interface CardInteractionConfig {
181
+ /**
182
+ * V2: Unified interactions array.
183
+ * Each interaction includes a trigger that specifies what element must be clicked.
184
+ */
185
+ interactions?: PersistedInteraction[];
186
+ allowedDrillTargets?: Field[];
187
+ drillHierarchies?: DrillHierarchy[];
188
+ }
189
+
190
+ declare type CardWithContent = BaseCustomCard & {
191
+ content: React.FC<{
192
+ card: TCard;
193
+ }>;
194
+ footer?: React.FC<{
195
+ card: TCard;
196
+ }>;
197
+ };
198
+
199
+ declare type CardWithFooter = BaseCustomCard & {
200
+ content?: React.FC<{
201
+ card: TCard;
202
+ }>;
203
+ footer: React.FC<{
204
+ card: TCard;
205
+ }>;
206
+ };
207
+
208
+ declare interface ClickFilterInteraction {
209
+ mode: 'clickFilter';
210
+ /**
211
+ * What element must be clicked to trigger this interaction.
212
+ * Determines both the matching logic and the filtering behavior.
213
+ *
214
+ * @migration Optional during migration. Will be required in V2.
215
+ * Old configs without trigger will apply to any click (legacy behavior).
216
+ */
217
+ trigger?: InteractionTrigger;
218
+ /**
219
+ * Fields from the chart element that should be used as filters.
220
+ * e.g., [region, ship_mode] from a stacked bar chart
221
+ */
222
+ filterFields: Field[];
223
+ /**
224
+ * Should this card visually highlight when clicked?
225
+ */
226
+ highlightSelf?: boolean;
227
+ /**
228
+ * Cards this filter applies to (inclusive).
229
+ * If omitted and `excludeCardIds` is also omitted → applies to all cards except self.
230
+ */
231
+ applyToCardIds?: string[];
232
+ /**
233
+ * Cards to explicitly exclude from receiving this filter.
234
+ * Takes effect only if `applyToCardIds` is undefined (acts as override).
235
+ */
236
+ excludeCardIds?: string[];
237
+ /**
238
+ * Optional UI label or tooltip.
239
+ */
240
+ label?: string;
241
+ }
242
+
243
+ declare type ColorConfig = {
244
+ segments: Record<string, string>;
245
+ };
246
+
247
+ declare type ColorRange = {
248
+ start: number;
249
+ end: number;
250
+ color: string;
251
+ };
252
+
253
+ declare interface ColorRange_2 {
254
+ min: number;
255
+ max: number;
256
+ color: string;
257
+ applyTo: 'cell' | 'row';
258
+ }
259
+
260
+ declare interface ColumnSettings {
261
+ type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
262
+ inheritMetricFormat?: boolean;
263
+ textAlign: 'left' | 'center' | 'right';
264
+ width: number;
265
+ minWidth?: number;
266
+ maxWidth?: number;
267
+ textOverflow?: 'ellipsis' | 'wrap' | 'clip';
268
+ textWrap: ColumnTextWrap;
269
+ /** Deprecated/inert. Totals are controlled by tablePrefs.tableStyle.totals. */
270
+ totalsBehavior?: TotalsBehavior;
271
+ totalsLabel?: string;
272
+ numberFormat: {
273
+ style: 'decimal' | 'currency' | 'percent' | 'scientific';
274
+ currency: string;
275
+ locale: string;
276
+ minimumFractionDigits: number;
277
+ maximumFractionDigits: number;
278
+ useGrouping?: boolean;
279
+ percentValueMode?: 'fraction' | 'whole';
280
+ showDataBar: boolean;
281
+ dataBarColor: string;
282
+ dataBarMinValue?: number;
283
+ dataBarMaxValue?: number;
284
+ /**
285
+ * When true, render the cell bg with a heatmap intensity tint scaled
286
+ * across the column's value range. Composes with the existing text
287
+ * color/color-range logic (tint is bg only). `showDataBar` takes
288
+ * precedence when both are set — per the canonical design, a cell is
289
+ * either a data-bar or a heatmap, never both.
290
+ */
291
+ showHeatmap?: boolean;
292
+ };
293
+ dateFormat: {
294
+ format: string;
295
+ useCustomFormat: boolean;
296
+ customFormat: string;
297
+ useRelativeTime: boolean;
298
+ timezone?: string;
299
+ sourceTimezone?: string;
300
+ };
301
+ linkFormat: LinkFormat;
302
+ colorRanges: ColorRange_2[];
303
+ }
304
+
305
+ declare type ColumnSettingsMap = Record<string, ColumnSettings>;
306
+
307
+ declare type ColumnTextWrap = 'default' | 'truncate' | 'wrap' | 'nowrap' | 'preserve';
308
+
309
+ declare type ColumnType = 'string' | 'number' | 'date';
310
+
311
+ declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
312
+
313
+ export declare function compileDashboardFromPlan(input: {
314
+ dashboardId: string;
315
+ plan: DashboardPlan;
316
+ cardArtifacts: GeneratedDashboardCardArtifact[];
317
+ }): DashboardCompileResult;
318
+
319
+ export declare type CompiledDashboardInputDefaults = {
320
+ inputs: DashboardInput[];
321
+ defaultInputValues?: DashboardInputValues;
322
+ };
323
+
324
+ export declare function compileResponsiveDashboardLayouts(inputs: DashboardLayoutCompileInput[]): DashboardLayoutCompileResult;
325
+
326
+ declare type ConditionalFormatCondition = {
327
+ kind: 'comparison';
328
+ columnId: string;
329
+ operator: ComparisonOperator;
330
+ value: unknown;
331
+ } | {
332
+ kind: 'between';
333
+ columnId: string;
334
+ min: unknown;
335
+ max: unknown;
336
+ inclusive?: boolean;
337
+ } | {
338
+ kind: 'blank';
339
+ columnId: string;
340
+ isBlank: boolean;
341
+ } | {
342
+ kind: 'contains';
343
+ columnId: string;
344
+ value: string;
345
+ caseSensitive?: boolean;
346
+ exact?: boolean;
347
+ } | {
348
+ kind: 'topBottom';
349
+ columnId: string;
350
+ direction: 'top' | 'bottom';
351
+ count: number;
352
+ } | {
353
+ kind: 'colorScale';
354
+ columnId: string;
355
+ range: 'auto' | 'manual';
356
+ min?: number;
357
+ mid?: number;
358
+ max?: number;
359
+ colors: {
360
+ min: string;
361
+ mid?: string;
362
+ max: string;
363
+ };
364
+ } | {
365
+ kind: 'dataBar';
366
+ columnId: string;
367
+ range: 'auto' | 'manual';
368
+ min?: number;
369
+ max?: number;
370
+ color: string;
371
+ showValue?: boolean;
372
+ };
373
+
374
+ declare type ConditionalFormatRule = {
375
+ id: string;
376
+ name?: string;
377
+ enabled?: boolean;
378
+ target: ConditionalFormatTarget;
379
+ condition: ConditionalFormatCondition;
380
+ style?: ConditionalFormatStyle;
381
+ };
382
+
383
+ declare type ConditionalFormatStyle = {
384
+ backgroundColor?: string;
385
+ textColor?: string;
386
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
387
+ italic?: boolean;
388
+ textDecoration?: 'none' | 'underline' | 'line-through';
389
+ icon?: 'arrowUp' | 'arrowDown' | 'warning' | 'check' | 'x';
390
+ dataBar?: {
391
+ color: string;
392
+ showValue: boolean;
393
+ };
394
+ };
395
+
396
+ declare type ConditionalFormatTarget = {
397
+ level: 'cell' | 'row';
398
+ columnIds?: string[];
399
+ conditionColumnId?: string;
400
+ applyToColumnIds?: string[];
401
+ tableParts?: TablePart[];
402
+ rowRoles?: string[];
403
+ depth?: number;
404
+ includeTotals?: boolean;
405
+ includeSubtotals?: boolean;
406
+ };
407
+
408
+ declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
409
+
410
+ declare type ControlBinding = {
411
+ controlId: string;
412
+ target: 'sql_param';
413
+ paramId: string;
414
+ } | {
415
+ controlId: string;
416
+ target: 'config_metric_selector';
417
+ mapping: Record<string, StructuralMetricSelectorTarget>;
418
+ } | {
419
+ controlId: string;
420
+ target: 'config_field_selector';
421
+ mapping: Record<string, StructuralFieldSelectorTarget>;
422
+ } | {
423
+ controlId: string;
424
+ target: 'config_aggregation';
425
+ mapping: Record<string, string>;
426
+ } | {
427
+ controlId: string;
428
+ target: 'config_grain';
429
+ mapping: Record<string, string>;
430
+ };
431
+
432
+ declare type ControlDashboardInput = DashboardInputBase & {
433
+ kind: 'control';
434
+ control: ControlDefinition;
435
+ };
436
+
437
+ declare type ControlDefinition = {
438
+ id: string;
439
+ label: string;
440
+ scope: ControlScope;
441
+ type: ControlType;
442
+ source: ControlSource;
443
+ initialValueStrategy: ControlInitialValueStrategy;
444
+ defaultValue?: unknown;
445
+ requiredAtExecution: boolean;
446
+ hidden?: boolean;
447
+ locked?: boolean;
448
+ helpText?: string;
449
+ placement?: 'toolbar' | 'card_header' | 'advanced';
450
+ showLabel?: boolean;
451
+ toolbarWidth?: number;
452
+ };
453
+
454
+ declare type ControlInitialValueStrategy = 'saved_default' | 'builtin' | 'embed_required' | 'schedule_snapshot';
455
+
456
+ declare type ControlOption = {
457
+ value: string;
458
+ label: string;
459
+ presentation?: {
460
+ granularity?: TimeGranularity;
461
+ dateFormat?: DateFormatValue;
462
+ customFormat?: string;
463
+ };
464
+ };
465
+
466
+ declare type ControlScope = 'dashboard' | 'card';
467
+
468
+ declare type ControlSource = {
469
+ kind: 'manual';
470
+ options: ControlOption[];
471
+ } | {
472
+ kind: 'dataset_values';
473
+ fieldId: string;
474
+ connectionId?: string;
475
+ } | {
476
+ kind: 'field_allowlist';
477
+ fieldIds: string[];
478
+ } | {
479
+ kind: 'metric_allowlist';
480
+ metricIds: string[];
481
+ } | SqlQueryControlSource;
482
+
483
+ declare type ControlType = 'enum' | 'multi_enum' | 'text' | 'number' | 'boolean' | 'date' | 'field_selector' | 'metric_selector' | 'aggregation_selector' | 'grain_selector';
484
+
485
+ declare type CustomCard = CardWithContent | CardWithFooter;
486
+
487
+ export declare const DASHBOARD_AUTHORING_BREAKPOINTS: readonly ["lg", "md", "sm", "xs", "xxs"];
488
+
489
+ export declare const DASHBOARD_AUTHORING_MAX_GENERATED_CARDS = 10;
490
+
491
+ declare type DashboardAIContext = AIContext & {
492
+ mode?: DashboardAIContextMode;
493
+ };
494
+
495
+ declare type DashboardAIContextMode = 'auto' | 'fixed';
496
+
497
+ export declare type DashboardAuthoringBreakpoint = (typeof DASHBOARD_AUTHORING_BREAKPOINTS)[number];
498
+
499
+ export declare type DashboardAuthoringDatasetRef = {
500
+ kind: 'semantic';
501
+ domainId: string;
502
+ datasetName: string;
503
+ datasetId?: string;
504
+ label?: string;
505
+ connectionId?: string;
506
+ } | {
507
+ kind: 'physical';
508
+ connectionId: string;
509
+ databaseName?: string;
510
+ schemaName?: string;
511
+ tableName: string;
512
+ label?: string;
513
+ };
514
+
515
+ export declare type DashboardAuthoringIdFactory = {
516
+ dashboardId?: () => string;
517
+ sheetId?: () => string;
518
+ frameId: (seed?: string) => string;
519
+ cardId: (seed?: string) => string;
520
+ };
521
+
522
+ export declare type DashboardAuthoringValidationResult = {
523
+ ok: boolean;
524
+ errors: DashboardPlanWarning[];
525
+ warnings: DashboardPlanWarning[];
526
+ };
527
+
528
+ export declare type DashboardCardQueryIntent = {
529
+ metric?: string;
530
+ metrics?: string[];
531
+ dateField?: string;
532
+ timeGrain?: 'day' | 'week' | 'month' | 'quarter' | 'year';
533
+ dimensions?: string[];
534
+ limit?: number;
535
+ };
536
+
537
+ export declare type DashboardCardSizeIntent = 'kpi' | 'chart' | 'table' | 'text';
538
+
539
+ export declare type DashboardChangeCompileResult = {
540
+ dashboard: TDashboard;
541
+ warnings: DashboardPlanWarning[];
542
+ skippedOperations: DashboardPlanWarning[];
543
+ };
544
+
545
+ export declare type DashboardChangeOperation = {
546
+ kind: 'addCard';
547
+ card: DashboardPlanCard;
548
+ } | {
549
+ kind: 'addFilterInput';
550
+ input: DashboardPlanFilterInput;
551
+ } | {
552
+ kind: 'addCalculatedField';
553
+ field: DashboardPlanCalculatedField;
554
+ } | {
555
+ kind: 'reuseCalculatedField';
556
+ fieldId: string;
557
+ scope: 'sheet' | 'dashboard' | 'domain';
558
+ } | {
559
+ kind: 'renameCard';
560
+ cardId: string;
561
+ title: string;
562
+ description?: string;
563
+ } | {
564
+ kind: 'reorderCards';
565
+ cardIds: string[];
566
+ } | {
567
+ kind: 'unsupported';
568
+ requestedAction: string;
569
+ reason: string;
570
+ };
571
+
572
+ export declare type DashboardChangePlan = {
573
+ version: 1;
574
+ id: string;
575
+ dashboardId: string;
576
+ title?: string;
577
+ description?: string;
578
+ datasets: DashboardAuthoringDatasetRef[];
579
+ operations: DashboardChangeOperation[];
580
+ warnings?: DashboardPlanWarning[];
581
+ unresolvedRequests?: string[];
582
+ };
583
+
584
+ export declare type DashboardCompileResult = {
585
+ dashboard: TDashboard;
586
+ warnings: DashboardPlanWarning[];
587
+ skippedOperations: DashboardPlanWarning[];
588
+ };
589
+
590
+ declare type DashboardInput = FilterDashboardInput | ControlDashboardInput;
591
+
592
+ declare type DashboardInputBase = {
593
+ id: string;
594
+ label: string;
595
+ variableName: string;
596
+ description?: string;
597
+ requiredAtExecution?: boolean;
598
+ scope: DashboardInputScope;
599
+ runtimeScope: DashboardInputRuntimeScope;
600
+ presentation?: DashboardInputPresentation;
601
+ exports?: DashboardInputExportKey[];
602
+ compatibility?: DashboardInputCompatibilityMetadata;
603
+ };
604
+
605
+ declare type DashboardInputCompatibilityMetadata = {
606
+ source: 'dashboardFilter';
607
+ filterId: string;
608
+ } | {
609
+ source: 'dashboardControl';
610
+ controlId: string;
611
+ } | {
612
+ source: 'cardInlineFilter';
613
+ cardId: string;
614
+ filterId: string;
615
+ } | {
616
+ source: 'cardControl';
617
+ cardId: string;
618
+ controlId: string;
619
+ } | {
620
+ source: 'documentInput';
621
+ sheetId: string;
622
+ inputId: string;
623
+ };
624
+
625
+ declare type DashboardInputExportKey = 'label' | 'value' | 'start' | 'end' | 'range';
626
+
627
+ declare type DashboardInputPresentation = {
628
+ placement?: 'toolbar' | 'card_header' | 'advanced' | 'hidden';
629
+ widthPx?: number;
630
+ order?: number;
631
+ };
632
+
633
+ declare type DashboardInputRuntimeScope = 'shared' | 'perSheet' | 'perCard' | 'perDocumentSection';
634
+
635
+ declare type DashboardInputScope = {
636
+ kind: 'allSheets';
637
+ sheetKinds?: Array<'dashboard' | 'document'>;
638
+ } | {
639
+ kind: 'sheets';
640
+ sheetIds: string[];
641
+ } | {
642
+ kind: 'cards';
643
+ cardIds: string[];
644
+ } | {
645
+ kind: 'documentSections';
646
+ sheetId: string;
647
+ sectionIds: string[];
648
+ };
649
+
650
+ declare type DashboardInputSlot = {
651
+ status: 'set';
652
+ value: DashboardInputValue;
653
+ } | {
654
+ status: 'cleared';
655
+ };
656
+
657
+ declare type DashboardInputTextContent = Array<{
658
+ type: 'text';
659
+ value: string;
660
+ } | {
661
+ type: 'variable';
662
+ ref: DashboardInputVariableRef;
663
+ }>;
664
+
665
+ declare type DashboardInputValue = {
666
+ kind: 'filter';
667
+ filterValue: TFilterValue;
668
+ } | {
669
+ kind: 'control';
670
+ value: unknown;
671
+ };
672
+
673
+ declare type DashboardInputValues = {
674
+ shared?: Record<string, DashboardInputSlot>;
675
+ bySheetId?: Record<string, Record<string, DashboardInputSlot>>;
676
+ byCardId?: Record<string, Record<string, DashboardInputSlot>>;
677
+ byDocumentSectionId?: Record<string, Record<string, DashboardInputSlot>>;
678
+ };
679
+
680
+ declare type DashboardInputVariableRef = {
681
+ source: 'dashboardInput';
682
+ inputId: string;
683
+ export: DashboardInputExportKey;
684
+ } | {
685
+ source: 'dashboardInputAlias';
686
+ variableName: string;
687
+ export?: DashboardInputExportKey;
688
+ } | {
689
+ source: 'documentMeta';
690
+ key: 'generatedAt' | 'pageNumber' | 'pageCount';
691
+ };
692
+
693
+ export declare type DashboardLayoutCompileInput = {
694
+ frameId: string;
695
+ role: DashboardCardSizeIntent;
696
+ priority: number;
697
+ };
698
+
699
+ export declare type DashboardLayoutCompileResult = PersistedFrameLayouts;
700
+
701
+ export declare type DashboardPlan = {
702
+ version: 1;
703
+ id: string;
704
+ title: string;
705
+ description?: string;
706
+ datasets: DashboardAuthoringDatasetRef[];
707
+ sheets: DashboardPlanSheet[];
708
+ filterInputs?: DashboardPlanFilterInput[];
709
+ calculatedFields?: DashboardPlanCalculatedField[];
710
+ warnings?: DashboardPlanWarning[];
711
+ unresolvedRequests?: string[];
712
+ deferredSuggestions?: string[];
713
+ };
714
+
715
+ export declare type DashboardPlanCalculatedField = {
716
+ id: string;
717
+ name: string;
718
+ scope: 'card' | 'sheet' | 'dashboard' | 'domain';
719
+ expression?: string;
720
+ field?: Field;
721
+ targetCardId?: string;
722
+ reuseOnly?: boolean;
723
+ };
724
+
725
+ export declare type DashboardPlanCard = {
726
+ id: string;
727
+ frameId: string;
728
+ title: string;
729
+ description?: string;
730
+ type: Exclude<TChartType, 'custom'>;
731
+ role: DashboardCardSizeIntent;
732
+ priority: number;
733
+ section?: string;
734
+ query?: DashboardCardQueryIntent;
735
+ text?: string;
736
+ };
737
+
738
+ export declare type DashboardPlanFilterInput = {
739
+ id: string;
740
+ label: string;
741
+ variableName: string;
742
+ filter: TFilter;
743
+ defaultValue?: unknown;
744
+ };
745
+
746
+ export declare type DashboardPlanSheet = {
747
+ id: string;
748
+ title: string;
749
+ description?: string;
750
+ kind: 'dashboard';
751
+ cards: DashboardPlanCard[];
752
+ };
753
+
754
+ export declare type DashboardPlanWarning = {
755
+ code: string;
756
+ message: string;
757
+ cardId?: string;
758
+ };
759
+
760
+ export declare type DashboardSuggestion = {
761
+ id: string;
762
+ title: string;
763
+ description: string;
764
+ preview: DashboardSuggestionPreviewKind[];
765
+ cardCount: number;
766
+ filterCount: number;
767
+ prompt: string;
768
+ };
769
+
770
+ export declare type DashboardSuggestionPreviewKind = 'kpi' | 'line' | 'bar' | 'donut' | 'table';
771
+
772
+ declare interface DatabaseEntityReference {
773
+ connectionId: string;
774
+ connectionType: ConnectionType;
775
+ type: EntityType;
776
+ dbObjectType?: string;
777
+ dialect?: Dialect;
778
+ database?: string;
779
+ schema?: string;
780
+ name: string;
781
+ }
782
+
783
+ declare type DatabaseEntityType = 'table' | 'view' | 'materialized view';
784
+
785
+ declare interface DataModelEntityReference extends DatabaseEntityReference {
786
+ type: 'model';
787
+ id: string;
788
+ label: string;
789
+ description: string;
790
+ }
791
+
792
+ declare interface DatasetEntityReference extends DatabaseEntityReference {
793
+ type: 'dataset';
794
+ datasetType: 'physical' | 'virtual';
795
+ datamodelId?: string | null;
796
+ sql?: string | null;
797
+ id: string;
798
+ domainId: string;
799
+ label: string;
800
+ description?: string;
801
+ }
802
+
803
+ declare interface DataSource {
804
+ connectionId: string;
805
+ semanticDomainId?: string;
806
+ connectionType: string;
807
+ mode: 'database' | 'upload' | 'url' | 'semanticDomain';
808
+ dbSelection?: {
809
+ database: string;
810
+ schema: string;
811
+ entityType: DatabaseEntityType;
812
+ };
813
+ selectedEntities: SelectedEntities;
814
+ }
815
+
816
+ declare const DATE_FORMAT_VALUES: readonly ["MM-DD-YYYY", "YYYY-MM-DD", "MM/DD/YYYY", "DD/MM/YYYY", "MMMM DD, YYYY", "MMM DD, YYYY", "DD MMM YYYY", "YYYY-MM-DD HH:mm", "YYYY-MM-DD HH:mm:ss", "YYYY-MM-DD HH:mm Z", "YYYY-MM-DD HH:mm:ss Z", "Week of MMM DD, YYYY", "Week of MMMM DD, YYYY", "YYYY-WW", "MMM YYYY", "MMMM YYYY", "YYYY-MM", "MM/YYYY", "YYYY MMM", "Q1 YYYY", "YYYY Q1", "1st Quarter YYYY", "YYYY-Q1", "Quarter 1, YYYY", "YYYY", "YY", "custom"];
817
+
818
+ declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
819
+
820
+ declare type DateOptions = {
821
+ locale: string;
822
+ format: string;
823
+ options: Intl.DateTimeFormatOptions;
824
+ };
825
+
826
+ declare type DateSelectionMode = 'range' | 'months';
827
+
828
+ declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
829
+
830
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
831
+
832
+ /**
833
+ * Field configuration for detail table columns.
834
+ * Unlike GroupByField, DetailField does not support aggregation or granularity.
835
+ * Columns are selected and displayed as-is from the database.
836
+ */
837
+ declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
838
+ role: 'detail';
839
+ dateFormat?: DateFormatValue;
840
+ customFormat?: string;
841
+ /**
842
+ * Optional SQL expression for calculated detail fields.
843
+ */
844
+ expression?: string;
845
+ /**
846
+ * Formula metadata for calculated fields (used for token qualification).
847
+ */
848
+ calculatedFormula?: CalculatedFieldFormula;
849
+ }
850
+
851
+ declare interface DetailTableBackupConfig {
852
+ groupByColumns?: GroupByField[];
853
+ metricColumns?: MetricField[];
854
+ pivotByColumns?: PivotByField[];
855
+ sortByColumns?: SortByField[];
856
+ rowAggregates?: Array<{
857
+ label?: string;
858
+ function: AggregateFunction;
859
+ groupLevel: string | 'ALL';
860
+ }>;
861
+ columnAggregates?: Array<{
862
+ label?: string;
863
+ function: AggregateFunction;
864
+ pivotLevel: string | 'ALL';
865
+ }>;
866
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
867
+ }
868
+
869
+ declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
870
+
871
+ declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
872
+
873
+ declare type DocumentChartSection = {
874
+ id: string;
875
+ type: 'chart';
876
+ title?: string;
877
+ card: TCard;
878
+ heightPx: number;
879
+ };
880
+
881
+ declare type DocumentControlInputDefinition = DocumentInputBase & {
882
+ kind: 'control';
883
+ control: ControlDefinition;
884
+ exports?: DocumentInputExportKey[];
885
+ };
886
+
887
+ declare type DocumentDefinition = {
888
+ version: 1;
889
+ page: DocumentPageSetup;
890
+ runtime?: DocumentRuntimeSettings;
891
+ inputs?: DocumentInputDefinition[];
892
+ defaultInputValues?: Record<string, unknown>;
893
+ header?: DocumentHeaderRegion;
894
+ footer?: DocumentFooterRegion;
895
+ sections: DocumentSection[];
896
+ theme?: DocumentTheme;
897
+ };
898
+
899
+ declare type DocumentFilterInputDefinition = DocumentInputBase & {
900
+ kind: 'filter';
901
+ filter: TFilter;
902
+ exports?: DocumentInputExportKey[];
903
+ };
904
+
905
+ declare type DocumentFooterRegion = DocumentRegionBase & {
906
+ region: 'footer';
907
+ layout: {
908
+ type: 'preset';
909
+ preset: 'mvp_footer';
910
+ };
911
+ };
912
+
913
+ declare type DocumentHeaderRegion = DocumentRegionBase & {
914
+ region: 'header';
915
+ layout: {
916
+ type: 'preset';
917
+ preset: 'mvp_header';
918
+ };
919
+ };
920
+
921
+ declare type DocumentImageRegionBlock = DocumentRegionBlockBase & {
922
+ type: 'image';
923
+ role?: 'logo';
924
+ src: string;
925
+ alt?: string;
926
+ widthPx?: number;
927
+ };
928
+
929
+ declare type DocumentInputBase = {
930
+ id: string;
931
+ label: string;
932
+ variableName: string;
933
+ requiredAtExecution: boolean;
934
+ documentPlacement?: 'input_bar';
935
+ description?: string;
936
+ };
937
+
938
+ declare type DocumentInputDefinition = DocumentFilterInputDefinition | DocumentControlInputDefinition;
939
+
940
+ declare type DocumentInputExportKey = 'label' | 'value' | 'start' | 'end' | 'range';
941
+
942
+ declare type DocumentPageBreakSection = {
943
+ id: string;
944
+ type: 'page_break';
945
+ };
946
+
947
+ declare type DocumentPageSetup = {
948
+ size: 'letter' | 'a4';
949
+ orientation: 'portrait' | 'landscape';
950
+ margins: {
951
+ top: number;
952
+ right: number;
953
+ bottom: number;
954
+ left: number;
955
+ unit: 'in' | 'mm';
956
+ };
957
+ };
958
+
959
+ declare type DocumentRegionBase = {
960
+ enabled: boolean;
961
+ heightPx?: number;
962
+ layout: DocumentRegionLayout;
963
+ blocks: DocumentRegionBlock[];
964
+ };
965
+
966
+ declare type DocumentRegionBlock = DocumentTextRegionBlock | DocumentImageRegionBlock;
967
+
968
+ declare type DocumentRegionBlockBase = {
969
+ id: string;
970
+ area?: 'left' | 'center' | 'right' | 'title' | 'metadata' | 'note' | 'pageInfo';
971
+ };
972
+
973
+ declare type DocumentRegionLayout = {
974
+ type: 'preset';
975
+ preset: 'mvp_header' | 'mvp_footer';
976
+ };
977
+
978
+ declare type DocumentRuntimeSettings = {
979
+ generatedAtFormat?: string;
980
+ };
981
+
982
+ declare type DocumentSection = DocumentTextSection | DocumentTableSection | DocumentChartSection | DocumentSpacerSection | DocumentPageBreakSection;
983
+
984
+ declare type DocumentSpacerSection = {
985
+ id: string;
986
+ type: 'spacer';
987
+ heightPx: number;
988
+ };
989
+
990
+ declare type DocumentTableSection = {
991
+ id: string;
992
+ type: 'table';
993
+ title?: string;
994
+ card: TCard;
995
+ table: {
996
+ totalsRow?: boolean;
997
+ columnFormatting?: Record<string, unknown>;
998
+ repeatHeaderOnPageBreak?: boolean;
999
+ rowHeightPx?: number;
1000
+ };
1001
+ };
1002
+
1003
+ declare type DocumentTextContent = DocumentTextNode[];
1004
+
1005
+ declare type DocumentTextInlineFormat = {
1006
+ bold?: boolean;
1007
+ italic?: boolean;
1008
+ underline?: boolean;
1009
+ };
1010
+
1011
+ declare type DocumentTextNode = {
1012
+ type: 'text';
1013
+ value: string;
1014
+ format?: DocumentTextInlineFormat;
1015
+ } | {
1016
+ type: 'variable';
1017
+ ref: DocumentVariableRef;
1018
+ format?: DocumentTextInlineFormat;
1019
+ };
1020
+
1021
+ declare type DocumentTextRegionBlock = DocumentRegionBlockBase & {
1022
+ type: 'text';
1023
+ role?: 'title' | 'metadata' | 'note' | 'pageInfo';
1024
+ content: DocumentTextContent;
1025
+ style?: DocumentTextStyle;
1026
+ };
1027
+
1028
+ declare type DocumentTextSection = {
1029
+ id: string;
1030
+ type: 'text';
1031
+ content: DocumentTextContent;
1032
+ style?: DocumentTextStyle;
1033
+ };
1034
+
1035
+ declare type DocumentTextStyle = {
1036
+ fontSize?: number;
1037
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
1038
+ color?: string;
1039
+ align?: 'left' | 'center' | 'right';
1040
+ };
1041
+
1042
+ declare type DocumentTheme = {
1043
+ fontFamily?: string;
1044
+ primaryColor?: string;
1045
+ };
1046
+
1047
+ declare type DocumentVariableRef = {
1048
+ source: 'input';
1049
+ inputId: string;
1050
+ export: DocumentInputExportKey;
1051
+ } | {
1052
+ source: 'documentMeta';
1053
+ key: 'generatedAt' | 'pageNumber' | 'pageCount';
1054
+ };
1055
+
1056
+ declare interface DrillDownInteraction {
1057
+ mode: 'drillDown';
1058
+ /**
1059
+ * What element must be clicked to trigger this drill-down.
1060
+ * Optional during configuration, but must be defined before execution.
1061
+ */
1062
+ trigger?: InteractionTrigger;
1063
+ filterFields: Field[];
1064
+ hierarchyId?: string;
1065
+ label?: string;
1066
+ }
1067
+
1068
+ declare interface DrillHierarchy {
1069
+ id: string;
1070
+ label?: string;
1071
+ type: 'static' | 'date';
1072
+ steps: DrillHierarchyStep[];
1073
+ default?: boolean;
1074
+ baseField?: Field;
1075
+ }
1076
+
1077
+ declare interface DrillHierarchyStep {
1078
+ field: Field;
1079
+ mode: 'drillDown';
1080
+ preferredChartType?: TChartType;
1081
+ breadcrumbLabelTemplate?: string;
1082
+ retainFilters?: boolean;
1083
+ label?: string;
1084
+ linkedInsightId?: string;
1085
+ }
1086
+
1087
+ declare interface DrillThroughInteraction {
1088
+ mode: 'drillThrough';
1089
+ /**
1090
+ * What element must be clicked to trigger this drill-through.
1091
+ * @migration Optional during migration. Will be required in V2.
1092
+ */
1093
+ trigger?: InteractionTrigger;
1094
+ filterFields: Field[];
1095
+ targetDashboardId: string;
1096
+ /**
1097
+ * How to pass context to the target dashboard
1098
+ * @default 'interactionFilters'
1099
+ */
1100
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1101
+ label?: string;
1102
+ }
1103
+
1104
+ declare interface DrillToDetailInteraction {
1105
+ mode: 'drillToDetail';
1106
+ /**
1107
+ * What element must be clicked to trigger this drill to detail.
1108
+ * @migration Optional during migration. Will be required in V2.
1109
+ */
1110
+ trigger?: InteractionTrigger;
1111
+ filterFields: Field[];
1112
+ detailFields?: Field[];
1113
+ sortBy?: SortByField[];
1114
+ limit?: number;
1115
+ detailTitle?: string;
1116
+ /**
1117
+ * Target insight ID to navigate to
1118
+ */
1119
+ targetInsightId?: string;
1120
+ /**
1121
+ * How to pass context to the target insight
1122
+ * @default 'interactionFilters'
1123
+ */
1124
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1125
+ /**
1126
+ * How to display the insight
1127
+ * @default 'modal'
1128
+ */
1129
+ displayMode?: 'modal' | 'replace-card';
1130
+ label?: string;
1131
+ }
1132
+
1133
+ declare interface DrillToURLInteraction {
1134
+ mode: 'drillToURL';
1135
+ /**
1136
+ * What element must be clicked to trigger this URL drill.
1137
+ */
1138
+ trigger?: InteractionTrigger;
1139
+ filterFields: Field[];
1140
+ /**
1141
+ * URL template with placeholders (e.g., 'https://example.com/product/{{product_id}}')
1142
+ */
1143
+ urlTemplate: string;
1144
+ /**
1145
+ * List of parameters used in the URL template
1146
+ */
1147
+ parameters: URLParameter[];
1148
+ /**
1149
+ * Whether to URL-encode parameter values
1150
+ * @default true
1151
+ */
1152
+ encodeParameters?: boolean;
1153
+ /**
1154
+ * Custom label for this interaction in the menu
1155
+ */
1156
+ label?: string;
1157
+ }
1158
+
1159
+ declare interface DrillUpInteraction {
1160
+ mode: 'drillUp';
1161
+ /**
1162
+ * What element must be clicked to trigger this drill-up.
1163
+ * For synthetic drill-up interactions, this is inherited from the original drill-down.
1164
+ */
1165
+ trigger?: InteractionTrigger;
1166
+ /**
1167
+ * The hierarchy ID to reference for display purposes.
1168
+ * Used to show the parent level name in the interaction menu.
1169
+ */
1170
+ hierarchyId?: string;
1171
+ label?: string;
1172
+ }
1173
+
1174
+ declare interface DynamicDrillInteraction {
1175
+ mode: 'dynamicDrill';
1176
+ /**
1177
+ * What element must be clicked to trigger this dynamic drill menu.
1178
+ * When this trigger fires, user sees a menu of available fields to explore.
1179
+ */
1180
+ trigger?: InteractionTrigger;
1181
+ /**
1182
+ * List of fields available for dynamic exploration.
1183
+ * User can choose which field to drill into at runtime.
1184
+ * Only drillable fields (string, boolean types) should be included.
1185
+ */
1186
+ availableFields: Field[];
1187
+ /**
1188
+ * Optional label for the menu item.
1189
+ * Defaults to "Explore Fields" if not specified.
1190
+ */
1191
+ label?: string;
1192
+ /* Excluded from this release type: drillField */
1193
+ }
1194
+
1195
+ declare type EmailSettings = {
1196
+ companyName: string;
1197
+ dashboardUrl: string;
1198
+ supportEmail: string;
1199
+ senderTitle: string;
1200
+ };
1201
+
1202
+ declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
1203
+
1204
+ declare interface Field {
1205
+ /**
1206
+ * Unique identifier for this field instance (for joins, UI state, etc.).
1207
+ * Should be unique within the context of the query or data model.
1208
+ * Example: 'orders.customer_id', 'expr_12345', etc.
1209
+ */
1210
+ id: string;
1211
+ /**
1212
+ * The physical/source column name in the database or data source.
1213
+ * Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
1214
+ */
1215
+ name: string;
1216
+ /**
1217
+ * Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
1218
+ */
1219
+ label: string;
1220
+ /**
1221
+ * Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
1222
+ * If not provided, should be auto-generated from label or name.
1223
+ */
1224
+ alias?: string;
1225
+ sourceField?: string;
1226
+ qualifiedFieldName: string;
1227
+ dataType: string;
1228
+ description?: string;
1229
+ qualifiedEntityName?: string;
1230
+ dateFormat?: DateFormatValue;
1231
+ customFormat?: string;
1232
+ granularity?: TimeGranularity;
1233
+ entityId: string;
1234
+ entityName: string;
1235
+ entityType: EntityType;
1236
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
1237
+ expression?: string;
1238
+ calculatedFormula?: CalculatedFieldFormula;
1239
+ format?: FormatSpec;
1240
+ fieldScope?: FieldScope;
1241
+ }
1242
+
1243
+ declare type FieldScope = 'card' | 'sheet' | 'dashboard' | 'domain';
1244
+
1245
+ declare type FileAttachment = {
1246
+ id: string;
1247
+ name: string;
1248
+ size: number;
1249
+ type: string;
1250
+ data?: string;
1251
+ url?: string;
1252
+ preview?: string;
1253
+ uploadProgress?: number;
1254
+ };
1255
+
1256
+ declare interface FileEntityReference extends DatabaseEntityReference {
1257
+ id: string;
1258
+ type: 'file' | 'url' | 'upload';
1259
+ label: string;
1260
+ description: string;
1261
+ originalName: string;
1262
+ file?: File;
1263
+ url?: string;
1264
+ }
1265
+
1266
+ declare interface FilterByColumn extends BaseColumn {
1267
+ role: 'filter';
1268
+ operators?: string[];
1269
+ mode?: 'include' | 'exclude';
1270
+ sql?: string;
1271
+ fetchValues?: boolean;
1272
+ fetchLimit?: number;
1273
+ valueSource?: 'distinct' | 'static' | 'range';
1274
+ staticValues?: string[];
1275
+ }
1276
+
1277
+ declare interface FilterCondition {
1278
+ id: string;
1279
+ field: Field;
1280
+ operator: Operator;
1281
+ value: FilterValue;
1282
+ }
1283
+
1284
+ declare type FilterDashboardInput = DashboardInputBase & {
1285
+ kind: 'filter';
1286
+ filter: TFilter;
1287
+ };
1288
+
1289
+ /**
1290
+ * Display mode for individual filters
1291
+ * - 'canvas': Filter displayed as a draggable card on the dashboard canvas
1292
+ * - 'toolbar': Filter displayed in the compact toolbar
1293
+ * - 'inherit': Use the dashboard's filterLayout.displayMode setting (default)
1294
+ */
1295
+ declare type FilterDisplayMode = 'canvas' | 'toolbar' | 'inherit';
1296
+
1297
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
1298
+ entityName?: Field['entityName'];
1299
+ entityType?: string;
1300
+ expression?: string;
1301
+ calculatedFormula?: CalculatedFieldFormula;
1302
+ };
1303
+
1304
+ declare type FilterForBetween = BaseFilter & {
1305
+ operation: 'between' | 'not between';
1306
+ values: [number, number];
1307
+ };
1308
+
1309
+ declare type FilterForCompare = BaseFilter & {
1310
+ operation: '>' | '<' | '>=' | '<=';
1311
+ values: [number];
1312
+ };
1313
+
1314
+ declare type FilterForDate = BaseFilter & {
1315
+ operation: 'between' | 'not between' | '=' | '!=' | '>' | '<' | '>=' | '<=';
1316
+ values: [Date | string, Date | string] | [Date | string];
1317
+ relativeMeta?: RelativeDateFilter;
1318
+ };
1319
+
1320
+ declare type FilterForEqual = BaseFilter & {
1321
+ operation: '=' | '!=';
1322
+ values: [string | number];
1323
+ };
1324
+
1325
+ declare type FilterForIn = BaseFilter & {
1326
+ operation: 'in' | 'not in';
1327
+ values: (string | number)[];
1328
+ };
1329
+
1330
+ declare type FilterForNull = BaseFilter & {
1331
+ operation: 'is null' | 'is not null';
1332
+ values: [];
1333
+ };
1334
+
1335
+ declare type FilterForString = BaseFilter & {
1336
+ operation: 'like' | 'not like';
1337
+ values: [string];
1338
+ };
1339
+
1340
+ declare interface FilterGroup {
1341
+ id: string;
1342
+ logicalOperator: LogicalOperator;
1343
+ negate: boolean;
1344
+ conditions: FilterCondition[];
1345
+ groups: FilterGroup[];
1346
+ }
1347
+
1348
+ declare type FilterKind = 'field' | 'global-date';
1349
+
1350
+ /**
1351
+ * Filter layout settings for controlling how dashboard filters are displayed
1352
+ */
1353
+ declare type FilterLayoutSettings = {
1354
+ /**
1355
+ * Display mode for filters
1356
+ * - 'canvas': Filters displayed as draggable/resizable cards on the dashboard canvas (default)
1357
+ * - 'toolbar': Filters displayed in a compact horizontal toolbar below dashboard controls
1358
+ */
1359
+ displayMode?: 'canvas' | 'toolbar';
1360
+ /**
1361
+ * Whether the toolbar should wrap filters to multiple lines
1362
+ * - false: Horizontal scroll when filters overflow (default)
1363
+ * - true: Wrap to multiple lines
1364
+ */
1365
+ toolbarWrap?: boolean;
1366
+ /**
1367
+ * Whether to show a download button in the filter toolbar
1368
+ * Useful when embedding Dashboard component without Surfboard's controls
1369
+ */
1370
+ showDownloadButton?: boolean;
1371
+ /**
1372
+ * Mixed toolbar item order for dashboard-level filter and control chips.
1373
+ * Values use prefixed ids like `filter:<id>` and `control:<id>`.
1374
+ */
1375
+ toolbarItemOrder?: string[];
1376
+ };
1377
+
1378
+ declare type FilterLocation = 'dashboard' | 'frame' | 'sheet' | undefined;
1379
+
1380
+ declare type FilterOnClick = {
1381
+ expression?: string;
1382
+ columnIndex: number;
1383
+ };
1384
+
1385
+ declare type FilterSemanticContext = {
1386
+ semanticDomainId?: string;
1387
+ selectedEntities?: unknown[];
1388
+ connectionId?: string;
1389
+ connectionType?: string;
1390
+ };
1391
+
1392
+ declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1393
+
1394
+ /**
1395
+ * Absolute fixed month/year default used by Month Picker defaults.
1396
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
1397
+ */
1398
+ declare type FixedMonthDefaultDateFilter = {
1399
+ mode: 'fixed';
1400
+ unit: 'month';
1401
+ year: number;
1402
+ month: number;
1403
+ };
1404
+
1405
+ declare type FormatSpec = {
1406
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1407
+ locale?: string;
1408
+ minimumFractionDigits?: number;
1409
+ maximumFractionDigits?: number;
1410
+ useGrouping?: boolean;
1411
+ prefix?: string;
1412
+ suffix?: string;
1413
+ negativeStyle?: 'minus' | 'parentheses';
1414
+ compact?: boolean;
1415
+ scale?: number;
1416
+ currency?: string;
1417
+ percentValueMode?: 'fraction' | 'whole';
1418
+ } | {
1419
+ type: 'date';
1420
+ locale?: string;
1421
+ pattern?: string;
1422
+ relative?: boolean;
1423
+ timezone?: string;
1424
+ sourceTimezone?: string;
1425
+ prefix?: string;
1426
+ suffix?: string;
1427
+ } | {
1428
+ type: 'string';
1429
+ prefix?: string;
1430
+ suffix?: string;
1431
+ };
1432
+
1433
+ export declare type GeneratedDashboardCardArtifact = {
1434
+ planCardId: string;
1435
+ frameId: string;
1436
+ card: TCard;
1437
+ queryValidated?: boolean;
1438
+ warnings?: DashboardPlanWarning[];
1439
+ };
1440
+
1441
+ declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1442
+
1443
+ declare interface GroupByColumn extends BaseColumn {
1444
+ role: 'groupby';
1445
+ granularity?: Granularity;
1446
+ format?: string;
1447
+ }
1448
+
1449
+ declare interface GroupByField extends Field {
1450
+ role: 'groupby';
1451
+ granularity?: TimeGranularity;
1452
+ /**
1453
+ * Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
1454
+ * If present, used in SELECT and GROUP BY instead of just the column name.
1455
+ */
1456
+ expression?: string;
1457
+ timeDrillPath?: TimeDrillStep[];
1458
+ calculatedFormula?: CalculatedFieldFormula;
1459
+ }
1460
+
1461
+ declare type HtmlOptions = {
1462
+ html: string;
1463
+ };
1464
+
1465
+ declare interface InlineDrillInteraction {
1466
+ mode: 'inlineDrill';
1467
+ /**
1468
+ * What element must be clicked to trigger this inline drill.
1469
+ * @migration Optional during migration. Will be required in V2.
1470
+ */
1471
+ trigger?: InteractionTrigger;
1472
+ filterFields: Field[];
1473
+ /**
1474
+ * When to fetch the detailed data
1475
+ * @default 'lazy'
1476
+ */
1477
+ fetchMode?: 'lazy' | 'preloaded';
1478
+ /**
1479
+ * Maximum number of records to show (0 for unlimited)
1480
+ * @default 100
1481
+ */
1482
+ inlineLimit?: number;
1483
+ /**
1484
+ * How to display the detailed records
1485
+ * @default 'table'
1486
+ */
1487
+ displayMode?: 'table' | 'list' | 'cards';
1488
+ /**
1489
+ * Whether to show records in a modal overlay
1490
+ * @default false
1491
+ */
1492
+ showInModal?: boolean;
1493
+ /**
1494
+ * Whether to allow exporting the detailed records
1495
+ * @default true
1496
+ */
1497
+ allowExport?: boolean;
1498
+ label?: string;
1499
+ }
1500
+
1501
+ /**
1502
+ * Unified Interaction type (V2)
1503
+ * Combines all interaction types into a single union for the new interactions array.
1504
+ */
1505
+ declare type Interaction = ClickFilterInteraction | DrillDownInteraction | DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction | DrillUpInteraction | DynamicDrillInteraction;
1506
+
1507
+ declare interface InteractionTargetOverride {
1508
+ applyToCardIds?: string[] | null;
1509
+ excludeCardIds?: string[] | null;
1510
+ }
1511
+
1512
+ /**
1513
+ * Defines what element must be clicked to trigger an interaction.
1514
+ *
1515
+ * The `type` determines filtering behavior:
1516
+ * - 'metric': Captures intersection of ALL dimensions (e.g., country='USA' AND state='CA')
1517
+ * - 'attribute': Captures ONLY the clicked dimension (e.g., country='USA')
1518
+ *
1519
+ * Note: `trigger.type` is different from `field.type`:
1520
+ * - trigger.type = filtering behavior ('metric' | 'attribute')
1521
+ * - field.type = data type ('dimension' | 'metric' | 'measure')
1522
+ */
1523
+ declare interface InteractionTrigger {
1524
+ /**
1525
+ * Determines filtering behavior when this trigger fires:
1526
+ * - 'metric': Capture intersection of all dimensions
1527
+ * - 'attribute': Capture only this specific dimension
1528
+ */
1529
+ type: 'metric' | 'attribute';
1530
+ /**
1531
+ * The field (metric or attribute) that must be clicked.
1532
+ * For multi-series charts: Use the specific metric Field with unique ID
1533
+ * (e.g., Field with id='count_of_orders')
1534
+ */
1535
+ field: Field;
1536
+ }
1537
+
1538
+ declare interface Join {
1539
+ id: string;
1540
+ source: DatabaseEntityReference;
1541
+ target: DatabaseEntityReference;
1542
+ joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
1543
+ joinKeyGroups: JoinKeyGroup[];
1544
+ sequence: number;
1545
+ relationshipId?: string;
1546
+ relationshipName?: string;
1547
+ relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1548
+ }
1549
+
1550
+ declare interface JoinKey {
1551
+ id?: string;
1552
+ source: Field;
1553
+ target: Field;
1554
+ operator: string;
1555
+ }
1556
+
1557
+ declare interface JoinKeyGroup {
1558
+ id: string;
1559
+ operator: string;
1560
+ keys: JoinKey[];
1561
+ }
1562
+
1563
+ declare interface JoinPlan {
1564
+ baseEntity: DatabaseEntityReference;
1565
+ joins: Join[];
1566
+ }
1567
+
1568
+ declare interface LinkFormat {
1569
+ urlTemplate: string;
1570
+ labelType: 'value' | 'static' | 'column';
1571
+ staticLabel?: string;
1572
+ labelColumn?: string;
1573
+ openInNewTab: boolean;
1574
+ }
1575
+
1576
+ declare type LogicalOperator = 'AND' | 'OR';
1577
+
1578
+ declare interface MetricColumn extends BaseColumn {
1579
+ role: 'metric';
1580
+ aggregate: AggregateFunction;
1581
+ aliasTemplate?: string;
1582
+ }
1583
+
1584
+ declare interface MetricField extends Field {
1585
+ role: 'metric';
1586
+ aggregate?: AggregateFunction;
1587
+ /**
1588
+ * Optional SQL expression for the metric (e.g., ship_date - order_date).
1589
+ * If present, used as aggregate(expression) instead of aggregate(name).
1590
+ */
1591
+ expression?: string;
1592
+ /**
1593
+ * Optional parameters for future extensibility (e.g., window functions).
1594
+ * * Example:
1595
+ * {
1596
+ aggregate: "SUM",
1597
+ name: "sales",
1598
+ parameters: {
1599
+ window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
1600
+ }
1601
+ }
1602
+
1603
+ {
1604
+ aggregate: "COUNT",
1605
+ name: "order_id",
1606
+ parameters: {
1607
+ filter: "status = 'Active'"
1608
+ }
1609
+ }
1610
+ */
1611
+ parameters?: {
1612
+ filters?: FilterGroup;
1613
+ windowTransform?: WindowTransform;
1614
+ };
1615
+ aliasTemplate?: string;
1616
+ valueAliases?: Record<string, string>;
1617
+ /**
1618
+ * Formula metadata for calculated fields (UI-only metadata)
1619
+ * This is supplementary data to help the UI display and edit calculated fields.
1620
+ * The `expression` field remains the source of truth for the backend.
1621
+ *
1622
+ * IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
1623
+ * Both are generated together from the same dialog inputs, preventing drift.
1624
+ */
1625
+ calculatedFormula?: CalculatedFieldFormula;
1626
+ /**
1627
+ * Indicates the metric expression must be evaluated after row-level filtering,
1628
+ * either because it contains an aggregate function directly or depends on a
1629
+ * pre-aggregated metric input.
1630
+ */
1631
+ isPreAggregated?: boolean;
1632
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1633
+ comparisonDisplay?: 'column' | 'inline' | 'hover';
1634
+ targetValue?: number;
1635
+ }
1636
+
1637
+ declare type NoneOptions = {};
1638
+
1639
+ declare type NumberAxisFormat = {
1640
+ decimalPlaces?: number;
1641
+ minimumFractionDigits?: number;
1642
+ maximumFractionDigits?: number;
1643
+ suffix?: string;
1644
+ currency?: string;
1645
+ locale?: string;
1646
+ useGrouping?: boolean;
1647
+ percentValueMode?: 'fraction' | 'whole';
1648
+ };
1649
+
1650
+ declare type NumberOptions = {
1651
+ locale: string;
1652
+ currency?: string;
1653
+ options: Intl.NumberFormatOptions;
1654
+ colorRanges?: ColorRange[];
1655
+ };
1656
+
1657
+ declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
1658
+
1659
+ declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
1660
+
1661
+ declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'like' | 'not like' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
1662
+
1663
+ declare type OptionsMap = {
1664
+ number: NumberOptions;
1665
+ string: StringOptions;
1666
+ date: DateOptions;
1667
+ html: HtmlOptions;
1668
+ none: NoneOptions;
1669
+ };
1670
+
1671
+ declare interface OrderBy {
1672
+ columnId: string;
1673
+ direction: 'asc' | 'desc';
1674
+ }
1675
+
1676
+ /**
1677
+ * Pagination configuration for table queries
1678
+ */
1679
+ declare interface PaginationConfig {
1680
+ page: number;
1681
+ pageSize: number;
1682
+ }
1683
+
1684
+ declare type PersistedFrameLayoutItem = {
1685
+ i: string;
1686
+ x: number;
1687
+ y: number;
1688
+ w: number;
1689
+ h: number;
1690
+ minW?: number;
1691
+ minH?: number;
1692
+ maxW?: number;
1693
+ maxH?: number;
1694
+ static?: boolean;
1695
+ isResizable?: boolean;
1696
+ isDraggable?: boolean;
1697
+ };
1698
+
1699
+ declare type PersistedFrameLayouts = Partial<Record<Breakpoint, PersistedFrameLayoutItem[]>>;
1700
+
1701
+ declare type PersistedInteraction = Interaction & {
1702
+ id?: string;
1703
+ };
1704
+
1705
+ declare interface PivotByField extends Field {
1706
+ role: 'pivotby';
1707
+ }
1708
+
1709
+ declare interface QueryConfig {
1710
+ groupByColumns?: GroupByColumn[];
1711
+ pivotColumns?: GroupByColumn[];
1712
+ metricColumns?: MetricColumn[];
1713
+ filterColumns?: FilterByColumn[];
1714
+ filters?: QueryFilter[];
1715
+ limit?: number;
1716
+ orderBy?: OrderBy[];
1717
+ }
1718
+
1719
+ declare type QueryFilter = {
1720
+ filterColumnName: string;
1721
+ filterValue: OldFilterValue;
1722
+ };
1723
+
1724
+ declare type RangeValue = {
1725
+ gte?: string | number;
1726
+ lte?: string | number;
1727
+ lt?: string | number;
1728
+ gt?: string | number;
1729
+ };
1730
+
1731
+ declare type RelativeDateFilter = {
1732
+ mode: 'last';
1733
+ n: number;
1734
+ unit: DateUnit;
1735
+ complete?: boolean;
1736
+ } | {
1737
+ mode: 'this';
1738
+ unit: DateUnit;
1739
+ toDate?: boolean;
1740
+ } | {
1741
+ mode: 'previous';
1742
+ unit: DateUnit;
1743
+ } | {
1744
+ mode: 'between';
1745
+ unit: DateUnit;
1746
+ from: number;
1747
+ to: number;
1748
+ };
1749
+
1750
+ declare type SelectedEntities = SelectedEntity[];
1751
+
1752
+ declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
1753
+
1754
+ declare interface SortByField extends Field {
1755
+ role: 'sortby';
1756
+ direction: 'asc' | 'desc';
1757
+ }
1758
+
1759
+ declare type SqlQueryControlSource = {
1760
+ kind: 'sql_query';
1761
+ connectionId: string;
1762
+ sql: string;
1763
+ valueColumn: string;
1764
+ labelColumn?: string;
1765
+ };
1766
+
1767
+ declare type StringOptions = {
1768
+ maxLength?: number;
1769
+ };
1770
+
1771
+ declare type StructuralFieldSelectorTarget = GroupByField;
1772
+
1773
+ declare type StructuralMetricSelectorTarget = MetricField;
1774
+
1775
+ /**
1776
+ * Style propeerites for the dashboard
1777
+ */
1778
+ declare type StyleProps = {
1779
+ /** Theme for dashboard background */
1780
+ canvasTheme?: 'clear' | 'muted' | string;
1781
+ /** css class for `dashboard-panel` */
1782
+ dashboardPanel?: string;
1783
+ /** css class for `dashboard-tabs-container` */
1784
+ dashboardTabsContainer?: string;
1785
+ /** css class for `dashboard-card` */
1786
+ /** css class for `dashboard-card-container` */
1787
+ dashboardCardContainer?: string;
1788
+ dashboardCard?: string;
1789
+ /** grid-layout config */
1790
+ /**
1791
+ * Border radius for the control inputs such as filter input, tabs, date picker, etc.
1792
+ */
1793
+ controlInputRadius?: number;
1794
+ /**
1795
+ * Border radius for the cards
1796
+ */
1797
+ cardBorderRadius?: number;
1798
+ gridLayout?: {
1799
+ /** css class for `react-grid-layout` */
1800
+ className?: string;
1801
+ margin?: [number, number];
1802
+ };
1803
+ /** chart config */
1804
+ chart?: {
1805
+ /** chart font config */
1806
+ font?: Partial<FontSpec>;
1807
+ dataset?: any;
1808
+ /** chart options */
1809
+ options?: any;
1810
+ };
1811
+ table?: {
1812
+ tableHeaderColor?: string;
1813
+ };
1814
+ };
1815
+
1816
+ declare type TableBaseFormatting = {
1817
+ version: TableFormattingVersion;
1818
+ tableParts?: Partial<Record<TablePart, TableBaseStyle>>;
1819
+ columns?: Record<string, {
1820
+ body?: TableBaseStyle;
1821
+ header?: TableBaseStyle;
1822
+ footer?: TableBaseStyle;
1823
+ }>;
1824
+ };
1825
+
1826
+ declare type TableBaseStyle = {
1827
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
1828
+ italic?: boolean;
1829
+ textColor?: string;
1830
+ backgroundColor?: string;
1831
+ textDecoration?: 'none' | 'underline' | 'line-through';
1832
+ };
1833
+
1834
+ declare type TableConditionalFormatting = {
1835
+ version: TableFormattingVersion;
1836
+ rules: ConditionalFormatRule[];
1837
+ };
1838
+
1839
+ /**
1840
+ * Row rhythm for the whole table. Authors pick one per card; undefined
1841
+ * falls back to 'compact' (the canonical default — dense scanning, matches
1842
+ * the Linear-style spec). Drives row padding, cell font size, and header
1843
+ * font size via a shared density spec in DataTable.
1844
+ */
1845
+ declare type TableDensity = 'dense' | 'compact' | 'standard' | 'comfortable' | 'spacious';
1846
+
1847
+ declare type TableFormattingVersion = 1;
1848
+
1849
+ declare type TableGridLines = 'none' | 'outer' | 'inner' | 'horizontal' | 'vertical' | 'top' | 'right' | 'bottom' | 'left' | 'full';
1850
+
1851
+ declare type TableHeaderStyle = 'plain' | 'filled' | 'accent';
1852
+
1853
+ declare type TablePart = 'body' | 'header' | 'footer' | 'subtotal' | 'grandTotal';
1854
+
1855
+ declare type TablePreferences = {
1856
+ columnSettingsMap?: ColumnSettingsMap;
1857
+ baseFormatting?: TableBaseFormatting;
1858
+ conditionalFormatting?: TableConditionalFormatting;
1859
+ selectColumnVisible?: boolean;
1860
+ columnVisibility?: Record<string, boolean>;
1861
+ columnSizing?: ColumnSizingState;
1862
+ pageSize?: number;
1863
+ enableDevModePagination?: boolean;
1864
+ forceClientPagination?: boolean;
1865
+ density?: TableDensity;
1866
+ tableStyle?: TableStylePreferences;
1867
+ };
1868
+
1869
+ declare type TableStylePreferences = {
1870
+ headerStyle?: TableHeaderStyle;
1871
+ headerBackgroundColor?: string;
1872
+ headerTextColor?: string;
1873
+ headerWrapText?: boolean;
1874
+ stripedRows?: boolean;
1875
+ gridLines?: TableGridLines;
1876
+ wrapText?: boolean;
1877
+ totals?: TableTotalsStylePreferences;
1878
+ };
1879
+
1880
+ declare type TableTotalsFontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
1881
+
1882
+ declare type TableTotalsStylePreferences = {
1883
+ enabled?: boolean;
1884
+ backgroundColor?: string;
1885
+ textColor?: string;
1886
+ fontWeight?: TableTotalsFontWeight;
1887
+ borderTop?: boolean;
1888
+ borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double';
1889
+ borderTopColor?: string;
1890
+ };
1891
+
1892
+ /**
1893
+ * Target column configuration for multi-field filters.
1894
+ * Allows a single filter to target multiple columns from the SAME table,
1895
+ * with users selecting which column to filter at runtime.
1896
+ *
1897
+ * Note: Cross-table filtering is not supported. All target columns must
1898
+ * be from the same table as the filter's primary table. For cross-table
1899
+ * date filtering, create separate filters or use a shared date dimension.
1900
+ */
1901
+ declare type TargetColumn = {
1902
+ /** Column name (e.g., "shipping_date") - must be from the filter's table */
1903
+ column: string;
1904
+ /** Display label shown in the dropdown (e.g., "Shipping Date") */
1905
+ label: string;
1906
+ };
1907
+
1908
+ /** Global bar style configuration */
1909
+ declare type TBarStyleConfig = {
1910
+ /** Default border radius for all bars - 0-20 pixels */
1911
+ borderRadius?: number;
1912
+ /** Default border width for all bars - 0-5 pixels */
1913
+ borderWidth?: number;
1914
+ /** Default bar width as percentage of category width (0.1-1.0) */
1915
+ barPercentage?: number;
1916
+ /** Default category width as percentage of available space (0.1-1.0) */
1917
+ categoryPercentage?: number;
1918
+ };
1919
+
1920
+ declare type TBaseQuery = {
1921
+ id: string;
1922
+ name: string;
1923
+ connectionId: string;
1924
+ sql: string;
1925
+ context?: string;
1926
+ description?: string;
1927
+ };
1928
+
1929
+ declare type TBubbleScatterConfig = {
1930
+ /**
1931
+ * Explicit key for X-axis metric. Falls back to auto-detection.
1932
+ */
1933
+ xMetricKey?: string;
1934
+ /**
1935
+ * Explicit key for Y-axis metric. Falls back to auto-detection.
1936
+ */
1937
+ yMetricKey?: string;
1938
+ /**
1939
+ * Explicit key for radius metric (bubble only). Falls back to auto-detection.
1940
+ */
1941
+ radiusMetricKey?: string;
1942
+ /**
1943
+ * Key for point labels (first dimension).
1944
+ */
1945
+ labelKey?: string;
1946
+ /**
1947
+ * Whether to group points into series. Defaults to auto-detect in card config mode.
1948
+ */
1949
+ enableGrouping?: boolean;
1950
+ /**
1951
+ * Key for series grouping. Can be any data type (string, number, date).
1952
+ */
1953
+ groupKey?: string;
1954
+ /**
1955
+ * Scaling mode for bubble radius.
1956
+ */
1957
+ radiusScale?: 'linear' | 'sqrt' | 'fixed';
1958
+ /**
1959
+ * Fixed radius value when radiusScale is 'fixed' or for scatter charts.
1960
+ */
1961
+ fixedRadius?: number;
1962
+ /**
1963
+ * Minimum radius for bubble scaling.
1964
+ */
1965
+ minRadius?: number;
1966
+ /**
1967
+ * Maximum radius for bubble scaling.
1968
+ */
1969
+ maxRadius?: number;
1970
+ };
1971
+
1972
+ declare type TBulletConfig = {
1973
+ /**
1974
+ * Orientation of the bullet chart. Defaults to horizontal.
1975
+ */
1976
+ orientation?: 'horizontal' | 'vertical';
1977
+ /**
1978
+ * Explicit metric key to use for target markers. Falls back to the next metric column.
1979
+ */
1980
+ targetMetricKey?: string;
1981
+ /**
1982
+ * Optional comparative metric (e.g., previous period).
1983
+ */
1984
+ comparativeMetricKey?: string;
1985
+ /**
1986
+ * When true, disables automatic comparative assignment even if a metric exists.
1987
+ */
1988
+ disableAutoComparative?: boolean;
1989
+ /**
1990
+ * Mapping of qualitative range names to column keys.
1991
+ */
1992
+ rangeKeys?: TBulletRangeKeys;
1993
+ /**
1994
+ * Static range values if columns are not provided.
1995
+ */
1996
+ ranges?: TBulletRangeValues;
1997
+ /**
1998
+ * Global target value if a column is not provided.
1999
+ */
2000
+ targetValue?: number;
2001
+ /**
2002
+ * Show numeric labels on the actual bar. Default true.
2003
+ */
2004
+ showValueLabels?: boolean;
2005
+ /**
2006
+ * Treat provided range values as percentages (0-1) when true.
2007
+ */
2008
+ rangesArePercentages?: boolean;
2009
+ /**
2010
+ * Whether qualitative ranges should be rendered.
2011
+ */
2012
+ showRanges?: boolean;
2013
+ /**
2014
+ * Display labels for qualitative ranges.
2015
+ */
2016
+ rangeLabels?: TBulletRangeLabelOverrides;
2017
+ };
2018
+
2019
+ declare type TBulletRangeKeys = Partial<Record<TBulletRangeLabels, string>>;
2020
+
2021
+ declare type TBulletRangeLabelOverrides = Partial<Record<TBulletRangeLabels, string>>;
2022
+
2023
+ declare type TBulletRangeLabels = 'poor' | 'satisfactory' | 'good';
2024
+
2025
+ declare type TBulletRangeValues = Partial<Record<TBulletRangeLabels, number>>;
2026
+
2027
+ declare type TCard = {
2028
+ id: string;
2029
+ title: string;
2030
+ tabTitle?: string;
2031
+ displayTab?: boolean;
2032
+ description?: string;
2033
+ info?: string;
2034
+ connectionId?: string;
2035
+ datamodelId?: string;
2036
+ type: TChartType;
2037
+ sql?: string;
2038
+ python?: string;
2039
+ dataSource?: DataSource;
2040
+ config?: CardConfig;
2041
+ interactionConfig?: CardInteractionConfig;
2042
+ linkedSourceCardId?: string;
2043
+ linkedInteractionTargetOverrides?: Record<string, InteractionTargetOverride>;
2044
+ paginationConfig?: PaginationConfig;
2045
+ queryConfig?: QueryConfig;
2046
+ customCfg?: any;
2047
+ preferences?: TCardPreferences;
2048
+ customCardPreferences?: TCustomCardPreferences;
2049
+ visualizationMode?: TVisualizationMode;
2050
+ dynamicCardPreferences?: TDynamicCardPreferences;
2051
+ lastSelectedDatabase?: string;
2052
+ lastSelectedDatamodelId?: string;
2053
+ lastSelectedSchema?: string;
2054
+ lastSelectedTable?: string;
2055
+ refreshInterval?: string;
2056
+ /**
2057
+ * Card-specific display preferences that override dashboard-level preferences.
2058
+ * If not specified, the card will use the dashboard's display preferences.
2059
+ */
2060
+ displayPreferences?: VisualDisplayPreferences;
2061
+ /**
2062
+ * Inline filter definitions for this card.
2063
+ * Configured by editors via the visual editor settings.
2064
+ */
2065
+ inlineFilters?: TInlineFilter[];
2066
+ /**
2067
+ * Card-scoped calculated fields that should remain available even when they
2068
+ * are not actively selected in the chart configuration.
2069
+ */
2070
+ calculatedFields?: Field[];
2071
+ /**
2072
+ * Card-scoped control definitions for this card.
2073
+ */
2074
+ controls?: ControlDefinition[];
2075
+ /**
2076
+ * Per-card bindings that connect dashboard or card controls to this card's runtime targets.
2077
+ */
2078
+ controlBindings?: ControlBinding[];
2079
+ };
2080
+
2081
+ declare type TCardPreferences = {
2082
+ onClickFilter?: FilterOnClick[];
2083
+ filterOnClick?: boolean;
2084
+ filterOnClickField?: string;
2085
+ filterOnClickColumnIndex?: number;
2086
+ sortChart?: 'asc' | 'desc' | 'none';
2087
+ formatNumber?: {
2088
+ decimalPlaces?: number;
2089
+ minimumFractionDigits?: number;
2090
+ maximumFractionDigits?: number;
2091
+ currency?: string;
2092
+ locale?: string;
2093
+ suffix?: string;
2094
+ prefix?: string;
2095
+ useGrouping?: boolean;
2096
+ percentValueMode?: 'fraction' | 'whole';
2097
+ enabled?: boolean | string;
2098
+ colorRanges?: ColorRange[];
2099
+ };
2100
+ numberAxisFormat?: NumberAxisFormat;
2101
+ datasetOptions?: TDatasetOptions[];
2102
+ chartOptions?: TChartOptions;
2103
+ columnSettings?: TColumnSetting<DisplayDataType>[];
2104
+ colorConfig?: ColorConfig;
2105
+ xAxisConfig?: AxisConfig;
2106
+ yAxisConfig?: AxisConfig;
2107
+ secondaryYAxisConfig?: AxisConfig;
2108
+ tooltipConfig?: TTooltipFormatConfig;
2109
+ dataLabelsConfig?: TDataLabelsConfig;
2110
+ bulletConfig?: TBulletConfig;
2111
+ heatmapConfig?: THeatmapConfig;
2112
+ bubbleScatterConfig?: TBubbleScatterConfig;
2113
+ funnelConfig?: TFunnelConfig;
2114
+ /** Global line/point style defaults for line and area charts */
2115
+ lineStyleConfig?: {
2116
+ lineStyle?: TLineStyle;
2117
+ pointRadius?: number;
2118
+ pointStyle?: TPointStyle;
2119
+ };
2120
+ /** Global bar style defaults for bar charts */
2121
+ barStyleConfig?: TBarStyleConfig;
2122
+ tablePrefs?: TablePreferences;
2123
+ allowDownload?: boolean;
2124
+ customVisualCode?: string;
2125
+ textVisualOptions?: {
2126
+ isDynamicText?: boolean;
2127
+ content?: DashboardInputTextContent;
2128
+ };
2129
+ mapVisualOptions?: {
2130
+ topoJsonUrl?: string;
2131
+ objectKey?: string;
2132
+ outlineKey?: string;
2133
+ customTopoJsonUrl?: string;
2134
+ projection?: string;
2135
+ projectionScale?: number;
2136
+ projectionOffset?: [number, number];
2137
+ colorScale?: string;
2138
+ };
2139
+ kpiVisualOptions?: {
2140
+ lowerIsBetter?: boolean;
2141
+ countryLogoId?: string;
2142
+ valueAlignment?: 'left' | 'center';
2143
+ formatOptions?: TFormatOptions;
2144
+ metricComparison?: {
2145
+ enabled?: boolean;
2146
+ calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
2147
+ formatOptions?: TFormatOptions;
2148
+ showArrow?: boolean;
2149
+ showColor?: boolean;
2150
+ conditionalLabel?: boolean;
2151
+ labelName?: string;
2152
+ position?: 'left' | 'right' | 'top';
2153
+ conditionalLabels?: {
2154
+ increase?: string;
2155
+ decrease?: string;
2156
+ noChange?: string;
2157
+ };
2158
+ colorConfig?: {
2159
+ increase?: 'green' | 'red' | 'neutral' | string;
2160
+ decrease?: 'green' | 'red' | 'neutral' | string;
2161
+ noChange?: 'green' | 'red' | 'neutral' | string;
2162
+ };
2163
+ };
2164
+ };
2165
+ tableVisualOptions?: {
2166
+ metricComparison?: {
2167
+ calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
2168
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
2169
+ formatOptions?: TFormatOptions;
2170
+ colors?: {
2171
+ increase?: 'green' | 'red' | 'neutral' | string;
2172
+ decrease?: 'green' | 'red' | 'neutral' | string;
2173
+ neutral?: 'green' | 'red' | 'neutral' | string;
2174
+ };
2175
+ lowerIsBetter?: boolean;
2176
+ };
2177
+ };
2178
+ pivotTableOptions?: {
2179
+ showRowTotals?: boolean;
2180
+ showColumnTotals?: boolean;
2181
+ showGrandTotal?: boolean;
2182
+ sortRowsBy?: 'label' | 'total' | 'metric';
2183
+ sortColumnsBy?: 'label' | 'total' | 'metric';
2184
+ };
2185
+ displayOptions?: {
2186
+ showFilterInfo?: boolean;
2187
+ showCardToolbar?: boolean;
2188
+ showChrome?: boolean;
2189
+ allowScroll?: boolean;
2190
+ showInlineFilterBar?: boolean;
2191
+ };
2192
+ };
2193
+
2194
+ declare type TChartOptions = {
2195
+ type?: TChartType;
2196
+ scales?: {
2197
+ y?: {
2198
+ type?: 'linear' | 'logarithmic';
2199
+ min?: number;
2200
+ max?: number;
2201
+ ticks?: {
2202
+ stepSize?: number;
2203
+ };
2204
+ grid?: {
2205
+ display?: boolean;
2206
+ };
2207
+ };
2208
+ x?: {
2209
+ type?: 'linear' | 'logarithmic';
2210
+ min?: number;
2211
+ max?: number;
2212
+ ticks?: {
2213
+ stepSize?: number;
2214
+ };
2215
+ grid?: {
2216
+ display?: boolean;
2217
+ };
2218
+ };
2219
+ };
2220
+ indexAxis?: 'x' | 'y' | undefined;
2221
+ plugins?: {
2222
+ legend?: TLegendOptions;
2223
+ datalabels?: {
2224
+ anchor?: string;
2225
+ };
2226
+ };
2227
+ treemapColorMode?: 'branch' | 'category';
2228
+ };
2229
+
2230
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2231
+
2232
+ declare type TColumnSetting<T extends DisplayDataType> = {
2233
+ columnIdx: number;
2234
+ textAlign?: 'left' | 'center' | 'right';
2235
+ width?: number;
2236
+ type: T;
2237
+ options: OptionsMap[T];
2238
+ };
2239
+
2240
+ declare type TCustomCardPreferences = {
2241
+ showCardHeader?: boolean;
2242
+ url?: string;
2243
+ componentName?: string;
2244
+ icon?: string;
2245
+ pluginChartType?: string;
2246
+ type?: 'iframe' | 'component';
2247
+ visualType?: 'single' | 'multiple';
2248
+ minInputs?: number;
2249
+ maxInputs?: number;
2250
+ slotIndex?: number;
2251
+ settings?: any;
2252
+ slotSettings?: any;
2253
+ /** @deprecated Use position-based data collection. Kept for legacy dashboard support. */
2254
+ dataInputCardIds?: {
2255
+ [key: number]: {
2256
+ cardId: string;
2257
+ };
2258
+ };
2259
+ };
2260
+
2261
+ declare type TCustomFilterPreferences = {
2262
+ url: string;
2263
+ componentName: string;
2264
+ pluginFilterType?: string;
2265
+ icon?: string;
2266
+ settings?: Record<string, string | number | boolean>;
2267
+ };
2268
+
2269
+ declare type TDashboard = {
2270
+ id: string;
2271
+ title?: string;
2272
+ aiContext?: DashboardAIContext;
2273
+ summary?: {
2274
+ enabled?: boolean;
2275
+ position?: 'top' | 'bottom';
2276
+ maxItems?: number;
2277
+ };
2278
+ description?: string;
2279
+ sheets?: TSheet[];
2280
+ calculatedFields?: Field[];
2281
+ style?: TStyle;
2282
+ filters?: TFilter[];
2283
+ customCards?: CustomCard[];
2284
+ baseQueries?: TBaseQuery[];
2285
+ aiScopeTables?: AIScopeTable[];
2286
+ globalStyle?: TStyle;
2287
+ globalCacheConfig?: CacheConfig;
2288
+ emailSettings?: EmailSettings;
2289
+ defaultFilterValues?: TFilterValue[];
2290
+ controls?: ControlDefinition[];
2291
+ defaultControlValues?: Record<string, unknown>;
2292
+ inputs?: DashboardInput[];
2293
+ defaultInputValues?: DashboardInputValues;
2294
+ filterLayout?: FilterLayoutSettings;
2295
+ };
2296
+
2297
+ declare type TDataLabelsConfig = {
2298
+ enabled?: boolean;
2299
+ position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'custom';
2300
+ anchor?: 'center' | 'start' | 'end';
2301
+ align?: 'center' | 'start' | 'end' | 'top' | 'bottom' | number;
2302
+ display?: 'auto' | boolean;
2303
+ formatMode?: 'inherit' | 'override';
2304
+ /** @deprecated Use formatMode + formatOptions.type */
2305
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2306
+ formatOptions?: TFormatOptions;
2307
+ font?: {
2308
+ size?: number;
2309
+ weight?: 'normal' | 'bold';
2310
+ };
2311
+ color?: 'auto' | string;
2312
+ clamp?: boolean;
2313
+ clip?: boolean;
2314
+ rotation?: number;
2315
+ showTotal?: boolean;
2316
+ offset?: number;
2317
+ };
2318
+
2319
+ declare type TDatasetOptions = {
2320
+ idx: number;
2321
+ type?: 'bar' | 'line';
2322
+ fill?: string | number;
2323
+ /** Y-axis assignment for combo charts: 'y' (primary/left) or 'y2' (secondary/right) */
2324
+ yAxisId?: 'y' | 'y2';
2325
+ /** Per-series data labels configuration - uses full TDataLabelsConfig for feature parity */
2326
+ dataLabels?: TDataLabelsConfig;
2327
+ /** Point radius (size) for line/area charts - 0 hides points */
2328
+ pointRadius?: number;
2329
+ /** Point shape style for line/area charts */
2330
+ pointStyle?: TPointStyle;
2331
+ /** Point radius on hover - defaults to pointRadius + 2 */
2332
+ pointHoverRadius?: number;
2333
+ /** Line dash style for line/area charts */
2334
+ lineStyle?: TLineStyle;
2335
+ /** Border radius (rounded corners) for bar charts - 0-20 pixels */
2336
+ borderRadius?: number;
2337
+ /** Border width for bar charts - 0-5 pixels */
2338
+ barBorderWidth?: number;
2339
+ /** Bar width as percentage of category width (0.1-1.0) */
2340
+ barPercentage?: number;
2341
+ /** Category width as percentage of available space (0.1-1.0) */
2342
+ categoryPercentage?: number;
2343
+ /** @deprecated Use dataLabels instead */
2344
+ datalabels?: {
2345
+ display?: boolean;
2346
+ align?: string;
2347
+ anchor?: string;
2348
+ clamp?: boolean;
2349
+ color?: string;
2350
+ };
2351
+ };
2352
+
2353
+ declare type TDynamicCardPreferences = {
2354
+ renderer: 'dynamic-visual';
2355
+ artifactId?: string;
2356
+ parentArtifactId?: string;
2357
+ title?: string;
2358
+ rendererCode?: string;
2359
+ question?: string;
2360
+ provenance?: 'card-config' | 'sql' | 'sql+python';
2361
+ visualIntent?: TDynamicVisualIntent;
2362
+ assistantNote?: string;
2363
+ builtinDisplayOptions?: {
2364
+ showChrome?: boolean;
2365
+ allowScroll?: boolean;
2366
+ };
2367
+ fallback: TDynamicVisualFallback;
2368
+ error?: {
2369
+ stage: string;
2370
+ message: string;
2371
+ details?: string[];
2372
+ };
2373
+ };
2374
+
2375
+ declare type TDynamicVisualFallback = {
2376
+ mode: 'chart' | 'table';
2377
+ chartType?: TChartType;
2378
+ reason: string;
2379
+ };
2380
+
2381
+ declare type TDynamicVisualIntent = {
2382
+ primaryChartType?: TChartType | 'custom';
2383
+ layout: 'chart-only' | 'composite';
2384
+ includesKpis: boolean;
2385
+ };
2386
+
2387
+ declare type TFilter = {
2388
+ kind?: FilterKind;
2389
+ type?: 'single' | 'multiple';
2390
+ uiType?: 'radio' | 'dropdown' | 'tabs';
2391
+ dateSelectionMode?: DateSelectionMode;
2392
+ defaultValues?: (string | number)[];
2393
+ defaultDateFilter?: DefaultDateFilter;
2394
+ sheetId?: string;
2395
+ location?: FilterLocation;
2396
+ hide?: boolean;
2397
+ id: string;
2398
+ /** Alias exposed to document/text variables, for example {{region}}. */
2399
+ variableName?: string;
2400
+ connectionId: string;
2401
+ title: string;
2402
+ column: string;
2403
+ dataType: string;
2404
+ table?: string;
2405
+ database?: string;
2406
+ qualifiedTableName?: string;
2407
+ sql: string;
2408
+ operation: Operation;
2409
+ fieldMeta?: FilterFieldMeta;
2410
+ semanticContext?: FilterSemanticContext;
2411
+ /**
2412
+ * Multi-field filter support: When set, provides multiple column options.
2413
+ * The first column becomes the default. Users can select which column
2414
+ * to filter at runtime via a dropdown in the date picker.
2415
+ * If not set, the single `column` field is used (backward compatible).
2416
+ */
2417
+ targetColumns?: TargetColumn[];
2418
+ searchMode?: 'text' | 'numeric' | 'auto';
2419
+ applyToSheetIds?: string[];
2420
+ excludeSheetIds?: string[];
2421
+ applyToCardIds?: string[];
2422
+ excludeCardIds?: string[];
2423
+ customFilterPreferences?: TCustomFilterPreferences;
2424
+ /** Whether to show the label above the filter (default: true) */
2425
+ showLabel?: boolean;
2426
+ /**
2427
+ * Width in pixels when displayed in toolbar mode.
2428
+ * Defaults vary by filter type (160px for dropdowns, 220px for date ranges, etc.)
2429
+ */
2430
+ toolbarWidth?: number;
2431
+ /**
2432
+ * Display mode for this filter
2433
+ * - 'canvas': Always show as draggable card on canvas
2434
+ * - 'toolbar': Always show in toolbar
2435
+ * - 'inherit': Use dashboard's filterLayout.displayMode setting (default)
2436
+ */
2437
+ displayMode?: FilterDisplayMode;
2438
+ };
2439
+
2440
+ declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2441
+
2442
+ declare type TFormatOptions = {
2443
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2444
+ decimalPlaces?: number;
2445
+ minimumFractionDigits?: number;
2446
+ maximumFractionDigits?: number;
2447
+ currency?: string;
2448
+ locale?: string;
2449
+ prefix?: string;
2450
+ suffix?: string;
2451
+ useSuffix?: boolean;
2452
+ useGrouping?: boolean;
2453
+ negativeInParentheses?: boolean;
2454
+ multiplyBy?: number;
2455
+ percentValueMode?: 'fraction' | 'whole';
2456
+ dateFormat?: string;
2457
+ timezone?: string;
2458
+ sourceTimezone?: string;
2459
+ relative?: boolean;
2460
+ };
2461
+
2462
+ declare type TFrame = {
2463
+ id: string;
2464
+ visualId?: string;
2465
+ filterId?: string;
2466
+ cards: TCard[];
2467
+ activeCardId: string;
2468
+ calculatedFields?: Field[];
2469
+ };
2470
+
2471
+ declare type TFunnelConfig = {
2472
+ /**
2473
+ * How to calculate percentage in tooltips and data labels.
2474
+ * - 'percentOfTotal': Each stage shows % of total sum (default/current behavior)
2475
+ * - 'percentOfFirst': First stage = 100%, others relative to first
2476
+ */
2477
+ percentMode?: TFunnelPercentMode;
2478
+ /**
2479
+ * Controls how much funnel segments narrow based on their values.
2480
+ * - 0: No shrink (all segments same width)
2481
+ * - 1: Full shrink (segments narrow proportionally to values, default)
2482
+ * Lower values prevent segments from becoming too narrow for labels.
2483
+ */
2484
+ shrinkFraction?: number;
2485
+ /**
2486
+ * Hide labels for segments smaller than this percentage of total.
2487
+ * - 0: Show all labels (default)
2488
+ * - 10: Hide labels for segments < 10% of total
2489
+ * Range: 0-25
2490
+ */
2491
+ labelThreshold?: number;
2492
+ };
2493
+
2494
+ /**
2495
+ * Tooltip/data label percentage calculation mode for funnel charts.
2496
+ * - 'percentOfTotal': Percentage relative to sum of all values (default)
2497
+ * - 'percentOfFirst': Percentage relative to the first stage value (first stage = 100%)
2498
+ */
2499
+ declare type TFunnelPercentMode = 'percentOfTotal' | 'percentOfFirst';
2500
+
2501
+ declare type THeatmapConfig = {
2502
+ colorMode?: 'continuous' | 'stepped';
2503
+ steps?: number;
2504
+ colorRange?: [string, string];
2505
+ colorPalette?: 'blue' | 'green' | 'purple' | 'orange' | 'custom';
2506
+ showLegend?: boolean;
2507
+ legendPosition?: 'top' | 'bottom' | 'left' | 'right';
2508
+ showDataLabels?: boolean;
2509
+ nullFillColor?: string;
2510
+ fillMissingCells?: boolean;
2511
+ xAxisBuckets?: string[];
2512
+ yAxisBuckets?: string[];
2513
+ };
2514
+
2515
+ declare interface TimeDrillStep {
2516
+ granularity: TimeGranularity;
2517
+ next?: TimeGranularity;
2518
+ comparison?: 'previous_year' | 'previous_period';
2519
+ rollingWindow?: number;
2520
+ }
2521
+
2522
+ declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
2523
+
2524
+ /**
2525
+ * Inline filter definition stored on a card.
2526
+ * Inline filters appear on the right-hand side of the card header,
2527
+ * allowing ad-hoc data exploration without affecting other cards.
2528
+ */
2529
+ declare type TInlineFilter = {
2530
+ id: string;
2531
+ /** Alias exposed to document/text variables, for example {{region}}. */
2532
+ variableName?: string;
2533
+ column: string;
2534
+ title: string;
2535
+ dataType: string;
2536
+ table: string;
2537
+ database: string;
2538
+ qualifiedTableName?: string;
2539
+ connectionId: string;
2540
+ operation: Operation;
2541
+ sql: string;
2542
+ fieldMeta?: FilterFieldMeta;
2543
+ semanticContext?: FilterSemanticContext;
2544
+ /** Selection type: 'single' allows one value, 'multiple' allows many */
2545
+ type?: 'single' | 'multiple';
2546
+ /** UI component for single-select filters */
2547
+ uiType?: 'radio' | 'dropdown' | 'tabs';
2548
+ /** Date picker type: 'range' for full calendar, 'months' for month picker */
2549
+ dateSelectionMode?: DateSelectionMode;
2550
+ /** Default values applied when the dashboard first loads */
2551
+ defaultValues?: (string | number)[];
2552
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
2553
+ defaultDateFilter?: DefaultDateFilter;
2554
+ /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
2555
+ searchMode?: 'text' | 'numeric' | 'auto';
2556
+ /** Custom filter UI from a plugin */
2557
+ customFilterPreferences?: TCustomFilterPreferences;
2558
+ /** Width of the inline filter in pixels (default: 250) */
2559
+ width?: number;
2560
+ /** Whether to show the label above the filter (default: true) */
2561
+ showLabel?: boolean;
2562
+ };
2563
+
2564
+ declare type TLegendOptions = {
2565
+ display?: boolean;
2566
+ position?: 'top' | 'left' | 'bottom' | 'right';
2567
+ align?: 'start' | 'center' | 'end';
2568
+ labels?: {
2569
+ generateLabels?: (chart: any) => any[];
2570
+ [key: string]: any;
2571
+ };
2572
+ };
2573
+
2574
+ /** Line dash style options */
2575
+ declare type TLineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot';
2576
+
2577
+ /** Historical per-column totals shape. Runtime totals are table-level now. */
2578
+ declare type TotalsBehavior = 'sum' | 'avg' | 'count' | 'label' | 'none';
2579
+
2580
+ /** Point style options supported by Chart.js */
2581
+ declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
2582
+
2583
+ declare type TSheet = {
2584
+ id: string;
2585
+ kind?: 'dashboard' | 'document';
2586
+ title?: string;
2587
+ description?: string;
2588
+ layout?: ReactGridLayout.Layout[];
2589
+ layouts?: ReactGridLayout.Layouts;
2590
+ cards?: TCard[];
2591
+ frames?: TFrame[];
2592
+ calculatedFields?: Field[];
2593
+ document?: DocumentDefinition;
2594
+ };
2595
+
2596
+ /**
2597
+ * Style for the dashboard
2598
+ */
2599
+ declare type TStyle = {
2600
+ default: StyleProps;
2601
+ dark?: StyleProps;
2602
+ };
2603
+
2604
+ declare type TTooltipFormatConfig = {
2605
+ formatMode?: 'inherit' | 'override';
2606
+ /** @deprecated Use formatMode */
2607
+ mode?: 'inherit' | 'override';
2608
+ formatOptions?: TFormatOptions;
2609
+ };
2610
+
2611
+ declare type TVisualizationMode = 'builtin' | 'dynamic';
2612
+
2613
+ /**
2614
+ * URL Parameter for drill-to-URL interpolation
2615
+ * Represents a placeholder in the URL template (e.g., {{product_id}})
2616
+ */
2617
+ declare interface URLParameter {
2618
+ /**
2619
+ * Unique identifier for the parameter (e.g., 'product_id', 'card_id')
2620
+ * Used in template as {{id}}
2621
+ */
2622
+ id: string;
2623
+ /**
2624
+ * Display label for the parameter
2625
+ */
2626
+ label: string;
2627
+ /**
2628
+ * Category of the parameter
2629
+ * - attribute: From card dimensions/attributes (e.g., product name, region)
2630
+ * - identifier: System values (card_id, frame_id, sheet_id)
2631
+ */
2632
+ category: 'attribute' | 'identifier';
2633
+ /**
2634
+ * For attribute parameters: the complete field object
2635
+ * Provides access to all field properties (name, qualifiedFieldName, dataType, etc.)
2636
+ */
2637
+ field?: Field;
2638
+ }
2639
+
2640
+ export declare function validateDashboardChangePlan(plan: DashboardChangePlan): DashboardAuthoringValidationResult;
2641
+
2642
+ export declare function validateDashboardPlan(plan: DashboardPlan): DashboardAuthoringValidationResult;
2643
+
2644
+ /**
2645
+ * Display mode for visual components - controls which UI elements are shown
2646
+ */
2647
+ declare type VisualDisplayMode = 'full' | 'print' | 'table-print';
2648
+
2649
+ /**
2650
+ * Display preferences for controlling visual component rendering
2651
+ */
2652
+ declare type VisualDisplayPreferences = {
2653
+ /**
2654
+ * Predefined display mode
2655
+ * - 'full': All UI elements (default)
2656
+ * - 'print': Optimized for printing (shows title and description, hides interactive elements)
2657
+ * - 'table-print': Table-specific print mode (title only, no pagination/toolbar)
2658
+ */
2659
+ mode?: VisualDisplayMode;
2660
+ /**
2661
+ * Override specific UI elements visibility
2662
+ * These overrides take precedence over the mode presets
2663
+ */
2664
+ overrides?: {
2665
+ showHeader?: boolean;
2666
+ showTitle?: boolean;
2667
+ showDescription?: boolean;
2668
+ showTabs?: boolean;
2669
+ showFooter?: boolean;
2670
+ showFilters?: boolean;
2671
+ showBreadcrumbs?: boolean;
2672
+ showRefreshIndicator?: boolean;
2673
+ showFilterInfo?: boolean;
2674
+ showPagination?: boolean;
2675
+ showTableToolbar?: boolean;
2676
+ showColumnSettings?: boolean;
2677
+ };
2678
+ };
2679
+
2680
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
2681
+
2682
+ declare interface WindowTransform {
2683
+ function: WindowFunction;
2684
+ orderBy?: {
2685
+ fieldId: string;
2686
+ direction?: 'asc' | 'desc';
2687
+ };
2688
+ partitionByFieldIds?: string[];
2689
+ frame?: 'unbounded_preceding';
2690
+ movingAverage?: {
2691
+ windowSize?: number;
2692
+ minPeriods?: number;
2693
+ };
2694
+ previousPeriodDelta?: {
2695
+ mode?: 'absolute' | 'percent';
2696
+ };
2697
+ percentOfTotal?: {
2698
+ scope?: 'grand_total' | 'partition_total';
2699
+ output?: 'fraction' | 'percent';
2700
+ };
2701
+ }
2702
+
2703
+ export { }