Trigger
Defined in: widgets/controls/chat/types.ts:36
A character-triggered completion source. When char is typed (optionally
only at the line start), the widget collects the query after it and asks
getCompletions; accepting one calls onAccept to decide what to
splice. Slash-commands and
Mentions
Section titled “Mentions”are just two entries in triggers[].
Properties
Section titled “Properties”atLineStart?
Section titled “atLineStart?”
optionalatLineStart?:boolean
Defined in: widgets/controls/chat/types.ts:40
Require the char to sit at the start of its logical line (e.g. commands).
char:
string
Defined in: widgets/controls/chat/types.ts:38
The trigger character, e.g. ”/”, ”@”, ”#“.
getCompletions
Section titled “getCompletions”getCompletions: (
query) =>Completion[] |Promise<Completion[]>
Defined in: widgets/controls/chat/types.ts:42
Provide completions for the current query (sync or async).
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Completion[] | Promise<Completion[]>
onAccept
Section titled “onAccept”onAccept: (
completion,query) =>TriggerResult
Defined in: widgets/controls/chat/types.ts:44
Decide what to do when a completion is accepted.
Parameters
Section titled “Parameters”completion
Section titled “completion”string