import type { Client } from '@modelcontextprotocol/sdk/client/index.js';
import type { Transport } from '@modelcontextprotocol/sdk/shared/transport.js';
import type { Logger } from '../logging.js';
import type { OAuthSession } from '../oauth.js';
export declare const DEFAULT_OAUTH_CODE_TIMEOUT_MS = 60000;
export interface OAuthCapableTransport extends Transport {
    close(): Promise<void>;
    finishAuth?: (authorizationCode: string) => Promise<void>;
}
export interface ConnectWithAuthOptions {
    serverName?: string;
    maxAttempts?: number;
    oauthTimeoutMs?: number;
    recreateTransport?: (transport: OAuthCapableTransport) => Promise<OAuthCapableTransport>;
}
export declare class OAuthTimeoutError extends Error {
    readonly timeoutMs: number;
    readonly serverName: string;
    constructor(serverName: string, timeoutMs: number);
}
export declare function markOAuthFlowError(error: unknown): unknown;
export declare function isOAuthFlowError(error: unknown): boolean;
export declare function markPostAuthConnectError(error: unknown): unknown;
export declare function isPostAuthConnectError(error: unknown): boolean;
export declare function connectWithAuth(client: Client, transport: OAuthCapableTransport, session: OAuthSession | undefined, logger: Logger, options?: ConnectWithAuthOptions): Promise<OAuthCapableTransport>;
export declare function waitForAuthorizationCodeWithTimeout(session: OAuthSession, logger: Logger, serverName?: string, timeoutMs?: number): Promise<string>;
export declare function parseOAuthTimeout(raw: string | undefined): number;
export declare function resolveOAuthTimeoutFromEnv(): number;
//# sourceMappingURL=oauth.d.ts.map