=> any ? I : never type A2<T> = T extends (a1: any, a2: infer I, ...rest: any[]) => any ? I : never type MT<T> = (state: A1<T>) => A1<T> type MTPL<T> = (state: A1<T>, payload: A2<T>) => A1<T> type CR<T> = () => { type: string } type CRPL<T> = (payload: A2<T>) => { type: string; payload: A2<T> } type Mutation<T> = MT<T> | MTPL<T> // 入力型を制限する type Creator<T> = T extends MT<T> ? CR<T> : CRPL<T> // 出力型のアサーションに利用 推論マッピング型(redux-aggregate 抜粋)