/** * Authentication Manager and Factory * * Central manager for handling multiple authentication profiles * and creating auth providers based on configuration. */ import { AuthProvider, AuthConfig, AuthResult, AuthCredentials } from './index.js'; /** * Authentication error */ export declare class AuthError extends Error { code: string; provider?: string; constructor(message: string, provider?: string); } /** * Authentication Manager * * Manages multiple authentication profiles and provides * a unified interface for authentication operations. */ export declare class AuthManager { private profiles; /** * Register an authentication profile */ registerProfile(name: string, config: AuthConfig): void; /** * Unregister an authentication profile */ unregisterProfile(name: string): void; /** * Get a registered profile */ getProfile(name: string): AuthConfig | undefined; /** * List all registered profiles */ listProfiles(): string[]; /** * Authenticate using a named profile */ authenticate(name: string): Promise; /** * Authenticate using a configuration directly */ authenticateWithConfig(config: AuthConfig): Promise; /** * Create an auth provider based on configuration type */ createProvider(config: AuthConfig): AuthProvider; /** * Refresh authentication for a named profile */ refresh(name: string): Promise; /** * Clear authentication for a named profile */ clear(name: string): Promise; /** * Validate authentication for a named profile */ validate(name: string): Promise; /** * Clear all cached credentials */ clearAll(): void; } /** * Global auth manager instance */ export declare const authManager: AuthManager; /** * Helper function to authenticate with a single config */ export declare function authenticate(config: AuthConfig): Promise; /** * Helper function to create auth credentials for use in requests */ export declare function createAuthHeaders(credentials: AuthCredentials): Record; /** * Apply auth credentials to a fetch request init */ export declare function applyAuthToRequest(credentials: AuthCredentials, init?: RequestInit): RequestInit;