@verbaly/compiler 0.29.0 → 0.31.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
@@ -128,6 +128,16 @@ declare class MessageRegistry {
128
128
  origins(): Map<string, string[]>;
129
129
  }
130
130
  //#endregion
131
+ //#region src/validate.d.ts
132
+ declare const PLURAL_CATEGORIES: Set<string>;
133
+ type IssueSeverity = 'error' | 'warning';
134
+ interface StructureIssue {
135
+ severity: IssueSeverity;
136
+ message: string;
137
+ }
138
+ declare function validateMessage(message: string, locale?: string): StructureIssue[];
139
+ declare function validatePair(source: string, translated: string): StructureIssue[];
140
+ //#endregion
131
141
  //#region src/check.d.ts
132
142
  interface MissingEntry {
133
143
  locale: string;
@@ -138,13 +148,23 @@ interface UnknownEntry {
138
148
  key: string;
139
149
  files: string[];
140
150
  }
151
+ interface BrokenEntry {
152
+ locale: string;
153
+ key: string;
154
+ severity: IssueSeverity;
155
+ issue: string;
156
+ }
141
157
  interface CheckResult {
142
158
  ok: boolean;
143
159
  missing: MissingEntry[];
144
160
  unknown: UnknownEntry[];
161
+ broken: BrokenEntry[];
145
162
  }
163
+ declare function gatePasses(result: Omit<CheckResult, 'ok'>): boolean;
146
164
  declare function check(cfg: ResolvedConfig, catalogs: Catalogs, registry: MessageRegistry): CheckResult;
147
165
  declare function formatCheckResult(result: CheckResult): string;
166
+ declare function checkNextSteps(result: CheckResult): string;
167
+ declare function formatCheckWarnings(result: CheckResult): string;
148
168
  declare function githubCheckAnnotations(result: CheckResult, registry: MessageRegistry, root: string): string[];
149
169
  //#endregion
150
170
  //#region src/codegen.d.ts
@@ -265,11 +285,19 @@ interface InitOptions {
265
285
  interface InitResult {
266
286
  created: string[];
267
287
  skipped: string[];
268
- bundler: 'astro' | 'vite' | 'webpack' | 'rollup' | 'rspack' | 'esbuild' | undefined;
288
+ host: Host | undefined;
269
289
  configFile: string;
270
290
  next: string[];
271
291
  }
272
- declare function detectBundler(root: string): InitResult['bundler'];
292
+ type Host = 'nuxt' | 'next' | 'sveltekit' | 'astro' | 'vite' | 'webpack' | 'rspack' | 'rollup' | 'esbuild';
293
+ interface HostSetup {
294
+ name: Host;
295
+ pkg: string;
296
+ wire: string;
297
+ }
298
+ declare const WIRING_PACKAGES: string[];
299
+ declare function readDependencies(root: string): Record<string, string>;
300
+ declare function detectHost(root: string): HostSetup | undefined;
273
301
  declare function init(options?: InitOptions): InitResult;
274
302
  //#endregion
275
303
  //#region src/key.d.ts
@@ -337,6 +365,7 @@ interface LocaleStatus {
337
365
  translated: number;
338
366
  total: number;
339
367
  drafts: number;
368
+ broken: number;
340
369
  }
341
370
  interface StatusResult {
342
371
  messages: number;
@@ -383,5 +412,5 @@ interface WrapCodeResult {
383
412
  }
384
413
  declare function wrapCode(code: string, file: string): WrapCodeResult;
385
414
  //#endregion
386
- export { type Alternate, type Analysis, type AnalyzeOptions, type Catalog, type Catalogs, type CheckResult, type ClaudeProviderOptions, DRAFTS_FILE, type DoctorEntry, type DoctorResult, type Drafts, type ExchangeFormat, type ExportFormat, type ExportOptions, type ExportResult, type ExportedFile, type ImportOptions, type ImportResult, type InitOptions, type InitResult, LOCALE_MODULE_PREFIX, type LocaleStatus, MessageRegistry, type MissingEntry, type MobileFormat, 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 StatusResult, 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, type WatchProjectOptions, type WrapCodeResult, type WrapEntry, type WrapOptions, type WrapResult, type WrapSkip, analyze, analyzeFile, analyzeSfc, catalogPath, check, claudeProvider, clearDrafts, collectOrigins, collectParams, createSourceFilter, detectBundler, doctor, effectiveDrafts, exportCatalogs, extractProject, findConfigFile, formatCheckResult, formatStatusResult, generateDts, generateLocaleModule, generateRuntimeModule, githubCheckAnnotations, importCatalogs, init, isMobileFormat, isTransformTarget, loadCatalogs, loadConfig, loadConfigFile, loadDrafts, loadVirtualModule, markDrafts, parseExchangeFile, pruneCatalogs, pseudoCatalogs, pseudoLocalize, readCatalog, renderHtml, renderParamType, renderSite, resolveConfig, resolveProvider, resolveVirtualId, runBuildGate, saveDrafts, serializeCatalog, stableKey, status, structureMatches, syncCatalogs, targetLocales, transformCode, transformSource, translateCatalogs, watchProject, wrapCode, wrapProject, writeCatalog, writeDts };
415
+ export { type Alternate, type Analysis, type AnalyzeOptions, type BrokenEntry, type Catalog, type Catalogs, type CheckResult, type ClaudeProviderOptions, DRAFTS_FILE, type DoctorEntry, type DoctorResult, type Drafts, type ExchangeFormat, type ExportFormat, type ExportOptions, type ExportResult, type ExportedFile, type Host, type HostSetup, type ImportOptions, type ImportResult, type InitOptions, type InitResult, type IssueSeverity, LOCALE_MODULE_PREFIX, type LocaleStatus, MessageRegistry, type MissingEntry, type MobileFormat, PLURAL_CATEGORIES, 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 StatusResult, type StructureIssue, 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, WIRING_PACKAGES, type WatchProjectOptions, type WrapCodeResult, type WrapEntry, type WrapOptions, type WrapResult, type WrapSkip, analyze, analyzeFile, analyzeSfc, catalogPath, check, checkNextSteps, claudeProvider, clearDrafts, collectOrigins, collectParams, createSourceFilter, detectHost, doctor, effectiveDrafts, exportCatalogs, extractProject, findConfigFile, formatCheckResult, formatCheckWarnings, formatStatusResult, gatePasses, generateDts, generateLocaleModule, generateRuntimeModule, githubCheckAnnotations, importCatalogs, init, isMobileFormat, isTransformTarget, loadCatalogs, loadConfig, loadConfigFile, loadDrafts, loadVirtualModule, markDrafts, parseExchangeFile, pruneCatalogs, pseudoCatalogs, pseudoLocalize, readCatalog, readDependencies, renderHtml, renderParamType, renderSite, resolveConfig, resolveProvider, resolveVirtualId, runBuildGate, saveDrafts, serializeCatalog, stableKey, status, structureMatches, syncCatalogs, targetLocales, transformCode, transformSource, translateCatalogs, validateMessage, validatePair, watchProject, wrapCode, wrapProject, writeCatalog, writeDts };
387
416
  //# sourceMappingURL=index.d.ts.map