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

Improving the CHANGELOG and docs #2027

Merged
merged 1 commit into from
Mar 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand All @@ -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)
Expand Down
20 changes: 20 additions & 0 deletions examples/guide-supported-types-examples/src/imported_types.rs
Original file line number Diff line number Diff line change
@@ -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;
Expand Down