@elastic/esql 1.1.0 → 1.3.0
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/lib/ast/visitor/contexts.d.ts +5 -1
- package/lib/ast/visitor/contexts.d.ts.map +1 -1
- package/lib/ast/visitor/global_visitor_context.d.ts +3 -1
- package/lib/ast/visitor/global_visitor_context.d.ts.map +1 -1
- package/lib/ast/visitor/types.d.ts +4 -2
- package/lib/ast/visitor/types.d.ts.map +1 -1
- package/lib/index.js +8982 -8733
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +8980 -8733
- package/lib/index.mjs.map +1 -1
- package/lib/parser/antlr/esql_lexer.d.ts +148 -147
- package/lib/parser/antlr/esql_lexer.d.ts.map +1 -1
- package/lib/parser/antlr/esql_parser.d.ts +199 -188
- package/lib/parser/antlr/esql_parser.d.ts.map +1 -1
- package/lib/parser/antlr/esql_parser_listener.d.ts +11 -0
- package/lib/parser/antlr/esql_parser_listener.d.ts.map +1 -1
- package/lib/parser/core/cst_to_ast_converter.d.ts +2 -0
- package/lib/parser/core/cst_to_ast_converter.d.ts.map +1 -1
- package/lib/parser/core/decorations.d.ts.map +1 -1
- package/lib/printer/builders.d.ts +190 -0
- package/lib/printer/builders.d.ts.map +1 -0
- package/lib/printer/index.d.ts +5 -0
- package/lib/printer/index.d.ts.map +1 -0
- package/lib/printer/layout.d.ts +32 -0
- package/lib/printer/layout.d.ts.map +1 -0
- package/lib/printer/prepare.d.ts +9 -0
- package/lib/printer/prepare.d.ts.map +1 -0
- package/lib/printer/traversal.d.ts +13 -0
- package/lib/printer/traversal.d.ts.map +1 -0
- package/lib/printer/types.d.ts +178 -0
- package/lib/printer/types.d.ts.map +1 -0
- package/lib/types.d.ts +5 -1
- package/lib/types.d.ts.map +1 -1
- package/lib/types.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
import type { Doc, GroupNode, FillNode, IndentNode, IndentIfBreakNode, AlignNode, IfBreakNode, LineNode, LineSuffixNode, LineSuffixBoundaryNode, BreakParentNode, TrimNode, CursorNode } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Literal text. Must not contain newline characters.
|
|
4
|
+
*/
|
|
5
|
+
export declare const text: (s: string) => string;
|
|
6
|
+
/**
|
|
7
|
+
* Space if flat, newline + indent if broken.
|
|
8
|
+
*/
|
|
9
|
+
export declare const line: LineNode;
|
|
10
|
+
/**
|
|
11
|
+
* Nothing if flat, newline + indent if broken.
|
|
12
|
+
*/
|
|
13
|
+
export declare const softline: LineNode;
|
|
14
|
+
/**
|
|
15
|
+
* Always a newline + indent. Forces enclosing group to break.
|
|
16
|
+
*/
|
|
17
|
+
export declare const hardline: Doc;
|
|
18
|
+
/**
|
|
19
|
+
* Like `hardline` but does NOT force parent group to break.
|
|
20
|
+
*/
|
|
21
|
+
export declare const hardlineWithoutBreakParent: LineNode;
|
|
22
|
+
/**
|
|
23
|
+
* A hard line break that indents to the root position (set by `markAsRoot`)
|
|
24
|
+
* rather than the current nesting level. Also preserves trailing whitespace
|
|
25
|
+
* on the preceding line (no trim). Used for embedded/template content.
|
|
26
|
+
*
|
|
27
|
+
* Like `hardline`, forces enclosing groups to break.
|
|
28
|
+
*/
|
|
29
|
+
export declare const literalline: Doc;
|
|
30
|
+
/**
|
|
31
|
+
* Like `literalline` but does NOT force parent group to break.
|
|
32
|
+
*/
|
|
33
|
+
export declare const literallineWithoutBreakParent: LineNode;
|
|
34
|
+
/**
|
|
35
|
+
* Force all parent groups to break.
|
|
36
|
+
*/
|
|
37
|
+
export declare const breakParent: BreakParentNode;
|
|
38
|
+
/**
|
|
39
|
+
* Try to print `contents` on a single line (flat mode).
|
|
40
|
+
* If it doesn't fit within the remaining width, print in broken mode
|
|
41
|
+
* (all "line" nodes inside become newlines).
|
|
42
|
+
*
|
|
43
|
+
* @param contents - The document to group.
|
|
44
|
+
* @param opts.shouldBreak - Force this group to break (skip flat attempt).
|
|
45
|
+
* @param opts.id - Symbol ID for cross-referencing with `ifBreak`.
|
|
46
|
+
*/
|
|
47
|
+
export declare const group: (contents: Doc, opts?: {
|
|
48
|
+
shouldBreak?: boolean;
|
|
49
|
+
id?: symbol;
|
|
50
|
+
}) => GroupNode;
|
|
51
|
+
/**
|
|
52
|
+
* Provide multiple alternative layout representations, from most compact
|
|
53
|
+
* to most expanded. The layout engine tries each in order and uses the
|
|
54
|
+
* first one that fits. If none fits, the last state is used in break mode.
|
|
55
|
+
*
|
|
56
|
+
* Primary use case: three-phase list formatting:
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* conditionalGroup([flatLayout, wrappedLayout, brokenLayout])
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
62
|
+
export declare const conditionalGroup: (states: Doc[], opts?: {
|
|
63
|
+
id?: symbol;
|
|
64
|
+
}) => GroupNode;
|
|
65
|
+
/**
|
|
66
|
+
* Increase indentation by one tab level for `contents`.
|
|
67
|
+
*/
|
|
68
|
+
export declare const indent: (contents: Doc) => IndentNode;
|
|
69
|
+
/**
|
|
70
|
+
* Increase indentation by exactly `n` spaces (not a tab level).
|
|
71
|
+
*
|
|
72
|
+
* Special values:
|
|
73
|
+
*
|
|
74
|
+
* - Positive integer: add `n` spaces of alignment.
|
|
75
|
+
* - `-1`: dedent by one level (see `dedent()`).
|
|
76
|
+
* - `Number.NEGATIVE_INFINITY`: reset to root (see `dedentToRoot()`).
|
|
77
|
+
* - `{ type: 'root' }`: mark current indent as root (see `markAsRoot()`).
|
|
78
|
+
*/
|
|
79
|
+
export declare const align: (n: number | {
|
|
80
|
+
type: "root";
|
|
81
|
+
}, contents: Doc) => AlignNode;
|
|
82
|
+
/**
|
|
83
|
+
* Decrease indentation by one level.
|
|
84
|
+
*/
|
|
85
|
+
export declare const dedent: (contents: Doc) => AlignNode;
|
|
86
|
+
/**
|
|
87
|
+
* Reset indentation to the root level (column 0, or the position set by
|
|
88
|
+
* `markAsRoot`). Equivalent to `align(Number.NEGATIVE_INFINITY, contents)`.
|
|
89
|
+
*/
|
|
90
|
+
export declare const dedentToRoot: (contents: Doc) => AlignNode;
|
|
91
|
+
/**
|
|
92
|
+
* Mark the current indentation as the "root" position. Content inside
|
|
93
|
+
* `markAsRoot` that uses `literalline` will indent to this position
|
|
94
|
+
* rather than column 0. Used for embedded/template content.
|
|
95
|
+
*/
|
|
96
|
+
export declare const markAsRoot: (contents: Doc) => AlignNode;
|
|
97
|
+
/**
|
|
98
|
+
* Wrapping layout. `parts` should alternate content and line-break docs:
|
|
99
|
+
*
|
|
100
|
+
* ```ts
|
|
101
|
+
* fill([item1, line, item2, line, item3])
|
|
102
|
+
* ```
|
|
103
|
+
*
|
|
104
|
+
* The engine fills each line with as many items as fit before breaking.
|
|
105
|
+
*/
|
|
106
|
+
export declare const fill: (parts: Doc[]) => FillNode;
|
|
107
|
+
/**
|
|
108
|
+
* Print `breakContents` if the enclosing group (or the group identified
|
|
109
|
+
* by `groupId`) is in broken mode; otherwise print `flatContents`.
|
|
110
|
+
*/
|
|
111
|
+
export declare const ifBreak: (breakContents: Doc, flatContents?: Doc, opts?: {
|
|
112
|
+
groupId?: symbol;
|
|
113
|
+
}) => IfBreakNode;
|
|
114
|
+
/**
|
|
115
|
+
* Conditionally indent based on a referenced group's mode. Optimized form
|
|
116
|
+
* of `ifBreak(indent(doc), doc, { groupId })`.
|
|
117
|
+
*
|
|
118
|
+
* When the referenced group is broken, contents are indented. When the
|
|
119
|
+
* referenced group is flat, contents are not indented. Set `negate: true`
|
|
120
|
+
* to reverse this behavior.
|
|
121
|
+
*/
|
|
122
|
+
export declare const indentIfBreak: (contents: Doc, opts: {
|
|
123
|
+
groupId: symbol;
|
|
124
|
+
negate?: boolean;
|
|
125
|
+
}) => IndentIfBreakNode;
|
|
126
|
+
/**
|
|
127
|
+
* Buffer `contents` and emit at the end of the current line. Used for trailing
|
|
128
|
+
* comments: the comment text is deferred until just before the next newline.
|
|
129
|
+
*
|
|
130
|
+
* ```ts
|
|
131
|
+
* [text("stmt"), lineSuffix(" # comment"), text(";"), hardline]
|
|
132
|
+
* // stmt; # comment\n
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
export declare const lineSuffix: (contents: Doc) => LineSuffixNode;
|
|
136
|
+
/**
|
|
137
|
+
* Force-flush any pending lineSuffix. Prevents comment leakage across
|
|
138
|
+
* syntactic boundaries.
|
|
139
|
+
*/
|
|
140
|
+
export declare const lineSuffixBoundary: LineSuffixBoundaryNode;
|
|
141
|
+
/**
|
|
142
|
+
* Annotate a doc with a label. No effect on layout. Returns `contents`
|
|
143
|
+
* unwrapped if `label` is falsy.
|
|
144
|
+
*/
|
|
145
|
+
export declare const label: (lbl: unknown, contents: Doc) => Doc;
|
|
146
|
+
/**
|
|
147
|
+
* Trim all trailing whitespace at the end of the current line. Used for
|
|
148
|
+
* removing extra indentation on blank lines.
|
|
149
|
+
*/
|
|
150
|
+
export declare const trim: TrimNode;
|
|
151
|
+
/**
|
|
152
|
+
* Placeholder for cursor position tracking. After layout, the result
|
|
153
|
+
* reports the cursor offset in the output string. Can be used to maintain
|
|
154
|
+
* cursor position after formatting.
|
|
155
|
+
*
|
|
156
|
+
* @todo Rename to "sentinel"?
|
|
157
|
+
*/
|
|
158
|
+
export declare const cursor: CursorNode;
|
|
159
|
+
/**
|
|
160
|
+
* Join an array of docs with a separator doc between each pair.
|
|
161
|
+
*/
|
|
162
|
+
export declare const join: (separator: Doc, docs: Doc[]) => Doc[];
|
|
163
|
+
/**
|
|
164
|
+
* Common pattern: a bracketed, optionally-indented list.
|
|
165
|
+
*
|
|
166
|
+
* ```ts
|
|
167
|
+
* bracketedList("(", ")", ",", [a, b, c])
|
|
168
|
+
* ```
|
|
169
|
+
*
|
|
170
|
+
* Flat: `(a, b, c)`.
|
|
171
|
+
*
|
|
172
|
+
* Broken:
|
|
173
|
+
*
|
|
174
|
+
* ```
|
|
175
|
+
* (
|
|
176
|
+
* a,
|
|
177
|
+
* b,
|
|
178
|
+
* c
|
|
179
|
+
* )
|
|
180
|
+
* ```
|
|
181
|
+
*/
|
|
182
|
+
export declare const bracketedList: (open: string, close: string, separator: string, items: Doc[]) => Doc;
|
|
183
|
+
/**
|
|
184
|
+
* Convert an absolute indentation size into a combination of `indent` (for
|
|
185
|
+
* tab-sized chunks) and `align` (for remaining spaces), wrapped in
|
|
186
|
+
* `dedentToRoot`. Used for embedded content that needs a specific indentation
|
|
187
|
+
* level.
|
|
188
|
+
*/
|
|
189
|
+
export declare const addAlignmentToDoc: (doc: Doc, size: number, tabWidth: number) => Doc;
|
|
190
|
+
//# sourceMappingURL=builders.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"builders.d.ts","sourceRoot":"","sources":["../../src/printer/builders.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,GAAG,EACH,SAAS,EACT,QAAQ,EACR,UAAU,EACV,iBAAiB,EACjB,SAAS,EACT,WAAW,EACX,QAAQ,EACR,cAAc,EACd,sBAAsB,EACtB,eAAe,EAEf,QAAQ,EACR,UAAU,EACX,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,MAAM,KAAG,MAAW,CAAC;AAE7C;;GAEG;AACH,eAAO,MAAM,IAAI,EAAE,QAA2B,CAAC;AAE/C;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,QAAuC,CAAC;AAE/D;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,GAA8D,CAAC;AAEtF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,QAAuC,CAAC;AAEjF;;;;;;GAMG;AACH,eAAO,MAAM,WAAW,EAAE,GAGzB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,QAI3C,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,eAA0C,CAAC;AAErE;;;;;;;;GAQG;AACH,eAAO,MAAM,KAAK,GAAI,UAAU,GAAG,EAAE,OAAO;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GAGG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,EAAE,UAAU,GAAG,KAAG,GACqB,CAAC;AAE1E;;;GAGG;AACH,eAAO,MAAM,IAAI,EAAE,QAA2B,CAAC;AAE/C;;;;;;GAMG;AACH,eAAO,MAAM,MAAM,EAAE,UAA+B,CAAC;AAErD;;GAEG;AACH,eAAO,MAAM,IAAI,GAAI,WAAW,GAAG,EAAE,MAAM,GAAG,EAAE,KAAG,GAAG,EASrD,CAAC;AAEF;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,aAAa,GACxB,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,WAAW,MAAM,EACjB,OAAO,GAAG,EAAE,KACX,GASF,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,KAAK,GAAG,EAAE,MAAM,MAAM,EAAE,UAAU,MAAM,KAAG,GAiB5E,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/printer/index.ts"],"names":[],"mappings":"AAOA,mBAAmB,SAAS,CAAC;AAC7B,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { Doc } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Options accepted by the public API. All fields are optional with defaults.
|
|
4
|
+
*/
|
|
5
|
+
export interface LayoutOpts {
|
|
6
|
+
/**
|
|
7
|
+
* Maximum line width before the engine attempts to break groups.
|
|
8
|
+
* @default 80
|
|
9
|
+
*/
|
|
10
|
+
printWidth?: number;
|
|
11
|
+
/**
|
|
12
|
+
* Number of spaces per indentation level.
|
|
13
|
+
* @default 2
|
|
14
|
+
*/
|
|
15
|
+
tabWidth?: number;
|
|
16
|
+
/**
|
|
17
|
+
* Use tab characters for indentation instead of spaces.
|
|
18
|
+
* @default false
|
|
19
|
+
*/
|
|
20
|
+
useTabs?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* End-of-line character(s).
|
|
23
|
+
* @default '\n'
|
|
24
|
+
*/
|
|
25
|
+
endOfLine?: '\n' | '\r\n' | '\r';
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* The layout algorithm. Takes a pretty-print doc tree and options, and produces
|
|
29
|
+
* a concrete string with optimal line breaks.
|
|
30
|
+
*/
|
|
31
|
+
export declare const layout: (doc: Doc, opts?: LayoutOpts) => string;
|
|
32
|
+
//# sourceMappingURL=layout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.d.ts","sourceRoot":"","sources":["../../src/printer/layout.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAY,MAAM,SAAS,CAAC;AAmO7C;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB;;;OAGG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAAC;CAClC;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,GAAI,KAAK,GAAG,EAAE,OAAO,UAAU,KAAG,MAkOpD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Doc } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* A pre-pass that mutates `shouldBreak` on `GroupDoc` nodes. For example,
|
|
4
|
+
* forces all ancestor groups of any `breakParent` command to break. This
|
|
5
|
+
* ensures that a `hardline` deep inside a group hierarchy propagates upward
|
|
6
|
+
* correctly.
|
|
7
|
+
*/
|
|
8
|
+
export declare const propagateBreaks: (doc: Doc) => void;
|
|
9
|
+
//# sourceMappingURL=prepare.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prepare.d.ts","sourceRoot":"","sources":["../../src/printer/prepare.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,GAAG,EAAa,MAAM,SAAS,CAAC;AAE9C;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAAI,KAAK,GAAG,KAAG,IA6C1C,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Doc } from './types';
|
|
2
|
+
export interface TraverseOpts {
|
|
3
|
+
/** Called when entering a node. Return `false` to skip its children. */
|
|
4
|
+
onEnter?(doc: Doc): false | void;
|
|
5
|
+
/** Called when leaving a node. */
|
|
6
|
+
onExit?(doc: Doc): void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Generic depth-first traversal of a print tree. Uses an explicit stack
|
|
10
|
+
* (no recursion) traversal.
|
|
11
|
+
*/
|
|
12
|
+
export declare const traverse: (doc: Doc, callbacks: TraverseOpts) => void;
|
|
13
|
+
//# sourceMappingURL=traversal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"traversal.d.ts","sourceRoot":"","sources":["../../src/printer/traversal.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAC;AAOnC,MAAM,WAAW,YAAY;IAC3B,wEAAwE;IACxE,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,KAAK,GAAG,IAAI,CAAC;IACjC,kCAAkC;IAClC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,GAAG,IAAI,CAAC;CACzB;AAED;;;GAGG;AACH,eAAO,MAAM,QAAQ,GAAI,KAAK,GAAG,EAAE,WAAW,YAAY,KAAG,IAwD5D,CAAC"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The document intermediate representation.
|
|
3
|
+
*
|
|
4
|
+
* - `string` — literal text (must not contain newline characters).
|
|
5
|
+
* - `Doc[]` — concatenation of documents, rendered left to right.
|
|
6
|
+
* - `DocNode` — a formatting instruction node.
|
|
7
|
+
*/
|
|
8
|
+
export type Doc = string | Doc[] | AnyNode;
|
|
9
|
+
/**
|
|
10
|
+
* All possible document nodes.
|
|
11
|
+
*/
|
|
12
|
+
export type AnyNode = GroupNode | FillNode | IndentNode | IndentIfBreakNode | AlignNode | IfBreakNode | LineNode | LineSuffixNode | LineSuffixBoundaryNode | BreakParentNode | LabelNode | TrimNode | CursorNode;
|
|
13
|
+
/**
|
|
14
|
+
* The core break-decision unit. The layout engine first tries to render
|
|
15
|
+
* `contents` entirely on one line (flat mode). If the result exceeds the
|
|
16
|
+
* remaining line width, it switches to break mode — replacing every `line`
|
|
17
|
+
* and `softline` inside with a newline + indentation.
|
|
18
|
+
*
|
|
19
|
+
* When `expandedStates` is provided this becomes a **conditional group**:
|
|
20
|
+
* the engine tries each state in order (most compact first) and uses the first
|
|
21
|
+
* one that fits. If none fits, the last state is rendered in break mode.
|
|
22
|
+
*
|
|
23
|
+
* Setting `shouldBreak` to `true` forces break mode unconditionally.
|
|
24
|
+
*
|
|
25
|
+
* An `id` allows other commands (`ifBreak`, `indentIfBreak`) to query
|
|
26
|
+
* this group's resolved mode.
|
|
27
|
+
*/
|
|
28
|
+
export interface GroupNode {
|
|
29
|
+
readonly type: 'group';
|
|
30
|
+
readonly contents: Doc;
|
|
31
|
+
readonly id?: symbol;
|
|
32
|
+
readonly expandedStates?: readonly Doc[];
|
|
33
|
+
shouldBreak?: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Wrapping layout: packs as many items per line as possible, breaking to a
|
|
37
|
+
* new line only when the next item would exceed the line width.
|
|
38
|
+
*
|
|
39
|
+
* `parts` must alternate between content docs and line-break docs:
|
|
40
|
+
* `[item1, line, item2, line, item3, ...]`
|
|
41
|
+
*
|
|
42
|
+
* Unlike `group` (all-or-nothing), `fill` makes per-item break decisions,
|
|
43
|
+
* producing partially filled lines.
|
|
44
|
+
*/
|
|
45
|
+
export interface FillNode {
|
|
46
|
+
readonly type: 'fill';
|
|
47
|
+
readonly parts: Doc[];
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Increases indentation by one tab level for `contents`.
|
|
51
|
+
*/
|
|
52
|
+
export interface IndentNode {
|
|
53
|
+
readonly type: 'indent';
|
|
54
|
+
readonly contents: Doc;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Conditionally indents `contents` based on whether the group identified
|
|
58
|
+
* by `groupId` is in break mode.
|
|
59
|
+
*
|
|
60
|
+
* When `negate` is `true` the behavior is inverted: indent when the
|
|
61
|
+
* referenced group is flat, don't indent when broken.
|
|
62
|
+
*/
|
|
63
|
+
export interface IndentIfBreakNode {
|
|
64
|
+
readonly type: 'indent-if-break';
|
|
65
|
+
readonly contents: Doc;
|
|
66
|
+
readonly groupId: symbol;
|
|
67
|
+
readonly negate?: boolean;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Increases indentation by a fixed number of spaces rather than a full
|
|
71
|
+
* tab level. Useful for alignment that doesn't match the configured tab
|
|
72
|
+
* width.
|
|
73
|
+
*
|
|
74
|
+
* Special values for `n`:
|
|
75
|
+
*
|
|
76
|
+
* - Positive integer — add `n` spaces of alignment.
|
|
77
|
+
* - `-1` — dedent by one level (reverses one `indent` or `align`).
|
|
78
|
+
* - `Number.NEGATIVE_INFINITY` — reset indentation to the root level.
|
|
79
|
+
* - `{ type: 'root' }` — mark current indentation as the root position
|
|
80
|
+
* for `literalline`.
|
|
81
|
+
*/
|
|
82
|
+
export interface AlignNode {
|
|
83
|
+
readonly type: 'align';
|
|
84
|
+
readonly n: number | {
|
|
85
|
+
type: 'root';
|
|
86
|
+
};
|
|
87
|
+
readonly contents: Doc;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Emits `breakContents` when the enclosing group (or the group identified
|
|
91
|
+
* by `groupId`) is in break mode, or `flatContents` when it renders flat.
|
|
92
|
+
*
|
|
93
|
+
* Common use cases: trailing commas only in broken lists, different
|
|
94
|
+
* separators depending on layout mode.
|
|
95
|
+
*/
|
|
96
|
+
export interface IfBreakNode {
|
|
97
|
+
readonly type: 'if-break';
|
|
98
|
+
readonly breakContents: Doc;
|
|
99
|
+
readonly flatContents: Doc;
|
|
100
|
+
readonly groupId?: symbol;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* A line-break command whose behavior depends on the enclosing group's mode:
|
|
104
|
+
*
|
|
105
|
+
* | `soft` | `hard` | `literal` | Flat mode | Break mode |
|
|
106
|
+
* |--------|--------|-----------|------------------|--------------------|
|
|
107
|
+
* | false | false | false | space `" "` | newline + indent | `line`
|
|
108
|
+
* | true | false | false | nothing `""` | newline + indent | `softline`
|
|
109
|
+
* | false | true | false | newline + indent | newline + indent | `hardline`
|
|
110
|
+
* | false | true | true | newline + root | newline + root | `literalline`
|
|
111
|
+
*
|
|
112
|
+
* When `literal` is `true`, the newline preserves trailing whitespace on
|
|
113
|
+
* the preceding line and indents to the root position (set by `markAsRoot`)
|
|
114
|
+
* rather than the current nesting level. Used for embedded/template content.
|
|
115
|
+
*/
|
|
116
|
+
export interface LineNode {
|
|
117
|
+
readonly type: 'line';
|
|
118
|
+
readonly soft?: boolean;
|
|
119
|
+
readonly hard?: boolean;
|
|
120
|
+
readonly literal?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Buffers `contents` and emits them at the end of the current line, just
|
|
124
|
+
* before the next line break. Used for trailing comments.
|
|
125
|
+
*
|
|
126
|
+
* Example: `[text("x"), lineSuffix(" // comment"), text(";"), hardline]`
|
|
127
|
+
* produces: `x; // comment\n`
|
|
128
|
+
*
|
|
129
|
+
* Without `lineSuffix`, the comment would appear before the semicolon.
|
|
130
|
+
*/
|
|
131
|
+
export interface LineSuffixNode {
|
|
132
|
+
readonly type: 'line-suffix';
|
|
133
|
+
readonly contents: Doc;
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Forces any buffered `lineSuffix` content to be flushed at this point
|
|
137
|
+
* rather than waiting for a natural line break. Prevents trailing comments
|
|
138
|
+
* from leaking across syntactic boundaries (e.g., past a closing brace).
|
|
139
|
+
*/
|
|
140
|
+
export interface LineSuffixBoundaryNode {
|
|
141
|
+
readonly type: 'line-suffix-boundary';
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Forces all ancestor groups to break. Paired with `hardline` to ensure
|
|
145
|
+
* that a hard line break propagates upward through the group hierarchy.
|
|
146
|
+
*
|
|
147
|
+
* Processed during the `propagateBreaks` pre-pass which walks the Doc
|
|
148
|
+
* tree and sets `shouldBreak` on every enclosing `GroupDoc`.
|
|
149
|
+
*/
|
|
150
|
+
export interface BreakParentNode {
|
|
151
|
+
readonly type: 'break-parent';
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Annotates a doc with an opaque label for heuristic introspection by
|
|
155
|
+
* language-specific printers. Has no effect on layout. Useful when a
|
|
156
|
+
* printer needs to inspect sub-docs.
|
|
157
|
+
*/
|
|
158
|
+
export interface LabelNode {
|
|
159
|
+
readonly type: 'label';
|
|
160
|
+
readonly label: unknown;
|
|
161
|
+
readonly contents: Doc;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Removes trailing whitespace from the output at the current position.
|
|
165
|
+
*/
|
|
166
|
+
export interface TrimNode {
|
|
167
|
+
readonly type: 'trim';
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Placeholder for cursor position tracking. The layout engine emits a
|
|
171
|
+
* sentinel character at this position; after layout, the caller can
|
|
172
|
+
* locate the cursor in the output string. Useful for editor
|
|
173
|
+
* format-on-save integrations that need to preserve cursor position.
|
|
174
|
+
*/
|
|
175
|
+
export interface CursorNode {
|
|
176
|
+
readonly type: 'cursor';
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/print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,CAAC;CACzB"}
|
package/lib/types.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import type { PromQLAstQueryExpression } from './embedded_languages/promql/types
|
|
|
3
3
|
* @deprecated A full query AST is represented by {@link ESQLAstQueryExpression} type.
|
|
4
4
|
*/
|
|
5
5
|
export type ESQLAst = ESQLAstCommand[];
|
|
6
|
-
export type ESQLAstCommand = ESQLCommand | ESQLAstJoinCommand | ESQLAstChangePointCommand | ESQLAstRerankCommand | ESQLAstCompletionCommand | ESQLAstFuseCommand | ESQLAstForkCommand | ESQLAstUriPartsCommand | ESQLAstRegisteredDomainCommand;
|
|
6
|
+
export type ESQLAstCommand = ESQLCommand | ESQLAstJoinCommand | ESQLAstChangePointCommand | ESQLAstRerankCommand | ESQLAstCompletionCommand | ESQLAstFuseCommand | ESQLAstForkCommand | ESQLAstUriPartsCommand | ESQLAstTsInfoCommand | ESQLAstMetricsInfoCommand | ESQLAstRegisteredDomainCommand;
|
|
7
7
|
export type ESQLAstAllCommands = ESQLAstCommand | ESQLAstHeaderCommand;
|
|
8
8
|
export type ESQLAstNode = ESQLAstCommand | ESQLAstHeaderCommand | ESQLAstExpression | ESQLAstItem;
|
|
9
9
|
/**
|
|
@@ -106,6 +106,10 @@ export interface ESQLAstUriPartsCommand extends ESQLCommand<'uri_parts'> {
|
|
|
106
106
|
targetField: ESQLColumn;
|
|
107
107
|
expression?: ESQLAstExpression;
|
|
108
108
|
}
|
|
109
|
+
export interface ESQLAstTsInfoCommand extends ESQLCommand<'ts_info'> {
|
|
110
|
+
}
|
|
111
|
+
export interface ESQLAstMetricsInfoCommand extends ESQLCommand<'metrics_info'> {
|
|
112
|
+
}
|
|
109
113
|
export interface ESQLAstRegisteredDomainCommand extends ESQLCommand<'registered_domain'> {
|
|
110
114
|
targetField: ESQLColumn;
|
|
111
115
|
expression?: ESQLAstExpression;
|
package/lib/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":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AAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,GAAG,SAAS,GAAG,MAAM,CAAC;CACxC;AAED,MAAM,WAAW,qBAAqB,CAAC,OAAO,SAAS,aAAa,GAAG,YAAY;IACjF,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,YAAY,CAAC;CACzB;AAED,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,CAAC,aAAa,CAAC,CAAC;AAC5E,MAAM,MAAM,uBAAuB,GAAG,qBAAqB,CAAC,YAAY,CAAC,CAAC;AAC1E,MAAM,MAAM,cAAc,GAAG,wBAAwB,GAAG,uBAAuB,CAAC"}
|
package/lib/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\nimport type { PromQLAstQueryExpression } from './embedded_languages/promql/types';\n\n/**\n * @deprecated A full query AST is represented by {@link ESQLAstQueryExpression} type.\n */\nexport type ESQLAst = ESQLAstCommand[];\n\nexport type ESQLAstCommand =\n | ESQLCommand\n | ESQLAstJoinCommand\n | ESQLAstChangePointCommand\n | ESQLAstRerankCommand\n | ESQLAstCompletionCommand\n | ESQLAstFuseCommand\n | ESQLAstForkCommand\n | ESQLAstUriPartsCommand\n | ESQLAstRegisteredDomainCommand;\n\nexport type ESQLAstAllCommands = ESQLAstCommand | ESQLAstHeaderCommand;\n\nexport type ESQLAstNode = ESQLAstCommand | ESQLAstHeaderCommand | ESQLAstExpression | ESQLAstItem;\n\n/**\n * Represents an *expression* in the AST.\n */\nexport type ESQLAstExpression = ESQLSingleAstItem;\n\nexport type ESQLSingleAstItem =\n | ESQLAstQueryExpression\n | ESQLFunction\n | ESQLCommandOption\n | ESQLSource\n | ESQLParens\n | ESQLColumn\n | ESQLDatePeriodLiteral\n | ESQLTimeDurationLiteral\n | ESQLList\n | ESQLLiteral\n | ESQLIdentifier\n | ESQLInlineCast\n | ESQLOrderExpression\n | ESQLUnknownItem\n | ESQLMap\n | ESQLMapEntry\n | PromQLAstQueryExpression;\n\n/**\n * A field is either an index field `this.is.field`, or it is a field assignment\n * `new_field = 123`, in which case it is a binary expression with \"=\" operator.\n *\n * Also, a field can be specified as a parameter.\n *\n * ```\n * EVAL this.is.a.nested.field\n * EVAL new_field = 123\n * EVAL ?param\n * EVAL ?param = 123\n * ```\n */\nexport type ESQLAstField = ESQLColumn | ESQLBinaryExpression | ESQLAstExpression | ESQLParam;\n\n/**\n * An array of AST nodes represents different things in different contexts.\n * For example, in command top level arguments it is treated as an \"assignment expression\".\n */\nexport type ESQLAstItem = ESQLSingleAstItem | ESQLAstItem[];\n\nexport type ESQLAstNodeWithArgs = ESQLCommand | ESQLCommandOption | ESQLFunction;\nexport type ESQLAstNodeWithChildren = ESQLAstNodeWithArgs | ESQLList;\n\n/**\n * *Proper* are nodes which are objects with `type` property, once we get rid\n * of the nodes which are plain arrays, all nodes will be *proper* and we can\n * remove this type.\n */\nexport type ESQLProperNode = ESQLAstExpression | ESQLAstCommand | ESQLAstHeaderCommand;\n\nexport interface ESQLLocation {\n min: number;\n max: number;\n}\n\nexport interface ESQLAstBaseItem<Name = string> {\n name: Name;\n text: string;\n location: ESQLLocation;\n incomplete: boolean;\n formatting?: ESQLAstNodeFormatting;\n}\n\n/**\n * Contains optional formatting information used by the pretty printer.\n */\nexport interface ESQLAstNodeFormatting {\n top?: ESQLAstComment[];\n left?: ESQLAstCommentMultiLine[];\n right?: ESQLAstCommentMultiLine[];\n rightSingleLine?: ESQLAstCommentSingleLine;\n bottom?: ESQLAstComment[];\n}\n\nexport interface ESQLCommand<Name = string> extends ESQLAstBaseItem<Name> {\n type: 'command';\n\n /**\n * The subtype of the command. For example, the `JOIN` command can be: (1)\n * LOOKUP JOIN, (2) LEFT JOIN, (3) RIGHT JOIN.\n */\n commandType?: string;\n\n args: ESQLAstItem[];\n}\n\nexport interface ESQLAstJoinCommand extends ESQLCommand<'join'> {\n commandType: 'lookup' | 'left' | 'right';\n}\n\nexport interface ESQLAstChangePointCommand extends ESQLCommand<'change_point'> {\n value: ESQLColumn;\n key?: ESQLColumn;\n target?: {\n type: ESQLColumn;\n pvalue: ESQLColumn;\n };\n}\n\nexport interface ESQLAstCompletionCommand extends ESQLCommand<'completion'> {\n prompt: ESQLAstExpression;\n inferenceId: ESQLLiteral;\n targetField?: ESQLColumn;\n}\n\nexport interface ESQLAstFuseCommand extends ESQLCommand<'fuse'> {\n fuseType?: ESQLIdentifier;\n}\n\nexport interface ESQLAstRerankCommand extends ESQLCommand<'rerank'> {\n query: ESQLLiteral;\n fields: ESQLAstField[];\n targetField?: ESQLColumn;\n inferenceId: ESQLLiteral | undefined;\n}\n\nexport interface ESQLAstForkCommand extends ESQLCommand<'fork'> {\n args: ESQLForkParens[];\n}\n\nexport interface ESQLAstMmrCommand extends ESQLCommand<'mmr'> {\n queryVector?: ESQLSingleAstItem;\n diversifyField: ESQLSingleAstItem;\n limit: ESQLSingleAstItem;\n namedParameters?: ESQLSingleAstItem;\n}\n\nexport interface ESQLAstUriPartsCommand extends ESQLCommand<'uri_parts'> {\n targetField: ESQLColumn;\n expression?: ESQLAstExpression;\n}\n\nexport interface ESQLAstRegisteredDomainCommand extends ESQLCommand<'registered_domain'> {\n targetField: ESQLColumn;\n expression?: ESQLAstExpression;\n}\n\n/**\n * Represents a PROMQL command.\n *\n * ```\n * PROMQL query\n * PROMQL ( name = )? ( query )\n * PROMQL key1=value1 key2=value2... query\n * PROMQL key1=value1 key2=value2... ( name = )? ( query )\n * ```\n *\n * - Optional params use assignment syntax: \"key = value\"\n * - Optional `name` assignment before parentheses: name = ( query )\n * - Query can be specified without parentheses\n */\nexport interface ESQLAstPromqlCommand extends ESQLCommand<'promql'> {\n params?: ESQLMap;\n query?: ESQLAstPromqlCommandQuery;\n args: ESQLAstPromqlCommandArgs;\n}\n\nexport type ESQLAstPromqlCommandArgs =\n /** With params map and query */\n | [params: ESQLMap, query: ESQLAstPromqlCommandQuery]\n\n /** Query only, without params */\n | [query: ESQLAstPromqlCommandQuery]\n\n /** Below versions are in case the command is `.incomplete: true`. */\n | [params: ESQLMap]\n | [];\n\nexport type ESQLAstPromqlCommandQuery =\n /** query */\n | ESQLAstPromqlQuery\n\n /** ( query ) */\n | ESQLParens\n\n /** name = ( query ) */\n | ESQLBinaryExpression<'='>;\n\n/**\n * This will be replaced in the future with a proper PROMQL query AST.\n * For now, we just represent the query as an \"unknown\" node.\n */\nexport type ESQLAstPromqlQuery = PromQLAstQueryExpression;\n\n/**\n * Represents a header pseudo-command, such as SET.\n *\n * Example:\n *\n * ```\n * SET setting1 = \"value1\", setting2 = \"value2\";\n * ```\n */\nexport interface ESQLAstHeaderCommand<\n Name extends string = string,\n Arg = ESQLAstExpression,\n> extends ESQLAstBaseItem {\n type: 'header-command';\n\n /** Name of the command */\n name: Name;\n\n /**\n * Represents the arguments for the command. It has to be a list, because\n * even the SET command was initially designed to accept multiple\n * assignments.\n *\n * Example:\n *\n * ```\n * SET setting1 = \"value1\", setting2 = \"value2\"\n * ```\n */\n args: Arg[];\n}\n\nexport type ESQLAstSetHeaderCommand = ESQLAstHeaderCommand<\n 'set',\n ESQLBinaryExpression<BinaryExpressionAssignmentOperator>\n>;\n\nexport type ESQLIdentifierOrParam = ESQLIdentifier | ESQLParamLiteral;\n\nexport interface ESQLCommandOption extends ESQLAstBaseItem {\n type: 'option';\n args: ESQLAstItem[];\n}\n\nexport interface ESQLAstQueryExpression extends ESQLAstBaseItem<''> {\n type: 'query';\n header?: ESQLAstHeaderCommand[];\n commands: ESQLAstCommand[];\n}\n\n/**\n * We coalesce all function calls and expressions into a single \"function\"\n * node type. This subtype is used to distinguish between different types\n * of function calls and expressions.\n *\n * - `variadic-call` is a function call with any number of arguments: fn(a, b, c, ...)\n * - `unary-expression` is a unary expression: -a, +a, NOT a, ...\n * - `binary-expression` is a binary expression: a + b, a - b, a * b, ...\n */\nexport type FunctionSubtype =\n | 'variadic-call' // fn(a, b, c, ...)\n | 'unary-expression' // -a, +a, NOT a, ...\n | 'postfix-unary-expression' // a IS NULL, a IS NOT NULL, ...\n | 'binary-expression'; // a + b, a - b, a * b, ...\n\nexport interface ESQLFunction<\n Subtype extends FunctionSubtype = FunctionSubtype,\n Name extends string = string,\n> extends ESQLAstBaseItem<Name> {\n type: 'function';\n\n /**\n * Default is 'variadic-call'.\n */\n subtype?: Subtype;\n\n /**\n * A node representing the function or operator being called.\n */\n operator?: ESQLIdentifier | ESQLParamLiteral;\n\n args: ESQLAstItem[];\n}\n\nexport interface ESQLFunctionCallExpression extends ESQLFunction<'variadic-call'> {\n subtype: 'variadic-call';\n args: ESQLAstItem[];\n}\n\nexport interface ESQLUnaryExpression<Name extends string = string> extends ESQLFunction<\n 'unary-expression',\n Name\n> {\n subtype: 'unary-expression';\n args: [ESQLAstItem];\n}\n\nexport interface ESQLPostfixUnaryExpression<Name extends string = string> extends ESQLFunction<\n 'postfix-unary-expression',\n Name\n> {\n subtype: 'postfix-unary-expression';\n args: [ESQLAstItem];\n}\n\n/**\n * Represents an order expression used in SORT commands.\n *\n * ```\n * ... | SORT field ASC NULLS FIRST\n * ```\n */\nexport interface ESQLOrderExpression extends ESQLAstBaseItem {\n type: 'order';\n order: '' | 'ASC' | 'DESC';\n nulls: '' | 'NULLS FIRST' | 'NULLS LAST';\n args: [field: ESQLAstItem];\n}\n\nexport interface ESQLBinaryExpression<\n Name extends BinaryExpressionOperator = BinaryExpressionOperator,\n> extends ESQLFunction<'binary-expression', Name> {\n subtype: 'binary-expression';\n args: [ESQLAstItem, ESQLAstItem];\n}\n\nexport type BinaryExpressionOperator =\n | BinaryExpressionArithmeticOperator\n | BinaryExpressionAssignmentOperator\n | BinaryExpressionComparisonOperator\n | BinaryExpressionRegexOperator\n | BinaryExpressionRenameOperator\n | BinaryExpressionWhereOperator\n | BinaryExpressionMatchOperator\n | BinaryExpressionIn\n | BinaryExpressionLogical;\n\nexport type BinaryExpressionArithmeticOperator = '+' | '-' | '*' | '/' | '%';\nexport type BinaryExpressionAssignmentOperator = '=';\nexport type BinaryExpressionComparisonOperator = '==' | '=~' | '!=' | '<' | '<=' | '>' | '>=';\nexport type BinaryExpressionRegexOperator = 'like' | 'not like' | 'rlike' | 'not rlike';\nexport type BinaryExpressionRenameOperator = 'as';\nexport type BinaryExpressionWhereOperator = 'where';\nexport type BinaryExpressionMatchOperator = ':';\nexport type BinaryExpressionIn = 'in' | 'not in';\nexport type BinaryExpressionLogical = 'and' | 'or';\n\nexport interface ESQLInlineCast<ValueType = ESQLAstItem> extends ESQLAstBaseItem {\n type: 'inlineCast';\n value: ValueType;\n castType: string;\n}\n\n/**\n * This node represents something the AST generator\n * didn't recognize in the ANTLR parse tree.\n *\n * It can show up if the AST generator code is out of sync\n * with the ANTLR grammar or if there is some idiosyncrasy\n * or bug in the parse tree.\n *\n * These nodes can be ignored for the purpose of validation\n * and autocomplete, but they may be helpful in detecting bugs.\n */\nexport interface ESQLUnknownItem extends ESQLAstBaseItem {\n type: 'unknown';\n}\n\nexport interface ESQLSource extends ESQLAstBaseItem {\n type: 'source';\n sourceType: 'index' | 'policy';\n\n /**\n * Represents the prefix part of the source identifier. Empty string if not\n * present. Used in index pattern as the cluster identifier or as \"mode\" in\n * enrich policy.\n *\n * ```\n * FROM [<prefix>:]<index>\n * ```\n */\n prefix?: ESQLStringLiteral | undefined;\n\n /**\n * Represents the index part of the source identifier. Unescaped and unquoted.\n *\n * ```\n * FROM [<cluster>:]<index>\n * ```\n */\n index?: ESQLStringLiteral | undefined;\n\n /**\n * Represents the selector (component) part of the source identifier.\n *\n * ```\n * FROM <index>[::<selector>]\n * ```\n */\n selector?: ESQLStringLiteral | undefined;\n}\n\n/**\n * Represents any expression wrapped in parentheses.\n *\n * ```\n * FROM ( <query> )\n * ```\n */\nexport interface ESQLParens extends ESQLAstBaseItem {\n type: 'parens';\n child: ESQLAstExpression;\n}\n\nexport interface ESQLForkParens extends ESQLParens {\n child: ESQLAstQueryExpression;\n}\n\nexport interface ESQLColumn extends ESQLAstBaseItem {\n type: 'column';\n\n /**\n * Optional qualifier for the column, e.g. index name or alias.\n *\n * @example\n *\n * ```esql\n * [index].[column]\n * [index].[nested.column.part]\n * ```\n *\n * `index` is the qualifier.\n */\n qualifier?: ESQLIdentifier;\n\n /**\n * A ES|QL column name can be composed of multiple parts,\n * e.g: part1.part2.`part``3️⃣`.?param. Where parts can be quoted, or not\n * quoted, or even be a parameter.\n *\n * The args list contains the parts of the column name.\n */\n args: Array<ESQLIdentifier | ESQLParam>;\n\n /**\n * An identifier can be composed of multiple parts, e.g: part1.part2.`part``3️⃣`.\n * This property contains the parsed unquoted parts of the identifier.\n * For example: `['part1', 'part2', 'part`3️⃣']`.\n */\n parts: string[];\n\n /**\n * @deprecated\n *\n * An identifier can be composed of multiple parts, e.g: part1.part2.`part3️⃣`\n *\n * Each part can be quoted or not quoted independently. A single `quoted`\n * property is not enough to represent the identifier. Use `parts` instead.\n */\n quoted: boolean;\n}\n\n/**\n * Represents list-like structures where elements are separated by commas.\n *\n * *Literal lists* use square brackets and can contain only\n * string, number, or boolean literals and all elements must be of the same\n * type:\n *\n * ```\n * [1, 2, 3]\n * ```\n *\n * *Tuple lists* use round brackets and can contain any type of expression.\n * Tuple list are used in the `IN` expression:\n *\n * ```\n * a IN (\"abc\", \"def\")\n * ```\n */\nexport interface ESQLList extends ESQLAstBaseItem {\n type: 'list';\n\n /**\n * Represents various types of lists in ES|QL language.\n *\n * - `literal` - a literal list using square brackets, e.g. `[1, 2, 3]`\n * - `tuple` - a tuple list using round brackets, e.g. `(a, b, c)`\n * - `bare` - a bare list without any enclosing brackets, e.g. `a, b, c`\n *\n * @default 'literal'\n */\n subtype?: 'literal' | 'tuple' | 'bare';\n\n values: ESQLAstExpression[];\n}\n\n/**\n * Represents a ES|QL \"map\" object, a list of key-value pairs. Can have different\n * *representation* styles, such as \"map\" or \"listpairs\". The representation\n * style affects how the map is pretty-printed.\n */\nexport interface ESQLMap extends ESQLAstBaseItem {\n type: 'map';\n entries: ESQLMapEntry[];\n\n /**\n * Specifies how the key-value pairs are represented.\n *\n * @default 'map'\n *\n * `map` example:\n *\n * ```\n * { \"key1\": \"value1\", \"key2\": \"value2\" }\n * ```\n *\n * `listpairs` example:\n *\n * ```\n * key1 value1 key2 value2\n * ```\n *\n * `assignment` example:\n *\n * ```\n * key1=value1 key2=value2\n * ```\n */\n representation?: 'map' | 'listpairs' | 'assignment';\n}\n\n/**\n * Represents a key-value pair in a ES|QL map object.\n */\nexport interface ESQLMapEntry extends ESQLAstBaseItem {\n type: 'map-entry';\n key: ESQLAstExpression;\n value: ESQLAstExpression;\n}\n\nexport type ESQLNumericLiteralType = 'double' | 'integer';\n\nexport type ESQLLiteral =\n | ESQLDecimalLiteral\n | ESQLIntegerLiteral\n | ESQLBooleanLiteral\n | ESQLNullLiteral\n | ESQLStringLiteral\n | ESQLTimeDurationLiteral\n | ESQLDatePeriodLiteral\n | ESQLParamLiteral<string>;\n\n// Exporting here to prevent TypeScript error TS4058\n// Return type of exported function has or is using name 'ESQLNumericLiteral' from external module\n// @internal\nexport interface ESQLNumericLiteral<T extends ESQLNumericLiteralType> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: T;\n value: number;\n}\n// We cast anything as decimal (e.g. 32.12) as generic decimal numeric type here\n// @internal\nexport type ESQLDecimalLiteral = ESQLNumericLiteral<'double'>;\n\n// @internal\nexport type ESQLIntegerLiteral = ESQLNumericLiteral<'integer'>;\n\n// @internal\nexport interface ESQLBooleanLiteral extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'boolean';\n value: string;\n}\n\n// @internal\nexport interface ESQLNullLiteral extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'null';\n value: string;\n}\n\n// @internal\nexport interface ESQLStringLiteral extends ESQLAstBaseItem {\n type: 'literal';\n\n literalType: 'keyword';\n\n value: string;\n valueUnquoted: string;\n\n /**\n * Whether the string was parsed as \"unqouted\" and/or can be pretty-printed\n * unquoted, i.e. in the source text it did not have any quotes (not single \",\n * not triple \"\"\") quotes. This happens in FROM command source parsing, the\n * cluster and selector can be unquoted strings:\n *\n * ```\n * FROM <cluster>:index:<selector>\n * ```\n */\n unquoted?: boolean;\n}\n\nexport interface ESQLBaseTimeSpanLiteral<\n T extends 'time_duration' | 'date_period',\n> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: T;\n value: string;\n unit: string;\n quantity: number;\n}\nexport type ESQLDatePeriodLiteral = ESQLBaseTimeSpanLiteral<'date_period'>;\nexport type ESQLTimeDurationLiteral = ESQLBaseTimeSpanLiteral<'time_duration'>;\nexport type ESQLTimeSpanLiteral = ESQLDatePeriodLiteral | ESQLTimeDurationLiteral;\n\n// @internal\nexport interface ESQLParamLiteral<\n ParamType extends string = string,\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'param';\n paramKind: ParamKind;\n paramType: ParamType;\n value: string | number;\n}\n\nexport type ESQLParamKinds = '?' | '??';\n\n/**\n * *Unnamed* parameter is not named, just a question mark \"?\".\n *\n * @internal\n */\nexport type ESQLUnnamedParamLiteral<ParamKind extends ESQLParamKinds = ESQLParamKinds> =\n ESQLParamLiteral<'unnamed', ParamKind>;\n\n/**\n * *Named* parameter is a question mark followed by a name \"?name\".\n *\n * @internal\n */\nexport interface ESQLNamedParamLiteral<\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLParamLiteral<'named', ParamKind> {\n value: string;\n}\n\n/**\n * *Positional* parameter is a question mark followed by a number \"?1\".\n *\n * @internal\n */\nexport interface ESQLPositionalParamLiteral<\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLParamLiteral<'positional', ParamKind> {\n value: number;\n}\n\nexport type ESQLParam =\n | ESQLUnnamedParamLiteral\n | ESQLNamedParamLiteral\n | ESQLPositionalParamLiteral;\n\nexport interface ESQLIdentifier extends ESQLAstBaseItem {\n type: 'identifier';\n}\n\nexport interface ESQLMessage {\n type: 'error' | 'warning';\n text: string;\n location: ESQLLocation;\n code: string;\n errorType?: 'semantic';\n requiresCallback?: 'getColumnsFor' | 'getSources' | 'getPolicies' | 'getJoinIndices' | string;\n underlinedWarning?: boolean;\n}\n\nexport interface EditorError {\n startLineNumber: number;\n endLineNumber: number;\n startColumn: number;\n endColumn: number;\n message: string;\n code: string;\n severity: 'error' | 'warning' | number;\n}\n\nexport interface ESQLAstGenericComment<SubType extends 'single-line' | 'multi-line'> {\n type: 'comment';\n subtype: SubType;\n text: string;\n location?: ESQLLocation;\n}\n\nexport type ESQLAstCommentSingleLine = ESQLAstGenericComment<'single-line'>;\nexport type ESQLAstCommentMultiLine = ESQLAstGenericComment<'multi-line'>;\nexport type ESQLAstComment = ESQLAstCommentSingleLine | ESQLAstCommentMultiLine;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/types.ts"],"sourcesContent":["/*\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\nimport type { PromQLAstQueryExpression } from './embedded_languages/promql/types';\n\n/**\n * @deprecated A full query AST is represented by {@link ESQLAstQueryExpression} type.\n */\nexport type ESQLAst = ESQLAstCommand[];\n\nexport type ESQLAstCommand =\n | ESQLCommand\n | ESQLAstJoinCommand\n | ESQLAstChangePointCommand\n | ESQLAstRerankCommand\n | ESQLAstCompletionCommand\n | ESQLAstFuseCommand\n | ESQLAstForkCommand\n | ESQLAstUriPartsCommand\n | ESQLAstTsInfoCommand\n | ESQLAstMetricsInfoCommand\n | ESQLAstRegisteredDomainCommand;\n\nexport type ESQLAstAllCommands = ESQLAstCommand | ESQLAstHeaderCommand;\n\nexport type ESQLAstNode = ESQLAstCommand | ESQLAstHeaderCommand | ESQLAstExpression | ESQLAstItem;\n\n/**\n * Represents an *expression* in the AST.\n */\nexport type ESQLAstExpression = ESQLSingleAstItem;\n\nexport type ESQLSingleAstItem =\n | ESQLAstQueryExpression\n | ESQLFunction\n | ESQLCommandOption\n | ESQLSource\n | ESQLParens\n | ESQLColumn\n | ESQLDatePeriodLiteral\n | ESQLTimeDurationLiteral\n | ESQLList\n | ESQLLiteral\n | ESQLIdentifier\n | ESQLInlineCast\n | ESQLOrderExpression\n | ESQLUnknownItem\n | ESQLMap\n | ESQLMapEntry\n | PromQLAstQueryExpression;\n\n/**\n * A field is either an index field `this.is.field`, or it is a field assignment\n * `new_field = 123`, in which case it is a binary expression with \"=\" operator.\n *\n * Also, a field can be specified as a parameter.\n *\n * ```\n * EVAL this.is.a.nested.field\n * EVAL new_field = 123\n * EVAL ?param\n * EVAL ?param = 123\n * ```\n */\nexport type ESQLAstField = ESQLColumn | ESQLBinaryExpression | ESQLAstExpression | ESQLParam;\n\n/**\n * An array of AST nodes represents different things in different contexts.\n * For example, in command top level arguments it is treated as an \"assignment expression\".\n */\nexport type ESQLAstItem = ESQLSingleAstItem | ESQLAstItem[];\n\nexport type ESQLAstNodeWithArgs = ESQLCommand | ESQLCommandOption | ESQLFunction;\nexport type ESQLAstNodeWithChildren = ESQLAstNodeWithArgs | ESQLList;\n\n/**\n * *Proper* are nodes which are objects with `type` property, once we get rid\n * of the nodes which are plain arrays, all nodes will be *proper* and we can\n * remove this type.\n */\nexport type ESQLProperNode = ESQLAstExpression | ESQLAstCommand | ESQLAstHeaderCommand;\n\nexport interface ESQLLocation {\n min: number;\n max: number;\n}\n\nexport interface ESQLAstBaseItem<Name = string> {\n name: Name;\n text: string;\n location: ESQLLocation;\n incomplete: boolean;\n formatting?: ESQLAstNodeFormatting;\n}\n\n/**\n * Contains optional formatting information used by the pretty printer.\n */\nexport interface ESQLAstNodeFormatting {\n top?: ESQLAstComment[];\n left?: ESQLAstCommentMultiLine[];\n right?: ESQLAstCommentMultiLine[];\n rightSingleLine?: ESQLAstCommentSingleLine;\n bottom?: ESQLAstComment[];\n}\n\nexport interface ESQLCommand<Name = string> extends ESQLAstBaseItem<Name> {\n type: 'command';\n\n /**\n * The subtype of the command. For example, the `JOIN` command can be: (1)\n * LOOKUP JOIN, (2) LEFT JOIN, (3) RIGHT JOIN.\n */\n commandType?: string;\n\n args: ESQLAstItem[];\n}\n\nexport interface ESQLAstJoinCommand extends ESQLCommand<'join'> {\n commandType: 'lookup' | 'left' | 'right';\n}\n\nexport interface ESQLAstChangePointCommand extends ESQLCommand<'change_point'> {\n value: ESQLColumn;\n key?: ESQLColumn;\n target?: {\n type: ESQLColumn;\n pvalue: ESQLColumn;\n };\n}\n\nexport interface ESQLAstCompletionCommand extends ESQLCommand<'completion'> {\n prompt: ESQLAstExpression;\n inferenceId: ESQLLiteral;\n targetField?: ESQLColumn;\n}\n\nexport interface ESQLAstFuseCommand extends ESQLCommand<'fuse'> {\n fuseType?: ESQLIdentifier;\n}\n\nexport interface ESQLAstRerankCommand extends ESQLCommand<'rerank'> {\n query: ESQLLiteral;\n fields: ESQLAstField[];\n targetField?: ESQLColumn;\n inferenceId: ESQLLiteral | undefined;\n}\n\nexport interface ESQLAstForkCommand extends ESQLCommand<'fork'> {\n args: ESQLForkParens[];\n}\n\nexport interface ESQLAstMmrCommand extends ESQLCommand<'mmr'> {\n queryVector?: ESQLSingleAstItem;\n diversifyField: ESQLSingleAstItem;\n limit: ESQLSingleAstItem;\n namedParameters?: ESQLSingleAstItem;\n}\n\nexport interface ESQLAstUriPartsCommand extends ESQLCommand<'uri_parts'> {\n targetField: ESQLColumn;\n expression?: ESQLAstExpression;\n}\n\nexport interface ESQLAstTsInfoCommand extends ESQLCommand<'ts_info'> {}\n\nexport interface ESQLAstMetricsInfoCommand extends ESQLCommand<'metrics_info'> {}\n\nexport interface ESQLAstRegisteredDomainCommand extends ESQLCommand<'registered_domain'> {\n targetField: ESQLColumn;\n expression?: ESQLAstExpression;\n}\n\n/**\n * Represents a PROMQL command.\n *\n * ```\n * PROMQL query\n * PROMQL ( name = )? ( query )\n * PROMQL key1=value1 key2=value2... query\n * PROMQL key1=value1 key2=value2... ( name = )? ( query )\n * ```\n *\n * - Optional params use assignment syntax: \"key = value\"\n * - Optional `name` assignment before parentheses: name = ( query )\n * - Query can be specified without parentheses\n */\nexport interface ESQLAstPromqlCommand extends ESQLCommand<'promql'> {\n params?: ESQLMap;\n query?: ESQLAstPromqlCommandQuery;\n args: ESQLAstPromqlCommandArgs;\n}\n\nexport type ESQLAstPromqlCommandArgs =\n /** With params map and query */\n | [params: ESQLMap, query: ESQLAstPromqlCommandQuery]\n\n /** Query only, without params */\n | [query: ESQLAstPromqlCommandQuery]\n\n /** Below versions are in case the command is `.incomplete: true`. */\n | [params: ESQLMap]\n | [];\n\nexport type ESQLAstPromqlCommandQuery =\n /** query */\n | ESQLAstPromqlQuery\n\n /** ( query ) */\n | ESQLParens\n\n /** name = ( query ) */\n | ESQLBinaryExpression<'='>;\n\n/**\n * This will be replaced in the future with a proper PROMQL query AST.\n * For now, we just represent the query as an \"unknown\" node.\n */\nexport type ESQLAstPromqlQuery = PromQLAstQueryExpression;\n\n/**\n * Represents a header pseudo-command, such as SET.\n *\n * Example:\n *\n * ```\n * SET setting1 = \"value1\", setting2 = \"value2\";\n * ```\n */\nexport interface ESQLAstHeaderCommand<\n Name extends string = string,\n Arg = ESQLAstExpression,\n> extends ESQLAstBaseItem {\n type: 'header-command';\n\n /** Name of the command */\n name: Name;\n\n /**\n * Represents the arguments for the command. It has to be a list, because\n * even the SET command was initially designed to accept multiple\n * assignments.\n *\n * Example:\n *\n * ```\n * SET setting1 = \"value1\", setting2 = \"value2\"\n * ```\n */\n args: Arg[];\n}\n\nexport type ESQLAstSetHeaderCommand = ESQLAstHeaderCommand<\n 'set',\n ESQLBinaryExpression<BinaryExpressionAssignmentOperator>\n>;\n\nexport type ESQLIdentifierOrParam = ESQLIdentifier | ESQLParamLiteral;\n\nexport interface ESQLCommandOption extends ESQLAstBaseItem {\n type: 'option';\n args: ESQLAstItem[];\n}\n\nexport interface ESQLAstQueryExpression extends ESQLAstBaseItem<''> {\n type: 'query';\n header?: ESQLAstHeaderCommand[];\n commands: ESQLAstCommand[];\n}\n\n/**\n * We coalesce all function calls and expressions into a single \"function\"\n * node type. This subtype is used to distinguish between different types\n * of function calls and expressions.\n *\n * - `variadic-call` is a function call with any number of arguments: fn(a, b, c, ...)\n * - `unary-expression` is a unary expression: -a, +a, NOT a, ...\n * - `binary-expression` is a binary expression: a + b, a - b, a * b, ...\n */\nexport type FunctionSubtype =\n | 'variadic-call' // fn(a, b, c, ...)\n | 'unary-expression' // -a, +a, NOT a, ...\n | 'postfix-unary-expression' // a IS NULL, a IS NOT NULL, ...\n | 'binary-expression'; // a + b, a - b, a * b, ...\n\nexport interface ESQLFunction<\n Subtype extends FunctionSubtype = FunctionSubtype,\n Name extends string = string,\n> extends ESQLAstBaseItem<Name> {\n type: 'function';\n\n /**\n * Default is 'variadic-call'.\n */\n subtype?: Subtype;\n\n /**\n * A node representing the function or operator being called.\n */\n operator?: ESQLIdentifier | ESQLParamLiteral;\n\n args: ESQLAstItem[];\n}\n\nexport interface ESQLFunctionCallExpression extends ESQLFunction<'variadic-call'> {\n subtype: 'variadic-call';\n args: ESQLAstItem[];\n}\n\nexport interface ESQLUnaryExpression<Name extends string = string> extends ESQLFunction<\n 'unary-expression',\n Name\n> {\n subtype: 'unary-expression';\n args: [ESQLAstItem];\n}\n\nexport interface ESQLPostfixUnaryExpression<Name extends string = string> extends ESQLFunction<\n 'postfix-unary-expression',\n Name\n> {\n subtype: 'postfix-unary-expression';\n args: [ESQLAstItem];\n}\n\n/**\n * Represents an order expression used in SORT commands.\n *\n * ```\n * ... | SORT field ASC NULLS FIRST\n * ```\n */\nexport interface ESQLOrderExpression extends ESQLAstBaseItem {\n type: 'order';\n order: '' | 'ASC' | 'DESC';\n nulls: '' | 'NULLS FIRST' | 'NULLS LAST';\n args: [field: ESQLAstItem];\n}\n\nexport interface ESQLBinaryExpression<\n Name extends BinaryExpressionOperator = BinaryExpressionOperator,\n> extends ESQLFunction<'binary-expression', Name> {\n subtype: 'binary-expression';\n args: [ESQLAstItem, ESQLAstItem];\n}\n\nexport type BinaryExpressionOperator =\n | BinaryExpressionArithmeticOperator\n | BinaryExpressionAssignmentOperator\n | BinaryExpressionComparisonOperator\n | BinaryExpressionRegexOperator\n | BinaryExpressionRenameOperator\n | BinaryExpressionWhereOperator\n | BinaryExpressionMatchOperator\n | BinaryExpressionIn\n | BinaryExpressionLogical;\n\nexport type BinaryExpressionArithmeticOperator = '+' | '-' | '*' | '/' | '%';\nexport type BinaryExpressionAssignmentOperator = '=';\nexport type BinaryExpressionComparisonOperator = '==' | '=~' | '!=' | '<' | '<=' | '>' | '>=';\nexport type BinaryExpressionRegexOperator = 'like' | 'not like' | 'rlike' | 'not rlike';\nexport type BinaryExpressionRenameOperator = 'as';\nexport type BinaryExpressionWhereOperator = 'where';\nexport type BinaryExpressionMatchOperator = ':';\nexport type BinaryExpressionIn = 'in' | 'not in';\nexport type BinaryExpressionLogical = 'and' | 'or';\n\nexport interface ESQLInlineCast<ValueType = ESQLAstItem> extends ESQLAstBaseItem {\n type: 'inlineCast';\n value: ValueType;\n castType: string;\n}\n\n/**\n * This node represents something the AST generator\n * didn't recognize in the ANTLR parse tree.\n *\n * It can show up if the AST generator code is out of sync\n * with the ANTLR grammar or if there is some idiosyncrasy\n * or bug in the parse tree.\n *\n * These nodes can be ignored for the purpose of validation\n * and autocomplete, but they may be helpful in detecting bugs.\n */\nexport interface ESQLUnknownItem extends ESQLAstBaseItem {\n type: 'unknown';\n}\n\nexport interface ESQLSource extends ESQLAstBaseItem {\n type: 'source';\n sourceType: 'index' | 'policy';\n\n /**\n * Represents the prefix part of the source identifier. Empty string if not\n * present. Used in index pattern as the cluster identifier or as \"mode\" in\n * enrich policy.\n *\n * ```\n * FROM [<prefix>:]<index>\n * ```\n */\n prefix?: ESQLStringLiteral | undefined;\n\n /**\n * Represents the index part of the source identifier. Unescaped and unquoted.\n *\n * ```\n * FROM [<cluster>:]<index>\n * ```\n */\n index?: ESQLStringLiteral | undefined;\n\n /**\n * Represents the selector (component) part of the source identifier.\n *\n * ```\n * FROM <index>[::<selector>]\n * ```\n */\n selector?: ESQLStringLiteral | undefined;\n}\n\n/**\n * Represents any expression wrapped in parentheses.\n *\n * ```\n * FROM ( <query> )\n * ```\n */\nexport interface ESQLParens extends ESQLAstBaseItem {\n type: 'parens';\n child: ESQLAstExpression;\n}\n\nexport interface ESQLForkParens extends ESQLParens {\n child: ESQLAstQueryExpression;\n}\n\nexport interface ESQLColumn extends ESQLAstBaseItem {\n type: 'column';\n\n /**\n * Optional qualifier for the column, e.g. index name or alias.\n *\n * @example\n *\n * ```esql\n * [index].[column]\n * [index].[nested.column.part]\n * ```\n *\n * `index` is the qualifier.\n */\n qualifier?: ESQLIdentifier;\n\n /**\n * A ES|QL column name can be composed of multiple parts,\n * e.g: part1.part2.`part``3️⃣`.?param. Where parts can be quoted, or not\n * quoted, or even be a parameter.\n *\n * The args list contains the parts of the column name.\n */\n args: Array<ESQLIdentifier | ESQLParam>;\n\n /**\n * An identifier can be composed of multiple parts, e.g: part1.part2.`part``3️⃣`.\n * This property contains the parsed unquoted parts of the identifier.\n * For example: `['part1', 'part2', 'part`3️⃣']`.\n */\n parts: string[];\n\n /**\n * @deprecated\n *\n * An identifier can be composed of multiple parts, e.g: part1.part2.`part3️⃣`\n *\n * Each part can be quoted or not quoted independently. A single `quoted`\n * property is not enough to represent the identifier. Use `parts` instead.\n */\n quoted: boolean;\n}\n\n/**\n * Represents list-like structures where elements are separated by commas.\n *\n * *Literal lists* use square brackets and can contain only\n * string, number, or boolean literals and all elements must be of the same\n * type:\n *\n * ```\n * [1, 2, 3]\n * ```\n *\n * *Tuple lists* use round brackets and can contain any type of expression.\n * Tuple list are used in the `IN` expression:\n *\n * ```\n * a IN (\"abc\", \"def\")\n * ```\n */\nexport interface ESQLList extends ESQLAstBaseItem {\n type: 'list';\n\n /**\n * Represents various types of lists in ES|QL language.\n *\n * - `literal` - a literal list using square brackets, e.g. `[1, 2, 3]`\n * - `tuple` - a tuple list using round brackets, e.g. `(a, b, c)`\n * - `bare` - a bare list without any enclosing brackets, e.g. `a, b, c`\n *\n * @default 'literal'\n */\n subtype?: 'literal' | 'tuple' | 'bare';\n\n values: ESQLAstExpression[];\n}\n\n/**\n * Represents a ES|QL \"map\" object, a list of key-value pairs. Can have different\n * *representation* styles, such as \"map\" or \"listpairs\". The representation\n * style affects how the map is pretty-printed.\n */\nexport interface ESQLMap extends ESQLAstBaseItem {\n type: 'map';\n entries: ESQLMapEntry[];\n\n /**\n * Specifies how the key-value pairs are represented.\n *\n * @default 'map'\n *\n * `map` example:\n *\n * ```\n * { \"key1\": \"value1\", \"key2\": \"value2\" }\n * ```\n *\n * `listpairs` example:\n *\n * ```\n * key1 value1 key2 value2\n * ```\n *\n * `assignment` example:\n *\n * ```\n * key1=value1 key2=value2\n * ```\n */\n representation?: 'map' | 'listpairs' | 'assignment';\n}\n\n/**\n * Represents a key-value pair in a ES|QL map object.\n */\nexport interface ESQLMapEntry extends ESQLAstBaseItem {\n type: 'map-entry';\n key: ESQLAstExpression;\n value: ESQLAstExpression;\n}\n\nexport type ESQLNumericLiteralType = 'double' | 'integer';\n\nexport type ESQLLiteral =\n | ESQLDecimalLiteral\n | ESQLIntegerLiteral\n | ESQLBooleanLiteral\n | ESQLNullLiteral\n | ESQLStringLiteral\n | ESQLTimeDurationLiteral\n | ESQLDatePeriodLiteral\n | ESQLParamLiteral<string>;\n\n// Exporting here to prevent TypeScript error TS4058\n// Return type of exported function has or is using name 'ESQLNumericLiteral' from external module\n// @internal\nexport interface ESQLNumericLiteral<T extends ESQLNumericLiteralType> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: T;\n value: number;\n}\n// We cast anything as decimal (e.g. 32.12) as generic decimal numeric type here\n// @internal\nexport type ESQLDecimalLiteral = ESQLNumericLiteral<'double'>;\n\n// @internal\nexport type ESQLIntegerLiteral = ESQLNumericLiteral<'integer'>;\n\n// @internal\nexport interface ESQLBooleanLiteral extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'boolean';\n value: string;\n}\n\n// @internal\nexport interface ESQLNullLiteral extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'null';\n value: string;\n}\n\n// @internal\nexport interface ESQLStringLiteral extends ESQLAstBaseItem {\n type: 'literal';\n\n literalType: 'keyword';\n\n value: string;\n valueUnquoted: string;\n\n /**\n * Whether the string was parsed as \"unqouted\" and/or can be pretty-printed\n * unquoted, i.e. in the source text it did not have any quotes (not single \",\n * not triple \"\"\") quotes. This happens in FROM command source parsing, the\n * cluster and selector can be unquoted strings:\n *\n * ```\n * FROM <cluster>:index:<selector>\n * ```\n */\n unquoted?: boolean;\n}\n\nexport interface ESQLBaseTimeSpanLiteral<\n T extends 'time_duration' | 'date_period',\n> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: T;\n value: string;\n unit: string;\n quantity: number;\n}\nexport type ESQLDatePeriodLiteral = ESQLBaseTimeSpanLiteral<'date_period'>;\nexport type ESQLTimeDurationLiteral = ESQLBaseTimeSpanLiteral<'time_duration'>;\nexport type ESQLTimeSpanLiteral = ESQLDatePeriodLiteral | ESQLTimeDurationLiteral;\n\n// @internal\nexport interface ESQLParamLiteral<\n ParamType extends string = string,\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLAstBaseItem {\n type: 'literal';\n literalType: 'param';\n paramKind: ParamKind;\n paramType: ParamType;\n value: string | number;\n}\n\nexport type ESQLParamKinds = '?' | '??';\n\n/**\n * *Unnamed* parameter is not named, just a question mark \"?\".\n *\n * @internal\n */\nexport type ESQLUnnamedParamLiteral<ParamKind extends ESQLParamKinds = ESQLParamKinds> =\n ESQLParamLiteral<'unnamed', ParamKind>;\n\n/**\n * *Named* parameter is a question mark followed by a name \"?name\".\n *\n * @internal\n */\nexport interface ESQLNamedParamLiteral<\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLParamLiteral<'named', ParamKind> {\n value: string;\n}\n\n/**\n * *Positional* parameter is a question mark followed by a number \"?1\".\n *\n * @internal\n */\nexport interface ESQLPositionalParamLiteral<\n ParamKind extends ESQLParamKinds = ESQLParamKinds,\n> extends ESQLParamLiteral<'positional', ParamKind> {\n value: number;\n}\n\nexport type ESQLParam =\n | ESQLUnnamedParamLiteral\n | ESQLNamedParamLiteral\n | ESQLPositionalParamLiteral;\n\nexport interface ESQLIdentifier extends ESQLAstBaseItem {\n type: 'identifier';\n}\n\nexport interface ESQLMessage {\n type: 'error' | 'warning';\n text: string;\n location: ESQLLocation;\n code: string;\n errorType?: 'semantic';\n requiresCallback?: 'getColumnsFor' | 'getSources' | 'getPolicies' | 'getJoinIndices' | string;\n underlinedWarning?: boolean;\n}\n\nexport interface EditorError {\n startLineNumber: number;\n endLineNumber: number;\n startColumn: number;\n endColumn: number;\n message: string;\n code: string;\n severity: 'error' | 'warning' | number;\n}\n\nexport interface ESQLAstGenericComment<SubType extends 'single-line' | 'multi-line'> {\n type: 'comment';\n subtype: SubType;\n text: string;\n location?: ESQLLocation;\n}\n\nexport type ESQLAstCommentSingleLine = ESQLAstGenericComment<'single-line'>;\nexport type ESQLAstCommentMultiLine = ESQLAstGenericComment<'multi-line'>;\nexport type ESQLAstComment = ESQLAstCommentSingleLine | ESQLAstCommentMultiLine;\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|