import { AuthenticationResult } from '@azure/msal-node';
import { Client } from '@microsoft/microsoft-graph-client';
import { StoredCredentials, StoredTokens } from './credential-store.js';
export type AuthenticationMethod = 'redirect';
/**
 * Microsoft Teams authentication manager with OAuth redirect flow
 */
export declare class TeamsAuth {
    private msalClient;
    private credentials;
    private preferredAuthMethod;
    private callbackResolve;
    private callbackServer;
    private pendingAuthUrl;
    constructor(authMethod?: AuthenticationMethod);
    /**
     * Ensure configuration directory exists
     */
    private ensureConfigDir;
    /**
     * Load authentication credentials
     */
    loadCredentials(): Promise<boolean>;
    /**
     * Save authentication credentials
     */
    saveCredentials(credentials: StoredCredentials): Promise<void>;
    /**
     * Get MSAL cache plugin for persistent token storage
     */
    private getMsalCachePlugin;
    /**
     * Initialize MSAL client
     */
    private initializeMsalClient;
    /**
     * Get required scopes for Teams operations
     */
    private getScopes;
    /**
     * Get a valid token from storage, automatically refreshing if needed
     */
    getValidToken(): Promise<AuthenticationResult | null>;
    /**
     * Refresh an expired or expiring token using the refresh token
     */
    refreshToken(storedTokens: StoredTokens): Promise<AuthenticationResult | null>;
    /**
     * Acquire token silently using cached account information
     */
    acquireTokenSilently(storedTokens: StoredTokens): Promise<AuthenticationResult | null>;
    /**
     * Save authentication token
     */
    saveToken(result: AuthenticationResult, authType: AuthenticationMethod): Promise<void>;
    /**
     * Check if authentication is already in progress
     */
    isAuthenticationInProgress(): boolean;
    /**
     * Clean up authentication state
     */
    private cleanupAuthState;
    /**
     * Get pending authentication URL if authentication is in progress
     */
    getPendingAuthUrl(): string | null;
    /**
     * Main authentication method using OAuth redirect flow
     */
    authenticate(): Promise<AuthenticationResult>;
    /**
     * Authenticate for MCP context - start server if needed and return auth URL
     */
    authenticateForMcp(): Promise<AuthenticationResult>;
    /**
     * Authenticate using OAuth redirect flow
     */
    authenticateWithRedirect(): Promise<AuthenticationResult>;
    /**
     * Start callback server for redirect flow (non-blocking)
     */
    private startCallbackServer;
    /**
     * Wait for OAuth callback
     */
    private waitForCallback;
    /**
     * Process redirect callback in background
     */
    private processRedirectCallback;
    /**
     * Get current authentication status
     */
    getAuthenticationStatus(): Promise<{
        isAuthenticated: boolean;
        user?: any;
        message: string;
    }>;
    /**
     * Logout and clear all stored data
     */
    logout(): Promise<void>;
    /**
     * Get authenticated Graph API client
     */
    getGraphClient(): Promise<Client>;
}
/**
 * Custom error for when OAuth redirect authentication is required
 */
export declare class OAuthRedirectRequiredError extends Error {
    authUrl: string;
    redirectUri: string;
    constructor(authUrl: string, redirectUri: string);
}
export declare const teamsAuth: TeamsAuth;
