core-plugin-api: API report update for TranslationFunction
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -107,14 +107,21 @@ export type TranslationApi = {
|
||||
export const translationApiRef: ApiRef<TranslationApi>;
|
||||
|
||||
// @alpha (undocumented)
|
||||
export type TranslationFunction<
|
||||
export interface TranslationFunction<
|
||||
TMessages extends {
|
||||
[key in string]: string;
|
||||
},
|
||||
> = <TKey extends keyof TMessages>(
|
||||
key: TKey,
|
||||
options?: TranslationOptions,
|
||||
) => TMessages[TKey];
|
||||
> {
|
||||
// (undocumented)
|
||||
<TKey extends keyof CollapsedMessages<TMessages>>(
|
||||
key: TKey,
|
||||
...[args]: TranslationFunctionOptions<
|
||||
NestedMessageKeys<TKey, CollapsedMessages<TMessages>>,
|
||||
PluralKeys<TMessages>,
|
||||
CollapsedMessages<TMessages>
|
||||
>
|
||||
): CollapsedMessages<TMessages>[TKey];
|
||||
}
|
||||
|
||||
// @alpha
|
||||
export interface TranslationMessages<
|
||||
@@ -155,9 +162,6 @@ export interface TranslationMessagesOptions<
|
||||
ref: TranslationRef_2<TId, TMessages>;
|
||||
}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface TranslationOptions {}
|
||||
|
||||
// @alpha (undocumented)
|
||||
export interface TranslationRef<
|
||||
TId extends string = string,
|
||||
|
||||
Reference in New Issue
Block a user