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 UseFarcasterMultiIdentityOptions = { /** * Called when it is required to create a new signer in order to proceed */ onMissingIdentity: () => void; /** * URL to signer endpoint * * @defaultValue '/signer' */ signerUrl?: string; /** * @defaultValue WebStorage */ storage?: Storage; /** * @defaultValue 'farcasterIdentities' */ storageKey?: string; /** * 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; onIdentityRemove?: (identity: FarcasterSigner) => void; onIdentitySelect?: (identity: FarcasterSigner) => void; /** * 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; }; type FarcasterMultiSignerInstance = FarcasterSignerState & { createSigner: () => Promise; impersonateUser: (fid: number) => Promise; removeIdentity: () => Promise; identities: FarcasterSigner[]; selectIdentity: (id: number | string) => Promise; identityPoller: IdentityPoller; }; declare function useFarcasterMultiIdentity({ onMissingIdentity, signerUrl, storage, storageKey, visibilityChangeDetectionHook, onImpersonate, onLogIn, onLogInStart, onLogOut, onIdentityRemove, onIdentitySelect, generateUserId, fetchFn, }: UseFarcasterMultiIdentityOptions): FarcasterMultiSignerInstance; export { type FarcasterMultiSignerInstance, useFarcasterMultiIdentity };