import type { default as CellCoords } from '../../3rdparty/walkontable/src/cell/coords'; import type VisualSelection from './visualSelection'; import { HIGHLIGHT_ACTIVE_HEADER_TYPE, HIGHLIGHT_AREA_TYPE, HIGHLIGHT_FOCUS_TYPE, HIGHLIGHT_CUSTOM_SELECTION_TYPE, HIGHLIGHT_FILL_TYPE, HIGHLIGHT_HEADER_TYPE, HIGHLIGHT_ROW_TYPE, HIGHLIGHT_COLUMN_TYPE } from '../../3rdparty/walkontable/src'; export { HIGHLIGHT_ACTIVE_HEADER_TYPE as ACTIVE_HEADER_TYPE, HIGHLIGHT_AREA_TYPE as AREA_TYPE, HIGHLIGHT_FOCUS_TYPE as FOCUS_TYPE, HIGHLIGHT_CUSTOM_SELECTION_TYPE as CUSTOM_SELECTION_TYPE, HIGHLIGHT_FILL_TYPE as FILL_TYPE, HIGHLIGHT_HEADER_TYPE as HEADER_TYPE, HIGHLIGHT_ROW_TYPE as ROW_TYPE, HIGHLIGHT_COLUMN_TYPE as COLUMN_TYPE, }; /** * Highlight class responsible for managing Walkontable Selection classes. * * With Highlight object you can manipulate four different highlight types: * - `cell` can be added only to a single cell at a time and it defines currently selected cell; * - `fill` can occur only once and its highlight defines selection of autofill functionality (managed by the plugin with the same name); * - `areas` can be added to multiple cells at a time. This type highlights selected cell or multiple cells. * The multiple cells have to be defined as an uninterrupted order (regular shape). Otherwise, the new layer of * that type should be created to manage not-consecutive selection; * - `header` can occur multiple times. This type is designed to highlight only headers. Like `area` type it * can appear with multiple highlights (accessed under different level layers). * * @class Highlight * @util */ declare class Highlight { #private; /** * Options consumed by Highlight class and Walkontable Selection classes. * * @type {object} */ options: Record; /** * The property which describes which layer level of the visual selection will be modified. * This option is valid only for `area` and `header` highlight types which occurs multiple times on * the table (as a non-consecutive selection). * * An order of the layers is the same as the order of added new non-consecutive selections. * * @type {number} * @default 0 */ layerLevel: number; /** * `cell` highlight object which describes attributes for the currently selected cell. * It can only occur only once on the table. * * @type {Selection} */ focus: VisualSelection; /** * `fill` highlight object which describes attributes for the borders for autofill functionality. * It can only occur only once on the table. * * @type {Selection} */ fill: VisualSelection; /** * Collection of the `area` highlights. That objects describes attributes for the borders and selection of * the multiple selected cells. It can occur multiple times on the table. * * @type {Map.} */ layeredAreas: Map; /** * Collection of the `highlight` highlights. That objects describes attributes for the borders and selection of * the multiple selected cells. It can occur multiple times on the table. * * @type {Map.} */ areas: Map; /** * Collection of the `header` highlights. That objects describes attributes for the selection of * the multiple selected rows in the table header. It can occur multiple times on the table. * * @type {Map.} */ rowHeaders: Map; /** * Collection of the `header` highlights. That objects describes attributes for the selection of * the multiple selected columns in the table header. It can occur multiple times on the table. * * @type {Map.} */ columnHeaders: Map; /** * Collection of the `active-header` highlights. That objects describes attributes for the selection of * the multiple selected rows in the table header. The table headers which have selected all items in * a row will be marked as `active-header`. * * @type {Map.} */ activeRowHeaders: Map; /** * Collection of the `active-header` highlights. That objects describes attributes for the selection of * the multiple selected columns in the table header. The table headers which have selected all items in * a row will be marked as `active-header`. * * @type {Map.} */ activeColumnHeaders: Map; /** * Collection of the `active-header` highlights. That objects describes attributes for the selection of * the selected corner in the table header. The table headers which have selected all items in * a row will be marked as `active-header`. * * @type {Map.} */ activeCornerHeaders: Map; /** * Collection of the `rows` highlights. That objects describes attributes for the selection of * the multiple selected cells in a row. It can occur multiple times on the table. * * @type {Map.} */ rowHighlights: Map; /** * Collection of the `columns` highlights. That objects describes attributes for the selection of * the multiple selected cells in a column. It can occur multiple times on the table. * * @type {Map.} */ columnHighlights: Map; /** * Collection of the `custom-selection`, holder for example borders added through CustomBorders plugin. * * @type {Selection[]} */ customSelections: VisualSelection[]; /** * Initializes the highlight manager with configuration options and creates the focus and fill highlight instances. */ constructor(options: Record); /** * Check if highlight cell rendering is disabled for specified highlight type. * * @param {string} highlightType Highlight type. Possible values are: `cell`, `area`, `fill` or `header`. * @param {CellCoords} coords The CellCoords instance with defined visual coordinates. * @returns {boolean} */ isEnabledFor(highlightType: string, coords: CellCoords): boolean; /** * Set a new layer level to make access to the desire `area` and `header` highlights. * * @param {number} [level=0] Layer level to use. * @returns {Highlight} */ useLayerLevel(level?: number): this; /** * Get Walkontable Selection instance created for controlling highlight of the currently * focused cell (or header). * * @returns {Selection} */ getFocus(): VisualSelection; /** * Get Walkontable Selection instance created for controlling highlight of the autofill functionality. * * @returns {Selection} */ getFill(): VisualSelection; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * `area` highlights. * * @returns {Selection} */ createLayeredArea(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells. * * @returns {Selection[]} */ getLayeredAreas(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * `highlight` highlights. * * @returns {Selection} */ createArea(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the cells. * * @returns {Selection[]} */ getAreas(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * header highlight for rows. * * @returns {Selection} */ createRowHeader(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers. * * @returns {Selection[]} */ getRowHeaders(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * header highlight for columns. * * @returns {Selection} */ createColumnHeader(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers. * * @returns {Selection[]} */ getColumnHeaders(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * highlight for active row headers. * * @returns {Selection} */ createActiveRowHeader(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers. * * @returns {Selection[]} */ getActiveRowHeaders(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * highlight for active column headers. * * @returns {Selection} */ createActiveColumnHeader(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the active headers. * * @returns {Selection[]} */ getActiveColumnHeaders(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * highlight for the headers corner. * * @returns {Selection} */ createActiveCornerHeader(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the visual highlight of the headers corner. * * @returns {Selection[]} */ getActiveCornerHeaders(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * highlight cells in a row. * * @returns {Selection} */ createRowHighlight(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the rows highlighting. * * @returns {Selection[]} */ getRowHighlights(): VisualSelection[]; /** * Creates (if not exist in the cache) Walkontable Selection instance created for controlling * highlight cells in a column. * * @returns {Selection} */ createColumnHighlight(): VisualSelection | undefined; /** * Get all Walkontable Selection instances which describes the state of the columns highlighting. * * @returns {Selection[]} */ getColumnHighlights(): VisualSelection[]; /** * Get Walkontable Selection instance created for controlling highlight of the custom selection functionality. * * @returns {Selection} */ getCustomSelections(): VisualSelection[]; /** * Add selection to the custom selection instance. The new selection are added to the end of the selection collection. * * @param {object} selectionInstance The selection instance. */ addCustomSelection(selectionInstance: Record): void; /** * Updates the CSS class names used for row, column, header, and active header highlights. * Necessary when the related settings change at runtime (e.g. via `updateSettings()`). * * @param {object} options Options with updated class names. * @param {string} [options.rowClassName] The new class name for row highlights. * @param {string} [options.columnClassName] The new class name for column highlights. * @param {string} [options.headerClassName] The new class name for header highlights. * @param {string} [options.activeHeaderClassName] The new class name for active header highlights. */ updateHighlightClassNames(options: { rowClassName?: string; columnClassName?: string; headerClassName?: string; activeHeaderClassName?: string; }): void; /** * Perform cleaning visual highlights for the whole table. */ clear(): void; /** * This object can be iterate over using `for of` syntax or using internal `arrayEach` helper. * * @returns {Selection[]} */ [Symbol.iterator](): IterableIterator; } export default Highlight;