📅  最后修改于: 2022-03-11 14:48:13.039000             🧑  作者: Mango
function promiseOne() {
return Promise.resolve(1)
}
const promisedOne = promiseOne()
// note PromiseLike instead of Promise, this lets it work on any thenable
type ThenArg = T extends PromiseLike ? U : T
type PromiseOneThenArg = ThenArg // => number
// or
type PromiseOneThenArg2 = ThenArg> // => number