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

@univerjs/thread-comment v0.4.2Docs


Class: ThreadCommentDataSourceService

Preserve for import async comment system

Extends

Implements

Constructors

new ThreadCommentDataSourceService()

new ThreadCommentDataSourceService(): ThreadCommentDataSourceService

Returns

ThreadCommentDataSourceService

Overrides

Disposable.constructor

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:94 (opens in a new tab)

Properties

PropertyModifierTypeDefault valueDescriptionInherited fromDefined in
_disposedprotectedbooleanfalse-Disposable._disposedpackages/core/src/shared/lifecycle.ts:93 (opens in a new tab)
syncUpdateMutationToCollapublicbooleantrueshould sync update mutations to collaboration-server-packages/thread-comment/src/services/tc-datasource.service.ts:84 (opens in a new tab)

Accessors

dataSource

get dataSource(): Nullable<IThreadCommentDataSource>
set dataSource(dataSource): void

Parameters

ParameterType
dataSourceNullable<IThreadCommentDataSource>

Returns

Nullable<IThreadCommentDataSource>

Implementation of

IThreadCommentDataSourceService.dataSource

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:90 (opens in a new tab)

Methods

addComment()

addComment(comment): Promise<IThreadComment>

handler for add-comment, throw error means fail and stop the process.

Parameters

ParameterType
commentIThreadComment

Returns

Promise<IThreadComment>

Implementation of

IThreadCommentDataSourceService.addComment

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:107 (opens in a new tab)


deleteComment()

deleteComment(
   unitId, 
   subUnitId, 
   threadId, 
commentId): Promise<boolean>

handler for delete-comment, throw error means fail and stop the process.

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdstring
commentIdstring

Returns

Promise<boolean>

Implementation of

IThreadCommentDataSourceService.deleteComment

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:128 (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)


ensureNotDisposed()

protected ensureNotDisposed(): void

Returns

void

Inherited from

Disposable.ensureNotDisposed

Defined in

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


getThreadComment()

getThreadComment(
   unitId, 
   subUnitId, 
threadId): Promise<Nullable<IBaseComment>>

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdstring

Returns

Promise<Nullable<IBaseComment>>

Implementation of

IThreadCommentDataSourceService.getThreadComment

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:98 (opens in a new tab)


listThreadComments()

listThreadComments(
   unitId, 
   subUnitId, 
threadIds): Promise<false | IBaseComment[]>

Parameters

ParameterType
unitIdstring
subUnitIdstring
threadIdsstring[]

Returns

Promise<false | IBaseComment[]>

Implementation of

IThreadCommentDataSourceService.listThreadComments

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:135 (opens in a new tab)


resolveComment()

resolveComment(comment): Promise<boolean>

handler for resolve-comment, throw error means fail and stop the process.

Parameters

ParameterType
commentIThreadComment

Returns

Promise<boolean>

Implementation of

IThreadCommentDataSourceService.resolveComment

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:121 (opens in a new tab)


saveToSnapshot()

saveToSnapshot(unitComments, unitId): Record<string, ThreadCommentJSON[]>

Parameters

ParameterType
unitCommentsRecord<string, IThreadComment[]>
unitIdstring

Returns

Record<string, ThreadCommentJSON[]>

Implementation of

IThreadCommentDataSourceService.saveToSnapshot

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:143 (opens in a new tab)


updateComment()

updateComment(comment): Promise<boolean>

handler for update-comment, throw error means fail and stop the process.

Parameters

ParameterType
commentIThreadComment

Returns

Promise<boolean>

Implementation of

IThreadCommentDataSourceService.updateComment

Defined in

packages/thread-comment/src/services/tc-datasource.service.ts:114 (opens in a new tab)


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