With v2 using TS now, we should also generate and export type definitions for our npm package. This is a continuation of #2890.