import type { NumberArray } from 'cheminfo-types'; import type { Shape2D, XYNumber } from 'ml-peak-shape-generator'; import type { Peak2D, Peak2DSeries } from './types/Peaks2D.ts'; type NumToNumFn = (x: number, y?: number) => number | XYNumber; export interface OptionsSG2D { /** * First xy value (inclusive). * @default `0` */ from?: number | XYNumber; /** * Last xy value (inclusive). * @default `100` */ to?: number | XYNumber; /** * Number of points in the final spectrum. * @default `1001` */ nbPoints?: number | XYNumber; /** * Function that returns the width of a peak depending the x value. * @default `() => 5` */ peakWidthFct?: NumToNumFn; /** * Define the shape of the peak. * @default `shape: { * kind: 'gaussian', * },` */ shape?: Shape2D; } export interface AddPeak2DOptions { /** * Half-height width. * @default `peakWidthFct(value)` */ width?: number | XYNumber; fwhm?: number | XYNumber; /** * Define the shape of the peak. */ shape?: Shape2D; /** * Number of times of fwhm to calculate length.. * @default 'covers 99.99 % of volume' */ factor?: number | XYNumber; } interface GetSpectrum2DOptions { /** * generate a copy of the current data * @default true */ copy?: boolean; } export interface GenerateSpectrum2DOptions { /** * Options for spectrum generator */ generator?: OptionsSG2D; /** * Options for addPeaks method */ peaks?: AddPeak2DOptions; } export interface Spectrum2D { minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; z: NumberArray[]; } export declare class Spectrum2DGenerator { private from; private to; private nbPoints; interval: XYNumber; private data; private maxPeakHeight; private shape; private peakWidthFct; constructor(options?: OptionsSG2D); /** * Adds multiple peaks to the 2D spectrum. * @param peaks - Array of peaks or peak series to add. * @param options - Options for adding peaks. * @returns The generator instance. */ addPeaks(peaks: Peak2D[] | Peak2DSeries, options?: AddPeak2DOptions): this; /** * Adds a single peak to the 2D spectrum. * @param peak - Peak to add, can be array or object format. * @param options - Options for adding the peak. * @returns The generator instance. */ addPeak(peak: Peak2D, options?: AddPeak2DOptions): this; /** * Gets the generated 2D spectrum data. * @param options - Options for getting the spectrum. * @returns The spectrum data object. */ getSpectrum(options?: GetSpectrum2DOptions | boolean): { minX: number; maxX: number; maxY: number; minY: number; minZ: number; maxZ: number; z: Float64Array[] | number[][]; }; /** * Resets the generator to initial state. * @returns The generator instance. */ reset(): this; } /** * Generates a 2D spectrum with the given peaks. * @param peaks - Peaks to include in the spectrum. * @param options - Options for spectrum generation. * @returns The generated spectrum data. */ export declare function generateSpectrum2D(peaks: Peak2D[] | Peak2DSeries, options?: GenerateSpectrum2DOptions): Spectrum2D; export {}; //# sourceMappingURL=Spectrum2DGenerator.d.ts.map