import type { FilterType, FindOptions, PhysicalStore } from '@furystack/core';
import type { Constructable } from '@furystack/inject';
import { EventHub } from '@furystack/utils';
import { promises } from 'fs';
/**
 * Store implementation that stores info in a simple JSON file
 */
export declare class FileSystemStore<T, TPrimaryKey extends keyof T> extends EventHub<{
    onEntityAdded: {
        entity: T;
    };
    onEntityUpdated: {
        id: T[TPrimaryKey];
        change: Partial<T>;
    };
    onEntityRemoved: {
        key: T[TPrimaryKey];
    };
}> implements PhysicalStore<T, TPrimaryKey, T> {
    private readonly options;
    private readonly watcher?;
    readonly model: Constructable<T>;
    readonly primaryKey: TPrimaryKey;
    private readonly inMemoryStore;
    private get cache();
    remove(...keys: Array<T[TPrimaryKey]>): Promise<void>;
    tick: ReturnType<typeof setInterval>;
    hasChanges: boolean;
    get(key: T[TPrimaryKey], select?: Array<keyof T>): Promise<T | undefined>;
    add(...entries: T[]): Promise<import("@furystack/core").CreateResult<T>>;
    find<TFields extends Array<keyof T>>(filter: FindOptions<T, TFields>): Promise<import("@furystack/core").PartialResult<T, TFields>[]>;
    count(filter?: FilterType<T>): Promise<number>;
    private fileLock;
    saveChanges(): Promise<void>;
    [Symbol.asyncDispose](): Promise<void>;
    reloadData(): Promise<void>;
    update(id: T[TPrimaryKey], data: T): Promise<void>;
    readFile: typeof promises.readFile;
    writeFile: typeof promises.writeFile;
    constructor(options: {
        fileName: string;
        primaryKey: TPrimaryKey;
        tickMs?: number;
        model: Constructable<T>;
    });
}
//# sourceMappingURL=filesystem-store.d.ts.map