import { type CallbackResult } from "./server"; import type { GetAuthCodeOptions } from "./types"; export type { CallbackResult, CallbackServer, ServerOptions } from "./server"; export { OAuthError, TimeoutError } from "./errors"; export type { GetAuthCodeOptions } from "./types"; export { inMemoryStore } from "./storage/memory"; export { fileStore } from "./storage/file"; import * as mcp from "./mcp"; export { mcp }; /** * Builds the redirect URI for OAuth configuration. * Use this to construct the redirect_uri parameter for your authorization URL. * * @example * ```typescript * const redirectUri = getRedirectUrl({ port: 3000 }); * // => "http://localhost:3000/callback" * * const authUrl = `https://oauth.example.com/authorize?redirect_uri=${encodeURIComponent(redirectUri)}`; * console.log('Open:', authUrl); * await getAuthCode({ port: 3000 }); * ``` */ export declare function getRedirectUrl(options?: { port?: number; hostname?: string; callbackPath?: string; }): string; /** * Captures OAuth authorization code via localhost callback. * Starts a temporary server, optionally launches auth URL, waits for redirect. * * Two modes: * - **Managed**: Pass both `authorizationUrl` and `launch` — library opens browser * - **Headless**: Pass neither — caller handles URL display (CI/SSH/custom UI) * * @param input - Auth URL string (auto-launches browser) or GetAuthCodeOptions * @returns Promise with code and params * @throws {OAuthError} Provider errors (access_denied, invalid_scope) * @throws {Error} Timeout, network failures, port conflicts * * @example * ```typescript * import open from "open"; * * // Managed mode: library launches browser * const result = await getAuthCode({ * authorizationUrl: 'https://oauth.example.com/authorize?...', * launch: open, * }); * * // Headless mode: caller handles URL display * const authUrl = 'https://oauth.example.com/authorize?...'; * console.log('Open this URL:', authUrl); * const result = await getAuthCode({ port: 3000, timeout: 60000 }); * ``` */ export declare function getAuthCode(input: GetAuthCodeOptions | string): Promise; //# sourceMappingURL=index.d.ts.map