import type { AuthenticationStore } from './store';
import type { AuthOidcProvider } from './types';
export interface OidcDiscoveryDocument {
    issuer: string;
    authorization_endpoint: string;
    token_endpoint: string;
    jwks_uri: string;
    response_types_supported?: string[];
    id_token_signing_alg_values_supported?: string[];
    code_challenge_methods_supported?: string[];
    token_endpoint_auth_methods_supported?: string[];
}
export interface VerifiedOidcIdentity {
    provider: AuthOidcProvider;
    subject: string;
    email: string;
    name?: string;
    claims: Record<string, unknown>;
}
export type OidcFetch = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
export declare function sanitizeOidcReturnPath(value: string | undefined): string;
export declare function discoverOidcProvider(provider: AuthOidcProvider, fetchFn?: OidcFetch): Promise<OidcDiscoveryDocument>;
export declare function beginOidcAuthorization(auth: AuthenticationStore, providerSlug: string, origin: string, returnPath?: string, fetchFn?: OidcFetch): Promise<{
    authorizationUrl: string;
    expiresAt: string;
}>;
export declare function completeOidcAuthorization(auth: AuthenticationStore, input: {
    providerSlug: string;
    state: string;
    code: string;
    origin: string;
    now?: Date;
}, fetchFn?: OidcFetch): Promise<{
    identity: VerifiedOidcIdentity;
    returnPath: string;
}>;
