import { Context } from "hono";
import { Connection } from "@authhero/adapter-interfaces";
import { Bindings, Variables } from "../types";
/**
 * Resolve the redirect_uri that strategies should hand to the upstream IdP.
 * Defaults to `${authUrl}login/callback` on the request's host (custom domain
 * if present, otherwise the default issuer) — matching Auth0's default. Set
 * `options.callback_url` per connection to pin an explicit URL — required
 * when an upstream IdP has the legacy `/callback` URL registered and you
 * don't want it to flip when the request comes in via a custom domain.
 */
export declare function getConnectionCallbackUrl(ctx: Context<{
    Bindings: Bindings;
    Variables: Variables;
}>, connection: Connection): string;
export type UserInfo = {
    sub: string;
    email?: string;
    given_name?: string;
    family_name?: string;
    name?: string;
};
/**
 * Verified result returned by strategies that also expose the unmodified
 * upstream payload (id_token payload, userinfo response, etc.). Used by the
 * "Try Connection" diagnostic flow to surface raw provider claims to the
 * caller — production flows only consume `userinfo`.
 */
export type UserInfoWithRaw = {
    userinfo: UserInfo;
    raw: Record<string, unknown> | null;
};
export type StrategyHandler = {
    displayName: string;
    logoDataUri: string;
    getRedirect: (ctx: Context<{
        Bindings: Bindings;
        Variables: Variables;
    }>, connection: Connection, loginHint?: string) => Promise<{
        redirectUrl: string;
        code: string;
        codeVerifier?: string;
    }>;
    validateAuthorizationCodeAndGetUser: (ctx: Context<{
        Bindings: Bindings;
        Variables: Variables;
    }>, connection: Connection, code: string, codeVerifier?: string) => Promise<UserInfo>;
    validateAuthorizationCodeAndGetUserWithRaw?: (ctx: Context<{
        Bindings: Bindings;
        Variables: Variables;
    }>, connection: Connection, code: string, codeVerifier?: string) => Promise<UserInfoWithRaw>;
    disableEmbeddedBrowsers?: boolean;
};
export declare const BUILTIN_STRATEGIES: Record<string, StrategyHandler>;
export declare function getStrategy(ctx: Context<{
    Bindings: Bindings;
    Variables: Variables;
}>, name: string): StrategyHandler;
export declare const ENTERPRISE_STRATEGIES: Set<string>;
export declare function getProviderFromConnection(connection: Connection): string;
/**
 * Get the icon URL for a connection, falling back to strategy defaults
 */
export declare function getConnectionIconUrl(connection: {
    strategy: string;
    options?: {
        icon_url?: string;
    };
}): string | undefined;
