kepler.gl
Version:
kepler.gl is a webgl based application to visualize large scale location data in the browser
50 lines (49 loc) • 2.14 kB
TypeScript
import * as arrow from 'apache-arrow';
import { Loader } from '@loaders.gl/loader-utils';
import { AddDataToMapPayload, Feature } from '@kepler.gl/types';
import { FeatureCollection } from '@turf/helpers';
import { FileCacheItem, ValidKeplerGlMap } from './types';
export declare type ProcessFileDataContent = {
data: unknown;
fileName: string;
length?: number;
progress?: {
rowCount?: number;
rowCountInBatch?: number;
percent?: number;
};
/** metadata e.g. for arrow data, metadata could be the schema.fields */
metadata?: Map<string, string>;
};
/**
* check if table is an ArrowTable object
* @param table - object to check
* @returns {boolean} - true if table is an ArrowTable object type guarded
*/
export declare function isArrowTable(table: any): table is arrow.Table;
/**
* check if data is an ArrowData object, which is an array of RecordBatch
* @param data - object to check
* @returns {boolean} - true if data is an ArrowData object type guarded
*/
export declare function isArrowData(data: any): boolean;
export declare function isGeoJson(json: unknown): json is Feature | FeatureCollection;
export declare function isFeature(json: unknown): json is Feature;
export declare function isFeatureCollection(json: unknown): json is FeatureCollection;
export declare function isRowObject(json: any): boolean;
export declare function isKeplerGlMap(json: unknown): json is ValidKeplerGlMap;
export declare function makeProgressIterator(asyncIterator: AsyncIterable<any>, info: {
size: number;
}): AsyncGenerator;
export declare function readBatch(asyncIterator: AsyncIterable<any>, fileName: string): AsyncGenerator;
export declare function readFileInBatches({ file, loaders, loadOptions }: {
file: File;
fileCache: FileCacheItem[];
loaders: Loader[];
loadOptions: any;
}): Promise<AsyncGenerator>;
export declare function processFileData({ content, fileCache }: {
content: ProcessFileDataContent;
fileCache: FileCacheItem[];
}): Promise<FileCacheItem[]>;
export declare function filesToDataPayload(fileCache: FileCacheItem[]): AddDataToMapPayload[];