manzt / numcodecs.js

Buffer compression and transformation codecs for use in Zarr.js and beyond...
MIT License
27 stars 6 forks source link

Create generic codec constructor interface #21

Closed manzt closed 3 years ago

manzt commented 3 years ago

Previously the static constructor for each codec (fromConfig) was not type constrained. This PR adds a constraint where each Codec must implement both a static and instance interface: https://www.typescriptlang.org/docs/handbook/interfaces.html#difference-between-the-static-and-instance-sides-of-classes