vtk extension class implementation in typescript

I want to make a widget(extends vtkAbstractWidgetFactory) in typescript class.

But I don’t know how to implement this(I can’t extends vtk class).

Any examples for reference? or let me know how to make it.

(I already know vtk.js support type definition(by d.ts), but this useful only when I just use vtk class not implement vtk extension class.(am I right?))

Please consider the following documentation: Creating a new class in vtk.js | vtk.js

Thx for reply.
But there is no guide for make extended class using ‘class keyword’ in that page.
I want to know trick for converting vtk.js’s extend paradigm to typescript’s class extends paradigm.

Unfortunately, the vtk.js classes cannot be extended using ES6 classes. They are instead closure-based classes, not prototype-based ones, and thus require following Julien’s link above.

There was some effort a while back to wrap the vtk.js classes in ES6 classes. Depending on the overhead, revisiting that may pave the way to extending vtk.js classes with the extends keyword.

Oh, where can I find that effort?

That effort was not made public, and was more of a demonstration. IIRC it was re-defining the classes, using the original vtk.js objects internally as a delegate.

That’s so sad.

It seems difficult to reflect the inheritance hierarchy of vtk.js objects(excepting re-define all associated vtk.js objects).

I’m going to implement a class that extends vtk.js object in js, and make type definition file(d.ts) to use it in my app(written in typescript). → Is this the right way?

If there is a better way, please let me know in the comments at any time.

Yes, your approach is correct. You can see an example with vtkProp3D extending vtkProp, as well as the associated type definition.