import type { DocComment } from '../im/lark/doc-comment.js'; export interface DocCommentPollCursor { createdAt: number; replyId: string; } export interface PolledDocReply extends DocCommentPollCursor { commentId: string; isWhole: boolean; selectedText?: string; authorOpenId?: string; text: string; mentions: string[]; priorReplies: Array<{ authorOpenId?: string; text: string; }>; } export declare function compareDocCommentPollCursor(a: DocCommentPollCursor, b: DocCommentPollCursor): number; export declare function flattenDocCommentReplies(comments: DocComment[]): PolledDocReply[]; export declare function latestDocCommentPollCursor(comments: DocComment[]): DocCommentPollCursor | undefined; export declare function docCommentRepliesAfterCursor(comments: DocComment[], cursor: DocCommentPollCursor): PolledDocReply[]; /** * Walk `fresh` replies in ascending cursor order, delivering each and advancing * the persisted cursor **only** for a delivered reply. Stops at the first * `deliver` that returns false so a later success can never move the cursor past * an un-delivered earlier reply — that would drop it permanently, since the next * poll only fetches replies strictly after the cursor. The stopped reply is * retried from the same spot on the next poll (ordering is preserved). * * `deliver` returns true when the reply was handled (dispatched, or safely * skipped e.g. self-authored/empty so the cursor should move past it), and false * to stop the round without advancing (delivery failed, or the watch was removed * mid-loop). `commit` persists the cursor to the just-delivered reply. */ export declare function advanceDocCommentCursor(fresh: PolledDocReply[], deliver: (reply: PolledDocReply) => Promise, commit: (reply: PolledDocReply) => void | Promise): Promise; //# sourceMappingURL=doc-comment-poller.d.ts.map