import type { Options } from "conf/dist/source";
import type { IEqualsComparer } from "mobx";
import type { Migrations } from "./migrations.injectable";
export interface PersistentStorage {
    /**
     * This method does the initial synchronous load from disk and then starts writing the state
     * back to disk whenever it changes.
     */
    loadAndStartSyncing: () => void;
}
export interface PersistentStorageParams<T extends object> extends Omit<Options<T>, "migrations"> {
    readonly syncOptions?: {
        readonly fireImmediately?: boolean;
        equals?: IEqualsComparer<T>;
    };
    readonly configName: string;
    readonly migrations?: Migrations;
    /**
     * fromStore is called internally when a child class syncs with the file
     * system.
     *
     * Note: This function **must** be synchronous.
     *
     * @param data the parsed information read from the stored JSON file
     */
    fromStore(data: Partial<T>): void;
    /**
     * toJSON is called when syncing the store to the filesystem. It should
     * produce a JSON serializable object representation of the current state.
     *
     * It is recommended that a round trip is valid. Namely, calling
     * `this.fromStore(this.toJSON())` shouldn't change the state.
     */
    toJSON(): T;
}
export type CreatePersistentStorage = <T extends object>(params: PersistentStorageParams<T>) => PersistentStorage;
declare const createPersistentStorageInjectable: import("@ogre-tools/injectable").Injectable<CreatePersistentStorage, unknown, void>;
export default createPersistentStorageInjectable;
