type KunShortcutPlatform = 'apple' | 'other'; /** Keys whose spoken name comes from the locale (`kbd.`) rather than * from the label: a glyph such as ⌘ or ↑, or an abbreviation such as Esc. */ type KunKbdKeyName = 'control' | 'alt' | 'option' | 'shift' | 'command' | 'meta' | 'enter' | 'escape' | 'backspace' | 'delete' | 'tab' | 'space' | 'up' | 'down' | 'left' | 'right' | 'pageUp' | 'pageDown' | 'home' | 'end' | 'plus'; interface KunShortcutKey { /** Canonical key: `Control`, `Alt`, `Shift`, `Meta`, `Enter`, `ArrowUp`, `K`, `+`… */ key: string; /** What the key shows on this platform: `⌘`, `Ctrl`, `K`. */ label: string; /** The locale key (under `kbd`) a screen reader hears instead of `label`; * null when the label reads as itself (a letter, a digit, F5). */ spoken: KunKbdKeyName | null; } /** Parse a shortcut into its chords of canonical key names, `Mod` unresolved: * `'Shift+cmd+Z'` → `[['Shift', 'Meta', 'Z']]`, `'G G'` → `[['G'], ['G']]`. */ declare const parseKunShortcut: (keys: string) => string[][]; /** Resolve a shortcut for one platform: `Mod` becomes Meta on Apple and * Control elsewhere, repeated modifiers collapse, modifiers are sorted into * the platform's order, and every key carries its label and spoken name. */ declare const resolveKunShortcut: (keys: string, platform: KunShortcutPlatform) => KunShortcutKey[][]; /** One-line form, as a menu shows it: `⇧⌘Z` on Apple (no joiner, the macOS * menu convention) and `Ctrl+Shift+Z` elsewhere; chords of a sequence are * separated by a space. */ declare const formatKunShortcut: (keys: string, platform: KunShortcutPlatform) => string; /** What a screen reader should hear: `Command Shift Z`, chords of a sequence * joined by the locale's "then". `name` maps a spoken key to its word. */ declare const speakKunShortcut: (sequence: KunShortcutKey[][], name: (key: KunKbdKeyName) => string, then: string) => string; interface KunMessages { alert: { title: string; confirm: string; cancel: string; }; autocomplete: { clear: string; loading: string; noResult: string; }; avatar: { unknownUser: string; }; /** `{count}` — number of users in the group. */ avatarGroup: { label: string; }; banner: { label: string; close: string; }; /** `goto` takes `{index}`, the 1-based slide number. */ carousel: { label: string; prev: string; next: string; nav: string; goto: string; }; /** The KunChat* components. `senderPrefix` takes `{name}` and includes its * punctuation, as does `draft`; `album`, `scrollToBottomUnread`, * `unreadCount` and `members` take `{count}`; `photoFrom` takes `{name}`; `openLink` takes * `{url}`; `reactionCount` takes `{label}` and `{count}`. */ chat: { deletedUser: string; you: string; senderPrefix: string; today: string; yesterday: string; unreadDivider: string; edited: string; deletedMessage: string; photo: string; album: string; media: string; draft: string; messages: string; empty: string; loading: string; scrollToBottom: string; scrollToBottomUnread: string; unreadCount: string; mentioned: string; pinned: string; muted: string; photoFrom: string; openLink: string; reactions: string; reactionCount: string; back: string; members: string; }; /** `replyTo` and `quoteFrom` take `{name}`; `remaining` and `overLimit` * take `{count}`. */ chatComposer: { placeholder: string; send: string; save: string; attach: string; removeAttachment: string; retryAttachment: string; replyTo: string; quoteFrom: string; editing: string; cancelReply: string; cancelEdit: string; remaining: string; overLimit: string; dropHint: string; }; chatMenu: { label: string; reply: string; quote: string; copy: string; copied: string; edit: string; pin: string; unpin: string; delete: string; report: string; retry: string; moreReactions: string; fewerReactions: string; }; /** `indexed` takes `{index}`, 1-based. */ chatPinned: { label: string; indexed: string; unpin: string; }; /** `description` takes `{name}`. */ chatRequest: { title: string; description: string; accept: string; delete: string; block: string; report: string; }; /** Service messages. Every key takes `{actor}`; `membersAdded` also takes * `{users}` (a locale-joined list), `memberRemoved` `{user}`, * `groupCreatedTitled` and `titleChanged` `{title}`, `messagePinned` * `{text}`. */ chatService: { groupCreated: string; groupCreatedTitled: string; membersAdded: string; memberJoined: string; memberLeft: string; memberRemoved: string; titleChanged: string; photoChanged: string; messagePinned: string; messagePinnedMedia: string; joinedByLink: string; }; chatStatus: { sending: string; sent: string; read: string; failed: string; }; /** `one` takes `{name}`; `several` takes `{names}` (a locale-joined list); * `many` takes `{name}` and `{count}`, the number of others. */ chatTyping: { typing: string; one: string; several: string; many: string; }; chip: { remove: string; }; /** `resultCount` takes `{count}`. KunCommandSearch reads these too. */ commandPalette: { placeholder: string; empty: string; noResult: string; loading: string; close: string; hintSelect: string; hintOpen: string; hintClose: string; resultCount: string; remove: string; clear: string; }; /** `success` / `failure` take `{text}`, the copied string. */ copy: { copied: string; success: string; failure: string; }; /** `prevPage` / `nextPage` take `{unit}`, filled from `unitMonth` / * `unitYear` / `unitDecade`; `zoomOut` takes `{label}`; `monthCell` takes * `{month}` and `{year}` — one template, because Chinese puts the year * first. */ datePicker: { placeholderDay: string; placeholderMonth: string; placeholderYear: string; clear: string; today: string; close: string; prevYear: string; nextYear: string; prevPage: string; nextPage: string; zoomOut: string; unitMonth: string; unitYear: string; unitDecade: string; monthCell: string; }; drawer: { close: string; }; /** `selected` takes `{count}`. */ fileInput: { trigger: string; selected: string; }; /** `tooLarge` takes `{name}` and `{size}`. */ filePicker: { tooLarge: string; }; input: { clear: string; reveal: string; hide: string; }; /** Spoken key names for KunKbd, read in place of a glyph such as ⌘ or ↑; * `then` joins the chords of a sequence. */ kbd: Record & { then: string; }; /** `goto` takes `{index}`, the 1-based image number. */ lightbox: { label: string; close: string; prev: string; next: string; goto: string; zoomIn: string; zoomOut: string; rotateLeft: string; rotateRight: string; reset: string; download: string; }; lightboxGallery: { view: string; }; loading: { description: string; }; loli: { close: string; }; message: { close: string; }; modal: { close: string; }; /** KunNull — the "nothing here" empty state. */ null: { description: string; }; numberInput: { decrement: string; increment: string; }; /** `page` takes `{page}`. The two `hint` halves wrap the arrow-key icons. */ pagination: { nav: string; prev: string; next: string; page: string; hintBefore: string; hintAfter: string; jumpLabel: string; jump: string; }; /** `digit` takes `{label}` and `{index}`, the 1-based position. */ pinInput: { label: string; digit: string; }; reaction: { label: string; }; /** `removeOption` takes `{label}`, the option's own label. */ select: { searchPlaceholder: string; noResult: string; loading: string; clear: string; removeOption: string; }; splitPane: { handle: string; }; spoiler: { copyCode: string; reveal: string; }; /** Visually hidden state prefix read before each step's title; all four * take `{title}`. */ steps: { completed: string; current: string; pending: string; error: string; }; /** Both take `{tag}`. */ tagInput: { tag: string; removeTag: string; }; /** The menu a text field shows over its selection. Flutter only: on the * web the browser draws that menu, so no web component renders these. */ textSelection: { copy: string; cut: string; paste: string; selectAll: string; share: string; lookUp: string; searchWeb: string; }; upload: { imageAlt: string; cropTitle: string; cancel: string; confirm: string; }; } /** A locale's strings plus its identity — everything about a locale that is * framework-agnostic. A render layer extends it with whatever else it needs * (the Vue layer adds a date-fns locale for the calendar grid). */ interface KunMessageCatalog { /** Endonym, for a language switcher's own list (e.g. `简体中文`). */ name: string; /** BCP 47 tag. Not used for matching — KunUI never picks a locale for you. */ code: string; messages: KunMessages; } /** Dotted path into `KunMessages`, e.g. `'pagination.prev'`. */ type KunMessagePath = { [K in keyof KunMessages]: `${K & string}.${keyof KunMessages[K] & string}`; }[keyof KunMessages]; type KunTranslate = (path: KunMessagePath, params?: Record) => string; export { type KunMessages as K, type KunMessagePath as a, type KunMessageCatalog as b, type KunKbdKeyName as c, type KunShortcutKey as d, type KunShortcutPlatform as e, type KunTranslate as f, formatKunShortcut as g, parseKunShortcut as p, resolveKunShortcut as r, speakKunShortcut as s };