core-plugin-api: update translation exports
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -23,12 +23,14 @@ export interface TranslationOptions {
|
||||
/* no options supported for now */
|
||||
}
|
||||
|
||||
/** @alpha */
|
||||
export type TranslationFunction<TMessages extends { [key in string]: string }> =
|
||||
<TKey extends keyof TMessages>(
|
||||
key: TKey,
|
||||
options?: TranslationOptions,
|
||||
) => TMessages[TKey];
|
||||
|
||||
/** @alpha */
|
||||
export type TranslationSnapshot<TMessages extends { [key in string]: string }> =
|
||||
{ ready: false } | { ready: true; t: TranslationFunction<TMessages> };
|
||||
|
||||
|
||||
@@ -13,5 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
export * from './TranslationApi';
|
||||
export * from './AppLanguageApi';
|
||||
export {
|
||||
translationApiRef,
|
||||
type TranslationApi,
|
||||
type TranslationFunction,
|
||||
type TranslationOptions,
|
||||
type TranslationSnapshot,
|
||||
} from './TranslationApi';
|
||||
export { appLanguageApiRef, type AppLanguageApi } from './AppLanguageApi';
|
||||
|
||||
@@ -29,7 +29,4 @@ export {
|
||||
type TranslationRefOptions,
|
||||
createTranslationRef,
|
||||
} from './TranslationRef';
|
||||
export {
|
||||
type TranslationOptions,
|
||||
useTranslationRef,
|
||||
} from './useTranslationRef';
|
||||
export { useTranslationRef } from './useTranslationRef';
|
||||
|
||||
Reference in New Issue
Block a user