import { BasePlugin } from '../base';
export declare const PLUGIN_KEY = "hiddenRows";
export declare const PLUGIN_PRIORITY = 320;
/**
* @plugin HiddenRows
* @class HiddenRows
*
* @description
* The `HiddenRows` plugin lets you [hide specified rows](@/guides/rows/row-hiding/row-hiding.md).
*
* "Hiding a row" means that the hidden row doesn't get rendered as a DOM element.
*
* The `HiddenRows` plugin doesn't modify the source data,
* and doesn't participate in data transformation
* (the shape of the data returned by the [`getData*()` methods](@/api/core.md#getdata) stays intact).
*
* You can set the following configuration options:
*
* | Option | Required | Type | Default | Description |
* |---|---|---|---|---|
* | `rows` | No | Array | - | [Hides specified rows by default](@/guides/rows/row-hiding/row-hiding.md#step-1-specify-rows-hidden-by-default) |
* | `indicators` | No | Boolean | `false` | [Shows UI indicators](@/guides/rows/row-hiding/row-hiding.md#step-2-show-ui-indicators) |
* | `copyPasteEnabled` | No | Boolean | `true` | [Sets up copy/paste behavior](@/guides/rows/row-hiding/row-hiding.md#step-4-set-up-copy-and-paste-behavior) |
*
* @example
*
* ::: only-for javascript
* ```js
* const container = document.getElementById('example');
* const hot = new Handsontable(container, {
* data: getData(),
* hiddenRows: {
* copyPasteEnabled: true,
* indicators: true,
* rows: [1, 2, 5]
* }
* });
*
* // access the `HiddenRows` plugin's instance
* const hiddenRowsPlugin = hot.getPlugin('hiddenRows');
*
* // hide a single row
* hiddenRowsPlugin.hideRow(1);
*
* // hide multiple rows
* hiddenRowsPlugin.hideRow(1, 2, 9);
*
* // hide multiple rows as an array
* hiddenRowsPlugin.hideRows([1, 2, 9]);
*
* // unhide a single row
* hiddenRowsPlugin.showRow(1);
*
* // unhide multiple rows
* hiddenRowsPlugin.showRow(1, 2, 9);
*
* // unhide multiple rows as an array
* hiddenRowsPlugin.showRows([1, 2, 9]);
*
* // to see your changes, re-render your Handsontable instance
* hot.render();
* ```
* :::
*
* ::: only-for react
* ```jsx
* const hotRef = useRef(null);
*
* ...
*
*
*
* // access the `HiddenRows` plugin's instance
* const hot = hotRef.current.hotInstance;
* const hiddenRowsPlugin = hot.getPlugin('hiddenRows');
*
* // hide a single row
* hiddenRowsPlugin.hideRow(1);
*
* // hide multiple rows
* hiddenRowsPlugin.hideRow(1, 2, 9);
*
* // hide multiple rows as an array
* hiddenRowsPlugin.hideRows([1, 2, 9]);
*
* // unhide a single row
* hiddenRowsPlugin.showRow(1);
*
* // unhide multiple rows
* hiddenRowsPlugin.showRow(1, 2, 9);
*
* // unhide multiple rows as an array
* hiddenRowsPlugin.showRows([1, 2, 9]);
*
* // to see your changes, re-render your Handsontable instance
* hot.render();
* ```
* :::
*
* ::: only-for angular
* ```ts
* import { AfterViewInit, Component, ViewChild } from "@angular/core";
* import {
* GridSettings,
* HotTableModule,
* HotTableComponent,
* } from "@handsontable/angular-wrapper";
*
* `@Component`({
* selector: "app-example",
* standalone: true,
* imports: [HotTableModule],
* template: `
*
*
`,
* })
* export class ExampleComponent implements AfterViewInit {
* `@ViewChild`(HotTableComponent, { static: false })
* readonly hotTable!: HotTableComponent;
*
* readonly gridSettings = {
* data: this.getData(),
* hiddenRows: {
* copyPasteEnabled: true,
* indicators: true,
* rows: [1, 2, 5],
* },
* };
*
* ngAfterViewInit(): void {
* // Access the `HiddenRows` plugin's instance
* const hot = this.hotTable.hotInstance;
* const hiddenRowsPlugin = hot.getPlugin("hiddenRows");
*
* // Hide a single row
* hiddenRowsPlugin.hideRow(1);
*
* // Hide multiple rows
* hiddenRowsPlugin.hideRow(1, 2, 9);
*
* // Hide multiple rows as an array
* hiddenRowsPlugin.hideRows([1, 2, 9]);
*
* // Unhide a single row
* hiddenRowsPlugin.showRow(1);
*
* // Unhide multiple rows
* hiddenRowsPlugin.showRow(1, 2, 9);
*
* // Unhide multiple rows as an array
* hiddenRowsPlugin.showRows([1, 2, 9]);
*
* // To see your changes, re-render your Handsontable instance
* hot.render();
* }
*
* private getData(): Array<*> {
* // Get some data
* }
* }
* ```
* :::
*/
export declare class HiddenRows extends BasePlugin {
#private;
/**
* Returns the plugin key used to identify this plugin in Handsontable settings.
*/
static get PLUGIN_KEY(): string;
/**
* Returns the priority order used to determine the order in which plugins are initialized.
*/
static get PLUGIN_PRIORITY(): number;
/**
* Returns the default settings applied when the plugin is enabled without explicit configuration.
*/
static get DEFAULT_SETTINGS(): {
copyPasteEnabled: boolean;
indicators: boolean;
rows: number[];
};
/**
* Checks if the plugin is enabled in the handsontable settings. This method is executed in {@link Hooks#beforeInit}
* hook and if it returns `true` then the {@link HiddenRows#enablePlugin} method is called.
*
* @returns {boolean}
*/
isEnabled(): boolean;
/**
* Enables the plugin functionality for this Handsontable instance.
*/
enablePlugin(): void;
/**
* Updates the plugin's state.
*
* This method is executed when [`updateSettings()`](@/api/core.md#updatesettings) is invoked with any of the following configuration options:
* - [`hiddenRows`](@/api/options.md#hiddenrows)
*/
updatePlugin(): void;
/**
* Disables the plugin functionality for this Handsontable instance.
*/
disablePlugin(): void;
/**
* Shows the rows provided in the array.
*
* @param {number[]} rows Array of visual row indexes.
*/
showRows(rows: number[]): void;
/**
* Shows the row provided as row index (counting from 0).
*
* @param {...number} row Visual row index.
*/
showRow(...row: number[]): void;
/**
* Hides the rows provided in the array.
*
* @param {number[]} rows Array of visual row indexes.
*/
hideRows(rows: number[]): void;
/**
* Hides the row provided as row index (counting from 0).
*
* @param {...number} row Visual row index.
*/
hideRow(...row: number[]): void;
/**
* Returns an array of visual indexes of hidden rows.
*
* @returns {number[]}
*/
getHiddenRows(): number[];
/**
* Checks if the provided row is hidden.
*
* @param {number} row Visual row index.
* @returns {boolean}
*/
isHidden(row: number): boolean;
/**
* Checks whether all of the provided row indexes are within the bounds of the table.
*
* @param {Array} hiddenRows List of hidden visual row indexes.
* @returns {boolean}
*/
isValidConfig(hiddenRows: number[]): boolean;
/**
* Resets all rendered cells meta.
*
* @private
*/
resetCellsMeta(): void;
/**
* Destroys the plugin instance.
*/
destroy(): void;
}