Skip to content

Commit

Permalink
Fixing TS declaration of FibonnacciHeap, StaticIntervalTree & Vector
Browse files Browse the repository at this point in the history
- Several `from` static methods were missing parameters in their signatures.
- Made constructor parameter names in vector.d.ts match the implementation parameter name.
  • Loading branch information
Macil authored Dec 5, 2023
1 parent bea7dc5 commit fb42bf6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
10 changes: 8 additions & 2 deletions fibonacci-heap.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,10 @@ export class MinFibonacciHeap<T> {
inspect(): any;

// Statics
static from<I>(iterable: Iterable<I> | {[key: string]: I}): FibonacciHeap<I>;
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
comparator?: FibonacciHeapComparator<I>
): FibonacciHeap<I>;
}

export class MaxFibonacciHeap<T> {
Expand All @@ -61,5 +64,8 @@ export class MaxFibonacciHeap<T> {
inspect(): any;

// Statics
static from<I>(iterable: Iterable<I> | {[key: string]: I}): FibonacciHeap<I>;
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
comparator?: FibonacciHeapComparator<I>
): FibonacciHeap<I>;
}
7 changes: 5 additions & 2 deletions static-interval-tree.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,8 @@ export default class StaticIntervalTree<T> {
inspect(): any;

// Statics
static from<I>(iterable: Iterable<I> | {[key: string]: I}): StaticIntervalTree<I>;
}
static from<I>(
iterable: Iterable<I> | {[key: string]: I},
getters?: StaticIntervalTreeGettersTuple<I>
): StaticIntervalTree<I>;
}
4 changes: 2 additions & 2 deletions vector.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default class Vector implements Iterable<number> {
size: number;

// Constructor
constructor(ArrayClass: IArrayLikeConstructor, length: number | VectorOptions);
constructor(ArrayClass: IArrayLikeConstructor, initialCapacityOrOptions: number | VectorOptions);

// Methods
clear(): void;
Expand Down Expand Up @@ -48,7 +48,7 @@ declare class TypedVector implements Iterable<number> {
size: number;

// Constructor
constructor(length: number | VectorOptions);
constructor(initialCapacityOrOptions: number | VectorOptions);

// Methods
clear(): void;
Expand Down

0 comments on commit fb42bf6

Please sign in to comment.