Skip to content

Commit fcfc3c6

Browse files
committed
fix: wrong search replace yield bad typescript definition
1 parent 5168ac1 commit fcfc3c6

File tree

1 file changed

+30
-28
lines changed

1 file changed

+30
-28
lines changed

ml-gsd.d.ts

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
import type {DataXY} from 'cheminfo-types';
2-
export {DataXY} from 'cheminfo-types';
1+
export interface XYNumberArray {
2+
x: Array<number> | Float64Array;
3+
y: Array<number> | Float64Array;
4+
}
35

46
export interface GSDOptions {
57
/**
@@ -8,17 +10,17 @@ export interface GSDOptions {
810
*/
911
noiseLevel?: number;
1012
/**
11-
* Threshold to determine if a given GSDPeak should be considered as a noise, bases on its relative height compared to the highest GSDPeak.
13+
* Threshold to determine if a given peak should be considered as a noise, bases on its relative height compared to the highest peak.
1214
* @default 0.01
1315
*/
1416
minMaxRatio?: number;
1517
/**
16-
* If broadRatio is higher than 0, then all the GSDPeaks which second derivative smaller than broadRatio * maxAbsSecondDerivative will be marked with the soft mask equal to true.
18+
* If broadRatio is higher than 0, then all the peaks which second derivative smaller than broadRatio * maxAbsSecondDerivative will be marked with the soft mask equal to true.
1719
* @default 0.00025
1820
*/
1921
broadRatio?: number;
2022
/**
21-
* Select the GSDPeak intensities from a smoothed version of the independent variables.
23+
* Select the peak intensities from a smoothed version of the independent variables.
2224
* @default true
2325
*/
2426
smoothY?: boolean;
@@ -41,7 +43,7 @@ export interface GSDOptions {
4143
* @default -1
4244
*/
4345
/**
44-
* GSDPeaks are local maximum(true) or minimum(false)
46+
* Peaks are local maximum(true) or minimum(false)
4547
* @default true
4648
*/
4749
maxCriteria?: boolean;
@@ -58,31 +60,31 @@ export interface GSDOptions {
5860
}
5961

6062
export interface GSDPeak {
61-
index: number;
63+
ndex: number;
6264
x: number;
6365
y: number;
6466
width: number;
6567
left?: {
66-
x?:number,
67-
index?:number,
68+
x?: number;
69+
index?: number;
6870
};
6971
right?: {
70-
x?:number,
71-
index?:number,
72+
x?: number;
73+
index?: number;
7274
};
7375
base?: number;
7476
soft?: boolean;
7577
kind?: string;
7678
}
7779

78-
export interface OptimizeGSDPeaksOptions {
80+
export interface OptimizePeaksOptions {
7981
/**
80-
* factor to determine the width at the moment to group the GSDPeaks in signals in 'GSD.optimizeGSDPeaks' function.
82+
* factor to determine the width at the moment to group the peaks in signals in 'GSD.optimizePeaks' function.
8183
* @default 1
8284
*/
8385
factorWidth?: number;
8486
/**
85-
* times of width to use to optimize GSDPeaks
87+
* times of width to use to optimize peaks
8688
* @default 2
8789
*/
8890
factorLimits?: number;
@@ -110,27 +112,27 @@ export interface OptimizationOptions {
110112
timeout?: number;
111113
}
112114

113-
export interface OptimizedGSDPeak {
115+
export interface OptimizedPeak {
114116
x: number;
115117
y: number;
116118
width: number;
117119
mu?: number;
118120
}
119121

120-
export function gsd(data: DataXY, options?: GSDOptions): GSDPeak[];
122+
export function gsd(data: XYNumberArray, options?: GSDOptions): GSDPeak[];
121123

122-
export function optimizeGSDPeaks(
123-
data: DataXY,
124-
PeakList: GSDPeak[],
125-
options?: OptimizeGSDPeaksOptions,
126-
): OptimizedGSDPeak[];
124+
export function optimizePeaks(
125+
data: XYNumberArray,
126+
peakList: GSDPeak[],
127+
options?: OptimizePeaksOptions,
128+
): OptimizedPeak[];
127129

128-
export function joinBroadGSDPeaks(
129-
PeakList: GSDPeak[],
130-
options?: JoinBroadGSDPeaksOptions,
130+
export function joinBroadPeaks(
131+
peakList: GSDPeak[],
132+
options?: JoinBroadPeaksOptions,
131133
): GSDPeak[];
132134

133-
export interface JoinBroadGSDPeaksOptions {
135+
export interface JoinBroadPeaksOptions {
134136
/**
135137
* @default 0.25
136138
*/
@@ -145,10 +147,10 @@ export interface JoinBroadGSDPeaksOptions {
145147
optimization: OptimizationOptions;
146148
}
147149

148-
export function groupGSDPeaks(PeakList: GSDPeak[], factor?: number): GSDPeak[][];
150+
export function groupPeaks(peakList: GSDPeak[], factor?: number): GSDPeak[][];
149151

150-
export function broadenGSDPeaks(
151-
PeakList: GSDPeak[],
152+
export function broadenPeaks(
153+
peakList: GSDPeak[],
152154
options?: {
153155
/**
154156
* @default 2

0 commit comments

Comments
 (0)