import type { DatabaseConnection, RepositoryInstanceOptions } from './types.js';
type WithRemoveExisting = {
    removeExisting?: boolean;
};
/**
 * Caches a single async-created instance (a database repository, or a service that
 * wraps one) and reuses it across calls.
 *
 * A new instance is created only when none exists yet, or when the creation options
 * change.
 */
export declare class InstanceCacheResolver<TInstance, TOptions extends WithRemoveExisting> {
    #private;
    constructor(create: (options: TOptions) => Promise<TInstance>);
    get(options: TOptions): Promise<TInstance>;
}
export declare function createDatabaseRepositoryInstance<TRepository>(options: RepositoryInstanceOptions, repositoryName: string, repositoryClass: new (dbConnection: DatabaseConnection) => TRepository): Promise<TRepository>;
export {};
//# sourceMappingURL=instance-cache-resolver.d.ts.map