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. 
PNG


IHDRiCCPICC profile(}=H@_SZv(␡:Yq*BZu04$).kŪ "%/)=B4ktL%b&*^!A""3˘$:{zY9ԜH<& ޴
aVUs1.Hu76өy0XhcYԈSXY+WYuH`K BA%a#FN;\D.\%0r,
Z	/)_c|;N?Wz_3ZZ.[\'C6eWy)5>N4uewxwO{oiry]bKGD	pHYs+tIME
DwIDATxypU׹7}PDJ[HvJm8b]F\:TFEjԱ-uCb_h"` ,!='%jM|d|g
|>1\x/@ x/@ x/@ x/@ x/@ x/R8E7t6l4?ϟqƵk]{rg}w}W3fh׺;M6?Tnn+uپk2dF뮻N3fP;Ǐk̘1?,LVZZF9sh֬Y}뮻O|ꫯBxYkȐ!6m͛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