Hey there,
i built a neat little typescript implementation of BlinkStick. It’s implementing the javascript client in a TypeScript manner, but it also provides a (a) more object-oriented way of working with the LEDs and things and (b) a functional way.
NPM: blinkstick-ts - npm
GitLab: https://github.com/jkopcsek/blinkstick-ts
Object-Orientied API
A BlinkStick provides access to multiple LEDs potentially organized in multiple channels (i.e. lines of LEDs). To make it easier to work with those constructs and not just arbitrary indexes, there is an LedLine and Led object.
const ledLine: LedLine = blinkstick.getChannel(0);
const led1: Led = channel.getLed(0);
const led2: Led = channel.getLed(1);
Functional API
An alternative to the object-oriented API is the functional API. Here, it’s all functions, no objects. Simple to start with.
setColor(0, Colors.red);
setColors([Colors.red, Colors.green]);
I’d be happy to get feedback if there is something wrong or missing.