Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't import internally from types in next-env.d.ts #34394

Merged
merged 4 commits into from Feb 19, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/next/client/image.tsx
Expand Up @@ -61,6 +61,13 @@ type OnLoadingComplete = (result: {

type ImgElementStyle = NonNullable<JSX.IntrinsicElements['img']['style']>

export interface StaticImageData {
src: string
height: number
width: number
blurDataURL?: string
}

interface StaticRequire {
default: StaticImageData
}
Expand Down
7 changes: 1 addition & 6 deletions packages/next/image-types/global.d.ts
@@ -1,12 +1,7 @@
// this file is conditionally added/removed to next-env.d.ts
// if the static image import handling is enabled

interface StaticImageData {
src: string
height: number
width: number
blurDataURL?: string
}
import type { StaticImageData } from '../dist/client/image'

declare module '*.png' {
const content: StaticImageData
Expand Down
2 changes: 1 addition & 1 deletion packages/next/tsconfig.json
Expand Up @@ -7,5 +7,5 @@
"moduleResolution": "node",
"jsx": "react"
},
"exclude": ["dist", "./*.d.ts"]
"exclude": ["dist", "./*.d.ts", "image-types/global.d.ts"]
}