📅  最后修改于: 2022-03-11 14:55:13.433000             🧑  作者: 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