/** * Client-side storage source registry. * * Manages multiple `StorageSource` instances keyed by * `StorageSourceDefinition.key`. Collection properties reference * a source by key via `StorageConfig.storageSource`. * * Typical bootstrap flow: * 1. Fetch definitions from `GET /api/storage/sources` * 2. Build server-backed sources automatically via `createStorage(transport, key)` * 3. Register "direct" sources manually (e.g. Firebase Storage hook) */ import type { StorageSource, StorageSourceRegistry, StorageSourceDefinition } from "@rebasepro/types"; import type { Transport } from "./transport"; /** * Default implementation of the client-side `StorageSourceRegistry`. */ export declare class ClientStorageSourceRegistry implements StorageSourceRegistry { private sources; /** * Register a storage source. * @param key - Unique key matching a `StorageSourceDefinition.key` * @param source - The `StorageSource` instance */ register(key: string, source: StorageSource): void; getDefault(): StorageSource; get(key: string | undefined | null): StorageSource | undefined; getOrDefault(key: string | undefined | null): StorageSource; has(key: string): boolean; list(): string[]; /** * Build a registry from `StorageSourceDefinition[]` and an HTTP transport. * * - Sources with `transport: "server"` are auto-wired via `createStorage(transport, key)`. * - Sources with `transport: "direct"` are **not** auto-wired — they must * be registered manually after this call (e.g. via a Firebase hook). * * @param definitions - Array of storage source definitions * @param transport - HTTP transport for server-backed sources */ static fromDefinitions(definitions: StorageSourceDefinition[], transport: Transport): ClientStorageSourceRegistry; }