Extend types from existing node modules library with a new types

80 Views Asked by At

I am using the openseadragon library with @types/openseadragon

the library has a Viewer object that I need to extend

now I have another library called openseadraonselection without types. I found a nice types file here:

https://github.com/alvaromartmart/types-openseadragonselection/blob/master/index.d.ts

the issue is when I added it to my custom types file, it overrides the openseadragon basic types

even if I declare something like that it will override the openseadragon object:

declare module 'openseadragon' {
}

basically, I need to add an object to the viewer object so I will be able to do the following:

viewer.selection({....})

the viewer is from types Openseadragon.Viewer and selection is the new type

0

There are 0 best solutions below