Commit 84effd8 1 parent 2688196 commit 84effd8 Copy full SHA for 84effd8
File tree 1 file changed +23
-13
lines changed
1 file changed +23
-13
lines changed Original file line number Diff line number Diff line change 1
- import type { AstroIntegration } from "astro" ;
1
+ import type { AstroIntegration , AstroIntegrationLogger } from "astro" ;
2
2
import { betterImageService } from "./config.js" ;
3
3
4
4
/**
@@ -8,16 +8,26 @@ import { betterImageService } from "./config.js";
8
8
*/
9
9
export const astroIntegration = (
10
10
config ?: Parameters < typeof betterImageService > [ 0 ] ,
11
- ) : AstroIntegration => ( {
12
- name : "astro-better-image-service" ,
13
- hooks : {
14
- "astro:config:setup" : ( { updateConfig, logger } ) => {
15
- updateConfig ( {
16
- image : {
17
- service : betterImageService ( config ) ,
18
- } ,
19
- } ) ;
20
- logger . info ( "Image service entrypoint set." ) ;
11
+ ) =>
12
+ // loose type for compatibility with other astro versions
13
+ ( {
14
+ name : "astro-better-image-service" ,
15
+ hooks : {
16
+ "astro:config:setup" : ( {
17
+ updateConfig,
18
+ logger,
19
+ } : {
20
+ updateConfig : ( config : {
21
+ image : { service : ReturnType < typeof betterImageService > } ;
22
+ } ) => unknown ;
23
+ logger : AstroIntegrationLogger ;
24
+ } ) => {
25
+ updateConfig ( {
26
+ image : {
27
+ service : betterImageService ( config ) ,
28
+ } ,
29
+ } ) ;
30
+ logger . info ( "Image service entrypoint set." ) ;
31
+ } ,
21
32
} ,
22
- } ,
23
- } ) ;
33
+ } ) as const satisfies AstroIntegration ;
You can’t perform that action at this time.
0 commit comments