TypeScriptでPromise<A>のAの部分の型を取得する

UnwrapPromise というユーティリティを使えば取ることができる

type P = Promise<number>;
type R = UnwrapPromise<P>;  // number