import type { MessageCatalog, MessageKey } from './messages.js'; export { EN, formatMessage } from './messages.js'; export type { MessageCatalog, MessageKey } from './messages.js'; export interface EditorLanguage { /** A BCP 47 tag: `en`, `ko`, `pt-BR`. */ id: string; /** What the language calls itself, so a reader who cannot read the current one still finds it. */ label: string; /** What it translates. Every key it omits stays English, so a partial language is usable. */ messages: MessageCatalog; } /** Reads a message in the active language, filling `{name}` placeholders. */ export interface Translator { (key: MessageKey, values?: Record): string; /** The language it speaks, for a control that offers to change it. */ readonly language: EditorLanguage; } /** Every language the editor can speak, English first. */ export declare function editorLanguages(): readonly EditorLanguage[]; /** The language the editor is speaking now. */ export declare function editorLanguage(): EditorLanguage; /** Speaks another language and remembers it. An unknown id is ignored. */ export declare function setEditorLanguage(id: string): void; /** * Teaches the editor a language, or replaces one it knows. * * A host translates the keys it cares about and leaves the rest English. A * language registered after the reader chose it takes effect immediately, * which is what happens when the host registers one during startup. */ export declare function registerEditorLanguage(language: EditorLanguage): void; /** The translator outside React — a command, a report, a thrown message. */ export declare function editorMessages(): Translator; /** The translator inside React; the component re-renders when the language changes. */ export declare function useMessages(): Translator;