wasm-bindgen/crates
Alex Crichton d6e48195b3 Implement support for WebIDL dictionaries
This commit adds support for generating bindings for dictionaries defined in
WebIDL. Dictionaries are associative arrays which are simply objects in JS with
named keys and some values. In Rust given a dictionary like:

    dictionary Foo {
        long field;
    };

we'll generate a struct like:

    pub struct Foo {
        obj: js_sys::Object,
    }

    impl Foo {
        pub fn new() -> Foo { /* make a blank object */ }

        pub fn field(&mut self, val: i32) -> &mut Self {
            // set the field using `js_sys::Reflect`
        }
    }

    // plus a bunch of AsRef, From, and wasm abi impls

At the same time this adds support for partial dictionaries and dictionary
inheritance. All dictionary fields are optional by default and hence only have
builder-style setters, but dictionaries can also have required fields. Required
fields are exposed as arguments to the `new` constructor.

Closes #241
2018-08-15 17:08:27 -07:00
..
backend Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
cli Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
cli-support Use raw string in paths in webidl-tests generated code 2018-08-14 19:11:58 -04:00
futures futures: Add metadata to Cargo.toml 2018-08-13 14:35:35 -07:00
js-sys Merge pull request #708 from sendilkumarn/extends-arr 2018-08-15 23:45:04 +02:00
macro Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
macro-support Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
shared Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
test Remove warning, was fixed with the 0.2.16 release 2018-08-14 10:02:30 +02:00
test-macro Bump to version 0.2.16 2018-08-13 14:27:10 -07:00
typescript Fix compile on latest nightly (#489) 2018-07-17 09:11:30 -05:00
web-sys web-sys: Remove a few more interfaces from gecko's test suite 2018-08-15 14:34:59 -07:00
webidl Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00
webidl-tests Implement support for WebIDL dictionaries 2018-08-15 17:08:27 -07:00