import { LinguiConfigNormalized, OrderBy, OrderByFn } from "@lingui/conf"; import { FormatterWrapper } from "./formats/index.js"; import { CompiledCatalogNamespace } from "./compile.js"; import { GetTranslationsOptions } from "./catalog/getTranslationsForCatalog.js"; import { AllCatalogsType, CatalogType, ExtractedCatalogType } from "./types.js"; import { ExtractWorkerPool } from "./workerPools.js"; export type MakeOptions = { files?: string[]; clean: boolean; overwrite: boolean; locale?: string[]; orderBy: OrderBy; workerPool?: ExtractWorkerPool; }; export type MakeTemplateOptions = { files?: string[]; orderBy: OrderBy; workerPool?: ExtractWorkerPool; }; export type MergeOptions = { overwrite?: boolean; files?: string[]; }; export type CatalogProps = { name?: string; path: string; include: Array; exclude?: Array; templatePath?: string; format: FormatterWrapper; }; export declare class Catalog { config: LinguiConfigNormalized; name?: string; path: string; include: Array; exclude: Array; format: FormatterWrapper; templateFile: string; constructor({ name, path, include, templatePath, format, exclude }: CatalogProps, config: LinguiConfigNormalized); getFilename(locale: string): string; make(options: MakeOptions): Promise; makeTemplate(options: MakeTemplateOptions): Promise; /** * Collect messages from source paths. Return a raw message catalog as JSON. */ collect(options?: { files?: string[]; workerPool?: ExtractWorkerPool; }): Promise; merge(prevCatalogs: AllCatalogsType, nextCatalog: ExtractedCatalogType, options: MergeOptions): { [k: string]: CatalogType; }; getTranslations(locale: string, options: GetTranslationsOptions): Promise<{ missing: import("./catalog/getTranslationsForCatalog.js").TranslationMissingEvent[]; messages: { [id: string]: string; }; }>; write(locale: string, messages: CatalogType): Promise<[created: boolean, filename: string]>; writeTemplate(messages: CatalogType): Promise; read(locale: string): Promise; readAll(locales?: string[]): Promise; readTemplate(): Promise; get sourcePaths(): string[]; get localeDir(): string; get locales(): string[] & never[]; } export declare function cleanObsolete(messages: T): T; export declare function order(by: OrderBy, catalog: T): T; export declare function writeCompiled(path: string, locale: string, compiledCatalog: string, namespace?: CompiledCatalogNamespace): Promise; export declare const orderByMessage: OrderByFn;