import { EventEmitter } from '../../stencil-public-runtime'; import { Language } from '../../utils/common/language-types'; import { HeaderLanguageToggleEventDetails } from '../../utils/events/common-events.interface'; export type BackMode = 'history' | 'href' | 'event'; /** * Ontario Back Button renders a consistent, accessible back action shell. * * This component is intentionally navigation-strategy agnostic. * Consumers choose whether back behaviour uses browser history, explicit href navigation, or event-only routing. * * For component guidance, see: * - https://designsystem.ontario.ca/components/detail/back-button.html * - https://designsystem.ontario.ca/developer-docs/components/ontario-back-button/ */ export declare class OntarioBackButton { host: HTMLElement; /** * Optional visible text override for the back action. * If not provided, translated defaults are used: * - `Back` for English * - `Retour` for French */ label?: string; /** * The language of the component. * If no language is passed, it defaults to English (`en`). */ language?: Language; /** * Optional destination URL used by href mode. */ href?: string; /** * Optional navigation strategy override: * - `history`: emits event, then calls browser history back. * - `href`: emits event, then navigates using `href`. * - `event`: emits event only. * * When omitted, runtime mode is inferred: * - uses `href` mode if `href` exists * - otherwise defaults to `history` */ backMode?: BackMode; /** * Disables user interaction. * * Policy note: * This is intended for temporary/transient states only (for example, save-in-progress or * step-transition lock), not as a general-purpose way to gate back navigation in normal usage. * Whether going back is actually valid should be determined by application logic/validation * before this prop is ever set to `true`, not used as a substitute for that validation. */ disabled?: boolean; /** * Emitted when the user activates the back control. * Emitted before navigation when applicable. */ backClick: EventEmitter; translations: any; /** * Validates that href mode has the required href prop. * * Runs whenever `backMode` or `href` changes. * If `backMode` is set to `'href'` without providing an `href` prop, * logs a developer warning and the component falls back to button rendering with event-only emission. */ validateConfiguration(): void; /** * This listens for the `setAppLanguage` event sent from the test language toggler when it is connected to the DOM. * It is used for the initial language when the component loads. */ handleSetAppLanguage(event: CustomEvent): void; /** * Handles an update to language from the global header language toggle event. */ handleHeaderLanguageToggled(event: CustomEvent): void; componentWillLoad(): void; /** * Resolves which navigation mode to use at runtime. * * If `backMode` is explicitly provided (attribute or property), that value wins. * Otherwise, `href` implies link mode; missing `href` falls back to history mode. */ private get resolvedBackMode(); /** * Computes the visible back label. * * Uses the `label` prop when provided; otherwise falls back to * language-based defaults from translations. */ private get labelText(); /** * Handles user activation for both button and link render paths. * * Emits `backClick` first, then applies mode-specific behaviour: * - `event`: emit only * - `history`: call `window.history.back()` * - `href`: allow native link navigation when href exists */ private handleActivation; /** * Handles the Space key on the anchor render path. * * Native `` elements only activate on Enter (which triggers a native `click` * event and is handled by `handleActivation` via `onClick`); unlike `