@malloydata/malloy-query-builder 0.0.240 → 0.0.241-dev250312191256

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@malloydata/malloy-query-builder",
3
- "version": "0.0.240",
3
+ "version": "0.0.241-dev250312191256",
4
4
  "license": "MIT",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -14,21 +14,21 @@
14
14
  },
15
15
  "scripts": {
16
16
  "test": "jest --config=../../jest.config.js",
17
- "clean": "tsc --build --clean",
17
+ "clean": "tsc --build --clean && rimraf @flowtyped",
18
18
  "build": "tsc --build && npm run generate-flow",
19
19
  "prepublishOnly": "npm run clean && npm run build",
20
- "generate-flow": "ts-node scripts/gen_flow.ts",
20
+ "generate-flow": "ts-node ../../scripts/gen-flow.ts --skip expects.d.ts",
21
21
  "generate-docs": "npx typedoc --excludeInternal",
22
22
  "serve-docs": "npx http-server -o docs"
23
23
  },
24
24
  "dependencies": {
25
- "@malloydata/malloy-filter": "^0.0.240",
26
- "@malloydata/malloy-interfaces": "^0.0.240",
27
- "@malloydata/malloy-tag": "^0.0.240"
25
+ "@malloydata/malloy-filter": "^0.0.241-dev250312191256",
26
+ "@malloydata/malloy-interfaces": "^0.0.241-dev250312191256",
27
+ "@malloydata/malloy-tag": "^0.0.241-dev250312191256"
28
28
  },
29
29
  "devDependencies": {
30
- "flow-api-translator": "^0.26.0",
31
30
  "http-server": "^14.1.1",
31
+ "rimraf": "^6.0.1",
32
32
  "typedoc": "^0.27.7"
33
33
  }
34
34
  }
@@ -1,2 +0,0 @@
1
- import * as Malloy from "@malloydata/malloy-interfaces";
2
- declare export const flights_model: Malloy.ModelInfo;
package/flow/index.d.ts DELETED
@@ -1 +0,0 @@
1
- export * from "./query-ast";
@@ -1,1150 +0,0 @@
1
- import * as Malloy from "@malloydata/malloy-interfaces";
2
- import { Tag, TagSetValue } from "@malloydata/malloy-tag";
3
- import * as Filter from "@malloydata/malloy-filter";
4
- export type FilterType = "string" | "boolean" | "number" | "temporal";
5
- export type ParsedFilter =
6
- | { kind"string", parsedFilter.StringClause | null, ... }
7
- | { kind"number", parsedFilter.NumberClause | null, ... }
8
- | { kind"boolean", parsedFilter.BooleanClause | null, ... }
9
- | { kind"temporal", parsedFilter.TemporalClause | null, ... };
10
- export type PathSegment = number | string;
11
- export type Path = PathSegment[];
12
- type ASTAny = ASTNode<mixed>;
13
- type ASTChildren<T> = { [Key in keyof T]: LiteralOrNode<T[Key]> };
14
- type NonOptionalASTNode<T> = T extends void ? empty : ASTNode<T>;
15
- type LiteralOrNode<T> = T extends string
16
- ? T
17
- : T extends number
18
- ? T
19
- : T extends string[]
20
- ? T
21
- : T extends boolean
22
- ? T
23
- : void extends T
24
- ? NonOptionalASTNode<T> | void
25
- : ASTNode<T>;
26
- declare class ASTNode<T> {
27
- editedboolean;
28
- _parentASTAny | void;
29
- build(): T;
30
- edit(): this;
31
- findAny(path: Path): ASTAny;
32
- get as(): {
33
- Query(): ASTQuery,
34
- Reference(): ASTReference,
35
- ReferenceQueryArrowSource(): ASTReferenceQueryArrowSource,
36
- ParameterValueList(): ASTParameterValueList,
37
- Where(): ASTWhere,
38
- WhereList(): ASTWhereList,
39
- ParameterValue(): ASTParameterValue,
40
- StringLiteralValue(): ASTStringLiteralValue,
41
- NumberLiteralValue(): ASTNumberLiteralValue,
42
- ViewOperationList(): ASTViewOperationList,
43
- GroupByViewOperation(): ASTGroupByViewOperation,
44
- AggregateViewOperation(): ASTAggregateViewOperation,
45
- OrderByViewOperation(): ASTOrderByViewOperation,
46
- Field(): ASTField,
47
- ReferenceExpression(): ASTReferenceExpression,
48
- ReferenceViewDefinition(): ASTReferenceViewDefinition,
49
- ArrowQueryDefinition(): ASTArrowQueryDefinition,
50
- ArrowViewDefinition(): ASTArrowViewDefinition,
51
- RefinementViewDefinition(): ASTRefinementViewDefinition,
52
- TimeTruncationExpression(): ASTTimeTruncationExpression,
53
- FilteredFieldExpression(): ASTFilteredFieldExpression,
54
- NestViewOperation(): ASTNestViewOperation,
55
- View(): ASTView,
56
- SegmentViewDefinition(): ASTSegmentViewDefinition,
57
- LimitViewOperation(): ASTLimitViewOperation,
58
- AnnotationList(): ASTAnnotationList,
59
- Annotation(): ASTAnnotation,
60
- ...
61
- };
62
- get find(): {
63
- Query(path: Path): ASTQuery,
64
- Reference(path: Path): ASTReference,
65
- ReferenceQueryArrowSource(path: Path): ASTReferenceQueryArrowSource,
66
- ParameterValueList(path: Path): ASTParameterValueList,
67
- Where(path: Path): ASTWhere,
68
- WhereList(path: Path): ASTWhereList,
69
- ParameterValue(path: Path): ASTParameterValue,
70
- StringLiteralValue(path: Path): ASTStringLiteralValue,
71
- NumberLiteralValue(path: Path): ASTNumberLiteralValue,
72
- ViewOperationList(path: Path): ASTViewOperationList,
73
- GroupByViewOperation(path: Path): ASTGroupByViewOperation,
74
- AggregateViewOperation(path: Path): ASTAggregateViewOperation,
75
- OrderByViewOperation(path: Path): ASTOrderByViewOperation,
76
- Field(path: Path): ASTField,
77
- ReferenceExpression(path: Path): ASTReferenceExpression,
78
- ReferenceViewDefinition(path: Path): ASTReferenceViewDefinition,
79
- ArrowQueryDefinition(path: Path): ASTArrowQueryDefinition,
80
- ArrowViewDefinition(path: Path): ASTArrowViewDefinition,
81
- RefinementViewDefinition(path: Path): ASTRefinementViewDefinition,
82
- TimeTruncationExpression(path: Path): ASTTimeTruncationExpression,
83
- FilteredFieldExpression(path: Path): ASTFilteredFieldExpression,
84
- NestViewOperation(path: Path): ASTNestViewOperation,
85
- View(path: Path): ASTView,
86
- SegmentViewDefinition(path: Path): ASTSegmentViewDefinition,
87
- LimitViewOperation(path: Path): ASTLimitViewOperation,
88
- AnnotationList(path: Path): ASTAnnotationList,
89
- Annotation(path: Path): ASTAnnotation,
90
- ...
91
- };
92
- get parent(): ASTAny;
93
- set parent(parent: ASTAny): void;
94
- schemaTryGet(
95
- schema: Malloy.Schema,
96
- name: string,
97
- path: string[] | void,
98
- ): Malloy.FieldInfo | void;
99
- schemaGet(
100
- schema: Malloy.Schema,
101
- name: string,
102
- path: string[] | void,
103
- ): Malloy.FieldInfo;
104
- schemaMerge(a: Malloy.Schema, b: Malloy.Schema): Malloy.Schema;
105
- tagFor(a: Malloy.FieldInfo, prefix?: string): Tag;
106
- fieldWasCalculation(a: Malloy.FieldInfo): boolean;
107
- }
108
- declare class ASTListNode<T, N: ASTNode<T> = ASTNode<T>> extends ASTNode<T[]> {
109
- nodeT[];
110
- childrenN[];
111
- originalChildrenN[];
112
- constructor(node: T[], children: N[]): void;
113
- iter(): Generator<N, void, mixed>;
114
- get length(): number;
115
- get last(): N;
116
- index(i: number): N;
117
- insert(n: N, index: number): void;
118
- add(n: N): void;
119
- remove(n: N): this | void;
120
- build(): T[];
121
- findAny(path: Path): ASTAny;
122
- findIndex(predicate: (n: N) => boolean): number;
123
- indexOf(n: N): number;
124
- }
125
- declare class ASTObjectNode<T, Children: ASTChildren<T>> extends ASTNode<T> {
126
- nodeT;
127
- childrenChildren;
128
- constructor(node: T, children: Children): void;
129
- build(): T;
130
- findAny(path: Path): ASTAny;
131
- }
132
- declare export class ASTQuery
133
- extends
134
- ASTObjectNode<
135
- Malloy.Query,
136
- { definitionASTQueryDefinition, annotations?ASTAnnotationList, ... },
137
- >
138
- implements IASTAnnotatable
139
- {
140
- modelMalloy.ModelInfo;
141
- constructor(options: {
142
- query?Malloy.Query,
143
- source
144
- | Malloy.ModelEntryValueWithSource
145
- | Malloy.ModelEntryValueWithQuery
146
- | Malloy.SourceInfo
147
- | Malloy.QueryInfo,
148
- ...
149
- }): void;
150
- constructor(options: {
151
- query?Malloy.Query,
152
- modelMalloy.ModelInfo,
153
- ...
154
- }): void;
155
- get definition(): ASTQueryDefinition;
156
- set definition(definition: ASTQueryDefinition): void;
157
- get annotations(): ASTAnnotationList | void;
158
- reorderFields(names: string[]): void;
159
- getOrAddAnnotations(): ASTAnnotationList;
160
- getInheritedTag(prefix?: RegExp | string): Tag;
161
- getIntrinsicTag(prefix?: RegExp | string): Tag;
162
- getTag(prefix?: RegExp | string): Tag;
163
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
164
- removeTagProperty(path: Path, prefix?: string): void;
165
- setViewToEmptySegment(): ASTSegmentViewDefinition;
166
- isRunnable(): boolean;
167
- isEmpty(): boolean;
168
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
169
- setSource(name: string): void;
170
- setQueryHead(name: string): void;
171
- getQueryInfo(name: string): Malloy.QueryInfo;
172
- toMalloy(): string;
173
- build(): Malloy.Query;
174
- setView(name: string): ASTReferenceViewDefinition;
175
- _getInheritedAnnotationsany;
176
- getInheritedAnnotations(): Malloy.Annotation[];
177
- }
178
- export type RawLiteralValue =
179
- | number
180
- | string
181
- | { dateDate, granularityMalloy.TimestampTimeframe, ... }
182
- | boolean
183
- | null;
184
- declare export interface IASTReference extends ASTAny {
185
- getOrAddParameters(): ASTParameterValueList;
186
- setParameter(name: string, value: RawLiteralValue): void;
187
- tryGetParameter(name: string): ASTParameterValue | void;
188
- parametersASTParameterValueList | void;
189
- namestring;
190
- pathstring[] | void;
191
- }
192
- declare export class ASTReference
193
- extends
194
- ASTObjectNode<
195
- Malloy.Reference,
196
- { namestring, path?string[], parameters?ASTParameterValueList, ... },
197
- >
198
- implements IASTReference
199
- {
200
- referenceMalloy.Reference;
201
- constructor(reference: Malloy.Reference): void;
202
- get name(): string;
203
- set name(value: string): void;
204
- get parameters(): ASTParameterValueList | void;
205
- set parameters(parameters: ASTParameterValueList | void): void;
206
- get path(): string[] | void;
207
- getOrAddParameters(reference: IASTReference): ASTParameterValueList;
208
- setParameter(
209
- reference: IASTReference,
210
- name: string,
211
- value: RawLiteralValue,
212
- ): void;
213
- tryGetParameter(
214
- reference: IASTReference,
215
- name: string,
216
- ): ASTParameterValue | void;
217
- getOrAddParameters(): any;
218
- setParameter(name: string, value: RawLiteralValue): void;
219
- tryGetParameter(name: string): ASTParameterValue | void;
220
- }
221
- declare export class ASTFieldReference extends ASTReference {
222
- get segment(): ASTSegmentViewDefinition;
223
- getReferenceSchemaany;
224
- getFieldInfo(): Malloy.FieldInfo;
225
- }
226
- declare export class ASTParameterValueList
227
- extends ASTListNode<Malloy.ParameterValue, ASTParameterValue>
228
- {
229
- constructor(parameters: Malloy.ParameterValue[]): void;
230
- get parameters(): ASTParameterValue[];
231
- addParameter(name: string, value: RawLiteralValue): void;
232
- }
233
- declare export class ASTParameterValue
234
- extends
235
- ASTObjectNode<
236
- Malloy.ParameterValue,
237
- { namestring, valueASTLiteralValue, ... },
238
- >
239
- {
240
- parameterMalloy.ParameterValue;
241
- constructor(parameter: Malloy.ParameterValue): void;
242
- get name(): string;
243
- }
244
- export type ASTLiteralValue =
245
- | ASTStringLiteralValue
246
- | ASTNumberLiteralValue
247
- | ASTBooleanLiteralValue
248
- | ASTDateLiteralValue
249
- | ASTTimestampLiteralValue
250
- | ASTNullLiteralValue;
251
- declare export const LiteralValueAST: {
252
- from(
253
- value: Malloy.LiteralValue,
254
- ):
255
- | ASTStringLiteralValue
256
- | ASTNumberLiteralValue
257
- | ASTBooleanLiteralValue
258
- | ASTDateLiteralValue
259
- | ASTTimestampLiteralValue
260
- | ASTNullLiteralValue,
261
- makeLiteral(value: RawLiteralValue): Malloy.LiteralValue,
262
- ...
263
- };
264
- declare export class ASTStringLiteralValue
265
- extends
266
- ASTObjectNode<
267
- Malloy.LiteralValueWithStringLiteral,
268
- { kind"string_literal", string_valuestring, ... },
269
- >
270
- {
271
- nodeMalloy.LiteralValueWithStringLiteral;
272
- +kindMalloy.LiteralValueType;
273
- constructor(node: Malloy.LiteralValueWithStringLiteral): void;
274
- }
275
- declare export class ASTNullLiteralValue
276
- extends
277
- ASTObjectNode<
278
- Malloy.LiteralValueWithNullLiteral,
279
- { kind"null_literal", ... },
280
- >
281
- {
282
- nodeMalloy.LiteralValueWithNullLiteral;
283
- +kindMalloy.LiteralValueType;
284
- constructor(node: Malloy.LiteralValueWithNullLiteral): void;
285
- }
286
- declare export class ASTNumberLiteralValue
287
- extends
288
- ASTObjectNode<
289
- Malloy.LiteralValueWithNumberLiteral,
290
- { kind"number_literal", number_valuenumber, ... },
291
- >
292
- {
293
- nodeMalloy.LiteralValueWithNumberLiteral;
294
- +kindMalloy.LiteralValueType;
295
- constructor(node: Malloy.LiteralValueWithNumberLiteral): void;
296
- }
297
- declare export class ASTBooleanLiteralValue
298
- extends
299
- ASTObjectNode<
300
- Malloy.LiteralValueWithBooleanLiteral,
301
- { kind"boolean_literal", boolean_valueboolean, ... },
302
- >
303
- {
304
- nodeMalloy.LiteralValueWithBooleanLiteral;
305
- +kindMalloy.LiteralValueType;
306
- constructor(node: Malloy.LiteralValueWithBooleanLiteral): void;
307
- }
308
- declare export class ASTDateLiteralValue
309
- extends
310
- ASTObjectNode<
311
- Malloy.LiteralValueWithDateLiteral,
312
- {
313
- kind"date_literal",
314
- date_valuestring,
315
- granularity?Malloy.DateTimeframe,
316
- ...
317
- },
318
- >
319
- {
320
- nodeMalloy.LiteralValueWithDateLiteral;
321
- +kindMalloy.LiteralValueType;
322
- constructor(node: Malloy.LiteralValueWithDateLiteral): void;
323
- }
324
- declare export class ASTTimestampLiteralValue
325
- extends
326
- ASTObjectNode<
327
- Malloy.LiteralValueWithTimestampLiteral,
328
- {
329
- kind"timestamp_literal",
330
- timestamp_valuestring,
331
- granularity?Malloy.TimestampTimeframe,
332
- ...
333
- },
334
- >
335
- {
336
- nodeMalloy.LiteralValueWithTimestampLiteral;
337
- +kindMalloy.LiteralValueType;
338
- constructor(node: Malloy.LiteralValueWithTimestampLiteral): void;
339
- }
340
- declare export class ASTUnimplemented<T> extends ASTNode<T> {
341
- +nodeany;
342
- constructor(node: T): void;
343
- get treeEdited(): boolean;
344
- build(): T;
345
- findAny(): empty;
346
- }
347
- declare export interface IASTQueryOrViewDefinition {
348
- propagateUp(f: PropagationFunction): void;
349
- propagateDown(f: PropagationFunction): void;
350
- }
351
- type PropagationFunction = (propagatable: IASTQueryOrViewDefinition) => void;
352
- declare export interface IASTQueryDefinition extends IASTQueryOrViewDefinition {
353
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
354
- reorderFields(names: string[]): void;
355
- isRunnable(): boolean;
356
- }
357
- export type ASTQueryArrowSource =
358
- | ASTReferenceQueryArrowSource
359
- | ASTRefinementQueryDefinition;
360
- declare export const ASTQueryArrowSource: {
361
- from(
362
- definition: Malloy.QueryArrowSource,
363
- ): ASTReferenceQueryArrowSource | ASTRefinementQueryDefinition,
364
- ...
365
- };
366
- export type ASTQueryDefinition =
367
- | ASTReferenceQueryDefinition
368
- | ASTArrowQueryDefinition
369
- | ASTRefinementQueryDefinition;
370
- declare export const ASTQueryDefinition: {
371
- from(
372
- definition: Malloy.QueryDefinition,
373
- ):
374
- | ASTArrowQueryDefinition
375
- | ASTReferenceQueryDefinition
376
- | ASTRefinementQueryDefinition,
377
- ...
378
- };
379
- declare export class ASTArrowQueryDefinition
380
- extends
381
- ASTObjectNode<
382
- Malloy.QueryDefinitionWithArrow,
383
- { kind"arrow", sourceASTQueryArrowSource, viewASTViewDefinition, ... },
384
- >
385
- implements IASTQueryDefinition
386
- {
387
- nodeMalloy.QueryDefinitionWithArrow;
388
- constructor(node: Malloy.QueryDefinitionWithArrow): void;
389
- get view(): ASTViewDefinition;
390
- set view(view: ASTViewDefinition): void;
391
- get source(): ASTQueryArrowSource;
392
- set source(source: ASTQueryArrowSource): void;
393
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
394
- getSourceInfo(): any;
395
- getOutputSchema(): Malloy.Schema;
396
- isRunnable(): boolean;
397
- get query(): ASTQuery;
398
- propagateUp(f: PropagationFunction): void;
399
- propagateDown(f: PropagationFunction): void;
400
- reorderFields(names: string[]): void;
401
- }
402
- declare export class ASTRefinementQueryDefinition
403
- extends
404
- ASTObjectNode<
405
- Malloy.QueryDefinitionWithRefinement,
406
- {
407
- kind"refinement",
408
- baseASTQueryDefinition,
409
- refinementASTViewDefinition,
410
- ...
411
- },
412
- >
413
- implements IASTQueryDefinition
414
- {
415
- nodeMalloy.QueryDefinitionWithRefinement;
416
- constructor(node: Malloy.QueryDefinitionWithRefinement): void;
417
- get base(): ASTQueryDefinition;
418
- get refinement(): ASTViewDefinition;
419
- set refinement(refinement: ASTViewDefinition): void;
420
- isRunnable(): boolean;
421
- get query(): ASTQuery;
422
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
423
- getOutputSchema(): any;
424
- propagateUp(f: PropagationFunction): void;
425
- propagateDown(f: PropagationFunction): void;
426
- reorderFields(names: string[]): void;
427
- getSourceInfo(): any;
428
- }
429
- declare export class ASTReferenceQueryDefinition
430
- extends
431
- ASTObjectNode<
432
- Malloy.QueryDefinitionWithQueryReference,
433
- {
434
- kind"query_reference",
435
- namestring,
436
- path?string[],
437
- parameters?ASTParameterValueList,
438
- ...
439
- },
440
- >
441
- implements IASTQueryDefinition, IASTReference
442
- {
443
- nodeMalloy.QueryDefinitionWithQueryReference;
444
- constructor(node: Malloy.QueryDefinitionWithQueryReference): void;
445
- isRunnable(): boolean;
446
- get name(): string;
447
- get query(): ASTQuery;
448
- get parameters(): ASTParameterValueList | void;
449
- set parameters(parameters: ASTParameterValueList | void): void;
450
- get path(): string[] | void;
451
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
452
- propagateUp(_f: PropagationFunction): void;
453
- propagateDown(_f: PropagationFunction): void;
454
- reorderFields(names: string[]): void;
455
- getOrAddParameters(): any;
456
- setParameter(name: string, value: RawLiteralValue): void;
457
- tryGetParameter(name: string): ASTParameterValue | void;
458
- getOutputSchema(): Malloy.Schema;
459
- getSourceInfo(): Malloy.ModelEntryValue;
460
- }
461
- declare export class ASTReferenceQueryArrowSource
462
- extends
463
- ASTObjectNode<
464
- Malloy.QueryArrowSourceWithSourceReference,
465
- {
466
- kind"source_reference",
467
- namestring,
468
- path?string[],
469
- parameters?ASTParameterValueList,
470
- ...
471
- },
472
- >
473
- implements IASTReference
474
- {
475
- nodeMalloy.QueryArrowSourceWithSourceReference;
476
- constructor(node: Malloy.QueryArrowSourceWithSourceReference): void;
477
- isRunnable(): boolean;
478
- get name(): string;
479
- get arrow(): ASTArrowQueryDefinition;
480
- get parameters(): ASTParameterValueList | void;
481
- set parameters(parameters: ASTParameterValueList | void): void;
482
- get path(): string[] | void;
483
- getSourceInfo(): Malloy.ModelEntryValue;
484
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
485
- propagateUp(_f: PropagationFunction): void;
486
- propagateDown(_f: PropagationFunction): void;
487
- getOrAddParameters(): any;
488
- setParameter(name: string, value: RawLiteralValue): void;
489
- tryGetParameter(name: string): ASTParameterValue | void;
490
- get query(): ASTQuery;
491
- getSourceParameters(): Malloy.ParameterInfo[];
492
- areRequiredParametersSet(): boolean;
493
- }
494
- declare export interface IASTViewDefinition extends IASTQueryOrViewDefinition {
495
- isRunnable(): boolean;
496
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
497
- getInputSchema(): Malloy.Schema;
498
- getOutputSchema(): Malloy.Schema;
499
- getImplicitName(): string | void;
500
- getRefinementSchema(): Malloy.Schema;
501
- addEmptyRefinement(): ASTSegmentViewDefinition;
502
- addViewRefinement(name: string, path?: string[]): ASTReferenceViewDefinition;
503
- isValidViewRefinement(
504
- name: string,
505
- path?: string[],
506
- ): { isValidViewRefinementboolean, error?string, ... };
507
- getInheritedAnnotations(): Malloy.Annotation[];
508
- }
509
- export type ASTViewDefinition =
510
- | ASTArrowViewDefinition
511
- | ASTRefinementViewDefinition
512
- | ASTSegmentViewDefinition
513
- | ASTReferenceViewDefinition;
514
- declare export class ASTReferenceViewDefinition
515
- extends
516
- ASTObjectNode<
517
- Malloy.ViewDefinitionWithViewReference,
518
- {
519
- kind"view_reference",
520
- namestring,
521
- path?string[],
522
- parameters?ASTParameterValueList,
523
- ...
524
- },
525
- >
526
- implements IASTViewDefinition, IASTReference
527
- {
528
- nodeMalloy.ViewDefinitionWithViewReference;
529
- constructor(node: Malloy.ViewDefinitionWithViewReference): void;
530
- isRunnable(): boolean;
531
- get name(): string;
532
- get path(): string[] | void;
533
- get parameters(): ASTParameterValueList | void;
534
- set parameters(parameters: ASTParameterValueList | void): void;
535
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
536
- addEmptyRefinement(): ASTSegmentViewDefinition;
537
- addViewRefinement(name: string, path?: string[]): ASTReferenceViewDefinition;
538
- isValidViewRefinement(
539
- name: string,
540
- path?: string[],
541
- ): { isValidViewRefinementboolean, error?string, ... };
542
- getInputSchema(): Malloy.Schema;
543
- getOutputSchema(): Malloy.Schema;
544
- getImplicitName(): string | void;
545
- getViewInfo(): Malloy.FieldInfoWithView;
546
- getRefinementSchema(): Malloy.Schema;
547
- propagateUp(f: PropagationFunction): void;
548
- propagateDown(_f: PropagationFunction): void;
549
- getInheritedAnnotations(): Malloy.Annotation[];
550
- getOrAddParameters(): any;
551
- setParameter(name: string, value: RawLiteralValue): void;
552
- tryGetParameter(name: string): ASTParameterValue | void;
553
- }
554
- declare export class ASTArrowViewDefinition
555
- extends
556
- ASTObjectNode<
557
- Malloy.ViewDefinitionWithArrow,
558
- { kind"arrow", sourceASTViewDefinition, viewASTViewDefinition, ... },
559
- >
560
- implements IASTViewDefinition
561
- {
562
- nodeMalloy.ViewDefinitionWithArrow;
563
- constructor(node: Malloy.ViewDefinitionWithArrow): void;
564
- isRunnable(): boolean;
565
- get source(): ASTViewDefinition;
566
- set source(source: ASTViewDefinition): void;
567
- get view(): ASTViewDefinition;
568
- set view(view: ASTViewDefinition): void;
569
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
570
- addEmptyRefinement(): ASTSegmentViewDefinition;
571
- addViewRefinement(name: string, path?: string[]): ASTReferenceViewDefinition;
572
- getInputSchema(): Malloy.Schema;
573
- getOutputSchema(): Malloy.Schema;
574
- getImplicitName(): string | void;
575
- getRefinementSchema(): Malloy.Schema;
576
- isValidViewRefinement(
577
- name: string,
578
- path?: string[],
579
- ): { isValidViewRefinementboolean, error?string, ... };
580
- propagateUp(f: PropagationFunction): void;
581
- propagateDown(f: PropagationFunction): void;
582
- getInheritedAnnotations(): Malloy.Annotation[];
583
- }
584
- declare export class ASTRefinementViewDefinition
585
- extends
586
- ASTObjectNode<
587
- Malloy.ViewDefinitionWithRefinement,
588
- {
589
- kind"refinement",
590
- baseASTViewDefinition,
591
- refinementASTViewDefinition,
592
- ...
593
- },
594
- >
595
- implements IASTViewDefinition
596
- {
597
- nodeMalloy.ViewDefinitionWithRefinement;
598
- constructor(node: Malloy.ViewDefinitionWithRefinement): void;
599
- isRunnable(): boolean;
600
- get refinement(): ASTViewDefinition;
601
- set refinement(refinement: ASTViewDefinition): void;
602
- get base(): ASTViewDefinition;
603
- set base(base: ASTViewDefinition): void;
604
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
605
- addEmptyRefinement(): ASTSegmentViewDefinition;
606
- addViewRefinement(name: string, path?: string[]): ASTReferenceViewDefinition;
607
- getInputSchema(): Malloy.Schema;
608
- getOutputSchema(): Malloy.Schema;
609
- getRefinementSchema(): Malloy.Schema;
610
- getImplicitName(): string | void;
611
- isValidViewRefinement(
612
- name: string,
613
- path?: string[],
614
- ): { isValidViewRefinementboolean, error?string, ... };
615
- propagateUp(f: PropagationFunction): void;
616
- propagateDown(f: PropagationFunction): void;
617
- getInheritedAnnotations(): Malloy.Annotation[];
618
- viewRefinementOf(
619
- view: Malloy.ViewDefinition,
620
- name: string,
621
- path?: string[],
622
- ): ASTRefinementViewDefinition;
623
- segmentRefinementOf(view: Malloy.ViewDefinition): ASTRefinementViewDefinition;
624
- }
625
- declare export class ASTSegmentViewDefinition
626
- extends
627
- ASTObjectNode<
628
- Malloy.ViewDefinitionWithSegment,
629
- { kind"segment", operationsASTViewOperationList, ... },
630
- >
631
- implements IASTViewDefinition
632
- {
633
- nodeMalloy.ViewDefinitionWithSegment;
634
- constructor(node: Malloy.ViewDefinitionWithSegment): void;
635
- isRunnable(): boolean;
636
- get operations(): ASTViewOperationList;
637
- renameOrderBys(oldName: string, newName: string): void;
638
- propagateUp(f: PropagationFunction): void;
639
- propagateDown(_f: PropagationFunction): void;
640
- removeOrderBys(name: string): void;
641
- reorderFields(names: string[]): void;
642
- renameField(
643
- field:
644
- | ASTAggregateViewOperation
645
- | ASTGroupByViewOperation
646
- | ASTNestViewOperation,
647
- name: string,
648
- ): void;
649
- addOrderBy(
650
- name: string,
651
- direction?: Malloy.OrderByDirection,
652
- ): ASTOrderByViewOperation;
653
- addEmptyNest(name: string): ASTNestViewOperation;
654
- firstIndexOfOperationTypeany;
655
- DEFAULT_INSERTION_ORDERany;
656
- findInsertionPointany;
657
- getFieldNamed(
658
- name: string,
659
- ):
660
- | ASTGroupByViewOperation
661
- | ASTAggregateViewOperation
662
- | ASTNestViewOperation
663
- | void;
664
- hasFieldNamed(name: string): boolean;
665
- hasField(name: string, path?: string[]): boolean;
666
- getField(
667
- name: string,
668
- path?: string[],
669
- ): ASTGroupByViewOperation | ASTAggregateViewOperation | ASTNestViewOperation;
670
- tryGetField(
671
- name: string,
672
- path?: string[],
673
- ):
674
- | ASTGroupByViewOperation
675
- | ASTAggregateViewOperation
676
- | ASTNestViewOperation
677
- | void;
678
- tryGetFieldNamed(
679
- name: string,
680
- ):
681
- | ASTGroupByViewOperation
682
- | ASTAggregateViewOperation
683
- | ASTNestViewOperation
684
- | void;
685
- getGroupBy(name: string): ASTGroupByViewOperation | void;
686
- removeGroupBy(name: string): this;
687
- addGroupBy(
688
- name: string,
689
- path?: string[],
690
- rename?: string,
691
- ): ASTGroupByViewOperation;
692
- addWhere(name: string, filter: ParsedFilter): ASTWhereViewOperation;
693
- addWhere(name: string, filterString: string): ASTWhereViewOperation;
694
- addWhere(
695
- name: string,
696
- path: string[],
697
- filter: ParsedFilter,
698
- ): ASTWhereViewOperation;
699
- addWhere(
700
- name: string,
701
- path: string[],
702
- filterString: string,
703
- ): ASTWhereViewOperation;
704
- addTimeGroupByany;
705
- addDateGroupBy(
706
- name: string,
707
- path: string[],
708
- timeframe: Malloy.DateTimeframe,
709
- ): ASTGroupByViewOperation;
710
- addDateGroupBy(
711
- name: string,
712
- timeframe: Malloy.DateTimeframe,
713
- ): ASTGroupByViewOperation;
714
- addTimestampGroupBy(
715
- name: string,
716
- path: string[],
717
- timeframe: Malloy.TimestampTimeframe,
718
- ): ASTGroupByViewOperation;
719
- addTimestampGroupBy(
720
- name: string,
721
- timeframe: Malloy.TimestampTimeframe,
722
- ): ASTGroupByViewOperation;
723
- addAggregate(
724
- name: string,
725
- path?: string[],
726
- rename?: string,
727
- ): ASTAggregateViewOperation;
728
- addNest(name: string, rename?: string): ASTNestViewOperation;
729
- makeFieldany;
730
- addOperationany;
731
- getRefinementSchema(): Malloy.Schema;
732
- setLimit(limit: number): void;
733
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
734
- addEmptyRefinement(): ASTSegmentViewDefinition;
735
- addViewRefinement(name: string, path?: string[]): ASTReferenceViewDefinition;
736
- getInputSchema(): Malloy.Schema;
737
- getOutputSchema(): Malloy.Schema;
738
- getImplicitName(): string | void;
739
- isValidViewRefinement(
740
- name: string,
741
- path?: string[],
742
- ): { isValidViewRefinementboolean, error?string, ... };
743
- getInheritedAnnotations(): Malloy.Annotation[];
744
- }
745
- declare export class ASTViewOperationList
746
- extends ASTListNode<Malloy.ViewOperation, ASTViewOperation>
747
- {
748
- constructor(operations: Malloy.ViewOperation[]): void;
749
- get items(): ASTViewOperation[];
750
- set items(operations: ASTViewOperation[]): void;
751
- get segment(): ASTSegmentViewDefinition;
752
- }
753
- export type ASTViewOperation =
754
- | ASTGroupByViewOperation
755
- | ASTAggregateViewOperation
756
- | ASTOrderByViewOperation
757
- | ASTNestViewOperation
758
- | ASTLimitViewOperation
759
- | ASTWhereViewOperation;
760
- declare export const ASTViewOperation: {
761
- from(value: Malloy.ViewOperation): ASTViewOperation,
762
- isLimit(x: ASTViewOperation): x is ASTLimitViewOperation,
763
- ...
764
- };
765
- declare export interface IASTAnnotatable {
766
- getOrAddAnnotations(): ASTAnnotationList;
767
- getInheritedTag(prefix: RegExp | string): Tag;
768
- getIntrinsicTag(prefix: RegExp | string): Tag;
769
- getTag(prefix: RegExp | string): Tag;
770
- setTagProperty(path: Path, value: TagSetValue, prefix: string): void;
771
- removeTagProperty(path: Path, prefix: string): void;
772
- }
773
- declare export class ASTOrderByViewOperation
774
- extends
775
- ASTObjectNode<
776
- Malloy.ViewOperationWithOrderBy,
777
- {
778
- kind"order_by",
779
- field_referenceASTFieldReference,
780
- direction?Malloy.OrderByDirection,
781
- ...
782
- },
783
- >
784
- {
785
- nodeMalloy.ViewOperationWithOrderBy;
786
- +kindMalloy.ViewOperationType;
787
- constructor(node: Malloy.ViewOperationWithOrderBy): void;
788
- get fieldReference(): ASTFieldReference;
789
- get name(): string;
790
- get direction(): Malloy.OrderByDirection | void;
791
- set direction(direction: Malloy.OrderByDirection | void): void;
792
- get list(): ASTViewOperationList;
793
- delete(): void;
794
- setField(name: string): void;
795
- setDirection(direction: Malloy.OrderByDirection | void): void;
796
- }
797
- declare export class ASTGroupByViewOperation
798
- extends
799
- ASTObjectNode<
800
- Malloy.ViewOperationWithGroupBy,
801
- { kind"group_by", name?string, fieldASTField, ... },
802
- >
803
- implements IASTAnnotatable
804
- {
805
- nodeMalloy.ViewOperationWithGroupBy;
806
- +kindMalloy.ViewOperationType;
807
- constructor(node: Malloy.ViewOperationWithGroupBy): void;
808
- get field(): ASTField;
809
- get name(): string;
810
- set name(name: string): void;
811
- get list(): ASTViewOperationList;
812
- rename(name: string): void;
813
- delete(): void;
814
- getFieldInfo(): Malloy.FieldInfo;
815
- get annotations(): void;
816
- set annotations(value: any): void;
817
- getOrAddAnnotations(): ASTAnnotationList;
818
- getInheritedTag(prefix?: RegExp | string): Tag;
819
- getIntrinsicTag(prefix?: RegExp | string): Tag;
820
- getTag(prefix?: RegExp | string): Tag;
821
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
822
- removeTagProperty(path: Path, prefix?: string): void;
823
- fromReference(
824
- name: string,
825
- path: string[] | void,
826
- rename: string | void,
827
- ): ASTGroupByViewOperation;
828
- }
829
- declare export class ASTAggregateViewOperation
830
- extends
831
- ASTObjectNode<
832
- Malloy.ViewOperationWithAggregate,
833
- { kind"aggregate", name?string, fieldASTField, ... },
834
- >
835
- implements IASTAnnotatable
836
- {
837
- nodeMalloy.ViewOperationWithAggregate;
838
- +kindMalloy.ViewOperationType;
839
- constructor(node: Malloy.ViewOperationWithAggregate): void;
840
- get field(): ASTField;
841
- get name(): string;
842
- set name(name: string): void;
843
- get annotations(): ASTAnnotationList | void;
844
- rename(name: string): void;
845
- get list(): ASTViewOperationList;
846
- delete(): void;
847
- getFieldInfo(): Malloy.FieldInfo;
848
- getOrAddAnnotations(): ASTAnnotationList;
849
- getInheritedTag(prefix?: RegExp | string): Tag;
850
- getIntrinsicTag(prefix?: RegExp | string): Tag;
851
- getTag(prefix?: RegExp | string): Tag;
852
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
853
- removeTagProperty(path: Path, prefix?: string): void;
854
- addWhere(
855
- name: string,
856
- path: string[],
857
- filterString: string,
858
- ): ASTFilteredFieldExpression;
859
- addWhere(
860
- name: string,
861
- path: string[],
862
- filter: ParsedFilter,
863
- ): ASTFilteredFieldExpression;
864
- addWhere(name: string, filterString: string): ASTFilteredFieldExpression;
865
- addWhere(name: string, filter: ParsedFilter): ASTFilteredFieldExpression;
866
- fromReference(
867
- name: string,
868
- path: string[] | void,
869
- rename: string | void,
870
- ): ASTAggregateViewOperation;
871
- }
872
- declare export class ASTField
873
- extends
874
- ASTObjectNode<
875
- Malloy.Field,
876
- { expressionASTExpression, annotations?ASTAnnotationList, ... },
877
- >
878
- implements IASTAnnotatable
879
- {
880
- nodeMalloy.Field;
881
- constructor(node: Malloy.Field): void;
882
- get expression(): ASTExpression;
883
- set expression(expression: ASTExpression): void;
884
- get name(): string;
885
- get type():
886
- | Malloy.AtomicType
887
- | { timeframeMalloy.DateTimeframe, kind"date_type", ... }
888
- | { timeframeMalloy.TimestampTimeframe, kind"timestamp_type", ... };
889
- get annotations(): ASTAnnotationList | void;
890
- set annotations(annotations: ASTAnnotationList | void): void;
891
- getReference(): Malloy.Reference;
892
- getOrAddAnnotations(): ASTAnnotationList;
893
- getInheritedTag(prefix?: RegExp | string): Tag;
894
- getIntrinsicTag(prefix?: RegExp | string): Tag;
895
- getTag(prefix?: RegExp | string): Tag;
896
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
897
- removeTagProperty(path: Path, prefix?: string): void;
898
- get segment(): ASTSegmentViewDefinition;
899
- getInheritedAnnotations(): Malloy.Annotation[];
900
- }
901
- export type ASTExpression =
902
- | ASTReferenceExpression
903
- | ASTFilteredFieldExpression
904
- | ASTTimeTruncationExpression;
905
- declare export const ASTExpression: {
906
- from(value: Malloy.Expression): ASTExpression,
907
- ...
908
- };
909
- declare export class ASTReferenceExpression
910
- extends
911
- ASTObjectNode<
912
- Malloy.ExpressionWithFieldReference,
913
- {
914
- kind"field_reference",
915
- namestring,
916
- path?string[],
917
- parameters?ASTParameterValueList,
918
- ...
919
- },
920
- >
921
- implements IASTReference
922
- {
923
- nodeMalloy.ExpressionWithFieldReference;
924
- +kindMalloy.ExpressionType;
925
- constructor(node: Malloy.ExpressionWithFieldReference): void;
926
- get name(): string;
927
- get parameters(): ASTParameterValueList | void;
928
- set parameters(parameters: ASTParameterValueList | void): void;
929
- get field(): ASTField;
930
- get path(): string[] | void;
931
- getReference(): Malloy.ExpressionWithFieldReference;
932
- getFieldInfo(): Malloy.FieldInfoWithDimension | Malloy.FieldInfoWithMeasure;
933
- get fieldType(): Malloy.AtomicType;
934
- getInheritedAnnotations(): Malloy.Annotation[];
935
- getOrAddParameters(): any;
936
- setParameter(name: string, value: RawLiteralValue): void;
937
- tryGetParameter(name: string): ASTParameterValue | void;
938
- }
939
- declare export class ASTTimeTruncationExpression
940
- extends
941
- ASTObjectNode<
942
- Malloy.ExpressionWithTimeTruncation,
943
- {
944
- kind"time_truncation",
945
- field_referenceASTFieldReference,
946
- truncationMalloy.TimestampTimeframe,
947
- ...
948
- },
949
- >
950
- {
951
- nodeMalloy.ExpressionWithTimeTruncation;
952
- +kindMalloy.ExpressionType;
953
- constructor(node: Malloy.ExpressionWithTimeTruncation): void;
954
- getReference(): Malloy.Reference;
955
- get fieldReference(): ASTFieldReference;
956
- get truncation(): Malloy.TimestampTimeframe;
957
- get name(): string;
958
- get field(): ASTField;
959
- getFieldInfo(): Malloy.FieldInfoWithDimension | Malloy.FieldInfoWithMeasure;
960
- get fieldType():
961
- | { timeframeMalloy.DateTimeframe, kind"date_type", ... }
962
- | { timeframeMalloy.TimestampTimeframe, kind"timestamp_type", ... };
963
- getInheritedAnnotations(): Malloy.Annotation[];
964
- }
965
- declare export class ASTWhere
966
- extends ASTObjectNode<Malloy.Where, { filterASTFilter, ... }>
967
- {
968
- constructor(node: Malloy.Where): void;
969
- get filter(): ASTFilterWithFilterString;
970
- get list(): ASTWhereList;
971
- delete(): void;
972
- }
973
- declare export class ASTWhereList extends ASTListNode<Malloy.Where, ASTWhere> {
974
- constructor(wheres: Malloy.Where[]): void;
975
- get expression(): ASTFilteredFieldExpression;
976
- }
977
- declare export class ASTFilteredFieldExpression
978
- extends
979
- ASTObjectNode<
980
- Malloy.ExpressionWithFilteredField,
981
- {
982
- kind"filtered_field",
983
- field_referenceASTFieldReference,
984
- whereASTWhereList,
985
- ...
986
- },
987
- >
988
- {
989
- nodeMalloy.ExpressionWithFilteredField;
990
- +kindMalloy.ExpressionType;
991
- constructor(node: Malloy.ExpressionWithFilteredField): void;
992
- getReference(): Malloy.Reference;
993
- get fieldReference(): ASTFieldReference;
994
- get name(): string;
995
- get where(): ASTWhereList;
996
- get field(): ASTField;
997
- getFieldInfo(): Malloy.FieldInfoWithMeasure;
998
- get fieldType(): Malloy.AtomicType;
999
- getInheritedAnnotations(): Malloy.Annotation[];
1000
- }
1001
- declare export class ASTNestViewOperation
1002
- extends
1003
- ASTObjectNode<
1004
- Malloy.ViewOperationWithNest,
1005
- { kind"nest", name?string, viewASTView, ... },
1006
- >
1007
- implements IASTAnnotatable
1008
- {
1009
- nodeMalloy.ViewOperationWithNest;
1010
- +kindMalloy.ViewOperationType;
1011
- constructor(node: Malloy.ViewOperationWithNest): void;
1012
- get view(): ASTView;
1013
- get annotations(): ASTAnnotationList | void;
1014
- get name(): string;
1015
- set name(name: string): void;
1016
- get list(): ASTViewOperationList;
1017
- getOrAddAnnotations(): ASTAnnotationList;
1018
- getInheritedTag(prefix?: RegExp | string): Tag;
1019
- getIntrinsicTag(prefix?: RegExp | string): Tag;
1020
- getTag(prefix?: RegExp | string): Tag;
1021
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
1022
- removeTagProperty(path: Path, prefix?: string): void;
1023
- delete(): void;
1024
- rename(name: string): void;
1025
- getFieldInfo(): Malloy.FieldInfo;
1026
- fromReference(
1027
- name: string,
1028
- path: string[] | void,
1029
- rename: string | void,
1030
- ): ASTNestViewOperation;
1031
- }
1032
- declare export class ASTWhereViewOperation
1033
- extends
1034
- ASTObjectNode<
1035
- Malloy.ViewOperationWithWhere,
1036
- { kind"where", filterASTFilter, ... },
1037
- >
1038
- {
1039
- nodeMalloy.ViewOperationWithWhere;
1040
- +kindMalloy.ViewOperationType;
1041
- constructor(node: Malloy.ViewOperationWithWhere): void;
1042
- get filter(): ASTFilterWithFilterString;
1043
- get list(): ASTViewOperationList;
1044
- delete(): void;
1045
- }
1046
- export type ASTFilter = ASTFilterWithFilterString;
1047
- declare export const ASTFilter: {
1048
- from(filter: Malloy.Filter): ASTFilterWithFilterString,
1049
- ...
1050
- };
1051
- declare export class ASTFilterWithFilterString
1052
- extends
1053
- ASTObjectNode<
1054
- Malloy.FilterWithFilterString,
1055
- {
1056
- kind"filter_string",
1057
- field_referenceASTFieldReference,
1058
- filterstring,
1059
- ...
1060
- },
1061
- >
1062
- {
1063
- nodeMalloy.FilterWithFilterString;
1064
- +kindMalloy.FilterType;
1065
- constructor(node: Malloy.FilterWithFilterString): void;
1066
- get fieldReference(): ASTFieldReference;
1067
- get filterString(): string;
1068
- set filterString(filter: string): void;
1069
- setFilterString(filterString: string): void;
1070
- getFieldInfo(): Malloy.FieldInfoWithDimension | Malloy.FieldInfoWithMeasure;
1071
- getFilterType(): FilterType | "other";
1072
- setFilter(filter: ParsedFilter): void;
1073
- getFilter(): ParsedFilter;
1074
- }
1075
- declare export class ASTView
1076
- extends
1077
- ASTObjectNode<
1078
- Malloy.View,
1079
- { definitionASTViewDefinition, annotations?ASTAnnotationList, ... },
1080
- >
1081
- implements IASTAnnotatable
1082
- {
1083
- nodeMalloy.View;
1084
- constructor(node: Malloy.View): void;
1085
- get definition(): ASTViewDefinition;
1086
- set definition(definition: ASTViewDefinition): void;
1087
- get name(): string | void;
1088
- getOrAddDefaultSegment(): ASTSegmentViewDefinition;
1089
- get nest(): ASTNestViewOperation;
1090
- getInputSchema(): Malloy.Schema;
1091
- getOutputSchema(): Malloy.Schema;
1092
- propagateUp(f: PropagationFunction): void;
1093
- propagateDown(f: PropagationFunction): void;
1094
- reorderFields(names: string[]): void;
1095
- get annotations(): ASTAnnotationList | void;
1096
- getOrAddAnnotations(): ASTAnnotationList;
1097
- getInheritedAnnotations(): Malloy.Annotation[];
1098
- getInheritedTag(prefix?: RegExp | string): Tag;
1099
- getIntrinsicTag(prefix?: RegExp | string): Tag;
1100
- getTag(prefix?: RegExp | string): Tag;
1101
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
1102
- removeTagProperty(path: Path, prefix?: string): void;
1103
- }
1104
- declare export class ASTLimitViewOperation
1105
- extends
1106
- ASTObjectNode<
1107
- Malloy.ViewOperationWithLimit,
1108
- { kind"limit", limitnumber, ... },
1109
- >
1110
- {
1111
- nodeMalloy.ViewOperationWithLimit;
1112
- +kindMalloy.ViewOperationType;
1113
- get limit(): number;
1114
- set limit(limit: number): void;
1115
- constructor(node: Malloy.ViewOperationWithLimit): void;
1116
- get list(): ASTViewOperationList;
1117
- delete(): void;
1118
- validateLimit(limit: number): void;
1119
- }
1120
- declare export class ASTAnnotationList
1121
- extends ASTListNode<Malloy.Annotation, ASTAnnotation>
1122
- {
1123
- constructor(annotations: Malloy.Annotation[]): void;
1124
- get items(): ASTAnnotation[];
1125
- getInheritedAnnotations(): Malloy.Annotation[];
1126
- getIntrinsicTag(prefix?: RegExp | string): Tag;
1127
- getTag(prefix?: RegExp | string): Tag;
1128
- get annotations(): Malloy.Annotation[];
1129
- setTagProperty(path: Path, value?: TagSetValue, prefix?: string): void;
1130
- removeTagProperty(path: Path, prefix?: string): void;
1131
- }
1132
- declare export class ASTAnnotation
1133
- extends ASTObjectNode<Malloy.Annotation, { valuestring, ... }>
1134
- {
1135
- nodeMalloy.Annotation;
1136
- +kindMalloy.ViewOperationType;
1137
- get value(): string;
1138
- set value(value: string): void;
1139
- constructor(node: Malloy.Annotation): void;
1140
- get list(): ASTAnnotationList;
1141
- get index(): number;
1142
- delete(): void;
1143
- getIntrinsicTag(): Tag;
1144
- getTag(): Tag;
1145
- hasPrefix(prefix: string): boolean;
1146
- hasIntrinsicTagProperty(path: Path): boolean;
1147
- setTagProperty(path: Path, value: TagSetValue): void;
1148
- removeTagProperty(path: Path): void;
1149
- }
1150
- declare export {};
@@ -1,3 +0,0 @@
1
- declare module 'flow-api-translator' {
2
- async function unstable_translateTSDefToFlowDef(file: string): Promise<string>;
3
- }
@@ -1,23 +0,0 @@
1
- // eslint-disable-next-line node/no-unpublished-import
2
- import {unstable_translateTSDefToFlowDef} from 'flow-api-translator';
3
- import * as fs from 'fs';
4
-
5
- async function go() {
6
- const skipFiles = ['expects.d.ts', 'query-ast.spec.d.ts'];
7
- const files = fs
8
- .readdirSync('./dist')
9
- .filter(f => f.endsWith('.d.ts') && !skipFiles.includes(f));
10
- if (fs.existsSync('./flow')) fs.rmdirSync('./flow', {recursive: true});
11
- fs.mkdirSync('./flow');
12
- await Promise.all(
13
- files.map(async file => {
14
- // eslint-disable-next-line no-console
15
- console.log(`Generating flow types for file ${file}`);
16
- const contents = fs.readFileSync(`./dist/${file}`, 'utf8');
17
- const flow = await unstable_translateTSDefToFlowDef(contents);
18
- await fs.promises.writeFile(`./flow/${file}`, flow);
19
- })
20
- );
21
- }
22
-
23
- go();