@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
11 lines (10 loc) • 639 B
TypeScript
/**
* Internationalization key type declaration, plugins can extend through declaration merging
*/
export type LocaleType = typeof import("../locale").default;
type FlattenKeys<T, Prefix extends string = ''> = {
[K in keyof T & string]: T[K] extends string ? Prefix extends '' ? K : `${Prefix}.${K}` : T[K] extends Record<string, any> ? FlattenKeys<T[K], Prefix extends '' ? K : `${Prefix}.${K}`> : never;
}[keyof T & string];
export type TFunction = <TKey extends FlattenKeys<LocaleType>>(key: TKey, options?: Record<string, string | number>) => string;
export type ILocaleKeys = Record<FlattenKeys<LocaleType>, string>;
export {};