Skip to content

Type declaration for *.svg?url in Next.jsΒ #1012

@y-hsgw

Description

@y-hsgw

πŸ’¬ Questions and Help

declare module '*.svg?url' {
const content: any
export default content
}

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions