react-semaphor 0.1.421 → 0.1.423

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 (67) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +2 -2
  3. package/dist/brand-studio/index.cjs +1 -1
  4. package/dist/brand-studio/index.js +2 -2
  5. package/dist/briefings/index.cjs +1 -1
  6. package/dist/briefings/index.js +913 -712
  7. package/dist/chunks/{analyze-result-contract-sWcmvBOA.js → analyze-result-contract-D7pjjYPy.js} +45 -46
  8. package/dist/chunks/{analyze-result-contract-B5Eeu7vD.js → analyze-result-contract-DpDcImgk.js} +1 -1
  9. package/dist/chunks/{calendar-preferences-dialog-CscmhyuZ.js → calendar-preferences-dialog-CTmeASaM.js} +1 -1
  10. package/dist/chunks/{calendar-preferences-dialog-cN3_2C-u.js → calendar-preferences-dialog-t5ET6MON.js} +3 -3
  11. package/dist/chunks/card-config-utils-15sRtebL.js +1 -0
  12. package/dist/chunks/card-config-utils-BYZ5MJOh.js +16 -0
  13. package/dist/chunks/dashboard-briefing-launcher-Cavd0QJb.js +3401 -0
  14. package/dist/chunks/dashboard-briefing-launcher-S2akO-ub.js +26 -0
  15. package/dist/chunks/dashboard-controls-BJLrErjW.js +2322 -0
  16. package/dist/chunks/dashboard-controls-DzbP8AXA.js +52 -0
  17. package/dist/chunks/dashboard-json-5tWb5KD6.js +1 -0
  18. package/dist/chunks/{dashboard-json-Cxhw2TZc.js → dashboard-json-Do2-pdPZ.js} +12 -11
  19. package/dist/chunks/{edit-dashboard-visual-BigSJ3-x.js → edit-dashboard-visual-Cw6bq4_w.js} +7058 -6989
  20. package/dist/chunks/edit-dashboard-visual-Yh5YFgMF.js +178 -0
  21. package/dist/chunks/index-BPM3gDRw.js +1406 -0
  22. package/dist/chunks/{index-CH2ZzQo4.js → index-yHe0SeLO.js} +81534 -75430
  23. package/dist/chunks/{switch-TbCsyhv9.js → switch-2bh3Hka1.js} +620 -633
  24. package/dist/chunks/{switch-CiOjVyVI.js → switch-DMT7qf_R.js} +24 -24
  25. package/dist/chunks/{update-policy-2MZ-Vf7v.js → update-policy-BCJc0oI5.js} +1 -1
  26. package/dist/chunks/{update-policy-qpyAkOyO.js → update-policy-C1pmhLz9.js} +1 -1
  27. package/dist/chunks/{use-create-flow-overlay-state-BzcJWNzh.js → use-create-flow-overlay-state-5MDbZcs1.js} +515 -544
  28. package/dist/chunks/use-create-flow-overlay-state-BNczg9Gj.js +11 -0
  29. package/dist/chunks/{validators-Dj1Y-46V.js → validators-DMlVbd1p.js} +1 -1
  30. package/dist/chunks/{validators-D0pfj3jJ.js → validators-PXkij33j.js} +1 -1
  31. package/dist/dashboard/index.cjs +1 -1
  32. package/dist/dashboard/index.js +1 -1
  33. package/dist/dashboard-authoring/index.cjs +1 -1
  34. package/dist/dashboard-authoring/index.js +2 -2
  35. package/dist/data-app-builder/index.cjs +1 -1
  36. package/dist/data-app-builder/index.js +108 -108
  37. package/dist/data-app-codegen/index.cjs +1 -1
  38. package/dist/data-app-codegen/index.js +2 -2
  39. package/dist/data-app-codegen-node/index.cjs +165 -340
  40. package/dist/data-app-codegen-node/index.js +761 -952
  41. package/dist/data-app-sdk/index.cjs +2 -2
  42. package/dist/data-app-sdk/index.js +91 -95
  43. package/dist/data-app-sdk-adapters/index.cjs +1 -1
  44. package/dist/data-app-sdk-adapters/index.js +1 -1
  45. package/dist/data-app-sdk-validation/index.cjs +1 -1
  46. package/dist/data-app-sdk-validation/index.js +2 -2
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +168 -164
  49. package/dist/style.css +1 -1
  50. package/dist/surfboard/index.cjs +1 -1
  51. package/dist/surfboard/index.js +2 -2
  52. package/dist/types/analytics-protocol.d.ts +0 -4
  53. package/dist/types/briefings.d.ts +2388 -7
  54. package/dist/types/dashboard-assistant.d.ts +0 -1
  55. package/dist/types/data-app-sdk-validation.d.ts +0 -1
  56. package/dist/types/data-app-sdk.d.ts +0 -2
  57. package/dist/types/main.d.ts +70 -10
  58. package/dist/types/types.d.ts +4 -8
  59. package/package.json +1 -1
  60. package/dist/chunks/dashboard-briefing-launcher-BYTBNetR.js +0 -9077
  61. package/dist/chunks/dashboard-briefing-launcher-DmZkzIC3.js +0 -80
  62. package/dist/chunks/dashboard-controls-9DFeKIP4.js +0 -52
  63. package/dist/chunks/dashboard-controls-PhzuaTBj.js +0 -2280
  64. package/dist/chunks/dashboard-json-DyRHI3mL.js +0 -1
  65. package/dist/chunks/edit-dashboard-visual-3_jiBXsu.js +0 -178
  66. package/dist/chunks/index-BKDQw0aK.js +0 -1346
  67. package/dist/chunks/use-create-flow-overlay-state-DUQmgb9H.js +0 -21
@@ -1,3 +1,39 @@
1
+ import { ColumnSizingState } from '@tanstack/react-table';
2
+
3
+ declare type AggregateFunction = 'COUNT' | 'SUM' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
4
+
5
+ declare type AxisConfig = {
6
+ enabled?: boolean;
7
+ name?: {
8
+ enabled: boolean;
9
+ text?: string;
10
+ /** Font size for the axis title */
11
+ fontSize?: number;
12
+ /** Font weight for the axis title */
13
+ fontWeight?: 'normal' | 'bold';
14
+ };
15
+ position?: 'auto' | 'top' | 'bottom' | 'left' | 'right';
16
+ labels?: {
17
+ enabled: boolean;
18
+ rotation?: 'auto' | 0 | 45 | 90 | -45 | -90;
19
+ };
20
+ formatMode?: 'inherit' | 'override';
21
+ formatOptions?: TFormatOptions;
22
+ scale?: {
23
+ min?: number | 'auto';
24
+ max?: number | 'auto';
25
+ stepSize?: number | 'auto';
26
+ };
27
+ };
28
+
29
+ declare interface BaseColumn {
30
+ id: string;
31
+ name: string;
32
+ label?: string;
33
+ type: ColumnType;
34
+ table?: string;
35
+ }
36
+
1
37
  export declare const BRIEFING_ARTIFACT_FORMATS: readonly ["markdown", "html"];
2
38
 
3
39
  export declare const BRIEFING_CONTENT_LIMITS: {
@@ -47,16 +83,11 @@ export declare type BriefingAttachment = (BriefingAttachmentBase & {
47
83
  dashboardId: string;
48
84
  sheetId: string;
49
85
  format: 'pdf';
50
- }) | (BriefingAttachmentBase & {
51
- type: 'visual';
52
- dashboardId: string;
53
- visualId: string;
54
- format: 'pdf' | 'png';
55
86
  }) | (BriefingAttachmentBase & {
56
87
  type: 'card';
57
88
  dashboardId: string;
58
89
  cardId: string;
59
- format: 'csv' | 'pdf' | 'png';
90
+ format: 'csv' | 'pdf';
60
91
  });
61
92
 
62
93
  declare type BriefingAttachmentBase = {
@@ -64,7 +95,7 @@ declare type BriefingAttachmentBase = {
64
95
  settings?: BriefingAttachmentSettings;
65
96
  };
66
97
 
67
- export declare type BriefingAttachmentFormat = 'pdf' | 'csv' | 'png';
98
+ export declare type BriefingAttachmentFormat = 'pdf' | 'csv';
68
99
 
69
100
  export declare type BriefingAttachmentSettings = {
70
101
  theme?: string;
@@ -90,8 +121,11 @@ export declare type BriefingAttachmentSettings = {
90
121
  dashboardInputExecutionSnapshot?: Record<string, unknown>;
91
122
  selectedSheetId?: string;
92
123
  cardType?: string;
124
+ allowDownload?: boolean;
93
125
  };
94
126
 
127
+ export declare type BriefingAuthorIntent = 'scheduled_report' | 'analytical_briefing';
128
+
95
129
  export declare type BriefingBody = {
96
130
  type: 'generated_analysis';
97
131
  instruction: string;
@@ -102,6 +136,11 @@ export declare type BriefingBody = {
102
136
  type: 'none';
103
137
  };
104
138
 
139
+ export declare type BriefingCardAttachmentCapability = {
140
+ formats: BriefingAttachmentFormat[];
141
+ defaultFormat: BriefingAttachmentFormat | null;
142
+ };
143
+
105
144
  export declare type BriefingChannelConfig = {
106
145
  formatProfile?: BriefingFormatProfile;
107
146
  subjectOverride?: string;
@@ -220,6 +259,8 @@ export declare type BriefingDeliveryConfig = {
220
259
  channelConfigs?: Partial<Record<BriefingDeliveryChannel, BriefingChannelConfig>>;
221
260
  };
222
261
 
262
+ export declare type BriefingDisplayTypeLabel = 'Analytical briefing' | 'Scheduled report' | 'On-demand report' | 'Plain briefing';
263
+
223
264
  export declare type BriefingDraft = {
224
265
  name: string;
225
266
  description?: string | null;
@@ -234,6 +275,12 @@ export declare type BriefingDraft = {
234
275
  deliveryConfig?: BriefingDeliveryConfig | null;
235
276
  };
236
277
 
278
+ export declare type BriefingEntityPresentation = {
279
+ typeLabel: BriefingDisplayTypeLabel;
280
+ noun: 'report' | 'briefing';
281
+ pluralNoun: 'reports' | 'briefings';
282
+ };
283
+
237
284
  export declare type BriefingFormatProfile = 'concise' | 'balanced' | 'detailed';
238
285
 
239
286
  export declare type BriefingJobConfig = {
@@ -290,6 +337,15 @@ export declare type BriefingRecipient = {
290
337
  groupId: string;
291
338
  };
292
339
 
340
+ export declare type BriefingScheduleCadence = 'daily' | 'weekly' | 'twice_monthly' | 'monthly';
341
+
342
+ export declare type BriefingScheduleViewModel = {
343
+ cadence: BriefingScheduleCadence;
344
+ hour: number;
345
+ minute: number;
346
+ weekdays: number[];
347
+ };
348
+
293
349
  export declare type BriefingSheetSelection = 'current' | 'all';
294
350
 
295
351
  export declare type BriefingSlackChannelDestination = {
@@ -323,6 +379,11 @@ export declare type BriefingSource = {
323
379
 
324
380
  export declare type BriefingStatus = 'ACTIVE' | 'PAUSED' | 'DISABLED';
325
381
 
382
+ export declare type BriefingUiUser = {
383
+ type: 'organization' | 'tenant';
384
+ role?: string;
385
+ };
386
+
326
387
  export declare type BriefingValidationIssue = {
327
388
  field: string;
328
389
  message: string;
@@ -348,10 +409,416 @@ export declare function buildBriefingJobConfig(input: Omit<Partial<BriefingJobCo
348
409
  body: BriefingBody;
349
410
  }): BriefingJobConfig;
350
411
 
412
+ export declare function buildBriefingScheduleExpr(view: BriefingScheduleViewModel): string;
413
+
351
414
  export declare function buildCreateBriefingRequest(draft: BriefingDraft): CreateBriefingRequest;
352
415
 
353
416
  export declare function buildUpdateBriefingRequest(draft: BriefingDraft): UpdateBriefingRequest;
354
417
 
418
+ /**
419
+ * Formula metadata for calculated fields (UI-only metadata)
420
+ * This is supplementary runtime/compiler data to help dashboard UI display,
421
+ * edit, and execute calculated fields.
422
+ *
423
+ * Public source-level calculation metadata belongs in `Field.derivedField`
424
+ * (`SemaphorDerivedFieldDefinition`). `calculatedFormula` deliberately uses
425
+ * indexed `{field_N}` tokens and full runtime Field objects so current dashboard
426
+ * query execution can resolve aliases, joins, filters, and aggregates without
427
+ * doing catalog lookups.
428
+ *
429
+ * IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
430
+ * Both are generated together from the same dialog inputs, preventing drift.
431
+ */
432
+ declare interface CalculatedFieldFormula {
433
+ operation: CalculatedFieldOperation;
434
+ /**
435
+ * Array of full MetricField objects used as inputs to the calculated field.
436
+ *
437
+ * Storing complete Field objects eliminates the need for runtime lookups and ensures:
438
+ * - Table alias resolution works with schema-qualified tables (Issue 1)
439
+ * - All field metadata is available even if the input field isn't selected on the card (Issue 2)
440
+ * - Aggregate functions, filters, and entity info are preserved
441
+ *
442
+ * Each input field contains complete metadata:
443
+ * - name, entityId, entityName, qualifiedEntityName (for table qualification)
444
+ * - aggregate (for proper post-aggregation: SUM(sales) / COUNT(orders))
445
+ * - parameters.filters (for filtered metrics)
446
+ * - dataType and other properties
447
+ *
448
+ * Example: [
449
+ * {name: 'sales', aggregate: 'SUM', entityName: 'sales_data', ...},
450
+ * {name: 'order_id', aggregate: 'COUNT', entityName: 'sales_data', ...}
451
+ * ]
452
+ */
453
+ inputFields: Array<MetricField | GroupByField>;
454
+ /**
455
+ * Constant value used in scale operations (e.g., multiply by 0.15)
456
+ * Only applicable for 'scale' operation type
457
+ */
458
+ constant?: number;
459
+ }
460
+
461
+ /**
462
+ * Operations supported for calculated fields
463
+ */
464
+ declare type CalculatedFieldOperation = 'sum' | 'difference' | 'product' | 'ratio' | 'change' | 'percentage' | 'scale' | 'custom';
465
+
466
+ export declare function canCreateBriefingForUser(user: BriefingUiUser | null | undefined): boolean;
467
+
468
+ declare interface CardConfig {
469
+ /**
470
+ * Matrix table is the shared analytics-spine successor for pivot and
471
+ * hierarchical aggregate tables. Dashboard cards store the public matrix
472
+ * intent shape so Data Apps, MCP, and dashboard runtime consume one contract.
473
+ */
474
+ matrixIntent?: SemaphorMatrixIntent;
475
+ /**
476
+ * Deprecated compatibility fields for older matrix table drafts. New
477
+ * dashboard-authored matrix cards should use `matrixIntent` so normal
478
+ * `filters` can remain the explorer/card-level `FilterGroup`.
479
+ */
480
+ version?: SemaphorMatrixIntent['version'];
481
+ source?: SemaphorMatrixIntent['source'];
482
+ rows?: SemaphorMatrixIntent['rows'];
483
+ columns?: SemaphorMatrixIntent['columns'];
484
+ values?: SemaphorMatrixIntent['values'];
485
+ inputs?: SemaphorMatrixIntent['inputs'];
486
+ totals?: SemaphorMatrixIntent['totals'];
487
+ sort?: SemaphorMatrixIntent['sort'];
488
+ expansion?: SemaphorMatrixIntent['expansion'];
489
+ layout?: SemaphorMatrixIntent['layout'];
490
+ displayLimits?: SemaphorMatrixIntent['displayLimits'];
491
+ groupByColumns?: GroupByField[];
492
+ metricColumns?: MetricField[];
493
+ pivotByColumns?: PivotByField[];
494
+ sortByColumns?: SortByField[];
495
+ detailColumns?: DetailField[];
496
+ /**
497
+ * Typed source that anchors the query before auto-join materializes an
498
+ * executable joinPlan.baseEntity. This is distinct from
499
+ * DataSource.selectedEntities, which lists available datasets but does not
500
+ * define join-root semantics.
501
+ */
502
+ queryBaseSource?: SemaphorSourceRef;
503
+ /** Preserves non-detail config when switching to detail tables. */
504
+ detailTableBackup?: DetailTableBackupConfig;
505
+ filters?: FilterGroup;
506
+ joinPlan?: JoinPlan;
507
+ rowLimit?: number;
508
+ /**
509
+ * One or more hierarchies that define drillable paths through dimensions.
510
+ */
511
+ drillHierarchies?: DrillHierarchy[];
512
+ /**
513
+ * Optional list of dimensions allowed for dynamic drill-down across this card.
514
+ * Used only when drill steps contain `mode: 'dynamicDrill'` or `type: 'dynamic'`.
515
+ */
516
+ allowedDrillTargets?: Field[];
517
+ /**
518
+ * NOT UOptional preload settings for inline drill previews
519
+ */
520
+ inlineDrillPreview?: {
521
+ enabled: boolean;
522
+ limit: number;
523
+ mode: 'lazy' | 'preloaded';
524
+ };
525
+ /**
526
+ * Configuration for on-click dashboard filters triggered by this card.
527
+ */
528
+ clickFilterInteractions?: ClickFilterInteraction[];
529
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
530
+ targetValue?: number;
531
+ showComparisonInLegend?: boolean;
532
+ showTrendline?: boolean;
533
+ trendlineWindow?: number;
534
+ trendlineGranularity?: 'day' | 'week' | 'month';
535
+ summary?: {
536
+ enabled?: boolean;
537
+ showOnCard?: boolean;
538
+ includeInDashboardSummary?: boolean;
539
+ breakdownDimensions?: GroupByField[];
540
+ };
541
+ rowAggregates?: Array<{
542
+ label?: string;
543
+ function: AggregateFunction;
544
+ groupLevel: string | 'ALL';
545
+ }>;
546
+ columnAggregates?: Array<{
547
+ label?: string;
548
+ function: AggregateFunction;
549
+ pivotLevel: string | 'ALL';
550
+ }>;
551
+ }
552
+
553
+ declare interface CardInteractionConfig {
554
+ /**
555
+ * V2: Unified interactions array.
556
+ * Each interaction includes a trigger that specifies what element must be clicked.
557
+ */
558
+ interactions?: PersistedInteraction[];
559
+ allowedDrillTargets?: Field[];
560
+ drillHierarchies?: DrillHierarchy[];
561
+ }
562
+
563
+ declare interface ClickFilterInteraction {
564
+ mode: 'clickFilter';
565
+ /**
566
+ * What element must be clicked to trigger this interaction.
567
+ * Determines both the matching logic and the filtering behavior.
568
+ *
569
+ * @migration Optional during migration. Will be required in V2.
570
+ * Old configs without trigger will apply to any click (legacy behavior).
571
+ */
572
+ trigger?: InteractionTrigger;
573
+ /**
574
+ * Fields from the chart element that should be used as filters.
575
+ * e.g., [region, ship_mode] from a stacked bar chart
576
+ */
577
+ filterFields: Field[];
578
+ /**
579
+ * Should this card visually highlight when clicked?
580
+ */
581
+ highlightSelf?: boolean;
582
+ /**
583
+ * Cards this filter applies to (inclusive).
584
+ * If omitted and `excludeCardIds` is also omitted → applies to all cards except self.
585
+ */
586
+ applyToCardIds?: string[];
587
+ /**
588
+ * Cards to explicitly exclude from receiving this filter.
589
+ * Takes effect only if `applyToCardIds` is undefined (acts as override).
590
+ */
591
+ excludeCardIds?: string[];
592
+ /**
593
+ * Optional UI label or tooltip.
594
+ */
595
+ label?: string;
596
+ }
597
+
598
+ declare type ColorConfig = {
599
+ segments: Record<string, string>;
600
+ };
601
+
602
+ declare type ColorRange = {
603
+ start: number;
604
+ end: number;
605
+ color: string;
606
+ };
607
+
608
+ declare interface ColorRange_2 {
609
+ min: number;
610
+ max: number;
611
+ color: string;
612
+ applyTo: 'cell' | 'row';
613
+ }
614
+
615
+ declare interface ColumnSettings {
616
+ type: 'none' | 'text' | 'number' | 'date' | 'badge' | 'link' | 'progress';
617
+ inheritMetricFormat?: boolean;
618
+ textAlign: 'left' | 'center' | 'right';
619
+ width: number;
620
+ minWidth?: number;
621
+ maxWidth?: number;
622
+ textOverflow?: 'ellipsis' | 'wrap' | 'clip';
623
+ textWrap: ColumnTextWrap;
624
+ /** Deprecated/inert. Totals are controlled by tablePrefs.tableStyle.totals. */
625
+ totalsBehavior?: TotalsBehavior;
626
+ totalsLabel?: string;
627
+ numberFormat: {
628
+ style: 'decimal' | 'currency' | 'percent' | 'scientific';
629
+ currency: string;
630
+ locale: string;
631
+ minimumFractionDigits: number;
632
+ maximumFractionDigits: number;
633
+ useGrouping?: boolean;
634
+ percentValueMode?: 'fraction' | 'whole';
635
+ showDataBar: boolean;
636
+ dataBarColor: string;
637
+ dataBarMinValue?: number;
638
+ dataBarMaxValue?: number;
639
+ /**
640
+ * When true, render the cell bg with a heatmap intensity tint scaled
641
+ * across the column's value range. Composes with the existing text
642
+ * color/color-range logic (tint is bg only). `showDataBar` takes
643
+ * precedence when both are set — per the canonical design, a cell is
644
+ * either a data-bar or a heatmap, never both.
645
+ */
646
+ showHeatmap?: boolean;
647
+ };
648
+ dateFormat: {
649
+ format: string;
650
+ useCustomFormat: boolean;
651
+ customFormat: string;
652
+ useRelativeTime: boolean;
653
+ timezone?: string;
654
+ sourceTimezone?: string;
655
+ };
656
+ linkFormat: LinkFormat;
657
+ colorRanges: ColorRange_2[];
658
+ }
659
+
660
+ declare type ColumnSettingsMap = Record<string, ColumnSettings>;
661
+
662
+ declare type ColumnTextWrap = 'default' | 'truncate' | 'wrap' | 'nowrap' | 'preserve';
663
+
664
+ declare type ColumnType = 'string' | 'number' | 'date';
665
+
666
+ declare type ComparisonOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte';
667
+
668
+ declare type ConditionalFormatCondition = {
669
+ kind: 'comparison';
670
+ columnId: string;
671
+ operator: ComparisonOperator;
672
+ value: unknown;
673
+ } | {
674
+ kind: 'between';
675
+ columnId: string;
676
+ min: unknown;
677
+ max: unknown;
678
+ inclusive?: boolean;
679
+ } | {
680
+ kind: 'blank';
681
+ columnId: string;
682
+ isBlank: boolean;
683
+ } | {
684
+ kind: 'contains';
685
+ columnId: string;
686
+ value: string;
687
+ caseSensitive?: boolean;
688
+ exact?: boolean;
689
+ } | {
690
+ kind: 'topBottom';
691
+ columnId: string;
692
+ direction: 'top' | 'bottom';
693
+ count: number;
694
+ } | {
695
+ kind: 'colorScale';
696
+ columnId: string;
697
+ range: 'auto' | 'manual';
698
+ min?: number;
699
+ mid?: number;
700
+ max?: number;
701
+ colors: {
702
+ min: string;
703
+ mid?: string;
704
+ max: string;
705
+ };
706
+ } | {
707
+ kind: 'dataBar';
708
+ columnId: string;
709
+ range: 'auto' | 'manual';
710
+ min?: number;
711
+ max?: number;
712
+ color: string;
713
+ showValue?: boolean;
714
+ };
715
+
716
+ declare type ConditionalFormatRule = {
717
+ id: string;
718
+ name?: string;
719
+ enabled?: boolean;
720
+ target: ConditionalFormatTarget;
721
+ condition: ConditionalFormatCondition;
722
+ style?: ConditionalFormatStyle;
723
+ };
724
+
725
+ declare type ConditionalFormatStyle = {
726
+ backgroundColor?: string;
727
+ textColor?: string;
728
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
729
+ italic?: boolean;
730
+ textDecoration?: 'none' | 'underline' | 'line-through';
731
+ icon?: 'arrowUp' | 'arrowDown' | 'warning' | 'check' | 'x';
732
+ dataBar?: {
733
+ color: string;
734
+ showValue: boolean;
735
+ };
736
+ };
737
+
738
+ declare type ConditionalFormatTarget = {
739
+ level: 'cell' | 'row';
740
+ columnIds?: string[];
741
+ conditionColumnId?: string;
742
+ applyToColumnIds?: string[];
743
+ tableParts?: TablePart[];
744
+ rowRoles?: string[];
745
+ depth?: number;
746
+ includeTotals?: boolean;
747
+ includeSubtotals?: boolean;
748
+ };
749
+
750
+ declare type ConnectionType = 'GoogleSheets' | 'FileUpload' | 'MySQL' | 'MSSQL' | 'PostgreSQL' | 'BigQuery' | 'Redshift' | 'Snowflake' | 'S3' | 'clickhouse' | 'S3Tables' | 'API' | 'none';
751
+
752
+ declare type ControlBinding = {
753
+ controlId: string;
754
+ target: 'sql_param';
755
+ paramId: string;
756
+ } | {
757
+ controlId: string;
758
+ target: 'config_metric_selector';
759
+ mapping: Record<string, StructuralMetricSelectorTarget>;
760
+ } | {
761
+ controlId: string;
762
+ target: 'config_field_selector';
763
+ mapping: Record<string, StructuralFieldSelectorTarget>;
764
+ } | {
765
+ controlId: string;
766
+ target: 'config_aggregation';
767
+ mapping: Record<string, string>;
768
+ } | {
769
+ controlId: string;
770
+ target: 'config_grain';
771
+ mapping: Record<string, string>;
772
+ };
773
+
774
+ declare type ControlDefinition = {
775
+ id: string;
776
+ label: string;
777
+ scope: ControlScope;
778
+ type: ControlType;
779
+ source: ControlSource;
780
+ initialValueStrategy: ControlInitialValueStrategy;
781
+ defaultValue?: unknown;
782
+ requiredAtExecution: boolean;
783
+ hidden?: boolean;
784
+ locked?: boolean;
785
+ helpText?: string;
786
+ placement?: 'toolbar' | 'card_header' | 'advanced';
787
+ showLabel?: boolean;
788
+ toolbarWidth?: number;
789
+ };
790
+
791
+ declare type ControlInitialValueStrategy = 'saved_default' | 'builtin' | 'embed_required' | 'schedule_snapshot';
792
+
793
+ declare type ControlOption = {
794
+ value: string;
795
+ label: string;
796
+ presentation?: {
797
+ granularity?: TimeGranularity;
798
+ dateFormat?: DateFormatValue;
799
+ customFormat?: string;
800
+ };
801
+ };
802
+
803
+ declare type ControlScope = 'dashboard' | 'card';
804
+
805
+ declare type ControlSource = {
806
+ kind: 'manual';
807
+ options: ControlOption[];
808
+ } | {
809
+ kind: 'dataset_values';
810
+ fieldId: string;
811
+ connectionId?: string;
812
+ } | {
813
+ kind: 'field_allowlist';
814
+ fieldIds: string[];
815
+ } | {
816
+ kind: 'metric_allowlist';
817
+ metricIds: string[];
818
+ } | SqlQueryControlSource;
819
+
820
+ declare type ControlType = 'enum' | 'multi_enum' | 'text' | 'number' | 'boolean' | 'date' | 'field_selector' | 'metric_selector' | 'aggregation_selector' | 'grain_selector';
821
+
355
822
  export declare type CreateBriefingRequest = {
356
823
  name: string;
357
824
  description: string | null;
@@ -366,26 +833,1940 @@ export declare type CreateBriefingRequest = {
366
833
  deliveryConfig: BriefingDeliveryConfig | null;
367
834
  };
368
835
 
836
+ declare type DashboardInputExportKey = 'label' | 'value' | 'start' | 'end' | 'range';
837
+
838
+ declare type DashboardInputTextContent = Array<{
839
+ type: 'text';
840
+ value: string;
841
+ } | {
842
+ type: 'variable';
843
+ ref: DashboardInputVariableRef;
844
+ }>;
845
+
846
+ declare type DashboardInputVariableRef = {
847
+ source: 'dashboardInput';
848
+ inputId: string;
849
+ export: DashboardInputExportKey;
850
+ } | {
851
+ source: 'dashboardInputAlias';
852
+ variableName: string;
853
+ export?: DashboardInputExportKey;
854
+ } | {
855
+ source: 'documentMeta';
856
+ key: 'generatedAt' | 'pageNumber' | 'pageCount';
857
+ };
858
+
859
+ declare interface DatabaseEntityReference {
860
+ connectionId: string;
861
+ connectionType: ConnectionType;
862
+ type: EntityType;
863
+ dbObjectType?: string;
864
+ dialect?: Dialect;
865
+ database?: string;
866
+ schema?: string;
867
+ name: string;
868
+ }
869
+
870
+ declare type DatabaseEntityType = 'table' | 'view' | 'materialized view';
871
+
872
+ declare interface DataModelEntityReference extends DatabaseEntityReference {
873
+ type: 'model';
874
+ id: string;
875
+ label: string;
876
+ description: string;
877
+ }
878
+
879
+ declare interface DatasetEntityReference extends DatabaseEntityReference {
880
+ type: 'dataset';
881
+ datasetType: 'physical' | 'virtual';
882
+ table?: string | null;
883
+ datamodelId?: string | null;
884
+ sql?: string | null;
885
+ id: string;
886
+ domainId: string;
887
+ label: string;
888
+ description?: string;
889
+ }
890
+
891
+ declare interface DataSource {
892
+ connectionId: string;
893
+ semanticDomainId?: string;
894
+ connectionType: string;
895
+ mode: 'database' | 'upload' | 'url' | 'semanticDomain';
896
+ dbSelection?: {
897
+ database: string;
898
+ schema: string;
899
+ entityType: DatabaseEntityType;
900
+ };
901
+ selectedEntities: SelectedEntities;
902
+ }
903
+
904
+ 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"];
905
+
906
+ declare type DateFormatValue = (typeof DATE_FORMAT_VALUES)[number];
907
+
908
+ declare type DateOptions = {
909
+ locale: string;
910
+ format: string;
911
+ options: Intl.DateTimeFormatOptions;
912
+ };
913
+
914
+ declare type DateSelectionMode = 'range' | 'months';
915
+
916
+ declare type DateUnit = 'day' | 'week' | 'month' | 'quarter' | 'year';
917
+
369
918
  export declare const DEFAULT_BRIEFING_ARTIFACT_FORMATS: readonly ["markdown"];
370
919
 
920
+ export declare const DEFAULT_BRIEFING_SCHEDULE: BriefingScheduleViewModel;
921
+
922
+ declare type DefaultDateFilter = RelativeDateFilter | FixedMonthDefaultDateFilter;
923
+
924
+ export declare function describeBriefingSchedule(expression: string, timezone: string, locale?: string): string | null;
925
+
926
+ /**
927
+ * Field configuration for detail table columns.
928
+ * Unlike GroupByField, DetailField does not support aggregation or granularity.
929
+ * Columns are selected and displayed as-is from the database.
930
+ */
931
+ declare interface DetailField extends Omit<Field, 'role' | 'granularity'> {
932
+ role: 'detail';
933
+ dateFormat?: DateFormatValue;
934
+ customFormat?: string;
935
+ /**
936
+ * Optional SQL expression for calculated detail fields.
937
+ */
938
+ expression?: string;
939
+ /**
940
+ * Formula metadata for calculated fields (used for token qualification).
941
+ */
942
+ calculatedFormula?: CalculatedFieldFormula;
943
+ }
944
+
945
+ declare interface DetailTableBackupConfig {
946
+ groupByColumns?: GroupByField[];
947
+ metricColumns?: MetricField[];
948
+ pivotByColumns?: PivotByField[];
949
+ sortByColumns?: SortByField[];
950
+ rowAggregates?: Array<{
951
+ label?: string;
952
+ function: AggregateFunction;
953
+ groupLevel: string | 'ALL';
954
+ }>;
955
+ columnAggregates?: Array<{
956
+ label?: string;
957
+ function: AggregateFunction;
958
+ pivotLevel: string | 'ALL';
959
+ }>;
960
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'target' | 'start_vs_end';
961
+ }
962
+
963
+ declare type Dialect = 'mysql' | 'postgres' | 'bigquery' | 'redshift' | 'snowflake' | 'clickhouse' | 'duckdb' | 'mssql';
964
+
965
+ declare type DisplayDataType = 'string' | 'date' | 'number' | 'html' | 'none';
966
+
967
+ declare interface DrillDownInteraction {
968
+ mode: 'drillDown';
969
+ /**
970
+ * What element must be clicked to trigger this drill-down.
971
+ * Optional during configuration, but must be defined before execution.
972
+ */
973
+ trigger?: InteractionTrigger;
974
+ filterFields: Field[];
975
+ hierarchyId?: string;
976
+ label?: string;
977
+ }
978
+
979
+ declare interface DrillHierarchy {
980
+ id: string;
981
+ label?: string;
982
+ type: 'static' | 'date';
983
+ steps: DrillHierarchyStep[];
984
+ default?: boolean;
985
+ baseField?: Field;
986
+ }
987
+
988
+ declare interface DrillHierarchyStep {
989
+ field: Field;
990
+ mode: 'drillDown';
991
+ preferredChartType?: TChartType;
992
+ breadcrumbLabelTemplate?: string;
993
+ retainFilters?: boolean;
994
+ label?: string;
995
+ linkedInsightId?: string;
996
+ }
997
+
998
+ declare interface DrillThroughInteraction {
999
+ mode: 'drillThrough';
1000
+ /**
1001
+ * What element must be clicked to trigger this drill-through.
1002
+ * @migration Optional during migration. Will be required in V2.
1003
+ */
1004
+ trigger?: InteractionTrigger;
1005
+ filterFields: Field[];
1006
+ targetDashboardId: string;
1007
+ /**
1008
+ * How to pass context to the target dashboard
1009
+ * @default 'interactionFilters'
1010
+ */
1011
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1012
+ label?: string;
1013
+ }
1014
+
1015
+ declare interface DrillToDetailInteraction {
1016
+ mode: 'drillToDetail';
1017
+ /**
1018
+ * What element must be clicked to trigger this drill to detail.
1019
+ * @migration Optional during migration. Will be required in V2.
1020
+ */
1021
+ trigger?: InteractionTrigger;
1022
+ filterFields: Field[];
1023
+ detailFields?: Field[];
1024
+ sortBy?: SortByField[];
1025
+ limit?: number;
1026
+ detailTitle?: string;
1027
+ /**
1028
+ * Target insight ID to navigate to
1029
+ */
1030
+ targetInsightId?: string;
1031
+ /**
1032
+ * How to pass context to the target insight
1033
+ * @default 'interactionFilters'
1034
+ */
1035
+ contextMode?: 'interactionFilters' | 'full' | 'none';
1036
+ /**
1037
+ * How to display the insight
1038
+ * @default 'modal'
1039
+ */
1040
+ displayMode?: 'modal' | 'replace-card';
1041
+ label?: string;
1042
+ }
1043
+
1044
+ declare interface DrillToURLInteraction {
1045
+ mode: 'drillToURL';
1046
+ /**
1047
+ * What element must be clicked to trigger this URL drill.
1048
+ */
1049
+ trigger?: InteractionTrigger;
1050
+ filterFields: Field[];
1051
+ /**
1052
+ * URL template with placeholders (e.g., 'https://example.com/product/{{product_id}}')
1053
+ */
1054
+ urlTemplate: string;
1055
+ /**
1056
+ * List of parameters used in the URL template
1057
+ */
1058
+ parameters: URLParameter[];
1059
+ /**
1060
+ * Whether to URL-encode parameter values
1061
+ * @default true
1062
+ */
1063
+ encodeParameters?: boolean;
1064
+ /**
1065
+ * Custom label for this interaction in the menu
1066
+ */
1067
+ label?: string;
1068
+ }
1069
+
1070
+ declare interface DrillUpInteraction {
1071
+ mode: 'drillUp';
1072
+ /**
1073
+ * What element must be clicked to trigger this drill-up.
1074
+ * For synthetic drill-up interactions, this is inherited from the original drill-down.
1075
+ */
1076
+ trigger?: InteractionTrigger;
1077
+ /**
1078
+ * The hierarchy ID to reference for display purposes.
1079
+ * Used to show the parent level name in the interaction menu.
1080
+ */
1081
+ hierarchyId?: string;
1082
+ label?: string;
1083
+ }
1084
+
1085
+ declare interface DynamicDrillInteraction {
1086
+ mode: 'dynamicDrill';
1087
+ /**
1088
+ * What element must be clicked to trigger this dynamic drill menu.
1089
+ * When this trigger fires, user sees a menu of available fields to explore.
1090
+ */
1091
+ trigger?: InteractionTrigger;
1092
+ /**
1093
+ * List of fields available for dynamic exploration.
1094
+ * User can choose which field to drill into at runtime.
1095
+ * Only drillable fields (string, boolean types) should be included.
1096
+ */
1097
+ availableFields: Field[];
1098
+ /**
1099
+ * Optional label for the menu item.
1100
+ * Defaults to "Explore Fields" if not specified.
1101
+ */
1102
+ label?: string;
1103
+ /* Excluded from this release type: drillField */
1104
+ }
1105
+
1106
+ declare type EntityType = 'table' | 'view' | 'materialized view' | 'model' | 'file' | 'dataset' | 'url' | 'upload';
1107
+
1108
+ declare interface Field {
1109
+ /**
1110
+ * Unique identifier for this field instance (for joins, UI state, etc.).
1111
+ * Should be unique within the context of the query or data model.
1112
+ * Example: 'orders.customer_id', 'expr_12345', etc.
1113
+ */
1114
+ id: string;
1115
+ /**
1116
+ * The physical/source column name in the database or data source.
1117
+ * Used for mapping to the underlying data model and SQL generation (unless overridden by expression).
1118
+ */
1119
+ name: string;
1120
+ /**
1121
+ * Human-friendly, localizable display name for the UI (table headers, chart axes, etc.).
1122
+ */
1123
+ label: string;
1124
+ /**
1125
+ * Unique, stable, machine-friendly reference name for SQL (AS alias), exports, and scripting.
1126
+ * If not provided, should be auto-generated from label or name.
1127
+ */
1128
+ alias?: string;
1129
+ sourceField?: string;
1130
+ qualifiedFieldName: string;
1131
+ dataType: string;
1132
+ description?: string;
1133
+ qualifiedEntityName?: string;
1134
+ dateFormat?: DateFormatValue;
1135
+ customFormat?: string;
1136
+ granularity?: TimeGranularity;
1137
+ entityId: string;
1138
+ entityName: string;
1139
+ entityType: EntityType;
1140
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
1141
+ expression?: string;
1142
+ calculatedFormula?: CalculatedFieldFormula;
1143
+ /**
1144
+ * Public, source-level derived-field metadata for semantic/domain-authored
1145
+ * calculations. This is the AI/MCP/Data App-facing contract: named-token
1146
+ * expression, typed inputs, result role, and compute stage.
1147
+ *
1148
+ * Dashboard-local calculated fields may omit this because they are local
1149
+ * runtime artifacts rather than semantic-domain definitions.
1150
+ */
1151
+ derivedField?: SemaphorDerivedFieldDefinition;
1152
+ format?: FormatSpec;
1153
+ aggregate?: AggregateFunction;
1154
+ fieldScope?: FieldScope;
1155
+ }
1156
+
1157
+ declare type FieldScope = 'card' | 'sheet' | 'dashboard' | 'domain';
1158
+
1159
+ declare interface FileEntityReference extends DatabaseEntityReference {
1160
+ id: string;
1161
+ type: 'file' | 'url' | 'upload';
1162
+ label: string;
1163
+ description: string;
1164
+ originalName: string;
1165
+ file?: File;
1166
+ url?: string;
1167
+ }
1168
+
1169
+ declare interface FilterByColumn extends BaseColumn {
1170
+ role: 'filter';
1171
+ operators?: string[];
1172
+ mode?: 'include' | 'exclude';
1173
+ sql?: string;
1174
+ fetchValues?: boolean;
1175
+ fetchLimit?: number;
1176
+ valueSource?: 'distinct' | 'static' | 'range';
1177
+ staticValues?: string[];
1178
+ }
1179
+
1180
+ declare interface FilterCondition {
1181
+ id: string;
1182
+ field: Field;
1183
+ operator: Operator;
1184
+ value: FilterValue;
1185
+ }
1186
+
1187
+ declare type FilterFieldMeta = Pick<Field, 'name' | 'qualifiedFieldName'> & Partial<Pick<Field, 'id' | 'qualifiedEntityName' | 'entityId' | 'dataType' | 'role' | 'fieldScope'>> & {
1188
+ entityName?: Field['entityName'];
1189
+ entityType?: string;
1190
+ expression?: string;
1191
+ calculatedFormula?: CalculatedFieldFormula;
1192
+ };
1193
+
1194
+ declare interface FilterGroup {
1195
+ id: string;
1196
+ logicalOperator: LogicalOperator;
1197
+ negate: boolean;
1198
+ conditions: FilterCondition[];
1199
+ groups: FilterGroup[];
1200
+ }
1201
+
1202
+ declare type FilterOnClick = {
1203
+ expression?: string;
1204
+ columnIndex: number;
1205
+ };
1206
+
1207
+ declare type FilterSemanticContext = {
1208
+ semanticDomainId?: string;
1209
+ selectedEntities?: unknown[];
1210
+ connectionId?: string;
1211
+ connectionType?: string;
1212
+ };
1213
+
1214
+ declare type FilterValue = string | number | boolean | Date | null | [number, number] | [string, string] | string[] | number[];
1215
+
1216
+ /**
1217
+ * Absolute fixed month/year default used by Month Picker defaults.
1218
+ * - `month` is 0-indexed (0=January, 11=December) to align with MonthPicker.
1219
+ */
1220
+ declare type FixedMonthDefaultDateFilter = {
1221
+ mode: 'fixed';
1222
+ unit: 'month';
1223
+ year: number;
1224
+ month: number;
1225
+ };
1226
+
1227
+ declare type FormatSpec = {
1228
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1229
+ locale?: string;
1230
+ minimumFractionDigits?: number;
1231
+ maximumFractionDigits?: number;
1232
+ useGrouping?: boolean;
1233
+ prefix?: string;
1234
+ suffix?: string;
1235
+ negativeStyle?: 'minus' | 'parentheses';
1236
+ compact?: boolean;
1237
+ scale?: number;
1238
+ currency?: string;
1239
+ percentValueMode?: 'fraction' | 'whole';
1240
+ } | {
1241
+ type: 'date';
1242
+ locale?: string;
1243
+ pattern?: string;
1244
+ relative?: boolean;
1245
+ timezone?: string;
1246
+ sourceTimezone?: string;
1247
+ prefix?: string;
1248
+ suffix?: string;
1249
+ } | {
1250
+ type: 'duration';
1251
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1252
+ outputStyle?: 'compact' | 'digital' | 'long';
1253
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1254
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1255
+ maxUnits?: number;
1256
+ prefix?: string;
1257
+ suffix?: string;
1258
+ negativeStyle?: 'minus' | 'parentheses';
1259
+ } | {
1260
+ type: 'string';
1261
+ prefix?: string;
1262
+ suffix?: string;
1263
+ };
1264
+
1265
+ export declare function getBriefingCardAttachmentCapability(card: TCard): BriefingCardAttachmentCapability;
1266
+
1267
+ export declare function getBriefingCardAttachmentFormats(input: {
1268
+ cardType: string;
1269
+ allowDownload?: boolean;
1270
+ }): BriefingAttachmentFormat[];
1271
+
1272
+ export declare function getBriefingCreationIntents(input: {
1273
+ canCreate: boolean;
1274
+ analyticalBriefingsEnabled: boolean;
1275
+ scheduledReportAvailable: boolean;
1276
+ }): BriefingAuthorIntent[];
1277
+
1278
+ export declare function getBriefingDisplayTypeLabel(input: {
1279
+ body: BriefingBody;
1280
+ attachments: BriefingAttachment[];
1281
+ deliveryConfig: BriefingDeliveryConfig | null;
1282
+ scheduleExpr: string | null;
1283
+ }): BriefingDisplayTypeLabel;
1284
+
1285
+ /** Derives customer-facing terminology without changing the Briefing model. */
1286
+ export declare function getBriefingPresentation(input: {
1287
+ body: BriefingBody;
1288
+ attachments: BriefingAttachment[];
1289
+ deliveryConfig: BriefingDeliveryConfig | null;
1290
+ scheduleExpr: string | null;
1291
+ }): BriefingEntityPresentation;
1292
+
1293
+ export declare function getDefaultBriefingCardAttachmentFormat(input: {
1294
+ cardType: string;
1295
+ allowDownload?: boolean;
1296
+ }): BriefingAttachmentFormat;
1297
+
1298
+ declare type Granularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
1299
+
1300
+ declare interface GroupByColumn extends BaseColumn {
1301
+ role: 'groupby';
1302
+ granularity?: Granularity;
1303
+ format?: string;
1304
+ }
1305
+
1306
+ declare interface GroupByField extends Field {
1307
+ role: 'groupby';
1308
+ granularity?: TimeGranularity;
1309
+ /**
1310
+ * Optional SQL expression for grouping (e.g., DATE_TRUNC('month', order_date)).
1311
+ * If present, used in SELECT and GROUP BY instead of just the column name.
1312
+ */
1313
+ expression?: string;
1314
+ timeDrillPath?: TimeDrillStep[];
1315
+ calculatedFormula?: CalculatedFieldFormula;
1316
+ }
1317
+
1318
+ declare type HtmlOptions = {
1319
+ html: string;
1320
+ };
1321
+
1322
+ declare interface InlineDrillInteraction {
1323
+ mode: 'inlineDrill';
1324
+ /**
1325
+ * What element must be clicked to trigger this inline drill.
1326
+ * @migration Optional during migration. Will be required in V2.
1327
+ */
1328
+ trigger?: InteractionTrigger;
1329
+ filterFields: Field[];
1330
+ /**
1331
+ * When to fetch the detailed data
1332
+ * @default 'lazy'
1333
+ */
1334
+ fetchMode?: 'lazy' | 'preloaded';
1335
+ /**
1336
+ * Maximum number of records to show (0 for unlimited)
1337
+ * @default 100
1338
+ */
1339
+ inlineLimit?: number;
1340
+ /**
1341
+ * How to display the detailed records
1342
+ * @default 'table'
1343
+ */
1344
+ displayMode?: 'table' | 'list' | 'cards';
1345
+ /**
1346
+ * Whether to show records in a modal overlay
1347
+ * @default false
1348
+ */
1349
+ showInModal?: boolean;
1350
+ /**
1351
+ * Whether to allow exporting the detailed records
1352
+ * @default true
1353
+ */
1354
+ allowExport?: boolean;
1355
+ label?: string;
1356
+ }
1357
+
1358
+ /**
1359
+ * Unified Interaction type (V2)
1360
+ * Combines all interaction types into a single union for the new interactions array.
1361
+ */
1362
+ declare type Interaction = ClickFilterInteraction | DrillDownInteraction | DrillThroughInteraction | DrillToDetailInteraction | DrillToURLInteraction | InlineDrillInteraction | DrillUpInteraction | DynamicDrillInteraction;
1363
+
1364
+ declare interface InteractionTargetOverride {
1365
+ applyToCardIds?: string[] | null;
1366
+ excludeCardIds?: string[] | null;
1367
+ }
1368
+
1369
+ /**
1370
+ * Defines what element must be clicked to trigger an interaction.
1371
+ *
1372
+ * The `type` determines filtering behavior:
1373
+ * - 'metric': Captures intersection of ALL dimensions (e.g., country='USA' AND state='CA')
1374
+ * - 'attribute': Captures ONLY the clicked dimension (e.g., country='USA')
1375
+ *
1376
+ * Note: `trigger.type` is different from `field.type`:
1377
+ * - trigger.type = filtering behavior ('metric' | 'attribute')
1378
+ * - field.type = data type ('dimension' | 'metric' | 'measure')
1379
+ */
1380
+ declare interface InteractionTrigger {
1381
+ /**
1382
+ * Determines filtering behavior when this trigger fires:
1383
+ * - 'metric': Capture intersection of all dimensions
1384
+ * - 'attribute': Capture only this specific dimension
1385
+ */
1386
+ type: 'metric' | 'attribute';
1387
+ /**
1388
+ * The field (metric or attribute) that must be clicked.
1389
+ * For multi-series charts: Use the specific metric Field with unique ID
1390
+ * (e.g., Field with id='count_of_orders')
1391
+ */
1392
+ field: Field;
1393
+ }
1394
+
371
1395
  export declare function isBriefingArtifactFormat(input: unknown): input is BriefingArtifactFormat;
372
1396
 
373
1397
  export declare function isBriefingDeliveryChannel(input: unknown): input is BriefingDeliveryChannel;
374
1398
 
1399
+ export declare function isEmailOnlyBriefingDelivery(deliveryConfig: BriefingDeliveryConfig | null): boolean;
1400
+
1401
+ export declare function isValidBriefingTimezone(value: unknown): value is string;
1402
+
1403
+ declare interface Join {
1404
+ id: string;
1405
+ source: DatabaseEntityReference;
1406
+ target: DatabaseEntityReference;
1407
+ joinType: 'INNER' | 'LEFT' | 'RIGHT' | 'FULL';
1408
+ joinKeyGroups: JoinKeyGroup[];
1409
+ sequence: number;
1410
+ relationshipId?: string;
1411
+ relationshipName?: string;
1412
+ relationshipCardinality?: 'one_to_one' | 'one_to_many' | 'many_to_one' | 'many_to_many';
1413
+ relationshipTraversalDirection?: 'forward' | 'reverse';
1414
+ }
1415
+
1416
+ declare interface JoinKey {
1417
+ id?: string;
1418
+ source: Field;
1419
+ target: Field;
1420
+ operator: string;
1421
+ }
1422
+
1423
+ declare interface JoinKeyGroup {
1424
+ id: string;
1425
+ operator: string;
1426
+ keys: JoinKey[];
1427
+ }
1428
+
1429
+ declare interface JoinPlan {
1430
+ baseEntity: DatabaseEntityReference;
1431
+ joins: Join[];
1432
+ }
1433
+
1434
+ declare interface LinkFormat {
1435
+ urlTemplate: string;
1436
+ labelType: 'value' | 'static' | 'column';
1437
+ staticLabel?: string;
1438
+ labelColumn?: string;
1439
+ openInNewTab: boolean;
1440
+ }
1441
+
1442
+ declare type LogicalOperator = 'AND' | 'OR';
1443
+
375
1444
  export declare const MAX_BRIEFING_ATTACHMENTS = 20;
376
1445
 
1446
+ declare interface MetricColumn extends BaseColumn {
1447
+ role: 'metric';
1448
+ aggregate: AggregateFunction;
1449
+ aliasTemplate?: string;
1450
+ }
1451
+
1452
+ declare interface MetricField extends Field {
1453
+ role: 'metric';
1454
+ aggregate?: AggregateFunction;
1455
+ /**
1456
+ * Optional SQL expression for the metric (e.g., ship_date - order_date).
1457
+ * If present, used as aggregate(expression) instead of aggregate(name).
1458
+ */
1459
+ expression?: string;
1460
+ /**
1461
+ * Optional parameters for future extensibility (e.g., window functions).
1462
+ * * Example:
1463
+ * {
1464
+ aggregate: "SUM",
1465
+ name: "sales",
1466
+ parameters: {
1467
+ window: "PARTITION BY region ORDER BY date ROWS BETWEEN 1 PRECEDING AND CURRENT ROW"
1468
+ }
1469
+ }
1470
+
1471
+ {
1472
+ aggregate: "COUNT",
1473
+ name: "order_id",
1474
+ parameters: {
1475
+ filter: "status = 'Active'"
1476
+ }
1477
+ }
1478
+ */
1479
+ parameters?: {
1480
+ filters?: FilterGroup;
1481
+ windowTransform?: WindowTransform;
1482
+ };
1483
+ aliasTemplate?: string;
1484
+ valueAliases?: Record<string, string>;
1485
+ /**
1486
+ * Formula metadata for calculated fields (UI-only metadata)
1487
+ * This is supplementary data to help the UI display and edit calculated fields.
1488
+ * The `expression` field remains the source of truth for the backend.
1489
+ *
1490
+ * IMPORTANT: This metadata is ALWAYS updated atomically with the expression field.
1491
+ * Both are generated together from the same dialog inputs, preventing drift.
1492
+ */
1493
+ calculatedFormula?: CalculatedFieldFormula;
1494
+ /**
1495
+ * Indicates the metric expression must be evaluated after row-level filtering,
1496
+ * either because it contains an aggregate function directly or depends on a
1497
+ * pre-aggregated metric input.
1498
+ */
1499
+ isPreAggregated?: boolean;
1500
+ comparisonType?: 'none' | 'previous_period' | 'same_period_last_year' | 'start_vs_end' | 'target';
1501
+ comparisonDisplay?: 'column' | 'inline' | 'hover';
1502
+ targetValue?: number;
1503
+ }
1504
+
1505
+ declare type NoneOptions = {};
1506
+
377
1507
  export declare function normalizeBriefingContentDocument(input: unknown): BriefingContentDocument;
378
1508
 
379
1509
  export declare function normalizeBriefingDraft(input: unknown): CreateBriefingRequest;
380
1510
 
381
1511
  export declare function normalizeBriefingJobConfig(input: unknown): BriefingJobConfig;
382
1512
 
1513
+ declare type NumberAxisFormat = {
1514
+ decimalPlaces?: number;
1515
+ minimumFractionDigits?: number;
1516
+ maximumFractionDigits?: number;
1517
+ suffix?: string;
1518
+ currency?: string;
1519
+ locale?: string;
1520
+ useGrouping?: boolean;
1521
+ percentValueMode?: 'fraction' | 'whole';
1522
+ };
1523
+
1524
+ declare type NumberOptions = {
1525
+ locale: string;
1526
+ currency?: string;
1527
+ options: Intl.NumberFormatOptions;
1528
+ colorRanges?: ColorRange[];
1529
+ };
1530
+
1531
+ declare type OldFilterValue = string | number | null | (string | number)[] | RangeValue;
1532
+
1533
+ declare type Operation = '=' | '>' | '<' | '>=' | '<=' | '!=' | 'in' | 'not in' | 'like' | 'not like' | 'between' | 'not between' | 'is null' | 'is not null';
1534
+
1535
+ declare type Operator = '=' | '!=' | '>' | '>=' | '<' | '<=' | 'contains' | 'startsWith' | 'endsWith' | 'like' | 'not like' | 'in' | 'not in' | 'between' | 'not between' | 'isNull' | 'isNotNull';
1536
+
1537
+ declare type OptionsMap = {
1538
+ number: NumberOptions;
1539
+ string: StringOptions;
1540
+ date: DateOptions;
1541
+ html: HtmlOptions;
1542
+ none: NoneOptions;
1543
+ };
1544
+
1545
+ declare interface OrderBy {
1546
+ columnId: string;
1547
+ direction: 'asc' | 'desc';
1548
+ }
1549
+
1550
+ /**
1551
+ * Pagination configuration for table queries
1552
+ */
1553
+ declare interface PaginationConfig {
1554
+ page: number;
1555
+ pageSize: number;
1556
+ }
1557
+
1558
+ export declare function parseBriefingScheduleExpr(expression: string): {
1559
+ ok: true;
1560
+ value: BriefingScheduleViewModel;
1561
+ } | {
1562
+ ok: false;
1563
+ issue: string;
1564
+ };
1565
+
1566
+ declare type PersistedInteraction = Interaction & {
1567
+ id?: string;
1568
+ };
1569
+
1570
+ declare interface PivotByField extends Field {
1571
+ role: 'pivotby';
1572
+ }
1573
+
1574
+ declare interface QueryConfig {
1575
+ groupByColumns?: GroupByColumn[];
1576
+ pivotColumns?: GroupByColumn[];
1577
+ metricColumns?: MetricColumn[];
1578
+ filterColumns?: FilterByColumn[];
1579
+ filters?: QueryFilter[];
1580
+ limit?: number;
1581
+ orderBy?: OrderBy[];
1582
+ }
1583
+
1584
+ declare type QueryFilter = {
1585
+ filterColumnName: string;
1586
+ filterValue: OldFilterValue;
1587
+ };
1588
+
1589
+ declare type RangeValue = {
1590
+ gte?: string | number;
1591
+ lte?: string | number;
1592
+ lt?: string | number;
1593
+ gt?: string | number;
1594
+ };
1595
+
1596
+ declare type RelativeDateFilter = {
1597
+ mode: 'last';
1598
+ n: number;
1599
+ unit: SubDayDateUnit;
1600
+ complete?: false;
1601
+ } | {
1602
+ mode: 'last';
1603
+ n: number;
1604
+ unit: DateUnit;
1605
+ complete?: boolean;
1606
+ } | {
1607
+ mode: 'this';
1608
+ unit: DateUnit;
1609
+ toDate?: boolean;
1610
+ } | {
1611
+ mode: 'previous';
1612
+ unit: DateUnit;
1613
+ } | {
1614
+ mode: 'between';
1615
+ unit: DateUnit;
1616
+ from: number;
1617
+ to: number;
1618
+ };
1619
+
1620
+ declare type SelectedEntities = SelectedEntity[];
1621
+
1622
+ declare type SelectedEntity = DatabaseEntityReference | DataModelEntityReference | DatasetEntityReference | FileEntityReference;
1623
+
1624
+ declare type SemaphorAggregateFunction = 'SUM' | 'COUNT' | 'AVG' | 'MIN' | 'MAX' | 'MEDIAN' | 'DISTINCT';
1625
+
1626
+ declare type SemaphorAnalyticsFilter = SemaphorAnalyticsValueFilter | SemaphorAnalyticsNullFilter;
1627
+
1628
+ declare type SemaphorAnalyticsFilterBase = {
1629
+ id?: string;
1630
+ field: SemaphorFieldRef;
1631
+ /**
1632
+ * Controls where the filter is applied in an aggregate query.
1633
+ *
1634
+ * `row` means pre-aggregation filtering (`WHERE`).
1635
+ * `aggregate` means post-aggregation filtering (`HAVING`) and is valid only
1636
+ * for measure fields the execution engine can aggregate safely.
1637
+ */
1638
+ scope?: 'row' | 'aggregate';
1639
+ };
1640
+
1641
+ declare type SemaphorAnalyticsFilterOperator = SemaphorInputOperator | 'not_contains' | 'is_null' | 'is_not_null';
1642
+
1643
+ declare type SemaphorAnalyticsNullFilter = SemaphorAnalyticsFilterBase & {
1644
+ operator: SemaphorAnalyticsNullFilterOperator;
1645
+ values?: never;
1646
+ };
1647
+
1648
+ declare type SemaphorAnalyticsNullFilterOperator = 'is_null' | 'is_not_null';
1649
+
1650
+ declare type SemaphorAnalyticsValueFilter = SemaphorAnalyticsFilterBase & {
1651
+ operator?: SemaphorAnalyticsValueFilterOperator;
1652
+ values: unknown[];
1653
+ };
1654
+
1655
+ declare type SemaphorAnalyticsValueFilterOperator = Exclude<SemaphorAnalyticsFilterOperator, 'is_null' | 'is_not_null'>;
1656
+
1657
+ declare type SemaphorDerivedFieldAggregationBehavior = 'additive' | 'non_additive' | 'ratio_of_sums' | 'weighted' | 'pre_aggregated' | 'snapshot';
1658
+
1659
+ declare type SemaphorDerivedFieldAggregationStrategy = 'default' | 'symmetric_aggregate' | 'aggregate_then_join' | 'weighted';
1660
+
1661
+ declare type SemaphorDerivedFieldComputeStage = 'row' | 'aggregate';
1662
+
1663
+ declare type SemaphorDerivedFieldDefinition = {
1664
+ kind: 'derived_field';
1665
+ name: string;
1666
+ label: string;
1667
+ description?: string;
1668
+ resultRole: SemaphorDerivedFieldResultRole;
1669
+ dataType: NonNullable<SemaphorFieldRef['dataType']>;
1670
+ computeStage: SemaphorDerivedFieldComputeStage;
1671
+ expression: string;
1672
+ expressionLanguage?: 'semaphor_sql_template';
1673
+ inputs: Record<string, SemaphorDerivedFieldInput>;
1674
+ defaultAggregate?: SemaphorAggregateFunction;
1675
+ aggregationBehavior?: SemaphorDerivedFieldAggregationBehavior;
1676
+ aggregationStrategy?: SemaphorDerivedFieldAggregationStrategy;
1677
+ format?: SemaphorValueFormat;
1678
+ tags?: string[];
1679
+ };
1680
+
1681
+ declare type SemaphorDerivedFieldInput = {
1682
+ kind: 'field';
1683
+ field: SemaphorFieldRef;
1684
+ aggregate?: SemaphorAggregateFunction;
1685
+ };
1686
+
1687
+ declare type SemaphorDerivedFieldResultRole = 'measure' | 'dimension' | 'date' | 'id' | 'unknown';
1688
+
1689
+ declare type SemaphorDialect = 'postgres' | 'mysql' | 'mssql' | 'snowflake' | 'clickhouse' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
1690
+
1691
+ /**
1692
+ * Explorer-backed table source. This is intentionally distinct from raw SQL:
1693
+ * matrix planning needs stable source metadata, fields, and dialect context.
1694
+ */
1695
+ declare type SemaphorExplorerSourceRef = Extract<SemaphorSourceRef, {
1696
+ kind: 'physical';
1697
+ }>;
1698
+
1699
+ declare type SemaphorFieldRef = {
1700
+ name: string;
1701
+ label?: string;
1702
+ role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
1703
+ dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
1704
+ source?: SemaphorSourceRef;
1705
+ aggregate?: SemaphorAggregateFunction;
1706
+ };
1707
+
1708
+ declare type SemaphorInputBinding = {
1709
+ inputId: string;
1710
+ kind?: 'filter' | 'control';
1711
+ controlRole?: 'grain' | 'measure' | 'dimension' | 'aggregation' | 'sqlParam';
1712
+ operator?: SemaphorInputOperator;
1713
+ field?: SemaphorFieldRef;
1714
+ relationshipHint?: SemaphorRelationshipHint;
1715
+ };
1716
+
1717
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'not_contains' | 'between' | 'not_between' | '>' | '>=' | '<' | '<=';
1718
+
1719
+ declare type SemaphorMatrixAxisExpansionOptions = {
1720
+ defaultDepth?: number;
1721
+ lazy?: boolean;
1722
+ expandedPaths?: SemaphorMatrixMemberPathSegment[][];
1723
+ };
1724
+
1725
+ declare type SemaphorMatrixAxisLevel = {
1726
+ id?: string;
1727
+ field: SemaphorFieldRef;
1728
+ grain?: SemaphorTimeGrain;
1729
+ label?: string;
1730
+ subtotal?: boolean | SemaphorMatrixSubtotalOptions;
1731
+ sortBy?: SemaphorMatrixAxisSortRule;
1732
+ };
1733
+
1734
+ declare type SemaphorMatrixAxisSortRule = {
1735
+ direction: 'asc' | 'desc';
1736
+ by: {
1737
+ kind: 'label';
1738
+ } | {
1739
+ kind: 'field';
1740
+ field: SemaphorFieldRef;
1741
+ aggregate?: SemaphorAggregateFunction;
1742
+ };
1743
+ nulls?: 'warehouseDefault' | 'first' | 'last';
1744
+ scope?: 'global' | 'withinParent';
1745
+ };
1746
+
1747
+ declare type SemaphorMatrixDisplayLimitOptions = {
1748
+ rows?: SemaphorMatrixDisplayLimitRule;
1749
+ columns?: SemaphorMatrixDisplayLimitRule;
1750
+ };
1751
+
1752
+ declare type SemaphorMatrixDisplayLimitRule = {
1753
+ limit: number;
1754
+ };
1755
+
1756
+ declare type SemaphorMatrixExpansionOptions = {
1757
+ rows?: SemaphorMatrixAxisExpansionOptions;
1758
+ columns?: SemaphorMatrixAxisExpansionOptions;
1759
+ };
1760
+
1761
+ declare type SemaphorMatrixIntent = {
1762
+ kind: 'matrix';
1763
+ version?: SemaphorProtocolVersion;
1764
+ id?: string;
1765
+ label?: string;
1766
+ source: SemaphorMatrixSourceRef;
1767
+ rows: SemaphorMatrixAxisLevel[];
1768
+ columns?: SemaphorMatrixAxisLevel[];
1769
+ values: SemaphorMatrixValueField[];
1770
+ filters?: SemaphorAnalyticsFilter[];
1771
+ inputs?: SemaphorInputBinding[];
1772
+ relationshipHint?: SemaphorRelationshipHint;
1773
+ totals?: SemaphorMatrixTotalOptions;
1774
+ sort?: SemaphorMatrixSortRule[];
1775
+ expansion?: SemaphorMatrixExpansionOptions;
1776
+ layout?: SemaphorMatrixLayoutOptions;
1777
+ displayLimits?: SemaphorMatrixDisplayLimitOptions;
1778
+ };
1779
+
1780
+ declare type SemaphorMatrixLayoutOptions = {
1781
+ hierarchy?: 'compact' | 'tabular' | 'outline';
1782
+ valuesPlacement?: 'columns' | 'rows';
1783
+ stickyRowHeaders?: boolean;
1784
+ stickyColumnHeaders?: boolean;
1785
+ };
1786
+
1787
+ declare type SemaphorMatrixMemberPathSegment = {
1788
+ levelId: string;
1789
+ value: unknown;
1790
+ };
1791
+
1792
+ declare type SemaphorMatrixSortRule = {
1793
+ axis: 'row' | 'column';
1794
+ targetId?: string;
1795
+ direction: 'asc' | 'desc';
1796
+ by: {
1797
+ kind: 'label';
1798
+ } | {
1799
+ kind: 'field';
1800
+ field: SemaphorFieldRef;
1801
+ aggregate?: SemaphorAggregateFunction;
1802
+ } | {
1803
+ kind: 'value';
1804
+ valueId: string;
1805
+ rowPath?: SemaphorMatrixMemberPathSegment[];
1806
+ columnPath?: SemaphorMatrixMemberPathSegment[];
1807
+ };
1808
+ nulls?: 'warehouseDefault' | 'first' | 'last';
1809
+ scope?: 'global' | 'withinParent';
1810
+ };
1811
+
1812
+ declare type SemaphorMatrixSourceRef = SemaphorSemanticSourceRef | SemaphorExplorerSourceRef;
1813
+
1814
+ declare type SemaphorMatrixSubtotalOptions = {
1815
+ enabled?: boolean;
1816
+ position?: 'before' | 'after';
1817
+ label?: string;
1818
+ };
1819
+
1820
+ declare type SemaphorMatrixTotalCalculation = {
1821
+ kind: 'defaultAggregate';
1822
+ } | {
1823
+ kind: 'blank';
1824
+ } | {
1825
+ kind: 'labelOnly';
1826
+ label?: string;
1827
+ } | {
1828
+ kind: 'customAggregate';
1829
+ aggregate: SemaphorAggregateFunction;
1830
+ } | {
1831
+ kind: 'percentOfParent';
1832
+ } | {
1833
+ kind: 'percentOfGrandTotal';
1834
+ } | {
1835
+ kind: 'customExpression';
1836
+ expressionId: string;
1837
+ };
1838
+
1839
+ declare type SemaphorMatrixTotalOptions = {
1840
+ rows?: boolean | 'perLevel';
1841
+ columns?: boolean | 'perLevel';
1842
+ grandTotal?: boolean | {
1843
+ rows?: boolean;
1844
+ columns?: boolean;
1845
+ };
1846
+ rowPosition?: 'top' | 'bottom';
1847
+ columnPosition?: 'left' | 'right';
1848
+ };
1849
+
1850
+ declare type SemaphorMatrixValueField = {
1851
+ id?: string;
1852
+ field: SemaphorFieldRef;
1853
+ aggregate?: SemaphorAggregateFunction;
1854
+ label?: string;
1855
+ format?: SemaphorValueFormat;
1856
+ totalBehavior?: SemaphorMatrixTotalCalculation;
1857
+ };
1858
+
1859
+ declare type SemaphorProtocolVersion = 1;
1860
+
1861
+ declare type SemaphorRelationshipHint = {
1862
+ relationshipIds?: string[];
1863
+ };
1864
+
1865
+ declare type SemaphorSemanticSourceRef = Extract<SemaphorSourceRef, {
1866
+ kind: 'semantic';
1867
+ }>;
1868
+
1869
+ declare type SemaphorSourceRef = {
1870
+ kind: 'semantic';
1871
+ domainId: string;
1872
+ datasetName: string;
1873
+ datasetId?: string;
1874
+ label?: string;
1875
+ connectionId?: string;
1876
+ } | {
1877
+ kind: 'physical';
1878
+ connectionId: string;
1879
+ connectionType?: string;
1880
+ tableName: string;
1881
+ databaseName?: string;
1882
+ schemaName?: string;
1883
+ label?: string;
1884
+ dialect?: SemaphorDialect;
1885
+ } | {
1886
+ kind: 'sql';
1887
+ connectionId: string;
1888
+ dialect?: SemaphorDialect;
1889
+ label?: string;
1890
+ };
1891
+
1892
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
1893
+
1894
+ declare type SemaphorValueFormat = {
1895
+ type: 'number' | 'currency' | 'percent' | 'percentage' | 'scientific';
1896
+ locale?: string;
1897
+ minimumFractionDigits?: number;
1898
+ maximumFractionDigits?: number;
1899
+ useGrouping?: boolean;
1900
+ prefix?: string;
1901
+ suffix?: string;
1902
+ negativeStyle?: 'minus' | 'parentheses';
1903
+ compact?: boolean;
1904
+ scale?: number;
1905
+ currency?: string;
1906
+ percentValueMode?: 'fraction' | 'whole';
1907
+ } | {
1908
+ type: 'date' | 'datetime';
1909
+ locale?: string;
1910
+ pattern?: string;
1911
+ relative?: boolean;
1912
+ timezone?: string;
1913
+ sourceTimezone?: string;
1914
+ prefix?: string;
1915
+ suffix?: string;
1916
+ } | {
1917
+ type: 'duration';
1918
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1919
+ outputStyle?: 'compact' | 'digital' | 'long';
1920
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1921
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1922
+ maxUnits?: number;
1923
+ prefix?: string;
1924
+ suffix?: string;
1925
+ negativeStyle?: 'minus' | 'parentheses';
1926
+ } | {
1927
+ type: 'string';
1928
+ prefix?: string;
1929
+ suffix?: string;
1930
+ };
1931
+
1932
+ declare interface SortByField extends Field {
1933
+ role: 'sortby';
1934
+ direction: 'asc' | 'desc';
1935
+ }
1936
+
1937
+ declare type SqlQueryControlSource = {
1938
+ kind: 'sql_query';
1939
+ connectionId: string;
1940
+ sql: string;
1941
+ valueColumn: string;
1942
+ labelColumn?: string;
1943
+ };
1944
+
1945
+ declare type StringOptions = {
1946
+ maxLength?: number;
1947
+ };
1948
+
1949
+ declare type StructuralFieldSelectorTarget = GroupByField;
1950
+
1951
+ declare type StructuralMetricSelectorTarget = MetricField;
1952
+
1953
+ declare type SubDayDateUnit = 'minute' | 'hour';
1954
+
1955
+ declare type TableBaseFormatting = {
1956
+ version: TableFormattingVersion;
1957
+ tableParts?: Partial<Record<TablePart, TableBaseStyle>>;
1958
+ columns?: Record<string, {
1959
+ body?: TableBaseStyle;
1960
+ header?: TableBaseStyle;
1961
+ footer?: TableBaseStyle;
1962
+ }>;
1963
+ };
1964
+
1965
+ declare type TableBaseStyle = {
1966
+ fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold';
1967
+ italic?: boolean;
1968
+ textColor?: string;
1969
+ backgroundColor?: string;
1970
+ textDecoration?: 'none' | 'underline' | 'line-through';
1971
+ };
1972
+
1973
+ declare type TableConditionalFormatting = {
1974
+ version: TableFormattingVersion;
1975
+ rules: ConditionalFormatRule[];
1976
+ };
1977
+
1978
+ /**
1979
+ * Row rhythm for the whole table. Authors pick one per card; undefined
1980
+ * falls back to 'compact' (the canonical default — dense scanning, matches
1981
+ * the Linear-style spec). Drives row padding, cell font size, and header
1982
+ * font size via a shared density spec in DataTable.
1983
+ */
1984
+ declare type TableDensity = 'dense' | 'compact' | 'standard' | 'comfortable' | 'spacious';
1985
+
1986
+ declare type TableFormattingVersion = 1;
1987
+
1988
+ declare type TableGridLines = 'none' | 'outer' | 'inner' | 'horizontal' | 'vertical' | 'top' | 'right' | 'bottom' | 'left' | 'full';
1989
+
1990
+ declare type TableHeaderStyle = 'plain' | 'filled' | 'accent';
1991
+
1992
+ declare type TablePart = 'body' | 'header' | 'footer' | 'subtotal' | 'grandTotal';
1993
+
1994
+ declare type TablePreferences = {
1995
+ columnSettingsMap?: ColumnSettingsMap;
1996
+ baseFormatting?: TableBaseFormatting;
1997
+ conditionalFormatting?: TableConditionalFormatting;
1998
+ selectColumnVisible?: boolean;
1999
+ columnVisibility?: Record<string, boolean>;
2000
+ columnSizing?: ColumnSizingState;
2001
+ pageSize?: number;
2002
+ enableDevModePagination?: boolean;
2003
+ forceClientPagination?: boolean;
2004
+ density?: TableDensity;
2005
+ tableStyle?: TableStylePreferences;
2006
+ };
2007
+
2008
+ declare type TableStylePreferences = {
2009
+ headerStyle?: TableHeaderStyle;
2010
+ headerBackgroundColor?: string;
2011
+ headerTextColor?: string;
2012
+ headerWrapText?: boolean;
2013
+ stripedRows?: boolean;
2014
+ gridLines?: TableGridLines;
2015
+ wrapText?: boolean;
2016
+ totals?: TableTotalsStylePreferences;
2017
+ };
2018
+
2019
+ declare type TableTotalsFontWeight = 'normal' | 'medium' | 'semibold' | 'bold';
2020
+
2021
+ declare type TableTotalsStylePreferences = {
2022
+ enabled?: boolean;
2023
+ backgroundColor?: string;
2024
+ textColor?: string;
2025
+ fontWeight?: TableTotalsFontWeight;
2026
+ borderTop?: boolean;
2027
+ borderTopStyle?: 'solid' | 'dashed' | 'dotted' | 'double';
2028
+ borderTopColor?: string;
2029
+ };
2030
+
2031
+ /** Global bar style configuration */
2032
+ declare type TBarStyleConfig = {
2033
+ /** Default border radius for all bars - 0-20 pixels */
2034
+ borderRadius?: number;
2035
+ /** Default border width for all bars - 0-5 pixels */
2036
+ borderWidth?: number;
2037
+ /** Default bar width as percentage of category width (0.1-1.0) */
2038
+ barPercentage?: number;
2039
+ /** Default category width as percentage of available space (0.1-1.0) */
2040
+ categoryPercentage?: number;
2041
+ };
2042
+
2043
+ declare type TBubbleScatterConfig = {
2044
+ /**
2045
+ * Explicit key for X-axis metric. Falls back to auto-detection.
2046
+ */
2047
+ xMetricKey?: string;
2048
+ /**
2049
+ * Explicit key for Y-axis metric. Falls back to auto-detection.
2050
+ */
2051
+ yMetricKey?: string;
2052
+ /**
2053
+ * Explicit key for radius metric (bubble only). Falls back to auto-detection.
2054
+ */
2055
+ radiusMetricKey?: string;
2056
+ /**
2057
+ * Key for point labels (first dimension).
2058
+ */
2059
+ labelKey?: string;
2060
+ /**
2061
+ * Whether to group points into series. Defaults to auto-detect in card config mode.
2062
+ */
2063
+ enableGrouping?: boolean;
2064
+ /**
2065
+ * Key for series grouping. Can be any data type (string, number, date).
2066
+ */
2067
+ groupKey?: string;
2068
+ /**
2069
+ * Scaling mode for bubble radius.
2070
+ */
2071
+ radiusScale?: 'linear' | 'sqrt' | 'fixed';
2072
+ /**
2073
+ * Fixed radius value when radiusScale is 'fixed' or for scatter charts.
2074
+ */
2075
+ fixedRadius?: number;
2076
+ /**
2077
+ * Minimum radius for bubble scaling.
2078
+ */
2079
+ minRadius?: number;
2080
+ /**
2081
+ * Maximum radius for bubble scaling.
2082
+ */
2083
+ maxRadius?: number;
2084
+ };
2085
+
2086
+ declare type TBulletConfig = {
2087
+ /**
2088
+ * Orientation of the bullet chart. Defaults to horizontal.
2089
+ */
2090
+ orientation?: 'horizontal' | 'vertical';
2091
+ /**
2092
+ * Explicit metric key to use for target markers. Falls back to the next metric column.
2093
+ */
2094
+ targetMetricKey?: string;
2095
+ /**
2096
+ * Optional comparative metric (e.g., previous period).
2097
+ */
2098
+ comparativeMetricKey?: string;
2099
+ /**
2100
+ * When true, disables automatic comparative assignment even if a metric exists.
2101
+ */
2102
+ disableAutoComparative?: boolean;
2103
+ /**
2104
+ * Mapping of qualitative range names to column keys.
2105
+ */
2106
+ rangeKeys?: TBulletRangeKeys;
2107
+ /**
2108
+ * Static range values if columns are not provided.
2109
+ */
2110
+ ranges?: TBulletRangeValues;
2111
+ /**
2112
+ * Global target value if a column is not provided.
2113
+ */
2114
+ targetValue?: number;
2115
+ /**
2116
+ * Show numeric labels on the actual bar. Default true.
2117
+ */
2118
+ showValueLabels?: boolean;
2119
+ /**
2120
+ * Treat provided range values as percentages (0-1) when true.
2121
+ */
2122
+ rangesArePercentages?: boolean;
2123
+ /**
2124
+ * Whether qualitative ranges should be rendered.
2125
+ */
2126
+ showRanges?: boolean;
2127
+ /**
2128
+ * Display labels for qualitative ranges.
2129
+ */
2130
+ rangeLabels?: TBulletRangeLabelOverrides;
2131
+ };
2132
+
2133
+ declare type TBulletRangeKeys = Partial<Record<TBulletRangeLabels, string>>;
2134
+
2135
+ declare type TBulletRangeLabelOverrides = Partial<Record<TBulletRangeLabels, string>>;
2136
+
2137
+ declare type TBulletRangeLabels = 'poor' | 'satisfactory' | 'good';
2138
+
2139
+ declare type TBulletRangeValues = Partial<Record<TBulletRangeLabels, number>>;
2140
+
2141
+ declare type TCard = {
2142
+ id: string;
2143
+ title: string;
2144
+ tabTitle?: string;
2145
+ displayTab?: boolean;
2146
+ description?: string;
2147
+ info?: string;
2148
+ connectionId?: string;
2149
+ datamodelId?: string;
2150
+ type: TChartType;
2151
+ sql?: string;
2152
+ python?: string;
2153
+ dataSource?: DataSource;
2154
+ config?: CardConfig;
2155
+ interactionConfig?: CardInteractionConfig;
2156
+ linkedSourceCardId?: string;
2157
+ linkedInteractionTargetOverrides?: Record<string, InteractionTargetOverride>;
2158
+ paginationConfig?: PaginationConfig;
2159
+ queryConfig?: QueryConfig;
2160
+ customCfg?: any;
2161
+ preferences?: TCardPreferences;
2162
+ customCardPreferences?: TCustomCardPreferences;
2163
+ visualizationMode?: TVisualizationMode;
2164
+ dynamicCardPreferences?: TDynamicCardPreferences;
2165
+ lastSelectedDatabase?: string;
2166
+ lastSelectedDatamodelId?: string;
2167
+ lastSelectedSchema?: string;
2168
+ lastSelectedTable?: string;
2169
+ refreshInterval?: string;
2170
+ /**
2171
+ * Card-specific display preferences that override dashboard-level preferences.
2172
+ * If not specified, the card will use the dashboard's display preferences.
2173
+ */
2174
+ displayPreferences?: VisualDisplayPreferences;
2175
+ /**
2176
+ * Inline filter definitions for this card.
2177
+ * Configured by editors via the visual editor settings.
2178
+ */
2179
+ inlineFilters?: TInlineFilter[];
2180
+ /**
2181
+ * Card-scoped calculated fields that should remain available even when they
2182
+ * are not actively selected in the chart configuration.
2183
+ */
2184
+ calculatedFields?: Field[];
2185
+ /**
2186
+ * Card-scoped control definitions for this card.
2187
+ */
2188
+ controls?: ControlDefinition[];
2189
+ /**
2190
+ * Per-card bindings that connect dashboard or card controls to this card's runtime targets.
2191
+ */
2192
+ controlBindings?: ControlBinding[];
2193
+ };
2194
+
2195
+ declare type TCardPreferences = {
2196
+ onClickFilter?: FilterOnClick[];
2197
+ filterOnClick?: boolean;
2198
+ filterOnClickField?: string;
2199
+ filterOnClickColumnIndex?: number;
2200
+ sortChart?: 'asc' | 'desc' | 'none';
2201
+ formatNumber?: {
2202
+ decimalPlaces?: number;
2203
+ minimumFractionDigits?: number;
2204
+ maximumFractionDigits?: number;
2205
+ currency?: string;
2206
+ locale?: string;
2207
+ suffix?: string;
2208
+ prefix?: string;
2209
+ useGrouping?: boolean;
2210
+ percentValueMode?: 'fraction' | 'whole';
2211
+ enabled?: boolean | string;
2212
+ colorRanges?: ColorRange[];
2213
+ };
2214
+ numberAxisFormat?: NumberAxisFormat;
2215
+ datasetOptions?: TDatasetOptions[];
2216
+ chartOptions?: TChartOptions;
2217
+ columnSettings?: TColumnSetting<DisplayDataType>[];
2218
+ colorConfig?: ColorConfig;
2219
+ xAxisConfig?: AxisConfig;
2220
+ yAxisConfig?: AxisConfig;
2221
+ secondaryYAxisConfig?: AxisConfig;
2222
+ tooltipConfig?: TTooltipFormatConfig;
2223
+ dataLabelsConfig?: TDataLabelsConfig;
2224
+ bulletConfig?: TBulletConfig;
2225
+ heatmapConfig?: THeatmapConfig;
2226
+ bubbleScatterConfig?: TBubbleScatterConfig;
2227
+ funnelConfig?: TFunnelConfig;
2228
+ /** Global line/point style defaults for line and area charts */
2229
+ lineStyleConfig?: {
2230
+ lineStyle?: TLineStyle;
2231
+ pointRadius?: number;
2232
+ pointStyle?: TPointStyle;
2233
+ };
2234
+ /** Global bar style defaults for bar charts */
2235
+ barStyleConfig?: TBarStyleConfig;
2236
+ tablePrefs?: TablePreferences;
2237
+ allowDownload?: boolean;
2238
+ customVisualCode?: string;
2239
+ textVisualOptions?: {
2240
+ isDynamicText?: boolean;
2241
+ /**
2242
+ * Legacy structured content with dashboard-input variable refs.
2243
+ * Authored via the plain-text ContentEditableText editor. New cards
2244
+ * use `richContent` instead; this stays for backward compatibility
2245
+ * and is never set on a card that has `richContent`.
2246
+ */
2247
+ content?: DashboardInputTextContent;
2248
+ /**
2249
+ * Editor-agnostic rich content authored via the Lexical-based
2250
+ * editor. When this is present, the card renders via the rich-
2251
+ * content path on both the dashboard surface and inside the visual
2252
+ * editor. When absent (and `description` is set), the card falls
2253
+ * back to the legacy HTML-string render path.
2254
+ */
2255
+ richContent?: TextCardRichContent;
2256
+ };
2257
+ mapVisualOptions?: {
2258
+ topoJsonUrl?: string;
2259
+ objectKey?: string;
2260
+ outlineKey?: string;
2261
+ customTopoJsonUrl?: string;
2262
+ projection?: string;
2263
+ projectionScale?: number;
2264
+ projectionOffset?: [number, number];
2265
+ colorScale?: string;
2266
+ };
2267
+ kpiVisualOptions?: {
2268
+ lowerIsBetter?: boolean;
2269
+ countryLogoId?: string;
2270
+ valueAlignment?: 'left' | 'center';
2271
+ formatOptions?: TFormatOptions;
2272
+ metricComparison?: {
2273
+ enabled?: boolean;
2274
+ calculationType?: 'difference' | 'change' | 'change_difference' | 'ratio';
2275
+ formatOptions?: TFormatOptions;
2276
+ showArrow?: boolean;
2277
+ showColor?: boolean;
2278
+ conditionalLabel?: boolean;
2279
+ labelName?: string;
2280
+ position?: 'left' | 'right' | 'top';
2281
+ conditionalLabels?: {
2282
+ increase?: string;
2283
+ decrease?: string;
2284
+ noChange?: string;
2285
+ };
2286
+ colorConfig?: {
2287
+ increase?: 'green' | 'red' | 'neutral' | string;
2288
+ decrease?: 'green' | 'red' | 'neutral' | string;
2289
+ noChange?: 'green' | 'red' | 'neutral' | string;
2290
+ };
2291
+ };
2292
+ };
2293
+ tableVisualOptions?: {
2294
+ metricComparison?: {
2295
+ calculatedAs?: 'difference' | 'change' | 'change_difference' | 'ratio';
2296
+ indicatorStyle?: 'arrow_badge' | 'arrow' | 'badge' | 'none';
2297
+ formatOptions?: TFormatOptions;
2298
+ colors?: {
2299
+ increase?: 'green' | 'red' | 'neutral' | string;
2300
+ decrease?: 'green' | 'red' | 'neutral' | string;
2301
+ neutral?: 'green' | 'red' | 'neutral' | string;
2302
+ };
2303
+ lowerIsBetter?: boolean;
2304
+ };
2305
+ };
2306
+ pivotTableOptions?: {
2307
+ showRowTotals?: boolean;
2308
+ showColumnTotals?: boolean;
2309
+ showGrandTotal?: boolean;
2310
+ sortRowsBy?: 'label' | 'total' | 'metric';
2311
+ sortColumnsBy?: 'label' | 'total' | 'metric';
2312
+ };
2313
+ displayOptions?: {
2314
+ showFilterInfo?: boolean;
2315
+ showCardToolbar?: boolean;
2316
+ showChrome?: boolean;
2317
+ allowScroll?: boolean;
2318
+ showInlineFilterBar?: boolean;
2319
+ };
2320
+ };
2321
+
2322
+ declare type TChartOptions = {
2323
+ type?: TChartType;
2324
+ scales?: {
2325
+ y?: {
2326
+ type?: 'linear' | 'logarithmic';
2327
+ min?: number;
2328
+ max?: number;
2329
+ ticks?: {
2330
+ stepSize?: number;
2331
+ };
2332
+ grid?: {
2333
+ display?: boolean;
2334
+ };
2335
+ };
2336
+ x?: {
2337
+ type?: 'linear' | 'logarithmic';
2338
+ min?: number;
2339
+ max?: number;
2340
+ ticks?: {
2341
+ stepSize?: number;
2342
+ };
2343
+ grid?: {
2344
+ display?: boolean;
2345
+ };
2346
+ };
2347
+ };
2348
+ indexAxis?: 'x' | 'y' | undefined;
2349
+ plugins?: {
2350
+ legend?: TLegendOptions;
2351
+ datalabels?: {
2352
+ anchor?: string;
2353
+ };
2354
+ };
2355
+ treemapColorMode?: 'branch' | 'category';
2356
+ };
2357
+
2358
+ declare type TChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'stackedArea' | 'combo' | 'pie' | 'doughnut' | 'radar' | 'polarArea' | 'bubble' | 'scatter' | 'stackedBar' | 'stackedLine' | 'table' | 'pivotTable' | 'aggregateTable' | 'matrixTable' | 'detailTable' | 'tableBuilder' | 'kpi' | 'pyramid' | 'tornado' | 'range' | 'text' | 'map' | 'funnel' | 'bullet' | 'heatmap' | 'treemap' | 'custom';
2359
+
2360
+ declare type TColumnSetting<T extends DisplayDataType> = {
2361
+ columnIdx: number;
2362
+ textAlign?: 'left' | 'center' | 'right';
2363
+ width?: number;
2364
+ type: T;
2365
+ options: OptionsMap[T];
2366
+ };
2367
+
2368
+ declare type TCustomCardPreferences = {
2369
+ showCardHeader?: boolean;
2370
+ url?: string;
2371
+ componentName?: string;
2372
+ icon?: string;
2373
+ pluginChartType?: string;
2374
+ type?: 'iframe' | 'component';
2375
+ visualType?: 'single' | 'multiple';
2376
+ minInputs?: number;
2377
+ maxInputs?: number;
2378
+ slotIndex?: number;
2379
+ settings?: any;
2380
+ slotSettings?: any;
2381
+ /** @deprecated Use position-based data collection. Kept for legacy dashboard support. */
2382
+ dataInputCardIds?: {
2383
+ [key: number]: {
2384
+ cardId: string;
2385
+ };
2386
+ };
2387
+ };
2388
+
2389
+ declare type TCustomFilterPreferences = {
2390
+ url: string;
2391
+ componentName: string;
2392
+ pluginFilterType?: string;
2393
+ icon?: string;
2394
+ settings?: Record<string, string | number | boolean>;
2395
+ };
2396
+
2397
+ declare type TDataLabelsConfig = {
2398
+ enabled?: boolean;
2399
+ position?: 'center' | 'top' | 'bottom' | 'left' | 'right' | 'auto' | 'custom';
2400
+ anchor?: 'center' | 'start' | 'end';
2401
+ align?: 'center' | 'start' | 'end' | 'top' | 'bottom' | number;
2402
+ display?: 'auto' | boolean;
2403
+ formatMode?: 'inherit' | 'override';
2404
+ /** @deprecated Use formatMode + formatOptions.type */
2405
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2406
+ formatOptions?: TFormatOptions;
2407
+ font?: {
2408
+ size?: number;
2409
+ weight?: 'normal' | 'bold';
2410
+ };
2411
+ color?: 'auto' | string;
2412
+ clamp?: boolean;
2413
+ clip?: boolean;
2414
+ rotation?: number;
2415
+ showTotal?: boolean;
2416
+ offset?: number;
2417
+ };
2418
+
2419
+ declare type TDatasetOptions = {
2420
+ idx: number;
2421
+ type?: 'bar' | 'line';
2422
+ fill?: string | number;
2423
+ /** Y-axis assignment for combo charts: 'y' (primary/left) or 'y2' (secondary/right) */
2424
+ yAxisId?: 'y' | 'y2';
2425
+ /** Per-series data labels configuration - uses full TDataLabelsConfig for feature parity */
2426
+ dataLabels?: TDataLabelsConfig;
2427
+ /** Point radius (size) for line/area charts - 0 hides points */
2428
+ pointRadius?: number;
2429
+ /** Point shape style for line/area charts */
2430
+ pointStyle?: TPointStyle;
2431
+ /** Point radius on hover - defaults to pointRadius + 2 */
2432
+ pointHoverRadius?: number;
2433
+ /** Line dash style for line/area charts */
2434
+ lineStyle?: TLineStyle;
2435
+ /** Border radius (rounded corners) for bar charts - 0-20 pixels */
2436
+ borderRadius?: number;
2437
+ /** Border width for bar charts - 0-5 pixels */
2438
+ barBorderWidth?: number;
2439
+ /** Bar width as percentage of category width (0.1-1.0) */
2440
+ barPercentage?: number;
2441
+ /** Category width as percentage of available space (0.1-1.0) */
2442
+ categoryPercentage?: number;
2443
+ /** @deprecated Use dataLabels instead */
2444
+ datalabels?: {
2445
+ display?: boolean;
2446
+ align?: string;
2447
+ anchor?: string;
2448
+ clamp?: boolean;
2449
+ color?: string;
2450
+ };
2451
+ };
2452
+
2453
+ declare type TDynamicCardPreferences = {
2454
+ renderer: 'dynamic-visual';
2455
+ artifactId?: string;
2456
+ parentArtifactId?: string;
2457
+ title?: string;
2458
+ rendererCode?: string;
2459
+ question?: string;
2460
+ provenance?: 'card-config' | 'query_spec' | 'sql' | 'sql+python';
2461
+ visualIntent?: TDynamicVisualIntent;
2462
+ assistantNote?: string;
2463
+ builtinDisplayOptions?: {
2464
+ showChrome?: boolean;
2465
+ allowScroll?: boolean;
2466
+ };
2467
+ fallback: TDynamicVisualFallback;
2468
+ error?: {
2469
+ stage: string;
2470
+ message: string;
2471
+ details?: string[];
2472
+ };
2473
+ };
2474
+
2475
+ declare type TDynamicVisualFallback = {
2476
+ mode: 'chart' | 'table';
2477
+ chartType?: TChartType;
2478
+ reason: string;
2479
+ };
2480
+
2481
+ declare type TDynamicVisualIntent = {
2482
+ primaryChartType?: TChartType | 'custom';
2483
+ layout: 'chart-only' | 'composite';
2484
+ includesKpis: boolean;
2485
+ };
2486
+
2487
+ declare type TextCardInlineFormat = {
2488
+ bold?: boolean;
2489
+ italic?: boolean;
2490
+ };
2491
+
2492
+ declare type TextCardRichBlock = {
2493
+ type: 'paragraph';
2494
+ children: TextCardRichInline[];
2495
+ } | {
2496
+ type: 'heading';
2497
+ level: 1 | 2;
2498
+ children: TextCardRichInline[];
2499
+ } | {
2500
+ type: 'list';
2501
+ style: 'bulleted' | 'numbered';
2502
+ items: TextCardRichInline[][];
2503
+ };
2504
+
2505
+ declare type TextCardRichContent = {
2506
+ version: 1;
2507
+ blocks: TextCardRichBlock[];
2508
+ };
2509
+
2510
+ declare type TextCardRichInline = {
2511
+ type: 'text';
2512
+ value: string;
2513
+ format?: TextCardInlineFormat;
2514
+ } | {
2515
+ type: 'variable';
2516
+ ref: DashboardInputVariableRef;
2517
+ format?: TextCardInlineFormat;
2518
+ } | {
2519
+ type: 'link';
2520
+ url: string;
2521
+ children: Array<{
2522
+ type: 'text';
2523
+ value: string;
2524
+ format?: TextCardInlineFormat;
2525
+ } | {
2526
+ type: 'variable';
2527
+ ref: DashboardInputVariableRef;
2528
+ format?: TextCardInlineFormat;
2529
+ }>;
2530
+ };
2531
+
2532
+ declare type TFormatOptions = {
2533
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2534
+ decimalPlaces?: number;
2535
+ minimumFractionDigits?: number;
2536
+ maximumFractionDigits?: number;
2537
+ currency?: string;
2538
+ locale?: string;
2539
+ prefix?: string;
2540
+ suffix?: string;
2541
+ useSuffix?: boolean;
2542
+ useGrouping?: boolean;
2543
+ negativeInParentheses?: boolean;
2544
+ multiplyBy?: number;
2545
+ percentValueMode?: 'fraction' | 'whole';
2546
+ dateFormat?: string;
2547
+ timezone?: string;
2548
+ sourceTimezone?: string;
2549
+ relative?: boolean;
2550
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2551
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2552
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2553
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2554
+ durationMaxUnits?: number;
2555
+ };
2556
+
2557
+ declare type TFunnelConfig = {
2558
+ /**
2559
+ * How to calculate percentage in tooltips and data labels.
2560
+ * - 'percentOfTotal': Each stage shows % of total sum (default/current behavior)
2561
+ * - 'percentOfFirst': First stage = 100%, others relative to first
2562
+ */
2563
+ percentMode?: TFunnelPercentMode;
2564
+ /**
2565
+ * Controls how much funnel segments narrow based on their values.
2566
+ * - 0: No shrink (all segments same width)
2567
+ * - 1: Full shrink (segments narrow proportionally to values, default)
2568
+ * Lower values prevent segments from becoming too narrow for labels.
2569
+ */
2570
+ shrinkFraction?: number;
2571
+ /**
2572
+ * Hide labels for segments smaller than this percentage of total.
2573
+ * - 0: Show all labels (default)
2574
+ * - 10: Hide labels for segments < 10% of total
2575
+ * Range: 0-25
2576
+ */
2577
+ labelThreshold?: number;
2578
+ };
2579
+
2580
+ /**
2581
+ * Tooltip/data label percentage calculation mode for funnel charts.
2582
+ * - 'percentOfTotal': Percentage relative to sum of all values (default)
2583
+ * - 'percentOfFirst': Percentage relative to the first stage value (first stage = 100%)
2584
+ */
2585
+ declare type TFunnelPercentMode = 'percentOfTotal' | 'percentOfFirst';
2586
+
2587
+ declare type THeatmapConfig = {
2588
+ colorMode?: 'continuous' | 'stepped';
2589
+ steps?: number;
2590
+ colorRange?: [string, string];
2591
+ colorPalette?: 'blue' | 'green' | 'purple' | 'orange' | 'custom';
2592
+ showLegend?: boolean;
2593
+ legendPosition?: 'top' | 'bottom' | 'left' | 'right';
2594
+ showDataLabels?: boolean;
2595
+ nullFillColor?: string;
2596
+ fillMissingCells?: boolean;
2597
+ xAxisBuckets?: string[];
2598
+ yAxisBuckets?: string[];
2599
+ };
2600
+
2601
+ declare interface TimeDrillStep {
2602
+ granularity: TimeGranularity;
2603
+ next?: TimeGranularity;
2604
+ comparison?: 'previous_year' | 'previous_period';
2605
+ rollingWindow?: number;
2606
+ }
2607
+
2608
+ declare type TimeGranularity = 'day' | 'week' | 'month' | 'quarter' | 'year' | 'hour' | 'minute' | 'second';
2609
+
2610
+ /**
2611
+ * Inline filter definition stored on a card.
2612
+ * Inline filters appear on the right-hand side of the card header,
2613
+ * allowing ad-hoc data exploration without affecting other cards.
2614
+ */
2615
+ declare type TInlineFilter = {
2616
+ id: string;
2617
+ /** Alias exposed to document/text variables, for example {{region}}. */
2618
+ variableName?: string;
2619
+ column: string;
2620
+ title: string;
2621
+ dataType: string;
2622
+ table: string;
2623
+ database: string;
2624
+ qualifiedTableName?: string;
2625
+ connectionId: string;
2626
+ operation: Operation;
2627
+ sql: string;
2628
+ fieldMeta?: FilterFieldMeta;
2629
+ semanticContext?: FilterSemanticContext;
2630
+ /** Selection type: 'single' allows one value, 'multiple' allows many */
2631
+ type?: 'single' | 'multiple';
2632
+ /** UI component for single-select filters */
2633
+ uiType?: 'radio' | 'dropdown' | 'tabs';
2634
+ /** Date picker type: 'range' for full calendar, 'months' for month picker */
2635
+ dateSelectionMode?: DateSelectionMode;
2636
+ /** Default values applied when the dashboard first loads */
2637
+ defaultValues?: (string | number)[];
2638
+ /** Default date filter applied on dashboard load (relative or fixed month/year) */
2639
+ defaultDateFilter?: DefaultDateFilter;
2640
+ /** Search mode for numeric filters: 'text' treats as text, 'numeric' enables operators (>, <, =) */
2641
+ searchMode?: 'text' | 'numeric' | 'auto';
2642
+ /** Custom filter UI from a plugin */
2643
+ customFilterPreferences?: TCustomFilterPreferences;
2644
+ /** Width of the inline filter in pixels (default: 250) */
2645
+ width?: number;
2646
+ /** Whether to show the label above the filter (default: true) */
2647
+ showLabel?: boolean;
2648
+ };
2649
+
2650
+ declare type TLegendOptions = {
2651
+ display?: boolean;
2652
+ position?: 'top' | 'left' | 'bottom' | 'right';
2653
+ align?: 'start' | 'center' | 'end';
2654
+ labels?: {
2655
+ generateLabels?: (chart: any) => any[];
2656
+ [key: string]: any;
2657
+ };
2658
+ };
2659
+
2660
+ /** Line dash style options */
2661
+ declare type TLineStyle = 'solid' | 'dashed' | 'dotted' | 'dash-dot';
2662
+
2663
+ /** Historical per-column totals shape. Runtime totals are table-level now. */
2664
+ declare type TotalsBehavior = 'sum' | 'avg' | 'count' | 'label' | 'none';
2665
+
2666
+ /** Point style options supported by Chart.js */
2667
+ declare type TPointStyle = 'circle' | 'cross' | 'crossRot' | 'dash' | 'line' | 'rect' | 'rectRounded' | 'rectRot' | 'star' | 'triangle';
2668
+
2669
+ declare type TTooltipFormatConfig = {
2670
+ formatMode?: 'inherit' | 'override';
2671
+ /** @deprecated Use formatMode */
2672
+ mode?: 'inherit' | 'override';
2673
+ formatOptions?: TFormatOptions;
2674
+ };
2675
+
2676
+ declare type TVisualizationMode = 'builtin' | 'dynamic';
2677
+
383
2678
  export declare type UpdateBriefingRequest = CreateBriefingRequest;
384
2679
 
2680
+ /**
2681
+ * URL Parameter for drill-to-URL interpolation
2682
+ * Represents a placeholder in the URL template (e.g., {{product_id}})
2683
+ */
2684
+ declare interface URLParameter {
2685
+ /**
2686
+ * Unique identifier for the parameter (e.g., 'product_id', 'card_id')
2687
+ * Used in template as {{id}}
2688
+ */
2689
+ id: string;
2690
+ /**
2691
+ * Display label for the parameter
2692
+ */
2693
+ label: string;
2694
+ /**
2695
+ * Category of the parameter
2696
+ * - attribute: From card dimensions/attributes (e.g., product name, region)
2697
+ * - identifier: System values (card_id, frame_id, sheet_id)
2698
+ */
2699
+ category: 'attribute' | 'identifier';
2700
+ /**
2701
+ * For attribute parameters: the complete field object
2702
+ * Provides access to all field properties (name, qualifiedFieldName, dataType, etc.)
2703
+ */
2704
+ field?: Field;
2705
+ }
2706
+
385
2707
  export declare function validateBriefingContentDocument(input: unknown): BriefingValidationResult<BriefingContentDocument>;
386
2708
 
387
2709
  export declare function validateBriefingDraft(draft: unknown): BriefingValidationResult<CreateBriefingRequest>;
388
2710
 
389
2711
  export declare function validateBriefingJobConfig(input: unknown): BriefingValidationResult<BriefingJobConfig>;
390
2712
 
2713
+ /**
2714
+ * Display mode for visual components - controls which UI elements are shown
2715
+ */
2716
+ declare type VisualDisplayMode = 'full' | 'print' | 'table-print';
2717
+
2718
+ /**
2719
+ * Display preferences for controlling visual component rendering
2720
+ */
2721
+ declare type VisualDisplayPreferences = {
2722
+ /**
2723
+ * Predefined display mode
2724
+ * - 'full': All UI elements (default)
2725
+ * - 'print': Optimized for printing (shows title and description, hides interactive elements)
2726
+ * - 'table-print': Table-specific print mode (title only, no pagination/toolbar)
2727
+ */
2728
+ mode?: VisualDisplayMode;
2729
+ /**
2730
+ * Override specific UI elements visibility
2731
+ * These overrides take precedence over the mode presets
2732
+ */
2733
+ overrides?: {
2734
+ showHeader?: boolean;
2735
+ showTitle?: boolean;
2736
+ showDescription?: boolean;
2737
+ showTabs?: boolean;
2738
+ showFooter?: boolean;
2739
+ showFilters?: boolean;
2740
+ showBreadcrumbs?: boolean;
2741
+ showRefreshIndicator?: boolean;
2742
+ showFilterInfo?: boolean;
2743
+ showPagination?: boolean;
2744
+ showTableToolbar?: boolean;
2745
+ showColumnSettings?: boolean;
2746
+ };
2747
+ };
2748
+
2749
+ declare type WindowFunction = 'running_total' | 'moving_average' | 'previous_period_delta' | 'percent_of_total';
2750
+
2751
+ declare interface WindowTransform {
2752
+ function: WindowFunction;
2753
+ orderBy?: {
2754
+ fieldId: string;
2755
+ direction?: 'asc' | 'desc';
2756
+ };
2757
+ partitionByFieldIds?: string[];
2758
+ frame?: 'unbounded_preceding';
2759
+ movingAverage?: {
2760
+ windowSize?: number;
2761
+ minPeriods?: number;
2762
+ };
2763
+ previousPeriodDelta?: {
2764
+ mode?: 'absolute' | 'percent';
2765
+ };
2766
+ percentOfTotal?: {
2767
+ scope?: 'grand_total' | 'partition_total';
2768
+ output?: 'fraction' | 'percent';
2769
+ };
2770
+ }
2771
+
391
2772
  export { }