Say you have the following module:
const SomeModule = () => {
const add: number = (a: number, b: number) => a + b;
const subtract: number = (a: number, b: number) => a - b;
return {
add,
subtract
}
}
You can then use the follow module as a type by doing the following:
interface Types {
someModule : ReturnType<typeof SomeModule>
}