/** * @module types */ import type { CanUndef, HTMLTagNames, IDictionary, Nullable } from './types'; import type { IStyle } from './style'; export interface MarkerInfo { startId: string; endId?: string; collapsed: boolean; startMarker: string; endMarker?: string; } export type WindowSelection = Selection; export interface ISelect { readonly sel: WindowSelection | null; readonly range: Range; readonly isInsideArea: boolean; readonly html: string; createRange(select?: boolean): Range; clear(): void; current(checkChild?: boolean): Nullable; focus(options?: FocusOptions): boolean; isFocused(): boolean; remove(): void; removeNode(node: Node): void; save(silent?: boolean): MarkerInfo[]; restore(): void; readonly hasMarkers: boolean; readonly markers: HTMLElement[]; removeMarkers(): void; marker(atStart?: boolean, range?: Range): HTMLSpanElement; insertNode( node: Node, insertCursorAfter?: boolean, fireChange?: boolean ): void; insertHTML(html: number | string | Node, insertCursorAfter?: boolean): void; insertImage( url: string | HTMLImageElement, styles?: Nullable>, defaultWidth?: Nullable ): void; isCollapsed(): boolean; cursorInTheEdge( start: boolean, parentBlock: HTMLElement ): Nullable; cursorOnTheLeft(parentBlock: HTMLElement): Nullable; cursorOnTheRight(parentBlock: HTMLElement): Nullable; expandSelection(): ISelect; insertCursorAtPoint(x: number, y: number): boolean; setCursorAfter(node: Node): Nullable; setCursorBefore(node: Node): Nullable; setCursorIn(node: Node, inStart?: boolean): Node; selectRange(range: Range, focus?: boolean): ISelect; select( node: Node | HTMLElement | HTMLTableElement | HTMLTableCellElement, inward?: boolean ): ISelect; wrapInTagGen(): Generator; wrapInTag( tagOrCallback: HTMLTagNames | ((font: HTMLElement) => any) ): HTMLElement[]; applyStyle( style: CanUndef, options?: { element?: HTMLTagNames; className?: string; defaultTag?: HTMLTagNames; } ): void; eachSelection(callback: (current: Node) => void): void; splitSelection(currentBox: HTMLElement): Nullable; }