import { NylasConnect, ConnectConfig as AuthConfig, ConnectOptions as AuthOptions, ConnectResult as AuthResult, GrantInfo, ConnectStateChangeCallback as AuthStateChangeCallback, LogLevel } from '@nylas/connect';

/**
 * Configuration for the useNylasConnect React hook
 * Extends AuthConfig with connection-specific properties
 */
export interface UseNylasConnectConfig extends AuthConfig {
    /** Auto-refresh session interval in milliseconds (default: disabled) */
    autoRefreshInterval?: number;
    /** Initial loading state when hook mounts (default: true) */
    initialLoadingState?: boolean;
    /** Number of retry attempts for failed operations (default: 0) */
    retryAttempts?: number;
    /** Enable automatic error recovery for network errors (default: false) */
    enableAutoRecovery?: boolean;
}
export interface UseNylasConnectState {
    isConnected: boolean;
    grant: GrantInfo | null;
    isLoading: boolean;
    error: Error | null;
}
export interface UseNylasConnectActions {
    connect: (options?: AuthOptions) => Promise<AuthResult | string>;
    logout: (grantId?: string) => Promise<void>;
    refreshSession: () => Promise<void>;
    subscribe: (callback: AuthStateChangeCallback) => () => void;
    setLogLevel: (level: LogLevel | "off") => void;
}
export interface UseNylasConnectReturn extends UseNylasConnectState, UseNylasConnectActions {
    connectClient: NylasConnect;
}
export declare function useNylasConnect(config: UseNylasConnectConfig): UseNylasConnectReturn;
//# sourceMappingURL=useNylasConnect.d.ts.map