Need information about device creation


I’m working on my own implementation of the microbit device. I want to add support for the V2 microbit which isn’t there in the official version of the device.
In order to do that, I have to write a custom uplad driver (microbit doesn’t use a regular STK driver). My problem is that there aren’t any informations about the API in the documentation.
I’ve tried to look at the JS files of the official microbit device but the only code file there is index.js, which is not really readable.