/** A task comment as returned by GET /api/v2/task/{task_id}/comment or GET /comment/{id}/reply */ export interface ExistingComment { id: string; date: string; comment?: any[]; comment_text?: string; user?: { id?: number | string; username?: string; }; reply_count?: number; } /** Cursor into the comment list: the date and id of the last comment of the previous page */ export interface CommentPageCursor { start: string; startId: string; } /** * Never page further back than this. A busy ticket would otherwise walk its * entire comment history and eat the 100 calls/minute budget. */ export declare const MAX_COMMENT_PAGES = 10; /** One page of task comments, newest first, 25 per page */ export declare function fetchCommentPage(taskId: string, cursor?: CommentPageCursor): Promise; /** * All top-level comments of a task, newest first. * * The comment list endpoint returns 25 comments per page, so longer histories are * paged with `start`/`start_id`. Paging is capped at MAX_COMMENT_PAGES (250 comments) * to protect the API budget; hitting the cap is logged instead of failing. */ export declare function fetchAllTopLevelComments(taskId: string): Promise; /** * Find a top-level comment of a task by id, paging as far as MAX_COMMENT_PAGES. * * Unlike editComment's lookup this does not stop at the edit window, because a * thread parent can be arbitrarily old. Returns undefined when the id is not a * top-level comment of this task - which also catches reply ids, since replies * never appear in the task's comment list. */ export declare function findTopLevelComment(taskId: string, commentId: string): Promise; /** * The replies inside a comment thread, oldest first. * * `GET /task/{id}/comment` only returns top-level comments; the replies of a * thread (Threaded Comments ClickApp) live behind `GET /comment/{id}/reply`. * Any failure (non-ok response, network error, malformed body) is logged and * returns an empty array so one broken thread does not take down the whole * task view. */ export declare function fetchCommentReplies(commentId: string): Promise; /** * Never fetch more threads than this per task read, and never more than a few * at once - together with MAX_COMMENT_PAGES this keeps a single getTaskById * within ClickUp's 100 calls/minute budget even on a heavily threaded task. */ export declare const MAX_REPLY_FETCHES = 30; /** * Fetch the replies of every comment with reply_count > 0, bounded in count and * concurrency. Returns a map of comment id -> replies; a thread that was skipped * (over the cap) or failed to load is simply absent or empty, so callers can * render a "replies not loaded" hint from reply_count. */ export declare function fetchRepliesByComment(comments: ExistingComment[]): Promise>; //# sourceMappingURL=comments.d.ts.map