TypeScript

lang

interface IHoge<T = never> {
    f: (a: T) => Promise<void>
}
 
class Hoge implements IHoge<number> {
    async f(a /* require type annotation */) {}
}

2021-10-14
TypeScript 4.6で起こるタグ付きユニオンのさらなる進化