...
const _lib = await prepare(opts, {
test_str_async: { parameters: [], result: "pointer", nonblocking: true },
test_u32_async: { parameters: [], result: "u32", nonblocking: true },
test_void_async: { parameters: [], result: "void", nonblocking: true },
})
export function test_str_async() {
let rawResult = _lib.symbols.test_str_async()
const result = rawResult.then(readPointer)
return result.then(decode)
}
export function test_u32_async() {
let rawResult = _lib.symbols.test_u32_async()
const result = rawResult
return result
}
export function test_void_async() {
let rawResult = _lib.symbols.test_void_async()
const result = rawResult
return result
}
Some issues:
Function type declarations are missing and inferred as any, for test_str_async I would expect a return type of Promise<string> or the function to be marked as async function ...
test_u32_async & test_void_async are not resolving the promise result like test_str_async - there's no indication in the function declaration it returns a promise
Using
deno_bindgen==0.7.0
I'm facing some issues withnon_blocking
/async
codegen.Given the following defs:
Generates the following TS:
Some issues:
any
, fortest_str_async
I would expect a return type ofPromise<string>
or the function to be marked asasync function ...
test_u32_async
&test_void_async
are not resolving the promise result liketest_str_async
- there's no indication in the function declaration it returns a promise