import { ClientConnection } from 'message-event-channel'; import { HandlerContainer } from './handler-container'; export declare const KEY = "visualization-sdk:locale"; export declare enum LOCALE_EVENTS { GET = "visualization-sdk:locale:get", CHANGE = "visualization-sdk:locale:change" } export declare type LocaleModel = string | null; export declare type LocaleChangeHandler = (locale: LocaleModel) => void; export declare type LocaleChangeDispose = () => void; /** * Locale class allows you to get the currently selected locale in the form and watch for changes to asynchronously update your application */ export declare class Locale { connection: ClientConnection; changeHandlerContainer: HandlerContainer; constructor(connection: ClientConnection); /** * Get the current locale selected in visualization settings * * ### Example * * ```typescript * const value = await visualization.locale.get(); * * console.log(value) * ``` */ get(): Promise; /** * Sets up a listener for when the visualization locale changes. * * @param cb - callback function to be called when the visualization locale changes. * * @returns a dispose function which removes the listener * * ### Example * * ```typescript * const dispose = visualization.locale.changed((model) => { * // handle locale change * }) * ``` */ changed(cb: LocaleChangeHandler): LocaleChangeDispose; }