@visactor/vbi 0.4.17 → 0.4.20

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 (60) hide show
  1. package/dist/builder/adapters/index.d.ts +1 -0
  2. package/dist/builder/adapters/vquery-vseed/build-vquery.d.ts +3 -0
  3. package/dist/builder/adapters/vquery-vseed/build-vseed.d.ts +3 -0
  4. package/dist/builder/adapters/vquery-vseed/index.d.ts +7 -0
  5. package/dist/builder/adapters/vquery-vseed/types.d.ts +4 -0
  6. package/dist/builder/{vbi-builder.d.ts → builder.d.ts} +8 -8
  7. package/dist/builder/features/chart-type/chart-type-builder.d.ts +20 -1
  8. package/dist/builder/features/chart-type/dimension-encoding.d.ts +4 -0
  9. package/dist/builder/features/chart-type/measure-encoding.d.ts +4 -0
  10. package/dist/builder/features/chart-type/reapply-dimension-encodings.d.ts +2 -0
  11. package/dist/builder/features/chart-type/reapply-measure-encodings.d.ts +2 -0
  12. package/dist/builder/features/dimensions/dim-builder.d.ts +3 -2
  13. package/dist/builder/features/dimensions/dim-node-builder.d.ts +32 -1
  14. package/dist/builder/features/havingFilter/having-builder.d.ts +2 -2
  15. package/dist/builder/features/havingFilter/having-node-builder.d.ts +10 -1
  16. package/dist/builder/features/measures/mea-builder.d.ts +3 -2
  17. package/dist/builder/features/measures/mea-node-builder.d.ts +33 -3
  18. package/dist/builder/features/whereFilter/where-builder.d.ts +2 -2
  19. package/dist/builder/features/whereFilter/where-node-builder.d.ts +11 -2
  20. package/dist/builder/index.d.ts +2 -1
  21. package/dist/builder/modules/build.d.ts +2 -2
  22. package/dist/builder/modules/index.d.ts +2 -5
  23. package/dist/builder/modules/is-empty.d.ts +1 -1
  24. package/dist/index.cjs +1578 -386
  25. package/dist/index.d.ts +6 -3
  26. package/dist/index.js +1567 -384
  27. package/dist/pipeline/vqueryDSL/aggregateMap.d.ts +50 -0
  28. package/dist/pipeline/vqueryDSL/buildOrderBy.d.ts +2 -0
  29. package/dist/pipeline/vqueryDSL/index.d.ts +2 -3
  30. package/dist/pipeline/vqueryDSL/resolveDatePredicate.d.ts +7 -0
  31. package/dist/pipeline/vqueryDSL/types.d.ts +6 -6
  32. package/dist/types/builder/VBIInterface.d.ts +7 -7
  33. package/dist/types/builder/adapter.d.ts +23 -0
  34. package/dist/types/builder/build-vseed.d.ts +3 -0
  35. package/dist/types/builder/context.d.ts +2 -2
  36. package/dist/types/builder/index.d.ts +4 -2
  37. package/dist/types/builder/observe.d.ts +2 -1
  38. package/dist/types/connector/query.d.ts +1 -0
  39. package/dist/types/dsl/dimensions/aggregate.d.ts +15 -0
  40. package/dist/types/dsl/dimensions/dimensions.d.ts +62 -0
  41. package/dist/types/dsl/encoding.d.ts +2 -2
  42. package/dist/types/dsl/havingFilter/having.d.ts +20 -1
  43. package/dist/types/dsl/index.d.ts +6 -4
  44. package/dist/types/dsl/measures/aggregate.d.ts +14 -2
  45. package/dist/types/dsl/measures/measures.d.ts +177 -8
  46. package/dist/types/dsl/sort.d.ts +13 -0
  47. package/dist/types/dsl/vbi/vbi.d.ts +103 -7
  48. package/dist/types/dsl/whereFilter/date.d.ts +95 -0
  49. package/dist/types/dsl/whereFilter/filters.d.ts +142 -5
  50. package/dist/utils/filter-guards.d.ts +2 -2
  51. package/dist/vbi/create-vbi.d.ts +14 -14
  52. package/dist/vbi/from/from-vbi-dsl-input.d.ts +4 -3
  53. package/dist/vbi/from/set-base-dsl-fields.d.ts +2 -2
  54. package/dist/vbi/generate-empty-dsl.d.ts +2 -2
  55. package/dist/vbi/normalize/types.d.ts +3 -3
  56. package/dist/vbi.d.ts +1 -14
  57. package/package.json +5 -5
  58. package/dist/builder/modules/build-vquery.d.ts +0 -4
  59. package/dist/builder/modules/build-vseed.d.ts +0 -8
  60. package/dist/builder/modules/create-builder-features.d.ts +0 -14
@@ -0,0 +1,50 @@
1
+ export type VQueryBaseAggregateFunc = 'count' | 'count_distinct' | 'sum' | 'avg' | 'min' | 'max' | 'variance' | 'variance_pop' | 'stddev' | 'median' | 'quantile';
2
+ export type VQueryDateAggregateFunc = 'to_year' | 'to_quarter' | 'to_month' | 'to_week' | 'to_day' | 'to_hour' | 'to_minute' | 'to_second';
3
+ export type VQueryAggregateFunc = VQueryBaseAggregateFunc | VQueryDateAggregateFunc;
4
+ export type VQueryAggregate = {
5
+ func: VQueryAggregateFunc;
6
+ quantile?: number;
7
+ };
8
+ export type VBIMeasureAggregateInput = {
9
+ func: 'count';
10
+ } | {
11
+ func: 'countDistinct';
12
+ } | {
13
+ func: 'sum';
14
+ } | {
15
+ func: 'avg';
16
+ } | {
17
+ func: 'min';
18
+ } | {
19
+ func: 'max';
20
+ } | {
21
+ func: 'variance';
22
+ } | {
23
+ func: 'variancePop';
24
+ } | {
25
+ func: 'stddev';
26
+ } | {
27
+ func: 'median';
28
+ } | {
29
+ func: 'quantile';
30
+ quantile?: number;
31
+ };
32
+ export type VBIDimensionAggregateInput = {
33
+ func: 'toYear';
34
+ } | {
35
+ func: 'toQuarter';
36
+ } | {
37
+ func: 'toMonth';
38
+ } | {
39
+ func: 'toWeek';
40
+ } | {
41
+ func: 'toDay';
42
+ } | {
43
+ func: 'toHour';
44
+ } | {
45
+ func: 'toMinute';
46
+ } | {
47
+ func: 'toSecond';
48
+ };
49
+ export declare const mapAggregateForVQuery: (aggregate: VBIMeasureAggregateInput | undefined) => VQueryAggregate | undefined;
50
+ export declare const mapDimensionAggregateForVQuery: (aggregate: VBIDimensionAggregateInput | undefined) => VQueryAggregate | undefined;
@@ -0,0 +1,2 @@
1
+ import type { buildPipe } from './types';
2
+ export declare const buildOrderBy: buildPipe;
@@ -1,4 +1,3 @@
1
1
  import type { VQueryDSL } from '@visactor/vquery';
2
- import type { VBIDSL } from '../../types';
3
- import type { VBIBuilder } from '../../builder';
4
- export declare const buildVQuery: (vbiDSL: VBIDSL, builder: VBIBuilder) => VQueryDSL;
2
+ import type { VBIChartBuilderInterface, VBIChartDSL } from '../../types';
3
+ export declare const buildVQuery: (vbiDSL: VBIChartDSL, builder: VBIChartBuilderInterface<any, any>) => VQueryDSL;
@@ -0,0 +1,7 @@
1
+ import type { VBIWhereDateBounds, VBIWhereDatePredicate } from '../../types';
2
+ export type DateRange = {
3
+ start: string;
4
+ end: string;
5
+ bounds: VBIWhereDateBounds;
6
+ };
7
+ export declare function resolveDatePredicate(predicate: VBIWhereDatePredicate, now?: Date): DateRange;
@@ -1,7 +1,7 @@
1
1
  import type { VQueryDSL } from '@visactor/vquery';
2
- import type { VBIDSL } from '../../types';
3
- import type { VBIBuilder } from '../../builder';
4
- export type buildPipe = (queryDSL: VQueryDSL, context: {
5
- vbiDSL: VBIDSL;
6
- builder: VBIBuilder;
7
- }) => VQueryDSL;
2
+ import type { VBIChartBuilderInterface, VBIChartDSL } from '../../types';
3
+ export type buildPipeContext = {
4
+ vbiDSL: VBIChartDSL;
5
+ builder: VBIChartBuilderInterface<any, any>;
6
+ };
7
+ export type buildPipe = (queryDSL: VQueryDSL, context: buildPipeContext) => VQueryDSL;
@@ -1,9 +1,9 @@
1
- import type { VQueryDSL } from '@visactor/vquery';
2
- import type { VBIDSL } from '../dsl';
3
- import type { VSeedDSL } from '@visactor/vseed';
1
+ import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../../builder/adapters/vquery-vseed/types';
2
+ import type { VBIChartDSL } from '../dsl';
3
+ import type { BuildVSeedOptions } from './build-vseed';
4
4
  import type { MeasuresBuilder, DimensionsBuilder, ChartTypeBuilder, HavingFilterBuilder, WhereFilterBuilder, ThemeBuilder, LocaleBuilder, LimitBuilder, UndoManager } from '../../builder/features';
5
5
  import type { Map, Doc } from 'yjs';
6
- export interface VBIBuilderInterface {
6
+ export interface VBIChartBuilderInterface<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
7
7
  doc: Doc;
8
8
  dsl: Map<any>;
9
9
  undoManager: UndoManager;
@@ -17,8 +17,8 @@ export interface VBIBuilderInterface {
17
17
  limit: LimitBuilder;
18
18
  applyUpdate: (update: Uint8Array, origin?: any) => void;
19
19
  encodeStateAsUpdate: (targetStateVector?: Uint8Array) => Uint8Array;
20
- buildVSeed: () => Promise<VSeedDSL>;
21
- buildVQuery: () => VQueryDSL;
22
- build: () => VBIDSL;
20
+ buildVSeed: (options?: BuildVSeedOptions) => Promise<TSeedDSL>;
21
+ buildVQuery: () => TQueryDSL;
22
+ build: () => VBIChartDSL;
23
23
  isEmpty: () => boolean;
24
24
  }
@@ -0,0 +1,23 @@
1
+ import type { DefaultVBIQueryDSL, DefaultVBISeedDSL } from '../../builder/adapters/vquery-vseed/types';
2
+ import type { Map } from 'yjs';
3
+ import type { VBIChartDSL } from '../dsl';
4
+ import type { BuildVSeedOptions } from './build-vseed';
5
+ import type { VBIChartBuilderInterface } from './VBIInterface';
6
+ export interface VBIChartBuildVQueryContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
7
+ dsl: Map<any>;
8
+ vbiDSL: VBIChartDSL;
9
+ builder: VBIChartBuilderInterface<TQueryDSL, TSeedDSL>;
10
+ }
11
+ export interface VBIChartBuildVSeedContext<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> extends VBIChartBuildVQueryContext<TQueryDSL, TSeedDSL> {
12
+ options: BuildVSeedOptions;
13
+ queryDSL: TQueryDSL;
14
+ }
15
+ export type VBIChartQueryBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIChartBuildVQueryContext<TQueryDSL, TSeedDSL>) => TQueryDSL;
16
+ export type VBIChartSeedBuilder<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> = (context: VBIChartBuildVSeedContext<TQueryDSL, TSeedDSL>) => Promise<TSeedDSL> | TSeedDSL;
17
+ export interface VBIChartBuilderAdapters<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
18
+ buildVQuery: VBIChartQueryBuilder<TQueryDSL, TSeedDSL>;
19
+ buildVSeed: VBIChartSeedBuilder<TQueryDSL, TSeedDSL>;
20
+ }
21
+ export interface VBIChartBuilderOptions<TQueryDSL = DefaultVBIQueryDSL, TSeedDSL = DefaultVBISeedDSL> {
22
+ adapters?: Partial<VBIChartBuilderAdapters<TQueryDSL, TSeedDSL>>;
23
+ }
@@ -0,0 +1,3 @@
1
+ export interface BuildVSeedOptions {
2
+ signal?: AbortSignal;
3
+ }
@@ -1,4 +1,4 @@
1
- import { VBIDSL } from '../dsl';
1
+ import { VBIChartDSL } from '../dsl';
2
2
  export interface BuilderContext {
3
- getVBIDSL(): VBIDSL;
3
+ getVBIChartDSL(): VBIChartDSL;
4
4
  }
@@ -1,2 +1,4 @@
1
- export type { VBIBuilderInterface } from './VBIInterface';
2
- export type { ObserveCallback } from './observe';
1
+ export type { BuildVSeedOptions } from './build-vseed';
2
+ export type { VBIChartBuilderInterface } from './VBIInterface';
3
+ export type { VBIChartBuildVQueryContext, VBIChartBuildVSeedContext, VBIChartQueryBuilder, VBIChartSeedBuilder, VBIChartBuilderAdapters, VBIChartBuilderOptions, } from './adapter';
4
+ export type { ObserveCallback, ObserveDeepCallback } from './observe';
@@ -1,2 +1,3 @@
1
- import { YMapEvent, Transaction } from 'yjs';
1
+ import type { YEvent, YMapEvent, Transaction } from 'yjs';
2
2
  export type ObserveCallback = (e: YMapEvent<any>, trans: Transaction) => void;
3
+ export type ObserveDeepCallback = (events: YEvent<any>[], trans: Transaction) => void;
@@ -11,5 +11,6 @@ export declare const zVBIQueryProps: z.ZodObject<{
11
11
  type: z.ZodString;
12
12
  }, z.core.$strip>>;
13
13
  connectorId: z.ZodString;
14
+ signal: z.ZodOptional<z.ZodCustom<AbortSignal, AbortSignal>>;
14
15
  }, z.core.$strip>;
15
16
  export type VBIQueryProps = z.infer<typeof zVBIQueryProps>;
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const VBI_DIMENSION_DATE_AGGREGATE_FUNCS: readonly ["toYear", "toQuarter", "toMonth", "toWeek", "toDay", "toHour", "toMinute", "toSecond"];
3
+ export declare const zDimensionAggregate: z.ZodObject<{
4
+ func: z.ZodEnum<{
5
+ toYear: "toYear";
6
+ toQuarter: "toQuarter";
7
+ toMonth: "toMonth";
8
+ toWeek: "toWeek";
9
+ toDay: "toDay";
10
+ toHour: "toHour";
11
+ toMinute: "toMinute";
12
+ toSecond: "toSecond";
13
+ }>;
14
+ }, z.core.$strip>;
15
+ export type VBIDimensionAggregate = z.infer<typeof zDimensionAggregate>;
@@ -3,12 +3,74 @@ export declare const zVBIDimensionSchema: z.ZodObject<{
3
3
  id: z.ZodString;
4
4
  field: z.ZodString;
5
5
  alias: z.ZodString;
6
+ encoding: z.ZodOptional<z.ZodEnum<{
7
+ column: "column";
8
+ xAxis: "xAxis";
9
+ yAxis: "yAxis";
10
+ angle: "angle";
11
+ color: "color";
12
+ detail: "detail";
13
+ tooltip: "tooltip";
14
+ label: "label";
15
+ row: "row";
16
+ player: "player";
17
+ hierarchy: "hierarchy";
18
+ }>>;
19
+ aggregate: z.ZodOptional<z.ZodObject<{
20
+ func: z.ZodEnum<{
21
+ toYear: "toYear";
22
+ toQuarter: "toQuarter";
23
+ toMonth: "toMonth";
24
+ toWeek: "toWeek";
25
+ toDay: "toDay";
26
+ toHour: "toHour";
27
+ toMinute: "toMinute";
28
+ toSecond: "toSecond";
29
+ }>;
30
+ }, z.core.$strip>>;
31
+ sort: z.ZodOptional<z.ZodObject<{
32
+ order: z.ZodEnum<{
33
+ asc: "asc";
34
+ desc: "desc";
35
+ }>;
36
+ }, z.core.$strip>>;
6
37
  }, z.core.$strip>;
7
38
  export declare const zVBIDimensionGroupSchema: z.ZodType<VBIDimensionGroup>;
8
39
  export declare const zVBIDimensionTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
9
40
  id: z.ZodString;
10
41
  field: z.ZodString;
11
42
  alias: z.ZodString;
43
+ encoding: z.ZodOptional<z.ZodEnum<{
44
+ column: "column";
45
+ xAxis: "xAxis";
46
+ yAxis: "yAxis";
47
+ angle: "angle";
48
+ color: "color";
49
+ detail: "detail";
50
+ tooltip: "tooltip";
51
+ label: "label";
52
+ row: "row";
53
+ player: "player";
54
+ hierarchy: "hierarchy";
55
+ }>>;
56
+ aggregate: z.ZodOptional<z.ZodObject<{
57
+ func: z.ZodEnum<{
58
+ toYear: "toYear";
59
+ toQuarter: "toQuarter";
60
+ toMonth: "toMonth";
61
+ toWeek: "toWeek";
62
+ toDay: "toDay";
63
+ toHour: "toHour";
64
+ toMinute: "toMinute";
65
+ toSecond: "toSecond";
66
+ }>;
67
+ }, z.core.$strip>>;
68
+ sort: z.ZodOptional<z.ZodObject<{
69
+ order: z.ZodEnum<{
70
+ asc: "asc";
71
+ desc: "desc";
72
+ }>;
73
+ }, z.core.$strip>>;
12
74
  }, z.core.$strip>, z.ZodType<VBIDimensionGroup, unknown, z.core.$ZodTypeInternals<VBIDimensionGroup, unknown>>]>>;
13
75
  export type VBIDimension = z.infer<typeof zVBIDimensionSchema>;
14
76
  export type VBIDimensionGroup = {
@@ -1,11 +1,11 @@
1
1
  import { z } from 'zod';
2
2
  export declare const VBI_SUPPORTED_ENCODINGS: readonly ["yAxis", "xAxis", "color", "label", "tooltip", "size"];
3
3
  export declare const zVBIEncoding: z.ZodEnum<{
4
- yAxis: "yAxis";
5
4
  xAxis: "xAxis";
5
+ yAxis: "yAxis";
6
6
  color: "color";
7
- label: "label";
8
7
  tooltip: "tooltip";
8
+ label: "label";
9
9
  size: "size";
10
10
  }>;
11
11
  export type VBIEncoding = z.infer<typeof zVBIEncoding>;
@@ -1,12 +1,31 @@
1
1
  import { z } from 'zod';
2
+ import { zAggregate } from '../measures/aggregate';
2
3
  declare const zHavingLogicalOperator: z.ZodEnum<{
3
4
  and: "and";
4
5
  or: "or";
5
6
  }>;
7
+ export type VBIHavingAggregate = z.infer<typeof zAggregate>;
6
8
  export declare const zVBIHavingFilter: z.ZodObject<{
7
9
  id: z.ZodString;
8
10
  field: z.ZodString;
9
- op: z.ZodOptional<z.ZodString>;
11
+ aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
12
+ func: z.ZodEnum<{
13
+ count: "count";
14
+ countDistinct: "countDistinct";
15
+ sum: "sum";
16
+ avg: "avg";
17
+ min: "min";
18
+ max: "max";
19
+ variance: "variance";
20
+ variancePop: "variancePop";
21
+ stddev: "stddev";
22
+ median: "median";
23
+ }>;
24
+ }, z.core.$strip>, z.ZodObject<{
25
+ func: z.ZodLiteral<"quantile">;
26
+ quantile: z.ZodOptional<z.ZodNumber>;
27
+ }, z.core.$strip>], "func">;
28
+ op: z.ZodString;
10
29
  value: z.ZodOptional<z.ZodAny>;
11
30
  }, z.core.$strip>;
12
31
  export type VBIHavingFilter = z.infer<typeof zVBIHavingFilter>;
@@ -1,7 +1,9 @@
1
+ export type { VBISort, VBISortOrder } from './sort';
1
2
  export type { VBIDimensionTree, VBIDimensionGroup, VBIDimension } from './dimensions/dimensions';
2
- export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure } from './measures/measures';
3
- export type { VBIFilter, VBIWhereGroup, VBIWhereClause } from './whereFilter/filters';
4
- export type { VBIHavingFilter, VBIHavingGroup, VBIHavingClause } from './havingFilter/having';
3
+ export type { VBIDimensionAggregate } from './dimensions/aggregate';
4
+ export type { VBIMeasureTree, VBIMeasureGroup, VBIMeasure, VBIMeasureFormat } from './measures/measures';
5
+ export type { VBIWhereDateInput, VBIWhereDateUnit, VBIWhereDateBounds, VBIWhereDatePeriod, VBIWhereDatePredicate, VBIWhereFilter, VBIWhereScalarFilter, VBIWhereDateFilter, VBIWhereGroup, VBIWhereClause, } from './whereFilter/filters';
6
+ export type { VBIHavingFilter, VBIHavingGroup, VBIHavingClause, VBIHavingAggregate } from './havingFilter/having';
5
7
  export type { VBIDSLTheme } from './theme/theme';
6
8
  export type { VBIDSLLocale } from './locale/locale';
7
- export type { VBIDSL, VBIDSLInput } from './vbi/vbi';
9
+ export type { VBIChartDSL, VBIChartDSLInput } from './vbi/vbi';
@@ -1,7 +1,19 @@
1
1
  import { z } from 'zod';
2
+ export declare const VBI_MEASURE_SIMPLE_AGGREGATE_FUNCS: readonly ["count", "countDistinct", "sum", "avg", "min", "max", "variance", "variancePop", "stddev", "median"];
2
3
  export declare const zAggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
3
- func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
4
+ func: z.ZodEnum<{
5
+ count: "count";
6
+ countDistinct: "countDistinct";
7
+ sum: "sum";
8
+ avg: "avg";
9
+ min: "min";
10
+ max: "max";
11
+ variance: "variance";
12
+ variancePop: "variancePop";
13
+ stddev: "stddev";
14
+ median: "median";
15
+ }>;
4
16
  }, z.core.$strip>, z.ZodObject<{
5
17
  func: z.ZodLiteral<"quantile">;
6
- quantile: z.ZodNumber;
18
+ quantile: z.ZodOptional<z.ZodNumber>;
7
19
  }, z.core.$strip>], "func">;
@@ -1,22 +1,126 @@
1
1
  import { z } from 'zod';
2
+ import type { NumFormat } from '@visactor/vseed';
3
+ export declare const zVBIMeasureFormat: z.ZodUnion<readonly [z.ZodObject<{
4
+ autoFormat: z.ZodLiteral<true>;
5
+ }, z.core.$strip>, z.ZodObject<{
6
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
7
+ number: "number";
8
+ percent: "percent";
9
+ permille: "permille";
10
+ scientific: "scientific";
11
+ }>>>;
12
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
13
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
14
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
15
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
16
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
17
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
18
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
19
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
20
+ morePrecision: "morePrecision";
21
+ lessPrecision: "lessPrecision";
22
+ }>>>;
23
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
24
+ floor: "floor";
25
+ ceil: "ceil";
26
+ expand: "expand";
27
+ trunc: "trunc";
28
+ halfCeil: "halfCeil";
29
+ halfFloor: "halfFloor";
30
+ halfExpand: "halfExpand";
31
+ halfTrunc: "halfTrunc";
32
+ halfEven: "halfEven";
33
+ }>>>;
34
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
35
+ }, z.core.$strip>]>;
36
+ export type VBIMeasureFormat = {
37
+ autoFormat: true;
38
+ } | ({
39
+ autoFormat?: false;
40
+ } & NumFormat);
2
41
  export declare const zVBIMeasure: z.ZodObject<{
3
42
  id: z.ZodString;
4
43
  field: z.ZodString;
5
44
  alias: z.ZodString;
6
45
  encoding: z.ZodEnum<{
7
- yAxis: "yAxis";
46
+ value: "value";
47
+ column: "column";
8
48
  xAxis: "xAxis";
49
+ yAxis: "yAxis";
50
+ angle: "angle";
9
51
  color: "color";
10
- label: "label";
52
+ detail: "detail";
11
53
  tooltip: "tooltip";
54
+ label: "label";
55
+ min: "min";
56
+ max: "max";
57
+ median: "median";
58
+ primaryYAxis: "primaryYAxis";
59
+ secondaryYAxis: "secondaryYAxis";
60
+ radius: "radius";
12
61
  size: "size";
62
+ q1: "q1";
63
+ q3: "q3";
64
+ outliers: "outliers";
65
+ x0: "x0";
66
+ x1: "x1";
13
67
  }>;
14
68
  aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
15
- func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
69
+ func: z.ZodEnum<{
70
+ count: "count";
71
+ countDistinct: "countDistinct";
72
+ sum: "sum";
73
+ avg: "avg";
74
+ min: "min";
75
+ max: "max";
76
+ variance: "variance";
77
+ variancePop: "variancePop";
78
+ stddev: "stddev";
79
+ median: "median";
80
+ }>;
16
81
  }, z.core.$strip>, z.ZodObject<{
17
82
  func: z.ZodLiteral<"quantile">;
18
- quantile: z.ZodNumber;
83
+ quantile: z.ZodOptional<z.ZodNumber>;
19
84
  }, z.core.$strip>], "func">;
85
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
86
+ autoFormat: z.ZodLiteral<true>;
87
+ }, z.core.$strip>, z.ZodObject<{
88
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
89
+ number: "number";
90
+ percent: "percent";
91
+ permille: "permille";
92
+ scientific: "scientific";
93
+ }>>>;
94
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
95
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
96
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
97
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
98
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
99
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
100
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
101
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
102
+ morePrecision: "morePrecision";
103
+ lessPrecision: "lessPrecision";
104
+ }>>>;
105
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
106
+ floor: "floor";
107
+ ceil: "ceil";
108
+ expand: "expand";
109
+ trunc: "trunc";
110
+ halfCeil: "halfCeil";
111
+ halfFloor: "halfFloor";
112
+ halfExpand: "halfExpand";
113
+ halfTrunc: "halfTrunc";
114
+ halfEven: "halfEven";
115
+ }>>>;
116
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
117
+ }, z.core.$strip>]>>;
118
+ sort: z.ZodOptional<z.ZodObject<{
119
+ order: z.ZodEnum<{
120
+ asc: "asc";
121
+ desc: "desc";
122
+ }>;
123
+ }, z.core.$strip>>;
20
124
  }, z.core.$strip>;
21
125
  export declare const zVBIMeasureGroup: z.ZodType<VBIMeasureGroup>;
22
126
  export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
@@ -24,19 +128,84 @@ export declare const zVBIMeasureTree: z.ZodArray<z.ZodUnion<readonly [z.ZodObjec
24
128
  field: z.ZodString;
25
129
  alias: z.ZodString;
26
130
  encoding: z.ZodEnum<{
27
- yAxis: "yAxis";
131
+ value: "value";
132
+ column: "column";
28
133
  xAxis: "xAxis";
134
+ yAxis: "yAxis";
135
+ angle: "angle";
29
136
  color: "color";
30
- label: "label";
137
+ detail: "detail";
31
138
  tooltip: "tooltip";
139
+ label: "label";
140
+ min: "min";
141
+ max: "max";
142
+ median: "median";
143
+ primaryYAxis: "primaryYAxis";
144
+ secondaryYAxis: "secondaryYAxis";
145
+ radius: "radius";
32
146
  size: "size";
147
+ q1: "q1";
148
+ q3: "q3";
149
+ outliers: "outliers";
150
+ x0: "x0";
151
+ x1: "x1";
33
152
  }>;
34
153
  aggregate: z.ZodDiscriminatedUnion<[z.ZodObject<{
35
- func: z.ZodLiteral<"sum" | "count" | "avg" | "min" | "max">;
154
+ func: z.ZodEnum<{
155
+ count: "count";
156
+ countDistinct: "countDistinct";
157
+ sum: "sum";
158
+ avg: "avg";
159
+ min: "min";
160
+ max: "max";
161
+ variance: "variance";
162
+ variancePop: "variancePop";
163
+ stddev: "stddev";
164
+ median: "median";
165
+ }>;
36
166
  }, z.core.$strip>, z.ZodObject<{
37
167
  func: z.ZodLiteral<"quantile">;
38
- quantile: z.ZodNumber;
168
+ quantile: z.ZodOptional<z.ZodNumber>;
39
169
  }, z.core.$strip>], "func">;
170
+ format: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
171
+ autoFormat: z.ZodLiteral<true>;
172
+ }, z.core.$strip>, z.ZodObject<{
173
+ type: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
174
+ number: "number";
175
+ percent: "percent";
176
+ permille: "permille";
177
+ scientific: "scientific";
178
+ }>>>;
179
+ ratio: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
180
+ symbol: z.ZodOptional<z.ZodDefault<z.ZodString>>;
181
+ thousandSeparator: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
182
+ prefix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
183
+ suffix: z.ZodOptional<z.ZodDefault<z.ZodString>>;
184
+ fractionDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
185
+ significantDigits: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
186
+ roundingPriority: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
187
+ morePrecision: "morePrecision";
188
+ lessPrecision: "lessPrecision";
189
+ }>>>;
190
+ roundingMode: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
191
+ floor: "floor";
192
+ ceil: "ceil";
193
+ expand: "expand";
194
+ trunc: "trunc";
195
+ halfCeil: "halfCeil";
196
+ halfFloor: "halfFloor";
197
+ halfExpand: "halfExpand";
198
+ halfTrunc: "halfTrunc";
199
+ halfEven: "halfEven";
200
+ }>>>;
201
+ autoFormat: z.ZodOptional<z.ZodLiteral<false>>;
202
+ }, z.core.$strip>]>>;
203
+ sort: z.ZodOptional<z.ZodObject<{
204
+ order: z.ZodEnum<{
205
+ asc: "asc";
206
+ desc: "desc";
207
+ }>;
208
+ }, z.core.$strip>>;
40
209
  }, z.core.$strip>, z.ZodType<VBIMeasureGroup, unknown, z.core.$ZodTypeInternals<VBIMeasureGroup, unknown>>]>>;
41
210
  export type VBIMeasure = z.infer<typeof zVBIMeasure>;
42
211
  export type VBIMeasureGroup = {
@@ -0,0 +1,13 @@
1
+ import { z } from 'zod';
2
+ export declare const zVBISortOrder: z.ZodEnum<{
3
+ asc: "asc";
4
+ desc: "desc";
5
+ }>;
6
+ export declare const zVBISort: z.ZodObject<{
7
+ order: z.ZodEnum<{
8
+ asc: "asc";
9
+ desc: "desc";
10
+ }>;
11
+ }, z.core.$strip>;
12
+ export type VBISortOrder = z.infer<typeof zVBISortOrder>;
13
+ export type VBISort = z.infer<typeof zVBISort>;