import { Sharp } from 'sharp' ; export const METADATA = Symbol ( 'image metadata' ) ; declare module 'sharp' { interface Sharp { [ METADATA ] : Record < string , any > ; } } export function setMetadata ( image , key , value ) { image [ METADATA ] && ( image [ METADATA ] [ key ] = value ) ; } export function getMetadata ( image , key ) { return image [ METADATA ] ?. [ key ] ; }