import { Sprite, Symbolizer, TextSymbolizer } from 'geostyler-style'; import { MapboxRef } from '../MapboxStyleParser'; declare class MapboxStyleUtil { static getResolutions(): number[]; static getScaleForResolution(resolution: number): number; static getZoomForResolution(resolution: number): number; /** * Calculates the appropriate map resolution for a given scale in the given * units. * * See: https://gis.stackexchange.com/questions/158435/ * how-to-get-current-scale-in-openlayers-3 * * @method * @param {number} scale The input scale to calculate the appropriate * resolution for. * @return {number} The calculated resolution. */ static getResolutionForScale(scale: number): number; static zoomToScale(zoom: number): number; /** * Checks if all keys of an object are undefined. * Returns true if so. * * @param obj The object to be checked */ static allUndefined(obj: any): boolean; /** * Checks if all keys of a Symbolizer are undefined except 'kind'. * * @param symbolizer A GeoStylerStyle Symbolizer */ static symbolizerAllUndefined(symbolizer: Symbolizer | TextSymbolizer): boolean; /** * Replaces the mapbox api placeholder with its actual url. * * @param url URL */ static getUrlForMbPlaceholder(url: string): string; /** * Replaces the actual mapbox url with its api placeholder. * * @param url URL */ static getMbPlaceholderForUrl(url: string): string; /** * Resolves a mapbox text-field placeholder string to a geostyler-style * placeholder string. I.e. replaces {varname} with {{varname}}. * * @param template Template string that should be resolved */ static resolveMbTextPlaceholder(template: string): string; static getSpriteName(sprite: Sprite, metadata: MapboxRef): string; /** * Splits a RGBA encoded color into its color values. * * @param {string} rgbaColor RGB(A) encoded color * @return {number[]} Numeric color values as array */ static splitRgbaColor(rgbaColor: string): number[]; /** * Returns the hex code for a given RGB(A) array. * * @param colorArr RGB(A) array. e.g. [255,0,0] * @return {string} The HEX color representation of the given color */ static getHexCodeFromRgbArray(colorArr: number[]): string; /** * Transforms a RGB(A) or named color value to a HEX encoded notation. * If a HEX color is provided it will be returned untransformed. * * @param {string} inColor The color to transform * @return {string | undefined} The HEX color representation of the given color */ static getHexColor(inColor: string): string | undefined; } export default MapboxStyleUtil;