In my current angular 2 cli project, I am faced with the task of defining a plugin that does not have its own type definition. This plugin relies on a main library that already has its own typed definitions and is functioning properly.
I have two files; the first one contains:
LIBRARY TYPES FILE A
export class A extends B {
constructor(...);
methodX(): void;
}
Now, I need to add a new method for my plugin so that my class looks like this:
export class A extends B {
constructor(...);
methodX(): void;
methodY(): void;
}
The challenge lies in adding this new method in a separate file without creating a new class altogether.
If I try putting it in either of these files:
PLUGIN TYPES FILE B
export class A extends B {
constructor(...);
methodX(): void;
}
or
PLUGIN TYPES FILE B
export class A extends B {
constructor(...);
methodX(): void;
methodY(): void;
}
It doesn't seem to work. Can anyone provide guidance on how I can successfully overwrite or extend a class with a new method?
Thank you.