denoland / denoland/deno_bindgen
Support TypedArray types...
- Dominant language
- Rust
- Stars
- 320
- Forks
- 28
- PR merge metrics
- No merged PRs in 30d
Description
TypedArrays are very helpful in certain situations...
for example a `Vec` or a Box<[i32]> could be turned into an `Int32Array` which is very helpful
## Rust
```rs
#[deno_bindgen]
pub fn mouse_pos(this: usize)-> Box<[i32]> {
let this=unsafe { ..... };
let pos=this.mouse_position();
vec![pos.x,pos.y].into_boxed_slice()
}
```
## denoland
```ts
export function mouse_pos(self: number|bigint): Int32Array {
return lib.symbols.mouse_pos(self);
}
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by tracing how Rust return types such as Vec and Box<[i32]> are represented in the generated TypeScript bindings. Compare the Rust mouse_pos example with its Int32Array return type, then define the supported TypedArray mappings and verify that the generated denoland API exposes the expected type.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100