Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import type { ImageProvider } from './types'

declare module './types' {
interface ProviderDefaults {
provider: 'ipx'
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe this is a correct fix - this file is only used when developing nuxt/image and is not included in the dist files... it won't make any difference to the experience of an end user

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct that this file isn't included in the dist, so it wouldn't help end users.

interface ConfiguredImageProviders {
ipx: ImageProviders['ipx']
}
Expand Down
4 changes: 0 additions & 4 deletions test/nuxt/use-image.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,17 +29,13 @@ describe('image helper', () => {
provider: 'ipx',
modifiers: {
sharpen: 0.75,
// @ts-expect-error this is not a valid modifier for ipx
alkj: false,
Comment on lines -32 to -33
Copy link
Copy Markdown
Member

@danielroe danielroe Dec 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a correct test to make sure that modifiers are typed correctly (in other words, you can't pass a nonsense modifier to them)

we wouldn't want to get rid of this test

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've reverted the @ts-expect-error removal. I now understand this is a valid test to ensure invalid modifiers are caught by the type system.

},
})

// defaults to ipx as default provider
useImage().getImage('/test.png', {
modifiers: {
sharpen: 0.75,
// @ts-expect-error this is not a valid modifier for ipx
alkj: false,
},
})
})
Expand Down
Loading