An object that can be used to emulate classes and a class hierarchy in JavaScript. This works even for old
browsers that do no support the native class syntax yet. Note however, that this should be mostly compatible
with the new class syntax of JavaScript, so consider creating your own widgets as a class:
Note for TypeScript users: Normally you should just write a widget as a class that extends from the appropriate
base class. If you must use this method you will need to specify the type parameters explicitly. The best way to
do so is by defining the interfaces for the classes separately:
An object that can be used to emulate classes and a class hierarchy in JavaScript. This works even for old browsers that do no support the native
class
syntax yet. Note however, that this should be mostly compatible with the newclass
syntax of JavaScript, so consider creating your own widgets as a class:Note for TypeScript users: Normally you should just write a widget as a class that extends from the appropriate base class. If you must use this method you will need to specify the type parameters explicitly. The best way to do so is by defining the interfaces for the classes separately:
Now you can use it normally: