intor 2.3.29 → 2.3.31
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/core/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/dist/core/src/routing/pathname/canonicalize-pathname.js +11 -7
- package/dist/core/src/server/helpers/get-translator.js +2 -2
- package/dist/core/src/server/intor/intor.js +3 -8
- package/dist/core/src/server/messages/load-messages.js +2 -1
- package/dist/core/src/server/translator/init-translator.js +9 -3
- package/dist/express/src/adapters/express/middleware/create-intor-middleware.js +4 -11
- package/dist/express/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/express/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/dist/express/src/routing/pathname/canonicalize-pathname.js +11 -7
- package/dist/express/src/server/helpers/get-translator.js +2 -2
- package/dist/express/src/server/messages/load-messages.js +2 -1
- package/dist/express/src/server/translator/init-translator.js +9 -3
- package/dist/next/export/next/index.js +0 -1
- package/dist/next/export/next/server/index.js +0 -1
- package/dist/next/src/adapters/next/navigation/link.js +11 -10
- package/dist/next/src/adapters/next/navigation/use-router.js +14 -20
- package/dist/next/src/adapters/next/proxy/intor-proxy.js +1 -1
- package/dist/next/src/adapters/next/server/intor.js +1 -1
- package/dist/next/src/client/shared/navigation/execute-navigation.js +50 -0
- package/dist/next/src/client/shared/utils/build-cookie-string.js +30 -0
- package/dist/next/src/client/shared/utils/locale/set-locale-cookie.js +15 -0
- package/dist/next/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/next/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/dist/next/src/routing/pathname/canonicalize-pathname.js +11 -7
- package/dist/next/src/server/helpers/get-translator.js +2 -2
- package/dist/next/src/server/intor/intor.js +3 -8
- package/dist/next/src/server/messages/load-messages.js +2 -1
- package/dist/next/src/server/translator/init-translator.js +9 -3
- package/dist/react/export/react/index.js +0 -2
- package/dist/react/src/client/shared/messages/create-refetch-messages.js +1 -0
- package/dist/react/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/react/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/dist/svelte/export/svelte/index.js +4 -2
- package/dist/svelte/src/client/shared/messages/create-refetch-messages.js +1 -0
- package/dist/svelte/src/client/svelte/{store → provider}/create-intor-store.js +7 -14
- package/dist/svelte/src/client/svelte/provider/intor-provider.svelte +7 -0
- package/dist/svelte/src/client/svelte/provider/use-intor-context.js +11 -0
- package/dist/svelte/src/client/svelte/render/create-svelte-renderer.js +5 -6
- package/dist/svelte/src/client/svelte/translator/create-t-rich.js +23 -0
- package/dist/svelte/src/client/svelte/translator/use-translator.js +32 -0
- package/dist/svelte/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/svelte/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/dist/svelte-kit/export/svelte-kit/index.js +1 -0
- package/dist/svelte-kit/export/svelte-kit/server/index.js +2 -0
- package/dist/svelte-kit/src/adapters/svelte-kit/navigation/use-navigation.js +36 -0
- package/dist/svelte-kit/src/adapters/svelte-kit/server/create-intor-handle.js +66 -0
- package/dist/svelte-kit/src/adapters/svelte-kit/server/intor.js +24 -0
- package/dist/svelte-kit/src/adapters/svelte-kit/server/utils/is-svelte-kit-ssg.js +15 -0
- package/dist/svelte-kit/src/client/shared/navigation/execute-navigation.js +49 -0
- package/dist/svelte-kit/src/client/shared/utils/build-cookie-string.js +30 -0
- package/dist/svelte-kit/src/client/shared/utils/locale/set-locale-cookie.js +15 -0
- package/dist/svelte-kit/src/core/error/intor-error.js +9 -0
- package/dist/svelte-kit/src/core/logger/get-logger.js +39 -0
- package/dist/svelte-kit/src/core/logger/global-logger-pool.js +8 -0
- package/dist/svelte-kit/src/core/messages/load-remote-messages/collect-remote-resources.js +25 -0
- package/dist/svelte-kit/src/core/messages/load-remote-messages/fetch-remote-resource.js +47 -0
- package/dist/svelte-kit/src/core/messages/load-remote-messages/load-remote-messages.js +93 -0
- package/dist/svelte-kit/src/core/messages/load-remote-messages/resolve-remote-resources.js +24 -0
- package/dist/svelte-kit/src/core/messages/merge-messages.js +33 -0
- package/dist/svelte-kit/src/core/messages/utils/is-valid-messages.js +44 -0
- package/dist/svelte-kit/src/core/messages/utils/nest-object-from-path.js +21 -0
- package/dist/svelte-kit/src/core/utils/deep-merge.js +47 -0
- package/dist/svelte-kit/src/core/utils/normalizers/normalize-cache-key.js +45 -0
- package/dist/svelte-kit/src/core/utils/normalizers/normalize-locale.js +59 -0
- package/dist/svelte-kit/src/core/utils/normalizers/normalize-query.js +25 -0
- package/dist/svelte-kit/src/core/utils/resolve-loader-options.js +34 -0
- package/dist/{react → svelte-kit}/src/policies/shoud-full-reload.js +1 -1
- package/dist/svelte-kit/src/policies/should-sync-locale.js +8 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-inbound.js +46 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-locale/resolve-locale.js +33 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-pathname/resolve-pathname.js +42 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-pathname/strategies/all.js +28 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-pathname/strategies/except-default.js +29 -0
- package/dist/svelte-kit/src/routing/inbound/resolve-pathname/strategies/none.js +8 -0
- package/dist/svelte-kit/src/routing/locale/get-locale-from-accept-language.js +38 -0
- package/dist/svelte-kit/src/routing/locale/get-locale-from-host.js +32 -0
- package/dist/svelte-kit/src/routing/locale/get-locale-from-pathname.js +46 -0
- package/dist/svelte-kit/src/routing/locale/get-locale-from-query.js +29 -0
- package/dist/{react → svelte-kit}/src/routing/pathname/canonicalize-pathname.js +11 -7
- package/dist/svelte-kit/src/server/intor/intor.js +31 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/cache/messages-pool.js +11 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/load-local-messages.js +107 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/read-locale-messages/collect-file-entries/collect-file-entries.js +90 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/read-locale-messages/parse-file-entries/parse-file-entries.js +102 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/read-locale-messages/parse-file-entries/utils/json-reader.js +12 -0
- package/dist/svelte-kit/src/server/messages/load-local-messages/read-locale-messages/read-locale-messages.js +42 -0
- package/dist/svelte-kit/src/server/messages/load-messages.js +77 -0
- package/dist/svelte-kit/src/server/translator/create-translator.js +40 -0
- package/dist/svelte-kit/src/server/translator/init-translator.js +42 -0
- package/dist/types/export/next/index.d.ts +1 -1
- package/dist/types/export/next/server/index.d.ts +1 -1
- package/dist/types/export/react/index.d.ts +2 -2
- package/dist/types/export/svelte/index.d.ts +3 -1
- package/dist/types/export/svelte-kit/index.d.ts +1 -0
- package/dist/types/export/svelte-kit/server/index.d.ts +1 -0
- package/dist/types/src/adapters/express/global.d.ts +5 -8
- package/dist/types/src/adapters/next/navigation/index.d.ts +0 -1
- package/dist/types/src/adapters/next/server/index.d.ts +0 -1
- package/dist/types/src/adapters/svelte-kit/navigation/index.d.ts +1 -0
- package/dist/types/src/adapters/svelte-kit/navigation/use-navigation.d.ts +15 -0
- package/dist/types/src/adapters/svelte-kit/server/create-intor-handle.d.ts +12 -0
- package/dist/types/src/adapters/svelte-kit/server/index.d.ts +2 -0
- package/dist/types/src/adapters/svelte-kit/server/intor.d.ts +16 -0
- package/dist/types/src/adapters/svelte-kit/server/utils/is-svelte-kit-ssg.d.ts +8 -0
- package/dist/types/src/client/index.d.ts +1 -0
- package/dist/types/src/client/react/index.d.ts +0 -1
- package/dist/types/src/client/shared/navigation/execute-navigation.d.ts +19 -0
- package/dist/types/src/client/shared/navigation/index.d.ts +1 -0
- package/dist/types/src/client/svelte/index.d.ts +2 -2
- package/dist/types/src/client/svelte/provider/create-intor-store.d.ts +3 -0
- package/dist/types/src/client/svelte/provider/index.d.ts +3 -0
- package/dist/types/src/client/svelte/provider/types.d.ts +18 -0
- package/dist/types/src/client/svelte/provider/use-intor-context.d.ts +2 -0
- package/dist/types/src/client/svelte/render/types.d.ts +7 -13
- package/dist/types/src/client/svelte/translator/create-t-rich.d.ts +15 -0
- package/dist/types/src/client/svelte/translator/index.d.ts +1 -0
- package/dist/types/src/client/svelte/translator/translator-instance.d.ts +20 -0
- package/dist/types/src/client/svelte/translator/use-translator.d.ts +8 -0
- package/dist/types/src/core/index.d.ts +1 -1
- package/dist/types/src/core/messages/load-remote-messages/fetch-remote-resource.d.ts +3 -1
- package/dist/types/src/core/messages/load-remote-messages/load-remote-messages.d.ts +1 -1
- package/dist/types/src/core/messages/load-remote-messages/types.d.ts +2 -0
- package/dist/types/src/core/types/index.d.ts +1 -0
- package/dist/types/src/core/types/runtime-fetch.d.ts +1 -0
- package/dist/types/src/routing/inbound/index.d.ts +1 -0
- package/dist/types/src/routing/inbound/resolve-inbound.d.ts +1 -12
- package/dist/types/src/routing/inbound/types.d.ts +12 -0
- package/dist/types/src/routing/index.d.ts +1 -1
- package/dist/types/src/routing/pathname/canonicalize-pathname.d.ts +2 -0
- package/dist/types/src/server/helpers/get-translator.d.ts +2 -1
- package/dist/types/src/server/intor/intor.d.ts +4 -3
- package/dist/types/src/server/intor/types.d.ts +0 -2
- package/dist/types/src/server/messages/load-messages.d.ts +1 -1
- package/dist/types/src/server/messages/types.d.ts +2 -1
- package/dist/types/src/server/translator/init-translator.d.ts +2 -2
- package/dist/vue/src/client/shared/messages/create-refetch-messages.js +1 -0
- package/dist/vue/src/core/messages/load-remote-messages/fetch-remote-resource.js +1 -1
- package/dist/vue/src/core/messages/load-remote-messages/load-remote-messages.js +2 -2
- package/package.json +11 -1
- package/dist/express/src/core/constants/headers.js +0 -6
- package/dist/next/src/adapters/next/navigation/use-pathname.js +0 -26
- package/dist/next/src/adapters/next/server/get-pathname.js +0 -28
- package/dist/react/src/client/react/navigation/use-execute-navigation.js +0 -41
- package/dist/react/src/client/react/navigation/use-resolve-navigation.js +0 -16
- package/dist/svelte/src/client/svelte/helpers/create-intor.js +0 -45
- package/dist/svelte/src/client/svelte/store/create-translator-bindings.js +0 -25
- package/dist/types/src/adapters/next/navigation/use-pathname.d.ts +0 -14
- package/dist/types/src/adapters/next/server/get-pathname.d.ts +0 -16
- package/dist/types/src/client/react/navigation/index.d.ts +0 -2
- package/dist/types/src/client/react/navigation/use-execute-navigation.d.ts +0 -5
- package/dist/types/src/client/react/navigation/use-resolve-navigation.d.ts +0 -5
- package/dist/types/src/client/svelte/helpers/create-intor.d.ts +0 -4
- package/dist/types/src/client/svelte/helpers/index.d.ts +0 -1
- package/dist/types/src/client/svelte/store/create-intor-store.d.ts +0 -2
- package/dist/types/src/client/svelte/store/create-translator-bindings.d.ts +0 -13
- package/dist/types/src/client/svelte/store/index.d.ts +0 -2
- package/dist/types/src/client/svelte/store/types.d.ts +0 -31
- /package/dist/{react → next}/src/policies/should-sync-locale.js +0 -0
- /package/dist/svelte/src/client/svelte/{store → provider}/effects/locale-effects.js +0 -0
- /package/dist/svelte/src/client/svelte/{store → provider}/effects/messages-effects.js +0 -0
- /package/dist/{react → svelte-kit}/src/core/constants/prefix-placeholder.js +0 -0
- /package/dist/{react → svelte-kit}/src/core/utils/normalizers/normalize-pathname.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/decide-strategy.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/derive-target.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/resolve-navigation.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/utils/derive-host-destination.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/utils/derive-query-destination.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/navigation/utils/is-external-destination.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/pathname/localize-pathname.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/pathname/materialize-pathname.js +0 -0
- /package/dist/{react → svelte-kit}/src/routing/pathname/standardize-pathname.js +0 -0
- /package/dist/types/src/client/svelte/{store → provider}/effects/locale-effects.d.ts +0 -0
- /package/dist/types/src/client/svelte/{store → provider}/effects/messages-effects.d.ts +0 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import '../../core/error/intor-error.js';
|
|
2
|
+
import { resolveLoaderOptions } from '../../core/utils/resolve-loader-options.js';
|
|
3
|
+
import { getLogger } from '../../core/logger/get-logger.js';
|
|
4
|
+
import { loadRemoteMessages } from '../../core/messages/load-remote-messages/load-remote-messages.js';
|
|
5
|
+
import { loadLocalMessages } from './load-local-messages/load-local-messages.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Load locale messages according to the resolved Intor loader configuration.
|
|
9
|
+
*
|
|
10
|
+
* This function is the top-level orchestration entry for message loading.
|
|
11
|
+
* It is responsible for:
|
|
12
|
+
*
|
|
13
|
+
* - Resolving the active loader strategy (local or remote)
|
|
14
|
+
* - Dispatching to the appropriate loader implementation
|
|
15
|
+
* - Passing through cache and read-related options
|
|
16
|
+
*
|
|
17
|
+
* Message traversal, parsing, fallback resolution, and caching logic
|
|
18
|
+
* are delegated to the selected loader.
|
|
19
|
+
*/
|
|
20
|
+
const loadMessages = async ({ config, locale, readers, allowCacheWrite = false, fetch, }) => {
|
|
21
|
+
const baseLogger = getLogger(config.logger);
|
|
22
|
+
const logger = baseLogger.child({ scope: "load-messages" });
|
|
23
|
+
// ---------------------------------------------------------------------------
|
|
24
|
+
// Resolve loader configuration
|
|
25
|
+
// ---------------------------------------------------------------------------
|
|
26
|
+
const loader = resolveLoaderOptions(config, "server");
|
|
27
|
+
if (!loader) {
|
|
28
|
+
logger.warn("No loader options have been configured in the current config.");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
const { type, namespaces, concurrency } = loader;
|
|
32
|
+
const fallbackLocales = config.fallbackLocales[locale] || [];
|
|
33
|
+
logger.info(`Loading messages for locale "${locale}".`);
|
|
34
|
+
logger.trace("Starting to load messages with runtime context.", {
|
|
35
|
+
loaderType: type,
|
|
36
|
+
...(type === "local" ? { rootDir: loader.rootDir } : {}),
|
|
37
|
+
locale,
|
|
38
|
+
fallbackLocales: fallbackLocales.join(", "),
|
|
39
|
+
namespaces: namespaces && namespaces.length > 0 ? [...namespaces] : "*",
|
|
40
|
+
});
|
|
41
|
+
// ---------------------------------------------------------------------------
|
|
42
|
+
// Dispatch to loader implementation
|
|
43
|
+
// ---------------------------------------------------------------------------
|
|
44
|
+
let loadedMessages;
|
|
45
|
+
if (type === "local") {
|
|
46
|
+
loadedMessages = await loadLocalMessages({
|
|
47
|
+
id: config.id,
|
|
48
|
+
locale,
|
|
49
|
+
fallbackLocales,
|
|
50
|
+
namespaces,
|
|
51
|
+
rootDir: loader.rootDir,
|
|
52
|
+
concurrency,
|
|
53
|
+
readers,
|
|
54
|
+
allowCacheWrite,
|
|
55
|
+
loggerOptions: config.logger,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
else if (type === "remote") {
|
|
59
|
+
loadedMessages = await loadRemoteMessages({
|
|
60
|
+
locale,
|
|
61
|
+
fallbackLocales,
|
|
62
|
+
namespaces,
|
|
63
|
+
concurrency,
|
|
64
|
+
fetch,
|
|
65
|
+
url: loader.url,
|
|
66
|
+
headers: loader.headers,
|
|
67
|
+
loggerOptions: config.logger,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
// Final sanity check
|
|
71
|
+
if (!loadedMessages || Object.keys(loadedMessages).length === 0) {
|
|
72
|
+
logger.warn("No messages found.", { locale, fallbackLocales, namespaces });
|
|
73
|
+
}
|
|
74
|
+
return loadedMessages;
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
export { loadMessages };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Translator } from 'intor-translator';
|
|
2
|
+
import { mergeMessages } from '../../core/messages/merge-messages.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Create a server-side translator snapshot.
|
|
6
|
+
*
|
|
7
|
+
* - Merges static config messages with runtime-loaded messages
|
|
8
|
+
* - Creates a Translator instance for a fixed locale
|
|
9
|
+
* - Optionally scopes the translator with a preKey
|
|
10
|
+
*
|
|
11
|
+
* The returned object is a read-only translation view
|
|
12
|
+
* and does not expose the underlying Translator instance.
|
|
13
|
+
*/
|
|
14
|
+
function createTranslator(params) {
|
|
15
|
+
const { config, locale, messages, preKey, handlers, plugins } = params;
|
|
16
|
+
// Merge static config messages with runtime-loaded messages
|
|
17
|
+
const finalMessages = mergeMessages(config.messages, messages, {
|
|
18
|
+
config,
|
|
19
|
+
locale,
|
|
20
|
+
});
|
|
21
|
+
const translator = new Translator({
|
|
22
|
+
locale,
|
|
23
|
+
messages: finalMessages,
|
|
24
|
+
fallbackLocales: config.fallbackLocales,
|
|
25
|
+
loadingMessage: config.translator?.loadingMessage,
|
|
26
|
+
missingMessage: config.translator?.missingMessage,
|
|
27
|
+
handlers,
|
|
28
|
+
plugins,
|
|
29
|
+
});
|
|
30
|
+
// Apply scoped view when preKey is provided
|
|
31
|
+
const scoped = preKey ? translator.scoped(preKey) : null;
|
|
32
|
+
return {
|
|
33
|
+
messages: finalMessages,
|
|
34
|
+
locale,
|
|
35
|
+
hasKey: scoped ? scoped.hasKey : translator.hasKey,
|
|
36
|
+
t: scoped ? scoped.t : translator.t,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export { createTranslator };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import '../../core/error/intor-error.js';
|
|
2
|
+
import { resolveLoaderOptions } from '../../core/utils/resolve-loader-options.js';
|
|
3
|
+
import 'logry';
|
|
4
|
+
import 'p-limit';
|
|
5
|
+
import { loadMessages } from '../messages/load-messages.js';
|
|
6
|
+
import 'node:path';
|
|
7
|
+
import 'node:fs/promises';
|
|
8
|
+
import { createTranslator } from './create-translator.js';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Initializes a server-side translator for a specific locale.
|
|
12
|
+
*
|
|
13
|
+
* - Performs message loading during initialization.
|
|
14
|
+
* - Returns an immutable translator snapshot.
|
|
15
|
+
*/
|
|
16
|
+
async function initTranslator(config, locale, options) {
|
|
17
|
+
const { readers, allowCacheWrite = false, fetch, preKey, handlers, plugins, } = options;
|
|
18
|
+
const loader = resolveLoaderOptions(config, "server");
|
|
19
|
+
// Load messages
|
|
20
|
+
let messages = {};
|
|
21
|
+
if (loader) {
|
|
22
|
+
const loaded = await loadMessages({
|
|
23
|
+
config,
|
|
24
|
+
locale,
|
|
25
|
+
readers,
|
|
26
|
+
allowCacheWrite,
|
|
27
|
+
fetch,
|
|
28
|
+
});
|
|
29
|
+
messages = loaded || {};
|
|
30
|
+
}
|
|
31
|
+
// Create immutable translator snapshot
|
|
32
|
+
return createTranslator({
|
|
33
|
+
config,
|
|
34
|
+
locale,
|
|
35
|
+
messages,
|
|
36
|
+
preKey,
|
|
37
|
+
handlers,
|
|
38
|
+
plugins,
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export { initTranslator };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Link,
|
|
1
|
+
export { Link, useRouter, redirect } from "../../src/adapters/next/navigation";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { intor, getLocale,
|
|
1
|
+
export { intor, getLocale, getTranslator } from "../../../src/adapters/next/server";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { IntorProvider, type IntorProviderProps, useIntorContext, //
|
|
2
|
-
useTranslator, Trans,
|
|
1
|
+
export { IntorProvider, type IntorProviderProps, useIntorContext, // @internal
|
|
2
|
+
useTranslator, Trans, useIntor, getClientLocale, } from "../../src/client/react";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useNavigation } from "../../src/adapters/svelte-kit/navigation";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { createIntorHandle, intor } from "../../../src/adapters/svelte-kit/server";
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
import type { TranslatorInstance
|
|
2
|
-
import type {
|
|
1
|
+
import type { TranslatorInstance } from "../../core";
|
|
2
|
+
import type { InboundContext } from "../../routing";
|
|
3
|
+
import type { Locale, LocaleMessages, Replacement } from "intor-translator";
|
|
3
4
|
/**
|
|
4
5
|
* Global type augmentations for Express request
|
|
5
6
|
*/
|
|
6
7
|
declare global {
|
|
7
8
|
namespace Express {
|
|
8
9
|
interface Request {
|
|
9
|
-
intor:
|
|
10
|
-
|
|
11
|
-
localeSource: RoutingLocaleSource;
|
|
12
|
-
pathname: string;
|
|
13
|
-
};
|
|
14
|
-
locale: string;
|
|
10
|
+
intor: InboundContext;
|
|
11
|
+
locale: Locale;
|
|
15
12
|
hasKey: TranslatorInstance<LocaleMessages, Replacement, "string">["hasKey"];
|
|
16
13
|
t: TranslatorInstance<LocaleMessages, Replacement, "string">["t"];
|
|
17
14
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useNavigation } from "./use-navigation";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { GenConfigKeys, GenLocale } from "../../../core";
|
|
2
|
+
import { goto as svelteGoto } from "$app/navigation";
|
|
3
|
+
/**
|
|
4
|
+
* Locale-aware navigation utilities for SvelteKit.
|
|
5
|
+
*
|
|
6
|
+
* Provides imperative navigation helpers that integrate
|
|
7
|
+
* Intor's locale-aware routing and side effects.
|
|
8
|
+
*
|
|
9
|
+
* @platform SvelteKit
|
|
10
|
+
*/
|
|
11
|
+
export declare function useNavigation<CK extends GenConfigKeys = "__default__">(): {
|
|
12
|
+
goto: (url: string, opts?: Parameters<typeof svelteGoto>[1] & {
|
|
13
|
+
locale?: GenLocale<CK>;
|
|
14
|
+
}) => Promise<void>;
|
|
15
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IntorResolvedConfig } from "../../../config";
|
|
2
|
+
import type { Handle } from "@sveltejs/kit";
|
|
3
|
+
/**
|
|
4
|
+
* Resolves locale-aware routing for the current execution context.
|
|
5
|
+
*
|
|
6
|
+
* The resolved routing state is exposed via response headers.
|
|
7
|
+
*
|
|
8
|
+
* - Acts as the canonical routing authority within the SvelteKit request lifecycle.
|
|
9
|
+
*
|
|
10
|
+
* @platform SvelteKit
|
|
11
|
+
*/
|
|
12
|
+
export declare function createIntorHandle(config: IntorResolvedConfig): Handle;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IntorResolvedConfig } from "../../../config";
|
|
2
|
+
import type { MessagesReaders, RuntimeFetch } from "../../../core";
|
|
3
|
+
import type { Locale } from "intor-translator";
|
|
4
|
+
import { type GenConfigKeys } from "../../../core";
|
|
5
|
+
import { type IntorValue } from "../../../server";
|
|
6
|
+
/**
|
|
7
|
+
* Initializes Intor for the current execution context.
|
|
8
|
+
*
|
|
9
|
+
* - Uses the locale resolved by the SvelteKit request lifecycle.
|
|
10
|
+
* - Permits cache writes during server execution.
|
|
11
|
+
* @platform SvelteKit
|
|
12
|
+
*/
|
|
13
|
+
export declare function intor<CK extends GenConfigKeys = "__default__">(config: IntorResolvedConfig, locale: Locale, fetch: RuntimeFetch, options?: {
|
|
14
|
+
readers?: MessagesReaders;
|
|
15
|
+
allowCacheWrite?: boolean;
|
|
16
|
+
}): Promise<IntorValue<CK>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RequestEvent } from "@sveltejs/kit";
|
|
2
|
+
/**
|
|
3
|
+
* Heuristic to detect static (prerender) execution in SvelteKit.
|
|
4
|
+
*
|
|
5
|
+
* This is NOT a guaranteed signal.
|
|
6
|
+
* It intentionally prefers false positives over false negatives.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isSvelteKitSSG(event: RequestEvent<Record<string, string>, string | null>): boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeNavigation } from "./shared/navigation";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
export { IntorProvider, type IntorProviderProps, useIntorContext, } from "./provider";
|
|
2
2
|
export { useTranslator, Trans } from "./translator";
|
|
3
|
-
export { useResolveNavigation, useExecuteNavigation } from "./navigation";
|
|
4
3
|
export { useIntor } from "./helpers";
|
|
5
4
|
export { getClientLocale } from "../shared/helpers";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IntorResolvedConfig } from "../../../config";
|
|
2
|
+
import type { NavigationResult } from "../../../routing";
|
|
3
|
+
interface NavigationExecutionContext {
|
|
4
|
+
config: IntorResolvedConfig;
|
|
5
|
+
currentLocale: string;
|
|
6
|
+
setLocale(locale: string): void;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Executes a resolved navigation result.
|
|
10
|
+
*
|
|
11
|
+
* Applies all imperative side effects required to complete navigation,
|
|
12
|
+
* including locale synchronization, cookie persistence, and full reloads.
|
|
13
|
+
*
|
|
14
|
+
* This function must be called after `resolveNavigation`.
|
|
15
|
+
*/
|
|
16
|
+
export declare function executeNavigation(navigationResult: NavigationResult, context: NavigationExecutionContext, e?: {
|
|
17
|
+
preventDefault(): void;
|
|
18
|
+
}): void;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { executeNavigation } from "./execute-navigation";
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createIntorStore,
|
|
2
|
-
export {
|
|
1
|
+
export { createIntorStore, IntorProvider, useIntorContext } from "./provider";
|
|
2
|
+
export { useTranslator } from "./translator";
|
|
3
3
|
export { getClientLocale } from "../shared/helpers";
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { IntorResolvedConfig } from "../../../config";
|
|
2
|
+
import type { Locale, TranslateHandlers, TranslateHook, TranslatorPlugin, Translator, LocaleMessages } from "intor-translator";
|
|
3
|
+
import type { Readable, Writable } from "svelte/store";
|
|
4
|
+
export interface IntorValue {
|
|
5
|
+
config: IntorResolvedConfig;
|
|
6
|
+
locale: Locale;
|
|
7
|
+
messages?: Readonly<LocaleMessages>;
|
|
8
|
+
isLoading?: boolean;
|
|
9
|
+
onLocaleChange?: (newLocale: Locale) => Promise<void> | void;
|
|
10
|
+
handlers?: TranslateHandlers;
|
|
11
|
+
plugins?: (TranslatorPlugin | TranslateHook)[];
|
|
12
|
+
}
|
|
13
|
+
export interface IntorContextValue {
|
|
14
|
+
config: IntorResolvedConfig;
|
|
15
|
+
locale: Writable<Locale>;
|
|
16
|
+
setLocale: (locale: Locale) => void;
|
|
17
|
+
translator: Readable<Translator<unknown>>;
|
|
18
|
+
}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
type
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*
|
|
9
|
-
* Each entry can be either:
|
|
10
|
-
* - A render function that receives children and attributes
|
|
11
|
-
* - A static HTML string, used as-is for the tag
|
|
12
|
-
*/
|
|
13
|
-
export type SvelteTagRenderers = Record<string, SvelteTagRenderer | string>;
|
|
1
|
+
import type { Rich } from "intor-translator";
|
|
2
|
+
/** Renderer function for a semantic rich tag. */
|
|
3
|
+
type SvelteTagRenderer = ((children: string[]) => string) | string;
|
|
4
|
+
/** Mapping of semantic rich tags to Svelte renderers. */
|
|
5
|
+
export type SvelteTagRenderers<RichSchema = Rich> = {
|
|
6
|
+
[K in keyof RichSchema]: SvelteTagRenderer;
|
|
7
|
+
} & Record<string, SvelteTagRenderer>;
|
|
14
8
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { SvelteTagRenderers } from "../render";
|
|
2
|
+
import type { Replacement, Translator } from "intor-translator";
|
|
3
|
+
/**
|
|
4
|
+
* Create a Svelte-specific rich translation function.
|
|
5
|
+
*
|
|
6
|
+
* This adapter bridges the core Translator with the Svelte rich
|
|
7
|
+
* message rendering flow.
|
|
8
|
+
*
|
|
9
|
+
* - Resolves translated messages via `translator.t`
|
|
10
|
+
* - Renders semantic tags using Svelte renderers
|
|
11
|
+
* - Supports optional scoped keys via `preKey`
|
|
12
|
+
*
|
|
13
|
+
* Intended for Svelte client usage only.
|
|
14
|
+
*/
|
|
15
|
+
export declare const createTRich: (translator: Translator, preKey?: string) => (key: string, tagRenderers?: SvelteTagRenderers, replacements?: Replacement) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useTranslator } from "./use-translator";
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { SvelteTagRenderers } from "../render";
|
|
2
|
+
import type { TranslatorInstance } from "../../../core";
|
|
3
|
+
import type { Readable, Writable } from "svelte/store";
|
|
4
|
+
import { type Locale, type LocaleMessages, type LocalizedKey, type LocalizedReplacement, type LocalizedRich, type Replacement, type Rich, type ScopedKey } from "intor-translator";
|
|
5
|
+
export type TranslatorInstanceSvelte<M extends LocaleMessages, ReplacementSchema = Replacement, RichSchema = Rich, PK extends string | undefined = undefined> = {
|
|
6
|
+
/** `messages`: The message object containing all translations. */
|
|
7
|
+
messages: Readable<M>;
|
|
8
|
+
/** Current locale in use. */
|
|
9
|
+
locale: Writable<Locale<M>>;
|
|
10
|
+
/** Indicates whether translations are currently loading. */
|
|
11
|
+
isLoading: Readable<boolean>;
|
|
12
|
+
/** Update the active locale. */
|
|
13
|
+
setLocale: (locale: Locale<M>) => void;
|
|
14
|
+
/** Check if a given key exists in the messages. */
|
|
15
|
+
hasKey: Readable<TranslatorInstance<M, ReplacementSchema, PK>["hasKey"]>;
|
|
16
|
+
/** Translate a given key into its string representation. */
|
|
17
|
+
t: Readable<TranslatorInstance<M, ReplacementSchema, PK>["t"]>;
|
|
18
|
+
/** Translate a key into an HTML string using semantic rich tags. */
|
|
19
|
+
tRich: Readable<(<K extends string = PK extends string ? ScopedKey<M, PK> : LocalizedKey<M>, RI = LocalizedRich<RichSchema, K>, RE = LocalizedReplacement<ReplacementSchema, K>>(key?: K | (string & {}), tagRenderers?: SvelteTagRenderers<RI>, replacements?: RE | Replacement) => string)>;
|
|
20
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { TranslatorInstanceSvelte } from "./translator-instance";
|
|
2
|
+
import type { GenConfigKeys, GenMessages, GenReplacements, GenRich } from "../../../core";
|
|
3
|
+
import type { LocalizedPreKey } from "intor-translator";
|
|
4
|
+
/**
|
|
5
|
+
* Svelte utility for accessing the active Intor translator instance.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useTranslator<CK extends GenConfigKeys = "__default__", ReplacementSchema = GenReplacements<CK>, RichSchema = GenRich<CK>>(): TranslatorInstanceSvelte<GenMessages<CK>, ReplacementSchema, RichSchema, undefined>;
|
|
8
|
+
export declare function useTranslator<CK extends GenConfigKeys = "__default__", ReplacementSchema = GenReplacements<CK>, RichSchema = GenRich<CK>, PK extends string = LocalizedPreKey<GenMessages<CK>>>(preKey?: PK): TranslatorInstanceSvelte<GenMessages<CK>, ReplacementSchema, RichSchema, PK>;
|
|
@@ -3,4 +3,4 @@ export { IntorError, IntorErrorCode } from "./error";
|
|
|
3
3
|
export { deepMerge, type PlainObject, type DeepMergeOverrideEvent, resolveLoaderOptions, normalizePathname, normalizeCacheKey, normalizeLocale, normalizeQuery, } from "./utils";
|
|
4
4
|
export { getLogger, clearLoggerPool } from "./logger";
|
|
5
5
|
export { loadRemoteMessages, mergeMessages, isValidMessages, nestObjectFromPath, type MessagesReader, type MessagesReaders, INTOR_PREFIX, INTOR_MESSAGES_KIND_KEY, INTOR_MESSAGES_KIND, getMessagesKind, type IntorMessagesKind, } from "./messages";
|
|
6
|
-
export type { INTOR_GENERATED_KEY, IfGen, GenConfigKeys, GenConfig, GenMessages, GenLocale, GenReplacements, GenRich, TranslatorInstance, RoutingLocaleSource, RoutingLocaleCarrier, LocalePathPrefix, } from "./types";
|
|
6
|
+
export type { INTOR_GENERATED_KEY, IfGen, GenConfigKeys, GenConfig, GenMessages, GenLocale, GenReplacements, GenRich, TranslatorInstance, RoutingLocaleSource, RoutingLocaleCarrier, LocalePathPrefix, RuntimeFetch, } from "./types";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import type { RuntimeFetch } from "../../types";
|
|
1
2
|
import type { RemoteHeaders, LoggerOptions } from "../../../config";
|
|
2
3
|
import type { MessageObject } from "intor-translator";
|
|
3
4
|
interface FetchLocaleMessagesParams {
|
|
5
|
+
fetch: RuntimeFetch;
|
|
4
6
|
url: string;
|
|
5
7
|
headers?: RemoteHeaders;
|
|
6
8
|
signal?: AbortSignal;
|
|
@@ -17,5 +19,5 @@ interface FetchLocaleMessagesParams {
|
|
|
17
19
|
* - Validating the returned message structure
|
|
18
20
|
* - Handling abort and network errors
|
|
19
21
|
*/
|
|
20
|
-
export declare function fetchRemoteResource({ url, headers, signal, loggerOptions, }: FetchLocaleMessagesParams): Promise<MessageObject | undefined>;
|
|
22
|
+
export declare function fetchRemoteResource({ fetch, url, headers, signal, loggerOptions, }: FetchLocaleMessagesParams): Promise<MessageObject | undefined>;
|
|
21
23
|
export {};
|
|
@@ -14,4 +14,4 @@ import type { LocaleMessages } from "intor-translator";
|
|
|
14
14
|
*
|
|
15
15
|
* Network requests and response validation are delegated to lower-level utilities.
|
|
16
16
|
*/
|
|
17
|
-
export declare const loadRemoteMessages: ({ locale, fallbackLocales, namespaces, concurrency, url: baseUrl, headers, signal, loggerOptions, }: LoadRemoteMessagesParams) => Promise<LocaleMessages | undefined>;
|
|
17
|
+
export declare const loadRemoteMessages: ({ locale, fallbackLocales, namespaces, concurrency, fetch, url: baseUrl, headers, signal, loggerOptions, }: LoadRemoteMessagesParams) => Promise<LocaleMessages | undefined>;
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import type { RuntimeFetch } from "../../types";
|
|
1
2
|
import type { RemoteHeaders, LoggerOptions } from "../../../config";
|
|
2
3
|
export interface LoadRemoteMessagesParams {
|
|
3
4
|
locale: string;
|
|
4
5
|
fallbackLocales?: string[];
|
|
5
6
|
namespaces?: string[];
|
|
6
7
|
concurrency?: number;
|
|
8
|
+
fetch: RuntimeFetch;
|
|
7
9
|
url: string;
|
|
8
10
|
headers?: RemoteHeaders;
|
|
9
11
|
signal?: AbortSignal;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export type { INTOR_GENERATED_KEY, IfGen, GenConfigKeys, GenConfig, GenMessages, GenLocale, GenReplacements, GenRich, } from "./generated";
|
|
2
2
|
export type { TranslatorInstance } from "./translator-instance";
|
|
3
3
|
export type { RoutingLocaleSource, RoutingLocaleCarrier, LocalePathPrefix, } from "./routing";
|
|
4
|
+
export type { RuntimeFetch } from "./runtime-fetch";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type RuntimeFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
|
|
@@ -1,15 +1,5 @@
|
|
|
1
|
+
import type { ResolveInboundResult } from "./types";
|
|
1
2
|
import type { IntorResolvedConfig } from "../../config";
|
|
2
|
-
import type { RoutingLocaleSource } from "../../core";
|
|
3
|
-
interface ResolveInboundResult {
|
|
4
|
-
/** Resolved locale */
|
|
5
|
-
locale: string;
|
|
6
|
-
/** Locale source used for resolution */
|
|
7
|
-
localeSource: RoutingLocaleSource;
|
|
8
|
-
/** Localized pathname */
|
|
9
|
-
pathname: string;
|
|
10
|
-
/** Whether redirect is required */
|
|
11
|
-
shouldRedirect: boolean;
|
|
12
|
-
}
|
|
13
3
|
/**
|
|
14
4
|
* Resolves inbound routing state.
|
|
15
5
|
*
|
|
@@ -25,4 +15,3 @@ export declare function resolveInbound(config: IntorResolvedConfig, rawPathname:
|
|
|
25
15
|
cookie?: string;
|
|
26
16
|
detected: string;
|
|
27
17
|
}): Promise<ResolveInboundResult>;
|
|
28
|
-
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RoutingLocaleSource } from "../../core";
|
|
2
|
+
export interface ResolveInboundResult {
|
|
3
|
+
/** Resolved locale */
|
|
4
|
+
locale: string;
|
|
5
|
+
/** Locale source used for resolution */
|
|
6
|
+
localeSource: RoutingLocaleSource;
|
|
7
|
+
/** Localized pathname */
|
|
8
|
+
pathname: string;
|
|
9
|
+
/** Whether redirect is required */
|
|
10
|
+
shouldRedirect: boolean;
|
|
11
|
+
}
|
|
12
|
+
export type InboundContext = Pick<ResolveInboundResult, "locale" | "pathname" | "localeSource">;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { resolveInbound } from "./inbound";
|
|
1
|
+
export { resolveInbound, type InboundContext } from "./inbound";
|
|
2
2
|
export { localizePathname, type LocalizedPathname } from "./pathname";
|
|
3
3
|
export { getLocaleFromAcceptLanguage, getLocaleFromPathname, getLocaleFromHost, getLocaleFromQuery, } from "./locale";
|
|
4
4
|
export { resolveNavigation, type NavigationResult } from "./navigation";
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { TranslatorInstanceServer } from "../translator/translator-instance";
|
|
2
2
|
import type { IntorResolvedConfig } from "../../config";
|
|
3
|
-
import type { GenConfigKeys, GenMessages, GenReplacements, MessagesReaders } from "../../core";
|
|
3
|
+
import type { GenConfigKeys, GenMessages, GenReplacements, MessagesReaders, RuntimeFetch } from "../../core";
|
|
4
4
|
import type { LocalizedPreKey, TranslateHandlers, TranslateHook, TranslatorPlugin } from "intor-translator";
|
|
5
5
|
export interface GetTranslatorParams {
|
|
6
6
|
locale: string;
|
|
7
7
|
readers?: MessagesReaders;
|
|
8
8
|
allowCacheWrite?: boolean;
|
|
9
|
+
fetch?: RuntimeFetch;
|
|
9
10
|
handlers?: TranslateHandlers;
|
|
10
11
|
plugins?: (TranslatorPlugin | TranslateHook)[];
|
|
11
12
|
}
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { IntorValue } from "./types";
|
|
2
2
|
import type { IntorResolvedConfig } from "../../config";
|
|
3
3
|
import type { Locale } from "intor-translator";
|
|
4
|
-
import { type GenConfigKeys, type MessagesReaders } from "../../core";
|
|
4
|
+
import { type GenConfigKeys, type MessagesReaders, type RuntimeFetch } from "../../core";
|
|
5
5
|
/**
|
|
6
6
|
* Initializes Intor for the current execution context.
|
|
7
7
|
*
|
|
8
8
|
* Produces a server-side snapshot for SSR and
|
|
9
9
|
* full-stack rendering environments.
|
|
10
10
|
*/
|
|
11
|
-
export declare function intor<CK extends GenConfigKeys = "__default__">(config: IntorResolvedConfig,
|
|
11
|
+
export declare function intor<CK extends GenConfigKeys = "__default__">(config: IntorResolvedConfig, locale: Locale, options?: {
|
|
12
12
|
readers?: MessagesReaders;
|
|
13
13
|
allowCacheWrite?: boolean;
|
|
14
|
+
fetch?: RuntimeFetch;
|
|
14
15
|
}): Promise<IntorValue<CK>>;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { IntorResolvedConfig } from "../../config";
|
|
2
|
-
import type { Locale } from "intor-translator";
|
|
3
2
|
import { type GenConfigKeys, type GenLocale, type GenMessages } from "../../core";
|
|
4
|
-
export type LocaleResolver = (config: IntorResolvedConfig) => Locale | Promise<Locale>;
|
|
5
3
|
export interface IntorValue<CK extends GenConfigKeys = "__default__"> {
|
|
6
4
|
config: IntorResolvedConfig;
|
|
7
5
|
locale: GenLocale<CK>;
|
|
@@ -13,4 +13,4 @@ import type { LocaleMessages } from "intor-translator";
|
|
|
13
13
|
* Message traversal, parsing, fallback resolution, and caching logic
|
|
14
14
|
* are delegated to the selected loader.
|
|
15
15
|
*/
|
|
16
|
-
export declare const loadMessages: ({ config, locale, readers, allowCacheWrite, }: LoadMessagesParams) => Promise<LocaleMessages | undefined>;
|
|
16
|
+
export declare const loadMessages: ({ config, locale, readers, allowCacheWrite, fetch, }: LoadMessagesParams) => Promise<LocaleMessages | undefined>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { IntorResolvedConfig } from "../../config";
|
|
2
|
-
import type { MessagesReaders } from "../../core";
|
|
2
|
+
import type { MessagesReaders, RuntimeFetch } from "../../core";
|
|
3
3
|
import type { Locale } from "intor-translator";
|
|
4
4
|
export type LoadMessagesParams = {
|
|
5
5
|
config: IntorResolvedConfig;
|
|
@@ -10,4 +10,5 @@ export type LoadMessagesParams = {
|
|
|
10
10
|
* write into the shared messages cache.
|
|
11
11
|
*/
|
|
12
12
|
allowCacheWrite?: boolean;
|
|
13
|
+
fetch: RuntimeFetch;
|
|
13
14
|
};
|