Skip to content
Merged
Prev Previous commit
Next Next commit
Export DitheringAlgorithm type from Astro package
  • Loading branch information
delucis committed Dec 17, 2025
commit 45a9df64cba82f3cda0cfaf79f14673ebaf7f0ac
9 changes: 9 additions & 0 deletions .changeset/goofy-trains-joke.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
"@sweetcorn/astro": minor
---

Exports a type to help with typing code that interfaces with the `dither` prop:

```ts
import type { DitheringAlgorithm } from '@astrojs/sweetcorn`;
```
2 changes: 2 additions & 0 deletions packages/astro/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
import type { AstroIntegration } from 'astro';
import type { SweetcornImageConfig } from './types';

export type DitheringAlgorithm = Exclude<Astro.CustomImageProps['dither'], false | undefined>;

export default function sweetcornAstro<T extends string = never, D extends string = never>(
config: SweetcornImageConfig<T, D> = {}
) {
Expand Down