@intlayer/types 7.0.0-canary.3 → 7.0.1
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/types/config.d.ts +38 -78
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/dictionary.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -3
- package/dist/types/module_augmentation.d.ts +5 -11
- package/dist/types/module_augmentation.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/cjs/backend_models.cjs +0 -0
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/intlayer.d.cjs +0 -1
- package/dist/cjs/locales copy.cjs +0 -569
- package/dist/cjs/locales copy.cjs.map +0 -1
- package/dist/cjs/module_augmentation.cjs.map +0 -1
- package/dist/cjs/test.cjs +0 -0
- package/dist/cjs/test.cjs.map +0 -1
- package/dist/cjs/translation.cjs +0 -0
- package/dist/esm/backend_models.mjs +0 -0
- package/dist/esm/index.mjs.map +0 -1
- package/dist/esm/intlayer.d.mjs +0 -3
- package/dist/esm/locales copy.mjs +0 -568
- package/dist/esm/locales copy.mjs.map +0 -1
- package/dist/esm/module_augmentation.mjs.map +0 -1
- package/dist/esm/test.mjs +0 -0
- package/dist/esm/test.mjs.map +0 -1
- package/dist/esm/translation.mjs +0 -1
- package/dist/types/backend_models.d.ts +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/intlayer.d.ts +0 -11
- package/dist/types/intlayer.d.ts.map +0 -1
- package/dist/types/locales copy.d.ts +0 -566
- package/dist/types/locales copy.d.ts.map +0 -1
- package/dist/types/test.d.ts +0 -20
- package/dist/types/test.d.ts.map +0 -1
- package/dist/types/translation.d.ts +0 -13
- package/dist/types/translation.d.ts.map +0 -1
package/dist/types/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Locale } from "./locales.js";
|
|
2
|
-
import {
|
|
2
|
+
import { Dictionary } from "./dictionary.js";
|
|
3
3
|
import { Plugin } from "./plugin.js";
|
|
4
4
|
|
|
5
5
|
//#region src/config.d.ts
|
|
@@ -114,16 +114,14 @@ type CookiesAttributes = {
|
|
|
114
114
|
*/
|
|
115
115
|
expires?: Date | number | undefined;
|
|
116
116
|
};
|
|
117
|
-
type
|
|
117
|
+
type StorageAttributes = {
|
|
118
118
|
/**
|
|
119
119
|
* Storage type where the locale is stored
|
|
120
120
|
*
|
|
121
|
-
* Default: 'localStorage'
|
|
122
|
-
*
|
|
123
121
|
* Determines whether the locale is persisted in `localStorage` (across sessions)
|
|
124
|
-
* or `sessionStorage` (cleared when the browser session ends).
|
|
122
|
+
* or `sessionStorage` (cleared when the browser session ends) or `header` (from the request header).
|
|
125
123
|
*/
|
|
126
|
-
type: 'localStorage' | 'sessionStorage';
|
|
124
|
+
type: 'localStorage' | 'sessionStorage' | 'header';
|
|
127
125
|
/**
|
|
128
126
|
* Storage key to store the locale information
|
|
129
127
|
*
|
|
@@ -163,7 +161,7 @@ type RoutingConfig = {
|
|
|
163
161
|
* If false, the locale will not be stored by the middleware.
|
|
164
162
|
* If true, the locale storage will consider all default values.
|
|
165
163
|
*
|
|
166
|
-
* Default: 'cookie'
|
|
164
|
+
* Default: ['cookie', 'header]
|
|
167
165
|
*
|
|
168
166
|
* Note: Check out GDPR compliance for cookies. See https://gdpr.eu/cookies/
|
|
169
167
|
* Note: useLocale hook includes a prop to disable the cookie storage.
|
|
@@ -173,15 +171,7 @@ type RoutingConfig = {
|
|
|
173
171
|
* - Config both localStorage and cookies for the storage of the locale if you want to support GDPR compliance.
|
|
174
172
|
* - Disable the cookie storage by default on the useLocale hook by waiting for the user to consent to the cookie storage.
|
|
175
173
|
*/
|
|
176
|
-
storage: false | 'cookie' | 'localStorage' | 'sessionStorage' | CookiesAttributes |
|
|
177
|
-
/**
|
|
178
|
-
* Header name to get the locale from the request
|
|
179
|
-
*
|
|
180
|
-
* Default: 'x-intlayer-locale'
|
|
181
|
-
*
|
|
182
|
-
* The HTTP header key used to determine the current locale.
|
|
183
|
-
*/
|
|
184
|
-
headerName: string;
|
|
174
|
+
storage: false | 'cookie' | 'localStorage' | 'sessionStorage' | 'header' | CookiesAttributes | StorageAttributes | ('cookie' | 'localStorage' | 'sessionStorage' | 'header' | CookiesAttributes | StorageAttributes)[];
|
|
185
175
|
/**
|
|
186
176
|
* Base path for application URLs
|
|
187
177
|
*
|
|
@@ -190,38 +180,6 @@ type RoutingConfig = {
|
|
|
190
180
|
* Defines the base path where the application is accessible from.
|
|
191
181
|
*/
|
|
192
182
|
basePath: string;
|
|
193
|
-
/**
|
|
194
|
-
* Controls whether locale detection occurs during Next.js prefetch requests
|
|
195
|
-
* - true: Detect and apply locale during prefetch
|
|
196
|
-
* - false: Use default locale during prefetch (recommended)
|
|
197
|
-
*
|
|
198
|
-
* This setting affects how Next.js handles locale prefetching:
|
|
199
|
-
*
|
|
200
|
-
* Example scenario:
|
|
201
|
-
* - User's browser language is 'fr'
|
|
202
|
-
* - Current page is /fr/about
|
|
203
|
-
* - Link prefetches /about
|
|
204
|
-
*
|
|
205
|
-
* With `detectLocaleOnPrefetchNoPrefix:true`
|
|
206
|
-
* - Prefetch detects 'fr' locale from browser
|
|
207
|
-
* - Redirects prefetch to /fr/about
|
|
208
|
-
*
|
|
209
|
-
* With `detectLocaleOnPrefetchNoPrefix:false` (default)
|
|
210
|
-
* - Prefetch uses default locale
|
|
211
|
-
* - Redirects prefetch to /en/about (assuming 'en' is default)
|
|
212
|
-
*
|
|
213
|
-
* When to use true:
|
|
214
|
-
* - Your app uses non-localized internal links (e.g. <a href="/about">)
|
|
215
|
-
* - You want consistent locale detection behavior between regular and prefetch requests
|
|
216
|
-
*
|
|
217
|
-
* When to use false (default):
|
|
218
|
-
* - Your app uses locale-prefixed links (e.g. <a href="/fr/about">)
|
|
219
|
-
* - You want to optimize prefetching performance
|
|
220
|
-
* - You want to avoid potential redirect loops
|
|
221
|
-
*
|
|
222
|
-
* Default: false
|
|
223
|
-
*/
|
|
224
|
-
detectLocaleOnPrefetchNoPrefix: boolean;
|
|
225
183
|
};
|
|
226
184
|
/**
|
|
227
185
|
* Configuration for intlayer editor
|
|
@@ -334,32 +292,6 @@ type EditorConfig = {
|
|
|
334
292
|
* Default: `http://localhost:${liveSyncPort}`
|
|
335
293
|
*/
|
|
336
294
|
liveSyncURL: string;
|
|
337
|
-
/**
|
|
338
|
-
* Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.
|
|
339
|
-
*
|
|
340
|
-
* Example:
|
|
341
|
-
*
|
|
342
|
-
* ```bash
|
|
343
|
-
* npx prettier --write {{file}}
|
|
344
|
-
* ```
|
|
345
|
-
*
|
|
346
|
-
* ```bash
|
|
347
|
-
* bunx biome format {{file}}
|
|
348
|
-
* ```
|
|
349
|
-
*
|
|
350
|
-
* ```bash
|
|
351
|
-
* bun format {{file}}
|
|
352
|
-
* ```
|
|
353
|
-
*
|
|
354
|
-
* ```bash
|
|
355
|
-
* npx eslint --fix {{file}}
|
|
356
|
-
* ```
|
|
357
|
-
*
|
|
358
|
-
* Intlayer will replace the {{file}} with the path of the file to format.
|
|
359
|
-
*
|
|
360
|
-
* Default: undefined
|
|
361
|
-
*/
|
|
362
|
-
formatCommand: string | undefined;
|
|
363
295
|
};
|
|
364
296
|
type AiConfig = {
|
|
365
297
|
/**
|
|
@@ -520,6 +452,10 @@ type CustomIntlayerConfig = {
|
|
|
520
452
|
* Custom internationalization configuration
|
|
521
453
|
*/
|
|
522
454
|
internationalization?: Partial<InternationalizationConfig>;
|
|
455
|
+
/**
|
|
456
|
+
* Custom dictionary configuration
|
|
457
|
+
*/
|
|
458
|
+
dictionary?: Partial<DictionaryConfig>;
|
|
523
459
|
/**
|
|
524
460
|
* Custom routing configuration
|
|
525
461
|
*/
|
|
@@ -549,6 +485,7 @@ type CustomIntlayerConfig = {
|
|
|
549
485
|
*/
|
|
550
486
|
plugins?: Plugin[];
|
|
551
487
|
};
|
|
488
|
+
type DictionaryConfig = Pick<Dictionary, 'fill' | 'description' | 'locale' | 'priority' | 'live' | 'title' | 'tags' | 'version'>;
|
|
552
489
|
/**
|
|
553
490
|
* Combined configuration for internationalization, middleware, and content
|
|
554
491
|
*/
|
|
@@ -557,6 +494,10 @@ type IntlayerConfig = {
|
|
|
557
494
|
* Internationalization configuration
|
|
558
495
|
*/
|
|
559
496
|
internationalization: InternationalizationConfig;
|
|
497
|
+
/**
|
|
498
|
+
* Default dictionary configuration
|
|
499
|
+
*/
|
|
500
|
+
dictionary?: Partial<DictionaryConfig>;
|
|
560
501
|
/**
|
|
561
502
|
* Routing configuration
|
|
562
503
|
*/
|
|
@@ -621,12 +562,31 @@ type BaseContentConfig = {
|
|
|
621
562
|
*/
|
|
622
563
|
watch: boolean;
|
|
623
564
|
/**
|
|
624
|
-
*
|
|
565
|
+
* Command to format the content. When intlayer write your .content files locally, this command will be used to format the content.
|
|
625
566
|
*
|
|
626
|
-
*
|
|
567
|
+
* Example:
|
|
568
|
+
*
|
|
569
|
+
* ```bash
|
|
570
|
+
* npx prettier --write {{file}}
|
|
571
|
+
* ```
|
|
627
572
|
*
|
|
573
|
+
* ```bash
|
|
574
|
+
* bunx biome format {{file}}
|
|
575
|
+
* ```
|
|
576
|
+
*
|
|
577
|
+
* ```bash
|
|
578
|
+
* bun format {{file}}
|
|
579
|
+
* ```
|
|
580
|
+
*
|
|
581
|
+
* ```bash
|
|
582
|
+
* npx eslint --fix {{file}}
|
|
583
|
+
* ```
|
|
584
|
+
*
|
|
585
|
+
* Intlayer will replace the {{file}} with the path of the file to format.
|
|
586
|
+
*
|
|
587
|
+
* Default: undefined
|
|
628
588
|
*/
|
|
629
|
-
|
|
589
|
+
formatCommand: string | undefined;
|
|
630
590
|
};
|
|
631
591
|
/**
|
|
632
592
|
* Configuration derived based on the base content configuration
|
|
@@ -789,5 +749,5 @@ type LogConfig = {
|
|
|
789
749
|
debug?: typeof console.debug;
|
|
790
750
|
};
|
|
791
751
|
//#endregion
|
|
792
|
-
export { AiConfig, BaseContentConfig, BaseDerivedConfig, BuildConfig, ContentConfig, CookiesAttributes, CustomIntlayerConfig, EditorConfig, InternationalizationConfig, IntlayerConfig,
|
|
752
|
+
export { AiConfig, BaseContentConfig, BaseDerivedConfig, BuildConfig, ContentConfig, CookiesAttributes, CustomIntlayerConfig, DictionaryConfig, EditorConfig, InternationalizationConfig, IntlayerConfig, LogConfig, LogFunctions, PatternsContentConfig, RoutingConfig, StorageAttributes, StrictMode };
|
|
793
753
|
//# sourceMappingURL=config.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/config.ts"],"sourcesContent":[],"mappings":";;;;;KAIY,UAAA;;AAAZ;AAKA;AAQW,KARC,0BAAA,GAQD;EAWQ;;;;AAsBnB;AAwEA;
|
|
1
|
+
{"version":3,"file":"config.d.ts","names":[],"sources":["../../src/config.ts"],"sourcesContent":[],"mappings":";;;;;KAIY,UAAA;;AAAZ;AAKA;AAQW,KARC,0BAAA,GAQD;EAWQ;;;;AAsBnB;AAwEA;AAsBA;EA4CM,OAAA,EA3KK,MA2KL,EAAA;EACA;;;;AAuBN;AAyHA;AAyDA;AA4GA;;EAIyB,eAAA,EA1dN,MA0dM,EAAA;EAKF;;;;;;;;EAoBP,UAAA,EAzeF,UAyeE;EAAR;;;;;;;EAkBI,aAAA,EAlfK,MAkfW;AAe5B,CAAA;AAIwB,KAlgBZ,iBAAA,GAkgBY;EAKD;;;;;EAoBhB,IAAA,EAAA,QAAA;EAKQ;;;;;AAgBf;AAkEA;EAwGY,IAAA,CAAA,EAAA,MAAA;EAiCA;;;;;AAIZ;;;EAGgB,MAAQ,CAAA,EAAA,MAAA;EACR;;AAGhB;;;;;EA4BiB,IAAA,CAAQ,EAAA,MAAA;EAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;YA7tBlB;;KAGA,iBAAA;;;;;;;;;;;;;;;;;;;;KAsBA,aAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;6EA4CN,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Q"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dictionary.d.ts","names":[],"sources":["../../src/dictionary.ts"],"sourcesContent":[],"mappings":";;;;KAGK,QAAA;KAEA,aAAA;EAFA,QAAA,EAGO,QAHC,GAAA,GAGa,QAHb,EAAA;AAAA,CAAA;AAMI,UAAA,SAAS,CAAA,
|
|
1
|
+
{"version":3,"file":"dictionary.d.ts","names":[],"sources":["../../src/dictionary.ts"],"sourcesContent":[],"mappings":";;;;KAGK,QAAA;KAEA,aAAA;EAFA,QAAA,EAGO,QAHC,GAAA,GAGa,QAHb,EAAA;AAAA,CAAA;AAMI,UAAA,SAAS,CAAA,aAA+B,SAAA,CAAA,SAAA,aAAa,CAAA,CAAG;KAEpE,oBAEY,CAAA,UAAA,CAAA,GAAA,CAAA,IAAA,CAAA,EAAA,GAAA,EAAA,GAAZ,WAAY,CAAA,UAAA,CAAA,GAAY,OAAZ,CAAoB,WAApB,CAAgC,UAAhC,CAAA,CAAA;AAAZ,KAEO,WAFP,CAAA,IAAA,SAAA,EAAA,gBAAA,KAAA,EAAA,cAKQ,CALR,SAAA,SAAA,GAK8B,QAL9B,GAKyC,CALzC,EAAA,GAOD,UAPC,GAQD,SARC,CAQS,UART,CAAA,GAAA,CAAA,CAAA,IAAA,CAAA,EAAA,GAAA,EAAA,GASgB,WAThB,CAS4B,UAT5B,CAAA,CAAA,GAAA,CAUA,aAVA,SAAA,IAAA,GAU6B,oBAV7B,CAUkD,UAVlD,CAAA,GAAA,SAAA,CAAA;KAaA,OAb4C,CAAA,CAAA,CAAA,GAa/B,CAb+B,SAAA,GAAA,EAAA,GAAA,IAAA,GAAA,KAAA;KAe5C,wBAfgC,CAAA,CAAA,EAAA,aAAA,CAAA,GAea,CAfb,SAAA,CAAA,KAAA,EAAA,CAAA,EAAA;AAAA;AAkBjC,WAlByB,CAkBb,CAlBa,EAkBV,aAlBU,CAAA,GAkBO,mBAlBP,CAkB2B,CAlB3B,EAkB8B,aAlB9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,CAAA,EAAA,MAAA;EAEe;;;;;AAG1B;;;;;;;;;;;;;EAMO,WAAA,CAAA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAjKI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAoCF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;WAkHE,sCAEL,oBAAoB,aAAa,iBAAiB;;KAG5C,mBAAmB,uCAC3B,gBAAgB,IACd,WAAW,EAAE,IAAI,gBAEnB,gBAAgB,IACd,EAAE,KACF"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Locale, locales_d_exports } from "./locales.js";
|
|
2
|
-
import { DeclaredLocales, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, LocalesValues, RequiredLocales, StrictModeLocaleMap
|
|
2
|
+
import { DeclaredLocales, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, LocalesValues, RequiredLocales, StrictModeLocaleMap } from "./module_augmentation.js";
|
|
3
3
|
import { NodeType, TypedNodeModel, formatNodeType } from "./nodeType.js";
|
|
4
4
|
import { ContentNode, Dictionary, Fill, GetSubPath, LocalDictionaryId, TypedNode } from "./dictionary.js";
|
|
5
5
|
import { MergedDictionaryOutput, MergedDictionaryResult, Plugin, UnmergedDictionaryOutput, UnmergedDictionaryResult } from "./plugin.js";
|
|
6
|
-
import { AiConfig, BaseContentConfig, BaseDerivedConfig, BuildConfig, ContentConfig, CookiesAttributes, CustomIntlayerConfig, EditorConfig, InternationalizationConfig, IntlayerConfig,
|
|
6
|
+
import { AiConfig, BaseContentConfig, BaseDerivedConfig, BuildConfig, ContentConfig, CookiesAttributes, CustomIntlayerConfig, DictionaryConfig, EditorConfig, InternationalizationConfig, IntlayerConfig, LogConfig, LogFunctions, PatternsContentConfig, RoutingConfig, StorageAttributes, StrictMode } from "./config.js";
|
|
7
7
|
import { ArrayNode, ConditionNode, EnumerationNode, FileNode, GenderNode, InsertionNode, KeyPath, MarkdownNode, NestedNode, ObjectNode, ReactNode, TranslationNode } from "./keyPath.js";
|
|
8
|
-
export { AiConfig, ArrayNode, BaseContentConfig, BaseDerivedConfig, BuildConfig, ConditionNode, ContentConfig, ContentNode, CookiesAttributes, CustomIntlayerConfig, DeclaredLocales, Dictionary, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, EditorConfig, EnumerationNode, FileNode, Fill, GenderNode, GetSubPath, InsertionNode, InternationalizationConfig, IntlayerConfig, KeyPath, LocalDictionaryId, type Locale,
|
|
8
|
+
export { AiConfig, ArrayNode, BaseContentConfig, BaseDerivedConfig, BuildConfig, ConditionNode, ContentConfig, ContentNode, CookiesAttributes, CustomIntlayerConfig, DeclaredLocales, Dictionary, DictionaryConfig, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, EditorConfig, EnumerationNode, FileNode, Fill, GenderNode, GetSubPath, InsertionNode, InternationalizationConfig, IntlayerConfig, KeyPath, LocalDictionaryId, type Locale, locales_d_exports as Locales, LocalesValues, LogConfig, LogFunctions, MarkdownNode, MergedDictionaryOutput, MergedDictionaryResult, NestedNode, NodeType, ObjectNode, PatternsContentConfig, Plugin, ReactNode, RequiredLocales, RoutingConfig, StorageAttributes, StrictMode, StrictModeLocaleMap, TranslationNode, TypedNode, TypedNodeModel, UnmergedDictionaryOutput, UnmergedDictionaryResult, formatNodeType };
|
|
@@ -4,27 +4,21 @@ import { StrictMode } from "./config.js";
|
|
|
4
4
|
import { __DeclaredLocalesRegistry, __DictionaryRegistry, __RequiredLocalesRegistry, __StrictModeRegistry } from "intlayer";
|
|
5
5
|
|
|
6
6
|
//#region src/module_augmentation.d.ts
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Provides a fallback to string type if the generic type T is undefined,
|
|
10
|
-
* otherwise returns T. This is useful for handling cases where no keys are found.
|
|
11
|
-
* Example: StringFallback<undefined> -> string; StringFallback<'key'> -> 'key'
|
|
12
|
-
*/
|
|
13
|
-
type StringFallback<T> = T extends never ? string : T;
|
|
14
7
|
type DictionaryKeys = keyof __DictionaryRegistry extends never ? string : keyof __DictionaryRegistry;
|
|
15
8
|
type DictionaryRegistry = __DictionaryRegistry[keyof __DictionaryRegistry] extends never ? Record<string, Dictionary> : __DictionaryRegistry;
|
|
16
9
|
type DictionaryRegistryElement<T extends DictionaryKeys> = [string] extends [T] ? Dictionary : __DictionaryRegistry[T] extends Dictionary ? __DictionaryRegistry[T] : Dictionary;
|
|
17
10
|
type DictionaryRegistryContent<T extends PropertyKey> = [T] extends [keyof __DictionaryRegistry] ? __DictionaryRegistry[T] extends {
|
|
18
11
|
content: infer C;
|
|
19
12
|
} ? C : any : any;
|
|
20
|
-
type
|
|
21
|
-
type
|
|
13
|
+
type NarrowStringKeys<T> = string extends keyof T ? never : Extract<keyof T, string>;
|
|
14
|
+
type DeclaredLocales = [NarrowStringKeys<__DeclaredLocalesRegistry>] extends [never] ? Locale : NarrowStringKeys<__DeclaredLocalesRegistry>;
|
|
15
|
+
type RequiredLocales = [NarrowStringKeys<__RequiredLocalesRegistry>] extends [never] ? never : NarrowStringKeys<__RequiredLocalesRegistry>;
|
|
22
16
|
/** Define MyType using the ValueOf utility type on Locales */
|
|
23
|
-
type LocalesValues =
|
|
17
|
+
type LocalesValues = DeclaredLocales | (string & {});
|
|
24
18
|
type ResolvedStrictMode = __StrictModeRegistry extends {
|
|
25
19
|
mode: infer M;
|
|
26
20
|
} ? M : 'inclusive';
|
|
27
21
|
type StrictModeLocaleMap<Content = unknown, Mode extends StrictMode = ResolvedStrictMode> = RequiredLocales extends never ? Partial<Record<Locale, Content>> : Mode extends 'strict' ? Required<Record<RequiredLocales, Content>> & Partial<Record<DeclaredLocales, Content>> : Mode extends 'inclusive' ? Required<Record<RequiredLocales, Content>> & Partial<Record<Locale, Content>> : Partial<Record<Locale, Content>>;
|
|
28
22
|
//#endregion
|
|
29
|
-
export { DeclaredLocales, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, LocalesValues, RequiredLocales, StrictModeLocaleMap
|
|
23
|
+
export { DeclaredLocales, DictionaryKeys, DictionaryRegistry, DictionaryRegistryContent, DictionaryRegistryElement, LocalesValues, RequiredLocales, StrictModeLocaleMap };
|
|
30
24
|
//# sourceMappingURL=module_augmentation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module_augmentation.d.ts","names":[],"sources":["../../src/module_augmentation.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"module_augmentation.d.ts","names":[],"sources":["../../src/module_augmentation.ts"],"sourcesContent":[],"mappings":";;;;;;KAUY,cAAA,SAAuB,oDAEzB;KAGE,kBAAA,GACV,2BAA2B,sCACvB,eAAe,cACf;AARM,KAUA,yBAVuB,CAAA,UAUa,cARtC,CAAA,GAAA,CAGE,MAAA,CACV,SAAA,CAMS,CANT,CAAA,GAOE,UAPF,GAQE,oBARF,CAQuB,CARvB,CAAA,SAQkC,UARlC,GASI,oBATJ,CASyB,CATzB,CAAA,GAUI,UAVJ;AAA2B,KAYjB,yBAZiB,CAAA,UAYmB,WAZnB,CAAA,GAAA,CAYmC,CAZnC,CAAA,SAAA,CACR,MAYb,oBAZa,CAAf,GAcF,oBAdE,CAcmB,CAdnB,CAAA,SAAA;EACA,OAAA,EAAA,KAAA,EAAA;CAAoB,GAcpB,CAdoB,GAAA,GAAA,GAAA,GAAA;AAE1B,KAkBK,gBAlBO,CAAA,CAAA,CAAA,GAAA,MAAyB,SAAA,MAkBW,CAlBX,GAAA,KAAA,GAoBjC,OApBiC,CAAA,MAoBnB,CApBmB,EAAA,MAAA,CAAA;AAAW,KAsBpC,eAAA,GAtBoC,CAuB9C,gBArBS,CAqBQ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
|
5
5
|
"description": "Retrieve Intlayer configurations and manage environment variables for both server-side and client-side environments.",
|
|
6
6
|
"keywords": [
|
|
@@ -76,9 +76,9 @@
|
|
|
76
76
|
},
|
|
77
77
|
"devDependencies": {
|
|
78
78
|
"@types/node": "24.9.1",
|
|
79
|
-
"@utils/ts-config": "7.0.
|
|
80
|
-
"@utils/ts-config-types": "7.0.
|
|
81
|
-
"@utils/tsdown-config": "7.0.
|
|
79
|
+
"@utils/ts-config": "7.0.1",
|
|
80
|
+
"@utils/ts-config-types": "7.0.1",
|
|
81
|
+
"@utils/tsdown-config": "7.0.1",
|
|
82
82
|
"rimraf": "6.0.1",
|
|
83
83
|
"tsdown": "0.15.9",
|
|
84
84
|
"typescript": "5.9.3",
|
|
File without changes
|
package/dist/cjs/index.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["LocalesList"],"sources":["../../src/index.ts"],"sourcesContent":["import type { Locale } from './locales';\nimport * as LocalesList from './locales';\n\nexport const Locales = LocalesList as unknown as Locale;\nexport type { Locale };\n\nexport * from './config';\nexport * from './dictionary';\nexport * from './keyPath';\nexport * from './module_augmentation';\nexport * from './nodeType';\nexport * from './plugin';\nexport * from './translation';\n"],"mappings":";;;;AAGA,MAAa,UAAUA"}
|
package/dist/cjs/intlayer.d.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require("intlayer");
|