From fb42bf6419f63116e58ef026b4045a465e8bd673 Mon Sep 17 00:00:00 2001 From: Chris Cowan Date: Tue, 5 Dec 2023 02:10:48 -0800 Subject: [PATCH] Fixing TS declaration of FibonnacciHeap, StaticIntervalTree & Vector - Several `from` static methods were missing parameters in their signatures. - Made constructor parameter names in vector.d.ts match the implementation parameter name. --- fibonacci-heap.d.ts | 10 ++++++++-- static-interval-tree.d.ts | 7 +++++-- vector.d.ts | 4 ++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/fibonacci-heap.d.ts b/fibonacci-heap.d.ts index 8f9f5729..215e93d0 100644 --- a/fibonacci-heap.d.ts +++ b/fibonacci-heap.d.ts @@ -42,7 +42,10 @@ export class MinFibonacciHeap { inspect(): any; // Statics - static from(iterable: Iterable | {[key: string]: I}): FibonacciHeap; + static from( + iterable: Iterable | {[key: string]: I}, + comparator?: FibonacciHeapComparator + ): FibonacciHeap; } export class MaxFibonacciHeap { @@ -61,5 +64,8 @@ export class MaxFibonacciHeap { inspect(): any; // Statics - static from(iterable: Iterable | {[key: string]: I}): FibonacciHeap; + static from( + iterable: Iterable | {[key: string]: I}, + comparator?: FibonacciHeapComparator + ): FibonacciHeap; } diff --git a/static-interval-tree.d.ts b/static-interval-tree.d.ts index 904859dc..3ef7aa2f 100644 --- a/static-interval-tree.d.ts +++ b/static-interval-tree.d.ts @@ -20,5 +20,8 @@ export default class StaticIntervalTree { inspect(): any; // Statics - static from(iterable: Iterable | {[key: string]: I}): StaticIntervalTree; -} \ No newline at end of file + static from( + iterable: Iterable | {[key: string]: I}, + getters?: StaticIntervalTreeGettersTuple + ): StaticIntervalTree; +} diff --git a/vector.d.ts b/vector.d.ts index b156f5a2..5ed513d7 100644 --- a/vector.d.ts +++ b/vector.d.ts @@ -18,7 +18,7 @@ export default class Vector implements Iterable { size: number; // Constructor - constructor(ArrayClass: IArrayLikeConstructor, length: number | VectorOptions); + constructor(ArrayClass: IArrayLikeConstructor, initialCapacityOrOptions: number | VectorOptions); // Methods clear(): void; @@ -48,7 +48,7 @@ declare class TypedVector implements Iterable { size: number; // Constructor - constructor(length: number | VectorOptions); + constructor(initialCapacityOrOptions: number | VectorOptions); // Methods clear(): void;