@kepler.gl/utils 3.3.0-alpha.6 → 3.3.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/application-config.d.ts +31 -0
- package/dist/arrow-data-container.d.ts +20 -0
- package/dist/cjs/application-config.js +9 -2
- package/dist/cjs/arrow-data-container.js +205 -20
- package/dist/cjs/column-statistics.js +115 -0
- package/dist/cjs/data-scale-utils.js +2 -2
- package/dist/cjs/data-utils.js +17 -6
- package/dist/cjs/dataset-utils.js +2 -2
- package/dist/cjs/editor-feature-utils.js +177 -0
- package/dist/cjs/effect-utils.js +2 -2
- package/dist/cjs/export-utils.js +2 -2
- package/dist/cjs/filter-utils.js +31 -15
- package/dist/cjs/index.js +63 -1
- package/dist/cjs/map-style-utils/mapbox-gl-style-editor.js +7 -3
- package/dist/cjs/observe-dimensions.js +2 -2
- package/dist/cjs/plot.js +60 -20
- package/dist/cjs/projection-utils.js +52 -2
- package/dist/cjs/split-map-utils.js +2 -2
- package/dist/cjs/types.js +1 -1
- package/dist/column-statistics.d.ts +54 -0
- package/dist/editor-feature-utils.d.ts +30 -0
- package/dist/esm/application-config.js +9 -2
- package/dist/esm/arrow-data-container.js +204 -20
- package/dist/esm/column-statistics.js +105 -0
- package/dist/esm/data-scale-utils.js +2 -2
- package/dist/esm/data-utils.js +17 -6
- package/dist/esm/dataset-utils.js +2 -2
- package/dist/esm/editor-feature-utils.js +164 -0
- package/dist/esm/effect-utils.js +2 -2
- package/dist/esm/export-utils.js +2 -2
- package/dist/esm/filter-utils.js +31 -15
- package/dist/esm/index.js +5 -3
- package/dist/esm/map-style-utils/mapbox-gl-style-editor.js +8 -4
- package/dist/esm/observe-dimensions.js +2 -2
- package/dist/esm/plot.js +58 -19
- package/dist/esm/projection-utils.js +52 -2
- package/dist/esm/split-map-utils.js +2 -2
- package/dist/esm/types.js +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/map-style-utils/mapbox-gl-style-editor.d.ts +11 -10
- package/dist/plot.d.ts +8 -6
- package/dist/projection-utils.d.ts +7 -5
- package/dist/types.d.ts +1 -0
- package/package.json +6 -7
- package/dist/cjs/noop.js +0 -13
- package/dist/cjs/searcher-utils.js +0 -25
- package/dist/esm/noop.js +0 -7
- package/dist/esm/searcher-utils.js +0 -19
- package/dist/noop.d.ts +0 -1
- package/dist/searcher-utils.d.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,9 @@ export { createNotification, exportImageError, successNotification } from './not
|
|
|
4
4
|
export { setStyleSheetBaseHref } from './dom-utils';
|
|
5
5
|
export { default as domtoimage } from './dom-to-image';
|
|
6
6
|
export { getFrequency, getMode, aggregate } from './aggregation';
|
|
7
|
-
export {
|
|
7
|
+
export { ColumnStatsType, NUMERIC_BIN_COUNT, collectColumnValues, computeColumnStats, getColumnStatistics } from './column-statistics';
|
|
8
|
+
export type { ColumnStats, NumericColumnStats, CategoricalColumnStats, TimeColumnStats, Quantile } from './column-statistics';
|
|
9
|
+
export { adjustValueToAnimationWindow, getBinThresholds, histogramFromThreshold, histogramFromValues, histogramFromDomain, histogramFromOrdinal, mergePolygonLayerIndexes, runGpuFilterForPlot, updateTimeFilterPlotType } from './plot';
|
|
8
10
|
export * from './data-utils';
|
|
9
11
|
export type { FieldFormatter } from './data-utils';
|
|
10
12
|
export * from './strings';
|
|
@@ -29,11 +31,13 @@ export { computeDeckEffects, fixEffectOrder, reorderEffectOrder, validateEffectP
|
|
|
29
31
|
export { isStyleUsingMapboxTiles, isStyleUsingOpenStreetMapTiles, mapHasOpenStreetMapAttribution, getBaseMapAttributions, getBaseMapLibrary, transformRequest } from './map-style-utils/mapbox-utils';
|
|
30
32
|
export type { AttributionMapLike } from './map-style-utils/mapbox-utils';
|
|
31
33
|
export * from './map-utils';
|
|
32
|
-
export { ArrowDataContainer, arrowDataTypeToAnalyzerDataType, arrowDataTypeToFieldType, isArrowTable, isArrowFixedSizeList, isArrowStruct, isArrowVector } from './arrow-data-container';
|
|
34
|
+
export { ArrowDataContainer, compactArrowTable, arrowDataTypeToAnalyzerDataType, arrowDataTypeToFieldType, isArrowTable, isArrowFixedSizeList, isArrowStruct, isArrowVector } from './arrow-data-container';
|
|
33
35
|
export type { DataContainerInterface } from './data-container-interface';
|
|
34
36
|
export { DataForm, createDataContainer, createIndexedDataContainer, getSampleData as getSampleContainerData } from './data-container-utils';
|
|
35
37
|
export * from './filter-utils';
|
|
36
38
|
export type { FilterChanged, FilterResult, dataValueAccessor } from './filter-utils';
|
|
39
|
+
export * from './editor-feature-utils';
|
|
40
|
+
export type { EditorFeatureCollection } from './editor-feature-utils';
|
|
37
41
|
export { colorMapToColorBreaks, colorBreaksToColorMap, getLayerColorScale, getLegendOfScale, getLinearDomain, getLogDomain, getOrdinalDomain, getQuantileDomain, getScaleFunction, getVisualChannelScaleByZoom, initializeLayerColorMap, isNumericColorBreaks, isDomainStops, isDomainQuantile, getDomainStepsbyZoom, getThresholdsFromQuantiles, getQuantLabelFormat, getHistogramDomain, getQuantLegends, getCategoricalColorMap, getCategoricalColorScale, initCustomPaletteByCustomScale, colorMapToCategoricalColorBreaks, resetCategoricalColorMapByIndex, selectRestCategoricalColorMapByIndex, removeCategoricalValueFromColorMap, addCategoricalValuesToColorMap } from './data-scale-utils';
|
|
38
42
|
export type { ColorBreak, ColorBreakOrdinal, DomainQuantiles, DomainStops } from './data-scale-utils';
|
|
39
43
|
export { DataRow } from './data-row';
|
|
@@ -2,6 +2,14 @@ import { BaseMapStyle, LayerGroup, MapState } from '@kepler.gl/types';
|
|
|
2
2
|
export declare function getDefaultLayerGroupVisibility({ layerGroups }: {
|
|
3
3
|
layerGroups: LayerGroup[];
|
|
4
4
|
}): {};
|
|
5
|
+
type EditMapStyleArgs = {
|
|
6
|
+
id?: string;
|
|
7
|
+
mapStyle: BaseMapStyle;
|
|
8
|
+
visibleLayerGroups: {
|
|
9
|
+
[id: string]: LayerGroup | boolean;
|
|
10
|
+
} | false;
|
|
11
|
+
};
|
|
12
|
+
type EditMapStyle = (args: EditMapStyleArgs) => object;
|
|
5
13
|
/**
|
|
6
14
|
* Edit preset map style to keep only visible layers
|
|
7
15
|
*
|
|
@@ -9,15 +17,7 @@ export declare function getDefaultLayerGroupVisibility({ layerGroups }: {
|
|
|
9
17
|
* @param visibleLayerGroups - visible layers of top map
|
|
10
18
|
* @returns top map style
|
|
11
19
|
*/
|
|
12
|
-
export declare const editTopMapStyle:
|
|
13
|
-
id?: string;
|
|
14
|
-
mapStyle: BaseMapStyle;
|
|
15
|
-
visibleLayerGroups: {
|
|
16
|
-
[id: string]: LayerGroup | boolean;
|
|
17
|
-
} | false;
|
|
18
|
-
}) => {
|
|
19
|
-
layers: any;
|
|
20
|
-
}) & import("lodash").MemoizedFunction;
|
|
20
|
+
export declare const editTopMapStyle: EditMapStyle;
|
|
21
21
|
/**
|
|
22
22
|
* Edit preset map style to filter out invisible layers
|
|
23
23
|
*
|
|
@@ -25,7 +25,7 @@ export declare const editTopMapStyle: (({ mapStyle, visibleLayerGroups }: {
|
|
|
25
25
|
* @param {Object} visibleLayerGroups - visible layers of bottom map
|
|
26
26
|
* @returns {Object} bottom map style
|
|
27
27
|
*/
|
|
28
|
-
export declare const editBottomMapStyle:
|
|
28
|
+
export declare const editBottomMapStyle: EditMapStyle;
|
|
29
29
|
export declare function getStyleDownloadUrl(styleUrl: any, accessToken: any, mapboxApiUrl: any): any;
|
|
30
30
|
/**
|
|
31
31
|
* Generate static map image from style Url to be used as icon
|
|
@@ -54,3 +54,4 @@ export declare function scaleMapStyleByResolution(mapboxStyle: any, scale: any):
|
|
|
54
54
|
* @return {Object} mergedLayerGroups
|
|
55
55
|
*/
|
|
56
56
|
export declare function mergeLayerGroupVisibility(defaultLayerGroup: any, currentLayerGroup: any): any;
|
|
57
|
+
export {};
|
package/dist/plot.d.ts
CHANGED
|
@@ -3,6 +3,13 @@ import { AggregationTypes } from '@kepler.gl/constants';
|
|
|
3
3
|
import { DataContainerInterface } from '.';
|
|
4
4
|
import { KeplerTableModel } from './types';
|
|
5
5
|
type Datasets = any;
|
|
6
|
+
/**
|
|
7
|
+
* Merge per-layer polygon-filtered indices into a dataset-level index.
|
|
8
|
+
* When any layers are polygon-filtered, take the union of their indices (a row is kept if it
|
|
9
|
+
* is visible on at least one targeted layer), then intersect with the base index.
|
|
10
|
+
* Used for filtered export and filter plots/histograms.
|
|
11
|
+
*/
|
|
12
|
+
export declare function mergePolygonLayerIndexes(baseIndex: number[], filteredIndexByLayer?: Record<string, number[]>): number[];
|
|
6
13
|
/**
|
|
7
14
|
*
|
|
8
15
|
* @param thresholds
|
|
@@ -16,12 +23,7 @@ export declare function histogramFromThreshold(thresholds: number[], values: num
|
|
|
16
23
|
* @param numBins
|
|
17
24
|
* @param valueAccessor
|
|
18
25
|
*/
|
|
19
|
-
export declare function histogramFromValues(values: (Millisecond | null | number)[], numBins: number, valueAccessor?: (d: number) => number):
|
|
20
|
-
count: number;
|
|
21
|
-
indexes: import("d3-array").Bin<number, number>;
|
|
22
|
-
x0: number | undefined;
|
|
23
|
-
x1: number | undefined;
|
|
24
|
-
}[];
|
|
26
|
+
export declare function histogramFromValues(values: (Millisecond | null | number)[], numBins: number, valueAccessor?: (d: number) => number): Bin[];
|
|
25
27
|
export declare function histogramFromOrdinal(domain: [string], values: (Millisecond | null | number)[], valueAccessor?: (d: unknown) => string): Bin[];
|
|
26
28
|
/**
|
|
27
29
|
*
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import WebMercatorViewport from 'viewport-mercator-project';
|
|
2
|
+
import type { ViewportPadding } from '@kepler.gl/types';
|
|
2
3
|
export declare const MAPBOX_TILE_SIZE = 512;
|
|
3
4
|
/**
|
|
4
5
|
* bounds should be [minLng, minLat, maxLng, maxLat]
|
|
5
6
|
* @param {*} bounds
|
|
6
7
|
*/
|
|
7
8
|
export declare function validateBounds(bounds: any): any[] | null;
|
|
8
|
-
export declare function getCenterAndZoomFromBounds(bounds: any, { width, height }: {
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
9
|
+
export declare function getCenterAndZoomFromBounds(bounds: any, { width, height, padding }: {
|
|
10
|
+
width: number;
|
|
11
|
+
height: number;
|
|
12
|
+
padding?: ViewportPadding;
|
|
11
13
|
}): {
|
|
12
|
-
zoom:
|
|
13
|
-
center:
|
|
14
|
+
zoom: any;
|
|
15
|
+
center: any[];
|
|
14
16
|
} | null;
|
|
15
17
|
/**
|
|
16
18
|
* Add extra info about screen space position and world position to the event.
|
package/dist/types.d.ts
CHANGED
|
@@ -15,4 +15,5 @@ export interface KeplerTableModel<K, L, F extends Field = any> {
|
|
|
15
15
|
filterValueAccessor: (dc: DataContainerInterface) => (getIndex?: (any: any) => number, getData?: (dc_: DataContainerInterface, d: any, fieldIndex: number) => any) => (d: any) => (number | number[])[];
|
|
16
16
|
};
|
|
17
17
|
filteredIndex: number[];
|
|
18
|
+
filteredIndexByLayer?: Record<string, number[]>;
|
|
18
19
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kepler.gl/utils",
|
|
3
3
|
"author": "Shan He <shan@uber.com>",
|
|
4
|
-
"version": "3.3.0-alpha.
|
|
4
|
+
"version": "3.3.0-alpha.8",
|
|
5
5
|
"description": "kepler.gl constants used by kepler.gl components, actions and reducers",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/cjs/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@deck.gl/core": "^9.3.1",
|
|
32
|
-
"@kepler.gl/common-utils": "3.3.0-alpha.
|
|
33
|
-
"@kepler.gl/constants": "3.3.0-alpha.
|
|
34
|
-
"@kepler.gl/types": "3.3.0-alpha.
|
|
32
|
+
"@kepler.gl/common-utils": "3.3.0-alpha.8",
|
|
33
|
+
"@kepler.gl/constants": "3.3.0-alpha.8",
|
|
34
|
+
"@kepler.gl/types": "3.3.0-alpha.8",
|
|
35
35
|
"@loaders.gl/gis": "^4.4.1",
|
|
36
36
|
"@luma.gl/constants": "^9.3.2",
|
|
37
37
|
"@luma.gl/core": "^9.3.2",
|
|
@@ -40,17 +40,16 @@
|
|
|
40
40
|
"@turf/helpers": "^7.2.0",
|
|
41
41
|
"@types/d3-array": "^2.8.0",
|
|
42
42
|
"@types/keymirror": "^0.1.1",
|
|
43
|
-
"@types/lodash": "4.17.5",
|
|
44
43
|
"apache-arrow": ">=15.0.0",
|
|
45
44
|
"d3-array": "^2.8.0",
|
|
46
45
|
"d3-color": "^3.1.0",
|
|
47
46
|
"d3-format": "^2.0.0",
|
|
48
|
-
"d3-interpolate": "^
|
|
47
|
+
"d3-interpolate": "^3.0.1",
|
|
49
48
|
"decimal.js": "^10.2.0",
|
|
49
|
+
"es-toolkit": "^1.39.10",
|
|
50
50
|
"global": "^4.3.0",
|
|
51
51
|
"h3-js": "^4.4.0",
|
|
52
52
|
"keymirror": "^0.1.1",
|
|
53
|
-
"lodash": "4.17.23",
|
|
54
53
|
"mapbox-gl": "1.13.1",
|
|
55
54
|
"maplibre-gl": "^4.0.0",
|
|
56
55
|
"maplibregl-mapbox-request-transformer": "^0.0.2",
|
package/dist/cjs/noop.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports["default"] = noop;
|
|
7
|
-
// SPDX-License-Identifier: MIT
|
|
8
|
-
// Copyright contributors to the kepler.gl project
|
|
9
|
-
|
|
10
|
-
function noop() {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub29wIl0sInNvdXJjZXMiOlsiLi4vLi4vc3JjL25vb3AudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVFxuLy8gQ29weXJpZ2h0IGNvbnRyaWJ1dG9ycyB0byB0aGUga2VwbGVyLmdsIHByb2plY3RcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gbm9vcCgpIHtcbiAgcmV0dXJuO1xufVxuIl0sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQTtBQUNBOztBQUVlLFNBQVNBLElBQUlBLENBQUEsRUFBRztFQUM3QjtBQUNGIiwiaWdub3JlTGlzdCI6W119
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.simpleSearcher = simpleSearcher;
|
|
7
|
-
// SPDX-License-Identifier: MIT
|
|
8
|
-
// Copyright contributors to the kepler.gl project
|
|
9
|
-
|
|
10
|
-
/* eslint-disable callback-return */
|
|
11
|
-
function simpleSearcher(autofillValues, page, query, cb) {
|
|
12
|
-
var regex = new RegExp(query, 'i');
|
|
13
|
-
var foundQuery = false;
|
|
14
|
-
var matches = (autofillValues || []).filter(function _filter(item) {
|
|
15
|
-
var tag = item.name;
|
|
16
|
-
foundQuery = foundQuery || tag === query;
|
|
17
|
-
return tag && regex.test(tag);
|
|
18
|
-
});
|
|
19
|
-
if (cb) {
|
|
20
|
-
cb(matches);
|
|
21
|
-
}
|
|
22
|
-
return matches;
|
|
23
|
-
}
|
|
24
|
-
/* eslint-enable callback-return */
|
|
25
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzaW1wbGVTZWFyY2hlciIsImF1dG9maWxsVmFsdWVzIiwicGFnZSIsInF1ZXJ5IiwiY2IiLCJyZWdleCIsIlJlZ0V4cCIsImZvdW5kUXVlcnkiLCJtYXRjaGVzIiwiZmlsdGVyIiwiX2ZpbHRlciIsIml0ZW0iLCJ0YWciLCJuYW1lIiwidGV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lJLFVBQVUsR0FBRyxLQUFLO0VBQ3RCLElBQU1DLE9BQU8sR0FBRyxDQUFDUCxjQUFjLElBQUksRUFBRSxFQUFFUSxNQUFNLENBQUMsU0FBU0MsT0FBT0EsQ0FBQ0MsSUFBSSxFQUFFO0lBQ25FLElBQU1DLEdBQUcsR0FBR0QsSUFBSSxDQUFDRSxJQUFJO0lBQ3JCTixVQUFVLEdBQUdBLFVBQVUsSUFBSUssR0FBRyxLQUFLVCxLQUFLO0lBQ3hDLE9BQU9TLEdBQUcsSUFBSVAsS0FBSyxDQUFDUyxJQUFJLENBQUNGLEdBQUcsQ0FBQztFQUMvQixDQUFDLENBQUM7RUFFRixJQUFJUixFQUFFLEVBQUU7SUFDTkEsRUFBRSxDQUFDSSxPQUFPLENBQUM7RUFDYjtFQUVBLE9BQU9BLE9BQU87QUFDaEI7QUFDQSIsImlnbm9yZUxpc3QiOltdfQ==
|
package/dist/esm/noop.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright contributors to the kepler.gl project
|
|
3
|
-
|
|
4
|
-
export default function noop() {
|
|
5
|
-
return;
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJub29wIl0sInNvdXJjZXMiOlsiLi4vLi4vc3JjL25vb3AudHMiXSwic291cmNlc0NvbnRlbnQiOlsiLy8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IE1JVFxuLy8gQ29weXJpZ2h0IGNvbnRyaWJ1dG9ycyB0byB0aGUga2VwbGVyLmdsIHByb2plY3RcblxuZXhwb3J0IGRlZmF1bHQgZnVuY3Rpb24gbm9vcCgpIHtcbiAgcmV0dXJuO1xufVxuIl0sIm1hcHBpbmdzIjoiQUFBQTtBQUNBOztBQUVBLGVBQWUsU0FBU0EsSUFBSUEsQ0FBQSxFQUFHO0VBQzdCO0FBQ0YiLCJpZ25vcmVMaXN0IjpbXX0=
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: MIT
|
|
2
|
-
// Copyright contributors to the kepler.gl project
|
|
3
|
-
|
|
4
|
-
/* eslint-disable callback-return */
|
|
5
|
-
export function simpleSearcher(autofillValues, page, query, cb) {
|
|
6
|
-
var regex = new RegExp(query, 'i');
|
|
7
|
-
var foundQuery = false;
|
|
8
|
-
var matches = (autofillValues || []).filter(function _filter(item) {
|
|
9
|
-
var tag = item.name;
|
|
10
|
-
foundQuery = foundQuery || tag === query;
|
|
11
|
-
return tag && regex.test(tag);
|
|
12
|
-
});
|
|
13
|
-
if (cb) {
|
|
14
|
-
cb(matches);
|
|
15
|
-
}
|
|
16
|
-
return matches;
|
|
17
|
-
}
|
|
18
|
-
/* eslint-enable callback-return */
|
|
19
|
-
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJzaW1wbGVTZWFyY2hlciIsImF1dG9maWxsVmFsdWVzIiwicGFnZSIsInF1ZXJ5IiwiY2IiLCJyZWdleCIsIlJlZ0V4cCIsImZvdW5kUXVlcnkiLCJtYXRjaGVzIiwiZmlsdGVyIiwiX2ZpbHRlciIsIml0ZW0iLCJ0YWciLCJuYW1lIiwidGVzdCJdLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZWFyY2hlci11dGlscy50cyJdLCJzb3VyY2VzQ29udGVudCI6WyIvLyBTUERYLUxpY2Vuc2UtSWRlbnRpZmllcjogTUlUXG4vLyBDb3B5cmlnaHQgY29udHJpYnV0b3JzIHRvIHRoZSBrZXBsZXIuZ2wgcHJvamVjdFxuXG4vKiBlc2xpbnQtZGlzYWJsZSBjYWxsYmFjay1yZXR1cm4gKi9cbmV4cG9ydCBmdW5jdGlvbiBzaW1wbGVTZWFyY2hlcihhdXRvZmlsbFZhbHVlcywgcGFnZSwgcXVlcnksIGNiKSB7XG4gIGNvbnN0IHJlZ2V4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UsRUFBRTtJQUNOQSxFQUFFLENBQUNJLE9BQU8sQ0FBQztFQUNiO0VBRUEsT0FBT0EsT0FBTztBQUNoQjtBQUNBIiwiaWdub3JlTGlzdCI6W119
|
package/dist/noop.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export default function noop(): void;
|
package/dist/searcher-utils.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function simpleSearcher(autofillValues: any, page: any, query: any, cb: any): any;
|