/** * Shape of the state returned by {@link useLatestRecord}. */ export interface LatestRecordState { /** Latest record value if one exists. */ record?: T; /** Record key for the fetched record, when derivable. */ rkey?: string; /** Error encountered while fetching. */ error?: Error; /** Indicates whether a fetch is in progress. */ loading: boolean; /** `true` when the collection has zero records. */ empty: boolean; } /** * Fetches the most recent record from a collection using `listRecords(limit=3)`. * * Note: Slingshot does not support listRecords, so this always queries the actor's PDS directly. * * Records with invalid timestamps (before 2023, when ATProto was created) are automatically * skipped, and additional records are fetched to find a valid one. * * @param handleOrDid - Handle or DID that owns the collection. * @param collection - NSID of the collection to query. * @param refreshKey - Optional key that when changed, triggers a refetch. Use for auto-refresh scenarios. * @returns {LatestRecordState} Object reporting the latest record value, derived rkey, loading status, emptiness, and any error. */ export declare function useLatestRecord(handleOrDid: string | undefined, collection: string, refreshKey?: number): LatestRecordState;