@elaraai/e3-ui-components 1.0.83 → 1.0.85

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 (190) hide show
  1. package/README.md +113 -6
  2. package/dist/components/DataTaskPreview.d.ts +35 -1
  3. package/dist/components/DataTaskPreview.d.ts.map +1 -1
  4. package/dist/components/DatasetPreview.d.ts +16 -0
  5. package/dist/components/DatasetPreview.d.ts.map +1 -1
  6. package/dist/components/InputPreview.d.ts +12 -0
  7. package/dist/components/InputPreview.d.ts.map +1 -1
  8. package/dist/components/PagedDatasetPreview.d.ts +15 -0
  9. package/dist/components/PagedDatasetPreview.d.ts.map +1 -1
  10. package/dist/components/TaskLogs.d.ts +19 -0
  11. package/dist/components/TaskLogs.d.ts.map +1 -1
  12. package/dist/components/TaskPreview.d.ts +24 -0
  13. package/dist/components/TaskPreview.d.ts.map +1 -1
  14. package/dist/components/UITaskPreview.d.ts +4 -1
  15. package/dist/components/UITaskPreview.d.ts.map +1 -1
  16. package/dist/components/VirtualizedLogViewer.d.ts +29 -1
  17. package/dist/components/VirtualizedLogViewer.d.ts.map +1 -1
  18. package/dist/components/controlled-search.d.ts +22 -0
  19. package/dist/components/controlled-search.d.ts.map +1 -0
  20. package/dist/components/preview-controls.d.ts +73 -0
  21. package/dist/components/preview-controls.d.ts.map +1 -0
  22. package/dist/diff/index.d.ts.map +1 -1
  23. package/dist/experiment/index.d.ts.map +1 -1
  24. package/dist/hooks/executions.d.ts +17 -0
  25. package/dist/hooks/executions.d.ts.map +1 -1
  26. package/dist/hooks/index.d.ts +1 -1
  27. package/dist/hooks/index.d.ts.map +1 -1
  28. package/dist/hooks/useDatasetValue.d.ts +19 -1
  29. package/dist/hooks/useDatasetValue.d.ts.map +1 -1
  30. package/dist/hooks/useTaskLogsHook.d.ts +67 -3
  31. package/dist/hooks/useTaskLogsHook.d.ts.map +1 -1
  32. package/dist/in-memory-call-7_3frW52.js +615 -0
  33. package/dist/in-memory-call-7_3frW52.js.map +1 -0
  34. package/dist/in-memory-call-_r5DJotS.cjs +614 -0
  35. package/dist/in-memory-call-_r5DJotS.cjs.map +1 -0
  36. package/dist/index.cjs +25860 -5731
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.ts +14 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +28383 -8253
  41. package/dist/index.js.map +1 -1
  42. package/dist/platform/bind-runtime.d.ts +18 -3
  43. package/dist/platform/bind-runtime.d.ts.map +1 -1
  44. package/dist/platform/dataset-hooks.d.ts +15 -3
  45. package/dist/platform/dataset-hooks.d.ts.map +1 -1
  46. package/dist/platform/dataset-store.d.ts +35 -7
  47. package/dist/platform/dataset-store.d.ts.map +1 -1
  48. package/dist/platform/e3-config.d.ts +26 -2
  49. package/dist/platform/e3-config.d.ts.map +1 -1
  50. package/dist/platform/func-runtime.d.ts +11 -5
  51. package/dist/platform/func-runtime.d.ts.map +1 -1
  52. package/dist/platform/index.d.ts +2 -2
  53. package/dist/platform/index.d.ts.map +1 -1
  54. package/dist/platform/paged-runtime.d.ts +46 -9
  55. package/dist/platform/paged-runtime.d.ts.map +1 -1
  56. package/dist/platform/record-runtime.d.ts +45 -7
  57. package/dist/platform/record-runtime.d.ts.map +1 -1
  58. package/dist/platform/recovery.d.ts +44 -0
  59. package/dist/platform/recovery.d.ts.map +1 -0
  60. package/dist/platform/staged-store.d.ts +16 -0
  61. package/dist/platform/staged-store.d.ts.map +1 -1
  62. package/dist/platform/tracked-channel.d.ts +12 -0
  63. package/dist/platform/tracked-channel.d.ts.map +1 -1
  64. package/dist/query/about.d.ts +50 -0
  65. package/dist/query/about.d.ts.map +1 -0
  66. package/dist/query/autocomplete.d.ts +112 -0
  67. package/dist/query/autocomplete.d.ts.map +1 -0
  68. package/dist/query/builder.d.ts +29 -0
  69. package/dist/query/builder.d.ts.map +1 -0
  70. package/dist/query/calls.d.ts +46 -0
  71. package/dist/query/calls.d.ts.map +1 -0
  72. package/dist/query/datasets-tab.d.ts +52 -0
  73. package/dist/query/datasets-tab.d.ts.map +1 -0
  74. package/dist/query/downloads.d.ts +29 -0
  75. package/dist/query/downloads.d.ts.map +1 -0
  76. package/dist/query/drops.d.ts +28 -0
  77. package/dist/query/drops.d.ts.map +1 -0
  78. package/dist/query/foot.d.ts +22 -0
  79. package/dist/query/foot.d.ts.map +1 -0
  80. package/dist/query/hooks.d.ts +265 -0
  81. package/dist/query/hooks.d.ts.map +1 -0
  82. package/dist/query/in-memory-call.d.ts +150 -0
  83. package/dist/query/in-memory-call.d.ts.map +1 -0
  84. package/dist/query/jq-editor.d.ts +34 -0
  85. package/dist/query/jq-editor.d.ts.map +1 -0
  86. package/dist/query/library-tab.d.ts +33 -0
  87. package/dist/query/library-tab.d.ts.map +1 -0
  88. package/dist/query/library.d.ts +20 -0
  89. package/dist/query/library.d.ts.map +1 -0
  90. package/dist/query/model/cards.d.ts +179 -0
  91. package/dist/query/model/cards.d.ts.map +1 -0
  92. package/dist/query/model/index.d.ts +19 -0
  93. package/dist/query/model/index.d.ts.map +1 -0
  94. package/dist/query/model/messages.d.ts +1253 -0
  95. package/dist/query/model/messages.d.ts.map +1 -0
  96. package/dist/query/model/refs.d.ts +92 -0
  97. package/dist/query/model/refs.d.ts.map +1 -0
  98. package/dist/query/model/slots.d.ts +213 -0
  99. package/dist/query/model/slots.d.ts.map +1 -0
  100. package/dist/query/model/summaries.d.ts +104 -0
  101. package/dist/query/model/summaries.d.ts.map +1 -0
  102. package/dist/query/model/words.d.ts +331 -0
  103. package/dist/query/model/words.d.ts.map +1 -0
  104. package/dist/query/one-shot.d.ts +266 -0
  105. package/dist/query/one-shot.d.ts.map +1 -0
  106. package/dist/query/open-query.d.ts +214 -0
  107. package/dist/query/open-query.d.ts.map +1 -0
  108. package/dist/query/parts.d.ts +115 -0
  109. package/dist/query/parts.d.ts.map +1 -0
  110. package/dist/query/plan-popover.d.ts +22 -0
  111. package/dist/query/plan-popover.d.ts.map +1 -0
  112. package/dist/query/plan.d.ts +353 -0
  113. package/dist/query/plan.d.ts.map +1 -0
  114. package/dist/query/query-east.d.ts +21 -0
  115. package/dist/query/query-east.d.ts.map +1 -0
  116. package/dist/query/query-tab.d.ts +21 -0
  117. package/dist/query/query-tab.d.ts.map +1 -0
  118. package/dist/query/results-table.d.ts +153 -0
  119. package/dist/query/results-table.d.ts.map +1 -0
  120. package/dist/query/results.d.ts +137 -0
  121. package/dist/query/results.d.ts.map +1 -0
  122. package/dist/query/run.d.ts +199 -0
  123. package/dist/query/run.d.ts.map +1 -0
  124. package/dist/query/save-popover.d.ts +29 -0
  125. package/dist/query/save-popover.d.ts.map +1 -0
  126. package/dist/query/session.d.ts +409 -0
  127. package/dist/query/session.d.ts.map +1 -0
  128. package/dist/query/shape-line.d.ts +21 -0
  129. package/dist/query/shape-line.d.ts.map +1 -0
  130. package/dist/query/source.d.ts +21 -0
  131. package/dist/query/source.d.ts.map +1 -0
  132. package/dist/query/status-line.d.ts +48 -0
  133. package/dist/query/status-line.d.ts.map +1 -0
  134. package/dist/query/step-card.d.ts +30 -0
  135. package/dist/query/step-card.d.ts.map +1 -0
  136. package/dist/query/steps/check.d.ts +162 -0
  137. package/dist/query/steps/check.d.ts.map +1 -0
  138. package/dist/query/steps/count.d.ts +49 -0
  139. package/dist/query/steps/count.d.ts.map +1 -0
  140. package/dist/query/steps/edit.d.ts +108 -0
  141. package/dist/query/steps/edit.d.ts.map +1 -0
  142. package/dist/query/steps/fields.d.ts +101 -0
  143. package/dist/query/steps/fields.d.ts.map +1 -0
  144. package/dist/query/steps/index.d.ts +22 -0
  145. package/dist/query/steps/index.d.ts.map +1 -0
  146. package/dist/query/steps/jq.d.ts +188 -0
  147. package/dist/query/steps/jq.d.ts.map +1 -0
  148. package/dist/query/steps/parse.d.ts +38 -0
  149. package/dist/query/steps/parse.d.ts.map +1 -0
  150. package/dist/query/steps/print.d.ts +195 -0
  151. package/dist/query/steps/print.d.ts.map +1 -0
  152. package/dist/query/steps/shape.d.ts +90 -0
  153. package/dist/query/steps/shape.d.ts.map +1 -0
  154. package/dist/query/steps/values.d.ts +85 -0
  155. package/dist/query/steps/values.d.ts.map +1 -0
  156. package/dist/query/toolbar.d.ts +56 -0
  157. package/dist/query/toolbar.d.ts.map +1 -0
  158. package/dist/query/use-query-editor.d.ts +153 -0
  159. package/dist/query/use-query-editor.d.ts.map +1 -0
  160. package/dist/query/use-query-session.d.ts +55 -0
  161. package/dist/query/use-query-session.d.ts.map +1 -0
  162. package/dist/query/words.d.ts +60 -0
  163. package/dist/query/words.d.ts.map +1 -0
  164. package/dist/query.cjs +16 -0
  165. package/dist/query.cjs.map +1 -0
  166. package/dist/query.js +16 -0
  167. package/dist/query.js.map +1 -0
  168. package/dist/shared/name-popover.d.ts +38 -0
  169. package/dist/shared/name-popover.d.ts.map +1 -0
  170. package/dist/studio/builder.d.ts +20 -0
  171. package/dist/studio/builder.d.ts.map +1 -0
  172. package/dist/studio/inspector.d.ts +18 -0
  173. package/dist/studio/inspector.d.ts.map +1 -0
  174. package/dist/studio/library.d.ts +20 -0
  175. package/dist/studio/library.d.ts.map +1 -0
  176. package/dist/studio/messages.d.ts +318 -0
  177. package/dist/studio/messages.d.ts.map +1 -0
  178. package/dist/studio/open-page.d.ts +13 -0
  179. package/dist/studio/open-page.d.ts.map +1 -0
  180. package/dist/studio/page.d.ts +61 -0
  181. package/dist/studio/page.d.ts.map +1 -0
  182. package/dist/studio/palette.d.ts +41 -0
  183. package/dist/studio/palette.d.ts.map +1 -0
  184. package/dist/studio/publish.d.ts +21 -0
  185. package/dist/studio/publish.d.ts.map +1 -0
  186. package/dist/studio/save-template.d.ts +18 -0
  187. package/dist/studio/save-template.d.ts.map +1 -0
  188. package/dist/studio/studio-east.d.ts +45 -0
  189. package/dist/studio/studio-east.d.ts.map +1 -0
  190. package/package.json +19 -14
@@ -0,0 +1,162 @@
1
+ import { EastType } from '@elaraai/east';
2
+ import { StepLayout, StepSlot } from './print.js';
3
+ import { Shape } from './shape.js';
4
+ import { Condition, StepQuery, StepValue } from './values.js';
5
+ /** A jq step's note, in the checker's manner: a part of the program the visual view keeps as jq. */
6
+ export declare const JQ_STEP_NOTE = "custom: not a visual step; it stays as jq in the visual editor.";
7
+ /**
8
+ * Where a diagnostic is placed in a step besides a condition: a step's
9
+ * {@link StepSlot}; `cmp` and `inner`, a condition's comparison and inner
10
+ * condition; `as` and `over`, the names a step gives; `source`, the data
11
+ * source; `text`, a jq step's text.
12
+ */
13
+ export type DiagnosticSlot = StepSlot | "cmp" | "inner" | "as" | "over" | "source" | "text";
14
+ /** A fix, as an edit of the steps, which `applyFix` applies. */
15
+ export type StepFix =
16
+ /** Keep only the rows of a case first: `field is case` at the front of this filter, or a filter of it before this step. */
17
+ {
18
+ readonly kind: "addCaseCondition";
19
+ readonly label: string;
20
+ readonly stepId: string;
21
+ readonly field: string;
22
+ readonly case: string;
23
+ }
24
+ /** Use another field in a slot or a condition. */
25
+ | {
26
+ readonly kind: "setField";
27
+ readonly label: string;
28
+ readonly stepId: string;
29
+ readonly slot: DiagnosticSlot;
30
+ readonly condId?: string;
31
+ readonly id?: string;
32
+ readonly field: string;
33
+ }
34
+ /** Use another value in a condition. */
35
+ | {
36
+ readonly kind: "setValue";
37
+ readonly label: string;
38
+ readonly stepId: string;
39
+ readonly condId: string;
40
+ readonly value: StepValue;
41
+ }
42
+ /** Compare a variant's case, not the whole value. */
43
+ | {
44
+ readonly kind: "unwhole";
45
+ readonly label: string;
46
+ readonly stepId: string;
47
+ readonly condId: string;
48
+ }
49
+ /** Take the step out. */
50
+ | {
51
+ readonly kind: "removeStep";
52
+ readonly label: string;
53
+ readonly stepId: string;
54
+ }
55
+ /** Edit a jq step's text: the checker's own fix, at offsets in the step's text. */
56
+ | {
57
+ readonly kind: "editJq";
58
+ readonly label: string;
59
+ readonly stepId: string;
60
+ readonly edits: readonly {
61
+ readonly from: number;
62
+ readonly to: number;
63
+ readonly insert: string;
64
+ }[];
65
+ };
66
+ /** A problem in a query's steps, where it is, and how to fix it. */
67
+ export interface StepDiagnostic {
68
+ /** The step it is in; `""` for the data source. */
69
+ readonly stepId: string;
70
+ /** The condition it is in. */
71
+ readonly condId?: string;
72
+ /** The slot it is on. */
73
+ readonly slot?: DiagnosticSlot;
74
+ /** What the slot is for: a total's id, a field shown's, a field brought in, an input's name. */
75
+ readonly id?: string;
76
+ /** An error stops the query running; a warning does not; a note says what a jq step is. */
77
+ readonly severity: "error" | "warning" | "note";
78
+ /** The checker's code; `incomplete` for a slot not filled in; `custom` for a jq step; `too_many_rows` for a range a run cuts off. */
79
+ readonly code: string;
80
+ /** The checker's sentence, or the steps' own, in jq's words. */
81
+ readonly message: string;
82
+ /**
83
+ * What the builder's plain words need: `field` (the field's ref), `kind`,
84
+ * `name` and, for a payload's field, `parent`, `case` and `leaf`; `value`
85
+ * the condition's value; `suggestion` the checker's first; `what` what an
86
+ * unfinished slot needs; `cmp` and `fn` the comparison and the total;
87
+ * `dataset` a Look up's data source, with its `kind`; `rows` and `max` a
88
+ * range's rows and the most a run returns.
89
+ */
90
+ readonly context: Readonly<Record<string, string>>;
91
+ /** Its fixes, best first. */
92
+ readonly fixes: readonly StepFix[];
93
+ }
94
+ /** One step's shapes, as the check found them. */
95
+ export interface CheckedStepStage {
96
+ /** The step's id. */
97
+ readonly stepId: string;
98
+ /** The shape of the rows it takes. */
99
+ readonly before: Shape;
100
+ /** The shape it gives: its input's when it is unfinished or does not check. */
101
+ readonly after: Shape;
102
+ }
103
+ /** What checking a query's steps found. */
104
+ export interface CheckedSteps {
105
+ /** The printed program. */
106
+ readonly program: string;
107
+ /** The shape the data source gives. */
108
+ readonly source: Shape;
109
+ /** Each step's shapes, in order. */
110
+ readonly stages: readonly CheckedStepStage[];
111
+ /** The shape the query gives. */
112
+ readonly final: Shape;
113
+ /** The problems, by step. */
114
+ readonly diagnostics: readonly StepDiagnostic[];
115
+ /** How many are errors. */
116
+ readonly errors: number;
117
+ /** How many are warnings, unfinished slots included. */
118
+ readonly warnings: number;
119
+ /** The layout the check was made on: the program's ranges, and east's check. */
120
+ readonly layout: StepLayout;
121
+ }
122
+ /**
123
+ * The type of a data source of the root.
124
+ *
125
+ * @param root - the root's type: a struct of the data sources
126
+ * @param name - the data source's name
127
+ * @returns its type, or `undefined` when the root has none of that name
128
+ */
129
+ export declare function datasetType(root: EastType, name: string): EastType | undefined;
130
+ /**
131
+ * A condition of a filter by its id, with the rows it tests: the step's, or
132
+ * a list's items for a condition inside has any where.
133
+ *
134
+ * @param conds - the filter's conditions
135
+ * @param id - the condition's id
136
+ * @param shape - the rows the filter takes
137
+ * @returns the condition and the rows it tests, or `undefined` when no condition has that id
138
+ */
139
+ export declare function conditionIn(conds: readonly Condition[], id: string, shape: Shape): {
140
+ condition: Condition;
141
+ shape: Shape;
142
+ } | undefined;
143
+ /**
144
+ * Checks a query's steps: once, through east's checker, with what the steps
145
+ * check themselves.
146
+ *
147
+ * @param query - the query
148
+ * @param root - the root's type: a struct of the data sources
149
+ * @returns the program, each step's shapes, and the diagnostics by step
150
+ *
151
+ * @remarks
152
+ * An unfinished slot is an `incomplete` warning, since an unfinished step is
153
+ * not in the program. The checker's diagnostics keep their code and message,
154
+ * placed by span on the step, condition and slot they came from; each jq
155
+ * step gets a `custom` note. Where the steps find a problem themselves — a
156
+ * field of the wrong kind in a slot, a comparison the field's kind does not
157
+ * take, a Look up in a data source that is not a Dict — what the checker
158
+ * finds in that slot, that condition or that step follows from it and is
159
+ * left out, so one problem is reported once.
160
+ */
161
+ export declare function checkSteps(query: StepQuery, root: EastType): CheckedSteps;
162
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../../src/query/steps/check.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EAEH,KAAK,QAAQ,EAChB,MAAM,eAAe,CAAC;AAGvB,OAAO,EAA+D,KAAK,UAAU,EAAE,KAAK,QAAQ,EAAE,M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AarI;AAwHD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,YAAY,CA6BzE"}
@@ -0,0 +1,49 @@
1
+ import { ArrayType, IntegerType, EastType, ValueTypeOf } from '@elaraai/east';
2
+ import { StepQuery } from './values.js';
3
+ /** The id a count of the data source's rows is given, beside the steps' ids. */
4
+ export declare const SOURCE_COUNT = "$source";
5
+ /** How many rows a counting run returns, by default. */
6
+ export declare const DEFAULT_MAX_ROWS = 1000;
7
+ /** The counts a counting program gives: one per counted stage. */
8
+ declare const CountsType: ArrayType<IntegerType>;
9
+ /** A counting program, and what its counts count. */
10
+ export interface CountingProgram {
11
+ /** The program's text. */
12
+ readonly text: string;
13
+ /** What each count is of, in order: {@link SOURCE_COUNT}, or a step's id. */
14
+ readonly counted: readonly string[];
15
+ }
16
+ /**
17
+ * The program that runs a query and counts each stage's rows.
18
+ *
19
+ * @param query - the query
20
+ * @param root - the root's type: a struct of the data sources
21
+ * @param options - `maxRows`, how many rows of a rows result to return (1 000 by default)
22
+ * @returns the program, and what its counts are of
23
+ *
24
+ * @remarks
25
+ * After the data source and each step whose shape is rows, the program binds
26
+ * `length as $nK`; it ends `{counts: [$n0, …], result: …}`, the result
27
+ * `.[:maxRows]` when the query gives rows and `.` otherwise. It checks against
28
+ * the root as the query does.
29
+ */
30
+ export declare function countingProgram(query: StepQuery, root: EastType, options?: {
31
+ maxRows?: number;
32
+ }): CountingProgram;
33
+ /**
34
+ * Reads a counting run's output.
35
+ *
36
+ * @param output - what the counting program gave: its counts and its result
37
+ * @param counted - what each count is of, as {@link countingProgram} gave it
38
+ * @returns each count, by {@link SOURCE_COUNT} or step id, and the result
39
+ * @throws {Error} When the counts are not one whole number per counted stage.
40
+ */
41
+ export declare function readCounts<T>(output: {
42
+ readonly counts: ValueTypeOf<typeof CountsType>;
43
+ readonly result: T;
44
+ }, counted: readonly string[]): {
45
+ counts: ReadonlyMap<string, number>;
46
+ value: T;
47
+ };
48
+ export {};
49
+ //# sourceMappingURL=count.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"count.d.ts","sourceRoot":"","sources":["../../../src/query/steps/count.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,WAAW,EAAsB,KAAK,QAAQ,EAAE,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5G,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAE7C,gFAAgF;AAChF,eAAO,MAAM,YAAY,YAAY,CAAC;AAEtC,wDAAwD;AACxD,eAAO,MAAM,gBAAgB,OAAO,CAAC;AAErC,kEAAkE;AAClE,QAAA,MAAM,UAAU,wBAAyB,CAAC;AAE1C,qDAAqD;AACrD,MAAM,WAAW,eAAe;IAC5B,0BAA0B;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;CACvC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,eAAe,CAiBrH;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,CAAC,EACxB,MAAM,EAAE;IAAE,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,OAAO,UAAU,CAAC,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAA;CAAE,EAC/E,OAAO,EAAE,SAAS,MAAM,EAAE,GAC3B;IAAE,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,CAAC,CAAA;CAAE,CAQnD"}
@@ -0,0 +1,108 @@
1
+ import { EastType, option } from '@elaraai/east';
2
+ import { StepFix } from './check.js';
3
+ import { Shape } from './shape.js';
4
+ import { Condition, Match, Step, StepKind, StepQuery, StepValue } from './values.js';
5
+ /**
6
+ * An empty test, its slots not chosen.
7
+ *
8
+ * @param id - its id; a fresh one when omitted
9
+ * @returns the condition
10
+ */
11
+ export declare function emptyCondition(id?: string): Condition;
12
+ /**
13
+ * A query with a step inserted.
14
+ *
15
+ * @param query - the query
16
+ * @param step - the step
17
+ * @param at - where: before the step at this index; at the end when omitted
18
+ * @returns the new query
19
+ */
20
+ export declare function insertStep(query: StepQuery, step: Step, at?: number): StepQuery;
21
+ /** A query without a step. */
22
+ export declare function removeStep(query: StepQuery, stepId: string): StepQuery;
23
+ /**
24
+ * A query with a step moved.
25
+ *
26
+ * @param query - the query
27
+ * @param stepId - the step
28
+ * @param by - how many places, up (negative) or down; a move past an end is no move
29
+ * @returns the new query
30
+ */
31
+ export declare function moveStep(query: StepQuery, stepId: string, by: number): StepQuery;
32
+ /** A query with a step replaced whole: the step given keeps its place. */
33
+ export declare function updateStep(query: StepQuery, stepId: string, step: Step): StepQuery;
34
+ /**
35
+ * A query with an empty condition added to a filter, or to a group in it.
36
+ *
37
+ * @param query - the query
38
+ * @param stepId - the filter
39
+ * @param groupId - the group; the filter itself when omitted
40
+ * @param id - the new condition's id; a fresh one when omitted
41
+ * @returns the new query
42
+ */
43
+ export declare function addCondition(query: StepQuery, stepId: string, groupId?: string, id?: string): StepQuery;
44
+ /**
45
+ * A query with a group added to a filter, or to a group in it: the opposite
46
+ * match to where it is, with two empty conditions.
47
+ *
48
+ * @param query - the query
49
+ * @param stepId - the filter
50
+ * @param groupId - the group it goes in; the filter itself when omitted
51
+ * @returns the new query
52
+ */
53
+ export declare function addGroup(query: StepQuery, stepId: string, groupId?: string): StepQuery;
54
+ /** A query without a condition, wherever it is in a filter. */
55
+ export declare function removeCondition(query: StepQuery, stepId: string, condId: string): StepQuery;
56
+ /**
57
+ * A query with a filter's or a group's match changed. A group inside it of
58
+ * the same match is no group any more, and its conditions join it.
59
+ *
60
+ * @param query - the query
61
+ * @param stepId - the filter
62
+ * @param groupId - the group; the filter itself when omitted
63
+ * @param match - the new match
64
+ * @returns the new query
65
+ */
66
+ export declare function setMatch(query: StepQuery, stepId: string, groupId: string | undefined, match: Match): StepQuery;
67
+ /** A query with a condition's value set. */
68
+ export declare function setConditionValue(query: StepQuery, stepId: string, condId: string, value: option<StepValue>): StepQuery;
69
+ /**
70
+ * A query with a condition's field set. A new field of the kind the old one
71
+ * was (a whole number and a number are one kind here) keeps the comparison
72
+ * and the value; another starts from its own comparison (is in year for a
73
+ * date, has at least 1 for a list, …).
74
+ *
75
+ * @param query - the query
76
+ * @param stepId - the filter
77
+ * @param condId - the condition
78
+ * @param field - the new field's ref
79
+ * @param root - the root's type
80
+ * @returns the new query
81
+ */
82
+ export declare function setConditionField(query: StepQuery, stepId: string, condId: string, field: string, root: EastType): StepQuery;
83
+ /**
84
+ * A query with a fix the check offers applied.
85
+ *
86
+ * @param query - the query
87
+ * @param fix - the fix
88
+ * @param root - the root's type
89
+ * @returns the new query
90
+ *
91
+ * @remarks
92
+ * Keep only a case's rows first puts `field is case` at the front of the
93
+ * filter the problem is in (in place of a case test of that field), and an
94
+ * any filter becomes all of it and the old conditions as a group; for a step
95
+ * of another kind, a filter of it goes before the step.
96
+ */
97
+ export declare function applyFix(query: StepQuery, fix: StepFix, root: EastType): StepQuery;
98
+ /**
99
+ * A new step of a kind, with the defaults it starts with
100
+ * (`Query Editor Spec.md` §4.4).
101
+ *
102
+ * @param kind - the kind of step
103
+ * @param before - the shape of the rows it will take
104
+ * @param root - the root's type, whose lookup tables a Look up starts from
105
+ * @returns the step, with fresh ids
106
+ */
107
+ export declare function newStep(kind: StepKind, before: Shape, root: EastType): Step;
108
+ //# sourceMappingURL=edit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"edit.d.ts","sourceRoot":"","sources":["../../../src/query/steps/edit.ts"],"names":[],"mappings":"AAAA;;;G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,+DAA+D;AAC/D,wBAAgB,eAAe,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAE3F;AAOD;;;;;;;;;GASG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,KAAK,EAAE,KAAK,GAAG,SAAS,CAQ/G;AAUD,4CAA4C;AAC5C,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,SAAS,CAEvH;AAmCD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CAkB5H;AAuCD;;;;;;;;;;;;;GAaG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,GAAG,SAAS,CA6BlF;AAsCD;;;;;;;;GAQG;AACH,wBAAgB,OAAO,CAAC,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAkE3E"}
@@ -0,0 +1,101 @@
1
+ import { EastType } from '@elaraai/east';
2
+ import { Shape } from './shape.js';
3
+ import { ComparisonKind } from './values.js';
4
+ /**
5
+ * What kind of value a field holds, as the builder offers it: text, a whole
6
+ * number, a number, a date, yes or no, one of some cases, a list, a record,
7
+ * a lookup table, a calculation, or anything else.
8
+ */
9
+ export type FieldKind = "text" | "int" | "num" | "date" | "bool" | "case" | "list" | "record" | "dict" | "fn" | "other";
10
+ /** A field a step can name, in a shape. */
11
+ export interface StepField {
12
+ /** How a step names it: `"total"`, `"status"`, `"status.shipped.date"`. */
13
+ readonly ref: string;
14
+ /** The name a step gives a field made from it: `"total"`, `"status"`, `"shipped_date"`. */
15
+ readonly name: string;
16
+ /** What kind of value it holds. */
17
+ readonly kind: FieldKind;
18
+ /** The type a read of it gives here: a payload field not narrowed to its case is an option. */
19
+ readonly type: EastType;
20
+ /** Whether it can be missing: an option, or a payload field not narrowed to its case. */
21
+ readonly optional: boolean;
22
+ /** The fields jq reads it through from a row: `["total"]`, `["status", "type"]`, `["status", "value", "date"]`. */
23
+ readonly path: readonly string[];
24
+ /** A case field's cases. */
25
+ readonly cases?: readonly string[];
26
+ /** A payload field's variant field, the case whose payload has it, its name in the payload, and whether the rows are narrowed to that case. */
27
+ readonly payload?: {
28
+ readonly parent: string;
29
+ readonly case: string;
30
+ readonly leaf: string;
31
+ readonly narrowed: boolean;
32
+ };
33
+ /** A list's item type. */
34
+ readonly element?: EastType;
35
+ }
36
+ /**
37
+ * The kind of value a type holds.
38
+ *
39
+ * @param type - a field's type
40
+ * @returns its kind, read through an option and a recursive wrapper
41
+ */
42
+ export declare function kindOf(type: EastType): FieldKind;
43
+ /**
44
+ * The fields of a record, as steps name them: each field; for a variant
45
+ * field, its case and each field of each struct case's payload.
46
+ *
47
+ * @param record - the record's type
48
+ * @param narrowed - the variant fields narrowed to one case, with the case
49
+ * @returns the fields, in the record's order, each variant's case before its payloads' fields
50
+ */
51
+ export declare function fieldsOfRecord(record: EastType, narrowed: ReadonlyMap<string, string>): StepField[];
52
+ /**
53
+ * The field catalog of a shape: the fields of its rows.
54
+ *
55
+ * @param shape - the shape
56
+ * @returns its rows' fields; none when it is not rows
57
+ */
58
+ export declare function fieldsOf(shape: Shape): StepField[];
59
+ /**
60
+ * The field a step names, in a shape.
61
+ *
62
+ * @param shape - the shape
63
+ * @param ref - how the step names it
64
+ * @returns the field, or `undefined` when the shape has none of that name
65
+ */
66
+ export declare function fieldByRef(shape: Shape, ref: string): StepField | undefined;
67
+ /**
68
+ * The fields jq reads a field through, for one the shape does not have: a
69
+ * name is read as itself, and `parent.case.leaf` as a payload's field, so the
70
+ * check names what is wrong.
71
+ *
72
+ * @param ref - how a step names it
73
+ * @returns the fields jq reads
74
+ */
75
+ export declare function pathOfUnknown(ref: string): string[];
76
+ /**
77
+ * The record each item of a list is, when the items are records.
78
+ *
79
+ * @param field - a list field
80
+ * @returns its item record, or `undefined`
81
+ */
82
+ export declare function itemRecordOf(field: StepField): EastType | undefined;
83
+ /**
84
+ * The comparisons a field takes (`Query Editor Spec.md` §4.4): its kind's,
85
+ * and is missing and has a value for an optional field that is not a
86
+ * payload's; a list takes has any where only when its items are records.
87
+ *
88
+ * @param field - the field
89
+ * @returns the comparisons, in the order the builder offers them
90
+ */
91
+ export declare function comparisonsFor(field: StepField): ComparisonKind[];
92
+ /**
93
+ * The comparison a field starts with when it is picked: is in year for a
94
+ * date, has at least for a list, is yes for yes or no, is at least for a
95
+ * number, and is otherwise.
96
+ *
97
+ * @param field - the field
98
+ * @returns the comparison
99
+ */
100
+ export declare function defaultComparison(field: StepField): ComparisonKind;
101
+ //# sourceMappingURL=fields.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../../../src/query/steps/fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAuD,KAAK,KAAK,EAAE,MAAM,YAAY,CAAC;AAC7F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAElD;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC;AAExH,2CAA2C;AAC3C,MAAM,WA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,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAGnD;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,CAInE;AAgBD;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,EAAE,CAIjE;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,SAAS,GAAG,cAAc,CAQlE"}
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Copyright (c) 2025 Elara AI Pty Ltd
3
+ * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details.
4
+ */
5
+ /**
6
+ * The query builder's canonical steps (#933): the step algebra behind the
7
+ * builder, with no rendering in it — steps printed as canonical jq and parsed
8
+ * back, checked with every diagnostic on its step, condition and slot, edited,
9
+ * and counted. The builder and the query library import it; the package's
10
+ * index does not export it.
11
+ *
12
+ * @packageDocumentation
13
+ */
14
+ export { comparison, freshId, isComplete, isConditionComplete, isGiven, needsValue, type Aggregate, type Comparison, type ComparisonKind, type Condition, type GroupCondition, type IdKind, type Match, type PickField, type Step, type StepInput, type StepKind, type StepOf, type StepQuery, type StepValue, type TestCondition, } from './values.js';
15
+ export { UNKNOWN, baseType, optionPayload, orMissing, rowOf, shapeOf, singular, unwrapRecursive, type Shape, type ShapeKind } from './shape.js';
16
+ export { comparisonsFor, defaultComparison, fieldByRef, fieldsOf, fieldsOfRecord, itemRecordOf, kindOf, pathOfUnknown, type FieldKind, type StepField, } from './fields.js';
17
+ export { itemShape, layOutSteps, printSteps, type ConditionRange, type LaidOutSegment, type LaidOutStep, type PrintedSteps, type SlotRange, type StepLayout, type StepRange, type StepSlot, } from './print.js';
18
+ export { defaultTotalName, parseSteps, type StepParseError } from './parse.js';
19
+ export { checkSteps, conditionIn, datasetType, type CheckedStepStage, type CheckedSteps, type DiagnosticSlot, type StepDiagnostic, type StepFix, } from './check.js';
20
+ export { addCondition, addGroup, applyFix, emptyCondition, insertStep, moveStep, newStep, removeCondition, removeStep, setConditionField, setConditionValue, setMatch, updateStep, } from './edit.js';
21
+ export { DEFAULT_MAX_ROWS, SOURCE_COUNT, countingProgram, readCounts, type CountingProgram } from './count.js';
22
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/query/steps/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;GAQG;AAEH,OAAO,EACH,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,mBAAmB,EAAE,OAAO,EAAE,UAAU,EACzE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,KAAK,MAAM,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAClI,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,SAAS,EAAE,KAAK,aAAa,GAC5G,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,KAAK,KAAK,EAAE,KAAK,SAAS,EAAE,MAAM,YAAY,CAAC;AAChJ,OAAO,EACH,cAAc,EAAE,iBAAiB,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,aAAa,EAC5G,KAAK,SAAS,EAAE,KAAK,SAAS,GACjC,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,SAAS,EAAE,WAAW,EAAE,UAAU,EAClC,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,QAAQ,GAChJ,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,KAAK,cAAc,EAAE,MAAM,YAAY,CAAC;AAC/E,OAAO,EACH,UAAU,EAAE,WAAW,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,cAAc,EAAE,KAAK,cAAc,EAAE,KAAK,OAAO,GACzI,MAAM,YAAY,CAAC;AACpB,OAAO,EACH,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,iBAAiB,EAC/H,iBAAiB,EAAE,QAAQ,EAAE,UAAU,GAC1C,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,eAAe,EAAE,UAAU,EAAE,KAAK,eAAe,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,188 @@
1
+ import { EastType, JqNode } from '@elaraai/east';
2
+ import { StepValue } from './values.js';
3
+ /**
4
+ * A child's path, as the parser and the printer key a node's span: the
5
+ * parent's path, then the step to the child.
6
+ *
7
+ * @param path - the parent's path, `""` for the root
8
+ * @param step - the steps to the child: `"pipe.left"`, `"call.args[0]"`, …; `""` for the node itself
9
+ * @returns the child's path
10
+ */
11
+ export declare function at(path: string, step: string): string;
12
+ /**
13
+ * Whether a name can name a jq variable.
14
+ *
15
+ * @param name - the name
16
+ * @returns whether `$name` reads as a variable
17
+ */
18
+ export declare function isVariableName(name: string): boolean;
19
+ /** `.` */
20
+ export declare const IDENTITY: JqNode;
21
+ /** `target.name` */
22
+ export declare function fieldNode(target: JqNode, name: string): JqNode;
23
+ /**
24
+ * The read of a field path: `.a.b` from `.`, or from another node.
25
+ *
26
+ * @param names - the fields read, outermost first
27
+ * @param from - what they are read from; `.` by default
28
+ * @returns the node
29
+ */
30
+ export declare function pathNode(names: readonly string[], from?: JqNode): JqNode;
31
+ /** `left | right` */
32
+ export declare function pipe(left: JqNode, right: JqNode): JqNode;
33
+ /**
34
+ * Segments piped in order, as the parser nests them: `a | (b | c)`.
35
+ *
36
+ * @param nodes - the segments, one or more
37
+ * @returns the pipe
38
+ */
39
+ export declare function pipeAll(nodes: readonly JqNode[]): JqNode;
40
+ /**
41
+ * The path of the `i`th of `n` segments piped by {@link pipeAll}, relative
42
+ * to the pipe.
43
+ *
44
+ * @param i - the segment's index
45
+ * @param n - how many segments
46
+ * @returns its path
47
+ */
48
+ export declare function pipedPath(i: number, n: number): string;
49
+ /** `name(args…)` */
50
+ export declare function call(name: string, args?: readonly JqNode[]): JqNode;
51
+ /** `left op right` */
52
+ export declare function binary(left: JqNode, op: string, right: JqNode): JqNode;
53
+ /**
54
+ * Operands joined by one operator, as the parser nests them: `(a and b) and c`.
55
+ *
56
+ * @param operands - the operands, one or more
57
+ * @param op - `and` or `or`
58
+ * @returns the chain
59
+ */
60
+ export declare function chain(operands: readonly JqNode[], op: string): JqNode;
61
+ /**
62
+ * The path of the `i`th of `n` operands joined by {@link chain}, relative to
63
+ * the chain.
64
+ *
65
+ * @param i - the operand's index
66
+ * @param n - how many operands
67
+ * @returns its path
68
+ */
69
+ export declare function chainedPath(i: number, n: number): string;
70
+ /** `-operand` */
71
+ export declare function negate(operand: JqNode): JqNode;
72
+ /** `$name` */
73
+ export declare function variable(name: string): JqNode;
74
+ /**
75
+ * `{key: value, key, …}`: each entry a name, with a value or none.
76
+ *
77
+ * @param entries - the entries
78
+ * @returns the object
79
+ */
80
+ export declare function objectNode(entries: readonly {
81
+ key: string;
82
+ value?: JqNode;
83
+ }[]): JqNode;
84
+ /** `[body]`, or `[]` with no body. */
85
+ export declare function arrayNode(body?: JqNode): JqNode;
86
+ /**
87
+ * Outputs one after another, as the parser nests them: `(a, b), c`.
88
+ *
89
+ * @param nodes - the outputs, one or more
90
+ * @returns the comma
91
+ */
92
+ export declare function commaAll(nodes: readonly JqNode[]): JqNode;
93
+ /** `target[]` */
94
+ export declare function iterate(target: JqNode): JqNode;
95
+ /** `target[key]` */
96
+ export declare function index(target: JqNode, key: JqNode): JqNode;
97
+ /** `target[:to]` */
98
+ export declare function sliceTo(target: JqNode, to: JqNode): JqNode;
99
+ /** `source as $name | body` */
100
+ export declare function bind(source: JqNode, name: string, body: JqNode): JqNode;
101
+ /** `path op value`, for an update operator */
102
+ export declare function updateNode(path: JqNode, op: string, value: JqNode): JqNode;
103
+ /** A String literal. */
104
+ export declare function stringLiteral(text: string): JqNode;
105
+ /** An Integer literal. */
106
+ export declare function integerLiteral(n: bigint): JqNode;
107
+ /** A Float literal. */
108
+ export declare function floatLiteral(x: number): JqNode;
109
+ /** A Boolean literal. */
110
+ export declare function booleanLiteral(b: boolean): JqNode;
111
+ /** `null` */
112
+ export declare function nullLiteral(): JqNode;
113
+ /**
114
+ * A number as jq writes it: an Integer when it is whole, which a Float
115
+ * compares with as its own, and a Float otherwise.
116
+ *
117
+ * @param x - the number
118
+ * @returns the literal
119
+ */
120
+ export declare function numberLiteral(x: number): JqNode;
121
+ /**
122
+ * The literal of a step's value.
123
+ *
124
+ * @param value - the value
125
+ * @returns its literal
126
+ */
127
+ export declare function valueLiteral(value: StepValue): JqNode;
128
+ /**
129
+ * The fields a node reads in a row, from `.`: `.a.b` gives `["a", "b"]`.
130
+ *
131
+ * @param node - the node
132
+ * @param from - what the reads start from; `.` when omitted, else a test of the base node
133
+ * @returns the names, or `undefined` when the node is not a plain path
134
+ */
135
+ export declare function readPath(node: JqNode, from?: (base: JqNode) => boolean): string[] | undefined;
136
+ /**
137
+ * A call's arguments.
138
+ *
139
+ * @param node - the node
140
+ * @param name - the function's name
141
+ * @param arity - how many arguments
142
+ * @returns the arguments, or `undefined` when the node is not that call
143
+ */
144
+ export declare function readCall(node: JqNode, name: string, arity: number): JqNode[] | undefined;
145
+ /**
146
+ * A literal's value, with its type.
147
+ *
148
+ * @param node - the node
149
+ * @returns the type and value, or `undefined` when it is not a literal
150
+ */
151
+ export declare function readLiteral(node: JqNode): {
152
+ type: EastType;
153
+ value: unknown;
154
+ } | undefined;
155
+ /**
156
+ * A literal as a step's value: text, a number, yes or no, or nothing.
157
+ *
158
+ * @param node - the node
159
+ * @returns the value, or `undefined` when it is not a literal
160
+ */
161
+ export declare function readStepValue(node: JqNode): StepValue | undefined;
162
+ /**
163
+ * A pipe's segments, in order.
164
+ *
165
+ * @param node - the node
166
+ * @returns the segments; the node alone when it is no pipe
167
+ */
168
+ export declare function readPipe(node: JqNode): JqNode[];
169
+ /**
170
+ * An object's entries, when every key is a name.
171
+ *
172
+ * @param node - the node
173
+ * @returns each entry's key and value, or `undefined` when it is no such object
174
+ */
175
+ export declare function readObject(node: JqNode): {
176
+ key: string;
177
+ value: JqNode | undefined;
178
+ }[] | undefined;
179
+ /**
180
+ * The operands of a chain of one operator, as {@link chain} builds it: the
181
+ * left side read down while it is the same operator.
182
+ *
183
+ * @param node - the node
184
+ * @param op - `and` or `or`
185
+ * @returns the operands; the node alone when it is no such chain
186
+ */
187
+ export declare function readChain(node: JqNode, op: string): JqNode[];
188
+ //# sourceMappingURL=jq.d.ts.map