/** * Identifier trio required to address an AT Protocol record. */ export interface AtProtoRecordKey { /** Repository DID (or handle prior to resolution) containing the record. */ did?: string; /** NSID collection in which the record resides. */ collection?: string; /** Record key string uniquely identifying the record within the collection. */ rkey?: string; /** Force bypass cache and refetch from network. Useful for auto-refresh scenarios. */ bypassCache?: boolean; /** Internal refresh trigger - changes to this value force a refetch. */ _refreshKey?: number; } /** * Loading state returned by {@link useAtProtoRecord}. */ export interface AtProtoRecordState { /** Resolved record value when fetch succeeds. */ record?: T; /** Error thrown while loading, if any. */ error?: Error; /** Indicates whether the hook is in a loading state. */ loading: boolean; } /** * React hook that fetches a single AT Protocol record and tracks loading/error state. * * For Bluesky collections (app.bsky.*), uses a three-tier fallback strategy: * 1. Try Bluesky appview API first * 2. Fall back to Slingshot getRecord * 3. Finally query the PDS directly * * For other collections, queries the PDS directly (with Slingshot fallback via the client handler). * * @param did - DID (or handle before resolution) that owns the record. * @param collection - NSID collection from which to fetch the record. * @param rkey - Record key identifying the record within the collection. * @param bypassCache - Force bypass cache and refetch from network. Useful for auto-refresh scenarios. * @param _refreshKey - Internal parameter used to trigger refetches. * @returns {AtProtoRecordState} Object containing the resolved record, any error, and a loading flag. */ export declare function useAtProtoRecord({ did: handleOrDid, collection, rkey, bypassCache, _refreshKey, }: AtProtoRecordKey): AtProtoRecordState;