@univerjs/thread-comment v0.4.2 • Docs
Class: ThreadCommentModel
Extends
Constructors
new ThreadCommentModel()
new ThreadCommentModel(_dataSourceService, _lifecycleService): ThreadCommentModel
Parameters
Parameter | Type |
---|---|
_dataSourceService | IThreadCommentDataSourceService |
_lifecycleService | LifecycleService |
Returns
Overrides
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:75 (opens in a new tab)
Properties
Property | Modifier | Type | Default value | Inherited from | Defined in |
---|---|---|---|---|---|
_disposed | protected | boolean | false | Disposable ._disposed | packages/core/src/shared/lifecycle.ts:93 (opens in a new tab) |
commentUpdate$ | public | Observable <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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
origin | IThreadComment |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
threadId | string |
Returns
void
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:386 (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:414 (opens in a new tab)
dispose()
dispose(): void
Returns
void
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:106 (opens in a new tab)
disposeWithMe()
disposeWithMe(disposable): IDisposable
Parameters
Parameter | Type |
---|---|
disposable | DisposableLike |
Returns
Inherited from
Defined in
packages/core/src/shared/lifecycle.ts:96 (opens in a new tab)
ensureMap()
ensureMap(unitId, subUnitId): Map<string, IThreadComment>
Parameters
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
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
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
threadId | string |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
threadId | string |
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
Parameter | Type |
---|---|
unitId | string |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
commentId | string |
resolved | boolean |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
threadIds | string [] |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
payload | IUpdateCommentPayload |
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
Parameter | Type |
---|---|
unitId | string |
subUnitId | string |
payload | IUpdateCommentRefPayload |
silent ? | boolean |
Returns
boolean
Defined in
packages/thread-comment/src/models/thread-comment.model.ts:276 (opens in a new tab)