import { CommentPageSchemaType } from '../schemas.cjs'; import { QueryKey, InfiniteData } from '@tanstack/react-query'; import { IndexerAPIListCommentsSchemaType } from '@ecp.eth/sdk/indexer/schemas'; import { Hex } from '@ecp.eth/sdk/core/schemas'; import '@ecp.eth/sdk/indexer'; import 'zod/v3'; import '@ecp.eth/shared-signer/schemas/signer-api/shared'; /** * This hook checks whether there are any new comments on the query given by the `queryKey`. * If there are new comments, it updates the first page pagination info so UI can react to them. */ declare function useNewCommentsChecker({ enabled, queryKey, queryData, refetch, fetchComments: fetchFn, refetchInterval, }: { /** * Whether to enable the new comments checker. * * @default true */ enabled?: boolean; /** * Query key used by the main useInfiniteQuery hook. */ queryKey: QueryKey; queryData: InfiniteData | undefined; /** * Function to trigger a refetch of the main useInfiniteQuery hook. */ refetch: () => Promise; fetchComments: (options: { cursor: Hex | undefined; signal: AbortSignal; }) => Promise; /** * @default 60000 */ refetchInterval?: number; }): { hasNewComments: boolean; fetchNewComments: () => void; }; export { useNewCommentsChecker };