Skip to content

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

are just two entries in triggers[].

optional atLineStart?: 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: (query) => Completion[] | Promise<Completion[]>

Defined in: widgets/controls/chat/types.ts:42

Provide completions for the current query (sync or async).

string

Completion[] | Promise<Completion[]>


onAccept: (completion, query) => TriggerResult

Defined in: widgets/controls/chat/types.ts:44

Decide what to do when a completion is accepted.

Completion

string

TriggerResult