For node16 / nodenext support, this should append .js to the import statement.
So:
tsTypes: {} as import("./index.typegen").Typegen0,
should become:
tsTypes: {} as import("./index.typegen.js").Typegen0,
I believe this would be backwards compatible on non-node16 as well, so should be safe to change.