/** * Reading the one comment a `drive.notice.comment_add_v1` event names. * * A comment is two facts, and this module keeps both: what the commenter * wrote, and which part of the document they wrote it about. The second is the * one Feishu answers in pieces — some of them outside the SDK's own response * type — so it is assembled here rather than at the reader. */ import * as lark from '@larksuiteoapi/node-sdk'; /** * One piece of a comment's body. * * A mention stays a mention rather than being flattened into text here, * because the element a model reads it as is an agent-facing body format and * this package does not assemble those. The caller decides how to write it. */ export type FeishuCommentSegment = { readonly kind: 'text'; readonly text: string; } | { readonly kind: 'mention'; readonly openId: string; }; /** * What a comment is about: the whole document, or something in it. * * Feishu states this itself, and it is not the same fact as an unread comment. * A caller that could not read the comment learns nothing about its anchor, * while this says the commenter chose the document rather than a part of it. */ export type FeishuCommentAnchor = { readonly kind: 'whole_document'; } | { readonly kind: 'content'; /** * Feishu's own id for the anchored content, empty when it returns none. * What the id names follows the document type — for a docx it is a block * id — so a reader pairs it with the type it arrived with. A selection * spanning several parts records the one it starts at. */ readonly anchorId: string; /** * The anchored text as Feishu previews it. Feishu derives it and cuts it * at a length of its own, saying neither that it cut anything nor how * long the original was, so it reads a passage and does not reproduce * one. */ readonly preview: string; /** * Whether Feishu says the anchored content has since been deleted. False * also covers a response that does not say, which is every document type * that carries no relation. */ readonly deleted: boolean; }; /** * The one comment a `drive.notice.comment_add_v1` event names. * * The event payload carries identifying ids only, so a caller that wants to * show a person what was written has to read the thread. Only the named item * is returned: a whole thread is what lark-cli is for. */ export interface FeishuDocCommentText { /** Which part of the document this comment is about. */ anchor: FeishuCommentAnchor; /** What the commenter wrote, in order. */ segments: readonly FeishuCommentSegment[]; } /** The one comment to read: a thread, and the item inside it. */ export interface FeishuDocCommentRequest { fileToken: string; fileType: string; commentId: string; /** Empty names the thread's own top-level comment. */ replyId: string; } /** * Read the comment the event names, or `null`. * * Every way of not finding it is one answer to the caller — there is no text * to show — so a missing thread, a missing reply, and a document type the * comment API does not take are all `null`. A platform failure is not one of * them and throws. */ export declare function readDocComment(client: lark.Client, request: FeishuDocCommentRequest): Promise; //# sourceMappingURL=doc-comment.d.ts.map