/** * Record envelope returned by paginated AT Protocol queries. */ export interface PaginatedRecord { /** Fully qualified AT URI for the record. */ uri: string; /** Record key extracted from the URI or provided by the API. */ rkey: string; /** Raw record value. */ value: T; /** Optional feed metadata (for example, repost context). */ reason?: AuthorFeedReason; /** Optional reply context derived from feed metadata. */ replyParent?: ReplyParentInfo; } /** * Options accepted by {@link usePaginatedRecords}. */ export interface UsePaginatedRecordsOptions { /** DID or handle whose repository should be queried. */ did?: string; /** NSID collection containing the target records. */ collection: string; /** Maximum page size to request; defaults to `5`. */ limit?: number; /** Prefer the Bluesky appview author feed endpoint before falling back to the PDS. */ preferAuthorFeed?: boolean; /** Optional filter applied when fetching from the appview author feed. */ authorFeedFilter?: AuthorFeedFilter; /** Whether to include pinned posts when fetching from the author feed. */ authorFeedIncludePins?: boolean; /** Override for the appview service base URL used to query the author feed. */ authorFeedService?: string; /** Optional explicit actor identifier for the author feed request. */ authorFeedActor?: string; } /** * Result returned from {@link usePaginatedRecords} describing records and pagination state. */ export interface UsePaginatedRecordsResult { /** Records for the active page. */ records: PaginatedRecord[]; /** Indicates whether a page load is in progress. */ loading: boolean; /** Error produced during the latest fetch, if any. */ error?: Error; /** `true` when another page can be fetched forward. */ hasNext: boolean; /** `true` when a previous page exists in memory. */ hasPrev: boolean; /** Requests the next page (if available). */ loadNext: () => void; /** Returns to the previous page when possible. */ loadPrev: () => void; /** Index of the currently displayed page. */ pageIndex: number; /** Number of pages fetched so far (or inferred total when known). */ pagesCount: number; } export type AuthorFeedFilter = "posts_with_replies" | "posts_no_replies" | "posts_with_media" | "posts_and_author_threads" | "posts_with_video"; export interface AuthorFeedReason { $type?: string; by?: { handle?: string; did?: string; }; indexedAt?: string; } export interface ReplyParentInfo { uri?: string; author?: { handle?: string; did?: string; }; } /** * React hook that fetches a repository collection with cursor-based pagination and prefetching. * * @param did - Handle or DID whose repository should be queried. * @param collection - NSID collection to read from. * @param limit - Maximum number of records to request per page. Defaults to `5`. * @returns {UsePaginatedRecordsResult} Object containing the current page, pagination metadata, and navigation callbacks. */ export declare function usePaginatedRecords({ did: handleOrDid, collection, limit, preferAuthorFeed, authorFeedFilter, authorFeedIncludePins, authorFeedService, authorFeedActor, }: UsePaginatedRecordsOptions): UsePaginatedRecordsResult;