TS7010

error TS7010: ‘sum‘, which lacks return-type annotation, implicitly has an ‘any‘ return type.

Broken Code ❌

1
2
3
namespace MyModule {
export function sum(a: number, b: number);
}

Fixed Code ✔️

You have to add a return-type annotation and preferably a function implementation:

1
2
3
4
5
namespace MyModule {
export function sum(a: number, b: number): number {
return a + b;
}
}