In my Angular2 application, I am facing an issue with an external NPM package that has an outdated typings file. This means there are functions within the package that are present but not declared in the typings file.
My main goals are:
- To create and utilize my own typings file that is recognized by Angular2
- To extend an existing interface typing with additional members
- To properly write the typing in the correct syntax
Despite searching online, I have been unable to find answers to these three questions. I attempted to create a .d.ts file, but I am unsure of how to make Angular2 recognize it and also unclear on the correct syntax to use.
declare namespace ContentfulClientAPI {
export interface ContentfulClientApi {
parseEntries(data: any): any;
}
}
Specifically, I am looking to extend the ContenfulClientAPI as defined here: