import { FarcasterSignerState } from '../../farcaster/signers.js'; import { Storage } from '../types.js'; import { useVisibilityDetection } from '../../hooks/use-visibility-detection.js'; import { IdentityPoller } from './identity-poller.js'; import { FarcasterSigner, FarcasterCreateSignerResult, FarcasterSignerImpersonating, FarcasterSignerApproved, FarcasterSignerPendingApproval } from './types.js'; import '../../types-CH60H6Gq.js'; import 'frames.js'; import 'react'; import 'frames.js/frame-parsers'; import 'frames.js/types'; import '../../unstable-types.js'; import '../../farcaster/types.js'; type UseFarcasterIdentityOptions = { /** * Called when it is required to create a new signer in order to proceed */ onMissingIdentity: () => void; /** * Allows you to disable the polling of the signer approval status * when user starts signin in * * @defaultValue true */ enableIdentityPolling?: boolean; /** * URL to signer endpoint * * @defaultValue '/signer' */ signerUrl?: string; /** * @defaultValue WebStorage */ storage?: Storage; /** * @defaultValue 'farcasterIdentity' */ storageKey?: string; /** * Function used to generate a unique user id for signer._id property value */ generateUserId?: () => string | number; /** * Custom fetch function used to do requests */ fetchFn?: typeof fetch; /** * Used to detect if the current context is visible, this affects the polling of the signer approval status. */ visibilityChangeDetectionHook?: typeof useVisibilityDetection; onImpersonate?: (identity: FarcasterSignerImpersonating) => void; onLogIn?: (identity: FarcasterSignerApproved) => void; onLogInStart?: (identity: FarcasterSignerPendingApproval) => void; onLogOut?: (identity: FarcasterSigner) => void; }; type FarcasterSignerInstance = FarcasterSignerState & { createSigner: () => Promise; impersonateUser: (fid: number) => Promise; identityPoller: IdentityPoller; }; declare function useFarcasterIdentity({ onMissingIdentity, enableIdentityPolling, signerUrl, storage, storageKey, visibilityChangeDetectionHook, onImpersonate, onLogIn, onLogInStart, onLogOut, generateUserId, fetchFn, }: UseFarcasterIdentityOptions): FarcasterSignerInstance; export { type FarcasterSignerInstance, useFarcasterIdentity };