import type { ArchivistInstance } from '@xyo-network/sdk';
import type { ConnectionConfig } from '../config/connections/Connection.js';
import type { ArchivistConnectOptions } from './ArchivistConnectOptions.js';
/** A connection binding handed to a factory: the connection's name plus its config. */
export interface ArchivistConnectionBinding {
    config: ConnectionConfig;
    name: string;
}
/**
 * Contract every substrate factory implements. `connect` is a static method on the
 * concrete class (see MemoryArchivistFactory); this interface documents the shape and
 * lets call sites depend on the abstraction rather than a concrete factory.
 */
export interface ArchivistFactory {
    connect(connectionName: string, config: ConnectionConfig, options: ArchivistConnectOptions): Promise<ArchivistInstance>;
}
/** Compose the cache key from the connection name and the logical archivist name. */
export declare function archivistCacheKey(connectionName: string, archivistName: string): string;
/**
 * Per-substrate cache of archivist instances keyed by (connectionName, archivistName).
 * A single Mutex serializes creation so concurrent callers with the same key share
 * one instance rather than racing to create two.
 */
export declare class ArchivistInstanceCache {
    private readonly cache;
    private readonly mutex;
    clear(): Promise<void>;
    getOrCreate(connectionName: string, archivistName: string, create: () => Promise<ArchivistInstance>): Promise<ArchivistInstance>;
    has(connectionName: string, archivistName: string): boolean;
}
//# sourceMappingURL=ArchivistFactory.d.ts.map