import { DataAdapter } from "../data-adapter.js"; import { DiscardObsoleteFragmentType } from "../obsolete-handling.js"; import { Source } from "../source.js"; import { DataJson } from "./json-format.js"; export declare class DefaultDataAdapter implements DataAdapter { #private; watchPatterns?: string[] | undefined; /** * Create a new default data adapter. * * @param filename The absolute filename where to store data. If undefined, this data adapter is inert and can only be used for testing by using {@link importJson} and {@link exportJson}. * @param watchable If true, this adapter supports watching the translation data file for changes. */ constructor(filename?: string, watchable?: boolean); get revision(): number; /** * Import translation data from it's json representation. * * This will increment the {@link revision}. */ importJson(data: DataJson): void; reload(): Promise; get modified(): boolean; /** * Export translation data to it's json representation. * * This will not clear the {@link modified} flag. To clear it, use {@link clearModified}. */ exportJson(): DataJson; persist(): Promise; /** * Clear the {@link modified} flag. */ clearModified(): void; updateFragment(sourceId: string, fragmentId: string, update: Source.FragmentUpdate): void; discardFragments(sourceId: string, type: DiscardObsoleteFragmentType, keepFragmentIds?: DataAdapter.IdSet): void; discardSources(type: DiscardObsoleteFragmentType, keepSourceIds: DataAdapter.IdSet): void; getSyncFragment(sourceId: string, fragment: Source.Fragment): DataAdapter.Fragment | undefined; forEachSyncFragment(getSource: (sourceId: string) => Source | undefined, callback: (fragmentId: string, fragment: DataAdapter.Fragment) => void): void; }