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.
We know you will probably just skip ahead, but you'll soon find yourself here with us telling you, "I told ya so!" :)