View as Markdown

API reference: @salmonui/dropdowns/mention

MentionEditorInsertioninterface

import type { MentionEditorInsertion } from '@salmonui/dropdowns/mention';
interface MentionEditorInsertion {
    readonly start: number;
    readonly end: number;
    readonly text: string;
    readonly suffix: string;
    readonly trigger: string;
    readonly value: string | number;
    readonly label: string;
    readonly item: unknown;
}

What Mention asks an editor target to insert.

MentionEditorInsertion members (8)
NameSignatureDescription
startreadonly start: number;

Offset of the trigger in the text block (the text getTextBeforeCaret() returns).

endreadonly end: number;

Offset of the caret: [start, end) is the trigger and the search text to replace.

textreadonly text: string;

The text the textarea path would insert: trigger (with keepChar), the insert text, then suffix.

suffixreadonly suffix: string;

The trigger suffix included at the end of text ('' by default).

triggerreadonly trigger: string;
valuereadonly value: string | number;
labelreadonly label: string;
itemreadonly item: unknown;