import type { HotInstance } from '../core/types'; import type { default as DataSourceInstance } from './dataSource'; import type { default as MetaManagerInstance } from './metaManager'; import DataMap from './dataMap'; /** * Configuration for the replaceData function. */ interface ReplaceDataConfig { hotInstance: HotInstance; dataMap: DataMap | { destroy(): void; [key: string]: unknown; } | null; dataSource: DataSourceInstance; internalSource: string; source: string; metaManager: MetaManagerInstance; firstRun: boolean | [null, string]; } /** * Loads new data to Handsontable. * * @private * @param {Array} data Array of arrays or array of objects containing data. * @param {Function} setDataMapFunction Function that updates the datamap instance. * @param {Function} callbackFunction Function that takes care of updating Handsontable to the new dataset. Called * right before the `after-` hooks. * @param {object} config The configuration object containing all the needed dependency references and information. * @param {Handsontable.Core} config.hotInstance The Handsontable instance. * @param {DataMap} config.dataMap The current `dataMap` instance. * @param {DataSource} config.dataSource The current `dataSource` instance. * @param {string} config.internalSource The immediate internal source of the `replaceData` call. * @param {string} config.source The source of the call. * @param {boolean} config.firstRun `true` if it's a first call in the Handsontable lifecycle, `false` otherwise. * @fires Hooks#beforeLoadData * @fires Hooks#beforeUpdateData * @fires Hooks#afterLoadData * @fires Hooks#afterUpdateData * @fires Hooks#afterChange */ declare function replaceData(data: unknown[], setDataMapFunction: (dataMap: DataMap) => void, callbackFunction: (dataMap: DataMap) => void, config: ReplaceDataConfig): void; export { replaceData };