/** * OAuth2 Authentication — Gmail + Outlook + Legacy IMAP * * Zero database. Config stored in ~/.personal-suite/config.json * under the "email" key (shared with other modules via lib/config.ts). * Optional AES-256-GCM encryption for sensitive credentials. * * Supports three auth modes: * 1. Environment variables (OAUTH2_PROVIDER, OAUTH2_EMAIL, etc.) * 2. Shared suite config file (~/.personal-suite/config.json) * 3. email_setup tool for interactive configuration */ export type OAuthProvider = 'gmail' | 'outlook' | 'imap'; export interface OAuthConfig { provider: OAuthProvider; email: string; clientId?: string; clientSecret?: string; refreshToken?: string; accessToken?: string; accessTokenExpiry?: number; imapHost?: string; imapPort?: number; imapUser?: string; imapPass?: string; smtpHost?: string; smtpPort?: number; smtpUser?: string; smtpPass?: string; } export interface TokenResponse { access_token: string; expires_in: number; token_type: string; scope?: string; refresh_token?: string; } export declare function loadConfig(): OAuthConfig | null; export declare function saveConfig(config: OAuthConfig): void; export declare function generateAuthUrl(provider: OAuthProvider, clientId: string, redirectUri: string): string; export declare function exchangeCode(provider: OAuthProvider, code: string, clientId: string, clientSecret: string, redirectUri: string): Promise; export declare function refreshAccessToken(config: OAuthConfig): Promise; export declare function getValidAccessToken(config: OAuthConfig): Promise; export declare function getImapConfig(config: OAuthConfig): { host: string; port: number; user: string; auth: 'oauth2' | 'basic'; password?: string; }; export declare function getSmtpConfig(config: OAuthConfig): { host: string; port: number; user: string; auth: 'oauth2' | 'basic'; password?: string; }; //# sourceMappingURL=oauth2.d.ts.map