In my Next.js web project, my types/global.d.ts starts like this:
declare module 'react-zeroconfig-components'
interface Product {
...
}
I’m using openapi-typescript to generate types from my Swagger OpenAPI definitions, but when I import my generated swagger.ts file:
import { definitions } from 'types/swagger'
declare module 'react-zeroconfig-components'
interface Product {
...
}
…none of the other types/interfaces in global.d.ts work any longer:
Type error: Cannot find name 'Product'.
and also the declare module stops working:
Could not find a declaration file for module 'react-zeroconfig-components'
What is wrong here?