import type TableSelection from './TableSelection'; import type { SelectionRangeTypes } from '../enum/SelectionRangeTypes'; import type { CompatibleSelectionRangeTypes } from '../compatibleEnum/SelectionRangeTypes'; /** * Represents normal selection */ export interface SelectionRangeExBase { /** * Selection Type definition */ type: T; /** * Ranges */ ranges: Range[]; /** * Whether all the ranges are collapsed */ areAllCollapsed: boolean; } /** * Represents the selection made inside of a table. */ export interface TableSelectionRange extends SelectionRangeExBase { /** * Table that has cells selected */ table: HTMLTableElement; /** * Coordinates of first and last Cell */ coordinates: TableSelection | undefined; /** * Whether the whole table is selected */ isWholeTableSelected?: boolean; } /** * Represents a selected image. */ export interface ImageSelectionRange extends SelectionRangeExBase { /** * Selected Image */ image: HTMLImageElement; } /** * Represents normal selection */ export interface NormalSelectionRange extends SelectionRangeExBase { } /** * Types of ranges used in editor api getSelectionRangeEx */ export declare type SelectionRangeEx = NormalSelectionRange | TableSelectionRange | ImageSelectionRange;