export interface SelectionState { anchorNode: Node; anchorOffset: number; focusNode: Node; focusOffset: number; range?: Range; text?: string; } export interface IdsEditorBlockElem { /** The block element */ el: HTMLElement; /** The value filter */ tagName: string; } /** * Get block element and tagName for given node * @param {Selection} sel The selection. * @returns {IdsEditorBlockElem} The element and tagname */ export declare function blockElem(sel: Selection): IdsEditorBlockElem; /** * Get list of block elements for selection * @param {Selection} sel The selection. * @param {HTMLElement} elem The element. * @returns {Array} List of selection block elements */ export declare function selectionBlockElems(sel: Selection, elem: HTMLElement): Array; /** * Restores selection with bounds checking * @param {SelectionState | null} sel - Saved selection state * @returns {boolean} True if restored successfully */ export declare function saveSelectionObject(sel: Selection): SelectionState | null; /** * Restore selection from a previously saved SelectionState object * @param {SelectionState | null} selectionObject - The saved selection state */ export declare function restoreObjectSelection(selectionObject: SelectionState | null): void; /** * Restore selection. * @param {Selection} sel The selection. * @param {Array|null} savedSel Saved selection ranges. * @returns {void} */ export declare function restoreSelection(sel: Selection, savedSel: Array | null): void; /** * Get all selection parents. * @param {Selection} sel The selection. * @param {HTMLElement} elem The element. * @returns {object} List of selection parents. */ export declare function selectionParents(sel: Selection, elem: HTMLElement): object; /** * Find element within the selection * http://stackoverflow.com/questions/6052870/how-to-know-if-there-is-a-link-element-within-the-selection * @param {Selection} sel The selection. * @param {HTMLElement} container The editor host element * @param {string} tagName The tagname to find. * @returns {HTMLElement|null} The found element. */ export declare function findElementInSelection(sel: Selection, container: HTMLElement, tagName: string): HTMLElement | null;