import { SourceFile } from "./source-file"; import { Config } from "./config"; import { Diagnostic } from "./diagnostic"; export declare class Project { constructor(config: Config); readonly config: Config; private readonly _sources; private readonly _unprocessedSources; private readonly _sourceIds; private _data; get sources(): ReadonlyMap; get data(): Project.Data; set data(value: Project.Data); updateSource(source: SourceFile): void; removeSource(filename: string): void; getSourceForId(id: string): SourceFile | undefined; verify(): boolean; processSources(context: Project.SourceProcessingContext): Promise; compile(): Promise<{ resources: Map; }>; getDiagnostics(): Diagnostic[]; } export declare namespace Project { interface SourceProcessingContext { writeSource(filename: string, sourceText: string): Promise | void; writeProjectData(data: Project.Data): Promise | void; } interface CompileResult { readonly resources: Map; } interface Translation { value: Value; lastModified: string; } interface TranslationSet extends Translation { translations: { [language: string]: Translation; }; } interface Data { readonly version: 1; readonly values: { [id: string]: TranslationSet; }; } type SimpleValue = string; type PluralValue = string[]; type Value = SimpleValue | PluralValue; enum ValueType { Unknown = 0, Simple = 1, Plural = 2 } function getValueType(value: any): ValueType; function isId(id: any): id is string; function valueEquals(a?: Value, b?: Value): boolean; namespace Data { function now(): string; function stringify(data: Data): string; function parse(value: string): Data; function createEmpty(): Data; function updateValue(data: Data, id: string, value: Value, oldId: string | undefined): boolean; function removeValue(data: Data, id: string): void; } interface LanguageResources { [namespace: string]: { [id: string]: Value; }; } namespace LanguageResources { function stringify(resources: LanguageResources, minify?: boolean): string; function parse(value: string): LanguageResources; function createEmpty(): LanguageResources; function setValue(resources: LanguageResources, namespace: string, id: string, value: string | string[]): void; } }