Skip to content

basalt / comments/src / CommentsOptions

Interface: CommentsOptions ​

Defined in: comments/src/comments.ts:95

Properties ​

hooks? ​

> optional hooks?: HookBus

Defined in: comments/src/comments.ts:97


maxBodyLength? ​

> optional maxBodyLength?: number

Defined in: comments/src/comments.ts:101

Longest body accepted, in characters. Default DEFAULT_MAX_COMMENT_LENGTH.


maxMentions? ​

> optional maxMentions?: number

Defined in: comments/src/comments.ts:106

Most distinct @mentions one comment may carry — each one emits a comment:mentioned hook (a notification). Default DEFAULT_MAX_MENTIONS.


mentionPattern? ​

> optional mentionPattern?: RegExp

Defined in: comments/src/comments.ts:99

Regex whose first capture group is a mentioned user id. Default @([\w-]+).


now? ​

> optional now?: () => number

Defined in: comments/src/comments.ts:116

Returns ​

number


resolveMentions? ​

> optional resolveMentions?: (ids, tenantId) => string[] | Promise<string[]>

Defined in: comments/src/comments.ts:115

Filters the mentioned ids down to the users that may be mentioned — typically the members of tenantId. Ids it drops are neither stored nor notified.

Without it every @id in the body is taken at face value, so a mention can address a user of another tenant: wire it whenever comment:mentioned reaches a real notification channel.

Parameters ​

ids ​

string[]

tenantId ​

string

Returns ​

string[] | Promise<string[]>


store? ​

> optional store?: CommentStore

Defined in: comments/src/comments.ts:96

Released under the MIT License.