@@ -28,7 +28,8 @@ Options:
28
28
--browser Generate output that only works in a browser
29
29
--no-modules Generate output that only works in a browser (without modules)
30
30
--no-modules-global VAR Name of the global variable to initialize
31
- --typescript Output a TypeScript definition file
31
+ --typescript Output a TypeScript definition file (on by default)
32
+ --no-typescript Don't emit a *.d.ts file
32
33
--debug Include otherwise-extraneous debug checks in output
33
34
--no-demangle Don't demangle Rust symbol names
34
35
-V --version Print the version number of wasm-bindgen
@@ -40,6 +41,7 @@ struct Args {
40
41
flag_browser : bool ,
41
42
flag_no_modules : bool ,
42
43
flag_typescript : bool ,
44
+ flag_no_typescript : bool ,
43
45
flag_out_dir : Option < PathBuf > ,
44
46
flag_debug : bool ,
45
47
flag_version : bool ,
@@ -74,14 +76,16 @@ fn rmain(args: &Args) -> Result<(), Error> {
74
76
None => bail ! ( "input file expected" ) ,
75
77
} ;
76
78
79
+ let typescript = args. flag_typescript || !args. flag_no_typescript ;
80
+
77
81
let mut b = Bindgen :: new ( ) ;
78
82
b. input_path ( input)
79
83
. nodejs ( args. flag_nodejs )
80
84
. browser ( args. flag_browser )
81
85
. no_modules ( args. flag_no_modules )
82
86
. debug ( args. flag_debug )
83
87
. demangle ( !args. flag_no_demangle )
84
- . typescript ( args . flag_typescript ) ;
88
+ . typescript ( typescript ) ;
85
89
if let Some ( ref name) = args. flag_no_modules_global {
86
90
b. no_modules_global ( name) ;
87
91
}
0 commit comments