@carto/api-client 0.5.0-alpha.1 → 0.5.0-alpha.13

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 (127) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/api-client.cjs +3162 -3206
  3. package/build/api-client.cjs.map +1 -1
  4. package/build/api-client.d.cts +1399 -0
  5. package/build/api-client.d.ts +1399 -0
  6. package/build/api-client.js +3673 -0
  7. package/build/api-client.js.map +1 -0
  8. package/build/worker.d.ts +2 -0
  9. package/build/worker.js +1949 -0
  10. package/build/worker.js.map +1 -0
  11. package/package.json +61 -46
  12. package/src/api/carto-api-error.ts +1 -1
  13. package/src/api/query.ts +5 -5
  14. package/src/api/request-with-parameters.ts +6 -6
  15. package/src/client.ts +3 -3
  16. package/src/constants-internal.ts +5 -11
  17. package/src/constants.ts +6 -6
  18. package/src/deck/get-data-filter-extension-props.ts +164 -0
  19. package/src/deck/index.ts +1 -0
  20. package/src/filters/Filter.ts +18 -8
  21. package/src/filters/FilterTypes.ts +2 -2
  22. package/src/filters/geosjonFeatures.ts +2 -2
  23. package/src/filters/tileFeatures.ts +12 -17
  24. package/src/filters.ts +4 -4
  25. package/src/geo.ts +12 -14
  26. package/src/global.d.ts +3 -8
  27. package/src/index.ts +3 -0
  28. package/src/models/common.ts +11 -9
  29. package/src/models/model.ts +3 -4
  30. package/src/operations/aggregation.ts +5 -5
  31. package/src/operations/applySorting.ts +4 -4
  32. package/src/operations/groupBy.ts +4 -4
  33. package/src/operations/groupByDate.ts +1 -1
  34. package/src/operations/histogram.ts +4 -4
  35. package/src/operations/scatterPlot.ts +4 -4
  36. package/src/sources/base-source.ts +8 -8
  37. package/src/sources/boundary-query-source.ts +2 -2
  38. package/src/sources/boundary-table-source.ts +2 -2
  39. package/src/sources/h3-query-source.ts +7 -5
  40. package/src/sources/h3-table-source.ts +7 -5
  41. package/src/sources/h3-tileset-source.ts +4 -4
  42. package/src/sources/index.ts +26 -26
  43. package/src/sources/quadbin-query-source.ts +7 -5
  44. package/src/sources/quadbin-table-source.ts +7 -5
  45. package/src/sources/quadbin-tileset-source.ts +4 -4
  46. package/src/sources/raster-source.ts +2 -2
  47. package/src/sources/types.ts +9 -3
  48. package/src/sources/vector-query-source.ts +2 -3
  49. package/src/sources/vector-table-source.ts +2 -3
  50. package/src/sources/vector-tileset-source.ts +5 -5
  51. package/src/spatial-index.ts +12 -10
  52. package/src/types-internal.ts +5 -5
  53. package/src/types.ts +15 -15
  54. package/src/utils/makeIntervalComplete.ts +1 -1
  55. package/src/utils.ts +3 -3
  56. package/src/widget-sources/index.ts +1 -0
  57. package/src/widget-sources/types.ts +6 -4
  58. package/src/widget-sources/widget-query-source.ts +6 -2
  59. package/src/widget-sources/widget-remote-source.ts +67 -26
  60. package/src/widget-sources/widget-source.ts +10 -25
  61. package/src/widget-sources/widget-table-source.ts +6 -2
  62. package/src/widget-sources/widget-tileset-source-impl.ts +417 -0
  63. package/src/widget-sources/widget-tileset-source.ts +199 -299
  64. package/src/workers/constants.ts +13 -0
  65. package/src/workers/types.ts +19 -0
  66. package/src/workers/widget-tileset-worker.ts +40 -0
  67. package/build/api/carto-api-error.d.ts +0 -26
  68. package/build/api/endpoints.d.ts +0 -24
  69. package/build/api/index.d.ts +0 -5
  70. package/build/api/query.d.ts +0 -3
  71. package/build/api/request-with-parameters.d.ts +0 -10
  72. package/build/api-client.modern.js +0 -3574
  73. package/build/api-client.modern.js.map +0 -1
  74. package/build/client.d.ts +0 -14
  75. package/build/constants-internal.d.ts +0 -26
  76. package/build/constants.d.ts +0 -53
  77. package/build/filters/Filter.d.ts +0 -13
  78. package/build/filters/FilterTypes.d.ts +0 -3
  79. package/build/filters/geosjonFeatures.d.ts +0 -8
  80. package/build/filters/index.d.ts +0 -6
  81. package/build/filters/tileFeatures.d.ts +0 -20
  82. package/build/filters/tileFeaturesGeometries.d.ts +0 -13
  83. package/build/filters/tileFeaturesSpatialIndex.d.ts +0 -10
  84. package/build/filters.d.ts +0 -39
  85. package/build/geo.d.ts +0 -19
  86. package/build/index.d.ts +0 -14
  87. package/build/models/common.d.ts +0 -27
  88. package/build/models/index.d.ts +0 -3
  89. package/build/models/model.d.ts +0 -37
  90. package/build/operations/aggregation.d.ts +0 -8
  91. package/build/operations/applySorting.d.ts +0 -20
  92. package/build/operations/groupBy.d.ts +0 -15
  93. package/build/operations/groupByDate.d.ts +0 -11
  94. package/build/operations/histogram.d.ts +0 -13
  95. package/build/operations/index.d.ts +0 -6
  96. package/build/operations/scatterPlot.d.ts +0 -14
  97. package/build/sources/base-source.d.ts +0 -4
  98. package/build/sources/boundary-query-source.d.ts +0 -10
  99. package/build/sources/boundary-table-source.d.ts +0 -8
  100. package/build/sources/h3-query-source.d.ts +0 -5
  101. package/build/sources/h3-table-source.d.ts +0 -5
  102. package/build/sources/h3-tileset-source.d.ts +0 -5
  103. package/build/sources/index.d.ts +0 -26
  104. package/build/sources/quadbin-query-source.d.ts +0 -5
  105. package/build/sources/quadbin-table-source.d.ts +0 -5
  106. package/build/sources/quadbin-tileset-source.d.ts +0 -5
  107. package/build/sources/raster-source.d.ts +0 -4
  108. package/build/sources/types.d.ts +0 -366
  109. package/build/sources/vector-query-source.d.ts +0 -5
  110. package/build/sources/vector-table-source.d.ts +0 -5
  111. package/build/sources/vector-tileset-source.d.ts +0 -5
  112. package/build/spatial-index.d.ts +0 -8
  113. package/build/types-internal.d.ts +0 -56
  114. package/build/types.d.ts +0 -140
  115. package/build/utils/dateUtils.d.ts +0 -10
  116. package/build/utils/getTileFormat.d.ts +0 -3
  117. package/build/utils/makeIntervalComplete.d.ts +0 -2
  118. package/build/utils/transformTileCoordsToWGS84.d.ts +0 -8
  119. package/build/utils/transformToTileCoords.d.ts +0 -9
  120. package/build/utils.d.ts +0 -32
  121. package/build/widget-sources/index.d.ts +0 -5
  122. package/build/widget-sources/types.d.ts +0 -158
  123. package/build/widget-sources/widget-query-source.d.ts +0 -33
  124. package/build/widget-sources/widget-remote-source.d.ts +0 -18
  125. package/build/widget-sources/widget-source.d.ts +0 -74
  126. package/build/widget-sources/widget-table-source.d.ts +0 -33
  127. package/build/widget-sources/widget-tileset-source.d.ts +0 -76
@@ -0,0 +1,1399 @@
1
+ import { Polygon, MultiPolygon, Feature, BBox, FeatureCollection, Geometry } from 'geojson';
2
+ import { BinaryFeatureCollection, BinaryFeature } from '@loaders.gl/schema';
3
+
4
+ /**
5
+ * Returns current client ID, used to categorize API requests. For internal use only.
6
+ *
7
+ * @internal
8
+ * @privateRemarks Source: @carto/react-core
9
+ */
10
+ declare function getClient(): string;
11
+ /**
12
+ * Sets current client ID, used to categorize API requests. For internal use only.
13
+ *
14
+ * @internal
15
+ * @privateRemarks Source: @carto/react-core
16
+ */
17
+ declare function setClient(c: string): void;
18
+
19
+ /**
20
+ * Defines a comparator used when matching a column's values against given filter values.
21
+ *
22
+ * Example:
23
+ *
24
+ * ```javascript
25
+ * import { FilterType } from '@carto/api-client';
26
+ * const filters = {
27
+ * column_name: { [FilterType.IN]: { values: ['a', 'b', 'c'] } }
28
+ * };
29
+ * ```
30
+ *
31
+ * @privateRemarks Source: @carto/react-api, @deck.gl/carto
32
+ */
33
+ declare enum FilterType {
34
+ IN = "in",
35
+ /** [a, b] both are included. */
36
+ BETWEEN = "between",
37
+ /** [a, b) a is included, b is not. */
38
+ CLOSED_OPEN = "closed_open",
39
+ TIME = "time",
40
+ STRING_SEARCH = "stringSearch"
41
+ }
42
+ /** @privateRemarks Source: @carto/constants */
43
+ declare enum ApiVersion {
44
+ V1 = "v1",
45
+ V2 = "v2",
46
+ V3 = "v3"
47
+ }
48
+ /** @privateRemarks Source: @carto/constants, @deck.gl/carto */
49
+ declare const DEFAULT_API_BASE_URL = "https://gcp-us-east1.api.carto.com";
50
+ /** @privateRemarks Source: @carto/react-core */
51
+ declare enum TileFormat {
52
+ MVT = "mvt",
53
+ JSON = "json",
54
+ GEOJSON = "geojson",
55
+ BINARY = "binary"
56
+ }
57
+ /** @privateRemarks Source: @carto/react-core */
58
+ declare enum SpatialIndex {
59
+ H3 = "h3",
60
+ S2 = "s2",
61
+ QUADBIN = "quadbin"
62
+ }
63
+ /** @privateRemarks Source: @carto/react-core */
64
+ declare enum Provider {
65
+ BIGQUERY = "bigquery",
66
+ REDSHIFT = "redshift",
67
+ POSTGRES = "postgres",
68
+ SNOWFLAKE = "snowflake",
69
+ DATABRICKS = "databricks",
70
+ DATABRICKS_REST = "databricksRest"
71
+ }
72
+
73
+ /******************************************************************************
74
+ * MAPS AND TILES
75
+ */
76
+ /** @privateRemarks Source: @deck.gl/carto */
77
+ type Format = 'json' | 'geojson' | 'tilejson';
78
+ /** @privateRemarks Source: @carto/constants, @deck.gl/carto */
79
+ type MapType = 'boundary' | 'query' | 'table' | 'tileset' | 'raster';
80
+ /**
81
+ * Alias for GeoJSON 'BBox' type, semantically representing a viewport.
82
+ * Order of values is "west", "south", "east", "north".
83
+ */
84
+ type Viewport = [number, number, number, number];
85
+ /**
86
+ * Subset of deck.gl's Tile2DHeader type, containing only the properties
87
+ * required for local widget calculations. Deeper dependencies on deck.gl
88
+ * APIs should be minimized within this library: @deck.gl/carto depends
89
+ * on the API client, not the other way around.
90
+ * @privateRemarks Source: @deck.gl/geo-layers
91
+ */
92
+ type Tile = {
93
+ index: {
94
+ x: number;
95
+ y: number;
96
+ z: number;
97
+ };
98
+ id: string;
99
+ content: unknown;
100
+ zoom: number;
101
+ bbox: {
102
+ west: number;
103
+ east: number;
104
+ north: number;
105
+ south: number;
106
+ };
107
+ isVisible: boolean;
108
+ data?: BinaryFeatureCollection;
109
+ };
110
+ /** Subset of deck.gl's Tile2DHeader type, for spatial indexes. */
111
+ type SpatialIndexTile = Tile & {
112
+ data?: (Feature & {
113
+ id: bigint;
114
+ })[];
115
+ };
116
+ /** @privateRemarks Source: @deck.gl/carto */
117
+ type Raster = {
118
+ blockSize: number;
119
+ cells: {
120
+ numericProps: BinaryFeature['numericProps'];
121
+ properties: BinaryFeature['properties'];
122
+ };
123
+ };
124
+ /******************************************************************************
125
+ * AGGREGATION
126
+ */
127
+ /**
128
+ * Enum for the different types of aggregations available for widgets.
129
+ *
130
+ * @privateRemarks Source: @carto/constants
131
+ * @privateRemarks Converted from enum to type union, for improved declarative API.
132
+ */
133
+ type AggregationType = 'count' | 'avg' | 'min' | 'max' | 'sum' | 'custom';
134
+ /******************************************************************************
135
+ * FILTERS
136
+ */
137
+ /** @privateRemarks Source: @carto/react-api */
138
+ type SpatialFilter = Polygon | MultiPolygon;
139
+ /** @privateRemarks Source: @deck.gl/carto */
140
+ interface Filters {
141
+ [column: string]: Filter;
142
+ }
143
+ /** @privateRemarks Source: @carto/react-api, @deck.gl/carto */
144
+ interface Filter {
145
+ [FilterType.IN]?: {
146
+ owner?: string;
147
+ values: number[] | string[];
148
+ };
149
+ /** [a, b] both are included. */
150
+ [FilterType.BETWEEN]?: {
151
+ owner?: string;
152
+ values: number[][];
153
+ };
154
+ /** [a, b) a is included, b is not. */
155
+ [FilterType.CLOSED_OPEN]?: {
156
+ owner?: string;
157
+ values: number[][];
158
+ };
159
+ [FilterType.TIME]?: {
160
+ owner?: string;
161
+ values: number[][];
162
+ };
163
+ [FilterType.STRING_SEARCH]?: {
164
+ owner?: string;
165
+ values: string[];
166
+ params?: StringSearchOptions;
167
+ };
168
+ }
169
+ /** @privateRemarks Source: @carto/react-core */
170
+ type FilterLogicalOperator = 'and' | 'or';
171
+ /**
172
+ * Type for minimum or maximum value of an interval. Values 'null' and
173
+ * 'undefined' are intentionally allowed, and represent an unbounded value.
174
+ */
175
+ type FilterIntervalExtremum = number | null | undefined;
176
+ type FilterInterval = [FilterIntervalExtremum, FilterIntervalExtremum];
177
+ type FilterIntervalComplete = [number, number];
178
+ type StringSearchOptions = {
179
+ useRegExp?: boolean;
180
+ mustStart?: boolean;
181
+ mustEnd?: boolean;
182
+ caseSensitive?: boolean;
183
+ keepSpecialCharacters?: boolean;
184
+ };
185
+ /******************************************************************************
186
+ * GROUPING
187
+ */
188
+ /**
189
+ * Defines a step size increment for use with {@link TimeSeriesRequestOptions}.
190
+ *
191
+ * @privateRemarks Source: @carto/react-core
192
+ */
193
+ type GroupDateType = 'year' | 'month' | 'week' | 'day' | 'hour' | 'minute' | 'second';
194
+ /******************************************************************************
195
+ * SORTING
196
+ */
197
+ type SortDirection = 'asc' | 'desc';
198
+ type SortColumnType = 'number' | 'string' | 'date';
199
+ /******************************************************************************
200
+ * SQL QUERY PARAMETERS
201
+ */
202
+ /** @privateRemarks Source: @deck.gl/carto */
203
+ type QueryParameterValue = string | number | boolean | Array<QueryParameterValue> | object;
204
+ /** @privateRemarks Source: @deck.gl/carto */
205
+ type NamedQueryParameter = Record<string, QueryParameterValue>;
206
+ /** @privateRemarks Source: @deck.gl/carto */
207
+ type PositionalQueryParameter = QueryParameterValue[];
208
+ /** @privateRemarks Source: @deck.gl/carto */
209
+ type QueryParameters = NamedQueryParameter | PositionalQueryParameter;
210
+
211
+ /******************************************************************************
212
+ * COMMON
213
+ */
214
+
215
+ /******************************************************************************
216
+ * LOCAL CALCULATIONS
217
+ */
218
+ type FeatureData = Record<string, unknown>;
219
+
220
+ /** @experimental Prefer type definition from deck.gl. */
221
+ type _DataFilterExtensionProps = {
222
+ filterRange: number[][];
223
+ updateTriggers: Record<string, string>;
224
+ getFilterValue: (feature: Feature | FeatureData) => number[];
225
+ };
226
+ /**
227
+ * Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
228
+ * a set of filters. Requires that DataFilterExtension is initialized with
229
+ * filterSize=4, where the CARTO filters will occupy the first two slots.
230
+ *
231
+ * @example To create a deck.gl layer with GPU data filtering:
232
+ * ```typescript
233
+ * import {DataFilterExtension} from '@deck.gl/extensions';
234
+ * import {VectorTileLayer} from '@deck.gl/layers';
235
+ * import {getDataFilterExtensionProps} from '@carto/api-client';
236
+ *
237
+ * const layer = new VectorTileLayer({
238
+ * data: data,
239
+ * extensions: [new DataFilterExtension({filterSize: 4})],
240
+ * ...getDataFilterExtensionProps(filters),
241
+ * });
242
+ * ```
243
+ */
244
+ declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
245
+
246
+ type FilterTypeOptions<T extends FilterType> = {
247
+ type: T;
248
+ column: string;
249
+ } & Filter[T];
250
+ type AddFilterOptions = FilterTypeOptions<FilterType.IN> | FilterTypeOptions<FilterType.BETWEEN> | FilterTypeOptions<FilterType.CLOSED_OPEN> | FilterTypeOptions<FilterType.TIME> | FilterTypeOptions<FilterType.STRING_SEARCH>;
251
+ /**
252
+ * Adds a {@link Filter} to the filter set. Any previous filters with the same
253
+ * `column` and `type` will be replaced.
254
+ */
255
+ declare function addFilter(filters: Record<string, Filter>, { column, type, values, owner }: AddFilterOptions): Record<string, Filter>;
256
+ type RemoveFilterOptions = {
257
+ column: string;
258
+ owner?: string;
259
+ };
260
+ /**
261
+ * Removes one or more {@link Filter filters} from the filter set. If only
262
+ * `column` is specified, then all filters on that column are removed. If both
263
+ * `column` and `owner` are specified, then only filters for that column
264
+ * associated with the owner are removed.
265
+ */
266
+ declare function removeFilter(filters: Record<string, Filter>, { column, owner }: RemoveFilterOptions): Record<string, Filter>;
267
+ /**
268
+ * Clears all {@link Filter filters} from the filter set.
269
+ */
270
+ declare function clearFilters(filters: Record<string, Filter>): Record<string, Filter>;
271
+ type HasFilterOptions = {
272
+ column: string;
273
+ owner?: string;
274
+ };
275
+ declare function hasFilter(filters: Record<string, Filter>, { column, owner }: HasFilterOptions): boolean;
276
+ type GetFilterOptions<T extends FilterType> = {
277
+ column: string;
278
+ type: T;
279
+ owner?: string;
280
+ };
281
+ declare function getFilter<T extends FilterType>(filters: Record<string, Filter>, { column, type, owner }: GetFilterOptions<T>): Filter[T] | null;
282
+
283
+ /**
284
+ * Returns a {@link SpatialFilter} for a given viewport, typically obtained
285
+ * from deck.gl's `viewport.getBounds()` method ([west, south, east, north]).
286
+ * If the viewport covers the entire world (to some margin of error in Web
287
+ * Mercator space), `undefined` is returned instead.
288
+ *
289
+ * If the viewport extends beyond longitude range [-180, +180], the polygon
290
+ * may be reformatted for compatibility with CARTO APIs.
291
+ */
292
+ declare function createViewportSpatialFilter(viewport: BBox): SpatialFilter | undefined;
293
+ /**
294
+ * Returns a {@link SpatialFilter} for a given {@link Polygon} or
295
+ * {@link MultiPolygon}. If the polygon(s) extend outside longitude
296
+ * range [-180, +180], the result may be reformatted for compatibility
297
+ * with CARTO APIs.
298
+ */
299
+ declare function createPolygonSpatialFilter(spatialFilter: Polygon | MultiPolygon): SpatialFilter | undefined;
300
+
301
+ type SourceRequiredOptions = {
302
+ /** Carto platform access token. */
303
+ accessToken: string;
304
+ /** Data warehouse connection name in Carto platform. */
305
+ connectionName: string;
306
+ };
307
+ type SourceOptionalOptions = {
308
+ /**
309
+ * Base URL of the CARTO Maps API.
310
+ *
311
+ * Example for account located in EU-west region: `https://gcp-eu-west1.api.carto.com`
312
+ *
313
+ * @default https://gcp-us-east1.api.carto.com
314
+ */
315
+ apiBaseUrl: string;
316
+ /**
317
+ * Custom HTTP headers added to map instantiation and data requests.
318
+ */
319
+ headers: Record<string, string>;
320
+ /**
321
+ * Cache buster value returned by map instantiation.
322
+ *
323
+ * Carto source saves `cache` value of map instantiation response in `cache.value`, so it can be used to
324
+ * check if underlying map data has changed between distinct source requests.
325
+ */
326
+ cache?: {
327
+ value?: number;
328
+ };
329
+ clientId: string;
330
+ /** @deprecated use `query` instead **/
331
+ format: Format;
332
+ /**
333
+ * Maximum URL character length. Above this limit, requests use POST.
334
+ * Used to avoid browser and CDN limits.
335
+ * @default {@link DEFAULT_MAX_LENGTH_URL}
336
+ */
337
+ maxLengthURL?: number;
338
+ /**
339
+ * The column name and the type of geospatial support.
340
+ *
341
+ * If not present, defaults to `'geom'` for generic queries, `'quadbin'` for Quadbin sources and `'h3'` for H3 sources.
342
+ */
343
+ spatialDataColumn?: string;
344
+ /**
345
+ * The type of geospatial support. Defaults to `'geo'`.
346
+ */
347
+ spatialDataType?: SpatialDataType;
348
+ /**
349
+ * Relative resolution of a tile. Higher values increase density and data size. At `tileResolution = 1`, tile geometry is
350
+ * quantized to a 1024x1024 grid. Increasing or decreasing the resolution will increase or decrease the dimensions of
351
+ * the quantization grid proportionately.
352
+ *
353
+ * Supported `tileResolution` values, with corresponding grid sizes:
354
+ *
355
+ * - 0.25: 256x256
356
+ * - 0.5: 512x512
357
+ * - 1: 1024x1024
358
+ * - 2: 2048x2048
359
+ * - 4: 4096x4096
360
+ */
361
+ tileResolution?: TileResolution;
362
+ /**
363
+ * By default, local in-memory caching is enabled.
364
+ */
365
+ localCache?: LocalCacheOptions;
366
+ };
367
+ type LocalCacheOptions = {
368
+ /**
369
+ * Map that stores requests and their responses.
370
+ */
371
+ cache?: Map<string, Promise<unknown>>;
372
+ /**
373
+ * Cache control
374
+ * * `no-cache`: If present, the source will always fetch from original source.
375
+ * * `no-store`: If present, source will not store result in cache (for later reuse).
376
+ *
377
+ * See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Cache-Control#directives
378
+ */
379
+ cacheControl?: ('no-cache' | 'no-store')[];
380
+ };
381
+ type SourceOptions = SourceRequiredOptions & Partial<SourceOptionalOptions>;
382
+ type AggregationOptions = {
383
+ /**
384
+ * Defines the aggregation expressions that will be calculated from the resulting columns on each grid cell.
385
+ *
386
+ * Example:
387
+ *
388
+ * sum(pop) as total_population, avg(rev) as average_revenue
389
+ */
390
+ aggregationExp: string;
391
+ /**
392
+ * Defines the tile aggregation resolution.
393
+ *
394
+ * @default 6 for quadbin and 4 for h3 sources
395
+ */
396
+ aggregationResLevel?: number;
397
+ /**
398
+ * Original resolution of the spatial index data as stored in the DW
399
+ */
400
+ dataResolution?: number;
401
+ };
402
+ type FilterOptions = {
403
+ /**
404
+ * Filters to apply to the data source on the server
405
+ */
406
+ filters?: Filters;
407
+ };
408
+ type QuerySourceOptions = {
409
+ /** Full SQL query with query paremeter placeholders (if any). */
410
+ sqlQuery: string;
411
+ /**
412
+ * Values for named or positional paramteres in the query.
413
+ *
414
+ * The way query parameters are determined by data warehouse.
415
+ *
416
+ * * BigQuery has named query parameters, specified with a dictionary, and referenced by key (`@key`)
417
+ *
418
+ * ```
419
+ * sqlQuery: "SELECT * FROM carto-demo-data.demo_tables.retail_stores WHERE storetype = ⁣@type AND revenue > ⁣@minRevenue"
420
+ * queryParameters: { type: 'Supermarket', minRevenue: 1000000 }
421
+ * ```
422
+ * * Snowflake supports positional parameters, in the form `:1`, `:2`, etc.
423
+ *
424
+ * ```
425
+ * sqlQuery: "SELECT * FROM demo_db.public.import_retail_stores WHERE storetype = :2 AND revenue > :1
426
+ * queryParameters: [100000, "Supermarket"]
427
+ * ```
428
+ * * Postgres and Redhisft supports positional parameters, but in the form `$1`, `$2`, etc.
429
+ *
430
+ * ```
431
+ * sqlQuery: "SELECT * FROM carto_demo_data.demo_tables.retail_stores WHERE storetype = $2 AND revenue > $1
432
+ * queryParameters: [100000, "Supermarket"]
433
+ * ```
434
+ */
435
+ queryParameters?: QueryParameters;
436
+ /**
437
+ * Comma-separated aggregation expressions. If assigned on a vector source, source is grouped by geometry and then aggregated.
438
+ *
439
+ * Example:
440
+ *
441
+ * 1 as value, avg(rev) as average_revenue
442
+ */
443
+ aggregationExp?: string;
444
+ };
445
+ type TableSourceOptions = {
446
+ /**
447
+ * Fully qualified name of table.
448
+ */
449
+ tableName: string;
450
+ /**
451
+ * Comma-separated aggregation expressions. If assigned on a vector source, source is grouped by geometry and then aggregated.
452
+ *
453
+ * Example:
454
+ *
455
+ * 1 as value, avg(rev) as average_revenue
456
+ */
457
+ aggregationExp?: string;
458
+ };
459
+ type TilesetSourceOptions = {
460
+ /**
461
+ * Fully qualified name of tileset.
462
+ */
463
+ tableName: string;
464
+ /**
465
+ * Whether to use Web Workers for local widget calculations. Workers
466
+ * are used by default if the runtime environment supports ES Module Workers.
467
+ */
468
+ widgetWorker?: boolean;
469
+ };
470
+ type ColumnsOption = {
471
+ /**
472
+ * Columns to retrieve from the table.
473
+ *
474
+ * If not present, all columns are returned.
475
+ */
476
+ columns?: string[];
477
+ };
478
+ type SpatialDataType = 'geo' | 'h3' | 'quadbin';
479
+ /**
480
+ * Strategy used for covering spatial filter geometry with spatial indexes.
481
+ * See https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/sql-reference/quadbin#quadbin_polyfill_mode
482
+ * or https://docs.carto.com/data-and-analysis/analytics-toolbox-for-bigquery/sql-reference/h3#h3_polyfill_mode for more information.
483
+ * @privateRemarks Source: cloud-native maps-api
484
+ * */
485
+ type SpatialFilterPolyfillMode = 'center' | 'intersects' | 'contains';
486
+ type TileResolution = 0.25 | 0.5 | 1 | 2 | 4;
487
+ interface Tilejson {
488
+ tilejson: string;
489
+ name: string;
490
+ description: string;
491
+ version: string;
492
+ attribution: string;
493
+ scheme: string;
494
+ tiles: string[];
495
+ minzoom: number;
496
+ maxzoom: number;
497
+ bounds: [left: number, bottom: number, right: number, top: number];
498
+ center: [longitute: number, latitude: number, zoom: number];
499
+ vector_layers: VectorLayer[];
500
+ minresolution: number;
501
+ maxresolution: number;
502
+ properties_tiles: string[];
503
+ tilestats: Tilestats;
504
+ tileResolution?: TileResolution;
505
+ /**
506
+ * Resolution of data in spatial-index dataset (e.g. H3, Quadbin).
507
+ *
508
+ * @internal
509
+ */
510
+ dataresolution?: number;
511
+ /**
512
+ * Array of ratios of dropped features per zoom level.
513
+ *
514
+ * Example: `[0,0,0.5]` - means that 50% of features are dropped at zoom 2 and bigger.
515
+ *
516
+ * @internal
517
+ */
518
+ fraction_dropped_per_zoom?: number[];
519
+ /**
520
+ * Names of bands - rasters only.
521
+ *
522
+ * @internal
523
+ */
524
+ raster_bands?: string[];
525
+ /**
526
+ * Raster metadata - rasters only.
527
+ *
528
+ * @internal
529
+ */
530
+ raster_metadata?: RasterMetadata;
531
+ }
532
+ interface Tilestats {
533
+ layerCount: number;
534
+ layers: Layer[];
535
+ }
536
+ interface Layer {
537
+ layer: string;
538
+ count: number;
539
+ attributeCount: number;
540
+ attributes: Attribute[];
541
+ }
542
+ interface Attribute {
543
+ attribute: string;
544
+ type: string;
545
+ }
546
+ interface VectorLayer {
547
+ id: string;
548
+ minzoom: number;
549
+ maxzoom: number;
550
+ fields: Record<string, string>;
551
+ geometry_type?: string;
552
+ }
553
+ type RasterMetadataBandStats = {
554
+ approximated_stats?: boolean;
555
+ min: number;
556
+ max: number;
557
+ mean: number;
558
+ stddev: number;
559
+ sum: number;
560
+ sum_squares: number;
561
+ count: number;
562
+ /**
563
+ * Quantiles by number of buckets.
564
+ *
565
+ * Example:
566
+ * ```ts
567
+ * {
568
+ * // for 3 buckets, first 1/3 of items lies in range [min, 20], second 1/3 is in [20, 40], and last 1/3 is in [40, max]
569
+ * 3: [20, 40],
570
+ * 4: [20, 30, 50], for 4 buckets ...
571
+ * }
572
+ * ```
573
+ */
574
+ quantiles?: Record<number, number[]>;
575
+ /**
576
+ * Top values by number of values.
577
+ *
578
+ * Key of dictionary is value, value is count.
579
+ * Key order is random.
580
+ *
581
+ * Example:
582
+ * ```
583
+ * {
584
+ * 3: 5, // means there are 5 pixels with value 3
585
+ * 11: 222,
586
+ * 12: 333, // means that 12 is most common value with count 333
587
+ * ... // (assuming 333 was largest value in dict)
588
+ * }
589
+ * ```
590
+ */
591
+ top_values?: Record<number, number>;
592
+ /**
593
+ * Raster loader version.
594
+ */
595
+ version?: string;
596
+ };
597
+ declare enum RasterBandColorinterp {
598
+ Gray = "gray",
599
+ Red = "red",
600
+ Green = "green",
601
+ Blue = "blue",
602
+ Alpha = "alpha",
603
+ Palette = "palette"
604
+ }
605
+ type RasterMetadataBand = {
606
+ type: string;
607
+ name: string;
608
+ stats: RasterMetadataBandStats;
609
+ /**
610
+ * Known values:
611
+ * * `palette`: use unique value and `colortable` ad default mapping
612
+ * * `red`, `green`, `blue`: use the band as color channel
613
+ * * `gray`: use the band as grayscale
614
+ */
615
+ colorinterp?: string | RasterBandColorinterp;
616
+ /**
617
+ * Default color mapping for unique values (or if coloprinterp is `palette`)
618
+ */
619
+ colortable?: Record<string, number[]>;
620
+ /**
621
+ * No value representation.
622
+ * Observed values:
623
+ * * `'nan'` for `NaN`
624
+ * * `number`: both as string as number, so parsing is needed
625
+ */
626
+ nodata: string | number;
627
+ };
628
+ type RasterMetadata = {
629
+ block_resolution: number;
630
+ minresolution: number;
631
+ maxresolution: number;
632
+ nodata: number | string;
633
+ bands: RasterMetadataBand[];
634
+ bounds: [left: number, bottom: number, right: number, top: number];
635
+ center: [longitute: number, latitude: number, zoom: number];
636
+ width: number;
637
+ height: number;
638
+ block_width: number;
639
+ block_height: number;
640
+ num_blocks: number;
641
+ num_pixels: number;
642
+ pixel_resolution: number;
643
+ };
644
+ type TilejsonResult = Tilejson & {
645
+ accessToken: string;
646
+ };
647
+ type GeojsonResult = {
648
+ type: 'FeatureCollection';
649
+ features: Feature[];
650
+ };
651
+ type JsonResult = any[];
652
+ type QueryResult = {
653
+ meta: {
654
+ cacheHit: boolean;
655
+ location: string;
656
+ totalBytesProcessed: string;
657
+ };
658
+ rows: Record<string, any>[];
659
+ schema: {
660
+ name: string;
661
+ type: string;
662
+ }[];
663
+ };
664
+
665
+ declare const SOURCE_DEFAULTS: SourceOptionalOptions;
666
+
667
+ type BoundaryQuerySourceOptions = SourceOptions & FilterOptions & {
668
+ columns?: string[];
669
+ tilesetTableName: string;
670
+ propertiesSqlQuery: string;
671
+ queryParameters?: QueryParameters;
672
+ };
673
+ type BoundaryQuerySourceResponse = TilejsonResult;
674
+ declare const boundaryQuerySource: (options: BoundaryQuerySourceOptions) => Promise<BoundaryQuerySourceResponse>;
675
+
676
+ type BoundaryTableSourceOptions = SourceOptions & FilterOptions & {
677
+ tilesetTableName: string;
678
+ columns?: string[];
679
+ propertiesTableName: string;
680
+ };
681
+ type BoundaryTableSourceResponse = TilejsonResult;
682
+ declare const boundaryTableSource: (options: BoundaryTableSourceOptions) => Promise<BoundaryTableSourceResponse>;
683
+
684
+ /******************************************************************************
685
+ * WIDGET API REQUESTS
686
+ */
687
+ interface ViewState {
688
+ zoom: number;
689
+ latitude: number;
690
+ longitude: number;
691
+ }
692
+ /** Common options for {@link WidgetRemoteSource} requests. */
693
+ interface BaseRequestOptions {
694
+ signal?: AbortSignal;
695
+ spatialFilter?: SpatialFilter;
696
+ spatialFiltersMode?: SpatialFilterPolyfillMode;
697
+ /** Required for table- and query-based spatial index sources (H3, Quadbin). */
698
+ spatialIndexReferenceViewState?: ViewState;
699
+ /** Overrides source filters, if any. */
700
+ filters?: Filters;
701
+ filterOwner?: string;
702
+ }
703
+ /** Options for {@link WidgetRemoteSource#getCategories}. */
704
+ interface CategoryRequestOptions extends BaseRequestOptions {
705
+ column: string;
706
+ operation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
707
+ operationColumn?: string;
708
+ /** Local only. */
709
+ joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
710
+ }
711
+ /**
712
+ * Options for {@link WidgetRemoteSource#getFeatures}.
713
+ * @experimental
714
+ * @internal
715
+ */
716
+ interface FeaturesRequestOptions extends BaseRequestOptions {
717
+ /**
718
+ * Feature IDs, as found in `_carto_feature_id`. Feature IDs are a hash
719
+ * of geometry, and features with identical geometry will have the same
720
+ * feature ID. Order is important; features in the result set will be
721
+ * sorted according to the order of IDs in the request.
722
+ */
723
+ featureIds: string[];
724
+ /**
725
+ * Columns to be returned for each picked object. Note that for datasets
726
+ * containing features with identical geometry, more than one result per
727
+ * requested feature ID may be returned. To match results back to the
728
+ * requested feature ID, include `_carto_feature_id` in the columns list.
729
+ */
730
+ columns: string[];
731
+ /** Topology of objects to be picked. */
732
+ dataType: 'points' | 'lines' | 'polygons';
733
+ /** Zoom level, required if using 'points' data type. */
734
+ z?: number;
735
+ /**
736
+ * Maximum number of objects to return in the result set. For datasets
737
+ * containing features with identical geometry, those features will have
738
+ * the same feature IDs, and so more results may be returned than feature IDs
739
+ * given in the request.
740
+ */
741
+ limit?: number;
742
+ /**
743
+ * Must match `tileResolution` used when obtaining the `_carto_feature_id`
744
+ * column, typically in a layer's tile requests.
745
+ */
746
+ tileResolution?: TileResolution;
747
+ }
748
+ /** Options for {@link WidgetRemoteSource#getFormula}. */
749
+ interface FormulaRequestOptions extends BaseRequestOptions {
750
+ column: string;
751
+ operation?: 'count' | 'avg' | 'min' | 'max' | 'sum' | 'custom';
752
+ operationExp?: string;
753
+ joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
754
+ }
755
+ /** Options for {@link WidgetRemoteSource#getHistogram}. */
756
+ interface HistogramRequestOptions extends BaseRequestOptions {
757
+ column: string;
758
+ ticks: number[];
759
+ operation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
760
+ /** Local only. */
761
+ joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
762
+ }
763
+ /** Options for {@link WidgetRemoteSource#getRange}. */
764
+ interface RangeRequestOptions extends BaseRequestOptions {
765
+ column: string;
766
+ }
767
+ /** Options for {@link WidgetRemoteSource#getScatter}. */
768
+ interface ScatterRequestOptions extends BaseRequestOptions {
769
+ xAxisColumn: string;
770
+ xAxisJoinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
771
+ yAxisColumn: string;
772
+ yAxisJoinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
773
+ }
774
+ /** Options for {@link WidgetRemoteSource#getTable}. */
775
+ interface TableRequestOptions extends BaseRequestOptions {
776
+ columns: string[];
777
+ sortBy?: string;
778
+ sortDirection?: SortDirection;
779
+ sortByColumnType?: SortColumnType;
780
+ offset?: number;
781
+ limit?: number;
782
+ /** Local only. */
783
+ searchFilterColumn?: string;
784
+ /** Local only. */
785
+ searchFilterText?: string;
786
+ }
787
+ /** Options for {@link WidgetRemoteSource#getTimeSeries}. */
788
+ interface TimeSeriesRequestOptions extends BaseRequestOptions {
789
+ column: string;
790
+ stepSize: GroupDateType;
791
+ stepMultiplier?: number;
792
+ operation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
793
+ operationColumn?: string;
794
+ joinOperation?: 'count' | 'avg' | 'min' | 'max' | 'sum';
795
+ splitByCategory?: string;
796
+ splitByCategoryLimit?: number;
797
+ splitByCategoryValues?: string[];
798
+ }
799
+ /******************************************************************************
800
+ * WIDGET API RESPONSES
801
+ */
802
+ /**
803
+ * Response from {@link WidgetRemoteSource#getFeatures}.
804
+ * @experimental
805
+ * @internal
806
+ */
807
+ type FeaturesResponse = {
808
+ rows: Record<string, unknown>[];
809
+ };
810
+ /** Response from {@link WidgetRemoteSource#getFormula}. */
811
+ type FormulaResponse = {
812
+ value: number | null;
813
+ };
814
+ /** Response from {@link WidgetRemoteSource#getCategories}. */
815
+ type CategoryResponse = {
816
+ name: string;
817
+ value: number;
818
+ }[];
819
+ /** Response from {@link WidgetRemoteSource#getRange}. */
820
+ type RangeResponse = {
821
+ min: number;
822
+ max: number;
823
+ } | null;
824
+ /** Response from {@link WidgetRemoteSource#getTable}. */
825
+ type TableResponse = {
826
+ totalCount: number;
827
+ rows: Record<string, number | string>[];
828
+ };
829
+ /** Response from {@link WidgetRemoteSource#getScatter}. */
830
+ type ScatterResponse = [number, number][];
831
+ /** Response from {@link WidgetRemoteSource#getTimeSeries}. */
832
+ type TimeSeriesResponse = {
833
+ rows: {
834
+ name: string;
835
+ value: number;
836
+ }[];
837
+ categories?: string[];
838
+ };
839
+ /** Response from {@link WidgetRemoteSource#getHistogram}. */
840
+ type HistogramResponse = number[];
841
+
842
+ interface ModelSource {
843
+ type: MapType;
844
+ apiVersion: ApiVersion;
845
+ apiBaseUrl: string;
846
+ accessToken: string;
847
+ clientId: string;
848
+ connectionName: string;
849
+ data: string;
850
+ filters?: Record<string, Filter>;
851
+ filtersLogicalOperator?: FilterLogicalOperator;
852
+ spatialFilter?: SpatialFilter;
853
+ queryParameters?: QueryParameters;
854
+ spatialDataColumn?: string;
855
+ spatialDataType?: SpatialDataType;
856
+ spatialFiltersResolution?: number;
857
+ spatialFiltersMode?: SpatialFilterPolyfillMode;
858
+ /** original resolution of the spatial index data as stored in the DW */
859
+ dataResolution?: number;
860
+ }
861
+
862
+ interface WidgetSourceProps extends Omit<SourceOptions, 'filters'> {
863
+ apiVersion?: ApiVersion;
864
+ filters?: Record<string, Filter>;
865
+ filtersLogicalOperator?: FilterLogicalOperator;
866
+ }
867
+ /**
868
+ * Source for Widget API requests on a data source defined by a SQL query.
869
+ *
870
+ * Abstract class. Use {@link WidgetQuerySource} or {@link WidgetTableSource}.
871
+ */
872
+ declare abstract class WidgetSource<Props extends WidgetSourceProps = WidgetSourceProps> {
873
+ readonly props: Props;
874
+ static defaultProps: Partial<WidgetSourceProps>;
875
+ constructor(props: Props);
876
+ /**
877
+ * Destroys the widget source and releases allocated resources.
878
+ *
879
+ * For remote sources (tables, queries) this has no effect, but for local
880
+ * sources (tilesets, rasters) these resources will affect performance
881
+ * and stability if many (10+) sources are created and not released.
882
+ */
883
+ destroy(): void;
884
+ protected _getSpatialFiltersResolution(source: Omit<ModelSource, 'type' | 'data'>, spatialFilter?: SpatialFilter, referenceViewState?: ViewState): number | undefined;
885
+ /**
886
+ * Returns a list of labeled datapoints for categorical data. Suitable for
887
+ * charts including grouped bar charts, pie charts, and tree charts.
888
+ */
889
+ abstract getCategories(options: CategoryRequestOptions): Promise<CategoryResponse>;
890
+ /**
891
+ * Given a list of feature IDs (as found in `_carto_feature_id`) returns all
892
+ * matching features. In datasets containing features with duplicate geometries,
893
+ * feature IDs may be duplicated (IDs are a hash of geometry) and so more
894
+ * results may be returned than IDs in the request.
895
+ * @internal
896
+ * @experimental
897
+ */
898
+ abstract getFeatures(options: FeaturesRequestOptions): Promise<FeaturesResponse>;
899
+ /**
900
+ * Returns a scalar numerical statistic over all matching data. Suitable
901
+ * for 'headline' or 'scorecard' figures such as counts and sums.
902
+ */
903
+ abstract getFormula(options: FormulaRequestOptions): Promise<FormulaResponse>;
904
+ /**
905
+ * Returns a list of labeled datapoints for 'bins' of data defined as ticks
906
+ * over a numerical range. Suitable for histogram charts.
907
+ */
908
+ abstract getHistogram(options: HistogramRequestOptions): Promise<HistogramResponse>;
909
+ /**
910
+ * Returns a range (min and max) for a numerical column of matching rows.
911
+ * Suitable for displaying certain 'headline' or 'scorecard' statistics,
912
+ * or rendering a range slider UI for filtering.
913
+ */
914
+ abstract getRange(options: RangeRequestOptions): Promise<RangeResponse>;
915
+ /**
916
+ * Returns a list of bivariate datapoints defined as numerical 'x' and 'y'
917
+ * values. Suitable for rendering scatter plots.
918
+ */
919
+ abstract getScatter(options: ScatterRequestOptions): Promise<ScatterResponse>;
920
+ /**
921
+ * Returns a list of arbitrary data rows, with support for pagination and
922
+ * sorting. Suitable for displaying tables and lists.
923
+ */
924
+ abstract getTable(options: TableRequestOptions): Promise<TableResponse>;
925
+ /**
926
+ * Returns a series of labeled numerical values, grouped into equally-sized
927
+ * time intervals. Suitable for rendering time series charts.
928
+ */
929
+ abstract getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
930
+ }
931
+
932
+ type WidgetRemoteSourceProps = WidgetSourceProps;
933
+ /**
934
+ * Source for Widget API requests.
935
+ *
936
+ * Abstract class. Use {@link WidgetQuerySource} or {@link WidgetTableSource}.
937
+ */
938
+ declare abstract class WidgetRemoteSource<Props extends WidgetRemoteSourceProps> extends WidgetSource<Props> {
939
+ /**
940
+ * Subclasses of {@link WidgetRemoteSource} must implement this method, calling
941
+ * {@link WidgetRemoteSource.prototype._getModelSource} for common source
942
+ * properties, and adding additional required properties including 'type' and
943
+ * 'data'.
944
+ */
945
+ protected abstract getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
946
+ protected _getModelSource(filters: Filters | undefined, filterOwner?: string): Omit<ModelSource, 'type' | 'data'>;
947
+ getCategories(options: CategoryRequestOptions): Promise<CategoryResponse>;
948
+ getFeatures(options: FeaturesRequestOptions): Promise<FeaturesResponse>;
949
+ getFormula(options: FormulaRequestOptions): Promise<FormulaResponse>;
950
+ getHistogram(options: HistogramRequestOptions): Promise<HistogramResponse>;
951
+ getRange(options: RangeRequestOptions): Promise<RangeResponse>;
952
+ getScatter(options: ScatterRequestOptions): Promise<ScatterResponse>;
953
+ getTable(options: TableRequestOptions): Promise<TableResponse>;
954
+ getTimeSeries(options: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
955
+ }
956
+
957
+ type LayerQuerySourceOptions = Omit<VectorQuerySourceOptions, 'filters'> | Omit<H3QuerySourceOptions, 'filters'> | Omit<QuadbinQuerySourceOptions, 'filters'>;
958
+ type WidgetQuerySourceResult = {
959
+ widgetSource: WidgetQuerySource;
960
+ };
961
+ /**
962
+ * Source for Widget API requests on a data source defined by a SQL query.
963
+ *
964
+ * Generally not intended to be constructed directly. Instead, call
965
+ * {@link vectorQuerySource}, {@link h3QuerySource}, or {@link quadbinQuerySource},
966
+ * which can be shared with map layers. Sources contain a `widgetSource` property,
967
+ * for use by widget implementations.
968
+ *
969
+ * Example:
970
+ *
971
+ * ```javascript
972
+ * import { vectorQuerySource } from '@carto/api-client';
973
+ *
974
+ * const data = vectorQuerySource({
975
+ * accessToken: '••••',
976
+ * connectionName: 'carto_dw',
977
+ * sqlQuery: 'SELECT * FROM carto-demo-data.demo_tables.retail_stores'
978
+ * });
979
+ *
980
+ * const { widgetSource } = await data;
981
+ * ```
982
+ */
983
+ declare class WidgetQuerySource extends WidgetRemoteSource<LayerQuerySourceOptions & WidgetRemoteSourceProps> {
984
+ protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
985
+ }
986
+
987
+ type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
988
+ type WidgetTableSourceResult = {
989
+ widgetSource: WidgetTableSource;
990
+ };
991
+ /**
992
+ * Source for Widget API requests on a data source defined as a table.
993
+ *
994
+ * Generally not intended to be constructed directly. Instead, call
995
+ * {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
996
+ * which can be shared with map layers. Sources contain a `widgetSource` property,
997
+ * for use by widget implementations.
998
+ *
999
+ * Example:
1000
+ *
1001
+ * ```javascript
1002
+ * import { vectorTableSource } from '@carto/api-client';
1003
+ *
1004
+ * const data = vectorTableSource({
1005
+ * accessToken: '••••',
1006
+ * connectionName: 'carto_dw',
1007
+ * tableName: 'carto-demo-data.demo_tables.retail_stores'
1008
+ * });
1009
+ *
1010
+ * const { widgetSource } = await data;
1011
+ * ```
1012
+ */
1013
+ declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
1014
+ protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1015
+ }
1016
+
1017
+ /**
1018
+ * @internal
1019
+ * @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
1020
+ */
1021
+ declare function _buildFeatureFilter({ filters, type, filtersLogicalOperator, }: {
1022
+ filters?: Filters;
1023
+ type?: 'number' | 'boolean';
1024
+ filtersLogicalOperator?: FilterLogicalOperator;
1025
+ }): (feature: Feature | FeatureData) => number | boolean;
1026
+ /**
1027
+ * Apply certain filters to a collection of features.
1028
+ * @internal
1029
+ */
1030
+ declare function applyFilters(features: FeatureData[], filters: Filters, filtersLogicalOperator: FilterLogicalOperator): FeatureData[];
1031
+ /**
1032
+ * Binary.
1033
+ * @internal
1034
+ */
1035
+ declare function buildBinaryFeatureFilter({ filters }: {
1036
+ filters: Filters;
1037
+ }): (() => number) | ((featureIdIdx: number, binaryData: BinaryFeature) => boolean);
1038
+
1039
+ type FilterFunction = (filterValues: unknown[], featureValue: unknown, params?: Record<string, unknown>) => boolean;
1040
+ declare const filterFunctions: Record<FilterType, FilterFunction>;
1041
+
1042
+ declare function geojsonFeatures({ geojson, spatialFilter, uniqueIdProperty, }: {
1043
+ geojson: FeatureCollection;
1044
+ spatialFilter: SpatialFilter;
1045
+ uniqueIdProperty?: string;
1046
+ }): FeatureData[];
1047
+
1048
+ /** @privateRemarks Source: @carto/react-core */
1049
+ type TileFeatures = {
1050
+ tiles: Tile[];
1051
+ tileFormat: TileFormat;
1052
+ spatialDataType: SpatialDataType;
1053
+ spatialDataColumn?: string;
1054
+ spatialFilter: SpatialFilter;
1055
+ uniqueIdProperty?: string;
1056
+ options?: TileFeatureExtractOptions;
1057
+ };
1058
+ /** @privateRemarks Source: @carto/react-core */
1059
+ type TileFeatureExtractOptions = {
1060
+ storeGeometry?: boolean;
1061
+ uniqueIdProperty?: string;
1062
+ };
1063
+ /** @privateRemarks Source: @carto/react-core */
1064
+ declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
1065
+
1066
+ declare const FEATURE_GEOM_PROPERTY = "__geomValue";
1067
+ declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
1068
+ tiles: Tile[];
1069
+ tileFormat?: TileFormat;
1070
+ spatialFilter: SpatialFilter;
1071
+ uniqueIdProperty?: string;
1072
+ options?: {
1073
+ storeGeometry?: boolean;
1074
+ };
1075
+ }): FeatureData[];
1076
+
1077
+ type TileFeaturesSpatialIndexOptions = {
1078
+ tiles: SpatialIndexTile[];
1079
+ spatialFilter: SpatialFilter;
1080
+ spatialDataColumn: string;
1081
+ spatialDataType: SpatialDataType;
1082
+ };
1083
+ declare function tileFeaturesSpatialIndex({ tiles, spatialFilter, spatialDataColumn, spatialDataType, }: TileFeaturesSpatialIndexOptions): FeatureData[];
1084
+
1085
+ declare enum Method {
1086
+ INIT = "init",
1087
+ LOAD_TILES = "loadTiles",
1088
+ SET_TILE_FEATURE_EXTRACT_OPTIONS = "setTileFeatureExtractOptions",
1089
+ LOAD_GEOJSON = "loadGeoJSON",
1090
+ GET_FORMULA = "getFormula",
1091
+ GET_HISTOGRAM = "getHistogram",
1092
+ GET_CATEGORIES = "getCategories",
1093
+ GET_SCATTER = "getScatter",
1094
+ GET_TABLE = "getTable",
1095
+ GET_TIME_SERIES = "getTimeSeries",
1096
+ GET_RANGE = "getRange"
1097
+ }
1098
+
1099
+ /**
1100
+ * Local (in-memory) implementation of tileset widget calculations. This class
1101
+ * may be instantiated by {@link WidgetTilesetSource} in a Web Worker when
1102
+ * supported, or on the main thread.
1103
+ */
1104
+ declare class WidgetTilesetSourceImpl extends WidgetSource<WidgetTilesetSourceProps> {
1105
+ private _tiles;
1106
+ private _features;
1107
+ private _tileFeatureExtractOptions;
1108
+ private _tileFeatureExtractPreviousInputs;
1109
+ /**
1110
+ * Loads features as a list of tiles (typically provided by deck.gl).
1111
+ * After tiles are loaded, {@link extractTileFeatures} must be called
1112
+ * before computing statistics on the tiles.
1113
+ */
1114
+ loadTiles(tiles: unknown[]): void;
1115
+ /** Configures options used to extract features from tiles. */
1116
+ setTileFeatureExtractOptions(options: TileFeatureExtractOptions): void;
1117
+ protected _extractTileFeatures(spatialFilter: SpatialFilter): void;
1118
+ /**
1119
+ * Loads features as GeoJSON (used for testing).
1120
+ * @experimental
1121
+ * @internal Not for public use. Spatial filters in other method calls will be ignored.
1122
+ */
1123
+ loadGeoJSON({ geojson, spatialFilter, }: {
1124
+ geojson: FeatureCollection;
1125
+ spatialFilter: SpatialFilter;
1126
+ }): void;
1127
+ getFeatures(): Promise<FeaturesResponse>;
1128
+ getFormula({ column, operation, joinOperation, filters, filterOwner, spatialFilter, }: FormulaRequestOptions): Promise<FormulaResponse>;
1129
+ getHistogram({ operation, ticks, column, joinOperation, filters, filterOwner, spatialFilter, }: HistogramRequestOptions): Promise<HistogramResponse>;
1130
+ getCategories({ column, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: CategoryRequestOptions): Promise<CategoryResponse>;
1131
+ getScatter({ xAxisColumn, yAxisColumn, xAxisJoinOperation, yAxisJoinOperation, filters, filterOwner, spatialFilter, }: ScatterRequestOptions): Promise<ScatterResponse>;
1132
+ getTable({ columns, searchFilterColumn, searchFilterText, sortBy, sortDirection, sortByColumnType, offset, limit, filters, filterOwner, spatialFilter, }: TableRequestOptions): Promise<TableResponse>;
1133
+ getTimeSeries({ column, stepSize, operation, operationColumn, joinOperation, filters, filterOwner, spatialFilter, }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
1134
+ getRange({ column, filters, filterOwner, spatialFilter, }: RangeRequestOptions): Promise<RangeResponse>;
1135
+ /****************************************************************************
1136
+ * INTERNAL
1137
+ */
1138
+ private _getFilteredFeatures;
1139
+ }
1140
+
1141
+ type WidgetTilesetSourceProps = WidgetSourceProps & Omit<TilesetSourceOptions, 'filters'> & {
1142
+ tileFormat: TileFormat;
1143
+ spatialDataType: SpatialDataType;
1144
+ };
1145
+ type WidgetTilesetSourceResult = {
1146
+ widgetSource: WidgetTilesetSource;
1147
+ };
1148
+ /**
1149
+ * Source for Widget API requests on a data source defined by a tileset.
1150
+ *
1151
+ * Generally not intended to be constructed directly. Instead, call
1152
+ * {@link vectorTilesetSource}, {@link h3TilesetSource}, or {@link quadbinTilesetSource},
1153
+ * which can be shared with map layers. Sources contain a `widgetSource`
1154
+ * property, for use by widget implementations.
1155
+ *
1156
+ * Example:
1157
+ *
1158
+ * ```javascript
1159
+ * import { vectorTilesetSource } from '@carto/api-client';
1160
+ *
1161
+ * const data = vectorTilesetSource({
1162
+ * accessToken: '••••',
1163
+ * connectionName: 'carto_dw',
1164
+ * tableName: 'carto-demo-data.demo_rasters.my_tileset_source'
1165
+ * });
1166
+ *
1167
+ * const { widgetSource } = await data;
1168
+ * ```
1169
+ */
1170
+ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps> {
1171
+ protected _localImpl: WidgetTilesetSourceImpl | null;
1172
+ protected _workerImpl: Worker | null;
1173
+ protected _workerEnabled: boolean;
1174
+ protected _workerNextRequestId: number;
1175
+ constructor(props: WidgetTilesetSourceProps);
1176
+ destroy(): void;
1177
+ /**
1178
+ * Returns an initialized Worker, to be reused for the lifecycle of this
1179
+ * source instance.
1180
+ */
1181
+ protected _getWorker(): Worker;
1182
+ /** Executes a given method on the worker. */
1183
+ protected _executeWorkerMethod<T>(method: Method, params: unknown[], signal?: AbortSignal): Promise<T>;
1184
+ /**
1185
+ * Loads features as a list of tiles (typically provided by deck.gl).
1186
+ * After tiles are loaded, {@link extractTileFeatures} must be called
1187
+ * before computing statistics on the tiles.
1188
+ */
1189
+ loadTiles(tiles: unknown[]): void;
1190
+ /** Configures options used to extract features from tiles. */
1191
+ setTileFeatureExtractOptions(options: TileFeatureExtractOptions): void;
1192
+ /**
1193
+ * Loads features as GeoJSON (used for testing).
1194
+ * @experimental
1195
+ * @internal Not for public use. Spatial filters in other method calls will be ignored.
1196
+ */
1197
+ loadGeoJSON({ geojson, spatialFilter, }: {
1198
+ geojson: FeatureCollection;
1199
+ spatialFilter: SpatialFilter;
1200
+ }): void;
1201
+ getFeatures(): Promise<FeaturesResponse>;
1202
+ getFormula({ signal, ...options }: FormulaRequestOptions): Promise<FormulaResponse>;
1203
+ getHistogram({ signal, ...options }: HistogramRequestOptions): Promise<HistogramResponse>;
1204
+ getCategories({ signal, ...options }: CategoryRequestOptions): Promise<CategoryResponse>;
1205
+ getScatter({ signal, ...options }: ScatterRequestOptions): Promise<ScatterResponse>;
1206
+ getTable({ signal, ...options }: TableRequestOptions): Promise<TableResponse>;
1207
+ getTimeSeries({ signal, ...options }: TimeSeriesRequestOptions): Promise<TimeSeriesResponse>;
1208
+ getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
1209
+ }
1210
+
1211
+ type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1212
+ type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1213
+ declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
1214
+
1215
+ type H3TableSourceOptions = SourceOptions & TableSourceOptions & AggregationOptions & FilterOptions;
1216
+ type H3TableSourceResponse = TilejsonResult & WidgetTableSourceResult;
1217
+ declare const h3TableSource: (options: H3TableSourceOptions) => Promise<H3TableSourceResponse>;
1218
+
1219
+ type H3TilesetSourceOptions = SourceOptions & TilesetSourceOptions;
1220
+ type H3TilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1221
+ declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
1222
+
1223
+ type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
1224
+ type RasterSourceResponse = TilejsonResult;
1225
+ declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
1226
+
1227
+ type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1228
+ type QuadbinQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1229
+ declare const quadbinQuerySource: (options: QuadbinQuerySourceOptions) => Promise<QuadbinQuerySourceResponse>;
1230
+
1231
+ type QuadbinTableSourceOptions = SourceOptions & TableSourceOptions & AggregationOptions & FilterOptions;
1232
+ type QuadbinTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
1233
+ declare const quadbinTableSource: (options: QuadbinTableSourceOptions) => Promise<QuadbinTableSourceResponse>;
1234
+
1235
+ type QuadbinTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
1236
+ type QuadbinTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1237
+ declare const quadbinTilesetSource: (options: QuadbinTilesetSourceOptions) => Promise<QuadbinTilesetSourceResponse>;
1238
+
1239
+ type VectorQuerySourceOptions = SourceOptions & QuerySourceOptions & FilterOptions & ColumnsOption;
1240
+ type VectorQuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1241
+ declare const vectorQuerySource: (options: VectorQuerySourceOptions) => Promise<VectorQuerySourceResponse>;
1242
+
1243
+ type VectorTableSourceOptions = SourceOptions & TableSourceOptions & FilterOptions & ColumnsOption;
1244
+ type VectorTableSourceResponse = TilejsonResult & WidgetTableSourceResult;
1245
+ declare const vectorTableSource: (options: VectorTableSourceOptions) => Promise<VectorTableSourceResponse>;
1246
+
1247
+ type VectorTilesetSourceOptions = SourceOptions & TilesetSourceOptions;
1248
+ type VectorTilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1249
+ declare const vectorTilesetSource: (options: VectorTilesetSourceOptions) => Promise<VectorTilesetSourceResponse>;
1250
+
1251
+ type APIRequestType = 'Map data' | 'Map instantiation' | 'Public map' | 'Tile stats' | 'SQL' | 'Basemap style';
1252
+ type APIErrorContext = {
1253
+ requestType: APIRequestType;
1254
+ mapId?: string;
1255
+ connection?: string;
1256
+ source?: string;
1257
+ type?: MapType;
1258
+ };
1259
+ /**
1260
+ *
1261
+ * Custom error for reported errors in CARTO Maps API.
1262
+ * Provides useful debugging information in console and context for applications.
1263
+ *
1264
+ */
1265
+ declare class CartoAPIError extends Error {
1266
+ /** Source error from server */
1267
+ error: Error;
1268
+ /** Context (API call & parameters) in which error occured */
1269
+ errorContext: APIErrorContext;
1270
+ /** Response from server */
1271
+ response?: Response;
1272
+ /** JSON Response from server */
1273
+ responseJson?: any;
1274
+ constructor(error: Error, errorContext: APIErrorContext, response?: Response, responseJson?: any);
1275
+ }
1276
+
1277
+ /** @internal Required by fetchMap(). */
1278
+ declare function buildPublicMapUrl({ apiBaseUrl, cartoMapId, }: {
1279
+ apiBaseUrl: string;
1280
+ cartoMapId: string;
1281
+ }): string;
1282
+ /** @internal Required by fetchMap(). */
1283
+ declare function buildStatsUrl({ attribute, apiBaseUrl, connectionName, source, type, }: {
1284
+ attribute: string;
1285
+ apiBaseUrl: string;
1286
+ connectionName: string;
1287
+ source: string;
1288
+ type: MapType;
1289
+ }): string;
1290
+
1291
+ type QueryOptions = SourceOptions & QuerySourceOptions;
1292
+ declare const query: (options: QueryOptions) => Promise<QueryResult>;
1293
+
1294
+ declare function requestWithParameters<T = any>({ baseUrl, parameters, headers: customHeaders, errorContext, maxLengthURL, localCache, }: {
1295
+ baseUrl: string;
1296
+ parameters?: Record<string, unknown>;
1297
+ headers?: Record<string, string>;
1298
+ errorContext: APIErrorContext;
1299
+ maxLengthURL?: number;
1300
+ localCache?: LocalCacheOptions;
1301
+ }): Promise<T>;
1302
+
1303
+ /**
1304
+ * Resolution conversion function. Takes a WebMercatorViewport and returns
1305
+ * a H3 resolution such that the screen space size of the hexagons is
1306
+ * "similar" to the given tileSize on screen. Intended for use with deck.gl.
1307
+ * @internal
1308
+ */
1309
+ declare function _getHexagonResolution(viewport: {
1310
+ zoom: number;
1311
+ latitude: number;
1312
+ }, tileSize: number): number;
1313
+
1314
+ /** @privateRemarks Source: @carto/react-core */
1315
+ type AggregationFunction = (values: unknown[] | FeatureData[], keys?: string[] | string, joinOperation?: AggregationType) => number;
1316
+ /** @privateRemarks Source: @carto/react-core */
1317
+ declare const aggregationFunctions: Record<Exclude<AggregationType, 'custom'>, AggregationFunction>;
1318
+ /** @privateRemarks Source: @carto/react-core */
1319
+ declare function aggregate(feature: FeatureData, keys?: string[], operation?: AggregationType): unknown;
1320
+
1321
+ type SortColumns = string | string[] | object[];
1322
+ interface SortOptions {
1323
+ sortBy?: SortColumns;
1324
+ sortByDirection?: SortDirection;
1325
+ sortByColumnType?: 'number' | 'string' | 'date';
1326
+ }
1327
+ /**
1328
+ * Apply sort structure to a collection of features
1329
+ * @param features
1330
+ * @param [sortOptions]
1331
+ * @param [sortOptions.sortBy] - One or more columns to sort by
1332
+ * @param [sortOptions.sortByDirection] - Direction by the columns will be sorted
1333
+ * @param [sortOptions.sortByColumnType] - Column type
1334
+ * @internal
1335
+ * @privateRemarks Source: @carto/react-core
1336
+ */
1337
+ declare function applySorting(features: FeatureData[], { sortBy, sortByDirection, sortByColumnType, }?: SortOptions): FeatureData[];
1338
+
1339
+ /** @privateRemarks Source: @carto/react-core */
1340
+ type GroupByFeature = {
1341
+ name: string;
1342
+ value: number;
1343
+ }[];
1344
+ /** @privateRemarks Source: @carto/react-core */
1345
+ declare function groupValuesByColumn({ data, valuesColumns, joinOperation, keysColumn, operation, }: {
1346
+ data: FeatureData[];
1347
+ valuesColumns?: string[];
1348
+ joinOperation?: AggregationType;
1349
+ keysColumn: string;
1350
+ operation: AggregationType;
1351
+ }): GroupByFeature | null;
1352
+
1353
+ /** @privateRemarks Source: @carto/react-core */
1354
+ declare function groupValuesByDateColumn({ data, valuesColumns, joinOperation, keysColumn, groupType, operation, }: {
1355
+ data: Record<string, unknown>[];
1356
+ valuesColumns?: string[];
1357
+ joinOperation?: Exclude<AggregationType, 'custom'>;
1358
+ keysColumn: string;
1359
+ groupType: GroupDateType;
1360
+ operation?: Exclude<AggregationType, 'custom'>;
1361
+ }): GroupByFeature | null;
1362
+
1363
+ /**
1364
+ * Histogram computation.
1365
+ * @privateRemarks Source: @carto/react-core
1366
+ */
1367
+ declare function histogram({ data, valuesColumns, joinOperation, ticks, operation, }: {
1368
+ data: FeatureData[];
1369
+ valuesColumns?: string[];
1370
+ joinOperation?: Exclude<AggregationType, 'custom'>;
1371
+ ticks: number[];
1372
+ operation: Exclude<AggregationType, 'custom'>;
1373
+ }): number[];
1374
+
1375
+ type ScatterPlotFeature = [number, number][];
1376
+ /**
1377
+ * Filters invalid features and formats data.
1378
+ * @privateRemarks Source: @carto/react-core
1379
+ */
1380
+ declare function scatterPlot({ data, xAxisColumns, xAxisJoinOperation, yAxisColumns, yAxisJoinOperation, }: {
1381
+ data: FeatureData[];
1382
+ xAxisColumns: string[];
1383
+ xAxisJoinOperation?: AggregationType;
1384
+ yAxisColumns: string[];
1385
+ yAxisJoinOperation?: AggregationType;
1386
+ }): ScatterPlotFeature;
1387
+
1388
+ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterIntervalComplete[];
1389
+
1390
+ /**
1391
+ * Transform WGS84 coordinates to tile coords.
1392
+ * It's the inverse of deck.gl coordinate-transform (https://github.com/visgl/deck.gl/blob/master/modules/geo-layers/src/mvt-layer/coordinate-transform.js)
1393
+ *
1394
+ * @param geometry - any valid geojson geometry
1395
+ * @param bbox - geojson bbox
1396
+ */
1397
+ declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
1398
+
1399
+ export { type APIErrorContext, type APIRequestType, type AddFilterOptions, type AggregationFunction, type AggregationType, ApiVersion, type BoundaryQuerySourceOptions, type BoundaryQuerySourceResponse, type BoundaryTableSourceOptions, type BoundaryTableSourceResponse, CartoAPIError, type CategoryRequestOptions, type CategoryResponse, DEFAULT_API_BASE_URL, FEATURE_GEOM_PROPERTY, type FeaturesRequestOptions, type FeaturesResponse, type Filter, type FilterFunction, type FilterInterval, type FilterIntervalComplete, type FilterIntervalExtremum, type FilterLogicalOperator, FilterType, type Filters, type Format, type FormulaRequestOptions, type FormulaResponse, type GeojsonResult, type GetFilterOptions, type GroupByFeature, type GroupDateType, type H3QuerySourceOptions, type H3QuerySourceResponse, type H3TableSourceOptions, type H3TableSourceResponse, type H3TilesetSourceOptions, type H3TilesetSourceResponse, type HasFilterOptions, type HistogramRequestOptions, type HistogramResponse, type JsonResult, type MapType, type NamedQueryParameter, type PositionalQueryParameter, Provider, type QuadbinQuerySourceOptions, type QuadbinQuerySourceResponse, type QuadbinTableSourceOptions, type QuadbinTableSourceResponse, type QuadbinTilesetSourceOptions, type QuadbinTilesetSourceResponse, type QueryOptions, type QueryParameterValue, type QueryParameters, type QueryResult, type QuerySourceOptions, type RangeRequestOptions, type RangeResponse, type Raster, RasterBandColorinterp, type RasterMetadata, type RasterMetadataBand, type RasterMetadataBandStats, type RasterSourceOptions, type RemoveFilterOptions, SOURCE_DEFAULTS, type ScatterPlotFeature, type ScatterRequestOptions, type ScatterResponse, type SortColumnType, type SortDirection, type SourceOptions, type SpatialFilter, type SpatialFilterPolyfillMode, SpatialIndex, type SpatialIndexTile, type StringSearchOptions, type TableRequestOptions, type TableResponse, type TableSourceOptions, type Tile, type TileFeatureExtractOptions, type TileFeatures, type TileFeaturesSpatialIndexOptions, TileFormat, type TileResolution, type TilejsonResult, type TilesetSourceOptions, type TimeSeriesRequestOptions, type TimeSeriesResponse, type VectorLayer, type VectorQuerySourceOptions, type VectorQuerySourceResponse, type VectorTableSourceOptions, type VectorTableSourceResponse, type VectorTilesetSourceOptions, type VectorTilesetSourceResponse, type ViewState, type Viewport, WidgetQuerySource, type WidgetQuerySourceResult, WidgetRemoteSource, type WidgetRemoteSourceProps, WidgetSource, type WidgetSourceProps, WidgetTableSource, type WidgetTableSourceResult, WidgetTilesetSource, type WidgetTilesetSourceProps, type WidgetTilesetSourceResult, type _DataFilterExtensionProps, _buildFeatureFilter, _getHexagonResolution, addFilter, aggregate, aggregationFunctions, applyFilters, applySorting, boundaryQuerySource, boundaryTableSource, buildBinaryFeatureFilter, buildPublicMapUrl, buildStatsUrl, clearFilters, createPolygonSpatialFilter, createViewportSpatialFilter, filterFunctions, geojsonFeatures, getClient, getDataFilterExtensionProps, getFilter, groupValuesByColumn, groupValuesByDateColumn, h3QuerySource, h3TableSource, h3TilesetSource, hasFilter, histogram, makeIntervalComplete, quadbinQuerySource, quadbinTableSource, quadbinTilesetSource, query, rasterSource, removeFilter, requestWithParameters, scatterPlot, setClient, tileFeatures, tileFeaturesGeometries, tileFeaturesSpatialIndex, transformToTileCoords, vectorQuerySource, vectorTableSource, vectorTilesetSource };