1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import {createToken} from 'fusion-core';
|
10 | import type {FusionPlugin, Token} from 'fusion-core';
|
11 |
|
12 | import serverPlugin from './node';
|
13 | import clientPlugin, {HydrationStateToken} from './browser';
|
14 | import serverLoader from './loader';
|
15 | import type {
|
16 | I18nDepsType,
|
17 | I18nServiceType,
|
18 | TranslationsObjectType,
|
19 | TranslateFuncType,
|
20 | } from './types.js';
|
21 | import {I18nLoaderToken} from './tokens.js';
|
22 |
|
23 | const I18nToken: Token<I18nServiceType> = createToken('I18nToken');
|
24 |
|
25 | const plugin: FusionPlugin<I18nDepsType, I18nServiceType> = __NODE__
|
26 | ? serverPlugin
|
27 | : clientPlugin;
|
28 |
|
29 | const createI18nLoader: typeof serverLoader = __NODE__
|
30 | ? serverLoader
|
31 | : (void 0: any);
|
32 |
|
33 | export type {
|
34 | I18nDepsType,
|
35 | I18nServiceType,
|
36 | TranslationsObjectType,
|
37 | TranslateFuncType,
|
38 | };
|
39 | export default plugin;
|
40 | export {I18nToken, I18nLoaderToken, HydrationStateToken, createI18nLoader};
|