import * as React from 'react'; declare const DISPLAY_IDENTITY_KINDS: readonly ["did", "btc", "email", "nostr"]; type DisplayIdentityKind = (typeof DISPLAY_IDENTITY_KINDS)[number]; interface DisplayIdentity { kind: DisplayIdentityKind; value: string; } interface OcAccount { accountId: string; didOc: string; primaryBtc?: string | null; hasEmail?: boolean; displayName?: string | null; nostrNpub?: string | null; homeFederation?: string | null; signingMethod?: 'fedimint_threshold' | 'fedimint_client' | 'bip322' | null; isOwner?: boolean; displayIdentity: DisplayIdentity; } type OcSessionStatus = 'loading' | 'authenticated' | 'anonymous' | 'error'; interface OcAccountSummary { didOc: string; displayName: string | null; primaryBtc: string | null; displayIdentity: DisplayIdentity; lastSeenAt: string | null; } type OcSignOutScope = 'all' | 'current'; interface OcSessionState { status: OcSessionStatus; account: OcAccount | null; roster: OcAccountSummary[]; tabPinned: boolean; error: Error | null; refresh: () => Promise; signOut: (opts?: { scope?: OcSignOutScope; }) => Promise; switchAccount: (didOc: string) => Promise; addAccountUrl: (returnTo?: string) => string; setDisplayIdentity: (kind: DisplayIdentityKind) => Promise; signInUrl: string; } interface OcAuthConfig { authOrigin?: string; signInPath?: string; mePath?: string; logoutPath?: string; } declare const DEFAULT_CONFIG: Required; declare function buildSignInUrl(cfg: Required, returnTo?: string): string; declare function buildAddAccountUrl(cfg: Required, returnTo?: string): string; interface OcSessionProviderProps { children: React.ReactNode; config?: OcAuthConfig; defaultReturnTo?: string; } declare function OcSessionProvider({ children, config, defaultReturnTo, }: OcSessionProviderProps): React.ReactElement; declare function useOcSession(): OcSessionState; declare function useOptionalOcSession(): OcSessionState | null; interface OcAccountChipProps { dashboardUrl?: string; signInUrl?: string; signInLabel?: string; className?: string; triggerClassName?: string; popoverClassName?: string; menuItemClassName?: string; } declare function OcAccountChip({ dashboardUrl, signInUrl: signInUrlOverride, signInLabel, className, triggerClassName, popoverClassName, menuItemClassName, }: OcAccountChipProps): React.ReactElement | null; interface OcSignInButtonProps extends React.AnchorHTMLAttributes { label?: string; eager?: boolean; signInUrl?: string; } declare function OcSignInButton({ label, eager, className, signInUrl: signInUrlOverride, ...rest }: OcSignInButtonProps): React.ReactElement | null; interface OcAccountPillProps extends React.HTMLAttributes { dashboardUrl?: string; render?: (account: { address: string; displayName?: string | null; }) => React.ReactNode; } declare function OcAccountPill({ dashboardUrl, render, className, ...rest }: OcAccountPillProps): React.ReactElement | null; interface OcAddressInputProps extends Omit, 'value' | 'onChange'> { value: string; onValueChange: (value: string) => void; suggestionLabel?: string; wrapperClassName?: string; popoverClassName?: string; suggestionClassName?: string; } interface UseOcAddressSuggestionOptions { value: string; onValueChange: (value: string) => void; suggestionLabel?: string; popoverClassName?: string; suggestionClassName?: string; } interface UseOcAddressSuggestionReturn { inputProps: { onFocus: (e: React.FocusEvent) => void; onBlur: (e: React.FocusEvent) => void; onKeyDown: (e: React.KeyboardEvent) => void; role: 'combobox'; 'aria-haspopup': 'listbox'; 'aria-expanded': boolean; 'aria-controls': string | undefined; 'aria-activedescendant': string | undefined; autoComplete: 'off'; spellCheck: false; }; popover: React.ReactNode; } declare function useOcAddressSuggestion(options: UseOcAddressSuggestionOptions): UseOcAddressSuggestionReturn; declare const OcAddressInput: React.ForwardRefExoticComponent>; interface OcSignInProps { audience: string; returnTo?: string; onSuccess?: (account: OcAccount, token?: string) => void; resolveReturnTo?: (account: OcAccount) => string | Promise; authOrigin?: string; initialPath?: 'wallet' | 'email'; providersFirst?: boolean; paths?: { wallet?: boolean; email?: boolean; }; linkPrompt?: boolean; add?: boolean; className?: string; } declare function safeReturnTo(input: string | undefined): string; declare function familyReturnTarget(input: string | undefined | null): string | undefined; declare function OcSignIn({ audience, returnTo, onSuccess, resolveReturnTo, linkPrompt, add: addProp, authOrigin, initialPath, providersFirst, paths, className, }: OcSignInProps): React.ReactElement; interface OcLinkedIdentity { id: string; kind: 'email' | 'btc'; value: string | null; verified_at: string | null; verification_method: 'email-otp' | 'bip322' | null; is_primary: boolean; } declare function fetchOcLinkedIdentities(opts?: { authOrigin?: string; }): Promise; interface OcLinkedIdentitiesProps { authOrigin?: string; className?: string; onChange?: () => void; } declare function OcLinkedIdentities({ authOrigin, className, onChange, }: OcLinkedIdentitiesProps): React.ReactElement; declare const TAB_SESSION_HEADER = "x-oc-tab-session"; declare const TAB_SESSION_STORAGE_KEY = "oc_tab_session"; declare const TAB_ACCOUNT_HINT_KEY = "oc-as"; declare const TAB_ADOPT_HASH = "#oc-adopt"; interface OcTabSession { token: string; didOc: string; } declare function readTabSession(): OcTabSession | null; declare function writeTabSession(session: OcTabSession): void; declare function clearTabSession(): void; declare function tabSessionHeader(): Record; declare function installTabFetchInterceptor(authOrigin: string): () => void; declare function consumeTabAdoptMarker(): boolean; declare function installTabLinkDecorator(authOrigin: string): () => void; declare function consumeTabAccountHint(authOrigin: string): Promise; interface WebAuthnCredentialPublic { id: string; label: string; authenticator_type: 'platform' | 'cross-platform' | 'unknown'; transports: string[]; user_verified: boolean; created_at: string; last_used_at: string | null; } type WebAuthnRegisterStatus = 'idle' | 'requesting-options' | 'authenticating' | 'verifying' | 'success' | 'error'; type WebAuthnAssertionStatus = WebAuthnRegisterStatus; type WebAuthnListStatus = 'loading' | 'ready' | 'error'; interface UseHostOptions { authOrigin?: string; } type WebAuthnRegisterResult = { ok: true; credential: WebAuthnCredentialPublic; } | { ok: false; reason: string; }; interface UseWebAuthnRegisterReturn { status: WebAuthnRegisterStatus; error: Error | null; register: (args?: { label?: string; }) => Promise; reset: () => void; } declare function useWebAuthnRegister(opts?: UseHostOptions): UseWebAuthnRegisterReturn; type WebAuthnRenameResult = { ok: true; credential: WebAuthnCredentialPublic; } | { ok: false; reason: string; }; type WebAuthnRemoveResult = { ok: true; } | { ok: false; reason: string; }; interface UseWebAuthnListReturn { status: WebAuthnListStatus; credentials: WebAuthnCredentialPublic[]; error: Error | null; refetch: () => Promise; rename: (id: string, label: string) => Promise; remove: (id: string) => Promise; } declare function useWebAuthnList(opts?: UseHostOptions): UseWebAuthnListReturn; type WebAuthnStepUpResult = { ok: true; step_up_at: number; } | { ok: false; reason: string; }; interface UseStepUpAuthReturn { status: WebAuthnAssertionStatus; error: Error | null; stepUp: (args: { purpose: string; }) => Promise; reset: () => void; } declare function useStepUpAuth(opts?: UseHostOptions): UseStepUpAuthReturn; interface RedirectToSudoArgs { returnTo?: string; purpose?: string; config?: OcAuthConfig; } declare function redirectToSudo(args?: RedirectToSudoArgs): void; declare function handleSudoRequired(body: { reason?: string; } | null | undefined, args?: Omit & { returnTo?: string; }): boolean; declare const SUDO_ACCOUNT_MISMATCH_MESSAGE = "Switch this tab to that account first \u2014 the confirmation on file is for a different one."; declare function isSudoAccountMismatch(body: { reason?: string; } | null | undefined): boolean; export { DEFAULT_CONFIG, DISPLAY_IDENTITY_KINDS, type DisplayIdentity, type DisplayIdentityKind, type OcAccount, OcAccountChip, type OcAccountChipProps, OcAccountPill, type OcAccountPillProps, type OcAccountSummary, OcAddressInput, type OcAddressInputProps, type OcAuthConfig, OcLinkedIdentities, type OcLinkedIdentitiesProps, type OcLinkedIdentity, OcSessionProvider, type OcSessionState, type OcSessionStatus, OcSignIn, OcSignInButton, type OcSignInButtonProps, type OcSignInProps, type OcSignOutScope, type OcTabSession, type RedirectToSudoArgs, SUDO_ACCOUNT_MISMATCH_MESSAGE, TAB_ACCOUNT_HINT_KEY, TAB_ADOPT_HASH, TAB_SESSION_HEADER, TAB_SESSION_STORAGE_KEY, type UseOcAddressSuggestionOptions, type UseOcAddressSuggestionReturn, type UseStepUpAuthReturn, type UseWebAuthnListReturn, type UseWebAuthnRegisterReturn, type WebAuthnAssertionStatus, type WebAuthnCredentialPublic, type WebAuthnListStatus, type WebAuthnRegisterResult, type WebAuthnRegisterStatus, type WebAuthnRemoveResult, type WebAuthnRenameResult, type WebAuthnStepUpResult, buildAddAccountUrl, buildSignInUrl, clearTabSession, consumeTabAccountHint, consumeTabAdoptMarker, familyReturnTarget, fetchOcLinkedIdentities, handleSudoRequired, installTabFetchInterceptor, installTabLinkDecorator, isSudoAccountMismatch, readTabSession, redirectToSudo, safeReturnTo, tabSessionHeader, useOcAddressSuggestion, useOcSession, useOptionalOcSession, useStepUpAuth, useWebAuthnList, useWebAuthnRegister, writeTabSession };