I'm having trouble understanding declarations. If I only need to declare a portion of a module, is this the correct way to do it (disregarding the use of 'any')?
import { Method as JaysonMethod } from 'jayson/promise';
declare class JaysonMethod {
handler: any;
execute(server: any, requestParams: any, callback: any) : void;
}
If so, how can I make this declaration accessible in other modules that import Method? Do I have to always use the alias JaysonMethod when importing Method in a .d.ts file? How does TypeScript link declarations to the actual modules or their parts?
I am struggling to grasp these concepts and would appreciate a clear explanation.