Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ts declaration file name for wasm import #2283

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crates/cli-support/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ impl Output {
}

if gen.typescript {
let ts_path = wasm_path.with_extension("d.ts");
let ts_path = wasm_path.with_extension("wasm.d.ts");
let ts = wasm2es6js::typescript(&self.module)?;
fs::write(&ts_path, ts)
.with_context(|| format!("failed to write `{}`", ts_path.display()))?;
Expand Down
2 changes: 1 addition & 1 deletion crates/typescript-tests/src/memory.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as wasm from '../pkg/typescript_tests_bg';
import * as wasm from '../pkg/typescript_tests_bg.wasm';

const memory: WebAssembly.Memory = wasm.memory;
2 changes: 1 addition & 1 deletion crates/typescript-tests/src/simple_fn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as wbg from '../pkg/typescript_tests';
import * as wasm from '../pkg/typescript_tests_bg';
import * as wasm from '../pkg/typescript_tests_bg.wasm';

const wbg_greet: (a: string) => void = wbg.greet;
const wasm_greet: (a: number, b: number) => void = wasm.greet;
Expand Down