aapoalas / denonomicon

The Dark Arts of Deno Foreign Function Interface Programming
MIT License
27 stars 0 forks source link

Add corresponding types for JS-FFI #7

Closed vixalien closed 1 year ago

vixalien commented 1 year ago

For the https://github.com/aapoalas/denonomicon/blob/main/static/contents/types.md page, it should also show the corresponding type for javascript. for example:

FFI Javascript
bool boolean

the thing is, as a web developer I'm extremely confused whether the i64 is a number, or it must be provided as a BigInt.

I believe based on the limits of JS' Number (MAX_SIZE, MAX_INT_SIZE) etc, one should be able to figure out if an int64 is assignable to a JS Number or if it requires a BigInt.

aapoalas commented 1 year ago

Hey, thank you for the feedback! This data is available in the Deno Manual https://deno.land/manual@v1.36.1/runtime/ffi_api#supported-types but I also added it to Denonomicon now.