@univerjs/thread-comment v0.1.17 • Docs
Class: ThreadCommentModel
Constructors
new ThreadCommentModel()
new ThreadCommentModel(): ThreadCommentModel
Returns
Properties
Property | Type | Defined in |
---|---|---|
commentMap$ | Observable <Record <string , Record <string , Record <string , IThreadComment >>>> | packages/thread-comment/src/models/thread-comment.model.ts:59 (opens in a new tab) |
commentTreeMap$ | Observable <Record <string , Record <string , Record <string , string []>>>> | packages/thread-comment/src/models/thread-comment.model.ts:58 (opens in a new tab) |
commentUpdate$ | Observable <CommentUpdate > | packages/thread-comment/src/models/thread-comment.model.ts:57 (opens in a new tab) |
Methods
addComment()
addComment(
unitId,
subUnitId,
comment): boolean
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
comment | IThreadComment |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:127 (opens in a new tab)
deleteComment()
deleteComment(
unitId,
subUnitId,
commentId): boolean
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:265 (opens in a new tab)
deleteUnit()
deleteUnit(unitId): void
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
void
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:308 (opens in a new tab)
ensureMap()
ensureMap(unitId, subUnitId): {
commentChildrenMap: Map<string, string[]>;
commentMap: Record<string, IThreadComment>;
}
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
Returns
{
commentChildrenMap: Map<string, string[]>;
commentMap: Record<string, IThreadComment>;
}
Name | Type | Defined in |
---|---|---|
commentChildrenMap | Map <string , string []> | packages/thread-comment/src/models/thread-comment.model.ts:123 (opens in a new tab) |
commentMap | Record <string , IThreadComment > | packages/thread-comment/src/models/thread-comment.model.ts:122 (opens in a new tab) |
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:117 (opens in a new tab)
getAll()
getAll(): Record<string, Record<string, Record<string, IThreadComment>>>
Returns
Record
<string
, Record
<string
, Record
<string
, IThreadComment
>>>
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:332 (opens in a new tab)
getComment()
getComment(
unitId,
subUnitId,
commentId): undefined | IThreadComment
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
Returns
undefined
| IThreadComment
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:229 (opens in a new tab)
getComment$()
getComment$(
unitId,
subUnitId,
commentId): Observable<IThreadComment>
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
Returns
Observable
<IThreadComment
>
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:234 (opens in a new tab)
getCommentWithChildren()
getCommentWithChildren(
unitId,
subUnitId,
commentId): undefined | {
children: childrenComments;
relativeUsers: Set<string>;
root: current;
}
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
Returns
undefined
| {
children
: childrenComments
;
relativeUsers
: Set
<string
>;
root
: current
;
}
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:238 (opens in a new tab)
getRootCommentIds()
getRootCommentIds(unitId, subUnitId): string[]
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
Returns
string
[]
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:321 (opens in a new tab)
getRootCommentIds$()
getRootCommentIds$(unitId, subUnitId): Observable<string[]>
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
Returns
Observable
<string
[]>
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:326 (opens in a new tab)
getUnit()
getUnit(unitId): readonly [string, IThreadComment[]][]
Parameters
Parameter | Type |
---|---|
unitId | string |
Returns
readonly [string
, IThreadComment
[]][]
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:299 (opens in a new tab)
resolveComment()
resolveComment(
unitId,
subUnitId,
commentId,
resolved): boolean
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
resolved | boolean |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:207 (opens in a new tab)
updateComment()
updateComment(
unitId,
subUnitId,
payload,
silent?): boolean
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
payload | IUpdateCommentPayload |
silent ? | boolean |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:163 (opens in a new tab)
updateCommentRef()
updateCommentRef(
unitId,
subUnitId,
payload,
silent?): boolean
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
payload | IUpdateCommentRefPayload |
silent ? | boolean |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:186 (opens in a new tab)