The current export of the type definition in index.d.ts looks like this:
export default function exif(buffer: Buffer): Exif;
However, the current implementation in index.js does not export any default. The type definition should actually look like this (similar to the old type definitions):
declare function exif(buffer: Buffer): Exif;
export = exif;
or you need to adapt the exports in index.js appropriately.
When I import the library using import exifReader from 'exif-reader'; I will get following runtime error:
(0 , exif_reader_1.default) is not a function
It only works when I import and use it the following way:
import * as exifReader from 'exif-reader';
const metadata = await sharp(file).metadata();
// @ts-ignore
const exif = exifReader(metadata.exif);
(I cannot set "esModuleInterop": true in tsconfig due to some other library.)
The current export of the type definition in
index.d.ts
looks like this:However, the current implementation in
index.js
does not export any default. The type definition should actually look like this (similar to the old type definitions):or you need to adapt the exports in
index.js
appropriately.When I import the library using
import exifReader from 'exif-reader';
I will get following runtime error:It only works when I import and use it the following way:
(I cannot set
"esModuleInterop": true
in tsconfig due to some other library.)