Improving the CHANGELOG and docs (#2027)

This commit is contained in:
Pauan 2020-03-04 05:53:18 +01:00 committed by GitHub
parent 5a752e5b84
commit 57f8ed2e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 27 additions and 1 deletions

View File

@ -22,7 +22,7 @@ Released 2020-03-03.
* Optional struct fields are now reflected idiomatically in TypeScript.
[#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)
* 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.
[#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
bindings for a function or type.
[#2016](https://github.com/rustwasm/wasm-bindgen/pull/2016)

View File

@ -1,5 +1,25 @@
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]
extern "C" {
pub type SomeJsType;