@conterra/ct-mapapps-typings 4.17.1-next.20240320050317 → 4.17.1-next.20240322050922
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/ct/store/Filter.d.ts +0 -68
- package/package.json +1 -1
- package/store-api/utils.d.ts +0 -1
- package/ct/store/ComplexMemory.d.ts +0 -3
- package/ct/store/ComplexQuery.d.ts +0 -2
- package/ct/store/ComplexQueryEngine.d.ts +0 -2
- package/ct/store/ComplexQueryToRQL.d.ts +0 -9
- package/ct/store/ComplexQueryToSQL.d.ts +0 -10
- package/ct/store/ComplexQueryToSolrQL.d.ts +0 -502
- package/ct/store/RQLStore.d.ts +0 -2
- package/ct/store/SQLStore.d.ts +0 -2
- package/ct/store/SpatialQuery.d.ts +0 -2
- package/ct/store/StoreUtil.d.ts +0 -10
- package/ct/store/_RestStore.d.ts +0 -2
package/ct/store/Filter.d.ts
CHANGED
|
@@ -1,68 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Metadata to describe a store.
|
|
3
|
-
*/
|
|
4
|
-
interface Metadata {
|
|
5
|
-
/** Stores may contain arbitrary custom metadata information. */
|
|
6
|
-
readonly [k: string]: any;
|
|
7
|
-
/**
|
|
8
|
-
* Title of the store.
|
|
9
|
-
*/
|
|
10
|
-
readonly title?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Description of the store.
|
|
13
|
-
*/
|
|
14
|
-
readonly description?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Name of the display field.
|
|
17
|
-
* Used e.g. for search results to display items.
|
|
18
|
-
*/
|
|
19
|
-
readonly displayField?: string;
|
|
20
|
-
/**
|
|
21
|
-
* Fields available in the store. These are mandatory.
|
|
22
|
-
*/
|
|
23
|
-
readonly fields: readonly FieldData[];
|
|
24
|
-
/**
|
|
25
|
-
* Flag to indicate, if the store supports spatial operations.
|
|
26
|
-
* If set to 'true', this implicitly declares that the items have a 'geometry' field.
|
|
27
|
-
* Default is 'false'.
|
|
28
|
-
*/
|
|
29
|
-
readonly supportsGeometry?: boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Flag to indicate, if the store can react to the 'sort' option in queries.
|
|
32
|
-
* If this flag ommited, the default value is 'true'.
|
|
33
|
-
*/
|
|
34
|
-
readonly supportsSorting?: boolean;
|
|
35
|
-
/**
|
|
36
|
-
* Indicates whether the store supports listening for changes in the underlying data.
|
|
37
|
-
* If this is true, `store.on("changed", ...)` must be implemented as well.
|
|
38
|
-
*
|
|
39
|
-
* Note that depending on the specific store, not all kinds of changes can be detected.
|
|
40
|
-
* For example, a store based on a feature layer might report client side edits, but may
|
|
41
|
-
* not report changes made to the service by other users.
|
|
42
|
-
*/
|
|
43
|
-
readonly supportsChangedEvent?: boolean;
|
|
44
|
-
}
|
|
45
|
-
/**
|
|
46
|
-
* List of well known field types.
|
|
47
|
-
*/
|
|
48
|
-
type WellKnownFieldTypes = "string" | "number" | "date" | "geometry";
|
|
49
|
-
/**
|
|
50
|
-
* Field information in the store's metadata to describe a single field available in the store.
|
|
51
|
-
*/
|
|
52
|
-
interface FieldData {
|
|
53
|
-
readonly [k: string]: any;
|
|
54
|
-
/** Name of the field. */
|
|
55
|
-
readonly name: string;
|
|
56
|
-
/** Title of the field. */
|
|
57
|
-
readonly title?: string;
|
|
58
|
-
/** Type of the field's value. */
|
|
59
|
-
readonly type: WellKnownFieldTypes | string;
|
|
60
|
-
/** If 'type' of the field is 'number', the 'precision' property indicates the kind of the number. */
|
|
61
|
-
readonly precision?: "single" | "double" | "long" | "float" | "smallinteger" | "biginteger" | "integer";
|
|
62
|
-
/** Marks a field as identity field. Should correlate with 'store.idProperty' */
|
|
63
|
-
readonly identifier?: boolean;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
1
|
/**
|
|
67
2
|
* A function to decorate a store with a predefined query.
|
|
68
3
|
* This query will always be added to the queries against the decorated store.
|
|
@@ -71,8 +6,5 @@ interface FieldData {
|
|
|
71
6
|
* The filter can be changed by using the setFilter method added to the store.
|
|
72
7
|
*/
|
|
73
8
|
declare function Filter(store: any, filterQuery: any, filterOptions: any): any;
|
|
74
|
-
declare namespace Filter {
|
|
75
|
-
function filterMetaData(...args: any[]): Metadata;
|
|
76
|
-
}
|
|
77
9
|
|
|
78
10
|
export { Filter as default };
|
package/package.json
CHANGED
package/store-api/utils.d.ts
CHANGED
|
@@ -68,7 +68,6 @@ declare function toQueryResult<T extends {}>(result: undefined): ResultItems<T>;
|
|
|
68
68
|
* This function creates a new function which can be used to implement
|
|
69
69
|
* a Store.query method by evaluating and filtering data available in an iterable, e.g. array.
|
|
70
70
|
*
|
|
71
|
-
* It is a replacement for 'ct/store/ComplexQueryEngine'
|
|
72
71
|
*
|
|
73
72
|
* @example
|
|
74
73
|
* ```js
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { toSQLWhere, astToSQLWhere, _operatorMapping } from 'store-api/rest/ComplexQueryToSQL';
|
|
2
|
-
export { _operatorMapping, astToSQLWhere, toSQLWhere } from 'store-api/rest/ComplexQueryToSQL';
|
|
3
|
-
|
|
4
|
-
declare namespace exports {
|
|
5
|
-
export { toSQLWhere };
|
|
6
|
-
export { astToSQLWhere };
|
|
7
|
-
export { _operatorMapping };
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export { exports as default };
|
|
@@ -1,502 +0,0 @@
|
|
|
1
|
-
import * as store_api_rest_ComplexQueryToSolrQL from 'store-api/rest/ComplexQueryToSolrQL';
|
|
2
|
-
import { toSolrQL, astToSolrQL, _operatorMapping } from 'store-api/rest/ComplexQueryToSolrQL';
|
|
3
|
-
import Geometry from 'esri/geometry/Geometry';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Language specification of a ComplexQuery.
|
|
7
|
-
*
|
|
8
|
-
* @module
|
|
9
|
-
*/
|
|
10
|
-
/** Expression to describe a ComplexQuery. */
|
|
11
|
-
type ComplexQueryExpression = ShortAndExpression | LogicExpression;
|
|
12
|
-
/**
|
|
13
|
-
* Expression to provide a short way to specify an '$and' expression.
|
|
14
|
-
*
|
|
15
|
-
* ```js
|
|
16
|
-
* { a: 1 , b: 3 }
|
|
17
|
-
*
|
|
18
|
-
* // this is the same like:
|
|
19
|
-
* { $and: [{a: {$eq: 1}}, {b: {$eq:3}}]}
|
|
20
|
-
* ```
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
interface ShortAndExpression {
|
|
24
|
-
/**
|
|
25
|
-
* Attribute that should match the condition.
|
|
26
|
-
*/
|
|
27
|
-
readonly [attributeName: string]: SimpleValue | ValueOperatorExpression | LogicExpression;
|
|
28
|
-
}
|
|
29
|
-
/**
|
|
30
|
-
* '$and' operator expression.
|
|
31
|
-
* Logical 'and' that combines other expressions.
|
|
32
|
-
*
|
|
33
|
-
* ```js
|
|
34
|
-
* { $and: [{a: {$eq: 1}}, {b: {$eq:3}}]}
|
|
35
|
-
* ```
|
|
36
|
-
* @internal
|
|
37
|
-
*/
|
|
38
|
-
interface AndExpression {
|
|
39
|
-
/** Expression containing other expressions to be combined with 'and'. */
|
|
40
|
-
readonly $and: ReadonlyArray<ComplexQueryExpression>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* '$or' operator expression.
|
|
44
|
-
* Logical 'or' that combines other expressions.
|
|
45
|
-
* ```js
|
|
46
|
-
* { $or: [{a: {$eq: 1}}, {a: {$eq:2}}]}
|
|
47
|
-
* ```
|
|
48
|
-
* @internal
|
|
49
|
-
*/
|
|
50
|
-
interface OrExpression {
|
|
51
|
-
/** Expression containing other expressions to be combined with 'or'. */
|
|
52
|
-
readonly $or: ReadonlyArray<ComplexQueryExpression>;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* '$nor' operator expression.
|
|
56
|
-
* Logical 'negating or' expression.
|
|
57
|
-
* Semantically the same as a `$not : { $or : [...] }` combination.
|
|
58
|
-
*
|
|
59
|
-
* ```js
|
|
60
|
-
* { $nor: [{a: {$eq: 1}}, {a: {$eq:2}}]}
|
|
61
|
-
* ```
|
|
62
|
-
* @internal
|
|
63
|
-
*/
|
|
64
|
-
interface NOrExpression {
|
|
65
|
-
/** Expression containing other expressions to be combined with 'negating or'. */
|
|
66
|
-
readonly $nor: ReadonlyArray<ComplexQueryExpression>;
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* '$not' operator expression.
|
|
70
|
-
* Logically negates another expression.
|
|
71
|
-
*
|
|
72
|
-
* ```js
|
|
73
|
-
* { $not: {a: {$eq: 1} } }
|
|
74
|
-
* ```
|
|
75
|
-
* @internal
|
|
76
|
-
*/
|
|
77
|
-
interface NotExpression {
|
|
78
|
-
/** Expression to be negated. */
|
|
79
|
-
readonly $not: ComplexQueryExpression;
|
|
80
|
-
}
|
|
81
|
-
/**
|
|
82
|
-
* '$eq' operator expression.
|
|
83
|
-
* Tests for an attribute to equal a given value.
|
|
84
|
-
*
|
|
85
|
-
* ```js
|
|
86
|
-
* {a: {$eq: 1} }
|
|
87
|
-
* ```
|
|
88
|
-
* The short form is `{a: 1}`.
|
|
89
|
-
* @internal
|
|
90
|
-
*/
|
|
91
|
-
interface EqualsExpression {
|
|
92
|
-
/** Value to be checked against for equality. */
|
|
93
|
-
readonly $eq: SimpleValue;
|
|
94
|
-
}
|
|
95
|
-
/**
|
|
96
|
-
* '$eqw' operator expression.
|
|
97
|
-
* Tests for an attribute to match a wildcard expression.
|
|
98
|
-
* Allowed wild cards are '*' (any char) and '?' (single char).
|
|
99
|
-
*
|
|
100
|
-
* ```js
|
|
101
|
-
* {a: {$eqw: "H*lo"} }
|
|
102
|
-
* ```
|
|
103
|
-
* @internal
|
|
104
|
-
*/
|
|
105
|
-
interface EqualsWildCardExpression {
|
|
106
|
-
/** The value containing the wild card. */
|
|
107
|
-
readonly $eqw: string;
|
|
108
|
-
}
|
|
109
|
-
/**
|
|
110
|
-
* '$lt' operator expression.
|
|
111
|
-
* Tests for an attribute to be lesser than a given value.
|
|
112
|
-
*
|
|
113
|
-
* ```js
|
|
114
|
-
* {a: {$lt: 4} }
|
|
115
|
-
* ```
|
|
116
|
-
* @internal
|
|
117
|
-
*/
|
|
118
|
-
interface LesserExpression {
|
|
119
|
-
/** Value to check against. */
|
|
120
|
-
readonly $lt: SimpleValue;
|
|
121
|
-
}
|
|
122
|
-
/**
|
|
123
|
-
* '$lte' operator expression.
|
|
124
|
-
* Tests for an attribute to be lesser or equal to a given value.
|
|
125
|
-
*
|
|
126
|
-
* ```js
|
|
127
|
-
* {a: {$lte: 4} }
|
|
128
|
-
* ```
|
|
129
|
-
* @internal
|
|
130
|
-
*/
|
|
131
|
-
interface LesserOrEqualExpression {
|
|
132
|
-
/** Value to check against. */
|
|
133
|
-
readonly $lte: SimpleValue;
|
|
134
|
-
}
|
|
135
|
-
/**
|
|
136
|
-
* '$gt' operator expression.
|
|
137
|
-
* Tests for an attribute to be greater than a given value.
|
|
138
|
-
*
|
|
139
|
-
* ```js
|
|
140
|
-
* {a: {$gt: 4} }
|
|
141
|
-
* ```
|
|
142
|
-
* @internal
|
|
143
|
-
*/
|
|
144
|
-
interface GreaterExpression {
|
|
145
|
-
/** Value to check against. */
|
|
146
|
-
readonly $gt: SimpleValue;
|
|
147
|
-
}
|
|
148
|
-
/**
|
|
149
|
-
* '$gte' operator expression.
|
|
150
|
-
* Tests for an attribute to be greater or equal to a given value.
|
|
151
|
-
*
|
|
152
|
-
* ```js
|
|
153
|
-
* {a: {$gte: 4} }
|
|
154
|
-
* ```
|
|
155
|
-
* @internal
|
|
156
|
-
*/
|
|
157
|
-
interface GreaterOrEqual {
|
|
158
|
-
/** Value to check against. */
|
|
159
|
-
readonly $gte: SimpleValue;
|
|
160
|
-
}
|
|
161
|
-
/**
|
|
162
|
-
* '$in' operator expression.
|
|
163
|
-
* Tests for an attribute to be equal to at least one value in a list of values.
|
|
164
|
-
*
|
|
165
|
-
* ```js
|
|
166
|
-
* {a: {$in: [1,2,3,4]} }
|
|
167
|
-
* ```
|
|
168
|
-
* This is semantically equivalent to:
|
|
169
|
-
* ```js
|
|
170
|
-
* {$or: [{a:{$eq:1}},{a:{$eq:2}},{a:{$eq:3}},{a:{$eq:4}}]}}
|
|
171
|
-
* ```
|
|
172
|
-
* @internal
|
|
173
|
-
*/
|
|
174
|
-
interface InExpression {
|
|
175
|
-
/** List of values to check against. */
|
|
176
|
-
readonly $in: ReadonlyArray<SimpleValue>;
|
|
177
|
-
}
|
|
178
|
-
/**
|
|
179
|
-
* '$nin' operator expression.
|
|
180
|
-
* Tests for an attribute not to be equal to any of the values in a list of values.
|
|
181
|
-
*
|
|
182
|
-
* ```js
|
|
183
|
-
* {a: {$nin: [1,2,3,4]} }
|
|
184
|
-
* ```
|
|
185
|
-
* This is semantically equivalent to:
|
|
186
|
-
* ```js
|
|
187
|
-
* {$not:{$or: [{a:{$eq:1}},{a:{$eq:2}},{a:{$eq:3}},{a:{$eq:4}}]}}}
|
|
188
|
-
* ```
|
|
189
|
-
* @internal
|
|
190
|
-
*/
|
|
191
|
-
interface NotInExpression {
|
|
192
|
-
/** List of values to check against. */
|
|
193
|
-
readonly $nin: ReadonlyArray<SimpleValue>;
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* '$neq' operator expression.
|
|
197
|
-
* Tests for an attribute not to be equal to a value.
|
|
198
|
-
*
|
|
199
|
-
* ```js
|
|
200
|
-
* {a: {$neq: 1} }
|
|
201
|
-
* ```
|
|
202
|
-
* This is semantically equivalent to:
|
|
203
|
-
* ```js
|
|
204
|
-
* {$not: {a: {$eq: 1}}}
|
|
205
|
-
* ```
|
|
206
|
-
* @internal
|
|
207
|
-
*/
|
|
208
|
-
interface NotEqualExpression {
|
|
209
|
-
/** Value to check against. */
|
|
210
|
-
readonly $neq: SimpleValue;
|
|
211
|
-
}
|
|
212
|
-
/**
|
|
213
|
-
* '$exists' operator expression.
|
|
214
|
-
* Tests for an attribute to exist or not exist, depending on the boolean flag given.
|
|
215
|
-
*
|
|
216
|
-
* ```js
|
|
217
|
-
* {a: {$exists: true} }
|
|
218
|
-
* ```
|
|
219
|
-
* @internal
|
|
220
|
-
*/
|
|
221
|
-
interface ExistsExpression {
|
|
222
|
-
/** Flag to determine if a value exists or not. */
|
|
223
|
-
readonly $exists: boolean;
|
|
224
|
-
}
|
|
225
|
-
/**
|
|
226
|
-
* '$suggest' operator expression.
|
|
227
|
-
* Tests if an attribute value may be suggested by the given string.
|
|
228
|
-
*
|
|
229
|
-
* ```js
|
|
230
|
-
* {a: {$suggest: "term"} }
|
|
231
|
-
* ```
|
|
232
|
-
* @internal
|
|
233
|
-
*/
|
|
234
|
-
interface SuggestExpression {
|
|
235
|
-
/** Suggest term for an attribute value. */
|
|
236
|
-
readonly $suggest: string;
|
|
237
|
-
}
|
|
238
|
-
/**
|
|
239
|
-
* '$elemMatch' operator expression.
|
|
240
|
-
* Only valid if an attribute has an array as value.
|
|
241
|
-
* Tests for at least one element in the array to fulfill the given expression.
|
|
242
|
-
*
|
|
243
|
-
* ```js
|
|
244
|
-
* {a:{$elemMatch: {name:{$eq: "x"}}}}
|
|
245
|
-
* ```
|
|
246
|
-
* @internal
|
|
247
|
-
*/
|
|
248
|
-
interface ElementMatchExpression {
|
|
249
|
-
/** Expression to check against. */
|
|
250
|
-
readonly $elemMatch: ReadonlyArray<ComplexQueryExpression>;
|
|
251
|
-
}
|
|
252
|
-
/**
|
|
253
|
-
* '$intersects' spatial operator expression.
|
|
254
|
-
* Operator matches if attribute `geometry` intersects the given geometry.
|
|
255
|
-
*
|
|
256
|
-
* ```js
|
|
257
|
-
* { geometry : { $intersects: testGeometry }}
|
|
258
|
-
* ```
|
|
259
|
-
* @internal
|
|
260
|
-
*/
|
|
261
|
-
interface SpatialIntersectsExpression {
|
|
262
|
-
/** Test geometry */
|
|
263
|
-
readonly $intersects: Geometry;
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* '$contains' spatial operator expression.
|
|
267
|
-
* Operator matches if attribute `geometry` is contained inside the given container geometry.
|
|
268
|
-
*
|
|
269
|
-
* ```js
|
|
270
|
-
* { geometry : { $contains: containerGeometry }}
|
|
271
|
-
* ```
|
|
272
|
-
* @internal
|
|
273
|
-
*/
|
|
274
|
-
interface SpatialContainsExpression {
|
|
275
|
-
/** Test geometry */
|
|
276
|
-
readonly $contains: Geometry;
|
|
277
|
-
}
|
|
278
|
-
/**
|
|
279
|
-
* '$crosses' spatial operator expression.
|
|
280
|
-
* Operator matches if attribute `geometry` crosses the other geometry.
|
|
281
|
-
*
|
|
282
|
-
* ```js
|
|
283
|
-
* { geometry : { $crosses: testGeometry }}
|
|
284
|
-
* ```
|
|
285
|
-
* @internal
|
|
286
|
-
*/
|
|
287
|
-
interface SpatialCrossesExpression {
|
|
288
|
-
/** Test geometry */
|
|
289
|
-
readonly $crosses: Geometry;
|
|
290
|
-
}
|
|
291
|
-
/**
|
|
292
|
-
* '$envelope-intersects' spatial operator expression.
|
|
293
|
-
* Operator matches if envelope of attribute `geometry` intersects envelope of other geometry.
|
|
294
|
-
*
|
|
295
|
-
* ```js
|
|
296
|
-
* { geometry : { $envelope-intersects: testGeometry }}
|
|
297
|
-
* ```
|
|
298
|
-
* @internal
|
|
299
|
-
*/
|
|
300
|
-
interface SpatialEnvelopeIntersectsExpression {
|
|
301
|
-
/** Test geometry */
|
|
302
|
-
readonly "$envelope-intersects": Geometry;
|
|
303
|
-
}
|
|
304
|
-
/**
|
|
305
|
-
* '$overlaps' spatial operator expression.
|
|
306
|
-
* Operator matches if attribute `geometry` overlaps the other geometry.
|
|
307
|
-
*
|
|
308
|
-
* ```js
|
|
309
|
-
* { geometry : { $overlaps: testGeometry }}
|
|
310
|
-
* ```
|
|
311
|
-
* @internal
|
|
312
|
-
*/
|
|
313
|
-
interface SpatialOverlapsExpression {
|
|
314
|
-
/** Test geometry */
|
|
315
|
-
readonly "$overlaps": Geometry;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* '$touches' spatial operator expression.
|
|
319
|
-
* Operator matches if attribute `geometry` touches the other geometry (share a common boundary).
|
|
320
|
-
*
|
|
321
|
-
* ```js
|
|
322
|
-
* { geometry : { $touches: testGeometry }}
|
|
323
|
-
* ```
|
|
324
|
-
* @internal
|
|
325
|
-
*/
|
|
326
|
-
interface SpatialTouchesExpression {
|
|
327
|
-
/** Test geometry */
|
|
328
|
-
readonly "$touches": Geometry;
|
|
329
|
-
}
|
|
330
|
-
/**
|
|
331
|
-
* '$within' spatial operator expression.
|
|
332
|
-
* The opposite of `$contains`.
|
|
333
|
-
*
|
|
334
|
-
* Operator matches if attribute `geometry` contains the other geometry
|
|
335
|
-
* (Alternative spelling: other geometry is within attribute `geometry`).
|
|
336
|
-
*
|
|
337
|
-
* ```js
|
|
338
|
-
* { geometry : { $within: testGeometry }}
|
|
339
|
-
* ```
|
|
340
|
-
* @internal
|
|
341
|
-
*/
|
|
342
|
-
interface SpatialWithinExpression {
|
|
343
|
-
/** Test geometry */
|
|
344
|
-
readonly "$within": Geometry;
|
|
345
|
-
}
|
|
346
|
-
/** Logical expressions to combine other expressions.
|
|
347
|
-
* @internal
|
|
348
|
-
*/
|
|
349
|
-
type LogicExpression = NotExpression | AndExpression | OrExpression | NOrExpression;
|
|
350
|
-
type SpatialOperatorExpression = SpatialIntersectsExpression | SpatialContainsExpression | SpatialCrossesExpression | SpatialEnvelopeIntersectsExpression | SpatialOverlapsExpression | SpatialTouchesExpression | SpatialWithinExpression;
|
|
351
|
-
/** Value operator expressions to check attribute values against.
|
|
352
|
-
* @internal
|
|
353
|
-
*/
|
|
354
|
-
type ValueOperatorExpression = EqualsExpression | EqualsWildCardExpression | LesserExpression | LesserOrEqualExpression | GreaterExpression | GreaterOrEqual | InExpression | NotInExpression | NotEqualExpression | ExistsExpression | SuggestExpression | ElementMatchExpression | SpatialOperatorExpression;
|
|
355
|
-
/** Allowed types for simple values.
|
|
356
|
-
* @internal
|
|
357
|
-
*/
|
|
358
|
-
type SimpleValue = string | number | boolean | Date | RegExp | null | undefined | any[] | Record<string, any>;
|
|
359
|
-
|
|
360
|
-
/**
|
|
361
|
-
* Callback method that is triggered while walking over an AST.
|
|
362
|
-
* @internal
|
|
363
|
-
*/
|
|
364
|
-
type VisitCallback = (node: ASTNode, walker: Walker, childIndex: number, childrenCount: number) => void;
|
|
365
|
-
/**
|
|
366
|
-
* Callback method that is triggered while walking over child nodes on an AST.
|
|
367
|
-
* @internal
|
|
368
|
-
*/
|
|
369
|
-
type ChildVisitCallback = (node: ASTNode, childIndex: number, childrenCount: number) => void;
|
|
370
|
-
/**
|
|
371
|
-
* Helper to analyze an AST.
|
|
372
|
-
*/
|
|
373
|
-
interface Walker {
|
|
374
|
-
/** Root of the AST */
|
|
375
|
-
ROOT: ASTNode;
|
|
376
|
-
/** Global query options. */
|
|
377
|
-
queryOptions: ComplexQueryOptions;
|
|
378
|
-
/** All parents of the current node. */
|
|
379
|
-
parents: ASTNode[];
|
|
380
|
-
/** Index of the current node in the parent's children. */
|
|
381
|
-
currentIndex: number;
|
|
382
|
-
/** Current ASTNode. */
|
|
383
|
-
current: ASTNode;
|
|
384
|
-
/** Function to move the walker to the next sibling. */
|
|
385
|
-
toNextSibling(): Walker | undefined;
|
|
386
|
-
/** Function to move the walker to the previous sibling. */
|
|
387
|
-
toPrevSibling(): Walker | undefined;
|
|
388
|
-
/** Function to move the walker to a sibling with an offset relative to the current position. */
|
|
389
|
-
toSibling(offsetFromCurrentPosition: number): Walker | undefined;
|
|
390
|
-
/** Function to pick a sibling at an offset relative to the current position. */
|
|
391
|
-
sibling(offsetFromCurrentPosition: number): ASTNode | undefined;
|
|
392
|
-
/** Function to check if the next sibling exists. */
|
|
393
|
-
hasNextSibling(): boolean;
|
|
394
|
-
/** Function to check if the previous sibling exists. */
|
|
395
|
-
hasPrevSibling(): boolean;
|
|
396
|
-
/** Function to move the walker to the first child. */
|
|
397
|
-
toFirstChild(): Walker | undefined;
|
|
398
|
-
/** Function to move the walker to the last child. */
|
|
399
|
-
toLastChild(): Walker | undefined;
|
|
400
|
-
/** Function to move the walker to the child at a given index. */
|
|
401
|
-
toChild(childIndex: number): Walker | undefined;
|
|
402
|
-
/** Function to pick the child at a given index. */
|
|
403
|
-
child(childIndex: number): ASTNode | undefined;
|
|
404
|
-
/** Function to check if the child at a given index exists. */
|
|
405
|
-
hasChild(childIndex: number): boolean;
|
|
406
|
-
/** Function to check if the current node has children. */
|
|
407
|
-
hasChildren(): boolean;
|
|
408
|
-
/** Function to move the walker to the current parent. */
|
|
409
|
-
toParent(): Walker | undefined;
|
|
410
|
-
/** Function to check if the current node has a parent. */
|
|
411
|
-
hasParent(): boolean;
|
|
412
|
-
/** Function to move the walker to an ancestor with given an offset. e.g. 1=direct parent, 2 = grandparent, ... */
|
|
413
|
-
toAncestor(offset: number): Walker | undefined;
|
|
414
|
-
/** Function to move the walker to the AST root. */
|
|
415
|
-
toROOT(): Walker;
|
|
416
|
-
/** Function to pick the parent of the current node. */
|
|
417
|
-
parent(): ASTNode | undefined;
|
|
418
|
-
/** Function to pick the child nodes of the current node. */
|
|
419
|
-
children(): ASTNode[];
|
|
420
|
-
/** Function to get the number of children of the current node. */
|
|
421
|
-
childrenCount(): number;
|
|
422
|
-
/** Function to check if a given node is the root of the AST.
|
|
423
|
-
* If no parameter is provided, this function will test if the walker is at the root position of the AST. */
|
|
424
|
-
isROOT(node?: ASTNode): boolean;
|
|
425
|
-
/** Function to create a new walker at the current node position. */
|
|
426
|
-
walker(): Walker;
|
|
427
|
-
/** Function to walk over all children. */
|
|
428
|
-
walkChildren(cb: ChildVisitCallback, scope?: any): void;
|
|
429
|
-
/** Function to walk over the AST.
|
|
430
|
-
* The visitor callback is called once for every node.
|
|
431
|
-
* Parents are visited before the children.
|
|
432
|
-
*/
|
|
433
|
-
walkPreOrder(cb: VisitCallback, scope?: any): void;
|
|
434
|
-
/** Function to walk over the AST.
|
|
435
|
-
* The visitor callback is called once for every node.
|
|
436
|
-
* Parents are visited after the children.
|
|
437
|
-
*/
|
|
438
|
-
walkPostOrder(cb: VisitCallback, scope?: any): void;
|
|
439
|
-
/** Function to walk over the AST.
|
|
440
|
-
* The visitor callback is called twice for every node. */
|
|
441
|
-
walk(cb: VisitCallback, scope?: any): void;
|
|
442
|
-
}
|
|
443
|
-
/**
|
|
444
|
-
* Node in the AST.
|
|
445
|
-
*/
|
|
446
|
-
interface ASTNode {
|
|
447
|
-
/** Name of the operator. */
|
|
448
|
-
o: string;
|
|
449
|
-
/** Child nodes of this node. */
|
|
450
|
-
c?: ASTNode[];
|
|
451
|
-
/** Name of the left side attribute of the operator. */
|
|
452
|
-
n?: string;
|
|
453
|
-
/** Value of the right side of the operator. Can be an array of values. */
|
|
454
|
-
v?: any;
|
|
455
|
-
/** Value type (typeof v). Is an array if 'v' is an array, too. */
|
|
456
|
-
vt?: string[] | string;
|
|
457
|
-
/** Indicate, if 'v' is an array. */
|
|
458
|
-
isArray?: boolean;
|
|
459
|
-
}
|
|
460
|
-
/**
|
|
461
|
-
* Options used to modify a query or evaluation.
|
|
462
|
-
*/
|
|
463
|
-
interface ComplexQueryOptions {
|
|
464
|
-
[k: string]: any;
|
|
465
|
-
ignoreCase?: boolean;
|
|
466
|
-
suggestContains?: boolean;
|
|
467
|
-
}
|
|
468
|
-
/**
|
|
469
|
-
* AST representation of a complex query.
|
|
470
|
-
*/
|
|
471
|
-
interface AST {
|
|
472
|
-
/**
|
|
473
|
-
* Query options used to parse the query.
|
|
474
|
-
*/
|
|
475
|
-
queryOptions: ComplexQueryOptions;
|
|
476
|
-
/**
|
|
477
|
-
* Function to provide access to the root node.
|
|
478
|
-
*/
|
|
479
|
-
root(): ASTNode | undefined;
|
|
480
|
-
/**
|
|
481
|
-
* Function to create a walker for easier visiting of nodes in the AST.
|
|
482
|
-
*/
|
|
483
|
-
walker(): Walker;
|
|
484
|
-
/**
|
|
485
|
-
* Function to be called after modification of the AST to reduce
|
|
486
|
-
* useless '$and' or '$or' operators.
|
|
487
|
-
* @returns the optimized AST (not a copy!)
|
|
488
|
-
*/
|
|
489
|
-
optimize(): AST;
|
|
490
|
-
}
|
|
491
|
-
|
|
492
|
-
declare function converter(ops: any): {
|
|
493
|
-
toSolrQL: (query?: ComplexQueryExpression | undefined, options?: store_api_rest_ComplexQueryToSolrQL.ComplexQueryToSolrQLOptions | undefined) => string;
|
|
494
|
-
astToSolrQL: (astOrWalker: Walker | AST) => string;
|
|
495
|
-
};
|
|
496
|
-
declare namespace converter {
|
|
497
|
-
export { toSolrQL };
|
|
498
|
-
export { astToSolrQL };
|
|
499
|
-
export { _operatorMapping };
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
export { converter as default };
|
package/ct/store/RQLStore.d.ts
DELETED
package/ct/store/SQLStore.d.ts
DELETED
package/ct/store/StoreUtil.d.ts
DELETED
package/ct/store/_RestStore.d.ts
DELETED