long story short, I have a npm module which exports a function and other function attached to exported function:
// @mycompany/module
...
const someTool = (options) => {
// do some cool stuff
};
someTool.canUseFeature1 = () => {
return canUseSomeFeature1();
};
module.exports = someTool;
In my client application, I need to declare type for exported function someTool
and for attached function someTool.canUseFeature1
.
I'm declaring the type in a file Global.d.ts:
declare module '@mycompany/module' {
export default function (options: any): any;
}
The question, how to declare someTool.canUseFeature1
in similar manner?
The closest answer I found is here, but I could not adapt it to external module.