import type { MeasurementXY, MeasurementXYVariables } from 'cheminfo-types'; import type { NormalizedSpectrumOptions } from './types/NormalizedSpectrumOptions.js'; import type { SpectrumSelector } from './types/SpectrumSelector.js'; export type SpectrumCallback = (variables: MeasurementXYVariables) => void; export interface AnalysisOptions { /** Unique identifier for the analysis. If not provided, a random id is generated. */ id?: string; /** Human-readable label. Defaults to the id. */ label?: string; /** A callback to apply on variables when creating a spectrum. */ spectrumCallback?: SpectrumCallback; } export interface NormalizedOptions { normalization?: NormalizedSpectrumOptions; selector?: SpectrumSelector; } /** * Class allowing to store and manipulate an analysis. * An analysis may contain one or more spectra that can be selected * based on their units */ export declare class Analysis { id: string; label: string; spectrumCallback: SpectrumCallback | undefined; spectra: MeasurementXY[]; private cache; constructor(options?: AnalysisOptions); clone({ filter }: { filter: { ids?: string[]; }; }): Analysis; toJSON(): { id: string; label: string; spectra: any; }; static fromJSON(json: any): Analysis; /** * Add a spectrum in the internal spectra variable * @param variables * @param options */ pushSpectrum(variables: MeasurementXYVariables, options?: Omit): void; /** * Retrieve a MeasurementXY based on x/y units * @param selector */ getXYSpectrum(selector?: SpectrumSelector): MeasurementXY | undefined; /** * Retrieve spectra matching selector * @param selector */ getXYSpectra(selector?: SpectrumSelector): MeasurementXY[]; /** * Retrieve a xy object * @param selector.units - Units separated by vs like for example "g vs °C" * @param selector.xUnits - if undefined takes the first variable * @param selector.yUnits - if undefined takes the second variable * @param selector */ getXY(selector?: SpectrumSelector): { x: import("cheminfo-types").DoubleArray; y: import("cheminfo-types").DoubleArray; } | undefined; /** * Return the data object for specific x/y units with possibly some * normalization options * @param options.selector.xUnits - // if undefined takes the first variable * @param options.selector.yUnits - // if undefined takes the second variable * @param options */ getNormalizedSpectrum(options?: NormalizedOptions): MeasurementXY | undefined; /** * @param options */ getNormalizedSpectra(options?: NormalizedOptions): MeasurementXY[]; /** * Returns the first spectrum. This method could be improved in the future * @returns */ getSpectrum(): MeasurementXY; /** * Returns the xLabel * @param selector.xUnits - // if undefined takes the first variable * @param selector.yUnits - // if undefined takes the second variable * @param selector */ getXLabel(selector: SpectrumSelector): string | undefined; /** * Returns the yLabel * @param selector.xUnits - // if undefined takes the first variable * @param selector.yUnits - // if undefined takes the second variable * @param selector */ getYLabel(selector: SpectrumSelector): string | undefined; } //# sourceMappingURL=Analysis.d.ts.map