mirror of
https://github.com/rustwasm/wasm-bindgen.git
synced 2025-01-07 13:43:03 +03:00
Improving the CHANGELOG and docs (#2027)
This commit is contained in:
parent
5a752e5b84
commit
57f8ed2e1e
@ -22,7 +22,7 @@ Released 2020-03-03.
|
|||||||
* Optional struct fields are now reflected idiomatically in TypeScript.
|
* Optional struct fields are now reflected idiomatically in TypeScript.
|
||||||
[#1990](https://github.com/rustwasm/wasm-bindgen/pull/1990)
|
[#1990](https://github.com/rustwasm/wasm-bindgen/pull/1990)
|
||||||
|
|
||||||
* Typed arrays in `js_sys` onw have `get_index` and `set_index` methods.
|
* Typed arrays in `js_sys` now have `get_index` and `set_index` methods.
|
||||||
[#2001](https://github.com/rustwasm/wasm-bindgen/pull/2001)
|
[#2001](https://github.com/rustwasm/wasm-bindgen/pull/2001)
|
||||||
|
|
||||||
* The `web_sys::Blob` type has been updated with `arrayBuffer` and `text`
|
* The `web_sys::Blob` type has been updated with `arrayBuffer` and `text`
|
||||||
@ -40,6 +40,12 @@ Released 2020-03-03.
|
|||||||
`#[wasm_bindgen]` annotations instead of expanded code.
|
`#[wasm_bindgen]` annotations instead of expanded code.
|
||||||
[#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
|
[#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
|
||||||
|
|
||||||
|
* A new `typescript_type` attribute can be used to specify the TypeScript type
|
||||||
|
for an `extern` type. [#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
|
||||||
|
|
||||||
|
* It is now possible to use string values with `#[wasm_bindgen]` `enum`s.
|
||||||
|
[#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
|
||||||
|
|
||||||
* A new `skip_tyepscript` attribute is recognized to skip generating TypeScript
|
* A new `skip_tyepscript` attribute is recognized to skip generating TypeScript
|
||||||
bindings for a function or type.
|
bindings for a function or type.
|
||||||
[#2016](https://github.com/rustwasm/wasm-bindgen/pull/2016)
|
[#2016](https://github.com/rustwasm/wasm-bindgen/pull/2016)
|
||||||
|
@ -1,5 +1,25 @@
|
|||||||
use wasm_bindgen::prelude::*;
|
use wasm_bindgen::prelude::*;
|
||||||
|
|
||||||
|
#[wasm_bindgen]
|
||||||
|
pub enum NumberEnum {
|
||||||
|
Foo = 0,
|
||||||
|
Bar = 1,
|
||||||
|
Qux = 2,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen]
|
||||||
|
pub enum StringEnum {
|
||||||
|
Foo = "foo",
|
||||||
|
Bar = "bar",
|
||||||
|
Qux = "qux",
|
||||||
|
}
|
||||||
|
|
||||||
|
#[wasm_bindgen]
|
||||||
|
pub struct Struct {
|
||||||
|
pub number: NumberEnum,
|
||||||
|
pub string: StringEnum,
|
||||||
|
}
|
||||||
|
|
||||||
#[wasm_bindgen]
|
#[wasm_bindgen]
|
||||||
extern "C" {
|
extern "C" {
|
||||||
pub type SomeJsType;
|
pub type SomeJsType;
|
||||||
|
Loading…
Reference in New Issue
Block a user