Skip to content

Commit

Permalink
fix: correct TS definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
targos authored Jul 10, 2019
1 parent 4543606 commit f50d820
Showing 1 changed file with 31 additions and 31 deletions.
62 changes: 31 additions & 31 deletions hclust.d.ts
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
declare module 'ml-hclust' {
export type AgglomerationMethod =
| 'single'
| 'complete'
| 'average'
| 'centroid'
| 'ward';
export interface AgnesOptions {
distanceFunction: (a: T, b: T) => number;
method: AgglomerationMethod;
isDistanceMatrix: boolean;
}
export type AgglomerationMethod =
| 'single'
| 'complete'
| 'average'
| 'centroid'
| 'ward';

export interface DianaOptions<T> {
distanceFunction: (a: T, b: T) => number;
}
export interface AgnesOptions<T> {
distanceFunction: (a: T, b: T) => number;
method: AgglomerationMethod;
isDistanceMatrix: boolean;
}

export interface Cluster {
children: Cluster[];
distance: number;
index: number[];
cut: (threshold: number) => Cluster[];
group: (minGroups: number) => Cluster;
traverse: (cb: (cluster: Cluster) => void) => void;
}
export interface DianaOptions<T> {
distanceFunction: (a: T, b: T) => number;
}

export function agnes<T = number[]>(
data: T[],
options?: AgnesOptions<T>
): Cluster;
export function diana<T = number[]>(
data: T[],
options?: DianaOptions<T>
): Cluster;
export interface Cluster {
children: Cluster[];
distance: number;
index: number[];
cut: (threshold: number) => Cluster[];
group: (minGroups: number) => Cluster;
traverse: (cb: (cluster: Cluster) => void) => void;
}

export function agnes<T = number[]>(
data: T[],
options?: AgnesOptions<T>
): Cluster;

export function diana<T = number[]>(
data: T[],
options?: DianaOptions<T>
): Cluster;

0 comments on commit f50d820

Please sign in to comment.