UNPKG

bcgis-type

Version:

The SDK is based on Cesium for secondary development of 2, 3D all-in-one WebGis application framework, the framework optimizes the use of Cesium and add some additional features, designed for developers to quickly build WebGis applications.

74 lines (73 loc) 2.09 kB
/** * 工具类 */ declare class Util { /** * 创建uuid * @param prefix 前缀,默认为 D * @returns {string} */ static uuid(prefix?: string): string; /** * 属性合并 * @param dest 目标对象 * @param sources 需要合并的属性 * @returns 目标对象 */ static merge(dest: Object, ...sources: Array<any>): any; /** * 按空格分割字符串 * @param str 需要被分割的字符串 */ static splitWords(str: any): string[]; /** * 将给定的属性合并到`obj`对象的`options`属性中,返回结果`options` * @param {*} obj * @param {*} options */ static setOptions(obj: any, options: any): any; /** * 返回四舍五入到指定小数位的数字,默认情况下返回到6位小数。 * @param num 数字 * @param digits 小数位数 * @returns */ static formatNum(num: number, digits: number): number; /** * 去除字符串中的空格 * @param {*} str */ static trim(str: any): any; /** * 创建空图片 * @returns Base64编码格式的图片 */ static emptyImageUrl(): string; /** * * 检查Position是否有效 * @param position */ static checkPosition(position: Object): boolean; /** * 对函数进行防抖处理,调用函数后将在设置时间后执行 * @param fn * @param delay * @returns {function(): void} */ static debounce(fn: () => void, delay: number): () => void; /** * 创建一个限制函数,该函数每次最多只能调用一次 * @param fn 函数 * @param delay 调用间隔 * @returns {function(): void} */ static throttle(fn: () => void, delay: number): () => void; /** * 将Base64编码的数据转换为二进制数据 * @param dataUrl Base64编码的数据 * @returns */ static dataURLtoBlob(dataUrl: string): Blob; } export default Util;