These are chat archives for DefinitelyTyped/DefinitelyTyped

23rd
Aug 2016
Reis
@mreis1
Aug 23 2016 15:50

Hey guys, quick question.
I just installed a global definition module. In this case it's cordova.

//then
interface Cordova { /*....some other stuff*/  plugins:CordovaPlugins; }
interface CordovaPlugins = {}

declare var cordova: Cordova;
declare module 'cordova' {
    export = cordova;
}

my plugin exposes himself from cordova.plugins.{MyPlugin}
because {MyPlugin} is not defined on CordovaPlugins Interface typescript complains.

is there a best practice on how to handle this without compromising other plugins that also expose themselves from this property (cordova.plugins)

Reis
@mreis1
Aug 23 2016 16:25
Ok found the solution
After all merging interfaces it's possible :+1:
All I've to do is define the same interface with the same name and the compiler will handle it by it's own.