import type { DataXY, PeakXYWidth } from 'cheminfo-types'; import type { GSDPeakOptimized } from '../GSDPeakOptimized.ts'; import type { MakeMandatory } from '../utils/MakeMandatory.ts'; import type { OptimizePeaksOptions } from './optimizePeaks.ts'; export interface Peak extends PeakXYWidth { /** * Optional stable identifier preserved through the optimization. * @default undefined */ id?: string; } export type GSDPeakOptimizedID = MakeMandatory; type GSDPeakOptimizedIDOrNot = T extends { id: string; } ? GSDPeakOptimizedID : GSDPeakOptimized; export interface OptimizePeaksLog { /** x range over which this group of peaks was optimized. */ range: { from: number; to: number; }; /** Optimization parameters used for this group. */ parameters: unknown; /** Number of peaks in the group. */ groupSize: number; /** Time spent on this group, in milliseconds. */ time: number; /** Number of iterations run by the optimizer (`0` when optimization was skipped). */ iterations: number; /** Final error reported by the optimizer. Absent when optimization was skipped. */ error?: number; /** Human-readable outcome (e.g. `optimization successful`). */ message: string; } /** * Optimize the position (x), max intensity (y), full width at half maximum (fwhm) * and the ratio of gaussian contribution (mu) if it's required. * It currently supports three kind of shapes: gaussian, lorentzian and pseudovoigt. * Returns both the optimized peaks and per-group diagnostic logs. * @param data - An object containing the x and y data to be fitted. * @param peakList - A list of initial parameters to be optimized. e.g. coming from a peak picking [{x, y, width}]. * @param options - Optimization options. * @returns An object with the optimized peaks and the per-group logs. */ export declare function optimizePeaksWithLogs(data: DataXY, peakList: T[], options?: OptimizePeaksOptions): { logs: OptimizePeaksLog[]; optimizedPeaks: Array>; }; export {}; //# sourceMappingURL=optimizePeaksWithLogs.d.ts.map