API Reference
@univerjs
@univerjs/thread-comment
classes
Threadcommentmodel

@univerjs/thread-comment v0.1.17Docs


Class: ThreadCommentModel

Constructors

new ThreadCommentModel()

new ThreadCommentModel(): ThreadCommentModel

Returns

ThreadCommentModel

Properties

PropertyTypeDefined 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

ParameterType
unitIdstring
subUnitIdstring
commentIThreadComment

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

ParameterType
unitIdstring
subUnitIdstring
commentIdstring

Returns

boolean

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:265 (opens in a new tab)


deleteUnit()

deleteUnit(unitId): void

Parameters

ParameterType
unitIdstring

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

ParameterType
unitIdstring
subUnitIdstring

Returns

{
  commentChildrenMap: Map<string, string[]>;
  commentMap: Record<string, IThreadComment>;
}
NameTypeDefined in
commentChildrenMapMap<string, string[]>packages/thread-comment/src/models/thread-comment.model.ts:123 (opens in a new tab)
commentMapRecord<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

ParameterType
unitIdstring
subUnitIdstring
commentIdstring

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

ParameterType
unitIdstring
subUnitIdstring
commentIdstring

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

ParameterType
unitIdstring
subUnitIdstring
commentIdstring

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

ParameterType
unitIdstring
subUnitIdstring

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

ParameterType
unitIdstring
subUnitIdstring

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

ParameterType
unitIdstring

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

ParameterType
unitIdstring
subUnitIdstring
commentIdstring
resolvedboolean

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

ParameterType
unitIdstring
subUnitIdstring
payloadIUpdateCommentPayload
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

ParameterType
unitIdstring
subUnitIdstring
payloadIUpdateCommentRefPayload
silent?boolean

Returns

boolean

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:186 (opens in a new tab)


Copyright © 2021-2024 DreamNum Co,Ltd. All Rights Reserved.