Skip to content

Interface: UseCommentsResult

@roomful/react


@roomful/react / UseCommentsResult

Defined in: react/src/index.ts:312

Describes the return value of useComments.

add: (input) => Promise<CommentThread>

Defined in: react/src/index.ts:322

Opens a new thread authored by the local peer at an anchor.

Opens a new thread authored by the local peer at anchor. The thread id and createdAt are generated.

The thread anchor and root comment body.

CommentAnchor

string

Promise<CommentThread>

A promise resolving to the created thread.


getByElement: (elementId) => CommentThread[]

Defined in: react/src/index.ts:352

Returns the threads anchored to an element.

Returns the threads anchored to elementId (element or text-range anchors).

string

The element id to filter by.

CommentThread[]

The matching threads.


getOpen: () => CommentThread[]

Defined in: react/src/index.ts:357

Returns the unresolved threads.

Returns the unresolved threads.

CommentThread[]

The open threads.


threads: CommentThread[]

Defined in: react/src/index.ts:317

Exposes the current comment threads, oldest first. Reactive: re-renders on any local or remote thread change.

reopen(threadId): Promise<CommentThread>

Defined in: react/src/index.ts:347

Reopens a resolved thread.

string

The thread to reopen.

Promise<CommentThread>

A promise resolving to the updated thread.


reply(threadId, text): Promise<CommentThread>

Defined in: react/src/index.ts:331

Appends a reply authored by the local peer to a thread.

string

The thread to reply to.

string

The reply body.

Promise<CommentThread>

A promise resolving to the updated thread.


resolve(threadId): Promise<CommentThread>

Defined in: react/src/index.ts:339

Marks a thread resolved.

string

The thread to resolve.

Promise<CommentThread>

A promise resolving to the updated thread.