Skip to content

Commit

Permalink
fix: return emscripten class declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
isaac-mason committed Feb 12, 2023
1 parent ff89ac3 commit bfa7f69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/eighty-bugs-wait.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"webidl-ts": patch
---

fix: return emscripten class declaration
5 changes: 3 additions & 2 deletions packages/webidl-ts/src/convert-idl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,13 @@ function convertInterface(
}

if (options?.emscripten) {
ts.factory.createClassDeclaration(
return ts.factory.createClassDeclaration(
undefined,
[],
ts.factory.createIdentifier(idl.name),
undefined,
!inheritance.length ? undefined : [ts.factory.createHeritageClause(ts.SyntaxKind.ExtendsKeyword, inheritance)],
members as ts.ClassElement[],
members as any, // TODO: fix hack - using ts.TypeElement[] instead of ts.ClassElement[]
)
}

Expand Down

0 comments on commit bfa7f69

Please sign in to comment.