Adds generic types so that the interval tree value type can be specified in the constructor.
Right now, this type definition isn't especially useful because it cant enforce custom types.
Make note of the T = any in the intervaltree def: this is done for backward compatibility: users who rely on the any type should not notice any changes when updating to this type def.
Trivial example:
const intervalTree = new IntervalTree<string>();
intervalTree.insert([0, 100], {}); // TYPE ERROR
Hi @subdavis ,
Excellent suggestion.
I merged your pull request. Available in the release v1.0.13.
Thank you for your contribution to this project
Alex
Adds generic types so that the interval tree value type can be specified in the constructor.
Right now, this type definition isn't especially useful because it cant enforce custom types.
Make note of the
T = any
in the intervaltree def: this is done for backward compatibility: users who rely on the any type should not notice any changes when updating to this type def.Trivial example: