As per this other thead on the topic, next.js automatically generates a next-env.d.ts file, to ensure that the next.js types are picked up by the TypeScript compiler. The next-env.d.ts file looks like this:
/// <reference types="next" />
/// <reference types="next/types/global" />
Fine, but I couldn't find the TypeScript documentation for this - is there any, or is it an experimental feature? I'd like to manually create a similar file for another package that doesn't generate the types.