In the discussion on #328 the consensus seems to be that people like type definitions. This moves toward generating types using jsdoc as suggested by @bollwyvl in that thread.

I don't have much Typescript experience so I would very much appreciate it if people could test them out. The types are available as CircleCI artifacts here:
https://3914-322074228-gh.circle-artifacts.com/0/root/repo/build/pyodide.d.ts

@bollwyvl said that

> types that aren't tested are probably worse than no types at all

If anyone could contribute tests, that would be very helpful (I don't know what they should look like). 

The main limitation I ran into with this approach is that Typescript supports Typescript types in jsdoc annotations but jsdoc does not. This means that if we want to automatically generate docs, we have to stick to the much more limited syntax that jsdoc supports. For example, `isPyProxy` should be typed `obj is PyProxy` but this approach does not allow that as far as I can tell. 
Some basic types. In the discussion on #328 the consensus seems to be that people like type definitions. This moves toward generating types using jsdoc as suggested by @bollwyvl in that thread.

I don't have much Typescript experience so I would very much appreciate it if people could test them out. The types are available as CircleCI artifacts here:
https://3914-322074228-gh.circle-artifacts.com/0/root/repo/build/pyodide.d.ts

@bollwyvl said that

> types that aren't tested are probably worse than no types at all

If anyone could contribute tests, that would be very helpful (I don't know what they should look like). 

The main limitation I ran into with this approach is that Typescript supports Typescript types in jsdoc annotations but jsdoc does not. This means that if we want to automatically generate docs, we have to stick to the much more limited syntax that jsdoc supports. For example, `isPyProxy` should be typed `obj is PyProxy` but this approach does not allow that as far as I can tell. 
diff --git a/imageio/core/findlib.py b/imageio/core/findlib.py
--- a/imageio/core/findlib.py
+++ b/imageio/core/findlib.py
@@ -7,7 +7,6 @@
 
 import os
 import sys
-import ctypes
 
 
 LOCALDIR = os.path.abspath(os.path.dirname(__file__))
@@ -95,6 +94,7 @@ def load_lib(exact_lib_names, lib_names, lib_dirs=None):
 
     Returns ``(ctypes_library, library_path)``
     """
+    import ctypes
 
     # Checks
     assert isinstance(exact_lib_names, list)

diff --git a/imageio/plugins/__init__.py b/imageio/plugins/__init__.py
index 7e26683..971f83e 100644
--- a/imageio/plugins/__init__.py
+++ b/imageio/plugins/__init__.py
@@ -84,8 +84,8 @@ from . import tifffile
 from . import pillow
 from . import grab
 
-from . import freeimage
-from . import freeimagemulti
+# from . import freeimage
+# from . import freeimagemulti
 
 from . import ffmpeg
 

diff --git a/imageio/core/findlib.py b/imageio/core/findlib.py
--- a/imageio/core/findlib.py
+++ b/imageio/core/findlib.py
@@ -7,7 +7,6 @@
 
 import os
 import sys
-import ctypes
 
 
 LOCALDIR = os.path.abspath(os.path.dirname(__file__))
@@ -95,6 +94,7 @@ def load_lib(exact_lib_names, lib_names, lib_dirs=None):
 
     Returns ``(ctypes_library, library_path)``
     """
+    import ctypes
 
     # Checks
     assert isinstance(exact_lib_names, list)

diff --git a/imageio/plugins/__init__.py b/imageio/plugins/__init__.py
index 7e26683..971f83e 100644
--- a/imageio/plugins/__init__.py
+++ b/imageio/plugins/__init__.py
@@ -84,8 +84,8 @@ from . import tifffile
 from . import pillow
 from . import grab
 
-from . import freeimage
-from . import freeimagemulti
+# from . import freeimage
+# from . import freeimagemulti
 
 from . import ffmpeg
 
