import type { DoubleArray, NumberArray } from 'cheminfo-types'; export interface AirPLSOptions { /** * Maximal number of iterations if the method does not reach the stop criterion. * @default 100 */ maxIterations?: number; /** * Smoothing parameter. Factor of weights matrix in -> [I + lambda D'D]z = x. * @default 10 */ lambda?: number; /** * Factor of the sum of absolute value of original data, to compute stop criterion. * @default 0.001 */ tolerance?: number; /** Initial weights vector, default each point has the same weight. */ weights?: NumberArray; /** Array of 0|1 to force the baseline to cross those points. */ controlPoints?: NumberArray; /** Array of x axis ranges (as from - to), to force the baseline to cross those zones. */ zones?: Array<{ from: number; to: number; }>; /** * Enable automatic downsampling for large datasets to speed up computation. * @default false */ autoDownsample?: boolean; /** * Maximum resolution (number of points) before downsampling is applied. * Only used if autoDownsample is true. * @default 5000 */ maxResolution?: number; } export interface AirPLSResult { /** The baseline-corrected data. */ corrected: NumberArray; /** The estimated baseline. */ baseline: NumberArray; /** The number of iterations performed. */ iteration: number; /** The sum of negative differences (error). */ error: number; } /** * Fit the baseline drift by iteratively changing weights of sum square error between the fitted baseline and original signals, * for further information about the parameters you can get the {@link https://github.com/zmzhang/airPLS/blob/main/airPLS_manuscript.pdf paper of airPLS}. * @param x - X axis data useful when control points or zones are submitted. * @param y - Original data. * @param options - Options object. * @returns An object containing the corrected data, baseline, iteration count, and error. */ export default function airPLS(x: DoubleArray, y: DoubleArray, options?: AirPLSOptions): AirPLSResult; //# sourceMappingURL=index.d.ts.map