@verbaly/compiler 0.19.0 → 0.21.0

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/index.d.ts CHANGED
@@ -23,6 +23,7 @@ interface TaggedMessage {
23
23
  name: string;
24
24
  components: TransComponent[];
25
25
  };
26
+ singleQuote?: boolean;
26
27
  }
27
28
  interface UsedKey {
28
29
  key: string;
@@ -32,7 +33,15 @@ interface Analysis {
32
33
  tagged: TaggedMessage[];
33
34
  usedKeys: UsedKey[];
34
35
  }
35
- declare function analyze(code: string, file: string): Analysis;
36
+ interface AnalyzeOptions {
37
+ tNames?: readonly string[];
38
+ }
39
+ declare function analyze(code: string, file: string, options?: AnalyzeOptions): Analysis;
40
+ //#endregion
41
+ //#region src/sfc.d.ts
42
+ declare const SFC_FILE_RE: RegExp;
43
+ declare function analyzeFile(code: string, file: string): Analysis;
44
+ declare function analyzeSfc(code: string, file: string): Analysis;
36
45
  //#endregion
37
46
  //#region src/translate.d.ts
38
47
  interface TranslateRequest {
@@ -139,17 +148,31 @@ interface RuntimeModuleOptions {
139
148
  }
140
149
  declare function generateRuntimeModule(cfg: ResolvedConfig, options?: RuntimeModuleOptions): string;
141
150
  declare function generateLocaleModule(catalog: Catalog): string;
142
- declare function generateDts(entries: Map<string, string>): string;
143
- declare function writeDts(cfg: ResolvedConfig, entries: Map<string, string>): void;
151
+ declare function generateDts(catalog: Catalog): string;
152
+ declare function writeDts(cfg: ResolvedConfig, catalog: Catalog): void;
153
+ //#endregion
154
+ //#region src/transform.d.ts
155
+ interface TransformResult {
156
+ code: string;
157
+ map: ReturnType<MagicString['generateMap']>;
158
+ }
159
+ declare function transformCode(code: string, file: string, analysis?: Analysis): TransformResult | null;
144
160
  //#endregion
145
161
  //#region src/plugin.d.ts
162
+ interface PluginOptions extends VerbalyConfig {
163
+ failOnMissing?: boolean;
164
+ }
146
165
  declare const RESOLVED_VIRTUAL_ID: string;
147
166
  declare const LOCALE_MODULE_PREFIX = "\0virtual:verbaly/locale/";
148
167
  declare const SOURCE_FILE_RE: RegExp;
149
168
  declare function resolveVirtualId(id: string): string | undefined;
150
169
  declare function loadVirtualModule(id: string, cfg: ResolvedConfig, catalogs: Catalogs): string | undefined;
151
170
  declare function isTransformTarget(id: string): boolean;
152
- declare function runBuildGate(cfg: ResolvedConfig, registry: MessageRegistry): void;
171
+ declare function transformSource(code: string, id: string, registry: MessageRegistry): {
172
+ analysis: Analysis;
173
+ result: TransformResult | null;
174
+ };
175
+ declare function runBuildGate(cfg: ResolvedConfig, registry: MessageRegistry, failOnMissing?: boolean): void;
153
176
  //#endregion
154
177
  //#region src/doctor.d.ts
155
178
  interface DoctorEntry {
@@ -286,12 +309,5 @@ interface RenderSiteResult {
286
309
  }
287
310
  declare function renderSite(cfg: ResolvedConfig, options?: RenderSiteOptions): Promise<RenderSiteResult>;
288
311
  //#endregion
289
- //#region src/transform.d.ts
290
- interface TransformResult {
291
- code: string;
292
- map: ReturnType<MagicString['generateMap']>;
293
- }
294
- declare function transformCode(code: string, file: string, analysis?: Analysis): TransformResult | null;
295
- //#endregion
296
- export { type Alternate, type Analysis, type Catalog, type Catalogs, type CheckResult, type ClaudeProviderOptions, type DoctorEntry, type DoctorResult, type ExchangeFormat, type ExportOptions, type ExportResult, type ExportedFile, type ImportOptions, type ImportResult, type InitOptions, type InitResult, LOCALE_MODULE_PREFIX, MessageRegistry, type MissingEntry, PSEUDO_LOCALE, type ParamType, RESOLVED_VIRTUAL_ID, type RenderConfig, type RenderHtmlOptions, type RenderHtmlResult, type RenderSiteOptions, type RenderSiteResult, type ResolvedConfig, type RuntimeModuleOptions, SOURCE_FILE_RE, type SyncResult, type TaggedMessage, type TaggedParam, type TransComponent, type TransformResult, type TranslateConfig, type TranslateOptions, type TranslateProvider, type TranslateRequest, type TranslateResult, type UnknownEntry, type UsedKey, VIRTUAL_ID, type VerbalyConfig, analyze, catalogPath, check, claudeProvider, collectParams, detectBundler, doctor, exportCatalogs, extractProject, findConfigFile, formatCheckResult, generateDts, generateLocaleModule, generateRuntimeModule, importCatalogs, init, isTransformTarget, loadCatalogs, loadConfig, loadConfigFile, loadVirtualModule, parseExchangeFile, pruneCatalogs, pseudoCatalogs, pseudoLocalize, readCatalog, renderHtml, renderParamType, renderSite, resolveConfig, resolveVirtualId, runBuildGate, serializeCatalog, stableKey, structureMatches, syncCatalogs, targetLocales, transformCode, translateCatalogs, writeCatalog, writeDts };
312
+ export { type Alternate, type Analysis, type AnalyzeOptions, type Catalog, type Catalogs, type CheckResult, type ClaudeProviderOptions, type DoctorEntry, type DoctorResult, type ExchangeFormat, type ExportOptions, type ExportResult, type ExportedFile, type ImportOptions, type ImportResult, type InitOptions, type InitResult, LOCALE_MODULE_PREFIX, MessageRegistry, type MissingEntry, PSEUDO_LOCALE, type ParamType, type PluginOptions, RESOLVED_VIRTUAL_ID, type RenderConfig, type RenderHtmlOptions, type RenderHtmlResult, type RenderSiteOptions, type RenderSiteResult, type ResolvedConfig, type RuntimeModuleOptions, SFC_FILE_RE, SOURCE_FILE_RE, type SyncResult, type TaggedMessage, type TaggedParam, type TransComponent, type TransformResult, type TranslateConfig, type TranslateOptions, type TranslateProvider, type TranslateRequest, type TranslateResult, type UnknownEntry, type UsedKey, VIRTUAL_ID, type VerbalyConfig, analyze, analyzeFile, analyzeSfc, catalogPath, check, claudeProvider, collectParams, detectBundler, doctor, exportCatalogs, extractProject, findConfigFile, formatCheckResult, generateDts, generateLocaleModule, generateRuntimeModule, importCatalogs, init, isTransformTarget, loadCatalogs, loadConfig, loadConfigFile, loadVirtualModule, parseExchangeFile, pruneCatalogs, pseudoCatalogs, pseudoLocalize, readCatalog, renderHtml, renderParamType, renderSite, resolveConfig, resolveVirtualId, runBuildGate, serializeCatalog, stableKey, structureMatches, syncCatalogs, targetLocales, transformCode, transformSource, translateCatalogs, writeCatalog, writeDts };
297
313
  //# sourceMappingURL=index.d.ts.map