react-semaphor 0.1.325 → 0.1.327

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 (68) hide show
  1. package/dist/analytics-protocol/index.cjs +1 -1
  2. package/dist/analytics-protocol/index.js +260 -226
  3. package/dist/brand-studio/index.cjs +2 -2
  4. package/dist/brand-studio/index.js +7 -6
  5. package/dist/chunks/{braces-ZjRH2Kl7.js → braces-B6qRDu1H.js} +1 -1
  6. package/dist/chunks/{braces-C7BeIXvM.js → braces-BGWZEnQJ.js} +1 -1
  7. package/dist/chunks/{calendar-preferences-dialog-DHhT6Sja.js → calendar-preferences-dialog-CjwbE_82.js} +6 -5
  8. package/dist/chunks/calendar-preferences-dialog-fkLUMJyR.js +1 -0
  9. package/dist/chunks/{chevrons-up-down-CA-XvN1o.js → chevrons-up-down-BpsogQvv.js} +1 -1
  10. package/dist/chunks/{chevrons-up-down-Cuilz9aY.js → chevrons-up-down-xG-bVFD9.js} +1 -1
  11. package/dist/chunks/{dashboard-briefing-launcher-DZiFMK8I.js → dashboard-briefing-launcher-Co57xBfS.js} +2 -2
  12. package/dist/chunks/{dashboard-briefing-launcher-BzIxRlzW.js → dashboard-briefing-launcher-Cy1nWZRW.js} +714 -719
  13. package/dist/chunks/{dashboard-controls-DVwsWny9.js → dashboard-controls-BWnVEFJq.js} +10 -9
  14. package/dist/chunks/{dashboard-controls-BX693lE0.js → dashboard-controls-C7rOGZO-.js} +1 -1
  15. package/dist/chunks/{dashboard-json-D15C_I9e.js → dashboard-json-BpRNSsF3.js} +7 -6
  16. package/dist/chunks/dashboard-json-DBPMknGo.js +1 -0
  17. package/dist/chunks/date-formatter-B4EBSe9C.js +1 -0
  18. package/dist/chunks/date-formatter-CzcPZx39.js +416 -0
  19. package/dist/chunks/edit-dashboard-visual-B2vkIKEa.js +178 -0
  20. package/dist/chunks/{edit-dashboard-visual-wQyJEcVH.js → edit-dashboard-visual-CYf26co_.js} +8243 -7784
  21. package/dist/chunks/index-BD90s-wf.js +1309 -0
  22. package/dist/chunks/index-BxM99sFL.js +1 -0
  23. package/dist/chunks/index-CuHybtft.js +51 -0
  24. package/dist/chunks/{index-CffvIaZO.js → index-DTlbYpxd.js} +29440 -28968
  25. package/dist/chunks/{palette-D96DOM7E.js → palette-CSF7IVJn.js} +1 -1
  26. package/dist/chunks/{palette-CanPG11m.js → palette-CWgEPBoG.js} +1 -1
  27. package/dist/chunks/{resource-management-panel-DlnrD0y-.js → resource-management-panel-D6nbfJY3.js} +1 -1
  28. package/dist/chunks/{resource-management-panel-CLoO2DL3.js → resource-management-panel-D893Onv8.js} +6 -5
  29. package/dist/chunks/{save-CqrBQKG6.js → save-CtQbSub2.js} +1 -1
  30. package/dist/chunks/{save-DxkSzUTZ.js → save-DRdFKF57.js} +1 -1
  31. package/dist/chunks/switch-DJJJD_g1.js +168 -0
  32. package/dist/chunks/{switch-Deo2Ltmj.js → switch-DKf6vHfP.js} +2222 -2228
  33. package/dist/chunks/{use-create-flow-overlay-state-DocFanjO.js → use-create-flow-overlay-state-C4LgoK8q.js} +1 -1
  34. package/dist/chunks/{use-create-flow-overlay-state-DsPoCfMu.js → use-create-flow-overlay-state-p21zs2p6.js} +29 -28
  35. package/dist/chunks/{use-visual-utils-BdO22fQZ.js → use-visual-utils-BKBua6o4.js} +2 -2
  36. package/dist/chunks/{use-visual-utils-DSbXQQD1.js → use-visual-utils-BqWm0QeW.js} +1 -1
  37. package/dist/chunks/validators-DDAweCzB.js +371 -0
  38. package/dist/chunks/validators-odlRJblR.js +2 -0
  39. package/dist/dashboard/index.cjs +1 -1
  40. package/dist/dashboard/index.js +1 -1
  41. package/dist/dashboard-authoring/index.cjs +3 -3
  42. package/dist/dashboard-authoring/index.js +919 -507
  43. package/dist/data-app-sdk/index.cjs +1 -0
  44. package/dist/data-app-sdk/index.js +512 -0
  45. package/dist/format-utils/index.cjs +4 -4
  46. package/dist/format-utils/index.js +22 -21
  47. package/dist/index.cjs +1 -1
  48. package/dist/index.js +141 -140
  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 +326 -2
  53. package/dist/types/dashboard-authoring.d.ts +102 -3
  54. package/dist/types/dashboard.d.ts +23 -3
  55. package/dist/types/data-app-sdk.d.ts +379 -0
  56. package/dist/types/format-utils.d.ts +25 -0
  57. package/dist/types/main.d.ts +182 -12
  58. package/dist/types/shared.d.ts +18 -2
  59. package/dist/types/surfboard.d.ts +23 -3
  60. package/dist/types/types.d.ts +38 -4
  61. package/package.json +6 -1
  62. package/dist/chunks/calendar-preferences-dialog-BxeROxyq.js +0 -1
  63. package/dist/chunks/dashboard-json-DxNEFM-p.js +0 -1
  64. package/dist/chunks/date-formatter-D9Bvw5Qk.js +0 -1
  65. package/dist/chunks/date-formatter-DyIOb6uC.js +0 -333
  66. package/dist/chunks/edit-dashboard-visual-90_qEgRc.js +0 -178
  67. package/dist/chunks/index-YTk9Hab2.js +0 -1303
  68. package/dist/chunks/switch-BXICAlvS.js +0 -168
@@ -812,6 +812,7 @@ declare interface DataModelEntityReference extends DatabaseEntityReference {
812
812
  declare interface DatasetEntityReference extends DatabaseEntityReference {
813
813
  type: 'dataset';
814
814
  datasetType: 'physical' | 'virtual';
815
+ table?: string | null;
815
816
  datamodelId?: string | null;
816
817
  sql?: string | null;
817
818
  id: string;
@@ -1468,6 +1469,16 @@ declare type FormatSpec = {
1468
1469
  sourceTimezone?: string;
1469
1470
  prefix?: string;
1470
1471
  suffix?: string;
1472
+ } | {
1473
+ type: 'duration';
1474
+ inputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1475
+ outputStyle?: 'compact' | 'digital' | 'long';
1476
+ largestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1477
+ smallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
1478
+ maxUnits?: number;
1479
+ prefix?: string;
1480
+ suffix?: string;
1481
+ negativeStyle?: 'minus' | 'parentheses';
1471
1482
  } | {
1472
1483
  type: 'string';
1473
1484
  prefix?: string;
@@ -2500,7 +2511,11 @@ export declare type TDataColumn = {
2500
2511
  label?: string;
2501
2512
  description?: string;
2502
2513
  qualifiedFieldName?: string;
2503
- role?: 'metric';
2514
+ qualifiedEntityName?: string;
2515
+ entityId?: string;
2516
+ entityName?: string;
2517
+ entityType?: EntityType;
2518
+ role?: 'groupby' | 'metric' | 'sortby' | 'pivotby' | 'detail';
2504
2519
  expression?: string;
2505
2520
  calculatedFormula?: CalculatedFieldFormula;
2506
2521
  format?: FormatSpec;
@@ -2515,7 +2530,7 @@ export declare type TDataLabelsConfig = {
2515
2530
  display?: 'auto' | boolean;
2516
2531
  formatMode?: 'inherit' | 'override';
2517
2532
  /** @deprecated Use formatMode + formatOptions.type */
2518
- format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'none';
2533
+ format?: 'auto' | 'number' | 'currency' | 'percent' | 'date' | 'scientific' | 'duration' | 'none';
2519
2534
  formatOptions?: TFormatOptions;
2520
2535
  font?: {
2521
2536
  size?: number;
@@ -2666,7 +2681,7 @@ declare type TFilter = {
2666
2681
  declare type TFilterValue = FilterForString | FilterForEqual | FilterForCompare | FilterForBetween | FilterForIn | FilterForNull | FilterForDate;
2667
2682
 
2668
2683
  export declare type TFormatOptions = {
2669
- type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date';
2684
+ type?: 'auto' | 'number' | 'currency' | 'percent' | 'scientific' | 'date' | 'duration';
2670
2685
  decimalPlaces?: number;
2671
2686
  minimumFractionDigits?: number;
2672
2687
  maximumFractionDigits?: number;
@@ -2683,6 +2698,11 @@ export declare type TFormatOptions = {
2683
2698
  timezone?: string;
2684
2699
  sourceTimezone?: string;
2685
2700
  relative?: boolean;
2701
+ durationInputUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2702
+ durationDisplayStyle?: 'compact' | 'digital' | 'long';
2703
+ durationLargestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2704
+ durationSmallestUnit?: 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
2705
+ durationMaxUnits?: number;
2686
2706
  };
2687
2707
 
2688
2708
  export declare type TFrame = {
@@ -0,0 +1,379 @@
1
+ import { JSX } from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ export declare function createSemaphorDataAppExecutor(): SemaphorDataAppExecutor;
5
+
6
+ export declare function hasSemaphorInputValue(value: unknown): boolean;
7
+
8
+ export declare function normalizeSemaphorInputOptions(options?: Array<{
9
+ label: string;
10
+ value: SemaphorDataAppOptionValue;
11
+ } | SemaphorDataAppOptionValue>): {
12
+ label: string;
13
+ value: SemaphorDataAppOptionValue;
14
+ }[];
15
+
16
+ declare type SemaphorAnalyticsIntent = SemaphorMetricIntent | SemaphorRecordsIntent | SemaphorInputOptionsIntent | SemaphorSqlIntent;
17
+
18
+ export declare type SemaphorDataAppControlInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
19
+ kind: 'control';
20
+ role: SemaphorDataAppControlRole;
21
+ };
22
+
23
+ export declare type SemaphorDataAppControlRole = 'grain' | 'metric' | 'dimension' | 'aggregation' | 'sqlParam';
24
+
25
+ export declare type SemaphorDataAppExecutor = {
26
+ executeMetric(intent: SemaphorMetricIntent, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppMetricData>;
27
+ executeRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(intent: SemaphorRecordsIntent, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppRecordsData<TRecord>>;
28
+ executeInputOptions(intent: Extract<SemaphorAnalyticsIntent, {
29
+ kind: 'inputOptions';
30
+ }>, context: SemaphorDataAppExecutorContext): Promise<SemaphorDataAppInputOptionsData>;
31
+ };
32
+
33
+ export declare type SemaphorDataAppExecutorContext = {
34
+ token?: string;
35
+ apiBaseUrl?: string;
36
+ activeInputs?: SemaphorDataAppInputSnapshot[];
37
+ };
38
+
39
+ export declare type SemaphorDataAppFieldSpec = string | SemaphorFieldRef;
40
+
41
+ export declare type SemaphorDataAppFilterInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppInputBase<TValue> & {
42
+ kind: 'filter';
43
+ field: SemaphorDataAppFieldSpec;
44
+ operator?: SemaphorInputOperator;
45
+ multi?: boolean;
46
+ source?: SemaphorSourceRef;
47
+ };
48
+
49
+ declare type SemaphorDataAppInputBase<TValue extends SemaphorDataAppInputValue> = {
50
+ id: string;
51
+ label?: string;
52
+ value?: TValue;
53
+ defaultValue?: TValue;
54
+ onValueChange?: (value: TValue | undefined) => void;
55
+ options?: Array<SemaphorDataAppInputOption | SemaphorDataAppOptionValue>;
56
+ };
57
+
58
+ export declare type SemaphorDataAppInputHandle<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = {
59
+ id: string;
60
+ kind: 'filter' | 'control';
61
+ label?: string;
62
+ field?: SemaphorFieldRef;
63
+ operator?: SemaphorInputOperator;
64
+ source?: SemaphorSourceRef;
65
+ controlRole?: SemaphorDataAppControlRole;
66
+ value: TValue | undefined;
67
+ options: SemaphorDataAppInputOption[];
68
+ isActive: boolean;
69
+ setValue(value: TValue | undefined): void;
70
+ clear(): void;
71
+ toAnalyticsInput(): SemaphorDataAppInputSnapshot<TValue>;
72
+ };
73
+
74
+ export declare type SemaphorDataAppInputOption = {
75
+ label: string;
76
+ value: SemaphorDataAppOptionValue;
77
+ count?: number;
78
+ };
79
+
80
+ export declare type SemaphorDataAppInputOptionsData = {
81
+ options: SemaphorDataAppInputOption[];
82
+ };
83
+
84
+ export declare type SemaphorDataAppInputOptionsResult = SemaphorDataAppQueryState & SemaphorDataAppInputOptionsData & {
85
+ id?: string;
86
+ intent?: Extract<SemaphorAnalyticsIntent, {
87
+ kind: 'inputOptions';
88
+ }>;
89
+ };
90
+
91
+ export declare type SemaphorDataAppInputOptionsSpec = SemaphorDataAppSourceSpec & {
92
+ id?: string;
93
+ label?: string;
94
+ field: SemaphorDataAppFieldSpec;
95
+ search?: string;
96
+ limit?: number;
97
+ };
98
+
99
+ export declare type SemaphorDataAppInputReference = SemaphorInputBinding | SemaphorDataAppInputSnapshot | SemaphorDataAppInputHandle;
100
+
101
+ export declare type SemaphorDataAppInputSnapshot<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorInputBinding & {
102
+ kind: 'filter' | 'control';
103
+ label?: string;
104
+ value?: TValue;
105
+ isActive: boolean;
106
+ operator?: SemaphorInputOperator;
107
+ source?: SemaphorSourceRef;
108
+ controlRole?: SemaphorDataAppControlRole;
109
+ };
110
+
111
+ export declare type SemaphorDataAppInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue> = SemaphorDataAppFilterInputSpec<TValue> | SemaphorDataAppControlInputSpec<TValue>;
112
+
113
+ export declare type SemaphorDataAppInputValue = SemaphorDataAppScalar | SemaphorDataAppScalar[];
114
+
115
+ export declare type SemaphorDataAppMetricComparison = 'none' | 'previous_period' | 'same_period_last_year' | 'previous_year' | {
116
+ kind: 'previous_period' | 'previous_year' | 'target';
117
+ targetValue?: number;
118
+ };
119
+
120
+ export declare type SemaphorDataAppMetricData = {
121
+ value: number | string | null;
122
+ metrics?: Record<string, number | string | null>;
123
+ comparisonValue?: number | string | null;
124
+ delta?: number | null;
125
+ deltaPercent?: number | null;
126
+ records?: Array<Record<string, unknown>>;
127
+ };
128
+
129
+ export declare type SemaphorDataAppMetricResult = SemaphorDataAppQueryState & SemaphorDataAppMetricData & {
130
+ id?: string;
131
+ intent?: SemaphorMetricIntent;
132
+ };
133
+
134
+ export declare type SemaphorDataAppMetricSpec = SemaphorDataAppSourceSpec & {
135
+ id?: string;
136
+ label?: string;
137
+ metric: string;
138
+ metrics?: string[];
139
+ dateField?: SemaphorDataAppFieldSpec;
140
+ timeGrain?: SemaphorTimeGrain;
141
+ dimensions?: SemaphorDataAppFieldSpec[];
142
+ comparison?: SemaphorDataAppMetricComparison;
143
+ inputs?: SemaphorDataAppInputReference[];
144
+ limit?: number;
145
+ };
146
+
147
+ export declare type SemaphorDataAppNonEmptyArray<T> = [T, ...T[]];
148
+
149
+ export declare type SemaphorDataAppOptionValue = string | number | boolean;
150
+
151
+ export declare function SemaphorDataAppProvider({ token, apiBaseUrl, executor, children, }: SemaphorDataAppProviderProps): JSX.Element;
152
+
153
+ export declare type SemaphorDataAppProviderProps = SemaphorDataAppExecutorContext & {
154
+ executor?: SemaphorDataAppExecutor;
155
+ children: ReactNode;
156
+ };
157
+
158
+ export declare type SemaphorDataAppQueryState = {
159
+ status: SemaphorDataAppQueryStatus;
160
+ isLoading: boolean;
161
+ error: Error | null;
162
+ };
163
+
164
+ export declare type SemaphorDataAppQueryStatus = 'idle' | 'loading' | 'success' | 'error';
165
+
166
+ declare type SemaphorDataAppRecordsBaseSpec = SemaphorDataAppSourceSpec & {
167
+ id?: string;
168
+ label?: string;
169
+ dateField?: SemaphorDataAppFieldSpec;
170
+ timeGrain?: SemaphorTimeGrain;
171
+ orderBy?: SemaphorDataAppRecordsOrderBy;
172
+ inputs?: SemaphorDataAppInputReference[];
173
+ limit?: number;
174
+ };
175
+
176
+ export declare type SemaphorDataAppRecordsData<TRecord extends Record<string, unknown> = Record<string, unknown>> = {
177
+ records: TRecord[];
178
+ columns?: Array<{
179
+ name: string;
180
+ label?: string;
181
+ dataType?: SemaphorFieldRef['dataType'];
182
+ role?: SemaphorFieldRef['role'];
183
+ }>;
184
+ rowCount?: number;
185
+ };
186
+
187
+ export declare type SemaphorDataAppRecordsOrderBy = {
188
+ field: string;
189
+ direction: 'asc' | 'desc';
190
+ };
191
+
192
+ export declare type SemaphorDataAppRecordsResult<TRecord extends Record<string, unknown> = Record<string, unknown>> = SemaphorDataAppQueryState & SemaphorDataAppRecordsData<TRecord> & {
193
+ id?: string;
194
+ intent?: SemaphorRecordsIntent;
195
+ };
196
+
197
+ declare type SemaphorDataAppRecordsSelectorSpec = {
198
+ fields: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
199
+ dimensions?: SemaphorDataAppFieldSpec[];
200
+ measures?: string[];
201
+ } | {
202
+ fields?: SemaphorDataAppFieldSpec[];
203
+ dimensions: SemaphorDataAppNonEmptyArray<SemaphorDataAppFieldSpec>;
204
+ measures?: string[];
205
+ } | {
206
+ fields?: SemaphorDataAppFieldSpec[];
207
+ dimensions?: SemaphorDataAppFieldSpec[];
208
+ measures: SemaphorDataAppNonEmptyArray<string>;
209
+ };
210
+
211
+ export declare type SemaphorDataAppRecordsSpec = SemaphorDataAppRecordsBaseSpec & SemaphorDataAppRecordsSelectorSpec;
212
+
213
+ export declare type SemaphorDataAppRuntime = SemaphorDataAppExecutorContext & {
214
+ executor?: SemaphorDataAppExecutor;
215
+ };
216
+
217
+ export declare type SemaphorDataAppScalar = string | number | boolean | null;
218
+
219
+ export declare type SemaphorDataAppSourceSpec = {
220
+ source: SemaphorSourceRef;
221
+ domainId?: never;
222
+ dataset?: never;
223
+ datasetName?: never;
224
+ datasetId?: never;
225
+ connectionId?: never;
226
+ } | {
227
+ source?: never;
228
+ domainId: string;
229
+ dataset?: string;
230
+ datasetName?: string;
231
+ datasetId?: string;
232
+ connectionId?: string;
233
+ sourceLabel?: string;
234
+ };
235
+
236
+ declare type SemaphorDialect = 'semantic' | 'postgres' | 'mysql' | 'snowflake' | 'bigquery' | 'redshift' | 'duckdb' | 'sqlite' | 'unknown';
237
+
238
+ declare type SemaphorFieldRef = {
239
+ name: string;
240
+ label?: string;
241
+ role?: 'dimension' | 'measure' | 'date' | 'id' | 'unknown';
242
+ dataType?: 'string' | 'number' | 'boolean' | 'date' | 'datetime' | 'unknown';
243
+ source?: SemaphorSourceRef;
244
+ };
245
+
246
+ declare type SemaphorInputBinding = {
247
+ inputId: string;
248
+ field?: SemaphorFieldRef;
249
+ };
250
+
251
+ declare type SemaphorInputOperator = '=' | '!=' | 'in' | 'not_in' | 'contains' | 'between' | '>' | '>=' | '<' | '<=';
252
+
253
+ declare type SemaphorInputOptionsIntent = {
254
+ kind: 'inputOptions';
255
+ version?: SemaphorProtocolVersion;
256
+ id?: string;
257
+ label?: string;
258
+ source: SemaphorSourceRef;
259
+ field: SemaphorFieldRef;
260
+ search?: string;
261
+ limit?: number;
262
+ };
263
+
264
+ declare type SemaphorMetricIntent = {
265
+ kind: 'metric';
266
+ version?: SemaphorProtocolVersion;
267
+ id?: string;
268
+ source: SemaphorSourceRef;
269
+ metric: string;
270
+ metrics?: string[];
271
+ label?: string;
272
+ dateField?: SemaphorFieldRef;
273
+ timeGrain?: SemaphorTimeGrain;
274
+ dimensions?: SemaphorFieldRef[];
275
+ comparison?: {
276
+ kind: 'previous_period' | 'previous_year' | 'target';
277
+ targetValue?: number;
278
+ };
279
+ inputs?: SemaphorInputBinding[];
280
+ limit?: number;
281
+ };
282
+
283
+ declare type SemaphorProtocolVersion = 1;
284
+
285
+ declare type SemaphorRecordsIntent = {
286
+ kind: 'records';
287
+ version?: SemaphorProtocolVersion;
288
+ source: SemaphorSourceRef;
289
+ id?: string;
290
+ label?: string;
291
+ fields: SemaphorFieldRef[];
292
+ measures?: string[];
293
+ dateField?: SemaphorFieldRef;
294
+ timeGrain?: SemaphorTimeGrain;
295
+ limit?: number;
296
+ orderBy?: {
297
+ field: string;
298
+ direction: 'asc' | 'desc';
299
+ };
300
+ inputs?: SemaphorInputBinding[];
301
+ };
302
+
303
+ declare type SemaphorSourceRef = {
304
+ kind: 'semantic';
305
+ domainId: string;
306
+ datasetName: string;
307
+ datasetId?: string;
308
+ label?: string;
309
+ connectionId?: string;
310
+ } | {
311
+ kind: 'physical';
312
+ connectionId: string;
313
+ tableName: string;
314
+ databaseName?: string;
315
+ schemaName?: string;
316
+ label?: string;
317
+ dialect?: SemaphorDialect;
318
+ } | {
319
+ kind: 'sql';
320
+ connectionId: string;
321
+ sql: string;
322
+ dialect?: SemaphorDialect;
323
+ label?: string;
324
+ };
325
+
326
+ declare type SemaphorSqlIntent = {
327
+ kind: 'sql';
328
+ version?: SemaphorProtocolVersion;
329
+ id?: string;
330
+ label?: string;
331
+ source: Extract<SemaphorSourceRef, {
332
+ kind: 'sql' | 'physical';
333
+ }>;
334
+ sql?: string;
335
+ parameters?: Record<string, unknown>;
336
+ pythonCode?: string;
337
+ limit?: number;
338
+ rationale?: string;
339
+ fields?: SemaphorFieldRef[];
340
+ inputs?: SemaphorInputBinding[];
341
+ };
342
+
343
+ declare type SemaphorTimeGrain = 'hour' | 'day' | 'week' | 'month' | 'quarter' | 'year';
344
+
345
+ export declare function toSemaphorActiveInputSnapshots(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorDataAppInputSnapshot[];
346
+
347
+ export declare function toSemaphorInputBinding(input: SemaphorDataAppInputReference): SemaphorInputBinding;
348
+
349
+ export declare function toSemaphorInputBindings(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorInputBinding[] | undefined;
350
+
351
+ export declare function toSemaphorInputOptionsIntent(spec: SemaphorDataAppInputOptionsSpec): Extract<SemaphorAnalyticsIntent, {
352
+ kind: 'inputOptions';
353
+ }>;
354
+
355
+ export declare function toSemaphorInputSnapshots(inputs: SemaphorDataAppInputReference[] | undefined): SemaphorDataAppInputSnapshot[];
356
+
357
+ export declare function toSemaphorInputSpec<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorInputBinding & {
358
+ kind: SemaphorDataAppInputSpec['kind'];
359
+ label?: string;
360
+ field?: SemaphorFieldRef;
361
+ operator?: SemaphorInputOperator;
362
+ source?: SemaphorSourceRef;
363
+ };
364
+
365
+ export declare function toSemaphorMetricIntent(spec: SemaphorDataAppMetricSpec): SemaphorMetricIntent;
366
+
367
+ export declare function toSemaphorRecordsIntent(spec: SemaphorDataAppRecordsSpec): SemaphorRecordsIntent;
368
+
369
+ export declare function useSemaphorDataAppRuntime(): SemaphorDataAppRuntime;
370
+
371
+ export declare function useSemaphorInput<TValue extends SemaphorDataAppInputValue = SemaphorDataAppInputValue>(spec: SemaphorDataAppInputSpec<TValue>): SemaphorDataAppInputHandle<TValue>;
372
+
373
+ export declare function useSemaphorInputOptions(spec: SemaphorDataAppInputOptionsSpec): SemaphorDataAppInputOptionsResult;
374
+
375
+ export declare function useSemaphorMetric(spec: SemaphorDataAppMetricSpec): SemaphorDataAppMetricResult;
376
+
377
+ export declare function useSemaphorRecords<TRecord extends Record<string, unknown> = Record<string, unknown>>(spec: SemaphorDataAppRecordsSpec): SemaphorDataAppRecordsResult<TRecord>;
378
+
379
+ export { }
@@ -107,6 +107,29 @@ export declare interface DateFormatOptions {
107
107
  locale?: string;
108
108
  }
109
109
 
110
+ export declare type DurationDisplayStyle = 'compact' | 'digital' | 'long';
111
+
112
+ export declare interface DurationFormatOptions {
113
+ /** Unit represented by the raw numeric value. */
114
+ inputUnit?: DurationUnit;
115
+ /** Display style, e.g. "6min 32s", "06:32", or "6 minutes 32 seconds". */
116
+ outputStyle?: DurationDisplayStyle;
117
+ /** Largest unit to show. Defaults to day. */
118
+ largestUnit?: DurationUnit;
119
+ /** Smallest unit to show. Defaults to second. */
120
+ smallestUnit?: DurationUnit;
121
+ /** Maximum non-zero unit parts to show for compact/long output. */
122
+ maxUnits?: number;
123
+ /** Add prefix string before the formatted duration. */
124
+ prefix?: string;
125
+ /** Add suffix string after the formatted duration. */
126
+ suffix?: string;
127
+ /** Show negative durations in parentheses instead of a minus sign. */
128
+ negativeInParentheses?: boolean;
129
+ }
130
+
131
+ export declare type DurationUnit = 'millisecond' | 'second' | 'minute' | 'hour' | 'day';
132
+
110
133
  /**
111
134
  * Escape a value for CSV output (RFC 4180 compliant)
112
135
  * Wraps in quotes if value contains delimiter, quotes, or newlines
@@ -181,6 +204,8 @@ export declare function formatCurrency(value: number | null | undefined, options
181
204
  */
182
205
  export declare const formatDate: (dateString: string | null | undefined, formatPattern: string | undefined, displayTimezone?: string, sourceTimezone?: string) => string;
183
206
 
207
+ export declare function formatDuration(value: number | string | null | undefined, options?: DurationFormatOptions): string;
208
+
184
209
  /**
185
210
  * Format a number with locale-aware formatting
186
211
  */