@intlayer/babel 9.4.2 → 9.4.4

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.
Files changed (53) hide show
  1. package/dist/types/babel-plugin-intlayer-extract.d.ts +3 -4
  2. package/dist/types/babel-plugin-intlayer-extract.d.ts.map +1 -1
  3. package/dist/types/babel-plugin-intlayer-field-rename.d.ts +8 -9
  4. package/dist/types/babel-plugin-intlayer-field-rename.d.ts.map +1 -1
  5. package/dist/types/babel-plugin-intlayer-minify.d.ts +2 -3
  6. package/dist/types/babel-plugin-intlayer-minify.d.ts.map +1 -1
  7. package/dist/types/babel-plugin-intlayer-optimize.d.ts +2 -3
  8. package/dist/types/babel-plugin-intlayer-optimize.d.ts.map +1 -1
  9. package/dist/types/babel-plugin-intlayer-purge.d.ts +4 -5
  10. package/dist/types/babel-plugin-intlayer-purge.d.ts.map +1 -1
  11. package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts +15 -15
  12. package/dist/types/babel-plugin-intlayer-usage-analyzer.d.ts.map +1 -1
  13. package/dist/types/babelParser.d.ts +3 -4
  14. package/dist/types/babelParser.d.ts.map +1 -1
  15. package/dist/types/extractContent/babelProcessor.d.ts +4 -5
  16. package/dist/types/extractContent/babelProcessor.d.ts.map +1 -1
  17. package/dist/types/extractContent/contentWriter.d.ts +3 -4
  18. package/dist/types/extractContent/contentWriter.d.ts.map +1 -1
  19. package/dist/types/extractContent/extractContent.d.ts +3 -4
  20. package/dist/types/extractContent/extractContent.d.ts.map +1 -1
  21. package/dist/types/extractContent/processTsxFile.d.ts +2 -3
  22. package/dist/types/extractContent/processTsxFile.d.ts.map +1 -1
  23. package/dist/types/extractContent/utils/constants.d.ts +3 -4
  24. package/dist/types/extractContent/utils/constants.d.ts.map +1 -1
  25. package/dist/types/extractContent/utils/detectPackageName.d.ts +1 -2
  26. package/dist/types/extractContent/utils/detectPackageName.d.ts.map +1 -1
  27. package/dist/types/extractContent/utils/extractDictionaryInfo.d.ts +5 -6
  28. package/dist/types/extractContent/utils/extractDictionaryInfo.d.ts.map +1 -1
  29. package/dist/types/extractContent/utils/extractDictionaryKey.d.ts +2 -3
  30. package/dist/types/extractContent/utils/extractDictionaryKey.d.ts.map +1 -1
  31. package/dist/types/extractContent/utils/generateKey.d.ts +1 -2
  32. package/dist/types/extractContent/utils/generateKey.d.ts.map +1 -1
  33. package/dist/types/extractContent/utils/getComponentName.d.ts +1 -2
  34. package/dist/types/extractContent/utils/getComponentName.d.ts.map +1 -1
  35. package/dist/types/extractContent/utils/getExistingIntlayerInfo.d.ts +2 -3
  36. package/dist/types/extractContent/utils/getExistingIntlayerInfo.d.ts.map +1 -1
  37. package/dist/types/extractContent/utils/getOrGenerateKey.d.ts +1 -2
  38. package/dist/types/extractContent/utils/getOrGenerateKey.d.ts.map +1 -1
  39. package/dist/types/extractContent/utils/resolveDictionaryKey.d.ts +1 -2
  40. package/dist/types/extractContent/utils/resolveDictionaryKey.d.ts.map +1 -1
  41. package/dist/types/extractScriptBlocks.d.ts +3 -4
  42. package/dist/types/extractScriptBlocks.d.ts.map +1 -1
  43. package/dist/types/getExtractPluginOptions.d.ts +2 -3
  44. package/dist/types/getExtractPluginOptions.d.ts.map +1 -1
  45. package/dist/types/getOptimizePluginOptions.d.ts +1 -2
  46. package/dist/types/getOptimizePluginOptions.d.ts.map +1 -1
  47. package/dist/types/getPurgePluginOptions.d.ts +2 -3
  48. package/dist/types/getPurgePluginOptions.d.ts.map +1 -1
  49. package/dist/types/normalizedFilesList.d.ts +1 -2
  50. package/dist/types/normalizedFilesList.d.ts.map +1 -1
  51. package/dist/types/transformers.d.ts +9 -10
  52. package/dist/types/transformers.d.ts.map +1 -1
  53. package/package.json +11 -11
@@ -5,13 +5,13 @@ import { Locale } from "@intlayer/types/allLocales";
5
5
  import { IntlayerConfig } from "@intlayer/types/config";
6
6
  import { FilePathPattern } from "@intlayer/types/filePathPattern";
7
7
  //#region src/babel-plugin-intlayer-extract.d.ts
8
- type ExtractResult = {
8
+ export type ExtractResult = {
9
9
  dictionaryKey: string;
10
10
  filePath: string;
11
11
  content: Record<string, string>;
12
12
  locale: Locale;
13
13
  };
14
- type ExtractPluginOptions = {
14
+ export type ExtractPluginOptions = {
15
15
  packageName?: PackageName;
16
16
  filesList: string[];
17
17
  enabled: boolean;
@@ -48,9 +48,8 @@ type State = PluginPass & {
48
48
  * };
49
49
  * ```
50
50
  */
51
- declare const intlayerExtractBabelPlugin: (_babel: {
51
+ export declare const intlayerExtractBabelPlugin: (_babel: {
52
52
  types: typeof BabelTypes;
53
53
  }) => PluginObject<State>;
54
54
  //#endregion
55
- export { ExtractPluginOptions, ExtractResult, intlayerExtractBabelPlugin };
56
55
  //# sourceMappingURL=babel-plugin-intlayer-extract.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-extract.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-extract.ts"],"mappings":";;;;;;;KAeY;EACV;EACA;EACA,SAAS;EACT,QAAQ;;KAGE;EACV,cAAc;EACd;EACA;EAEA,iBAAiB;EACjB,eAAe;;;;;;EAMf,aAAa,QAAQ,yBAAyB;;;;EAI9C,SAAS;;KAGN,QAAQ;EAAe,MAAM;;;;;;;;;;;;;;;;;;;cAmBrB,6BAA0B;EACrC,cAAc;MACZ,aAAa"}
1
+ {"version":3,"file":"babel-plugin-intlayer-extract.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-extract.ts"],"mappings":";;;;;;;YAeY;EACV;EACA;EACA,SAAS;EACT,QAAQ;;YAGE;EACV,cAAc;EACd;EACA;EAEA,iBAAiB;EACjB,eAAe;;;;;;EAMf,aAAa,QAAQ,yBAAyB;;;;EAI9C,SAAS;;KAGN,QAAQ;EAAe,MAAM;;;;;;;;;;;;;;;;;;;qBAmBrB,6BAA0B;EACrC,cAAc;MACZ,aAAa"}
@@ -6,7 +6,7 @@ import * as BabelTypes from "@babel/types";
6
6
  * Converts a zero-based index to a short alphabetic identifier.
7
7
  * 0 → 'a', 1 → 'b', …, 25 → 'z', 26 → 'aa', 27 → 'ab', …
8
8
  */
9
- declare const generateShortFieldName: (index: number) => string;
9
+ export declare const generateShortFieldName: (index: number) => string;
10
10
  /**
11
11
  * Recursively builds a `NestedRenameMap` from a compiled dictionary content
12
12
  * value by traversing the intlayer node structure.
@@ -34,7 +34,7 @@ declare const generateShortFieldName: (index: number) => string;
34
34
  *
35
35
  * @param contentValue - The dictionary content value to analyse.
36
36
  */
37
- declare const buildNestedRenameMapFromContent: (contentValue: unknown) => NestedRenameMap;
37
+ export declare const buildNestedRenameMapFromContent: (contentValue: unknown) => NestedRenameMap;
38
38
  /**
39
39
  * Walks `fieldPath` through a {@link NestedRenameMap} and returns the entry at
40
40
  * the final path segment, or `undefined` when any segment is missing (e.g. the
@@ -46,21 +46,21 @@ declare const buildNestedRenameMapFromContent: (contentValue: unknown) => Nested
46
46
  * @param renameMap - The root rename map to walk.
47
47
  * @param fieldPath - Original (pre-rename) field names from the content root.
48
48
  */
49
- declare const getNestedRenameEntryAtPath: (renameMap: NestedRenameMap, fieldPath: readonly string[]) => NestedRenameEntry | undefined;
49
+ export declare const getNestedRenameEntryAtPath: (renameMap: NestedRenameMap, fieldPath: readonly string[]) => NestedRenameEntry | undefined;
50
50
  /**
51
51
  * JSON-serialisable form of a {@link NestedRenameEntry}.
52
52
  *
53
53
  * Mirrors `FieldRenameNode` in the `@intlayer/swc` crate — both sides must stay
54
54
  * in sync.
55
55
  */
56
- type SerializedFieldRenameEntry = {
56
+ export type SerializedFieldRenameEntry = {
57
57
  /** Short alphabetic alias the field is renamed to (`'a'`, `'b'`, …). */
58
58
  shortName: string;
59
59
  /** Rename table of the fields nested inside this one. */
60
60
  children: SerializedFieldRenameMap;
61
61
  };
62
62
  /** JSON-serialisable form of a {@link NestedRenameMap}. */
63
- type SerializedFieldRenameMap = Record<string, SerializedFieldRenameEntry>;
63
+ export type SerializedFieldRenameMap = Record<string, SerializedFieldRenameEntry>;
64
64
  /**
65
65
  * Converts the field-rename tables of a {@link PruneContext} into a plain JSON
66
66
  * object, keyed by dictionary key.
@@ -74,7 +74,7 @@ type SerializedFieldRenameMap = Record<string, SerializedFieldRenameEntry>;
74
74
  * Empty tables are omitted as well, so the result is empty when there is
75
75
  * nothing to rename.
76
76
  */
77
- declare const serializeFieldRenameMap: (pruneContext: PruneContext) => Record<string, SerializedFieldRenameMap>;
77
+ export declare const serializeFieldRenameMap: (pruneContext: PruneContext) => Record<string, SerializedFieldRenameMap>;
78
78
  /**
79
79
  * Rewrites dictionary content field accesses in the given program to the
80
80
  * short aliases defined in `pruneContext.dictionaryKeyToFieldRenameMap`.
@@ -99,7 +99,7 @@ declare const serializeFieldRenameMap: (pruneContext: PruneContext) => Record<st
99
99
  * {@link makeFieldRenameBabelPlugin} and `intlayerMinifyBabelPlugin` can
100
100
  * invoke it from their own `Program.exit` visitors.
101
101
  */
102
- declare const renameIntlayerFieldAccesses: (babelTypes: typeof BabelTypes, programPath: NodePath<BabelTypes.Program>, pruneContext: PruneContext) => void;
102
+ export declare const renameIntlayerFieldAccesses: (babelTypes: typeof BabelTypes, programPath: NodePath<BabelTypes.Program>, pruneContext: PruneContext) => void;
103
103
  /**
104
104
  * Creates a Babel plugin that rewrites dictionary content field accesses in
105
105
  * source files to their short aliases via
@@ -109,9 +109,8 @@ declare const renameIntlayerFieldAccesses: (babelTypes: typeof BabelTypes, progr
109
109
  * `intlayerOptimizeBabelPlugin`, because the latter replaces `useIntlayer`
110
110
  * with `useDictionary`, erasing the dictionary-key information needed here.
111
111
  */
112
- declare const makeFieldRenameBabelPlugin: (pruneContext: PruneContext) => ({ types: babelTypes }: {
112
+ export declare const makeFieldRenameBabelPlugin: (pruneContext: PruneContext) => ({ types: babelTypes }: {
113
113
  types: typeof BabelTypes;
114
114
  }) => PluginObject;
115
115
  //#endregion
116
- export { SerializedFieldRenameEntry, SerializedFieldRenameMap, buildNestedRenameMapFromContent, generateShortFieldName, getNestedRenameEntryAtPath, makeFieldRenameBabelPlugin, renameIntlayerFieldAccesses, serializeFieldRenameMap };
117
116
  //# sourceMappingURL=babel-plugin-intlayer-field-rename.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-field-rename.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-field-rename.ts"],"mappings":";;;;;;;;cA4Ba,yBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA0CtB,kCAA+B,0BAEzC;;;;;;;;;;;;cA2EU,6BAA0B,WAC1B,iBAAe,iCAEzB;;;;;;;KAqBS;;EAEV;;EAEA,UAAU;;;KAIA,2BAA2B,eAErC;;;;;;;;;;;;;;cAgCW,0BAAuB,cACpB,iBACb,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;cA4aL,8BAA2B,mBACnB,YAAU,aAChB,SAAS,WAAW,UAAQ,cAC3B;;;;;;;;;;cAsIH,6BAA0B,cACtB,oBAAY,OAAA;EACD,cAAc;MAAe"}
1
+ {"version":3,"file":"babel-plugin-intlayer-field-rename.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-field-rename.ts"],"mappings":";;;;;;;;qBA4Ba,yBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA0CtB,kCAA+B,0BAEzC;;;;;;;;;;;;qBA2EU,6BAA0B,WAC1B,iBAAe,iCAEzB;;;;;;;YAqBS;;EAEV;;EAEA,UAAU;;;YAIA,2BAA2B,eAErC;;;;;;;;;;;;;;qBAgCW,0BAAuB,cACpB,iBACb,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;qBA4aL,8BAA2B,mBACnB,YAAU,aAChB,SAAS,WAAW,UAAQ,cAC3B;;;;;;;;;;qBAsIH,6BAA0B,cACtB,oBAAY,OAAA;EACD,cAAc;MAAe"}
@@ -8,7 +8,7 @@ import * as BabelTypes from "@babel/types";
8
8
  * {@link getMinifyPluginOptions}) so the plugin does not read the intlayer
9
9
  * configuration file on every file transform.
10
10
  */
11
- type MinifyPluginOptions = {
11
+ export type MinifyPluginOptions = {
12
12
  /**
13
13
  * Absolute path to the project root. Used to look up the shared
14
14
  * {@link PruneContext} built by {@link intlayerPurgeBabelPlugin}.
@@ -75,9 +75,8 @@ type MinifyPluginOptions = {
75
75
  * `useDictionary`, erasing the dictionary-key information needed to look up
76
76
  * the rename map.
77
77
  */
78
- declare const intlayerMinifyBabelPlugin: (babel: {
78
+ export declare const intlayerMinifyBabelPlugin: (babel: {
79
79
  types: typeof BabelTypes;
80
80
  }) => PluginObject;
81
81
  //#endregion
82
- export { MinifyPluginOptions, intlayerMinifyBabelPlugin };
83
82
  //# sourceMappingURL=babel-plugin-intlayer-minify.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-minify.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-minify.ts"],"mappings":";;;;;;;;;;KAgBY;;;;;EAKV;;;;;;EAOA;;;;;EAMA;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAkDW,4BAAyB;EACpC,cAAc;MACZ"}
1
+ {"version":3,"file":"babel-plugin-intlayer-minify.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-minify.ts"],"mappings":";;;;;;;;;;YAgBY;;;;;EAKV;;;;;;EAOA;;;;;EAMA;;;;EAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAkDW,4BAAyB;EACpC,cAAc;MACZ"}
@@ -6,7 +6,7 @@ declare const CALLER_LIST: readonly ['useIntlayer', 'getIntlayer', 'getIntlayerA
6
6
  /**
7
7
  * Options for the optimization Babel plugin
8
8
  */
9
- type OptimizePluginOptions = {
9
+ export type OptimizePluginOptions = {
10
10
  /**
11
11
  * If false, the plugin will not apply any transformation.
12
12
  */
@@ -208,9 +208,8 @@ type State = PluginPass & {
208
208
  * const content2 = getIntlayer(_dicHash);
209
209
  * ```
210
210
  */
211
- declare const intlayerOptimizeBabelPlugin: (babel: {
211
+ export declare const intlayerOptimizeBabelPlugin: (babel: {
212
212
  types: typeof BabelTypes;
213
213
  }) => PluginObject<State>;
214
214
  //#endregion
215
- export { OptimizePluginOptions, intlayerOptimizeBabelPlugin };
216
215
  //# sourceMappingURL=babel-plugin-intlayer-optimize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-optimize.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-optimize.ts"],"mappings":";;;;cA8BM;;;;KAwDM;;;;EAIV;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;;;;;;;;;;;;EAeA;;;;EAIA;;;;EAIA,oBAAoB;;;;EAOpB;;;;EAIA;;;;;;;;;;;;;;EAcA,gBAAgB;;KAGb,QAAQ;EACX,MAAM;;EAEN,oBAAoB,YAAY,WAAW;;EAE3C,qBAAqB,YAAY,WAAW;;EAE5C;;EAEA,aAAa,oBAAoB;;EAEjC,oBAAoB;;EAEpB,mBAAmB,YAAY;;EAE/B;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+TW,8BAA2B;EACtC,cAAc;MACZ,aAAa"}
1
+ {"version":3,"file":"babel-plugin-intlayer-optimize.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-optimize.ts"],"mappings":";;;;cA8BM;;;;YAwDM;;;;EAIV;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;EAIA;;;;;;;;;;;;;;;EAeA;;;;EAIA;;;;EAIA,oBAAoB;;;;EAOpB;;;;EAIA;;;;;;;;;;;;;;EAcA,gBAAgB;;KAGb,QAAQ;EACX,MAAM;;EAEN,oBAAoB,YAAY,WAAW;;EAE3C,qBAAqB,YAAY,WAAW;;EAE5C;;EAEA,aAAa,oBAAoB;;EAEjC,oBAAoB;;EAEpB,mBAAmB,YAAY;;EAE/B;;EAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA+TW,8BAA2B;EACtC,cAAc;MACZ,aAAa"}
@@ -11,7 +11,7 @@ import { NestedFieldReferences } from "@intlayer/core/dictionaryManipulator";
11
11
  * {@link getPurgePluginOptions}) so the plugin itself does not need to read
12
12
  * the configuration file on every file transform.
13
13
  */
14
- type PurgePluginOptions = {
14
+ export type PurgePluginOptions = {
15
15
  /**
16
16
  * Absolute path to the project root. Used as the cache key for the shared
17
17
  * {@link PruneContext} so two Babel transform pipelines for different
@@ -99,7 +99,7 @@ type PurgePluginOptions = {
99
99
  * Used by {@link intlayerMinifyBabelPlugin} to read the rename map without
100
100
  * creating a circular dependency.
101
101
  */
102
- declare const getSharedPruneContext: (baseDir: string) => PruneContext | null;
102
+ export declare const getSharedPruneContext: (baseDir: string) => PruneContext | null;
103
103
  /**
104
104
  * Runs the full purge/minify pipeline for the given options, using a
105
105
  * module-level cache so the work happens at most once per process per
@@ -117,7 +117,7 @@ declare const getSharedPruneContext: (baseDir: string) => PruneContext | null;
117
117
  * in-place. Call it at most once per build, after the dictionaries have been
118
118
  * built.
119
119
  */
120
- declare const runIntlayerPurgePipeline: (options: PurgePluginOptions) => PruneContext;
120
+ export declare const runIntlayerPurgePipeline: (options: PurgePluginOptions) => PruneContext;
121
121
  /**
122
122
  * Babel plugin that analyses all project source files and rewrites compiled
123
123
  * dictionary JSON files in-place to remove unused content fields
@@ -168,9 +168,8 @@ declare const runIntlayerPurgePipeline: (options: PurgePluginOptions) => PruneCo
168
168
  * renaming is skipped, so the `keyPath` the visual editor receives keeps
169
169
  * matching the unmerged dictionaries it edits.
170
170
  */
171
- declare const intlayerPurgeBabelPlugin: (_babel: {
171
+ export declare const intlayerPurgeBabelPlugin: (_babel: {
172
172
  types: typeof BabelTypes;
173
173
  }) => PluginObject;
174
174
  //#endregion
175
- export { PurgePluginOptions, getSharedPruneContext, intlayerPurgeBabelPlugin, runIntlayerPurgePipeline };
176
175
  //# sourceMappingURL=babel-plugin-intlayer-purge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-purge.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-purge.ts"],"mappings":";;;;;;;;;;;;;KA2CY;;;;;;EAMV;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;;;;EASA,6BAA6B,YAAY;;;;;;EAOzC,8BAA8B;;;;;;;;;;;;EAgB9B,gBAAgB;;;;;;;EAQhB,YAAY,KAAK;;;;;;;;;;cAwBN,wBAAqB,oBAAsB;;;;;;;;;;;;;;;;;;cA0rB3C,2BAAwB,SAC1B,uBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmIU,2BAAwB;EACnC,cAAc;MACZ"}
1
+ {"version":3,"file":"babel-plugin-intlayer-purge.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-purge.ts"],"mappings":";;;;;;;;;;;;;YA2CY;;;;;;EAMV;;;;;EAMA;;;;;;EAOA;;;;;;EAOA;;;;;;EAOA;;;;;EAMA;;;;;EAMA;;;;;;EAOA;;;;;;;;EASA,6BAA6B,YAAY;;;;;;EAOzC,8BAA8B;;;;;;;;;;;;EAgB9B,gBAAgB;;;;;;;EAQhB,YAAY,KAAK;;;;;;;;;;qBAwBN,wBAAqB,oBAAsB;;;;;;;;;;;;;;;;;;qBA0rB3C,2BAAwB,SAC1B,uBACR;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAmIU,2BAAwB;EACnC,cAAc;MACZ"}
@@ -10,7 +10,7 @@ import { NestedFieldReferences } from "@intlayer/core/dictionaryManipulator";
10
10
  * keep every field (no pruning possible).
11
11
  * Set<string> → the exact top-level content field names that were accessed.
12
12
  */
13
- type DictionaryFieldUsage = Set<string> | 'all';
13
+ export type DictionaryFieldUsage = Set<string> | 'all';
14
14
  /**
15
15
  * One node in the nested field-rename tree.
16
16
  *
@@ -18,19 +18,19 @@ type DictionaryFieldUsage = Set<string> | 'all';
18
18
  * children – rename table for the next level of user-defined keys inside
19
19
  * this field's value (empty when the value is a leaf / primitive).
20
20
  */
21
- type NestedRenameEntry = {
21
+ export type NestedRenameEntry = {
22
22
  shortName: string;
23
23
  children: NestedRenameMap;
24
24
  };
25
25
  /** A level of the field-rename tree, mapping original field names to entries. */
26
- type NestedRenameMap = Map<string, NestedRenameEntry>;
26
+ export type NestedRenameMap = Map<string, NestedRenameEntry>;
27
27
  /**
28
28
  * One opaque consumption of a dictionary content value: the value at
29
29
  * `fieldPath` escapes static analysis (passed as-is to a child component or a
30
30
  * function argument), so its children must keep their original key names in
31
31
  * the compiled JSON.
32
32
  */
33
- type OpaqueFieldOccurrence = {
33
+ export type OpaqueFieldOccurrence = {
34
34
  /**
35
35
  * Original (pre-rename) user-defined field names from the content root to
36
36
  * the escaping value, e.g. `['sections', 'hero']` for
@@ -47,7 +47,7 @@ type OpaqueFieldOccurrence = {
47
47
  * All mutations happen during the usage-analysis `buildStart` phase; readers
48
48
  * only access this state during the subsequent `transform` phase.
49
49
  */
50
- type PruneContext = {
50
+ export type PruneContext = {
51
51
  /**
52
52
  * Maps every dictionary key seen in source files to the set of top-level
53
53
  * content fields statically accessed, or `'all'` when the access pattern
@@ -117,7 +117,7 @@ type PruneContext = {
117
117
  dictionaryKey: string;
118
118
  }[]>;
119
119
  };
120
- declare const createPruneContext: () => PruneContext;
120
+ export declare const createPruneContext: () => PruneContext;
121
121
  /**
122
122
  * Records `nest()` references in a prune context so nest targets stay
123
123
  * resolvable — and no larger than they need to be — after purge and minify.
@@ -145,7 +145,7 @@ declare const createPruneContext: () => PruneContext;
145
145
  * @param nestedDictionaryReferences - Nest-target key → referenced top-level
146
146
  * fields, as returned by `getNestedDictionaryReferences`.
147
147
  */
148
- declare const preserveNestedDictionaryFields: (pruneContext: PruneContext, nestedDictionaryReferences: Map<string, NestedFieldReferences>) => void;
148
+ export declare const preserveNestedDictionaryFields: (pruneContext: PruneContext, nestedDictionaryReferences: Map<string, NestedFieldReferences>) => void;
149
149
  /**
150
150
  * Methods the runtime attaches to a resolved content object rather than fields
151
151
  * declared in a `.content` file.
@@ -160,17 +160,17 @@ declare const preserveNestedDictionaryFields: (pruneContext: PruneContext, neste
160
160
  * as a fresh content root, and the call result is analysed again because the
161
161
  * helpers return the content object for chaining.
162
162
  */
163
- declare const CHAINABLE_RUNTIME_METHOD_NAMES: Set<string>;
163
+ export declare const CHAINABLE_RUNTIME_METHOD_NAMES: Set<string>;
164
164
  /** Canonical intlayer caller names that trigger usage analysis. */
165
- declare const INTLAYER_CALLER_NAMES: readonly ['useIntlayer', 'getIntlayer', 'getIntlayerAsync'];
166
- type IntlayerCallerName = (typeof INTLAYER_CALLER_NAMES)[number];
165
+ export declare const INTLAYER_CALLER_NAMES: readonly ['useIntlayer', 'getIntlayer', 'getIntlayerAsync'];
166
+ export type IntlayerCallerName = (typeof INTLAYER_CALLER_NAMES)[number];
167
167
  /**
168
168
  * Configuration entry for a single compat namespace caller.
169
169
  *
170
170
  * @deprecated Alias kept for backward compatibility — use the shared
171
171
  * {@link CallerDescriptor} from `@intlayer/config/callers` instead.
172
172
  */
173
- type CompatCallerConfig = CallerDescriptor$1;
173
+ export type CompatCallerConfig = CallerDescriptor$1;
174
174
  /**
175
175
  * Default registry of compat namespace callers.
176
176
  *
@@ -181,14 +181,14 @@ type CompatCallerConfig = CallerDescriptor$1;
181
181
  * core `@intlayer/babel` package to every compat adapter, which violates the
182
182
  * design principle that compat logic lives in compat packages.
183
183
  */
184
- declare const DEFAULT_COMPAT_CALLERS: CompatCallerConfig[];
184
+ export declare const DEFAULT_COMPAT_CALLERS: CompatCallerConfig[];
185
185
  /**
186
186
  * Climbs past an enclosing `await` expression so that
187
187
  * `const t = await getTranslations('ns')` — or `await getIntlayerAsync('key')`
188
188
  * — is resolved to its variable declarator the same way the synchronous form
189
189
  * is.
190
190
  */
191
- declare const unwrapAwait: (babelTypes: typeof BabelTypes, path: NodePath<BabelTypes.Node>) => NodePath<BabelTypes.Node>;
191
+ export declare const unwrapAwait: (babelTypes: typeof BabelTypes, path: NodePath<BabelTypes.Node>) => NodePath<BabelTypes.Node>;
192
192
  /**
193
193
  * Creates a Babel plugin that traverses source files and records which
194
194
  * top-level dictionary fields each `useIntlayer` / `getIntlayer` call-site —
@@ -203,11 +203,11 @@ declare const unwrapAwait: (babelTypes: typeof BabelTypes, path: NodePath<BabelT
203
203
  * {@link DEFAULT_COMPAT_CALLERS}; pass `[]` to disable
204
204
  * compat-adapter analysis entirely.
205
205
  */
206
- declare const makeUsageAnalyzerBabelPlugin: (pruneContext: PruneContext, options?: {
206
+ export declare const makeUsageAnalyzerBabelPlugin: (pruneContext: PruneContext, options?: {
207
207
  compatCallers?: CompatCallerConfig[];
208
208
  }) => ({ types: babelTypes }: {
209
209
  types: typeof BabelTypes;
210
210
  }) => PluginObject;
211
211
  //#endregion
212
- export { CHAINABLE_RUNTIME_METHOD_NAMES, type CallerDescriptor, type CallerResultShape, type CallerValueSource, CompatCallerConfig, DEFAULT_COMPAT_CALLERS, DictionaryFieldUsage, INTLAYER_CALLER_NAMES, IntlayerCallerName, NestedRenameEntry, NestedRenameMap, OpaqueFieldOccurrence, PruneContext, createPruneContext, makeUsageAnalyzerBabelPlugin, preserveNestedDictionaryFields, unwrapAwait };
212
+ export type { CallerDescriptor, CallerResultShape, CallerValueSource };
213
213
  //# sourceMappingURL=babel-plugin-intlayer-usage-analyzer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babel-plugin-intlayer-usage-analyzer.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-usage-analyzer.ts"],"mappings":";;;;;;;;;;;;KAiBY,uBAAuB;;;;;;;;KASvB;EACV;EACA,UAAU;;;KAIA,kBAAkB,YAAY;;;;;;;KAQ9B;;;;;;EAMV;;EAGA;;;;;;;;;KAUU;;;;;;EAMV,8BAA8B,YAAY;;;;;EAM1C,2BAA2B;;;;;;EAO3B;;;;;;EAOA,qCAAqC;;;;;;EAOrC,+BAA+B,YAAY;;;;;;;;;;;;EAa3C,gCAAgC,YAE9B,YAAY;;;;;;;;;;;;;EAed,iCAAiC;;;;;;;;;;;EAYjC,0BAA0B;IAEtB;IAAsB;;;cAIf,0BAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAyCzB,iCAA8B,cAC3B,cAAY,4BACE,YAAY;;;;;;;;;;;;;;;cAqD7B,gCAA8B;;cAG9B;KAKD,6BAA6B;;;;;;;KAmB7B,qBAAqB;;;;;;;;;;;cAYpB,wBAAwB;;;;;;;cAWxB,cAAW,mBACH,YAAU,MACvB,SAAS,WAAW,UACzB,SAAS,WAAW;;;;;;;;;;;;;;;cA8rCV,+BAA4B,cAEvB,cAAY;EACd,gBAAgB;SAAsB,OAAA;EAE1B,cAAc;MAAe"}
1
+ {"version":3,"file":"babel-plugin-intlayer-usage-analyzer.d.ts","names":[],"sources":["../../src/babel-plugin-intlayer-usage-analyzer.ts"],"mappings":";;;;;;;;;;;;YAiBY,uBAAuB;;;;;;;;YASvB;EACV;EACA,UAAU;;;YAIA,kBAAkB,YAAY;;;;;;;YAQ9B;;;;;;EAMV;;EAGA;;;;;;;;;YAUU;;;;;;EAMV,8BAA8B,YAAY;;;;;EAM1C,2BAA2B;;;;;;EAO3B;;;;;;EAOA,qCAAqC;;;;;;EAOrC,+BAA+B,YAAY;;;;;;;;;;;;EAa3C,gCAAgC,YAE9B,YAAY;;;;;;;;;;;;;EAed,iCAAiC;;;;;;;;;;;EAYjC,0BAA0B;IAEtB;IAAsB;;;qBAIf,0BAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAyCzB,iCAA8B,cAC3B,cAAY,4BACE,YAAY;;;;;;;;;;;;;;;qBAqD7B,gCAA8B;;qBAG9B;YAKD,6BAA6B;;;;;;;YAmB7B,qBAAqB;;;;;;;;;;;qBAYpB,wBAAwB;;;;;;;qBAWxB,cAAW,mBACH,YAAU,MACvB,SAAS,WAAW,UACzB,SAAS,WAAW;;;;;;;;;;;;;;;qBA8rCV,+BAA4B,cAEvB,cAAY;EACd,gBAAgB;SAAsB,OAAA;EAE1B,cAAc;MAAe"}
@@ -1,12 +1,11 @@
1
1
  //#region src/babelParser.d.ts
2
2
  /** A parser object accepted by `recast.parse`'s `parser` option. */
3
- type RecastParser = {
3
+ export type RecastParser = {
4
4
  parse: (source: string) => unknown;
5
5
  };
6
6
  /** Drop-in replacement for `recast/parsers/typescript` (TS without JSX). */
7
- declare const typescriptParser: RecastParser;
7
+ export declare const typescriptParser: RecastParser;
8
8
  /** Drop-in replacement for `recast/parsers/babel-ts` (TS *and* JSX). */
9
- declare const babelTsParser: RecastParser;
9
+ export declare const babelTsParser: RecastParser;
10
10
  //#endregion
11
- export { RecastParser, babelTsParser, typescriptParser };
12
11
  //# sourceMappingURL=babelParser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babelParser.d.ts","names":[],"sources":["../../src/babelParser.ts"],"mappings":";;KAuDY;EACV,QAAQ;;;cAIG,kBAAkB;;cAMlB,eAAe"}
1
+ {"version":3,"file":"babelParser.d.ts","names":[],"sources":["../../src/babelParser.ts"],"mappings":";;YAuDY;EACV,QAAQ;;;qBAIG,kBAAkB;;qBAMlB,eAAe"}
@@ -4,7 +4,7 @@ import * as t from "@babel/types";
4
4
  import { IntlayerConfig } from "@intlayer/types/config";
5
5
  import { NodePath } from "@babel/traverse";
6
6
  //#region src/extractContent/babelProcessor.d.ts
7
- type BabelReplacement = {
7
+ export type BabelReplacement = {
8
8
  path: NodePath;
9
9
  key: string;
10
10
  type: 'jsx-text' | 'jsx-attribute' | 'string-literal' | 'jsx-insertion' | 'jsx-text-combined' | 'template-literal';
@@ -16,12 +16,12 @@ type BabelReplacement = {
16
16
  * Handles JSX insertions (elements with multiple children, including expressions).
17
17
  * Replaces complex JSX structures with variable-based translations.
18
18
  */
19
- declare const handleJsxInsertionBabel: (path: NodePath<t.JSXElement | t.JSXFragment>, fileCode: string, existingKeys: Set<string>, getComponentKeyForPath: (path: NodePath) => string, extractedContent: Record<string, Record<string, string>>, replacements: BabelReplacement[], handledNodes: Set<t.Node>) => boolean;
19
+ export declare const handleJsxInsertionBabel: (path: NodePath<t.JSXElement | t.JSXFragment>, fileCode: string, existingKeys: Set<string>, getComponentKeyForPath: (path: NodePath) => string, extractedContent: Record<string, Record<string, string>>, replacements: BabelReplacement[], handledNodes: Set<t.Node>) => boolean;
20
20
  /**
21
21
  * Traverses the AST to identify components and extract content.
22
22
  * Returns extraction results and metadata about which components need Intlayer hooks.
23
23
  */
24
- declare const extractBabelContentForComponents: (ast: t.File, fileCode: string, existingKeys: Set<string>, defaultKey: string, configuration: IntlayerConfig, filePath: string, unmergedDictionaries?: Record<string, unknown>) => {
24
+ export declare const extractBabelContentForComponents: (ast: t.File, fileCode: string, existingKeys: Set<string>, defaultKey: string, configuration: IntlayerConfig, filePath: string, unmergedDictionaries?: Record<string, unknown>) => {
25
25
  extractedContent: Record<string, Record<string, string>>;
26
26
  replacements: BabelReplacement[];
27
27
  componentsNeedingHooks: Set<NodePath>;
@@ -35,10 +35,9 @@ declare const extractBabelContentForComponents: (ast: t.File, fileCode: string,
35
35
  /**
36
36
  * High-level function to extract content from TS/JS/JSX/TSX AST.
37
37
  */
38
- declare const extractTsContent: (ast: t.File, fileCode: string, existingKeys: Set<string>, configuration: IntlayerConfig, filePath: string, unmergedDictionaries?: Record<string, unknown>) => {
38
+ export declare const extractTsContent: (ast: t.File, fileCode: string, existingKeys: Set<string>, configuration: IntlayerConfig, filePath: string, unmergedDictionaries?: Record<string, unknown>) => {
39
39
  extractedContent: Record<string, string>;
40
40
  replacements: BabelReplacement[];
41
41
  };
42
42
  //#endregion
43
- export { BabelReplacement, extractBabelContentForComponents, extractTsContent, handleJsxInsertionBabel };
44
43
  //# sourceMappingURL=babelProcessor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"babelProcessor.d.ts","names":[],"sources":["../../../src/extractContent/babelProcessor.ts"],"mappings":";;;;;;KAYY;EACV,MAAM;EACN;EACA;EAOA;EACA,oBAAoB,EAAE;EACtB;;;;;;cA4IW,0BAAuB,MAC5B,SAAS,EAAE,aAAa,EAAE,cAAY,kBAC5B,cACF,aAAW,yBACA,MAAM,qBAAmB,kBAChC,eAAe,yBAAuB,cAC1C,oBAAkB,cAClB,IAAI,EAAE;;;;;cAwIT,mCAAgC,KACtC,EAAE,MAAI,kBACK,cACF,aAAW,oBACP,eACH,gBAAc,kBACb,uBACM;EAEtB,kBAAkB,eAAe;EACjC,cAAc;EACd,wBAAwB,IAAI;EAC5B,iBAAiB,IAAI,EAAE;EACvB,gBAAgB;EAChB,SAAS,IAAI,EAAE;;EAEf,oBAAoB,IAAI,EAAE,MAAM;EAChC;;;;;cA6ZW,mBAAgB,KACtB,EAAE,MAAI,kBACK,cACF,aAAW,eACV,gBAAc,kBACb,uBACM;EAEtB,kBAAkB;EAClB,cAAc"}
1
+ {"version":3,"file":"babelProcessor.d.ts","names":[],"sources":["../../../src/extractContent/babelProcessor.ts"],"mappings":";;;;;;YAYY;EACV,MAAM;EACN;EACA;EAOA;EACA,oBAAoB,EAAE;EACtB;;;;;;qBA4IW,0BAAuB,MAC5B,SAAS,EAAE,aAAa,EAAE,cAAY,kBAC5B,cACF,aAAW,yBACA,MAAM,qBAAmB,kBAChC,eAAe,yBAAuB,cAC1C,oBAAkB,cAClB,IAAI,EAAE;;;;;qBAwIT,mCAAgC,KACtC,EAAE,MAAI,kBACK,cACF,aAAW,oBACP,eACH,gBAAc,kBACb,uBACM;EAEtB,kBAAkB,eAAe;EACjC,cAAc;EACd,wBAAwB,IAAI;EAC5B,iBAAiB,IAAI,EAAE;EACvB,gBAAgB;EAChB,SAAS,IAAI,EAAE;;EAEf,oBAAoB,IAAI,EAAE,MAAM;EAChC;;;;;qBA6ZW,mBAAgB,KACtB,EAAE,MAAI,kBACK,cACF,aAAW,eACV,gBAAc,kBACb,uBACM;EAEtB,kBAAkB;EAClB,cAAc"}
@@ -18,18 +18,17 @@ type DictionaryContentMap = Record<string, TranslationNode>;
18
18
  * - Keys in both: preserve existing translations, update default locale value
19
19
  * - Keys in existing but not in extracted: removed (no longer in source)
20
20
  */
21
- declare const mergeWithExistingMultilingualDictionary: (extractedContent: Record<string, string>, existingDictionary: Dictionary | null, defaultLocale: string) => DictionaryContentMap;
21
+ export declare const mergeWithExistingMultilingualDictionary: (extractedContent: Record<string, string>, existingDictionary: Dictionary | null, defaultLocale: string) => DictionaryContentMap;
22
22
  /**
23
23
  * Merge extracted content with existing dictionary for per-locale format.
24
24
  * - Keys in extracted but not in existing: added
25
25
  * - Keys in both: update value
26
26
  * - Keys in existing but not in extracted: removed (no longer in source)
27
27
  */
28
- declare const mergeWithExistingPerLocaleDictionary: (extractedContent: Record<string, string>, existingDictionary: Dictionary | null) => Record<string, string>;
28
+ export declare const mergeWithExistingPerLocaleDictionary: (extractedContent: Record<string, string>, existingDictionary: Dictionary | null) => Record<string, string>;
29
29
  /**
30
30
  * Helper to write extracted content to dictionary file(s).
31
31
  */
32
- declare const writeContentHelper: (extractedContent: Record<string, string>, dictionaryKey: DictionaryKey, filePath: string, configuration: IntlayerConfig) => Promise<string>;
32
+ export declare const writeContentHelper: (extractedContent: Record<string, string>, dictionaryKey: DictionaryKey, filePath: string, configuration: IntlayerConfig) => Promise<string>;
33
33
  //#endregion
34
- export { mergeWithExistingMultilingualDictionary, mergeWithExistingPerLocaleDictionary, writeContentHelper };
35
34
  //# sourceMappingURL=contentWriter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"contentWriter.d.ts","names":[],"sources":["../../../src/extractContent/contentWriter.ts"],"mappings":";;;;;;KAmCK;EACH;EACA,aAAa;;;;;KAMV,uBAAuB,eAAe;;;;;;;cAa9B,0CAAuC,kBAChC,wBAAsB,oBACpB,mBAAiB,0BAEpC;;;;;;;cAkDU,uCAAoC,kBAC7B,wBAAsB,oBACpB,sBACnB;;;;cA8CU,qBAAkB,kBACX,wBAAsB,eACzB,eAAa,kBACZ,eACD,mBACd"}
1
+ {"version":3,"file":"contentWriter.d.ts","names":[],"sources":["../../../src/extractContent/contentWriter.ts"],"mappings":";;;;;;KAmCK;EACH;EACA,aAAa;;;;;KAMV,uBAAuB,eAAe;;;;;;;qBAa9B,0CAAuC,kBAChC,wBAAsB,oBACpB,mBAAiB,0BAEpC;;;;;;;qBAkDU,uCAAoC,kBAC7B,wBAAsB,oBACpB,sBACnB;;;;qBA8CU,qBAAkB,kBACX,wBAAsB,eACzB,eAAa,kBACZ,eACD,mBACd"}
@@ -3,7 +3,7 @@ import "./utils/index.js";
3
3
  import { IntlayerConfig } from "@intlayer/types/config";
4
4
  import { GetConfigurationOptions } from "@intlayer/config/node";
5
5
  //#region src/extractContent/extractContent.d.ts
6
- type ExtractIntlayerOptions = {
6
+ export type ExtractIntlayerOptions = {
7
7
  configOptions?: GetConfigurationOptions;
8
8
  codeOnly?: boolean;
9
9
  declarationOnly?: boolean;
@@ -20,7 +20,7 @@ type ExtractResult = {
20
20
  transformedCode: string | null;
21
21
  extractedContentMap: Record<string, Record<string, string>>;
22
22
  };
23
- declare const extractContent: (filePath: string, packageName: PackageName, options?: ExtractIntlayerOptions) => Promise<ExtractResult | undefined>;
23
+ export declare const extractContent: (filePath: string, packageName: PackageName, options?: ExtractIntlayerOptions) => Promise<ExtractResult | undefined>;
24
24
  /**
25
25
  * Synchronous variant of `extractContent` — used by the Babel plugin which
26
26
  * runs in a sync transform context (e.g. Next.js / Webpack).
@@ -31,7 +31,6 @@ declare const extractContent: (filePath: string, packageName: PackageName, optio
31
31
  * - Does NOT write dictionary files or run the code formatter; callers that
32
32
  * need persistence should supply an `onExtract` callback
33
33
  */
34
- declare const extractContentSync: (filePath: string, packageName: PackageName, options?: ExtractIntlayerOptions) => ExtractResult | undefined;
34
+ export declare const extractContentSync: (filePath: string, packageName: PackageName, options?: ExtractIntlayerOptions) => ExtractResult | undefined;
35
35
  //#endregion
36
- export { ExtractIntlayerOptions, extractContent, extractContentSync };
37
36
  //# sourceMappingURL=extractContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractContent.d.ts","names":[],"sources":["../../../src/extractContent/extractContent.ts"],"mappings":";;;;;KAsBY;EACV,gBAAgB;EAChB;EACA;EACA,uBAAuB;EACvB,gBAAgB;EAChB;EACA,aAAa;IACX;IACA,SAAS;IACT;eACW;;KAsRV;EACH;EACA,qBAAqB,eAAe;;cAmCzB,iBAAc,kBACT,aACH,aAAW,UACd,2BACT,QAAQ;;;;;;;;;;;cA8EE,qBAAkB,kBACb,aACH,aAAW,UACd,2BACT"}
1
+ {"version":3,"file":"extractContent.d.ts","names":[],"sources":["../../../src/extractContent/extractContent.ts"],"mappings":";;;;;YAsBY;EACV,gBAAgB;EAChB;EACA;EACA,uBAAuB;EACvB,gBAAgB;EAChB;EACA,aAAa;IACX;IACA,SAAS;IACT;eACW;;KAsRV;EACH;EACA,qBAAqB,eAAe;;qBAmCzB,iBAAc,kBACT,aACH,aAAW,UACd,2BACT,QAAQ;;;;;;;;;;;qBA8EE,qBAAkB,kBACb,aACH,aAAW,UACd,2BACT"}
@@ -2,7 +2,7 @@ import { PackageName } from "./utils/constants.js";
2
2
  import "./utils/index.js";
3
3
  import { IntlayerConfig } from "@intlayer/types/config";
4
4
  //#region src/extractContent/processTsxFile.d.ts
5
- type TextEdit = {
5
+ export type TextEdit = {
6
6
  start: number;
7
7
  end: number;
8
8
  replacement: string;
@@ -10,10 +10,9 @@ type TextEdit = {
10
10
  /**
11
11
  * Processes a TSX/JSX/TS/JS file to extract content and inject Intlayer hooks/calls.
12
12
  */
13
- declare const processTsxFile: (filePath: string, componentKey: string, packageName: PackageName, configuration: IntlayerConfig, save?: boolean, unmergedDictionaries?: Record<string, unknown>, providedFileCode?: string) => {
13
+ export declare const processTsxFile: (filePath: string, componentKey: string, packageName: PackageName, configuration: IntlayerConfig, save?: boolean, unmergedDictionaries?: Record<string, unknown>, providedFileCode?: string) => {
14
14
  extractedContent: Record<string, Record<string, string>>;
15
15
  modifiedCode: string;
16
16
  } | null;
17
17
  //#endregion
18
- export { TextEdit, processTsxFile };
19
18
  //# sourceMappingURL=processTsxFile.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"processTsxFile.d.ts","names":[],"sources":["../../../src/extractContent/processTsxFile.ts"],"mappings":";;;;KAcY;EACV;EACA;EACA;;;;;cA4BW,iBAAc,kBACT,sBACI,aACP,aAAW,eACT,gBAAc,gBAChB,uBACS,yBAAuB;EAG7C,kBAAkB,eAAe;EACjC"}
1
+ {"version":3,"file":"processTsxFile.d.ts","names":[],"sources":["../../../src/extractContent/processTsxFile.ts"],"mappings":";;;;YAcY;EACV;EACA;EACA;;;;;qBA4BW,iBAAc,kBACT,sBACI,aACP,aAAW,eACT,gBAAc,gBAChB,uBACS,yBAAuB;EAG7C,kBAAkB,eAAe;EACjC"}
@@ -5,10 +5,9 @@
5
5
  *
6
6
  * Order matter for resolution
7
7
  */
8
- declare const packageList: readonly ['next-intlayer', 'react-intlayer', 'vue-intlayer', 'svelte-intlayer', 'preact-intlayer', 'solid-intlayer', 'angular-intlayer', 'lit-intlayer', 'express-intlayer', 'hono-intlayer', 'fastify-intlayer', 'adonis-intlayer', 'intlayer'];
8
+ export declare const packageList: readonly ['next-intlayer', 'react-intlayer', 'vue-intlayer', 'svelte-intlayer', 'preact-intlayer', 'solid-intlayer', 'angular-intlayer', 'lit-intlayer', 'express-intlayer', 'hono-intlayer', 'fastify-intlayer', 'adonis-intlayer', 'intlayer'];
9
9
  /** Packages that support a `/server` sub-path for React Server Components. */
10
- declare const SERVER_CAPABLE_PACKAGES: ReadonlySet<string>;
11
- type PackageName = (typeof packageList)[number];
10
+ export declare const SERVER_CAPABLE_PACKAGES: ReadonlySet<string>;
11
+ export type PackageName = (typeof packageList)[number];
12
12
  //#endregion
13
- export { PackageName, SERVER_CAPABLE_PACKAGES, packageList };
14
13
  //# sourceMappingURL=constants.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"constants.d.ts","names":[],"sources":["../../../../src/extractContent/utils/constants.ts"],"mappings":";;;;;;;cAMa;;cAiBA,yBAAyB;KAI1B,sBAAsB"}
1
+ {"version":3,"file":"constants.d.ts","names":[],"sources":["../../../../src/extractContent/utils/constants.ts"],"mappings":";;;;;;;qBAMa;;qBAiBA,yBAAyB;YAI1B,sBAAsB"}
@@ -3,7 +3,6 @@ import { PackageName } from "./constants.js";
3
3
  /**
4
4
  * Detects which intlayer package is used in the project by reading package.json.
5
5
  */
6
- declare const detectPackageName: (searchDir: string) => PackageName;
6
+ export declare const detectPackageName: (searchDir: string) => PackageName;
7
7
  //#endregion
8
- export { detectPackageName };
9
8
  //# sourceMappingURL=detectPackageName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"detectPackageName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/detectPackageName.ts"],"mappings":";;;;;cAOa,oBAAiB,sBAAwB"}
1
+ {"version":3,"file":"detectPackageName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/detectPackageName.ts"],"mappings":";;;;;qBAOa,oBAAiB,sBAAwB"}
@@ -2,8 +2,8 @@ import { Locale } from "@intlayer/types/allLocales";
2
2
  import { IntlayerConfig } from "@intlayer/types/config";
3
3
  import { FilePathPatternFunction } from "@intlayer/types/filePathPattern";
4
4
  //#region src/extractContent/utils/extractDictionaryInfo.d.ts
5
- declare const getOutput: (configuration: IntlayerConfig, locale?: Locale) => FilePathPatternFunction | false;
6
- type ResolveContentFilePaths = {
5
+ export declare const getOutput: (configuration: IntlayerConfig, locale?: Locale) => FilePathPatternFunction | false;
6
+ export type ResolveContentFilePaths = {
7
7
  absolutePath: string;
8
8
  relativePath: string;
9
9
  isPerLocale: boolean;
@@ -12,16 +12,15 @@ type ResolveContentFilePaths = {
12
12
  * Resolves the paths for the content files associated with a component.
13
13
  * Checks for existing dictionaries first.
14
14
  */
15
- declare const resolveContentFilePaths: (filePath: string, componentKey: string, configuration: IntlayerConfig, locale?: Locale) => Promise<ResolveContentFilePaths>;
16
- type ExtractDictionaryInfoOptions = {
15
+ export declare const resolveContentFilePaths: (filePath: string, componentKey: string, configuration: IntlayerConfig, locale?: Locale) => Promise<ResolveContentFilePaths>;
16
+ export type ExtractDictionaryInfoOptions = {
17
17
  configuration?: IntlayerConfig;
18
18
  };
19
19
  /**
20
20
  * Extracts the dictionary key and dictionary file path for a given component file.
21
21
  */
22
- declare const extractDictionaryInfo: (filePath: string, fileText: string, configuration: IntlayerConfig) => Promise<{
22
+ export declare const extractDictionaryInfo: (filePath: string, fileText: string, configuration: IntlayerConfig) => Promise<{
23
23
  dictionaryKey: string;
24
24
  } & ResolveContentFilePaths>;
25
25
  //#endregion
26
- export { ExtractDictionaryInfoOptions, ResolveContentFilePaths, extractDictionaryInfo, getOutput, resolveContentFilePaths };
27
26
  //# sourceMappingURL=extractDictionaryInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractDictionaryInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryInfo.ts"],"mappings":";;;;cAmBa,YAAS,eACL,gBAAc,SACpB,WACR;KA0CS;EACV;EACA;EACA;;;;;;cAOW,0BAAuB,kBAClB,sBACI,eACL,gBAAc,SACpB,WACR,QAAQ;KA+GC;EACV,gBAAgB;;;;;cAML,wBAAqB,kBAChB,kBACA,eACD,mBACd;EAEC;IACE"}
1
+ {"version":3,"file":"extractDictionaryInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryInfo.ts"],"mappings":";;;;qBAmBa,YAAS,eACL,gBAAc,SACpB,WACR;YA0CS;EACV;EACA;EACA;;;;;;qBAOW,0BAAuB,kBAClB,sBACI,eACL,gBAAc,SACpB,WACR,QAAQ;YA+GC;EACV,gBAAgB;;;;;qBAML,wBAAqB,kBAChB,kBACA,eACD,mBACd;EAEC;IACE"}
@@ -4,8 +4,7 @@
4
4
  *
5
5
  * Example: "src/components/MyComponent/index.tsx" -> "comp-my-component"
6
6
  */
7
- declare const extractDictionaryKeyFromPath: (filePath: string, prefix?: string) => string;
8
- declare const extractDictionaryKey: (filePath: string, fileText: string, prefix?: string) => string;
7
+ export declare const extractDictionaryKeyFromPath: (filePath: string, prefix?: string) => string;
8
+ export declare const extractDictionaryKey: (filePath: string, fileText: string, prefix?: string) => string;
9
9
  //#endregion
10
- export { extractDictionaryKey, extractDictionaryKeyFromPath };
11
10
  //# sourceMappingURL=extractDictionaryKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryKey.ts"],"mappings":";;;;;;cASa,+BAA4B,kBACvB;cAkBL,uBAAoB,kBACf,kBACA"}
1
+ {"version":3,"file":"extractDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/extractDictionaryKey.ts"],"mappings":";;;;;;qBASa,+BAA4B,kBACvB;qBAkBL,uBAAoB,kBACf,kBACA"}
@@ -1,5 +1,4 @@
1
1
  //#region src/extractContent/utils/generateKey.d.ts
2
- declare const generateKey: (text: string, existingKeys: Set<string>) => string;
2
+ export declare const generateKey: (text: string, existingKeys: Set<string>) => string;
3
3
  //#endregion
4
- export { generateKey };
5
4
  //# sourceMappingURL=generateKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/generateKey.ts"],"mappings":";cAAa,cAAW,cACV,cACE"}
1
+ {"version":3,"file":"generateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/generateKey.ts"],"mappings":";qBAAa,cAAW,cACV,cACE"}
@@ -3,7 +3,6 @@ import { NodePath } from "@babel/traverse";
3
3
  /**
4
4
  * Resolves the name of the component from various function declaration types.
5
5
  */
6
- declare const getComponentName: (path: NodePath) => string | undefined;
6
+ export declare const getComponentName: (path: NodePath) => string | undefined;
7
7
  //#endregion
8
- export { getComponentName };
9
8
  //# sourceMappingURL=getComponentName.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getComponentName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getComponentName.ts"],"mappings":";;;;;cAMa,mBAAgB,MAAU"}
1
+ {"version":3,"file":"getComponentName.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getComponentName.ts"],"mappings":";;;;;qBAMa,mBAAgB,MAAU"}
@@ -1,7 +1,7 @@
1
1
  import * as t from "@babel/types";
2
2
  import { NodePath } from "@babel/traverse";
3
3
  //#region src/extractContent/utils/getExistingIntlayerInfo.d.ts
4
- type ExistingIntlayerInfo = {
4
+ export type ExistingIntlayerInfo = {
5
5
  key: string;
6
6
  hook: 'useIntlayer' | 'getIntlayer';
7
7
  /** The variable name used to store the call result (e.g. `t` in `const t = useIntlayer(...)`) */
@@ -16,7 +16,6 @@ type ExistingIntlayerInfo = {
16
16
  /**
17
17
  * Searches for an existing useIntlayer or getIntlayer call in the function body.
18
18
  */
19
- declare const getExistingIntlayerInfo: (path: NodePath) => ExistingIntlayerInfo | undefined;
19
+ export declare const getExistingIntlayerInfo: (path: NodePath) => ExistingIntlayerInfo | undefined;
20
20
  //#endregion
21
- export { ExistingIntlayerInfo, getExistingIntlayerInfo };
22
21
  //# sourceMappingURL=getExistingIntlayerInfo.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExistingIntlayerInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getExistingIntlayerInfo.ts"],"mappings":";;;KAGY;EACV;EACA;;EAEA;;EAEA;;EAEA;;EAEA,oBAAoB,EAAE;;;;;cAMX,0BAAuB,MAC5B,aACL"}
1
+ {"version":3,"file":"getExistingIntlayerInfo.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getExistingIntlayerInfo.ts"],"mappings":";;;YAGY;EACV;EACA;;EAEA;;EAEA;;EAEA;;EAEA,oBAAoB,EAAE;;;;;qBAMX,0BAAuB,MAC5B,aACL"}
@@ -2,7 +2,6 @@
2
2
  /**
3
3
  * Gets an existing key for a given text or generates a new one.
4
4
  */
5
- declare const getOrGenerateKey: (text: string, componentKey: string, existingKeys: Set<string>, extractedContent: Record<string, Record<string, string>>) => string;
5
+ export declare const getOrGenerateKey: (text: string, componentKey: string, existingKeys: Set<string>, extractedContent: Record<string, Record<string, string>>) => string;
6
6
  //#endregion
7
- export { getOrGenerateKey };
8
7
  //# sourceMappingURL=getOrGenerateKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getOrGenerateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getOrGenerateKey.ts"],"mappings":";;;;cAKa,mBAAgB,cACf,sBACQ,cACN,aAAW,kBACP,eAAe"}
1
+ {"version":3,"file":"getOrGenerateKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/getOrGenerateKey.ts"],"mappings":";;;;qBAKa,mBAAgB,cACf,sBACQ,cACN,aAAW,kBACP,eAAe"}
@@ -5,7 +5,6 @@ import { IntlayerConfig } from "@intlayer/types/config";
5
5
  * Note: this chokidar-specific variant fetches unmergedDictionaries internally
6
6
  * from the configuration (unlike the `@intlayer/babel` version which takes it as a parameter).
7
7
  */
8
- declare const resolveDictionaryKey: (initialKey: string, filePath: string, configuration: IntlayerConfig, unmergedDictionaries?: Record<string, unknown>, usedKeys?: Set<string>) => string;
8
+ export declare const resolveDictionaryKey: (initialKey: string, filePath: string, configuration: IntlayerConfig, unmergedDictionaries?: Record<string, unknown>, usedKeys?: Set<string>) => string;
9
9
  //#endregion
10
- export { resolveDictionaryKey };
11
10
  //# sourceMappingURL=resolveDictionaryKey.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolveDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/resolveDictionaryKey.ts"],"mappings":";;;;;;;cAYa,uBAAoB,oBACb,kBACF,eACD,gBAAc,uBACN,yBAAuB,WACpC"}
1
+ {"version":3,"file":"resolveDictionaryKey.d.ts","names":[],"sources":["../../../../src/extractContent/utils/resolveDictionaryKey.ts"],"mappings":";;;;;;;qBAYa,uBAAoB,oBACb,kBACF,eACD,gBAAc,uBACN,yBAAuB,WACpC"}
@@ -8,7 +8,7 @@
8
8
  * `contentEndOffset` – Byte offset one past the last byte of `content` in the
9
9
  * full source string (i.e. `source.slice(start, end) === content`).
10
10
  */
11
- type ScriptBlock = {
11
+ export type ScriptBlock = {
12
12
  content: string;
13
13
  contentStartOffset: number;
14
14
  contentEndOffset: number;
@@ -27,7 +27,7 @@ type ScriptBlock = {
27
27
  * - everything else → treats the whole file as a single script block and
28
28
  * returns it wrapped in a single-element array.
29
29
  */
30
- declare const extractScriptBlocks: (filePath: string, code: string) => ScriptBlock[];
30
+ export declare const extractScriptBlocks: (filePath: string, code: string) => ScriptBlock[];
31
31
  /**
32
32
  * Applies modified script block content back into the original source string.
33
33
  *
@@ -38,10 +38,9 @@ declare const extractScriptBlocks: (filePath: string, code: string) => ScriptBlo
38
38
  *
39
39
  * Returns `originalCode` unchanged when `modifications` is empty.
40
40
  */
41
- declare const injectScriptBlocks: (originalCode: string, modifications: ReadonlyArray<{
41
+ export declare const injectScriptBlocks: (originalCode: string, modifications: ReadonlyArray<{
42
42
  block: ScriptBlock;
43
43
  modifiedContent: string;
44
44
  }>) => string;
45
45
  //#endregion
46
- export { ScriptBlock, extractScriptBlocks, injectScriptBlocks };
47
46
  //# sourceMappingURL=extractScriptBlocks.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"extractScriptBlocks.d.ts","names":[],"sources":["../../src/extractScriptBlocks.ts"],"mappings":";;;;;;;;;;KAWY;EACV;EACA;EACA;;;;;;;;;;;;;;;;cA8FW,sBAAmB,kBACd,iBAEf;;;;;;;;;;;cA+BU,qBAAkB,sBACT,eACL;EACb,OAAO;EACP"}
1
+ {"version":3,"file":"extractScriptBlocks.d.ts","names":[],"sources":["../../src/extractScriptBlocks.ts"],"mappings":";;;;;;;;;;YAWY;EACV;EACA;EACA;;;;;;;;;;;;;;;;qBA8FW,sBAAmB,kBACd,iBAEf;;;;;;;;;;;qBA+BU,qBAAkB,sBACT,eACL;EACb,OAAO;EACP"}
@@ -6,13 +6,12 @@ import { IntlayerConfig } from "@intlayer/types/config";
6
6
  * - 'dev': Development mode with HMR support
7
7
  * - 'build': Production build mode
8
8
  */
9
- type CompilerMode = 'dev' | 'build';
9
+ export type CompilerMode = 'dev' | 'build';
10
10
  /**
11
11
  * Get the options for the Intlayer Babel extraction plugin
12
12
  * This function loads the Intlayer configuration and sets up the onExtract callback
13
13
  * to write dictionaries to the filesystem.
14
14
  */
15
- declare const getExtractPluginOptions: (configuration?: IntlayerConfig, isDev?: CompilerMode | string | undefined) => ExtractPluginOptions;
15
+ export declare const getExtractPluginOptions: (configuration?: IntlayerConfig, isDev?: CompilerMode | string | undefined) => ExtractPluginOptions;
16
16
  //#endregion
17
- export { CompilerMode, getExtractPluginOptions };
18
17
  //# sourceMappingURL=getExtractPluginOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getExtractPluginOptions.d.ts","names":[],"sources":["../../src/getExtractPluginOptions.ts"],"mappings":";;;;;;;;KAcY;;;;;;cAOC,0BAAuB,gBACnB,gBAAc,QACtB,sCACN"}
1
+ {"version":3,"file":"getExtractPluginOptions.d.ts","names":[],"sources":["../../src/getExtractPluginOptions.ts"],"mappings":";;;;;;;;YAcY;;;;;;qBAOC,0BAAuB,gBACnB,gBAAc,QACtB,sCACN"}
@@ -27,7 +27,6 @@ type GetOptimizePluginOptionsParams = {
27
27
  * This function loads the Intlayer configuration and returns the paths
28
28
  * needed for dictionary optimization and import rewriting.
29
29
  */
30
- declare const getOptimizePluginOptions: (params?: GetOptimizePluginOptionsParams) => OptimizePluginOptions;
30
+ export declare const getOptimizePluginOptions: (params?: GetOptimizePluginOptionsParams) => OptimizePluginOptions;
31
31
  //#endregion
32
- export { getOptimizePluginOptions };
33
32
  //# sourceMappingURL=getOptimizePluginOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getOptimizePluginOptions.d.ts","names":[],"sources":["../../src/getOptimizePluginOptions.ts"],"mappings":";;;;KAWK;;;;EAIH,gBAAgB;;;;EAIhB,eAAe;;;;;;EAMf;;;;EAIA,YAAY,QAAQ;;;;;;;cAyBT,2BAAwB,SAC1B,mCACR"}
1
+ {"version":3,"file":"getOptimizePluginOptions.d.ts","names":[],"sources":["../../src/getOptimizePluginOptions.ts"],"mappings":";;;;KAWK;;;;EAIH,gBAAgB;;;;EAIhB,eAAe;;;;;;EAMf;;;;EAIA,YAAY,QAAQ;;;;;;;qBAyBT,2BAAwB,SAC1B,mCACR"}
@@ -44,7 +44,7 @@ type GetPurgePluginOptionsParams = {
44
44
  * };
45
45
  * ```
46
46
  */
47
- declare const getPurgePluginOptions: (params?: GetPurgePluginOptionsParams) => PurgePluginOptions;
47
+ export declare const getPurgePluginOptions: (params?: GetPurgePluginOptionsParams) => PurgePluginOptions;
48
48
  type GetMinifyPluginOptionsParams = {
49
49
  /**
50
50
  * Options forwarded to the intlayer configuration loader.
@@ -76,7 +76,6 @@ type GetMinifyPluginOptionsParams = {
76
76
  * };
77
77
  * ```
78
78
  */
79
- declare const getMinifyPluginOptions: (params?: GetMinifyPluginOptionsParams) => MinifyPluginOptions;
79
+ export declare const getMinifyPluginOptions: (params?: GetMinifyPluginOptionsParams) => MinifyPluginOptions;
80
80
  //#endregion
81
- export { getMinifyPluginOptions, getPurgePluginOptions };
82
81
  //# sourceMappingURL=getPurgePluginOptions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"getPurgePluginOptions.d.ts","names":[],"sources":["../../src/getPurgePluginOptions.ts"],"mappings":";;;;;KAmCK;;;;;;EAMH,gBAAgB;;;;;;EAOhB,eAAe;;;;EAKf,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;cA0BT,wBAAqB,SACvB,gCACR;KA8CE;;;;EAIH,gBAAgB;;;;EAKhB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;cAwBT,yBAAsB,SACxB,iCACR"}
1
+ {"version":3,"file":"getPurgePluginOptions.d.ts","names":[],"sources":["../../src/getPurgePluginOptions.ts"],"mappings":";;;;;KAmCK;;;;;;EAMH,gBAAgB;;;;;;EAOhB,eAAe;;;;EAKf,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;qBA0BT,wBAAqB,SACvB,gCACR;KA8CE;;;;EAIH,gBAAgB;;;;EAKhB,YAAY,QAAQ;;;;;;;;;;;;;;;;;;;;;;;qBAwBT,yBAAsB,SACxB,iCACR"}
@@ -6,7 +6,6 @@
6
6
  * @param filesList - The plugin's `filesList` option (absolute file paths).
7
7
  * @returns A set of the same paths normalized via `normalizePath`.
8
8
  */
9
- declare const getNormalizedFilesListSet: (filesList: readonly string[]) => Set<string>;
9
+ export declare const getNormalizedFilesListSet: (filesList: readonly string[]) => Set<string>;
10
10
  //#endregion
11
- export { getNormalizedFilesListSet };
12
11
  //# sourceMappingURL=normalizedFilesList.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"normalizedFilesList.d.ts","names":[],"sources":["../../src/normalizedFilesList.ts"],"mappings":";;;;;;;;cAiBa,4BAAyB,iCAEnC"}
1
+ {"version":3,"file":"normalizedFilesList.d.ts","names":[],"sources":["../../src/normalizedFilesList.ts"],"mappings":";;;;;;;;qBAiBa,4BAAyB,iCAEnC"}
@@ -6,7 +6,7 @@ import { ParserOptions } from "@babel/parser";
6
6
  * Babel parser options covering the superset of syntaxes used across all
7
7
  * supported frameworks (React / Vue / Svelte / Angular / …).
8
8
  */
9
- declare const BABEL_PARSER_OPTIONS: ParserOptions;
9
+ export declare const BABEL_PARSER_OPTIONS: ParserOptions;
10
10
  /**
11
11
  * Builds a fast pre-check regex that matches files potentially containing
12
12
  * native intlayer calls and/or the given compat namespace caller names.
@@ -26,25 +26,25 @@ declare const BABEL_PARSER_OPTIONS: ParserOptions;
26
26
  * (e.g. `['useTranslation', 'getFixedT']` from `@intlayer/react-i18next`).
27
27
  * @returns A `RegExp` matching any of the native or provided caller names.
28
28
  */
29
- declare const buildUsageCheckRegex: (extraCallerNames?: string[]) => RegExp;
29
+ export declare const buildUsageCheckRegex: (extraCallerNames?: string[]) => RegExp;
30
30
  /**
31
31
  * Fast pre-check: matches files that could contain native intlayer calls
32
32
  * (`useIntlayer` / `getIntlayer` / `getIntlayerAsync`). Used by the
33
33
  * optimize/transform pass, which only rewrites native calls.
34
34
  */
35
- declare const INTLAYER_USAGE_REGEX: RegExp;
35
+ export declare const INTLAYER_USAGE_REGEX: RegExp;
36
36
  /**
37
37
  * Returns the usage-check regex for the given compat callers, memoised by the
38
38
  * array reference. Plugins pass the same options array for every analysed
39
39
  * file, so the regex is built once per build instead of once per file.
40
40
  */
41
- declare const getUsageCheckRegex: (compatCallers?: readonly CompatCallerConfig[]) => RegExp;
41
+ export declare const getUsageCheckRegex: (compatCallers?: readonly CompatCallerConfig[]) => RegExp;
42
42
  /**
43
43
  * Matches source files that are valid targets for usage analysis and Babel
44
44
  * transformation. Excludes sourcemap files, declaration files, and other
45
45
  * non-source extensions.
46
46
  */
47
- declare const SOURCE_FILE_REGEX: RegExp;
47
+ export declare const SOURCE_FILE_REGEX: RegExp;
48
48
  /**
49
49
  * Runs the usage-analysis Babel plugin on a source file, accumulating
50
50
  * field-usage data into `pruneContext`.
@@ -57,14 +57,14 @@ declare const SOURCE_FILE_REGEX: RegExp;
57
57
  * Throws if Babel cannot parse the file (caller should handle and flag
58
58
  * `pruneContext.hasUnparsableSourceFiles`).
59
59
  */
60
- declare const analyzeFieldUsageInFile: (sourceFilePath: string, code: string, pruneContext: PruneContext, compatCallers?: CompatCallerConfig[]) => Promise<void>;
60
+ export declare const analyzeFieldUsageInFile: (sourceFilePath: string, code: string, pruneContext: PruneContext, compatCallers?: CompatCallerConfig[]) => Promise<void>;
61
61
  /**
62
62
  * Applies field-renaming to a single JS/TS code string (not an SFC).
63
63
  *
64
64
  * Returns the renamed code string, or `null` if nothing changed or if
65
65
  * Babel failed to parse the input (caller should fall back to original code).
66
66
  */
67
- declare const renameFieldsInCode: (code: string, sourceFilePath: string, pruneContext: PruneContext) => Promise<string | null>;
67
+ export declare const renameFieldsInCode: (code: string, sourceFilePath: string, pruneContext: PruneContext) => Promise<string | null>;
68
68
  /**
69
69
  * Applies field-renaming to a source file, correctly handling both plain
70
70
  * JS/TS files and SFC files (Vue / Svelte) by operating on each script block
@@ -72,7 +72,7 @@ declare const renameFieldsInCode: (code: string, sourceFilePath: string, pruneCo
72
72
  *
73
73
  * Returns the renamed code string, or `null` if nothing changed.
74
74
  */
75
- declare const renameFieldsInSourceFile: (sourceFilePath: string, code: string, pruneContext: PruneContext) => Promise<string | null>;
75
+ export declare const renameFieldsInSourceFile: (sourceFilePath: string, code: string, pruneContext: PruneContext) => Promise<string | null>;
76
76
  /**
77
77
  * Runs the intlayer optimize Babel plugin on a source file, transforming
78
78
  * `useIntlayer('key')` / `getIntlayer('key')` calls into `useDictionary(_hash)`
@@ -81,10 +81,9 @@ declare const renameFieldsInSourceFile: (sourceFilePath: string, code: string, p
81
81
  * Returns `{ code, map }` on success, or `null` if the transformation produced
82
82
  * no output.
83
83
  */
84
- declare const optimizeSourceFile: (code: string, sourceFilePath: string, options: OptimizePluginOptions) => Promise<{
84
+ export declare const optimizeSourceFile: (code: string, sourceFilePath: string, options: OptimizePluginOptions) => Promise<{
85
85
  code: string;
86
86
  map: string | object | null | undefined;
87
87
  } | null>;
88
88
  //#endregion
89
- export { BABEL_PARSER_OPTIONS, INTLAYER_USAGE_REGEX, SOURCE_FILE_REGEX, analyzeFieldUsageInFile, buildUsageCheckRegex, getUsageCheckRegex, optimizeSourceFile, renameFieldsInCode, renameFieldsInSourceFile };
90
89
  //# sourceMappingURL=transformers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/transformers.ts"],"mappings":";;;;;;;;cA0Ba,sBAAsB;;;;;;;;;;;;;;;;;;;;cAsCtB,uBAAoB,gCAAkC;;;;;;cAWtD,sBAAoB;;;;;;cAgBpB,qBAAkB,yBACJ,yBACxB;;;;;;cAoBU,mBAAiB;;;;;;;;;;;;;cAqCjB,0BAAuB,wBACZ,cACV,cACE,cAAY,gBACV,yBACf;;;;;;;cAyBU,qBAAkB,cACjB,wBACU,cACR,iBACb;;;;;;;;cAqBU,2BAAwB,wBACb,cACV,cACE,iBACb;;;;;;;;;cA8CU,qBAAkB,cACjB,wBACU,SACb,0BACR;EACD;EACA"}
1
+ {"version":3,"file":"transformers.d.ts","names":[],"sources":["../../src/transformers.ts"],"mappings":";;;;;;;;qBA0Ba,sBAAsB;;;;;;;;;;;;;;;;;;;;qBAsCtB,uBAAoB,gCAAkC;;;;;;qBAWtD,sBAAoB;;;;;;qBAgBpB,qBAAkB,yBACJ,yBACxB;;;;;;qBAoBU,mBAAiB;;;;;;;;;;;;;qBAqCjB,0BAAuB,wBACZ,cACV,cACE,cAAY,gBACV,yBACf;;;;;;;qBAyBU,qBAAkB,cACjB,wBACU,cACR,iBACb;;;;;;;;qBAqBU,2BAAwB,wBACb,cACV,cACE,iBACb;;;;;;;;;qBA8CU,qBAAkB,cACjB,wBACU,SACb,0BACR;EACD;EACA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/babel",
3
- "version": "9.4.2",
3
+ "version": "9.4.4",
4
4
  "private": false,
5
5
  "description": "A Babel plugin for Intlayer that transforms declaration files and provides internationalization features during the build process according to the Intlayer configuration.",
6
6
  "keywords": [
@@ -89,12 +89,12 @@
89
89
  "@babel/plugin-syntax-jsx": "8.0.1",
90
90
  "@babel/traverse": "8.0.4",
91
91
  "@babel/types": "8.0.4",
92
- "@intlayer/config": "9.4.2",
93
- "@intlayer/core": "9.4.2",
94
- "@intlayer/dictionaries-entry": "9.4.2",
95
- "@intlayer/engine": "9.4.2",
96
- "@intlayer/types": "9.4.2",
97
- "@intlayer/unmerged-dictionaries-entry": "9.4.2"
92
+ "@intlayer/config": "9.4.4",
93
+ "@intlayer/core": "9.4.4",
94
+ "@intlayer/dictionaries-entry": "9.4.4",
95
+ "@intlayer/engine": "9.4.4",
96
+ "@intlayer/types": "9.4.4",
97
+ "@intlayer/unmerged-dictionaries-entry": "9.4.4"
98
98
  },
99
99
  "devDependencies": {
100
100
  "@babel/plugin-syntax-jsx": "8.0.1",
@@ -107,13 +107,13 @@
107
107
  "@utils/tsdown-config": "1.0.4",
108
108
  "@vitejs/plugin-react": "6.1.1",
109
109
  "rimraf": "6.1.3",
110
- "tsdown": "0.22.14",
110
+ "tsdown": "0.23.0",
111
111
  "typescript": "7.0.2",
112
- "vitest": "4.1.11"
112
+ "vitest": "5.0.0"
113
113
  },
114
114
  "peerDependencies": {
115
- "@intlayer/svelte-compiler": "9.4.2",
116
- "@intlayer/vue-compiler": "9.4.2"
115
+ "@intlayer/svelte-compiler": "9.4.4",
116
+ "@intlayer/vue-compiler": "9.4.4"
117
117
  },
118
118
  "peerDependenciesMeta": {
119
119
  "@intlayer/svelte-compiler": {