Adds support for #[wasm_bindgen(typescript_custom_section)].

This commit is contained in:
Tim Ryan
2018-11-17 23:04:19 -05:00
parent fc0d6528fc
commit 90193eab51
7 changed files with 91 additions and 5 deletions

View File

@ -22,6 +22,8 @@ pub struct Program {
/// objects" in the sense that they represent a JS object with a particular
/// shape in JIT parlance.
pub dictionaries: Vec<Dictionary>,
/// custom typescript sections to be included in the definition file
pub typescript_custom_sections: Vec<String>,
}
/// A rust to js interface. Allows interaction with rust objects/functions

View File

@ -46,6 +46,7 @@ fn shared_program<'a>(prog: &'a ast::Program, intern: &'a Interner)
imports: prog.imports.iter()
.map(|a| shared_import(a, intern))
.collect::<Result<Vec<_>, _>>()?,
typescript_custom_sections: prog.typescript_custom_sections.iter().map(|x| -> &'a str { &x }).collect(),
// version: shared::version(),
// schema_version: shared::SCHEMA_VERSION.to_string(),
})