Skip to content

BREAKING CHANGE: Flatten generated TypeScript definitions #1872

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

Merged
merged 1 commit into from
May 27, 2021
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
35 changes: 15 additions & 20 deletions src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,33 +605,28 @@ export class TSDBuilder extends ExportsWalker {
build(): string {
var sb = this.sb;
var isWasm64 = this.program.options.isWasm64;
sb.push("declare module ASModule {\n");
sb.push(" type i8 = number;\n");
sb.push(" type i16 = number;\n");
sb.push(" type i32 = number;\n");
sb.push(" type i64 = bigint;\n");
sb.push("type i8 = number;\n");
sb.push("type i16 = number;\n");
sb.push("type i32 = number;\n");
sb.push("type i64 = bigint;\n");
if (isWasm64) {
sb.push(" type isize = bigint;\n");
sb.push("type isize = bigint;\n");
} else {
sb.push(" type isize = number;\n");
sb.push("type isize = number;\n");
}
sb.push(" type u8 = number;\n");
sb.push(" type u16 = number;\n");
sb.push(" type u32 = number;\n");
sb.push(" type u64 = bigint;\n");
sb.push("type u8 = number;\n");
sb.push("type u16 = number;\n");
sb.push("type u32 = number;\n");
sb.push("type u64 = bigint;\n");
if (isWasm64) {
sb.push(" type usize = bigint;\n");
sb.push("type usize = bigint;\n");
} else {
sb.push(" type usize = number;\n");
sb.push("type usize = number;\n");
}
sb.push(" type f32 = number;\n");
sb.push(" type f64 = number;\n");
sb.push(" type bool = boolean | number;\n");
++this.indentLevel;
sb.push("type f32 = number;\n");
sb.push("type f64 = number;\n");
sb.push("type bool = boolean | number;\n");
this.walk();
--this.indentLevel;
sb.push("}\n");
sb.push("export default ASModule;\n");
return this.sb.join("");
}
}
Expand Down
4 changes: 0 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,6 @@ export * from "./program";
export * from "./resolver";
export * from "./tokenizer";
export * from "./types";
// TODO: When vTables are pulled, perhaps it would be better to extend an ASTWalker
export * from "./extra/ast";
import * as util from "./util/index";
export { util };

// TODO: compat with 0.9, remove with 0.10
export * from "./util/index";