@chayns-components/emoji-input
Version:
Input field that supports HTML elements and emojis
24 lines (23 loc) • 1.13 kB
TypeScript
import type { KeyboardEvent } from 'react';
interface SaveSelectionOptions {
shouldIgnoreEmptyTextNodes?: boolean;
}
export declare const saveSelection: (element: HTMLDivElement, { shouldIgnoreEmptyTextNodes }?: SaveSelectionOptions) => void;
export declare const restoreSelection: (element: HTMLDivElement) => void;
export declare const insertInvisibleCursorMarker: () => void;
export declare const moveSelectionOffset: (distance: number) => void;
export declare const setChildIndex: (index: number) => void;
/**
* This function returns the code of the character that will be removed by the KeyDown event in the
* next step, if the "Backspace" or "Delete" key was pressed and there is no selection of multiple
* characters.
*
* @param event - Keyboard event from "onKeyDown"
*/
export declare const getCharCodeThatWillBeDeleted: (event: KeyboardEvent<HTMLDivElement>) => number | null | undefined;
interface FindAndSelectTextOptions {
editorElement: HTMLDivElement;
searchText: string;
}
export declare const findAndSelectText: ({ editorElement, searchText, }: FindAndSelectTextOptions) => Range | null;
export {};