/** * Auth error types and error class. * * Provides typed error handling for OAuth flow and session management. */ /** * Error codes for authentication-related failures. */ export type AuthErrorCode = 'invalid_state' | 'state_mismatch' | 'missing_code' | 'token_exchange_failed' | 'verification_failed' | 'session_invalid' | 'session_expired' | 'network_error' | 'cloud_api_error'; /** * Options for AuthError constructor. */ export interface AuthErrorOptions { cause?: Error; cloudCode?: string; cloudMessage?: string; } /** * Error class for authentication-related failures. * Uses a code discriminator for programmatic error handling. */ export declare class AuthError extends Error { readonly code: AuthErrorCode; readonly cause?: Error; readonly cloudCode?: string; readonly cloudMessage?: string; constructor(code: AuthErrorCode, message: string, options?: AuthErrorOptions); /** * Factory: OAuth state parameter is invalid or malformed. */ static invalidState(): AuthError; /** * Factory: OAuth state parameter does not match expected value. */ static stateMismatch(): AuthError; /** * Factory: Authorization code is missing from callback. */ static missingCode(): AuthError; /** * Factory: Token exchange with Cloud API failed. */ static tokenExchangeFailed(options?: AuthErrorOptions): AuthError; /** * Factory: Token verification failed. */ static verificationFailed(): AuthError; /** * Factory: Session is invalid. */ static sessionInvalid(): AuthError; /** * Factory: Session has expired. */ static sessionExpired(): AuthError; /** * Factory: Network error during API call. */ static networkError(cause?: Error): AuthError; /** * Factory: Cloud API returned an error. */ static cloudApiError(options?: AuthErrorOptions): AuthError; } //# sourceMappingURL=error.d.ts.map