import { ServiceProvider, IAuthProvider, IFunctionProvider, IStorageProvider, IDatabaseProvider } from '@progressive-development/pd-provider-interfaces'; /** * Central service container for dependency injection * * Usage: * ```typescript * // In app initialization (e.g., main.ts) * import { services } from "pd-helper-app"; * import { createFirebaseProvider } from "pd-provider-firebase"; * * services.initialize(createFirebaseProvider(firebaseConfig)); * * // In components/services * import { services } from "pd-helper-app"; * * const user = services.auth.getCurrentUser(); * ``` */ export declare class ServiceRegistry { private provider; /** * Initialize the service registry with a provider * @param provider The service provider to use * @throws Error if already initialized */ initialize(provider: ServiceProvider): void; /** * Check if the registry has been initialized */ get isInitialized(): boolean; /** * Ensure the registry is initialized before accessing providers * @throws Error if not initialized */ private ensureInitialized; /** * Get the auth provider */ get auth(): IAuthProvider; /** * Get the functions provider */ get functions(): IFunctionProvider; /** * Get the storage provider */ get storage(): IStorageProvider; /** * Get the database provider (optional) * @returns Database provider or undefined if not configured */ get database(): IDatabaseProvider | undefined; /** * Get a NAMED database provider. * * `database` returns the primary one — the database an app works with by * default. Apps that read from several (say, their own plus a shared one) * address the others by name. * * Throws rather than returning undefined: A missing name is a configuration * mistake, and it should surface where it happens, not as an empty list * three layers further on. * * @param name Logical name from the provider configuration */ databaseNamed(name: string): IDatabaseProvider; /** * Reset the registry (primarily for testing) * * Warning: This should only be used in tests. * In production, providers should be initialized once at app startup. */ reset(): void; } /** * Global service registry instance * * This is the main entry point for accessing services throughout the application. */ export declare const services: ServiceRegistry; //# sourceMappingURL=ServiceRegistry.d.ts.map