I think most of this stuff is now depracted. Looks like C++ is the only realistic way to go for implementing WebIDL bindings in Gecko. That's unfortuante, because if you are a JS dev, learning C++ can be challenging (though worth while! it's a fun language.)
This provides a gentle introduction to implementing a WebIDL interface in JavaScript. Once you are done, you can refer to the MDN Wiki, to add more advanced things.
We would encourage you to first build a simple prototype version of your API in JS. Going through the process of creating a WebIDL is fairly straight forward, but if you screw it up you will need to recreate a whole bunch of files, etc. As such, it's much easier to make sure you have your API in a good state before attempting the steps below.