Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readonly properties #57

Open
0xNF opened this issue Dec 16, 2024 · 0 comments
Open

Readonly properties #57

0xNF opened this issue Dec 16, 2024 · 0 comments

Comments

@0xNF
Copy link

0xNF commented Dec 16, 2024

wasm_bindgen has the #[wasm_bindgen(readonly)] annotation for fields which makes the output field readonly in the .d.ts file. Can this be done with tsify?

#[wasm_bindgen]
pub struct Point {
 #[wasm_bindgen(readonly)
    x: i32,
    y: i32,
}
export interface Point {
  readonly x: number;
  y: number;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant