I can define as below
new Promise((resolve) => {
setTimeout(() => {
console.log('Promise Done');
}, 2000);
});
But according to the below promise.d.ts file, both resolve and reject are needed, right?
interface PromiseConstructor
new <T>(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason?: any) => void) => void): Promise<T>;