import type { DomainResolver } from '@uauth/common'; import type { Store, StoreType } from './store'; export interface Fetcher { fetch(input: RequestInfo, init: RequestInit): Promise; } export declare type CodeChallengeMethod = 'S256' | 'plain'; export declare type StandardResponseMode = 'fragment' | 'query'; export declare type FormPostResponseMode = 'form_post'; export declare type WebMessageResponseMode = 'web_message'; export declare type ResponseMode = StandardResponseMode | FormPostResponseMode | WebMessageResponseMode; export declare type GrantType = 'authorization_code' | 'implicit' | 'password' | 'refresh_token' | 'client_credentials' | 'urn:ietf:params:oauth:grant-type:jwt-bearer' | 'urn:ietf:params:oauth:grant-type:saml2-bearer' | 'urn:ietf:params:oauth:grant-type:device_code'; export declare type SubjectType = 'public' | 'pairwise'; export declare type ClientAuthMethod = 'client_secret_basic' | 'client_secret_post' | 'none'; export interface AddressClaim { formatted: string; street_address: string; locality: string; region: string; postal_code: string; country: string; } export declare type WalletType = 'web3' | 'walletconnect' | 'coinbase-wallet'; export interface WalletClaims { wallet_address: string; wallet_type_hint: WalletType; eip4361_message: string; eip4361_signature: string; } export interface EmailClaims { email: string; email_verified: boolean; } export interface PhoneClaims { phone_number: string; phone_number_verified: boolean; } export interface AddressClaims { address: AddressClaim; } export interface ProfileClaims { name: string; given_name: string; family_name: string; middle_name: string; nickname: string; preferred_username: string; profile: string; picture: string; website: string; gender: string; birthdate: string; zoneinfo: string; locale: string; updated_at: string; } export interface HumanityCheckClaims { humanity_check_id: string; } export interface UserInfo extends Partial, Partial, Partial, Partial, Partial, Partial { sub: string; upgrade?: UpgradeInfo; } export interface JWTClaims { iss: string; aud: string; exp: number; nbf: number; iat: number; jti: string; azp: string; nonce: string; auth_time: string; at_hash: string; c_hash: string; acr: string; sub_jwk: string; cnf: string; sid: string; org_id: string; } export interface IdToken extends UserInfo, Partial { __raw: string; [key: string]: any; } export interface CryptoKeyGetter { (kid: string): Promise; } export interface UpgradeInfo { text: string; upgrade_for_premium: string; } export interface Authorization { accessToken: string; expiresAt: number; idToken: IdToken; scope: string; resource?: string; upgrade?: UpgradeInfo; } export interface VerifiedAddress { address: string; message: string; signature: string; symbol: string; } export interface LoginCallbackOptions { url?: string; } export interface LoginCallbackResponse { authorization: Authorization; state?: T; } export interface AuthorizationOptions { clientID?: string; username?: string; scope?: string; resource?: string; } export interface UserOptions extends AuthorizationOptions { claims?: string[]; } export interface LogoutCallbackOptions { url?: string; } export interface CacheOptions { issuer?: boolean | number; userinfo?: boolean; } export interface ClientOptions { clientID: string; clientSecret?: string; redirectUri: string; clientAuthMethod?: ClientAuthMethod; resource?: string; responseMode?: ResponseMode; scope?: string; prompt?: string; maxAge?: number; rpInitiatedLogout?: boolean; postLogoutRedirectUri?: string; cacheOptions?: CacheOptions; window?: Window | undefined; fallbackIssuer?: string; storeType?: StoreType; store?: Store; createIpfsUrl?: (cid: string, path: string) => string; resolution?: DomainResolver; } export declare type UAuthConstructorOptions = ClientOptions; export interface BaseLoginOptions { clientID: string; clientSecret?: string; clientAuthMethod: ClientAuthMethod; maxAge: number; prompt: string; resource?: string; redirectUri: string; responseMode: ResponseMode; scope: string; flowId?: 'login' | 'signup'; packageName?: string; packageVersion?: string; signupSuggestion?: string; } export interface LoginOptions extends Partial { username: string; state?: any; beforeRedirect?(url: string): Promise | void; } export interface FullLoginOptions extends BaseLoginOptions { username?: string; state?: any; beforeRedirect?(url: string): Promise | void; } export interface BaseLogoutOptions { rpInitiatedLogout: boolean; postLogoutRedirectUri?: string; } export interface LogoutOptions extends BaseLogoutOptions, AuthorizationOptions { state?: any; beforeRedirect?(url: string): Promise | void; }