import { type ComponentPropsWithRef } from 'react'; import { type UIStrings } from './Provider.js'; type KeyNames = UIStrings['keys']; /** Whether the keyboard is an Apple one, whose Command key does what Control does elsewhere. */ export declare function isApplePlatform(): boolean; /** A shortcut's platform: `apple` shows ⌘ ⌥ ⇧ ⌃ and takes Command for `Mod`; `other` names * the keys and takes Control. */ export type KeyPlatform = 'apple' | 'other'; /** The keys of a shortcut as its keycaps read: `Mod+K` is ⌘ K on an Apple keyboard and Ctrl K * elsewhere. A string is a combination joined by `+`; an array lists its keys as given, such * as `['[', ']']` or `['1–9']`. Pass `names` from the strings, so key names are localized. */ export declare function formatShortcut(keys: string | readonly string[], names?: KeyNames, platform?: KeyPlatform): string[]; /** A shortcut as one line of text, for a title or a sentence: ⌘K, or Ctrl+K. */ export declare function shortcutText(keys: string | readonly string[], names?: KeyNames, platform?: KeyPlatform): string; /** The `aria-keyshortcuts` value for a combination: `Mod+K` is `Meta+K` on an Apple keyboard * and `Control+K` elsewhere. Set it on the control the shortcut presses. */ export declare function ariaKeyShortcuts(keys: string, platform?: KeyPlatform): string; /** The keys of a keyboard event a shortcut is matched against: a DOM event or React's. */ export interface ShortcutKeyEvent { key: string; code: string; metaKey: boolean; ctrlKey: boolean; altKey: boolean; shiftKey: boolean; } /** Whether a key press is the combination, written as for `formatShortcut`: `Mod+K`, * `Shift+Enter`, `Backspace`, `A`. The modifiers must be exactly those named. */ export declare function matchesShortcut(event: ShortcutKeyEvent, keys: string, platform?: KeyPlatform): boolean; /** `formatShortcut` and `shortcutText` in the host's key names. */ export declare function useShortcutFormat(platform?: KeyPlatform): { format: (keys: string | readonly string[]) => string[]; text: (keys: string | readonly string[]) => string; }; export type KbdVariant = 'keycap' | 'plain'; export type KbdSize = 'xs' | 'sm'; /** Any other attribute and the ref reach the outer ``, so it can be a Tooltip's or a popover's * direct child. */ export interface KbdProps extends Omit, 'children' | 'className'> { /** A combination joined by `+`, such as `Mod+K` (Command on an Apple keyboard, Control * elsewhere) or `Shift+Enter`; or keys side by side, as given: `['↑', '↓']`, `['1–9']`. */ keys: string | readonly string[]; /** `keycap`, the default, draws each key; `plain` is muted text, for a menu row. */ variant?: KbdVariant | undefined; /** `xs` (16px, 10px text) for a hint inside a row or a field; `sm` (18px, 11px) otherwise. */ size?: KbdSize | undefined; /** Which keyboard to show the keys for; the reader's own by default. */ platform?: KeyPlatform | undefined; className?: string | undefined; } /** Keys to press, as keycaps: a muted fill, a hairline border and monospace text. Off an * Apple keyboard the keys of a combination are joined with a plus, as the platform writes * them. Renders ``, with a `` for each key of a combination. */ export declare function Kbd({ keys, variant, size, platform, className, ...rest }: KbdProps): import("react").JSX.Element; export {};