import{type PropertyValues,type TemplateResult}from'lit';import{LyraElement}from'../../../internal/lyra-element.js'; /** A single rendered key token: the compact glyph shown in the key cap, and * the spelled-out word used in the chip's `aria-label` (glyphs like `⌘`/ * `⇧`/`⌥` are not reliably announced across every screen reader/platform * combination, so the accessible name always spells them out in full). */ export interface KbdKeyLabel{visual:string;word:string;} /** Platform vocabulary used to resolve the platform-neutral `mod` and `alt` shortcut tokens. */ export type KbdPlatform='auto'|'mac'|'windows'|'linux'; /** Concrete platform produced after resolving `platform="auto"`. */ export type EffectiveKbdPlatform=Exclude; /** Resolves a localization key to its localized text, falling back to * `fallback` (the built-in English default) when no override applies -- * matches `LyraElement.localize()`'s own `(key, fallback)` shape, so a * component can pass `(key, fallback) => this.localize(key, fallback)` * directly. */ export type KbdLocalize=(key:string,fallback:string)=>string; /** * Resolves one `+`-separated token of a `keys` string to its rendered glyph * and spelled-out word, given whether the shortcut is being shown on macOS. * * The platform and localization inputs are explicit so the function remains * deterministic for callers and preserves the built-in English defaults when * no localization function is supplied. */ export declare function shortcutTokenLabel(rawToken:string,isMac:boolean,localize?:KbdLocalize):KbdKeyLabel; /** Splits a `keys` string (e.g. `'mod+shift+p'`) into its resolved token * labels, dropping empty segments from stray/leading/trailing `+`s. */ export declare function parseShortcut(keys:string,isMac:boolean,localize?:KbdLocalize):KbdKeyLabel[]; /** * `` — a small chip representing a keyboard shortcut, rendering * the platform-appropriate glyph for cross-platform modifier keys (⌘ on * macOS, "Ctrl" elsewhere) from a single platform-neutral `keys` string. * * `keys` is a `+`-separated sequence of tokens, e.g. `"mod+k"` or * `"mod+shift+p"`. Recognized modifier tokens: `mod` (the platform-neutral * primary modifier — ⌘ on macOS, "Ctrl" elsewhere), `alt` (⌥ / "Alt"), * `shift` (⇧ on every platform), and `ctrl` (always the literal Control * key, distinct from `mod`, for a shortcut that's specifically Ctrl even on * macOS). Any other token renders as typed, except a bare single * letter/digit which is upper-cased, with a small built-in map of friendly * labels for common named keys (`enter` → `↵`, `esc` → "Esc", the four * arrow keys → arrow glyphs, plus `tab`/`space`/`backspace`/`delete`/`home`/ * `end`/`pageup`/`pagedown`/`plus`/`minus`). `enter` renders as its `↵` * glyph (not the word "Enter") to match the other single-glyph modifier/ * arrow keys visually — its spelled-out word form still appears in the * computed `aria-label`. * * Each token renders as its own key cap (`part="key"`); consecutive caps * are joined by a small "+" separator between them, matching how most * cross-platform shortcut documentation (including on macOS, despite the * OS's own native shortcut hints usually running the glyphs together with * no separator) reads unambiguously regardless of how many/which glyphs are * involved. * * The default slot is not used for the normal glyph rendering above — it's * an escape hatch for fully custom content (e.g. an icon instead of a text * glyph) that, when non-empty, replaces the `keys`-driven rendering. * A host `aria-label` names that custom shortcut as one `role="img"` unit; * without one, the slotted content continues to own its own semantics. * * Removing keys safely clears the shortcut. Unknown tokens, including constructor and __proto__, render and name themselves verbatim; recognized modifiers keep their localized labels. * * @customElement lr-kbd * @slot - Optional override for fully custom key-cap content, replacing the * `keys`-driven rendering. Leave empty to use `keys`. * @csspart base - The chip's root element. * @csspart key - Each rendered key cap (one per token in `keys`). * @status stable * @since 4.0.0 */ export declare class LyraKbd extends LyraElement{static styles:import("lit").CSSResultGroup[]; /** A `+`-separated shortcut, e.g. `'mod+k'`. See the class doc for the * full token grammar. */ keys:string; /** Platform used for the platform-neutral `mod` and `alt` tokens. `auto` performs browser * detection; an explicit value is deterministic across browsers, SSR, screenshots, and tests. */ platform:KbdPlatform;private autoPlatform; /** The concrete, serializable platform currently used to render the shortcut. */ get effectivePlatform():EffectiveKbdPlatform;private hasCustomContent;protected willUpdate(changed:PropertyValues):void;private onSlotChange;render():TemplateResult;}declare global{interface HTMLElementTagNameMap{'lr-kbd':LyraKbd;}}