I'm writing an Angular2 app, and in it I'm using an external NPM package that has its own typings file. The problem is that the typings file is outdated - there are functions in the package that are available, but aren't declared in the typings file.
So I want to figure out:
- How to define my own typings file and get it recognized by Angular2
- How to extend an existing interface typing with new members
- How to write the typing in the correct way
I've tried Googling, but couldn't figure out an answer to any of those 3 questions. I mean I created a .d.ts file, but I don't know how to get Angular2 to recognize it, and also I don't know the correct syntax.
declare namespace ContentfulClientAPI {
export interface ContentfulClientApi {
parseEntries(data: any): any;
}
}
I'm specifically trying to extend ContenfulClientAPI defined here: