@malloydata/render 0.0.289 → 0.0.291

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/.storybook/malloy-stories-indexer.ts +21 -16
  2. package/API_MIGRATION.md +189 -0
  3. package/dist/api/malloy-renderer.d.ts +9 -0
  4. package/dist/api/malloy-viz.d.ts +19 -0
  5. package/dist/api/types.d.ts +12 -0
  6. package/dist/component/dashboard/dashboard.d.ts +1 -1
  7. package/dist/component/malloy-modal/malloy-modal.d.ts +0 -7
  8. package/dist/component/render-result-metadata.d.ts +4 -4
  9. package/dist/component/render.d.ts +5 -23
  10. package/dist/component/util.d.ts +13 -1
  11. package/dist/data_tree/cells/atomic.d.ts +75 -0
  12. package/dist/data_tree/cells/base.d.ts +41 -0
  13. package/dist/data_tree/cells/index.d.ts +14 -0
  14. package/dist/data_tree/cells/nest.d.ts +44 -0
  15. package/dist/data_tree/drilling.d.ts +11 -0
  16. package/dist/data_tree/fields/atomic.d.ts +67 -0
  17. package/dist/data_tree/fields/base.d.ts +65 -0
  18. package/dist/data_tree/fields/index.d.ts +17 -0
  19. package/dist/data_tree/fields/nest.d.ts +43 -0
  20. package/dist/data_tree/index.d.ts +11 -0
  21. package/dist/data_tree/plugins.d.ts +14 -0
  22. package/dist/data_tree/types.d.ts +68 -0
  23. package/dist/data_tree/utils.d.ts +19 -0
  24. package/dist/html/html_view.d.ts +1 -2
  25. package/dist/html/renderer_types.d.ts +1 -0
  26. package/dist/index.d.ts +4 -2
  27. package/dist/module/index.mjs +56960 -51018
  28. package/dist/module/index.umd.js +973 -402
  29. package/dist/render-field-metadata.d.ts +33 -0
  30. package/dist/stories/themes.stories.d.ts +0 -1
  31. package/dist/stories/vega-config-override.stories.d.ts +0 -1
  32. package/package.json +6 -18
  33. package/vite.config.base.ts +6 -0
  34. package/dist/bundle/main.d.ts +0 -6
  35. package/dist/bundle/renderer.d.ts +0 -1
  36. package/dist/component/copy-to-html.d.ts +0 -3
  37. package/dist/component/malloy-modal/malloy-modal-wc.d.ts +0 -5
  38. package/dist/component/register-webcomponent.d.ts +0 -15
  39. package/dist/component/render-webcomponent.d.ts +0 -1
  40. package/dist/data_tree.d.ts +0 -405
  41. package/dist/register/register.mjs +0 -162146
  42. package/dist/register/register.umd.js +0 -1921
  43. package/dist/register/style.css +0 -1
  44. package/dist/webcomponent/malloy-render.mjs +0 -162144
  45. package/dist/webcomponent/malloy-render.umd.js +0 -1921
  46. package/dist/webcomponent/style.css +0 -1
  47. package/vite.config.webcomponent-register.ts +0 -12
  48. package/vite.config.webcomponent.ts +0 -12
@@ -0,0 +1,33 @@
1
+ import { type Field, RootField, RecordField, ArrayField, type NestField, RepeatedRecordField, type FieldRegistry as DataTreeFieldRegistry } from '@/data_tree';
2
+ import type * as Malloy from '@malloydata/malloy-interfaces';
3
+ type RenderFieldProps<T = unknown> = {
4
+ field: Field;
5
+ renderAs: string;
6
+ sizingStrategy: string;
7
+ properties: T;
8
+ errors: Error[];
9
+ };
10
+ type RenderFieldRegistryEntry = {
11
+ field: Field;
12
+ renderProperties: RenderFieldProps;
13
+ plugins: never[];
14
+ };
15
+ interface FieldRegistry extends DataTreeFieldRegistry {
16
+ rendererFields: Map<string, RenderFieldRegistryEntry>;
17
+ }
18
+ export declare class RenderFieldMetadata {
19
+ private registry;
20
+ private legacyRegistry;
21
+ private rootField;
22
+ constructor(result: Malloy.Result);
23
+ private registerFields;
24
+ private populateRenderFieldProperties;
25
+ getField(path: string[]): Field | undefined;
26
+ getAllFields(): Field[];
27
+ getRootField(): RootField;
28
+ getFieldsByType<T extends Field, F extends Malloy.DimensionInfo>(type: new (field: F, parent: NestField | undefined, registry?: FieldRegistry) => T): T[];
29
+ getRecordFields(): RecordField[];
30
+ getArrayFields(): ArrayField[];
31
+ getRepeatedRecordFields(): RepeatedRecordField[];
32
+ }
33
+ export {};
@@ -1,6 +1,5 @@
1
1
  import type { Meta } from '@storybook/html';
2
2
  import './themes.css';
3
- import '../component/render-webcomponent';
4
3
  declare const meta: Meta;
5
4
  export default meta;
6
5
  export declare const ModelThemeOverride: {
@@ -1,6 +1,5 @@
1
1
  import type { Meta } from '@storybook/html';
2
2
  import './themes.css';
3
- import '../component/render-webcomponent';
4
3
  declare const meta: Meta;
5
4
  export default meta;
6
5
  export declare const BarChart: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/render",
3
- "version": "0.0.289",
3
+ "version": "0.0.291",
4
4
  "license": "MIT",
5
5
  "main": "dist/module/index.umd.js",
6
6
  "types": "dist/index.d.ts",
@@ -16,39 +16,27 @@
16
16
  ".": {
17
17
  "types": "./dist/index.d.ts",
18
18
  "default": "./dist/module/index.umd.js"
19
- },
20
- "./webcomponent": {
21
- "types": "./dist/component/render-webcomponent.d.ts",
22
- "default": "./dist/webcomponent/malloy-render.umd.js"
23
- },
24
- "./webcomponent/register": {
25
- "types": "./dist/component/register-webcomponent.d.ts",
26
- "default": "./dist/register/register.umd.js"
27
19
  }
28
20
  },
29
21
  "scripts": {
30
- "bundle_renderer": "node src/bundle/esbuild_bundler.js",
31
22
  "test": "jest --config=../../jest.config.js",
32
- "build": "npm run build-types && npm run build-source && npm run build-webcomponent",
23
+ "build": "npm run build-types && npm run build-source",
33
24
  "clean": "tsc --build --clean",
34
25
  "prepublishOnly": "npm run build",
35
26
  "storybook": "rm -rf ./node_modules/.cache && storybook dev -p 6006",
36
27
  "storybook-windows": "del /s /q .\\node_modules\\.cache && storybook dev -p 6006",
37
28
  "build-storybook": "storybook build",
38
29
  "build-source": "vite build --outDir 'dist/module' --config vite.config.ts",
39
- "build-webcomponent": "vite build --outDir 'dist/webcomponent' --config vite.config.webcomponent.ts && vite build --outDir 'dist/register' --config vite.config.webcomponent-register.ts",
40
30
  "build-types": "tsc --build --declaration --emitDeclarationOnly",
41
31
  "generate-flow": "ts-node ../../scripts/gen-flow.ts"
42
32
  },
43
33
  "dependencies": {
44
- "@malloydata/malloy": "0.0.289",
45
- "@malloydata/malloy-interfaces": "0.0.289",
46
- "@malloydata/malloy-tag": "0.0.289",
34
+ "@malloydata/malloy": "0.0.291",
35
+ "@malloydata/malloy-interfaces": "0.0.291",
36
+ "@malloydata/malloy-tag": "0.0.291",
47
37
  "@tanstack/solid-virtual": "^3.10.4",
48
- "component-register": "^0.8.6",
49
38
  "lodash": "^4.17.20",
50
39
  "luxon": "^2.4.0",
51
- "solid-element": "^1.8.0",
52
40
  "solid-js": "^1.8.15",
53
41
  "ssf": "^0.11.2",
54
42
  "us-atlas": "^3.0.0",
@@ -56,7 +44,7 @@
56
44
  "vega-lite": "^5.2.0"
57
45
  },
58
46
  "devDependencies": {
59
- "@malloydata/db-duckdb": "0.0.289",
47
+ "@malloydata/db-duckdb": "0.0.291",
60
48
  "@storybook/addon-essentials": "^8.5.8",
61
49
  "@storybook/addon-interactions": "^8.5.8",
62
50
  "@storybook/addon-links": "^8.5.8",
@@ -1,12 +1,18 @@
1
1
  import type {PluginOption} from 'vite';
2
2
  import {defineConfig} from 'vite';
3
3
  import solidPlugin from 'vite-plugin-solid';
4
+ import path from 'path';
4
5
 
5
6
  export default defineConfig({
6
7
  plugins: [viteStripMalloyDevToolsPlugin(), solidPlugin()],
7
8
  optimizeDeps: {
8
9
  include: ['@malloydata/malloy'],
9
10
  },
11
+ resolve: {
12
+ alias: {
13
+ '@': path.resolve(__dirname, './src'),
14
+ },
15
+ },
10
16
  build: {
11
17
  rollupOptions: {
12
18
  external: [],
@@ -1,6 +0,0 @@
1
- declare global {
2
- interface Window {
3
- renderMalloyResults: (queryResult: any, totalRows: any, preparedResult: any) => Promise<HTMLElement>;
4
- }
5
- }
6
- export {};
@@ -1 +0,0 @@
1
- export declare function renderMalloyResults(queryResult: any, totalRows: any, preparedResult: any): Promise<HTMLElement>;
@@ -1,3 +0,0 @@
1
- import type { MalloyRenderProps } from './render';
2
- export declare function copyMalloyRenderHTML(element: HTMLElement & MalloyRenderProps): Promise<void>;
3
- export declare function getMalloyRenderHTML(element: HTMLElement & MalloyRenderProps): Promise<string>;
@@ -1,5 +0,0 @@
1
- import type { ComponentOptions } from 'component-register';
2
- export type MalloyModalWCProps = {
3
- stylesheet?: CSSStyleSheet;
4
- };
5
- export declare function MalloyModalWC(props: MalloyModalWCProps, { element }: ComponentOptions): import("solid-js").JSX.Element;
@@ -1,15 +0,0 @@
1
- import type { MalloyCustomElement } from './render';
2
- import type { MalloyModalWCProps } from './malloy-modal/malloy-modal-wc';
3
- export default function registerWebComponent({ customElements, HTMLElement, }: {
4
- customElements?: CustomElementRegistry | undefined;
5
- HTMLElement?: {
6
- new (): HTMLElement;
7
- prototype: HTMLElement;
8
- } | undefined;
9
- }): void;
10
- declare global {
11
- interface HTMLElementTagNameMap {
12
- 'malloy-render': MalloyCustomElement;
13
- 'malloy-modal': HTMLElement & MalloyModalWCProps;
14
- }
15
- }
@@ -1 +0,0 @@
1
- export {};
@@ -1,405 +0,0 @@
1
- import type { Tag } from '@malloydata/malloy-tag';
2
- import * as Malloy from '@malloydata/malloy-interfaces';
3
- export type DrillEntry = {
4
- field: Field;
5
- value: string | number | boolean | Date | null;
6
- } | {
7
- where: string;
8
- };
9
- export interface FieldRegistry {
10
- fieldInstances: Map<string, Field[]>;
11
- plugins: Map<string, RenderPluginInstance[]>;
12
- }
13
- export declare function getDataTree(result: Malloy.Result, plugins?: RenderPlugin[]): RootCell;
14
- export type Field = ArrayField | RepeatedRecordField | RecordField | NumberField | DateField | JSONField | StringField | TimestampField | BooleanField | SQLNativeField;
15
- export type NestField = RepeatedRecordField | RecordField | ArrayField;
16
- export type RecordOrRepeatedRecordField = RepeatedRecordField | RecordField;
17
- export type BasicAtomicField = NumberField | DateField | JSONField | StringField | TimestampField | BooleanField | SQLNativeField;
18
- export type TimeField = DateField | TimestampField;
19
- export type SortableField = {
20
- field: Field;
21
- dir: 'asc' | 'desc' | undefined;
22
- };
23
- type ArrayFieldInfo = Malloy.DimensionInfo & {
24
- type: Malloy.AtomicTypeWithArrayType;
25
- };
26
- type RepeatedRecordFieldInfo = Malloy.DimensionInfo & {
27
- type: Malloy.AtomicTypeWithArrayType & {
28
- element_type: Malloy.AtomicTypeWithRecordType;
29
- };
30
- };
31
- type RecordFieldInfo = Malloy.DimensionInfo & {
32
- type: Malloy.AtomicTypeWithRecordType;
33
- };
34
- type NumberFieldInfo = Malloy.DimensionInfo & {
35
- type: Malloy.AtomicTypeWithNumberType;
36
- };
37
- type DateFieldInfo = Malloy.DimensionInfo & {
38
- type: Malloy.AtomicTypeWithDateType;
39
- };
40
- type JSONFieldInfo = Malloy.DimensionInfo & {
41
- type: Malloy.AtomicTypeWithJSONType;
42
- };
43
- type StringFieldInfo = Malloy.DimensionInfo & {
44
- type: Malloy.AtomicTypeWithStringType;
45
- };
46
- type TimestampFieldInfo = Malloy.DimensionInfo & {
47
- type: Malloy.AtomicTypeWithTimestampType;
48
- };
49
- type BooleanFieldInfo = Malloy.DimensionInfo & {
50
- type: Malloy.AtomicTypeWithBooleanType;
51
- };
52
- type SQLNativeFieldInfo = Malloy.DimensionInfo & {
53
- type: Malloy.AtomicTypeWithSQLNativeType;
54
- };
55
- export declare const Field: {
56
- from(field: Malloy.DimensionInfo, parent: NestField | undefined, registry?: FieldRegistry): Field;
57
- isNestField(field: Field): field is NestField;
58
- pathFromString(path: string): any;
59
- pathToString(path: string[]): string;
60
- };
61
- type DrillValue = {
62
- field: Field;
63
- value: Cell;
64
- } | {
65
- where: string;
66
- };
67
- export declare function shouldRenderAs(field: Malloy.DimensionInfo, parent: Field | undefined, tagOverride?: Tag): string;
68
- export declare abstract class FieldBase {
69
- readonly field: Malloy.DimensionInfo;
70
- readonly parent: NestField | undefined;
71
- readonly tag: Tag;
72
- readonly path: string[];
73
- protected readonly metadataTag: Tag;
74
- readonly renderAs: string;
75
- readonly valueSet: Set<string | number | boolean>;
76
- private _pluginData;
77
- protected registry?: FieldRegistry;
78
- registerPluginData<T>(pluginType: string, data: T): void;
79
- getPluginData<T>(pluginType: string): T | undefined;
80
- getAllFieldInstances(): Field[];
81
- getPlugins(): RenderPluginInstance[];
82
- constructor(field: Malloy.DimensionInfo, parent: NestField | undefined, registry?: FieldRegistry);
83
- isRoot(): boolean;
84
- root(): RootField;
85
- get drillPath(): string[];
86
- get sourceName(): string;
87
- get sourceArguments(): Malloy.ParameterValue[] | undefined;
88
- get name(): string;
89
- fieldAt(path: string[] | string): Field;
90
- getParentRecord(levelsUp: number): RecordField;
91
- get key(): string;
92
- fieldAtPath(path: string[]): Field;
93
- registerNullValue(): void;
94
- get drillFilters(): string[];
95
- getStableDrillFilter(filter: Tag): Malloy.Filter | undefined;
96
- get stableDrillFilters(): Malloy.Filter[] | undefined;
97
- get referenceId(): string | undefined;
98
- private escapeIdentifier;
99
- private identifierCode;
100
- drillExpression(): string;
101
- wasDimension(): boolean;
102
- wasCalculation(): boolean;
103
- isHidden(): boolean;
104
- get minNumber(): number | undefined;
105
- get maxNumber(): number | undefined;
106
- get maxString(): string | undefined;
107
- asField(): Field;
108
- isArray(): this is ArrayField;
109
- isRepeatedRecord(): this is RepeatedRecordField;
110
- isRecord(): this is RecordField;
111
- isNumber(): this is NumberField;
112
- isBoolean(): this is BooleanField;
113
- isString(): this is StringField;
114
- isRecordOrRepeatedRecord(): this is RecordOrRepeatedRecordField;
115
- isDate(): this is DateField;
116
- isTimestamp(): this is TimestampField;
117
- isTime(): this is TimeField;
118
- isSQLNative(): this is SQLNativeField;
119
- isJSON(): this is JSONField;
120
- isBasic(): this is BasicAtomicField;
121
- isNest(): this is NestField;
122
- getLocationInParent(): any;
123
- isLastChild(): any;
124
- isFirstChild(): any;
125
- pathTo(childField: Field): string;
126
- }
127
- export declare class ArrayField extends FieldBase {
128
- readonly field: ArrayFieldInfo;
129
- readonly fields: Field[];
130
- readonly maxUniqueFieldValueCounts: Map<string, number>;
131
- readonly eachField: Field;
132
- constructor(field: ArrayFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
133
- get isDrillable(): boolean;
134
- }
135
- export declare class RepeatedRecordField extends ArrayField {
136
- readonly field: RepeatedRecordFieldInfo;
137
- readonly fields: Field[];
138
- maxRecordCount: number;
139
- constructor(field: RepeatedRecordFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
140
- fieldAtPath(path: string[]): Field;
141
- registerRecordCount(count: number): void;
142
- registerValueSetSize(fieldName: string, size: number): void;
143
- private _fieldsWithOrder;
144
- get fieldsWithOrder(): SortableField[];
145
- }
146
- export declare class RootField extends RepeatedRecordField {
147
- readonly field: RepeatedRecordFieldInfo;
148
- readonly modelTag: Tag;
149
- readonly queryTimezone: string | undefined;
150
- constructor(field: RepeatedRecordFieldInfo, metadata: {
151
- modelTag: Tag;
152
- queryTimezone: string | undefined;
153
- }, registry?: FieldRegistry);
154
- }
155
- export declare class RecordField extends FieldBase {
156
- readonly field: RecordFieldInfo;
157
- readonly fields: Field[];
158
- readonly fieldsByName: Record<string, Field>;
159
- readonly maxUniqueFieldValueCounts: Map<string, number>;
160
- constructor(field: RecordFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
161
- fieldAtPath(path: string[]): Field;
162
- private _fieldsWithOrder;
163
- get fieldsWithOrder(): SortableField[];
164
- }
165
- export declare class NumberField extends FieldBase {
166
- readonly field: NumberFieldInfo;
167
- min: number | undefined;
168
- max: number | undefined;
169
- private _maxString;
170
- constructor(field: NumberFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
171
- registerValue(value: number): void;
172
- fieldAtPath(path: string[]): Field;
173
- get minNumber(): number | undefined;
174
- get maxNumber(): number | undefined;
175
- get maxString(): string | undefined;
176
- }
177
- export declare class DateField extends FieldBase {
178
- readonly field: DateFieldInfo;
179
- min: Date | undefined;
180
- max: Date | undefined;
181
- private _maxString;
182
- constructor(field: DateFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
183
- get timeframe(): Malloy.DateTimeframe | undefined;
184
- registerValue(value: Date): void;
185
- get minValue(): Date | undefined;
186
- get maxValue(): Date | undefined;
187
- get maxString(): string | undefined;
188
- get minNumber(): number | undefined;
189
- get maxNumber(): number | undefined;
190
- }
191
- export declare class TimestampField extends FieldBase {
192
- readonly field: TimestampFieldInfo;
193
- min: Date | undefined;
194
- max: Date | undefined;
195
- private _maxString;
196
- constructor(field: TimestampFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
197
- get timeframe(): Malloy.TimestampTimeframe | undefined;
198
- registerValue(value: Date): void;
199
- get minValue(): Date | undefined;
200
- get maxValue(): Date | undefined;
201
- get maxString(): string | undefined;
202
- }
203
- export declare class StringField extends FieldBase {
204
- readonly field: StringFieldInfo;
205
- min: string | undefined;
206
- max: string | undefined;
207
- private _maxString;
208
- constructor(field: StringFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
209
- registerValue(value: string): void;
210
- get minValue(): string | undefined;
211
- get maxValue(): string | undefined;
212
- get maxString(): string | undefined;
213
- }
214
- export declare class SQLNativeField extends FieldBase {
215
- readonly field: SQLNativeFieldInfo;
216
- constructor(field: SQLNativeFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
217
- }
218
- export declare class JSONField extends FieldBase {
219
- readonly field: JSONFieldInfo;
220
- constructor(field: JSONFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
221
- }
222
- export declare class BooleanField extends FieldBase {
223
- readonly field: BooleanFieldInfo;
224
- private _maxString;
225
- constructor(field: BooleanFieldInfo, parent: NestField | undefined, registry?: FieldRegistry);
226
- get maxString(): string | undefined;
227
- registerValue(value: boolean): void;
228
- }
229
- export type NestCell = ArrayCell | RecordCell;
230
- export type RecordOrRepeatedRecordCell = RepeatedRecordCell | RecordCell;
231
- export type TimeCell = DateCell | TimestampCell;
232
- export type Cell = ArrayCell | RecordCell | NullCell | NumberCell | DateCell | JSONCell | StringCell | TimestampCell | BooleanCell | SQLNativeCell;
233
- export declare const Cell: {
234
- from(cell: Malloy.Cell, field: Field, parent: NestCell): Cell;
235
- };
236
- export declare abstract class CellBase {
237
- readonly cell: Malloy.Cell;
238
- readonly field: Field;
239
- readonly parent: NestCell | undefined;
240
- constructor(cell: Malloy.Cell, field: Field, parent: NestCell | undefined);
241
- get literalValue(): Malloy.LiteralValue | undefined;
242
- abstract get value(): CellValue;
243
- isNull(): this is NullCell;
244
- isArray(): this is ArrayCell;
245
- isRecord(): this is RecordCell;
246
- isRepeatedRecord(): this is RepeatedRecordCell;
247
- isRecordOrRepeatedRecord(): this is RecordOrRepeatedRecordCell;
248
- isNest(): this is NestCell;
249
- isNumber(): this is NumberCell;
250
- isDate(): this is DateCell;
251
- isTime(): this is TimeCell;
252
- isJSON(): this is JSONCell;
253
- isString(): this is StringCell;
254
- isTimestamp(): this is TimestampCell;
255
- isBoolean(): this is BooleanCell;
256
- asCell(): Cell;
257
- root(): Cell;
258
- private getPathInfo;
259
- getParentRecord(levelsUp: number): RecordCell;
260
- getRelativeCell(relativeDataPath: string): Cell | undefined;
261
- cellAt(path: string[] | string): Cell;
262
- cellAtPath(path: string[]): Cell;
263
- compareTo(_other: Cell): number;
264
- canDrill(): boolean;
265
- getStableDrillQuery(): Malloy.Query | undefined;
266
- getStableDrillClauses(): Malloy.DrillOperation[] | undefined;
267
- getDrillValues(): DrillValue[];
268
- getDrillExpressions(): string[];
269
- getDrillEntries(): DrillEntry[];
270
- getStableDrillQueryMalloy(): string | undefined;
271
- getDrillQueryMalloy(): string;
272
- }
273
- export declare class ArrayCell extends CellBase {
274
- readonly cell: Malloy.CellWithArrayCell;
275
- readonly field: ArrayField;
276
- readonly parent: NestCell | undefined;
277
- readonly values: Cell[];
278
- constructor(cell: Malloy.CellWithArrayCell, field: ArrayField, parent: NestCell | undefined);
279
- get value(): Cell[];
280
- }
281
- export declare class RepeatedRecordCell extends ArrayCell {
282
- readonly cell: Malloy.CellWithArrayCell;
283
- readonly field: RepeatedRecordField;
284
- readonly parent: NestCell | undefined;
285
- readonly rows: RecordCell[];
286
- readonly fieldValueSets: Map<string, Set<CellValue>>;
287
- private plugins;
288
- private registry?;
289
- constructor(cell: Malloy.CellWithArrayCell, field: RepeatedRecordField, parent: NestCell | undefined, plugins?: RenderPlugin[], registry?: FieldRegistry);
290
- get value(): RecordCell[];
291
- }
292
- export declare class RootCell extends RepeatedRecordCell {
293
- readonly cell: Malloy.CellWithArrayCell;
294
- readonly field: RootField;
295
- constructor(cell: Malloy.CellWithArrayCell, field: RootField, plugins?: RenderPlugin[], registry?: FieldRegistry);
296
- }
297
- export type CellValue = string | number | boolean | Date | Cell[] | Record<string, Cell> | null;
298
- export declare class RecordCell extends CellBase {
299
- readonly cell: Malloy.CellWithRecordCell;
300
- readonly field: RecordField;
301
- readonly parent: NestCell | undefined;
302
- readonly cells: Record<string, Cell>;
303
- constructor(cell: Malloy.CellWithRecordCell, field: RecordField, parent: NestCell | undefined);
304
- get rows(): RecordCell[];
305
- get value(): Record<string, Cell>;
306
- column(name: string): Cell;
307
- get columns(): Cell[];
308
- allCellValues(): Record<string, CellValue>;
309
- cellAtPath(path: string[]): Cell;
310
- }
311
- export declare class NullCell extends CellBase {
312
- readonly cell: Malloy.CellWithNullCell;
313
- readonly field: Field;
314
- readonly parent: NestCell | undefined;
315
- constructor(cell: Malloy.CellWithNullCell, field: Field, parent: NestCell | undefined);
316
- get value(): null;
317
- get literalValue(): Malloy.LiteralValue | undefined;
318
- }
319
- export declare class NumberCell extends CellBase {
320
- readonly cell: Malloy.CellWithNumberCell;
321
- readonly field: NumberField;
322
- readonly parent: NestCell | undefined;
323
- constructor(cell: Malloy.CellWithNumberCell, field: NumberField, parent: NestCell | undefined);
324
- get value(): number;
325
- compareTo(other: Cell): 1 | 0 | -1;
326
- get literalValue(): Malloy.LiteralValue | undefined;
327
- }
328
- export declare class DateCell extends CellBase {
329
- readonly cell: Malloy.CellWithDateCell;
330
- readonly field: DateField;
331
- readonly parent: NestCell | undefined;
332
- constructor(cell: Malloy.CellWithDateCell, field: DateField, parent: NestCell | undefined);
333
- get value(): Date;
334
- get timeframe(): Malloy.DateTimeframe | undefined;
335
- compareTo(other: Cell): 1 | 0 | -1;
336
- get literalValue(): Malloy.LiteralValue | undefined;
337
- }
338
- export declare class TimestampCell extends CellBase {
339
- readonly cell: Malloy.CellWithTimestampCell;
340
- readonly field: TimestampField;
341
- readonly parent: NestCell | undefined;
342
- constructor(cell: Malloy.CellWithTimestampCell, field: TimestampField, parent: NestCell | undefined);
343
- get value(): Date;
344
- get timeframe(): Malloy.TimestampTimeframe | undefined;
345
- compareTo(other: Cell): 1 | 0 | -1;
346
- get literalValue(): Malloy.LiteralValue | undefined;
347
- }
348
- export declare class JSONCell extends CellBase {
349
- readonly cell: Malloy.CellWithJSONCell;
350
- readonly field: JSONField;
351
- readonly parent: NestCell | undefined;
352
- constructor(cell: Malloy.CellWithJSONCell, field: JSONField, parent: NestCell | undefined);
353
- get value(): any;
354
- compareTo(other: Cell): 1 | 0 | -1;
355
- }
356
- export declare class SQLNativeCell extends CellBase {
357
- readonly cell: Malloy.CellWithSQLNativeCell;
358
- readonly field: SQLNativeField;
359
- readonly parent: NestCell | undefined;
360
- constructor(cell: Malloy.CellWithSQLNativeCell, field: SQLNativeField, parent: NestCell | undefined);
361
- get value(): any;
362
- compareTo(other: Cell): 1 | 0 | -1;
363
- }
364
- export declare class StringCell extends CellBase {
365
- readonly cell: Malloy.CellWithStringCell;
366
- readonly field: StringField;
367
- readonly parent: NestCell | undefined;
368
- constructor(cell: Malloy.CellWithStringCell, field: StringField, parent: NestCell | undefined);
369
- get value(): string;
370
- compareTo(other: Cell): number;
371
- get literalValue(): Malloy.LiteralValue | undefined;
372
- }
373
- export declare class BooleanCell extends CellBase {
374
- readonly cell: Malloy.CellWithBooleanCell;
375
- readonly field: BooleanField;
376
- readonly parent: NestCell | undefined;
377
- constructor(cell: Malloy.CellWithBooleanCell, field: BooleanField, parent: NestCell | undefined);
378
- get value(): boolean;
379
- compareTo(other: Cell): 1 | 0 | -1;
380
- get literalValue(): Malloy.LiteralValue | undefined;
381
- }
382
- export declare enum FieldType {
383
- Array = "array",
384
- RepeatedRecord = "repeated_record",
385
- Record = "record",
386
- Number = "number",
387
- Date = "date",
388
- JSON = "json",
389
- String = "string",
390
- Timestamp = "timestamp",
391
- Boolean = "boolean",
392
- SQLNative = "sql_native"
393
- }
394
- export type RenderPluginInstance = {
395
- name: string;
396
- processData(field: NestField, cell: NestCell): void;
397
- };
398
- export type RenderPlugin<T extends RenderPluginInstance = {} & RenderPluginInstance> = {
399
- name: string;
400
- matches: (fieldTag: Tag, fieldType: FieldType) => boolean;
401
- plugin: RenderPluginFactory<T>;
402
- };
403
- export type RenderPluginFactory<T extends RenderPluginInstance> = (field: Field) => T;
404
- export declare function getFieldType(field: Field): FieldType;
405
- export {};