File tree 2 files changed +27
-1
lines changed
examples/guide-supported-types-examples/src
2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ Released 2020-03-03.
22
22
* Optional struct fields are now reflected idiomatically in TypeScript.
23
23
[ #1990 ] ( https://github.com/rustwasm/wasm-bindgen/pull/1990 )
24
24
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.
26
26
[ #2001 ] ( https://github.com/rustwasm/wasm-bindgen/pull/2001 )
27
27
28
28
* The ` web_sys::Blob ` type has been updated with ` arrayBuffer ` and ` text `
@@ -40,6 +40,12 @@ Released 2020-03-03.
40
40
` #[wasm_bindgen] ` annotations instead of expanded code.
41
41
[ #2012 ] ( https://github.com/rustwasm/wasm-bindgen/pull/2012 )
42
42
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
+
43
49
* A new ` skip_tyepscript ` attribute is recognized to skip generating TypeScript
44
50
bindings for a function or type.
45
51
[ #2016 ] ( https://github.com/rustwasm/wasm-bindgen/pull/2016 )
Original file line number Diff line number Diff line change 1
1
use wasm_bindgen:: prelude:: * ;
2
2
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
+
3
23
#[ wasm_bindgen]
4
24
extern "C" {
5
25
pub type SomeJsType ;
You can’t perform that action at this time.
0 commit comments