@let-value/translate-extract 1.0.30 → 1.0.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/bin/cli.cjs +7 -6
- package/dist/bin/cli.js +1 -1
- package/dist/chunk-CUT6urMc.cjs +30 -0
- package/dist/configuration-CFa8J7EM.d.ts +240 -0
- package/dist/configuration-CFa8J7EM.d.ts.map +1 -0
- package/dist/configuration-nsGqA5N9.d.cts +239 -0
- package/dist/configuration-nsGqA5N9.d.cts.map +1 -0
- package/dist/core-ACuLoi2B.d.ts +1 -0
- package/dist/core-CHb_Xdzl.cjs +65 -0
- package/dist/core-CPg6_re5.d.cts +1 -0
- package/dist/core-DR3oxhSq.js +59 -0
- package/dist/core-DR3oxhSq.js.map +1 -0
- package/dist/run-BacOPd9p.cjs +1479 -0
- package/dist/run-DcO6U79B.js +1439 -0
- package/dist/run-DcO6U79B.js.map +1 -0
- package/dist/src/core.cjs +4 -0
- package/dist/src/core.d.cts +3 -0
- package/dist/src/core.d.ts +3 -0
- package/dist/src/core.js +4 -0
- package/dist/src/index.cjs +9 -1320
- package/dist/src/index.d.cts +3 -209
- package/dist/src/index.d.cts.map +1 -1
- package/dist/src/index.d.ts +3 -210
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1306
- package/dist/src/static.cjs +6 -0
- package/dist/src/static.d.cts +2 -0
- package/dist/src/static.d.ts +2 -0
- package/dist/src/static.js +3 -0
- package/dist/static-CNiWpXhx.cjs +52 -0
- package/dist/static-DQHT7uqP.js +29 -0
- package/dist/static-DQHT7uqP.js.map +1 -0
- package/package.json +12 -2
- package/dist/run-BonabcP6.cjs +0 -209
- package/dist/run-C_bYec-q.js +0 -175
- package/dist/run-C_bYec-q.js.map +0 -1
- package/dist/src/index.js.map +0 -1
package/dist/src/index.d.cts
CHANGED
|
@@ -1,212 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, Logger, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, UniversalPlugin, UserConfig, cleanup$1 as cleanup, core$1 as core, defineConfig, po$1 as po, react$1 as react } from "../configuration-nsGqA5N9.cjs";
|
|
2
|
+
import "../core-CPg6_re5.cjs";
|
|
3
3
|
|
|
4
|
-
//#region src/logger.d.ts
|
|
5
|
-
type LogLevel = LogLevelNames;
|
|
6
|
-
//#endregion
|
|
7
|
-
//#region src/plugin.d.ts
|
|
8
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
9
|
-
interface Context {
|
|
10
|
-
config: ResolvedConfig;
|
|
11
|
-
generatedAt: Date;
|
|
12
|
-
logger?: Logger;
|
|
13
|
-
}
|
|
14
|
-
interface ResolveArgs<TInput = unknown> {
|
|
15
|
-
entrypoint: string;
|
|
16
|
-
path: string;
|
|
17
|
-
namespace: string;
|
|
18
|
-
data?: TInput;
|
|
19
|
-
}
|
|
20
|
-
interface ResolveResult<TInput = unknown> {
|
|
21
|
-
entrypoint: string;
|
|
22
|
-
path: string;
|
|
23
|
-
namespace: string;
|
|
24
|
-
data?: TInput;
|
|
25
|
-
}
|
|
26
|
-
interface LoadArgs<TInput = unknown> {
|
|
27
|
-
entrypoint: string;
|
|
28
|
-
path: string;
|
|
29
|
-
namespace: string;
|
|
30
|
-
data?: TInput;
|
|
31
|
-
}
|
|
32
|
-
interface LoadResult<TInput = unknown> {
|
|
33
|
-
entrypoint: string;
|
|
34
|
-
path: string;
|
|
35
|
-
namespace: string;
|
|
36
|
-
data: TInput;
|
|
37
|
-
}
|
|
38
|
-
interface ProcessArgs<TInput = unknown> {
|
|
39
|
-
entrypoint: string;
|
|
40
|
-
path: string;
|
|
41
|
-
namespace: string;
|
|
42
|
-
data: TInput;
|
|
43
|
-
}
|
|
44
|
-
interface ProcessResult<TOutput = unknown> {
|
|
45
|
-
entrypoint: string;
|
|
46
|
-
path: string;
|
|
47
|
-
namespace: string;
|
|
48
|
-
data: TOutput;
|
|
49
|
-
}
|
|
50
|
-
type Filter = {
|
|
51
|
-
filter: RegExp;
|
|
52
|
-
namespace?: string;
|
|
53
|
-
};
|
|
54
|
-
type ResolveHook<TInput = unknown> = (args: ResolveArgs<TInput>) => MaybePromise<ResolveResult<TInput> | undefined>;
|
|
55
|
-
type LoadHook<TInput = unknown> = (args: LoadArgs<TInput>) => MaybePromise<LoadResult<TInput> | undefined>;
|
|
56
|
-
type ProcessHook<TInput = unknown, TOutput = unknown> = (args: ProcessArgs<TInput>) => MaybePromise<ProcessResult<TOutput> | undefined>;
|
|
57
|
-
interface Build<TInput = unknown, TOutput = unknown> {
|
|
58
|
-
context: Context;
|
|
59
|
-
resolve(args: ResolveArgs<unknown>): void;
|
|
60
|
-
load(args: LoadArgs<unknown>): void;
|
|
61
|
-
process(args: ProcessArgs<unknown>): void;
|
|
62
|
-
defer(namespace: string): Promise<void>;
|
|
63
|
-
onResolve(options: Filter, hook: ResolveHook<TInput>): void;
|
|
64
|
-
onLoad(options: Filter, hook: LoadHook<TInput>): void;
|
|
65
|
-
onProcess(options: Filter, hook: ProcessHook<TInput, TOutput>): void;
|
|
66
|
-
}
|
|
67
|
-
interface Plugin<TInput = unknown, TOutput = unknown> {
|
|
68
|
-
name: string;
|
|
69
|
-
setup(build: Build<TInput, TOutput>): void;
|
|
70
|
-
}
|
|
71
|
-
//#endregion
|
|
72
|
-
//#region src/plugins/cleanup/cleanup.d.ts
|
|
73
|
-
declare function cleanup(): Plugin;
|
|
74
|
-
//#endregion
|
|
75
|
-
//#region src/plugins/core/queries/types.d.ts
|
|
76
|
-
interface Comments {
|
|
77
|
-
translator?: string;
|
|
78
|
-
reference?: string;
|
|
79
|
-
extracted?: string;
|
|
80
|
-
flag?: string;
|
|
81
|
-
previous?: string;
|
|
82
|
-
}
|
|
83
|
-
interface Translation {
|
|
84
|
-
context?: string;
|
|
85
|
-
id: string;
|
|
86
|
-
plural?: string;
|
|
87
|
-
message: string[];
|
|
88
|
-
comments?: Comments;
|
|
89
|
-
obsolete?: boolean;
|
|
90
|
-
}
|
|
91
|
-
//#endregion
|
|
92
|
-
//#region src/plugins/core/core.d.ts
|
|
93
|
-
declare function core(): Plugin<string, Translation[]>;
|
|
94
|
-
//#endregion
|
|
95
|
-
//#region src/plugins/po/po.d.ts
|
|
96
|
-
declare function po(): Plugin;
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/configuration.d.ts
|
|
99
|
-
type DestinationFn = (args: {
|
|
100
|
-
locale: string;
|
|
101
|
-
entrypoint: string;
|
|
102
|
-
path: string;
|
|
103
|
-
}) => string;
|
|
104
|
-
type ExcludeFn = (args: {
|
|
105
|
-
entrypoint: string;
|
|
106
|
-
path: string;
|
|
107
|
-
}) => boolean;
|
|
108
|
-
type Exclude = RegExp | ExcludeFn;
|
|
109
|
-
declare const defaultPlugins: {
|
|
110
|
-
core: typeof core;
|
|
111
|
-
po: typeof po;
|
|
112
|
-
cleanup: typeof cleanup;
|
|
113
|
-
};
|
|
114
|
-
type DefaultPlugins = typeof defaultPlugins;
|
|
115
|
-
/**
|
|
116
|
-
* Strategy to handle obsolete translations in existing locale files:
|
|
117
|
-
* - "mark": keep obsolete entries in the locale file but mark them as obsolete
|
|
118
|
-
* - "remove": remove obsolete entries from the locale file
|
|
119
|
-
*/
|
|
120
|
-
type ObsoleteStrategy = "mark" | "remove";
|
|
121
|
-
interface EntrypointConfig {
|
|
122
|
-
entrypoint: string;
|
|
123
|
-
destination?: DestinationFn;
|
|
124
|
-
obsolete?: ObsoleteStrategy;
|
|
125
|
-
walk?: boolean;
|
|
126
|
-
exclude?: Exclude | Exclude[];
|
|
127
|
-
}
|
|
128
|
-
interface UserConfig {
|
|
129
|
-
/**
|
|
130
|
-
* Default locale to use as the base for extraction
|
|
131
|
-
* @default "en"
|
|
132
|
-
* @see {@link PluralFormsLocale} for available locales
|
|
133
|
-
*/
|
|
134
|
-
defaultLocale?: PluralFormsLocale;
|
|
135
|
-
/**
|
|
136
|
-
* Array of locales to extract translations for
|
|
137
|
-
* @default [defaultLocale]
|
|
138
|
-
* @see {@link PluralFormsLocale} for available locales
|
|
139
|
-
*/
|
|
140
|
-
locales?: PluralFormsLocale[];
|
|
141
|
-
/**
|
|
142
|
-
* Array of plugins to use or a function to override the default plugins
|
|
143
|
-
* @default DefaultPlugins
|
|
144
|
-
* @see {@link DefaultPlugins} for available plugins
|
|
145
|
-
*/
|
|
146
|
-
plugins?: Plugin[] | ((defaultPlugins: DefaultPlugins) => Plugin[]);
|
|
147
|
-
/**
|
|
148
|
-
* One or more entrypoints to extract translations from, could be:
|
|
149
|
-
* - file path, will be treated as a single file entrypoint
|
|
150
|
-
* - glob pattern will be expanded to match files, each treated as a separate entrypoint
|
|
151
|
-
* - configuration object with options for the entrypoint
|
|
152
|
-
* @see {@link EntrypointConfig} for configuration options
|
|
153
|
-
*/
|
|
154
|
-
entrypoints: string | EntrypointConfig | Array<string | EntrypointConfig>;
|
|
155
|
-
/**
|
|
156
|
-
* Function to determine the destination path for each extracted locale file
|
|
157
|
-
* @default `./translations/entrypoint.locale.po`
|
|
158
|
-
* @see {@link DestinationFn}
|
|
159
|
-
* @see Can be overridden per entrypoint via `destination` in {@link EntrypointConfig
|
|
160
|
-
*/
|
|
161
|
-
destination?: DestinationFn;
|
|
162
|
-
/**
|
|
163
|
-
* Strategy to handle obsolete translations in existing locale files
|
|
164
|
-
* @default "mark"
|
|
165
|
-
* @see {@link ObsoleteStrategy} for available strategies
|
|
166
|
-
* @see Can be overridden per entrypoint via `obsolete` in {@link EntrypointConfig
|
|
167
|
-
*/
|
|
168
|
-
obsolete?: ObsoleteStrategy;
|
|
169
|
-
/**
|
|
170
|
-
* Whether to recursively walk dependencies of the entrypoints
|
|
171
|
-
* @default true
|
|
172
|
-
* @see Can be overridden per entrypoint via `walk` in {@link EntrypointConfig}.
|
|
173
|
-
*/
|
|
174
|
-
walk?: boolean;
|
|
175
|
-
/**
|
|
176
|
-
* Paths or patterns to exclude from extraction, applied to all entrypoints
|
|
177
|
-
* @default [/node_modules/, /dist/, /build/]
|
|
178
|
-
* @see Can be overridden per entrypoint via `exclude` in {@link EntrypointConfig}.
|
|
179
|
-
*/
|
|
180
|
-
exclude?: Exclude | Exclude[];
|
|
181
|
-
/**
|
|
182
|
-
* Log level for the extraction process
|
|
183
|
-
* @default "info"
|
|
184
|
-
*/
|
|
185
|
-
logLevel?: LogLevel;
|
|
186
|
-
}
|
|
187
|
-
interface ResolvedEntrypoint extends Omit<EntrypointConfig, "exclude"> {
|
|
188
|
-
exclude?: Exclude[];
|
|
189
|
-
}
|
|
190
|
-
interface ResolvedConfig {
|
|
191
|
-
plugins: Plugin[];
|
|
192
|
-
entrypoints: ResolvedEntrypoint[];
|
|
193
|
-
defaultLocale: string;
|
|
194
|
-
locales: string[];
|
|
195
|
-
destination: DestinationFn;
|
|
196
|
-
obsolete: ObsoleteStrategy;
|
|
197
|
-
walk: boolean;
|
|
198
|
-
logLevel: LogLevel;
|
|
199
|
-
exclude: Exclude[];
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Type helper to make it easier to use translate.config.ts
|
|
203
|
-
* @param config - {@link UserConfig}.
|
|
204
|
-
*/
|
|
205
|
-
declare function defineConfig(config: UserConfig): ResolvedConfig;
|
|
206
|
-
//#endregion
|
|
207
|
-
//#region src/plugins/react/react.d.ts
|
|
208
|
-
declare function react(): Plugin<string, Translation[]>;
|
|
209
|
-
//#endregion
|
|
210
4
|
//#region src/run.d.ts
|
|
211
5
|
type Task = {
|
|
212
6
|
type: "resolve";
|
|
@@ -226,5 +20,5 @@ declare function run(entrypoint: ResolvedEntrypoint, {
|
|
|
226
20
|
logger?: Logger;
|
|
227
21
|
}): Promise<void>;
|
|
228
22
|
//#endregion
|
|
229
|
-
export { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, Task, UserConfig, cleanup, core, defineConfig, po, react, run };
|
|
23
|
+
export { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, Task, UniversalPlugin, UserConfig, cleanup, core, defineConfig, po, react, run };
|
|
230
24
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/src/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../../src/run.ts"],"sourcesContent":[],"mappings":";;;;KAiBY,IAAA;EAAA,IAAA,EAAA,SAAI;EAAA,IAAA,EAGA,WAHA;;MAOA,EAAA,MAAA;MAIA,EAJA,QAIA;CAAW,GAAA;EAGL,IAAA,EAAG,SAAA;EAAA,IAAA,EAHT,WAGS;;AAEnB,iBAFgB,GAAA,CAEhB,UAAA,EADU,kBACV,EAAA;EAAA,MAAA;EAAA;CAAA,EAAA;QAAQ,EAAoB,cAApB;QAAoB,CAAA,EAAyB,MAAzB;IAAiC,OAAR,CAAA,IAAA,CAAA"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,213 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { PluralFormsLocale } from "@let-value/translate";
|
|
1
|
+
import { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, Logger, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, UniversalPlugin, UserConfig, cleanup$1 as cleanup, core$1 as core, defineConfig, po$1 as po, react$1 as react } from "../configuration-CFa8J7EM.js";
|
|
2
|
+
import "../core-ACuLoi2B.js";
|
|
4
3
|
|
|
5
|
-
//#region src/logger.d.ts
|
|
6
|
-
type LogLevel = LogLevelNames;
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/plugin.d.ts
|
|
9
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
10
|
-
interface Context {
|
|
11
|
-
config: ResolvedConfig;
|
|
12
|
-
generatedAt: Date;
|
|
13
|
-
logger?: Logger;
|
|
14
|
-
}
|
|
15
|
-
interface ResolveArgs<TInput = unknown> {
|
|
16
|
-
entrypoint: string;
|
|
17
|
-
path: string;
|
|
18
|
-
namespace: string;
|
|
19
|
-
data?: TInput;
|
|
20
|
-
}
|
|
21
|
-
interface ResolveResult<TInput = unknown> {
|
|
22
|
-
entrypoint: string;
|
|
23
|
-
path: string;
|
|
24
|
-
namespace: string;
|
|
25
|
-
data?: TInput;
|
|
26
|
-
}
|
|
27
|
-
interface LoadArgs<TInput = unknown> {
|
|
28
|
-
entrypoint: string;
|
|
29
|
-
path: string;
|
|
30
|
-
namespace: string;
|
|
31
|
-
data?: TInput;
|
|
32
|
-
}
|
|
33
|
-
interface LoadResult<TInput = unknown> {
|
|
34
|
-
entrypoint: string;
|
|
35
|
-
path: string;
|
|
36
|
-
namespace: string;
|
|
37
|
-
data: TInput;
|
|
38
|
-
}
|
|
39
|
-
interface ProcessArgs<TInput = unknown> {
|
|
40
|
-
entrypoint: string;
|
|
41
|
-
path: string;
|
|
42
|
-
namespace: string;
|
|
43
|
-
data: TInput;
|
|
44
|
-
}
|
|
45
|
-
interface ProcessResult<TOutput = unknown> {
|
|
46
|
-
entrypoint: string;
|
|
47
|
-
path: string;
|
|
48
|
-
namespace: string;
|
|
49
|
-
data: TOutput;
|
|
50
|
-
}
|
|
51
|
-
type Filter = {
|
|
52
|
-
filter: RegExp;
|
|
53
|
-
namespace?: string;
|
|
54
|
-
};
|
|
55
|
-
type ResolveHook<TInput = unknown> = (args: ResolveArgs<TInput>) => MaybePromise<ResolveResult<TInput> | undefined>;
|
|
56
|
-
type LoadHook<TInput = unknown> = (args: LoadArgs<TInput>) => MaybePromise<LoadResult<TInput> | undefined>;
|
|
57
|
-
type ProcessHook<TInput = unknown, TOutput = unknown> = (args: ProcessArgs<TInput>) => MaybePromise<ProcessResult<TOutput> | undefined>;
|
|
58
|
-
interface Build<TInput = unknown, TOutput = unknown> {
|
|
59
|
-
context: Context;
|
|
60
|
-
resolve(args: ResolveArgs<unknown>): void;
|
|
61
|
-
load(args: LoadArgs<unknown>): void;
|
|
62
|
-
process(args: ProcessArgs<unknown>): void;
|
|
63
|
-
defer(namespace: string): Promise<void>;
|
|
64
|
-
onResolve(options: Filter, hook: ResolveHook<TInput>): void;
|
|
65
|
-
onLoad(options: Filter, hook: LoadHook<TInput>): void;
|
|
66
|
-
onProcess(options: Filter, hook: ProcessHook<TInput, TOutput>): void;
|
|
67
|
-
}
|
|
68
|
-
interface Plugin<TInput = unknown, TOutput = unknown> {
|
|
69
|
-
name: string;
|
|
70
|
-
setup(build: Build<TInput, TOutput>): void;
|
|
71
|
-
}
|
|
72
|
-
//#endregion
|
|
73
|
-
//#region src/plugins/cleanup/cleanup.d.ts
|
|
74
|
-
declare function cleanup(): Plugin;
|
|
75
|
-
//#endregion
|
|
76
|
-
//#region src/plugins/core/queries/types.d.ts
|
|
77
|
-
interface Comments {
|
|
78
|
-
translator?: string;
|
|
79
|
-
reference?: string;
|
|
80
|
-
extracted?: string;
|
|
81
|
-
flag?: string;
|
|
82
|
-
previous?: string;
|
|
83
|
-
}
|
|
84
|
-
interface Translation {
|
|
85
|
-
context?: string;
|
|
86
|
-
id: string;
|
|
87
|
-
plural?: string;
|
|
88
|
-
message: string[];
|
|
89
|
-
comments?: Comments;
|
|
90
|
-
obsolete?: boolean;
|
|
91
|
-
}
|
|
92
|
-
//#endregion
|
|
93
|
-
//#region src/plugins/core/core.d.ts
|
|
94
|
-
declare function core(): Plugin<string, Translation[]>;
|
|
95
|
-
//#endregion
|
|
96
|
-
//#region src/plugins/po/po.d.ts
|
|
97
|
-
declare function po(): Plugin;
|
|
98
|
-
//#endregion
|
|
99
|
-
//#region src/configuration.d.ts
|
|
100
|
-
type DestinationFn = (args: {
|
|
101
|
-
locale: string;
|
|
102
|
-
entrypoint: string;
|
|
103
|
-
path: string;
|
|
104
|
-
}) => string;
|
|
105
|
-
type ExcludeFn = (args: {
|
|
106
|
-
entrypoint: string;
|
|
107
|
-
path: string;
|
|
108
|
-
}) => boolean;
|
|
109
|
-
type Exclude = RegExp | ExcludeFn;
|
|
110
|
-
declare const defaultPlugins: {
|
|
111
|
-
core: typeof core;
|
|
112
|
-
po: typeof po;
|
|
113
|
-
cleanup: typeof cleanup;
|
|
114
|
-
};
|
|
115
|
-
type DefaultPlugins = typeof defaultPlugins;
|
|
116
|
-
/**
|
|
117
|
-
* Strategy to handle obsolete translations in existing locale files:
|
|
118
|
-
* - "mark": keep obsolete entries in the locale file but mark them as obsolete
|
|
119
|
-
* - "remove": remove obsolete entries from the locale file
|
|
120
|
-
*/
|
|
121
|
-
type ObsoleteStrategy = "mark" | "remove";
|
|
122
|
-
interface EntrypointConfig {
|
|
123
|
-
entrypoint: string;
|
|
124
|
-
destination?: DestinationFn;
|
|
125
|
-
obsolete?: ObsoleteStrategy;
|
|
126
|
-
walk?: boolean;
|
|
127
|
-
exclude?: Exclude | Exclude[];
|
|
128
|
-
}
|
|
129
|
-
interface UserConfig {
|
|
130
|
-
/**
|
|
131
|
-
* Default locale to use as the base for extraction
|
|
132
|
-
* @default "en"
|
|
133
|
-
* @see {@link PluralFormsLocale} for available locales
|
|
134
|
-
*/
|
|
135
|
-
defaultLocale?: PluralFormsLocale;
|
|
136
|
-
/**
|
|
137
|
-
* Array of locales to extract translations for
|
|
138
|
-
* @default [defaultLocale]
|
|
139
|
-
* @see {@link PluralFormsLocale} for available locales
|
|
140
|
-
*/
|
|
141
|
-
locales?: PluralFormsLocale[];
|
|
142
|
-
/**
|
|
143
|
-
* Array of plugins to use or a function to override the default plugins
|
|
144
|
-
* @default DefaultPlugins
|
|
145
|
-
* @see {@link DefaultPlugins} for available plugins
|
|
146
|
-
*/
|
|
147
|
-
plugins?: Plugin[] | ((defaultPlugins: DefaultPlugins) => Plugin[]);
|
|
148
|
-
/**
|
|
149
|
-
* One or more entrypoints to extract translations from, could be:
|
|
150
|
-
* - file path, will be treated as a single file entrypoint
|
|
151
|
-
* - glob pattern will be expanded to match files, each treated as a separate entrypoint
|
|
152
|
-
* - configuration object with options for the entrypoint
|
|
153
|
-
* @see {@link EntrypointConfig} for configuration options
|
|
154
|
-
*/
|
|
155
|
-
entrypoints: string | EntrypointConfig | Array<string | EntrypointConfig>;
|
|
156
|
-
/**
|
|
157
|
-
* Function to determine the destination path for each extracted locale file
|
|
158
|
-
* @default `./translations/entrypoint.locale.po`
|
|
159
|
-
* @see {@link DestinationFn}
|
|
160
|
-
* @see Can be overridden per entrypoint via `destination` in {@link EntrypointConfig
|
|
161
|
-
*/
|
|
162
|
-
destination?: DestinationFn;
|
|
163
|
-
/**
|
|
164
|
-
* Strategy to handle obsolete translations in existing locale files
|
|
165
|
-
* @default "mark"
|
|
166
|
-
* @see {@link ObsoleteStrategy} for available strategies
|
|
167
|
-
* @see Can be overridden per entrypoint via `obsolete` in {@link EntrypointConfig
|
|
168
|
-
*/
|
|
169
|
-
obsolete?: ObsoleteStrategy;
|
|
170
|
-
/**
|
|
171
|
-
* Whether to recursively walk dependencies of the entrypoints
|
|
172
|
-
* @default true
|
|
173
|
-
* @see Can be overridden per entrypoint via `walk` in {@link EntrypointConfig}.
|
|
174
|
-
*/
|
|
175
|
-
walk?: boolean;
|
|
176
|
-
/**
|
|
177
|
-
* Paths or patterns to exclude from extraction, applied to all entrypoints
|
|
178
|
-
* @default [/node_modules/, /dist/, /build/]
|
|
179
|
-
* @see Can be overridden per entrypoint via `exclude` in {@link EntrypointConfig}.
|
|
180
|
-
*/
|
|
181
|
-
exclude?: Exclude | Exclude[];
|
|
182
|
-
/**
|
|
183
|
-
* Log level for the extraction process
|
|
184
|
-
* @default "info"
|
|
185
|
-
*/
|
|
186
|
-
logLevel?: LogLevel;
|
|
187
|
-
}
|
|
188
|
-
interface ResolvedEntrypoint extends Omit<EntrypointConfig, "exclude"> {
|
|
189
|
-
exclude?: Exclude[];
|
|
190
|
-
}
|
|
191
|
-
interface ResolvedConfig {
|
|
192
|
-
plugins: Plugin[];
|
|
193
|
-
entrypoints: ResolvedEntrypoint[];
|
|
194
|
-
defaultLocale: string;
|
|
195
|
-
locales: string[];
|
|
196
|
-
destination: DestinationFn;
|
|
197
|
-
obsolete: ObsoleteStrategy;
|
|
198
|
-
walk: boolean;
|
|
199
|
-
logLevel: LogLevel;
|
|
200
|
-
exclude: Exclude[];
|
|
201
|
-
}
|
|
202
|
-
/**
|
|
203
|
-
* Type helper to make it easier to use translate.config.ts
|
|
204
|
-
* @param config - {@link UserConfig}.
|
|
205
|
-
*/
|
|
206
|
-
declare function defineConfig(config: UserConfig): ResolvedConfig;
|
|
207
|
-
//#endregion
|
|
208
|
-
//#region src/plugins/react/react.d.ts
|
|
209
|
-
declare function react(): Plugin<string, Translation[]>;
|
|
210
|
-
//#endregion
|
|
211
4
|
//#region src/run.d.ts
|
|
212
5
|
type Task = {
|
|
213
6
|
type: "resolve";
|
|
@@ -227,5 +20,5 @@ declare function run(entrypoint: ResolvedEntrypoint, {
|
|
|
227
20
|
logger?: Logger;
|
|
228
21
|
}): Promise<void>;
|
|
229
22
|
//#endregion
|
|
230
|
-
export { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, Task, UserConfig, cleanup, core, defineConfig, po, react, run };
|
|
23
|
+
export { Build, Context, DestinationFn, EntrypointConfig, Exclude, ExcludeFn, Filter, LoadArgs, LoadHook, LoadResult, ObsoleteStrategy, Plugin, ProcessArgs, ProcessHook, ProcessResult, ResolveArgs, ResolveHook, ResolveResult, ResolvedConfig, ResolvedEntrypoint, Task, UniversalPlugin, UserConfig, cleanup, core, defineConfig, po, react, run };
|
|
231
24
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../src/run.ts"],"sourcesContent":[],"mappings":";;;;KAiBY,IAAA;EAAA,IAAA,EAAA,SAAI;EAAA,IAAA,EAGA,WAHA;;MAOA,EAAA,MAAA;MAIA,EAJA,QAIA;CAAW,GAAA;EAGL,IAAA,EAAG,SAAA;EAAA,IAAA,EAHT,WAGS;;AAEnB,iBAFgB,GAAA,CAEhB,UAAA,EADU,kBACV,EAAA;EAAA,MAAA;EAAA;CAAA,EAAA;QAAQ,EAAoB,cAApB;QAAoB,CAAA,EAAyB,MAAzB;IAAiC,OAAR,CAAA,IAAA,CAAA"}
|