import type { ServiceInstanceOptions } from './types.js';
type SyncableRepository = {
    sync: () => Promise<void>;
};
type RunOptions<T> = {
    onRepositoryMissing?: () => Promise<T> | T;
    skipSync?: boolean;
};
type BaseServiceConfig<R extends SyncableRepository | null> = {
    repository: NonNullable<R>;
    createRepository?: (options: ServiceInstanceOptions) => Promise<NonNullable<R>>;
};
export declare abstract class BaseService<R extends SyncableRepository | null> {
    #private;
    protected constructor(options: ServiceInstanceOptions | undefined, config: BaseServiceConfig<R>);
    protected get isLocalDbMode(): boolean;
    protected getRepository(): R;
    protected setRepository(repository: NonNullable<R>): void;
    protected recreateRepository(): Promise<NonNullable<R> | null>;
    protected syncRepositoryIfNeeded(): Promise<void>;
    protected runRead<T>(run: (repo: NonNullable<R>) => Promise<T>, options?: RunOptions<T>): Promise<T>;
    protected runWrite<T>(run: (repo: NonNullable<R>) => Promise<T>, options?: RunOptions<T>): Promise<T>;
}
export {};
//# sourceMappingURL=base-service.d.ts.map