import { EventEmitter } from '../../stencil-public-runtime'; import { Language } from '../../utils/common/language-types'; import { HeaderLanguageToggleEventDetails } from '../../utils/events/common-events.interface'; /** * Ontario Language Toggle switches the interface between supported languages. * * For component guidance, see: * - https://designsystem.ontario.ca/developer-docs/components/ontario-language-toggle/ */ export declare class OntarioLanguageToggle { /** * The language of the component. * * In most cases, the language toggle should be the source of truth for determining the site language. * * Only pass a language value here if necessary. */ language?: Language; /** * The size of the language toggle button. * * If no prop is passed, it will be set to the `default` size. */ size?: 'default' | 'small'; /** * The URL to change to when the language toggle button is clicked. * * This is optional. */ url?: string; /** * A custom function to pass to the language toggle button. * * This is optional. */ customLanguageToggle?: (event: globalThis.Event) => void; translations: any; /** * Internal state used as the source of truth for component language. */ private languageState; /** * Internal state used to render the text on the language toggle UI. */ private oppositeLanguageLabel; /** * Updates the language and languageState props when changes to the language prop are detected. */ updateLanguage(): void; /** * Event that fires during the setAppLanguageHandler() method. * * The event contains the current language (after language logic has already occurred). */ setAppLanguage: EventEmitter; /** * Event that fires when the language toggle is pressed/clicked. * * The event contains the oldLanguage along with the newLanguage. */ headerLanguageToggled: EventEmitter; /** * This function sets the languageState (if not already set). * * It also emits the setAppLanguage() event, updates the component language label, and * updates the tag lang attribute with the languageState value. * * It gets called by the connectedCallback() component lifecycle hook, and by the * updateLanguage() method, which is fired on the watch for the language prop. */ private setAppLanguageHandler; /** * An event that emits to other components that the language toggle button has been toggled. * * @param {Language} oldLanguage - The language prior to the language toggle being pressed. * @param {globalThis.Event} event - event that triggered the function (e.g. onclick). */ private handleHeaderLanguageToggled; /** * Prints a warning message to the console about using an incorrect language for the component. * * @param {string} lang - The incorrect language that was received. * @param {string} type - prop/document | Where the incorrect language is coming from. */ private showLanguageWarning; /** * Returns abbreviated text for the opposite language. * * @returns {Language} */ private getOppositeLanguageAbbrievation; /** * Returns full word text for the opposite language. * * @returns {string} */ private getOppositeLanguageFullWord; private updateHTMLLang; /** * Component life cycle hook. * * https://stenciljs.com/docs/component-lifecycle#connectedcallback */ connectedCallback(): void; /** * Component life cycle hook. * * https://stenciljs.com/docs/component-lifecycle#componentdidload */ componentDidLoad(): void; render(): any; }