/** @import { DataDrivenPropertyValueSpecification as PropertyValue, ExpressionSpecification as Expression, LayerSpecification, Var } from 'maplibre-gl' */
/**
 * Returns a list of languages as a comma-delimited string from the given URL hash.
 * @param {URL | Location} url
 */
export function getLanguageFromURL(url: URL | Location): string | null;
/**
 Returns an array of the language tags related to the given language tag, sorted from most specific to least specific.
 
 @param {string} tag - The language tag that the returned language tags are related to.
 @returns {string[]} A sorted array of related language tags, or an empty array if `tag` is malformed.
 */
export function getRelatedLanguageTags(tag: string): string[];
/**
 * Returns the languages that the user prefers.
 */
export function getLocales(): string[];
/**
 * Returns a `coalesce` expression that resolves to the feature's name in a
 * language that the user prefers.
 *
 * @param {string[]} locales - Locales of the name fields to include.
 * @param {object} options
 * @param {boolean} [options.includesLegacyFields] - Whether to include the older fields
 *  that include underscores, for layers that have not transitioned to the
 *  colon syntax.
 * @param {string} [options.unlocalizedNameProperty] - The name of the property holding the unlocalized name.
 * @param {string} [options.localizedNamePropertyFormat] - The format of properties holding localized names, where `$1` is replaced by an IETF language tag.
 * @returns {Expression}
 */
export function getLocalizedNameExpression(locales: string[], options?: {
    includesLegacyFields?: boolean | undefined;
    unlocalizedNameProperty?: string | undefined;
    localizedNamePropertyFormat?: string | undefined;
}): Expression;
/**
 * Mutates a `let` expression to have a new value for the variable by the given name, binding the variable if it isn’t already bound to any value.
 *
 * @param {PropertyValue<string> | undefined} letExpr - Expression to update.
 * @param {string} variable - Name of the variable to set.
 * @param {*} value - The variable's new value.
 */
export function updateVariable(letExpr: PropertyValue<string> | undefined, variable: string, value: any): void;
/**
 * Recursively walks an expression, returning a copy of the subexpression after replacing any reference to a specific feature property with a new value in place.
 *
 * @param {Expression} expression - The expression to transform.
 * @param {string} propertyName - The name of the feature property to look for.
 * @param {*} replacement - The replacement value.
 * @returns {Expression | undefined} The same array as `expression` if `expression` referred to `propertyName`, or `undefined` if `expression` did not refer to `propertyName`.
 */
export function replacePropertyReferences(expression: Expression, propertyName: string, replacement: any): Expression | undefined;
/**
 * Transforms a layer’s `text-field` layout property so that it can be localized by `localizeLayers` later on.
 *
 * The transformed `text-field` property is only modified if it contains a reference to the feature property specified by `unlocalizedNameProperty`. If the layer’s `symbol-placement` layout property is set to either `line` or `line-center`, the resulting text field takes up only one line. Otherwise, the text field for a given feature may span multiple lines if its unlocalized name property is set to a list of values.
 *
 * @param {LayerSpecification} layer - The style layer to prepare for localization.
 * @param {string} [unlocalizedNameProperty] - The name of the feature property that holds the unlocalized name. References to this property are replaced by a more complex expression that can be localized dynamically.
 * @param {boolean} [glossLocalNames] - Whether to format each label as a dual language label including a local name gloss.
 */
export function prepareLayer(layer: LayerSpecification, unlocalizedNameProperty?: string, glossLocalNames?: boolean): void;
/**
 * Updates localizable variables at the top level of each layer's `text-field` expression based on the given locales.
 *
 * @param {LayerSpecification[]} layers - The style layers to localize.
 * @param {string[]} locales - The locales to insert into each layer.
 * @param {object} options
 * @param {string} [options.unlocalizedNameProperty] - The name of the property holding the unlocalized name.
 * @param {string} [options.localizedNamePropertyFormat] - The format of properties holding localized names, where `$1` is replaced by an IETF language tag.
 */
export function localizeLayers(layers: LayerSpecification[], locales?: string[], options?: {
    unlocalizedNameProperty?: string | undefined;
    localizedNamePropertyFormat?: string | undefined;
}): void;
/**
 * Returns an expression interpreting the given string as a list of tag values,
 * pretty-printing the standard semicolon delimiter with the given separator.
 *
 * https://wiki.openstreetmap.org/wiki/Semi-colon_value_separator
 *
 * The returned expression can be complex, so use it only once within a property
 * value. To reuse the evaluated value, bind it to a variable in a let
 * expression.
 *
 * @param {Expression} valueList A semicolon-delimited list of values.
 * @param {string | Expression} separator A string to insert between each value, or an expression that
 *  evaluates to this string.
 * @param {string | Expression} [valueToOmit]
 * @returns {Expression}
 */
export function listValuesExpression(valueList: Expression, separator: string | Expression, valueToOmit?: string | Expression): Expression;
/**
 * Returns a table of country names in the user’s preferred language by ISO 3166-1 alpha-3 code.
 *
 * @param {string[]} locales - The locales for formatting the country names.
 * @param {object} options
 * @param {boolean} [options.uppercase] Whether to write the country names in all uppercase, respecting the locale’s case conventions.
 */
export function getLocalizedCountryNames(locales: string[], options?: {
    uppercase?: boolean | undefined;
}): {
    [k: string]: string | undefined;
};
/**
 * Returns the global state that Diplomat needs to fully localize the style.
 *
 * @param {string[]} locales - The locales for formatting the country names.
 * @param {object} options
 * @param {boolean} [options.uppercaseCountryNames] Whether to write country names in all uppercase, respecting the locale’s case conventions.
 */
export function getGlobalStateForLocalization(locales: string[], options?: {
    uppercaseCountryNames?: boolean | undefined;
}): {};
/**
 * Returns an expression that converts the given country code to a human-readable name in the user's preferred language.
 *
 * @param {Expression} code An expression that evaluates to an ISO 3166-1 alpha-3 country code.
 * @returns {Expression}
 */
export function getLocalizedCountryNameExpression(code: Expression): Expression;
/**
 * Updates each style layer's `text-field` value to match the given locales, upgrading any unlocalizable layer along the way.
 *
 * This method ugprades unlocalizable layers to localized multiline or inline labels depending on the `symbol-placement` layout property. To add a dual language label to a layer, set its `text-field` layout property manually using the `localizedNameWithLocalGloss` constant.
 *
 * If neither `options.layers` nor `options.sourceLayers` is specified, this function makes localizable any style layer that gets the feature property specified in `options.unlocalizedNameProperty`, or `name` by default.
 *
 * @param {maplibregl.Map} map - The map to localize.
 * @param {string[]} locales - The locales to insert into each layer.
 * @param {object} options
 * @param {string[]} [options.layers] - The style layers with these IDs will be made localizable.
 * @param {string[]} [options.sourceLayers] - The style layers that use these source layers will be made localizable. These are source layer IDs, not style layer IDs.
 * @param {string} [options.unlocalizedNameProperty] - The name of the property holding the unlocalized name.
 * @param {string} [options.localizedNamePropertyFormat] - The format of properties holding localized names, where `$1` is replaced by an IETF language tag.
 * @param {boolean} [options.glossLocalNames] - Whether to format each label as a dual language label including a local name gloss.
 * @param {boolean} [options.uppercaseCountryNames] Whether to write country names in all uppercase, respecting the locale’s case conventions.
 */
export function localizeStyle(map: maplibregl.Map, locales?: string[], options?: {
    layers?: string[] | undefined;
    sourceLayers?: string[] | undefined;
    unlocalizedNameProperty?: string | undefined;
    localizedNamePropertyFormat?: string | undefined;
    glossLocalNames?: boolean | undefined;
    uppercaseCountryNames?: boolean | undefined;
}): void;
/**
 * The names in the user's preferred language, each on a separate line.
 * @type {Expression}
 */
export const localizedName: Expression;
/**
 * The names in the user's preferred language, all on the same line.
 * @type {Expression}
 */
export const localizedNameInline: Expression;
/**
 * The name in the user's preferred language, followed by the name in the local
 * language in parentheses if it differs.
 * @type {Expression}
 */
export const localizedNameWithLocalGloss: Expression;
import type { ExpressionSpecification as Expression } from 'maplibre-gl';
import type { DataDrivenPropertyValueSpecification as PropertyValue } from 'maplibre-gl';
import type { LayerSpecification } from 'maplibre-gl';
