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

@univerjs/thread-comment v0.4.2Docs


Class: ThreadCommentModel

Extends

Constructors

new ThreadCommentModel()

new ThreadCommentModel(_dataSourceService, _lifecycleService): ThreadCommentModel

Parameters

ParameterType
_dataSourceServiceIThreadCommentDataSourceService
_lifecycleServiceLifecycleService

Returns

ThreadCommentModel

Overrides

Disposable.constructor

Defined in

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

Properties

PropertyModifierTypeDefault valueInherited fromDefined in
_disposedprotectedbooleanfalseDisposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
commentUpdate$publicObservable<CommentUpdate>undefined-packages/thread-comment/src/models/thread-comment.model.ts:71 (opens in a new tab)

Methods

addComment()

addComment(
   unitId, 
   subUnitId, 
   origin, 
   shouldSync?): boolean

Parameters

ParameterType
unitIdstring
subUnitIdstring
originIThreadComment
shouldSync?boolean

Returns

boolean

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:220 (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:398 (opens in a new tab)


deleteThread()

deleteThread(
   unitId, 
   subUnitId, 
   threadId): void

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdstring

Returns

void

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:386 (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:414 (opens in a new tab)


dispose()

dispose(): void

Returns

void

Inherited from

Disposable.dispose

Defined in

packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)


disposeWithMe()

disposeWithMe(disposable): IDisposable

Parameters

ParameterType
disposableDisposableLike

Returns

IDisposable

Inherited from

Disposable.disposeWithMe

Defined in

packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)


ensureMap()

ensureMap(unitId, subUnitId): Map<string, IThreadComment>

Parameters

ParameterType
unitIdstring
subUnitIdstring

Returns

Map<string, IThreadComment>

Defined in

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


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

packages/core/src/shared/lifecycle.ts:100 (opens in a new tab)


getAll()

getAll(): {
  threads: IThreadInfo[];
  unitId: string;
 }[]

Returns

{ threads: IThreadInfo[]; unitId: string; }[]

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:447 (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:315 (opens in a new tab)


getCommentWithChildren()

getCommentWithChildren(
   unitId, 
   subUnitId, 
commentId): Nullable<IThreadInfo>

Parameters

ParameterType
unitIdstring
subUnitIdstring
commentIdstring

Returns

Nullable<IThreadInfo>

Defined in

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


getRootComment()

getRootComment(
   unitId, 
   subUnitId, 
   threadId): undefined | IThreadComment

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdstring

Returns

undefined | IThreadComment

Defined in

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


getThread()

getThread(
   unitId, 
   subUnitId, 
threadId): Nullable<IThreadInfo>

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdstring

Returns

Nullable<IThreadInfo>

Defined in

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


getUnit()

getUnit(unitId): IThreadInfo[]

Parameters

ParameterType
unitIdstring

Returns

IThreadInfo[]

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:427 (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:295 (opens in a new tab)


syncThreadComments()

syncThreadComments(
   unitId, 
   subUnitId, 
threadIds): Promise<void>

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdsstring[]

Returns

Promise<void>

Defined in

packages/thread-comment/src/models/thread-comment.model.ts:192 (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:254 (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:276 (opens in a new tab)


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