Interface: UseCommentsResult
@roomful/solid / UseCommentsResult
Interface: UseCommentsResult
Section titled “Interface: UseCommentsResult”Defined in: solid/src/index.ts:357
Describes the return value of useComments.
Properties
Section titled “Properties”add: (
input) =>Promise<CommentThread>
Defined in: solid/src/index.ts:367
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.
Parameters
Section titled “Parameters”The thread anchor and root comment body.
anchor
Section titled “anchor”string
Returns
Section titled “Returns”Promise<CommentThread>
A promise resolving to the created thread.
getByElement()
Section titled “getByElement()”getByElement: (
elementId) =>CommentThread[]
Defined in: solid/src/index.ts:397
Returns the threads anchored to an element.
Returns the threads anchored to elementId (element or text-range
anchors).
Parameters
Section titled “Parameters”elementId
Section titled “elementId”string
The element id to filter by.
Returns
Section titled “Returns”The matching threads.
getOpen()
Section titled “getOpen()”getOpen: () =>
CommentThread[]
Defined in: solid/src/index.ts:402
Returns the unresolved threads.
Returns the unresolved threads.
Returns
Section titled “Returns”The open threads.
threads
Section titled “threads”threads:
Accessor<CommentThread[]>
Defined in: solid/src/index.ts:362
Exposes the current comment threads, oldest first. Reactive: updates on any local or remote thread change.
Methods
Section titled “Methods”reopen()
Section titled “reopen()”reopen(
threadId):Promise<CommentThread>
Defined in: solid/src/index.ts:392
Reopens a resolved thread.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
The thread to reopen.
Returns
Section titled “Returns”Promise<CommentThread>
A promise resolving to the updated thread.
reply()
Section titled “reply()”reply(
threadId,text):Promise<CommentThread>
Defined in: solid/src/index.ts:376
Appends a reply authored by the local peer to a thread.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
The thread to reply to.
string
The reply body.
Returns
Section titled “Returns”Promise<CommentThread>
A promise resolving to the updated thread.
resolve()
Section titled “resolve()”resolve(
threadId):Promise<CommentThread>
Defined in: solid/src/index.ts:384
Marks a thread resolved.
Parameters
Section titled “Parameters”threadId
Section titled “threadId”string
The thread to resolve.
Returns
Section titled “Returns”Promise<CommentThread>
A promise resolving to the updated thread.