Type declaration for `*.svg?url` in Next.js
Author: y-hsgwCreated Sep 9, 2025Updated Sep 24, 2025
Questions and Help
Would it be possible to declare this more strictly, for example using StaticImageData (or string | StaticImageData) instead of any?
declare module '*.svg?url' {
import { type StaticImageData } from 'next/image'
const content: string | StaticImageData
export default content
}I’d like to understand whether any is intentional, or if it would be acceptable to recommend a stricter type definition in the documentation.
Source: gregberge/svgr