francoischalifour / medium-zoom

🔎🖼 A JavaScript library for zooming images like Medium
https://medium-zoom.francoischalifour.com
MIT License
3.58k stars 162 forks source link

Export mediumZoom correctly as ESM style #82

Closed hmsk closed 5 years ago

hmsk commented 5 years ago

Summary

This PR fixes this compile error on TypeScript 3.x.

image

The actual exporting of mediumZoom is taking ESM way since last August. https://github.com/francoischalifour/medium-zoom/blob/master/src/index.js#L4

TS expects the same way for typedefs.

export = Something on TS

https://www.typescriptlang.org/docs/handbook/modules.html

When exporting a module using export =, TypeScript-specific import module = require("module") must be used to import the module.