Create a new deferrable promise which supports resolving it outside of the context of the promise.
Optionalpromise: Promise<T>Optionally a promise to wrap.
Private#innerPrivate#isPrivate#rejectPrivate#resolveBind the current promise to another promise, resolving or rejecting the current promise when the other promise is resolved or rejected.
The other promise to bind to.
The current promise.
Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.
OptionalonFinally: () => voidA Promise for the completion of the callback.
Deferred promise implementation.