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. 
This patch disables multiprocessing and pthread for blosc
diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx
index 3bfdc00..c6521b7 100644
--- a/numcodecs/blosc.pyx
+++ b/numcodecs/blosc.pyx
@@ -77,6 +77,8 @@ AUTOBLOCKS = 0
 # synchronization
 try:
     mutex = multiprocessing.Lock()
+except ModuleNotFoundError:
+    mutex = None
 except OSError:
     mutex = None
 
diff --git a/c-blosc/blosc/blosc.h b/c-blosc/blosc/blosc.h
index 40857d0..8a1e969 100644
--- a/c-blosc/blosc/blosc.h
+++ b/c-blosc/blosc/blosc.h
@@ -50,7 +50,7 @@ extern "C" {
   ((INT_MAX - BLOSC_MAX_TYPESIZE * sizeof(int32_t)) / 3)
 
 /* The maximum number of threads (for some static arrays) */
-#define BLOSC_MAX_THREADS 256
+#define BLOSC_MAX_THREADS 1
 
 /* Codes for shuffling (see blosc_compress) */
 #define BLOSC_NOSHUFFLE   0  /* no shuffle */

 diff --git a/c-blosc/blosc/blosc.c b/c-blosc/blosc/blosc.c
index a5a5bd5..2a7797c 100644
--- a/c-blosc/blosc/blosc.c
+++ b/c-blosc/blosc/blosc.c
@@ -2236,6 +2236,7 @@ void blosc_atfork_child(void) {
 
 void blosc_init(void)
 {
+  g_initlib = 1;
   /* Return if we are already initialized */
   if (g_initlib) return;
 



This patch disables multiprocessing and pthread for blosc
diff --git a/numcodecs/blosc.pyx b/numcodecs/blosc.pyx
index 3bfdc00..c6521b7 100644
--- a/numcodecs/blosc.pyx
+++ b/numcodecs/blosc.pyx
@@ -77,6 +77,8 @@ AUTOBLOCKS = 0
 # synchronization
 try:
     mutex = multiprocessing.Lock()
+except ModuleNotFoundError:
+    mutex = None
 except OSError:
     mutex = None
 
diff --git a/c-blosc/blosc/blosc.h b/c-blosc/blosc/blosc.h
index 40857d0..8a1e969 100644
--- a/c-blosc/blosc/blosc.h
+++ b/c-blosc/blosc/blosc.h
@@ -50,7 +50,7 @@ extern "C" {
   ((INT_MAX - BLOSC_MAX_TYPESIZE * sizeof(int32_t)) / 3)
 
 /* The maximum number of threads (for some static arrays) */
-#define BLOSC_MAX_THREADS 256
+#define BLOSC_MAX_THREADS 1
 
 /* Codes for shuffling (see blosc_compress) */
 #define BLOSC_NOSHUFFLE   0  /* no shuffle */

 diff --git a/c-blosc/blosc/blosc.c b/c-blosc/blosc/blosc.c
index a5a5bd5..2a7797c 100644
--- a/c-blosc/blosc/blosc.c
+++ b/c-blosc/blosc/blosc.c
@@ -2236,6 +2236,7 @@ void blosc_atfork_child(void) {
 
 void blosc_init(void)
 {
+  g_initlib = 1;
   /* Return if we are already initialized */
   if (g_initlib) return;
 


