From 730ef1926ed6b343b85ae5f2e75bf92db9fe4af7 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Wed, 20 Dec 2017 08:25:45 -0800 Subject: [PATCH] Enable the `--declaration` tsc argument --- crates/test-support/src/lib.rs | 1 + crates/wasm-bindgen-cli-support/src/ts.rs | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/test-support/src/lib.rs b/crates/test-support/src/lib.rs index be3831a4..1e7b82b6 100644 --- a/crates/test-support/src/lib.rs +++ b/crates/test-support/src/lib.rs @@ -168,6 +168,7 @@ impl Project { .arg("--noUnusedLocals") .arg("--noUnusedParameters") .arg("--noImplicitReturns") + .arg("--declaration") .arg("--lib") .arg("es6"); run(&mut cmd, "node"); diff --git a/crates/wasm-bindgen-cli-support/src/ts.rs b/crates/wasm-bindgen-cli-support/src/ts.rs index 6a296b35..a55baef2 100644 --- a/crates/wasm-bindgen-cli-support/src/ts.rs +++ b/crates/wasm-bindgen-cli-support/src/ts.rs @@ -370,7 +370,7 @@ impl Js { } if extra_exports_interface.len() == 0 { - extra_exports_interface.push_str("interface ExtraExports {\n"); + extra_exports_interface.push_str("export interface ExtraExports {\n"); exports_interface.push_str("extra: ExtraExports;\n"); exports.push_str("extra: {\n"); } @@ -417,7 +417,7 @@ impl Js { } if extra_imports_interface.len() == 0 { - extra_imports_interface.push_str("interface ExtraImports {\n"); + extra_imports_interface.push_str("export interface ExtraImports {\n"); imports_interface.push_str("env: ExtraImports;\n"); } imports_object.push_str(import);