/** * Some of the code borrows from leaflet * https://github.com/Leaflet/Leaflet/tree/master/src/core */ declare class Util { /** * 生成范围随机数 * @Min 最小值 * @Max 最大值(包括) */ static getRandomNum(Min: any, Max: any): number; /** * Generates uuid * @param prefix * @returns {string} */ static uuid(prefix?: string): string; /** * Merges the properties of the `src` object (or multiple objects) into `dest` object and returns the latter. * @param dest * @param sources * @returns {*} */ static merge(dest: any, ...sources: any[]): any; /** * @function splitWords(str: String): String[] * Trims and splits the string on whitespace and returns the array of parts. * @param {*} str */ static splitWords(str: any): any; /** * @function setOptions(obj: Object, options: Object): Object * Merges the given properties to the `options` of the `obj` object, returning the resulting options. See `Class options`. * @param {*} obj * @param {*} options */ static setOptions(obj: any, options: any): any; /** * @function formatNum(num: Number, digits?: Number): Number * Returns the number `num` rounded to `digits` decimals, or to 6 decimals by default. * @param num * @param digits * @returns {number} */ static formatNum(num: any, digits: any): number; /** * @function trim(str: String): String * Compatibility polyfill for [String.prototype.trim](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String/Trim) * @param {*} str */ static trim(str: any): any; /** * Data URI string containing a base64-encoded empty GIF image. * Used as a hack to free memory from unused images on WebKit-powered * mobile devices (by setting image `src` to this string). * @returns {string} */ static emptyImageUrl(): string; /** * @function checkPosition(position: Object): Boolean * Check position for validity * @param {*} position */ static checkPosition(position: any): any; /** * Creates a debounced function that delays invoking `fn` until after `delay` * @param fn * @param delay * @returns {function(): void} */ static debounce(fn: any, delay: any): () => void; /** * Creates a throttled function that only invokes `fn` at most once per * @param fn * @param delay * @returns {function(): void} */ static throttle(fn: any, delay: any): () => boolean; /** * * @param dataUrl * @returns {Blob} */ static dataURLtoBlob(dataUrl: any): Blob; /** * * @param {*} obj * @returns */ static isPromise(obj: any): boolean; /** * 进入全屏 * @param element 全屏要素容器,默认为整个页面 */ static requestFullScreen(el?: any | Element): void; /** * 退出全屏 */ static exitFullScreen(): void; } export default Util;