intor 2.4.2 → 2.4.3

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.
@@ -1,8 +1,8 @@
1
+ import { intor as intor$1 } from '../../../server/intor/intor.js';
1
2
  import '../../../core/error/intor-error.js';
2
3
  import 'logry';
3
4
  import 'p-limit';
4
5
  import 'intor-translator';
5
- import { intor as intor$1 } from '../../../server/intor/intor.js';
6
6
  import 'node:path';
7
7
  import 'node:fs/promises';
8
8
 
@@ -1,8 +1,11 @@
1
1
  import type { IntorResolvedConfig } from "../../../config";
2
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";
3
+ import type { Locale, LocaleMessages } from "intor-translator";
4
+ import { type IntorValue as IntorValueCore } from "../../../server";
5
+ interface IntorValue extends Pick<IntorValueCore, "config"> {
6
+ locale: Locale;
7
+ messages: Readonly<LocaleMessages>;
8
+ }
6
9
  /**
7
10
  * Initializes Intor for the current execution context.
8
11
  *
@@ -10,7 +13,8 @@ import { type IntorValue } from "../../../server";
10
13
  * - Permits cache writes during server execution.
11
14
  * @platform SvelteKit
12
15
  */
13
- export declare function intor<CK extends GenConfigKeys = "__default__">(config: IntorResolvedConfig, locale: Locale, fetch: RuntimeFetch, options?: {
16
+ export declare function intor(config: IntorResolvedConfig, locale: Locale, fetch: RuntimeFetch, options?: {
14
17
  readers?: MessagesReaders;
15
18
  allowCacheWrite?: boolean;
16
- }): Promise<IntorValue<CK>>;
19
+ }): Promise<IntorValue>;
20
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { Component } from "svelte";
2
+ import type { IntorProviderProps } from "./types";
3
+
4
+ declare const IntorProvider: Component<IntorProviderProps>;
5
+ export default IntorProvider;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intor",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "The i18n library for modern JavaScript",
5
5
  "author": "Yiming Liao",
6
6
  "homepage": "https://github.com/yiming-liao/intor#readme",
@@ -62,8 +62,8 @@
62
62
  "types": "./dist/types/export/svelte/index.d.ts"
63
63
  },
64
64
  "./svelte/provider": {
65
- "import": "./dist/svelte/src/client/svelte/provider",
66
- "types": "./dist/types/export/svelte/index.d.ts"
65
+ "import": "./dist/svelte/src/client/svelte/provider/intor-provider.svelte",
66
+ "types": "./dist/types/src/client/svelte/provider/intor-provider.d.ts"
67
67
  },
68
68
  "./next": {
69
69
  "import": "./dist/next/export/next/index.js",