interface UseEmojiTriggerResult

Returned by useEmojiTrigger to TextEditor.

Properties

emojiQuery: string
syncEmojiTrigger: (
value: string,
cursor: number,
open: boolean
) => void

Follows an inline :query and closes the picker once the caret leaves it. The caller calls it on every change with open set, and on every caret move without, since only typing may open the picker. It leaves a browse picker alone.

openEmojiBrowser: (
start: number,
end: number
) => void

Opens a browse picker, whose pick will replace [start, end).

setEmojiQuery: (query: string) => void

Sets the query of the picker's search, in either mode.

selectEmoji: (native: string) => void

Inserts the emoji native through replace and closes the picker.

closeEmoji: () => void

Usage

import { type UseEmojiTriggerResult } from "src/hooks/editor/useEmojiTrigger.ts";