UNPKG

kepler.gl

Version:

kepler.gl is a webgl based application to visualize large scale location data in the browser

117 lines (116 loc) 3.56 kB
/** * Generate a hash string based on number of character * @param {number} count * @returns {string} hash string */ export declare function generateHashId(count?: number): string; /** * Generate a hash string based on string * @param str * @returns */ export declare function generateHashIdFromString(str: string): string; /** * Detect chrome * @returns {boolean} - yes or no */ export declare function isChrome(): boolean; /** * Capitalize first letter of a string * @param {string} str * @returns {string} */ export declare function capitalizeFirstLetter(str: any): any; /** * Convert camel style names to title * strokeColor -> Stroke Color * @param {string} str * @returns {string} */ export declare function camelToTitle(str: string): string; /** * Convert names to camel style * Stroke Color -> strokeColor * @param {string} str * @returns {string} */ export declare const camelize: (str: string) => string; /** * Converts non-arrays to arrays. Leaves arrays alone. Converts * undefined values to empty arrays ([] instead of [undefined]). * Otherwise, just returns [item] for non-array items. * * @param {*} item * @returns {array} boom! much array. very indexed. so useful. */ export declare function toArray<T>(item: T | T[]): T[]; /** * immutably insert value to an Array or Object * @param {Array|Object} obj * @param {Number|String} key * @param {*} value * @returns {Array|Object} */ export declare const insertValue: <T extends object | any[]>(obj: T, key: number | string, value: any) => T; /** * check if value is a loose object including a plain object, array, function * @param {*} value */ export declare function isObject(value: any): boolean; /** * whether is an object * @returns {boolean} - yes or no */ export declare function isPlainObject(obj: unknown): obj is Record<string, unknown>; /** * Immutable version of _.set * @param {Array<String|Number>} path * @param {*} value * @param {Object} obj * @returns {Object} */ export declare const set: <T extends object | any[]>(path: (string | number)[], value: any, obj: T) => T; declare type ErrorObject = { error?: any; err?: any; message?: any; }; /** * Get error information of unknown type * Extracts as much human readable information as possible * Ensure result is an Error object suitable for throw or promise rejection * * @private * @param {*} err - Unknown error * @return {string} - human readable error msg */ export declare function getError(err?: Error | ErrorObject | string): string; export declare function arrayInsert<T>(arr: T[], index: number, val: T): T[]; export declare function hasMobileWidth(breakPointValues: { palm: number; desk: number; }): boolean; export declare function hasPortableWidth(breakPointValues: { palm: number; desk: number; }): boolean; export declare function isTest(): boolean; /** * Filters an object by an arbitrary predicate * Returns a new object containing all elements that match the predicate * @param {Object} obj Object to be filtered * @param {Function} predicate Predicate by which the object will be filtered * @returns {Object} */ export declare function filterObjectByPredicate(obj: any, predicate: any): {}; export declare function isFunction(func: any): boolean; export declare function findById(id: string): <X extends { id: string; }>(arr: X[]) => X | undefined; /** * Returns array difference from */ export declare function arrayDifference<X extends { id: string; }>(source: X[]): (compare: X[]) => X[]; export {};