import { PinoLogger } from "./logger.js";

//#region src/utils/auth-detection.d.ts

/**
 * OAuth configuration interface
 */
interface OAuthConfig {
  authorizationUrl: string;
  tokenUrl: string;
  registrationUrl?: string;
  supportsDynamicRegistration: boolean;
  scopes?: string;
}
/**
 * MCP OAuth flow initiation result
 */
interface McpOAuthFlowResult {
  authorizationUrl: string;
  codeVerifier: string;
  state: string;
  clientInformation: any;
  scopes?: string;
  metadata: any;
  resourceUrl?: string;
}
/**
 * MCP OAuth token exchange result
 */
interface McpTokenExchangeResult {
  access_token: string;
  refresh_token?: string;
  expires_at?: Date;
  token_type: string;
  scope?: string;
}
/**
 * Initiate MCP OAuth flow using the official MCP SDK
 */
declare function initiateMcpOAuthFlow({
  mcpServerUrl,
  redirectUri,
  state,
  clientName,
  clientUri,
  logoUri,
  defaultClientId,
  logger
}: {
  mcpServerUrl: string;
  redirectUri: string;
  state: string;
  clientName?: string;
  clientUri?: string;
  logoUri?: string;
  defaultClientId?: string;
  logger?: PinoLogger;
}): Promise<McpOAuthFlowResult>;
/**
 * Exchange authorization code for tokens using MCP SDK
 */
declare function exchangeMcpAuthorizationCode({
  mcpServerUrl,
  metadata,
  clientInformation,
  authorizationCode,
  codeVerifier,
  redirectUri,
  resourceUrl,
  logger
}: {
  mcpServerUrl: string;
  metadata: any;
  clientInformation: any;
  authorizationCode: string;
  codeVerifier: string;
  redirectUri: string;
  resourceUrl?: string;
  logger?: PinoLogger;
}): Promise<McpTokenExchangeResult>;
/**
 * Detect if MCP OAuth authentication is specifically required for a tool
 * Uses proper MCP OAuth specification discovery methods
 */
declare const detectAuthenticationRequired: ({
  serverUrl,
  error,
  logger
}: {
  serverUrl: string;
  error?: Error;
  logger?: PinoLogger;
}) => Promise<boolean>;
//#endregion
export { McpOAuthFlowResult, McpTokenExchangeResult, OAuthConfig, detectAuthenticationRequired, exchangeMcpAuthorizationCode, initiateMcpOAuthFlow };