@univerjs/sheets-thread-comment v0.5.4
Class: FThreadComment
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:247
Constructors
new FThreadComment()
new FThreadComment(
_thread,
_parent,
_injector,
_commandService,
_univerInstanceService,
_threadCommentModel,
_userManagerService): FThreadComment
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:248
Parameters
Parameter | Type |
---|---|
_thread | | IBaseComment | IThreadComment |
_parent | | undefined | IThreadComment |
_injector | Injector |
_commandService | ICommandService |
_univerInstanceService | IUniverInstanceService |
_threadCommentModel | SheetsThreadCommentModel |
_userManagerService | UserManagerService |
Returns
Methods
delete()
delete(): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:387
Returns
Promise
<boolean
>
Deprecated
use deleteAsync
as instead.
deleteAsync()
deleteAsync(): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:373
Delete the comment and it’s replies
Returns
Promise
<boolean
>
success or not
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const success = await comment.deleteAsync();
getCommentData()
getCommentData(): IBaseComment
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:292
Get the comment data
Returns
The comment data
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const commentData = comment.getCommentData();
getContent()
getContent(): IDocumentBody
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:342
Returns
Deprecated
use getRichText
as instead
getIsRoot()
getIsRoot(): boolean
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:277
Whether the comment is a root comment
Returns
boolean
Whether the comment is a root comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const isRoot = comment.getIsRoot();
getRange()
getRange(): null | FRange
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:326
Get the range of the comment
Returns
null
| FRange
The range of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const range = comment.getRange();
getReplies()
getReplies(): undefined | FThreadComment[]
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:308
Get the replies of the comment
Returns
undefined
| FThreadComment
[]
the replies of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const replies = comment.getReplies();
getRichText()
getRichText(): RichTextValue
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:357
Get the rich text of the comment
Returns
The rich text of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const richText = comment.getRichText();
replyAsync()
replyAsync(comment): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:479
Reply to the comment
Parameters
Parameter | Type | Description |
---|---|---|
comment | FTheadCommentBuilder | The comment to reply to |
Returns
Promise
<boolean
>
success or not
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const reply = univerAPI.newTheadComment()
.setContent(univerAPI.newRichText().insertText('hello zhangsan'));
const success = await comment.replyAsync(reply);
resolve()
resolve(resolved?): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:435
Parameters
Parameter | Type |
---|---|
resolved ? | boolean |
Returns
Promise
<boolean
>
Deprecated
use resolveAsync
as instead
resolveAsync()
resolveAsync(resolved?): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:451
Resolve the comment
Parameters
Parameter | Type | Description |
---|---|---|
resolved ? | boolean | Whether the comment is resolved |
Returns
Promise
<boolean
>
success or not
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const success = await comment.resolveAsync(true);
update()
update(content): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:395
Parameters
Parameter | Type |
---|---|
content | IDocumentBody |
Returns
Promise
<boolean
>
Deprecated
use updateAsync
as instead
updateAsync()
updateAsync(content): Promise<boolean>
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:411
Update the comment content
Parameters
Parameter | Type | Description |
---|---|---|
content | | IDocumentBody | RichTextValue | The new content of the comment |
Returns
Promise
<boolean
>
success or not
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const success = await comment.updateAsync(univerAPI.newRichText().insertText('hello zhangsan'));