0

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.

1 Answer 1

1

I found it. It's called "Triple-Slash Directives":

Triple-slash directives are single-line comments containing a single XML tag. The contents of the comment are used as compiler directives.

Read more about this in the docs.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.