@carto/api-client 0.5.0-alpha.11 → 0.5.0-alpha.14

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.
@@ -96,8 +96,6 @@ type Tile = {
96
96
  z: number;
97
97
  };
98
98
  id: string;
99
- content: unknown;
100
- zoom: number;
101
99
  bbox: {
102
100
  west: number;
103
101
  east: number;
@@ -113,6 +111,14 @@ type SpatialIndexTile = Tile & {
113
111
  id: bigint;
114
112
  })[];
115
113
  };
114
+ type RasterTile = Tile & {
115
+ id: string;
116
+ index: {
117
+ q: bigint;
118
+ i: string;
119
+ };
120
+ data?: Raster;
121
+ };
116
122
  /** @privateRemarks Source: @deck.gl/carto */
117
123
  type Raster = {
118
124
  blockSize: number;
@@ -225,13 +231,23 @@ type _DataFilterExtensionProps = {
225
231
  };
226
232
  /**
227
233
  * Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
228
- * a set of filters.
234
+ * a set of filters. Requires that DataFilterExtension is initialized with
235
+ * filterSize=4, where the CARTO filters will occupy the first two slots.
229
236
  *
230
- * @privateRemarks DataFilterExtension accepts up to 4 values to filter. This
231
- * implementation uses the 1st for all filters except the time filter, and the
232
- * 2nd for the time filter.
237
+ * @example To create a deck.gl layer with GPU data filtering:
238
+ * ```typescript
239
+ * import {DataFilterExtension} from '@deck.gl/extensions';
240
+ * import {VectorTileLayer} from '@deck.gl/layers';
241
+ * import {getDataFilterExtensionProps} from '@carto/api-client';
242
+ *
243
+ * const layer = new VectorTileLayer({
244
+ * data: data,
245
+ * extensions: [new DataFilterExtension({filterSize: 4})],
246
+ * ...getDataFilterExtensionProps(filters),
247
+ * });
248
+ * ```
233
249
  */
234
- declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator, filterSize?: 0 | 1 | 2 | 3 | 4): _DataFilterExtensionProps;
250
+ declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
235
251
 
236
252
  type FilterTypeOptions<T extends FilterType> = {
237
253
  type: T;
@@ -592,8 +608,9 @@ declare enum RasterBandColorinterp {
592
608
  Alpha = "alpha",
593
609
  Palette = "palette"
594
610
  }
611
+ type RasterBandType = 'uint8' | 'int8' | 'uint16' | 'int16' | 'uint32' | 'int32' | 'uint64' | 'int64' | 'float32' | 'float64';
595
612
  type RasterMetadataBand = {
596
- type: string;
613
+ type: RasterBandType;
597
614
  name: string;
598
615
  stats: RasterMetadataBandStats;
599
616
  /**
@@ -606,7 +623,7 @@ type RasterMetadataBand = {
606
623
  /**
607
624
  * Default color mapping for unique values (or if coloprinterp is `palette`)
608
625
  */
609
- colortable?: Record<string, number[]>;
626
+ colortable?: Record<string, [number, number, number, number]>;
610
627
  /**
611
628
  * No value representation.
612
629
  * Observed values:
@@ -974,36 +991,6 @@ declare class WidgetQuerySource extends WidgetRemoteSource<LayerQuerySourceOptio
974
991
  protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
975
992
  }
976
993
 
977
- type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
978
- type WidgetTableSourceResult = {
979
- widgetSource: WidgetTableSource;
980
- };
981
- /**
982
- * Source for Widget API requests on a data source defined as a table.
983
- *
984
- * Generally not intended to be constructed directly. Instead, call
985
- * {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
986
- * which can be shared with map layers. Sources contain a `widgetSource` property,
987
- * for use by widget implementations.
988
- *
989
- * Example:
990
- *
991
- * ```javascript
992
- * import { vectorTableSource } from '@carto/api-client';
993
- *
994
- * const data = vectorTableSource({
995
- * accessToken: '••••',
996
- * connectionName: 'carto_dw',
997
- * tableName: 'carto-demo-data.demo_tables.retail_stores'
998
- * });
999
- *
1000
- * const { widgetSource } = await data;
1001
- * ```
1002
- */
1003
- declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
1004
- protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1005
- }
1006
-
1007
994
  /**
1008
995
  * @internal
1009
996
  * @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
@@ -1043,6 +1030,7 @@ type TileFeatures = {
1043
1030
  spatialDataColumn?: string;
1044
1031
  spatialFilter: SpatialFilter;
1045
1032
  uniqueIdProperty?: string;
1033
+ rasterMetadata?: RasterMetadata;
1046
1034
  options?: TileFeatureExtractOptions;
1047
1035
  };
1048
1036
  /** @privateRemarks Source: @carto/react-core */
@@ -1051,7 +1039,7 @@ type TileFeatureExtractOptions = {
1051
1039
  uniqueIdProperty?: string;
1052
1040
  };
1053
1041
  /** @privateRemarks Source: @carto/react-core */
1054
- declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
1042
+ declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, rasterMetadata, options, }: TileFeatures): FeatureData[];
1055
1043
 
1056
1044
  declare const FEATURE_GEOM_PROPERTY = "__geomValue";
1057
1045
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
@@ -1157,12 +1145,12 @@ type WidgetTilesetSourceResult = {
1157
1145
  * const { widgetSource } = await data;
1158
1146
  * ```
1159
1147
  */
1160
- declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps> {
1148
+ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = WidgetTilesetSourceProps> extends WidgetSource<Props> {
1161
1149
  protected _localImpl: WidgetTilesetSourceImpl | null;
1162
1150
  protected _workerImpl: Worker | null;
1163
1151
  protected _workerEnabled: boolean;
1164
1152
  protected _workerNextRequestId: number;
1165
- constructor(props: WidgetTilesetSourceProps);
1153
+ constructor(props: Props);
1166
1154
  destroy(): void;
1167
1155
  /**
1168
1156
  * Returns an initialized Worker, to be reused for the lifecycle of this
@@ -1198,6 +1186,46 @@ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps>
1198
1186
  getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
1199
1187
  }
1200
1188
 
1189
+ type WidgetRasterSourceProps = WidgetTilesetSourceProps & {
1190
+ rasterMetadata: RasterMetadata;
1191
+ spatialDataType: 'quadbin';
1192
+ };
1193
+ type WidgetRasterSourceResult = {
1194
+ widgetSource: WidgetRasterSource;
1195
+ };
1196
+ declare class WidgetRasterSource extends WidgetTilesetSource<WidgetRasterSourceProps> {
1197
+ }
1198
+
1199
+ type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
1200
+ type WidgetTableSourceResult = {
1201
+ widgetSource: WidgetTableSource;
1202
+ };
1203
+ /**
1204
+ * Source for Widget API requests on a data source defined as a table.
1205
+ *
1206
+ * Generally not intended to be constructed directly. Instead, call
1207
+ * {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
1208
+ * which can be shared with map layers. Sources contain a `widgetSource` property,
1209
+ * for use by widget implementations.
1210
+ *
1211
+ * Example:
1212
+ *
1213
+ * ```javascript
1214
+ * import { vectorTableSource } from '@carto/api-client';
1215
+ *
1216
+ * const data = vectorTableSource({
1217
+ * accessToken: '••••',
1218
+ * connectionName: 'carto_dw',
1219
+ * tableName: 'carto-demo-data.demo_tables.retail_stores'
1220
+ * });
1221
+ *
1222
+ * const { widgetSource } = await data;
1223
+ * ```
1224
+ */
1225
+ declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
1226
+ protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1227
+ }
1228
+
1201
1229
  type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1202
1230
  type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1203
1231
  declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
@@ -1211,7 +1239,7 @@ type H3TilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1211
1239
  declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
1212
1240
 
1213
1241
  type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
1214
- type RasterSourceResponse = TilejsonResult;
1242
+ type RasterSourceResponse = TilejsonResult & WidgetRasterSourceResult;
1215
1243
  declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
1216
1244
 
1217
1245
  type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
@@ -1386,4 +1414,4 @@ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterInterv
1386
1414
  */
1387
1415
  declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
1388
1416
 
1389
- 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 };
1417
+ 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 RasterTile, 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, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, 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 };
@@ -96,8 +96,6 @@ type Tile = {
96
96
  z: number;
97
97
  };
98
98
  id: string;
99
- content: unknown;
100
- zoom: number;
101
99
  bbox: {
102
100
  west: number;
103
101
  east: number;
@@ -113,6 +111,14 @@ type SpatialIndexTile = Tile & {
113
111
  id: bigint;
114
112
  })[];
115
113
  };
114
+ type RasterTile = Tile & {
115
+ id: string;
116
+ index: {
117
+ q: bigint;
118
+ i: string;
119
+ };
120
+ data?: Raster;
121
+ };
116
122
  /** @privateRemarks Source: @deck.gl/carto */
117
123
  type Raster = {
118
124
  blockSize: number;
@@ -225,13 +231,23 @@ type _DataFilterExtensionProps = {
225
231
  };
226
232
  /**
227
233
  * Creates props for DataFilterExtension, from `@deck.gl/extensions`, given
228
- * a set of filters.
234
+ * a set of filters. Requires that DataFilterExtension is initialized with
235
+ * filterSize=4, where the CARTO filters will occupy the first two slots.
229
236
  *
230
- * @privateRemarks DataFilterExtension accepts up to 4 values to filter. This
231
- * implementation uses the 1st for all filters except the time filter, and the
232
- * 2nd for the time filter.
237
+ * @example To create a deck.gl layer with GPU data filtering:
238
+ * ```typescript
239
+ * import {DataFilterExtension} from '@deck.gl/extensions';
240
+ * import {VectorTileLayer} from '@deck.gl/layers';
241
+ * import {getDataFilterExtensionProps} from '@carto/api-client';
242
+ *
243
+ * const layer = new VectorTileLayer({
244
+ * data: data,
245
+ * extensions: [new DataFilterExtension({filterSize: 4})],
246
+ * ...getDataFilterExtensionProps(filters),
247
+ * });
248
+ * ```
233
249
  */
234
- declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator, filterSize?: 0 | 1 | 2 | 3 | 4): _DataFilterExtensionProps;
250
+ declare function getDataFilterExtensionProps(filters: Filters, filtersLogicalOperator?: FilterLogicalOperator): _DataFilterExtensionProps;
235
251
 
236
252
  type FilterTypeOptions<T extends FilterType> = {
237
253
  type: T;
@@ -592,8 +608,9 @@ declare enum RasterBandColorinterp {
592
608
  Alpha = "alpha",
593
609
  Palette = "palette"
594
610
  }
611
+ type RasterBandType = 'uint8' | 'int8' | 'uint16' | 'int16' | 'uint32' | 'int32' | 'uint64' | 'int64' | 'float32' | 'float64';
595
612
  type RasterMetadataBand = {
596
- type: string;
613
+ type: RasterBandType;
597
614
  name: string;
598
615
  stats: RasterMetadataBandStats;
599
616
  /**
@@ -606,7 +623,7 @@ type RasterMetadataBand = {
606
623
  /**
607
624
  * Default color mapping for unique values (or if coloprinterp is `palette`)
608
625
  */
609
- colortable?: Record<string, number[]>;
626
+ colortable?: Record<string, [number, number, number, number]>;
610
627
  /**
611
628
  * No value representation.
612
629
  * Observed values:
@@ -974,36 +991,6 @@ declare class WidgetQuerySource extends WidgetRemoteSource<LayerQuerySourceOptio
974
991
  protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
975
992
  }
976
993
 
977
- type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
978
- type WidgetTableSourceResult = {
979
- widgetSource: WidgetTableSource;
980
- };
981
- /**
982
- * Source for Widget API requests on a data source defined as a table.
983
- *
984
- * Generally not intended to be constructed directly. Instead, call
985
- * {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
986
- * which can be shared with map layers. Sources contain a `widgetSource` property,
987
- * for use by widget implementations.
988
- *
989
- * Example:
990
- *
991
- * ```javascript
992
- * import { vectorTableSource } from '@carto/api-client';
993
- *
994
- * const data = vectorTableSource({
995
- * accessToken: '••••',
996
- * connectionName: 'carto_dw',
997
- * tableName: 'carto-demo-data.demo_tables.retail_stores'
998
- * });
999
- *
1000
- * const { widgetSource } = await data;
1001
- * ```
1002
- */
1003
- declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
1004
- protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1005
- }
1006
-
1007
994
  /**
1008
995
  * @internal
1009
996
  * @privateRemarks Exported for use in @deck.gl/carto's getDataFilterExtensionProps.
@@ -1043,6 +1030,7 @@ type TileFeatures = {
1043
1030
  spatialDataColumn?: string;
1044
1031
  spatialFilter: SpatialFilter;
1045
1032
  uniqueIdProperty?: string;
1033
+ rasterMetadata?: RasterMetadata;
1046
1034
  options?: TileFeatureExtractOptions;
1047
1035
  };
1048
1036
  /** @privateRemarks Source: @carto/react-core */
@@ -1051,7 +1039,7 @@ type TileFeatureExtractOptions = {
1051
1039
  uniqueIdProperty?: string;
1052
1040
  };
1053
1041
  /** @privateRemarks Source: @carto/react-core */
1054
- declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, options, }: TileFeatures): FeatureData[];
1042
+ declare function tileFeatures({ tiles, spatialFilter, uniqueIdProperty, tileFormat, spatialDataColumn, spatialDataType, rasterMetadata, options, }: TileFeatures): FeatureData[];
1055
1043
 
1056
1044
  declare const FEATURE_GEOM_PROPERTY = "__geomValue";
1057
1045
  declare function tileFeaturesGeometries({ tiles, tileFormat, spatialFilter, uniqueIdProperty, options, }: {
@@ -1157,12 +1145,12 @@ type WidgetTilesetSourceResult = {
1157
1145
  * const { widgetSource } = await data;
1158
1146
  * ```
1159
1147
  */
1160
- declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps> {
1148
+ declare class WidgetTilesetSource<Props extends WidgetTilesetSourceProps = WidgetTilesetSourceProps> extends WidgetSource<Props> {
1161
1149
  protected _localImpl: WidgetTilesetSourceImpl | null;
1162
1150
  protected _workerImpl: Worker | null;
1163
1151
  protected _workerEnabled: boolean;
1164
1152
  protected _workerNextRequestId: number;
1165
- constructor(props: WidgetTilesetSourceProps);
1153
+ constructor(props: Props);
1166
1154
  destroy(): void;
1167
1155
  /**
1168
1156
  * Returns an initialized Worker, to be reused for the lifecycle of this
@@ -1198,6 +1186,46 @@ declare class WidgetTilesetSource extends WidgetSource<WidgetTilesetSourceProps>
1198
1186
  getRange({ signal, ...options }: RangeRequestOptions): Promise<RangeResponse>;
1199
1187
  }
1200
1188
 
1189
+ type WidgetRasterSourceProps = WidgetTilesetSourceProps & {
1190
+ rasterMetadata: RasterMetadata;
1191
+ spatialDataType: 'quadbin';
1192
+ };
1193
+ type WidgetRasterSourceResult = {
1194
+ widgetSource: WidgetRasterSource;
1195
+ };
1196
+ declare class WidgetRasterSource extends WidgetTilesetSource<WidgetRasterSourceProps> {
1197
+ }
1198
+
1199
+ type LayerTableSourceOptions = Omit<VectorTableSourceOptions, 'filters'> | Omit<H3TableSourceOptions, 'filters'> | Omit<QuadbinTableSourceOptions, 'filters'>;
1200
+ type WidgetTableSourceResult = {
1201
+ widgetSource: WidgetTableSource;
1202
+ };
1203
+ /**
1204
+ * Source for Widget API requests on a data source defined as a table.
1205
+ *
1206
+ * Generally not intended to be constructed directly. Instead, call
1207
+ * {@link vectorTableSource}, {@link h3TableSource}, or {@link quadbinTableSource},
1208
+ * which can be shared with map layers. Sources contain a `widgetSource` property,
1209
+ * for use by widget implementations.
1210
+ *
1211
+ * Example:
1212
+ *
1213
+ * ```javascript
1214
+ * import { vectorTableSource } from '@carto/api-client';
1215
+ *
1216
+ * const data = vectorTableSource({
1217
+ * accessToken: '••••',
1218
+ * connectionName: 'carto_dw',
1219
+ * tableName: 'carto-demo-data.demo_tables.retail_stores'
1220
+ * });
1221
+ *
1222
+ * const { widgetSource } = await data;
1223
+ * ```
1224
+ */
1225
+ declare class WidgetTableSource extends WidgetRemoteSource<LayerTableSourceOptions & WidgetRemoteSourceProps> {
1226
+ protected getModelSource(filters: Filters | undefined, filterOwner?: string): ModelSource;
1227
+ }
1228
+
1201
1229
  type H3QuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
1202
1230
  type H3QuerySourceResponse = TilejsonResult & WidgetQuerySourceResult;
1203
1231
  declare const h3QuerySource: (options: H3QuerySourceOptions) => Promise<H3QuerySourceResponse>;
@@ -1211,7 +1239,7 @@ type H3TilesetSourceResponse = TilejsonResult & WidgetTilesetSourceResult;
1211
1239
  declare const h3TilesetSource: (options: H3TilesetSourceOptions) => Promise<H3TilesetSourceResponse>;
1212
1240
 
1213
1241
  type RasterSourceOptions = SourceOptions & TilesetSourceOptions & FilterOptions;
1214
- type RasterSourceResponse = TilejsonResult;
1242
+ type RasterSourceResponse = TilejsonResult & WidgetRasterSourceResult;
1215
1243
  declare const rasterSource: (options: RasterSourceOptions) => Promise<RasterSourceResponse>;
1216
1244
 
1217
1245
  type QuadbinQuerySourceOptions = SourceOptions & QuerySourceOptions & AggregationOptions & FilterOptions;
@@ -1386,4 +1414,4 @@ declare function makeIntervalComplete(intervals: FilterInterval[]): FilterInterv
1386
1414
  */
1387
1415
  declare function transformToTileCoords<T extends Geometry>(geometry: T, bbox: BBox): T;
1388
1416
 
1389
- 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 };
1417
+ 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 RasterTile, 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, WidgetRasterSource, type WidgetRasterSourceProps, type WidgetRasterSourceResult, 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 };