Skip to content

Commit 57f8ed2

Browse files
authored
Improving the CHANGELOG and docs (#2027)
1 parent 5a752e5 commit 57f8ed2

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

CHANGELOG.md

+7-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Released 2020-03-03.
2222
* Optional struct fields are now reflected idiomatically in TypeScript.
2323
[#1990](https://github.com/rustwasm/wasm-bindgen/pull/1990)
2424

25-
* Typed arrays in `js_sys` onw have `get_index` and `set_index` methods.
25+
* Typed arrays in `js_sys` now have `get_index` and `set_index` methods.
2626
[#2001](https://github.com/rustwasm/wasm-bindgen/pull/2001)
2727

2828
* The `web_sys::Blob` type has been updated with `arrayBuffer` and `text`
@@ -40,6 +40,12 @@ Released 2020-03-03.
4040
`#[wasm_bindgen]` annotations instead of expanded code.
4141
[#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
4242

43+
* A new `typescript_type` attribute can be used to specify the TypeScript type
44+
for an `extern` type. [#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
45+
46+
* It is now possible to use string values with `#[wasm_bindgen]` `enum`s.
47+
[#2012](https://github.com/rustwasm/wasm-bindgen/pull/2012)
48+
4349
* A new `skip_tyepscript` attribute is recognized to skip generating TypeScript
4450
bindings for a function or type.
4551
[#2016](https://github.com/rustwasm/wasm-bindgen/pull/2016)

examples/guide-supported-types-examples/src/imported_types.rs

+20
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
use wasm_bindgen::prelude::*;
22

3+
#[wasm_bindgen]
4+
pub enum NumberEnum {
5+
Foo = 0,
6+
Bar = 1,
7+
Qux = 2,
8+
}
9+
10+
#[wasm_bindgen]
11+
pub enum StringEnum {
12+
Foo = "foo",
13+
Bar = "bar",
14+
Qux = "qux",
15+
}
16+
17+
#[wasm_bindgen]
18+
pub struct Struct {
19+
pub number: NumberEnum,
20+
pub string: StringEnum,
21+
}
22+
323
#[wasm_bindgen]
424
extern "C" {
525
pub type SomeJsType;

0 commit comments

Comments
 (0)