@univerjs/sheets-thread-comment v0.5.4
Class: FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:148
Extends
Constructors
new FTheadCommentBuilder()
new FTheadCommentBuilder(comment?): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:51
Parameters
Parameter | Type |
---|---|
comment ? | IThreadComment |
Returns
Inherited from
Properties
Property | Modifier | Type | Inherited from | Defined in |
---|---|---|---|---|
_comment | protected | IThreadComment | FTheadCommentItem ._comment | sheets-thread-comment/src/facade/f-thread-comment.ts:26 |
Accessors
content
Get Signature
get content(): RichTextValue
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:98
Get the content of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const content = comment.content;
Returns
The content of the comment
Inherited from
dateTime
Get Signature
get dateTime(): string
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:83
Get the date time of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const dateTime = comment.dateTime;
Returns
string
The date time of the comment
Inherited from
id
Get Signature
get id(): string
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:113
Get the id of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const id = comment.id;
Returns
string
The id of the comment
Inherited from
personId
Get Signature
get personId(): string
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:68
Get the person id of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const personId = comment.personId;
Returns
string
The person id of the comment
Inherited from
threadId
Get Signature
get threadId(): string
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:128
Get the thread id of the comment
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const threadId = comment.threadId;
Returns
string
The thread id of the comment
Inherited from
Methods
build()
build(): IThreadComment
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:242
Build the comment
Returns
The comment
Example
const comment = univerAPI.newTheadComment()
.setContent(univerAPI.newRichText().insertText('hello zhangsan'))
.build();
copy()
copy(): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:143
Copy the comment
Returns
The comment builder
Example
const comment = univerAPI.getActiveWorkbook()
.getSheetById(sheetId)
.getCommentById(commentId);
const newComment = comment.copy();
Inherited from
setContent()
setContent(content): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:163
Set the content of the comment
Parameters
Parameter | Type | Description |
---|---|---|
content | | IDocumentBody | RichTextValue | The content of the comment |
Returns
The comment builder
Example
const comment = univerAPI.newTheadComment()
.setContent(univerAPI.newRichText().insertText('hello zhangsan'));
setDateTime()
setDateTime(date): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:197
Set the date time of the comment
Parameters
Parameter | Type | Description |
---|---|---|
date | Date | The date time of the comment |
Returns
The comment builder
Example
const comment = univerAPI.newTheadComment()
.setDateTime(new Date());
setId()
setId(id): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:212
Set the id of the comment
Parameters
Parameter | Type | Description |
---|---|---|
id | string | The id of the comment |
Returns
The comment builder
Example
const comment = univerAPI.newTheadComment()
.setId('123');
setPersonId()
setPersonId(userId): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:182
Set the person id of the comment
Parameters
Parameter | Type | Description |
---|---|---|
userId | string | The person id of the comment |
Returns
The comment builder
Example
const comment = univerAPI.newTheadComment()
.setPersonId('123');
setThreadId()
setThreadId(threadId): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:227
Set the thread id of the comment
Parameters
Parameter | Type | Description |
---|---|---|
threadId | string | The thread id of the comment |
Returns
The comment builder
Example
const comment = univerAPI.newTheadComment()
.setThreadId('123');
create()
static create(comment?): FTheadCommentBuilder
Defined in: sheets-thread-comment/src/facade/f-thread-comment.ts:149
Create a new FTheadCommentItem
Parameters
Parameter | Type | Description |
---|---|---|
comment ? | IThreadComment | The comment |
Returns
A new instance of FTheadCommentItem
Example
const comment = univerAPI.newTheadComment();