It's possible to set up redirection in Next.js by configuring it like this:
module.exports = {
async redirects() {
return [
{
source: '/about',
destination: '/',
permanent: true,
},
]
},
}
You can dynamically define the redirect objects as shown below:
{
source: '/about',
destination: '/',
permanent: true,
}
For instance:
const myRedirect: WhatTypeGoesHere = {source: '/about', dest...}
What is the TypeScript type of the object above? If it exists, how did you find it? I searched extensively but couldn't locate it without going through the entire Next.js repo. If the answer is "There is no type for this", then is it common for Next.js built-ins to lack types?
I understand how to create my own interface/type for this, just curious about the default options.