type DataFactoryResult = false | { value: unknown; bundleSeed?: string; }; type DataFactory = (row: number, col: number, instance: SamplesGenerator) => DataFactoryResult; type SampleEntry = { needed: number; strings: Array<{ value: unknown; col?: number; row?: number; }>; }; /** * @class SamplesGenerator */ declare class SamplesGenerator { /** * Number of samples to take of each value length. * * @type {number} */ static get SAMPLE_COUNT(): number; /** * Samples prepared for calculations. * * @type {Map} * @default {null} */ samples: Map | null; /** * Function which give the data to collect samples. * * @type {Function} */ dataFactory: DataFactory | null; /** * Custom number of samples to take of each value length. * * @type {number} * @default {null} */ customSampleCount: number | null; /** * `true` if duplicate samples collection should be allowed, `false` otherwise. * * @type {boolean} * @default {false} */ allowDuplicates: boolean; /** * `true` if hidden samples should be included, `false` otherwise. * * @type {boolean} * @default {false} */ includeHidden: boolean; /** * Initializes the samples generator with the data factory function used to retrieve cell values during sampling. */ constructor(dataFactory: DataFactory); /** * Get the sample count for this instance. * * @returns {number} */ getSampleCount(): number; /** * Set the sample count. * * @param {number} sampleCount Number of samples to be collected. */ setSampleCount(sampleCount: number): void; /** * Set if the generator should accept duplicate values. * * @param {boolean} allowDuplicates `true` to allow duplicate values. */ setAllowDuplicates(allowDuplicates: boolean): void; /** * Sets the sampler to the mode where it will generate samples for hidden indexes. * * @param {boolean} includeHidden `true` to include hidden indexes, `false` otherwise. */ setIncludeHidden(includeHidden: boolean): void; /** * Generate samples for row. You can control which area should be sampled by passing `rowRange` object and `colRange` object. * * @param {object|number} rowRange The rows range to generate the samples. * @param {object} colRange The column range to generate the samples. * @returns {object} */ generateRowSamples(rowRange: unknown, colRange: unknown): Map; /** * Generate samples for column. You can control which area should be sampled by passing `colRange` object and `rowRange` object. * * @param {object} colRange Column index. * @param {object} rowRange Column index. * @returns {object} */ generateColumnSamples(colRange: unknown, rowRange: unknown): Map; /** * Generate collection of samples. * * @param {string} type Type to generate. Can be `col` or `row`. * @param {object} range The range to generate the samples. * @param {object|number} specifierRange The range to generate the samples. * @returns {Map} */ generateSamples(type: string, range: { from: number; to: number; }, specifierRange: unknown): Map; /** * Generate sample for specified type (`row` or `col`). * * @param {string} type Samples type `row` or `col`. * @param {object} range The range to generate the samples. * @param {number} specifierValue The range to generate the samples. * @returns {Map} */ generateSample(type: string, range: { from: number; to: number; }, specifierValue: number): Map; } export default SamplesGenerator;