import type { HotInstance } from '../../core/types'; import type { Events } from '../../core/settings'; import EventManager from '../../eventManager'; export declare const defaultMainSettingSymbol: unique symbol; export declare const PLUGIN_KEY = "base"; /** * @util * @property {Core} hot Handsontable instance. */ export declare class BasePlugin { #private; /** * Reference to the Handsontable instance this plugin belongs to. */ hot: HotInstance; /** * Translation helper object provided by the i18n system, if available. */ t?: Record; /** * Reference to the plugin's own class constructor, used for static property access at runtime. */ ['constructor']: typeof BasePlugin; /** * Returns `true` if the plugin should be active based on current Handsontable settings. Defined by each subclass. */ isEnabled?(): boolean; /** * Returns the plugin key used to identify and look up this plugin in Handsontable settings and the plugin registry. */ static get PLUGIN_KEY(): string; /** * The SETTING_KEYS getter defines the keys that, when present in the config object, trigger the plugin update * after the updateSettings calls. * - When it returns true, the plugin updates after all updateSettings calls, regardless of the contents of the * config object. * - When it returns false, the plugin never updates on updateSettings calls. * * @returns {string[] | boolean} */ static get SETTING_KEYS(): string[] | boolean; /** * The DEFAULT_SETTINGS getter defines the plugin default settings. * * @returns {object} */ static get DEFAULT_SETTINGS(): Record; /** * Validators for plugin settings. * * @type {Function|object|null} */ static get SETTINGS_VALIDATORS(): ((value: unknown) => boolean) | Record boolean> | null; /** * Optional list of plugin dependencies in the format 'type:ModuleName'. * * @type {string[] | undefined} */ static PLUGIN_DEPS?: string[]; /** * The instance of the EventManager class. * * @type {EventManager} */ eventManager: EventManager; /** * @type {string} */ pluginName: string | null; /** * @type {Function[]} */ pluginsInitializedCallbacks: (() => void)[]; /** * @type {boolean} */ isPluginsReady: boolean; /** * @type {boolean} */ enabled: boolean; /** * @type {boolean} */ initialized: boolean; /** * @param {object} hotInstance Handsontable instance. */ constructor(hotInstance: HotInstance); /** * Initializes the plugin by resolving its name, applying settings, and checking required dependencies. */ init(): void; /** * Whether this plugin is blocked by a registered hard conflict (another top-level setting is truthy; for example * nestedRows blocks pagination, or manualRowMove blocks dataProvider). Emits a console warning when blocked. * * @returns {boolean} true if the plugin must not enable. */ isHardConflictBlocked(): boolean; /** * Enable plugin for this Handsontable instance. */ enablePlugin(): void; /** * Disable plugin for this Handsontable instance. */ disablePlugin(): void; /** * Gets the plugin settings. If there is no setting under the provided key, it returns the default setting * provided by the DEFAULT_SETTINGS static property of the class. * * @param {string} [settingName] The setting name. If the setting name is not provided, it returns * the whole plugin's settings object. * @returns {T} */ getSetting(settingName?: string): T; /** * Update plugin settings. * * @param {*} newSettings New settings. * @returns {object} Updated settings object. */ updatePluginSettings(newSettings: unknown): unknown; /** * Add listener to plugin hooks system. * * @param {string} name The hook name. * @param {Function} callback The listener function to add. * @param {number} [orderIndex] Order index of the callback. * If > 0, the callback will be added after the others, for example, with an index of 1, the callback will be added before the ones with an index of 2, 3, etc., but after the ones with an index of 0 and lower. * If < 0, the callback will be added before the others, for example, with an index of -1, the callback will be added after the ones with an index of -2, -3, etc., but before the ones with an index of 0 and higher. * If 0 or no order index is provided, the callback will be added between the "negative" and "positive" indexes. */ addHook(name: K, callback: Events[K], orderIndex?: number): void; /** * Remove all hooks listeners by hook name. * * @param {string} name The hook name. */ removeHooks(name: string): void; /** * Clear all hooks. */ clearHooks(): void; /** * Register function which will be immediately called after all plugins initialized. * * @param {Function} callback The listener function to add. */ callOnPluginsReady(callback: () => void): void; /** * On after plugins initialized listener. * * @private */ onAfterPluginsInitialized(): void; /** * On update settings listener. Re-applies hard conflict rules when settings change so a plugin that is already * enabled disables if a conflicting top-level setting becomes truthy, even when this plugin's SETTING_KEYS do not * overlap the updateSettings payload. * * @private * @param {object} newSettings New set of settings passed to the updateSettings method. */ onUpdateSettings(newSettings: Record): void; /** * Updates the plugin to use the latest options you have specified. * * @private */ updatePlugin(newSettings?: Record): void; /** * Destroy plugin. */ destroy(): void; }