I'm using gulp to compile TS files to JS and for this code:
function Hello(): Promise<string> {
return new Promise(resolve => {
setTimeout(() => {
resolve('Hello, World!');
}, 3000);
});
}
The compile has this error:
error TS7006: Parameter 'resolve' implicitly has an 'any' type.
That means, I should use any type like this:
return new Promise((resolve: any) => {
But why I should use any in this case? when I'm using Promise<string> to define the Promise ?
dependencies:
"dependencies": {
"gulp": "^4.0.2",
"gulp-typescript": "^6.0.0-alpha.1",
"typescript": "^3.9.5"
}
Thanks