core-plugin-api: update translation exports

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-09-14 21:10:01 +02:00
parent b50c8e8237
commit d3c63d0c29
3 changed files with 11 additions and 6 deletions
@@ -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';