implement an api for allowing JS subclasses of C++ interfaces