/** * Helper for working with caret */ export default class Caret { /** * The for caret saving/restoring */ savedFakeCaret: HTMLElement | undefined; /** * Store internal properties */ constructor(); /** * Saves caret position using hidden * * @returns {void} */ save(): void; /** * Restores the caret position saved by the save() method * * @returns {void} */ restore(): void; /** * Returns the first range * * @returns {Range|null} */ static get range(): Range | null; /** * Extract content fragment from Caret position to the end of contenteditable element * * @returns {DocumentFragment|void} */ static extractFragmentFromCaretPositionTillTheEnd(): DocumentFragment | void; /** * Set focus to contenteditable or native input element * * @param {HTMLElement} element - element where to set focus * @param {boolean} atStart - where to set focus: at the start or at the end * @returns {void} */ static focus(element: HTMLElement, atStart?: boolean): void; /** * Check if the caret placed at the start of the contenteditable element * * @returns {boolean} */ static isAtStart(): boolean; /** * Get all first-level (first child of [contenteditabel]) siblings from passed node * Then you can check it for emptiness * * @example *
*

| *

| left first-level siblings *

| *
adaddad
<-- passed node for example *

| *

| right first-level siblings *

| *
* @param {HTMLElement} from - element from which siblings should be searched * @param {'left' | 'right'} direction - direction of search * @returns {HTMLElement[]} */ static getHigherLevelSiblings(from: HTMLElement, direction?: 'left' | 'right'): HTMLElement[]; }