From cd591d20513f1b4b9015c4281fb4f11cf7c9f3e1 Mon Sep 17 00:00:00 2001 From: Wink Saville Date: Sat, 1 Apr 2017 10:16:44 -0700 Subject: [PATCH] As an experiment change WebAssembly.Module to a class Close but it's not compiling I get the following error: ``` $ yarn test yarn test v0.21.3 $ tsc -p test/tsconfig.json test/wasm.ts(136,3): error TS2322: Type 'ResultObject' is not assignable to type 'Instance'. Property 'exports' is missing in type 'ResultObject'. error Command failed with exit code 2. ``` --- webassembly.d.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/webassembly.d.ts b/webassembly.d.ts index 800da92b..165cee99 100644 --- a/webassembly.d.ts +++ b/webassembly.d.ts @@ -6,25 +6,20 @@ declare namespace WebAssembly { /** * WebAssembly.Module **/ - interface Module { - readonly [Symbol.toStringTag]: "Module"; - } + class Module { + constructor (bufferSource: ArrayBuffer | Uint8Array); - interface ModuleConstructor { - readonly prototype: Module; - new(bufferSource: ArrayBuffer | Uint8Array): Module; - customSections(module: Module, sectionName: string): ArrayBuffer[]; - exports(module: Module): { + static customSections(module: Module, sectionName: string): ArrayBuffer[]; + static exports(module: Module): { name: string; kind: string; }[]; - imports(module: Module): { + static imports(module: Module): { module: string; name: string; kind: string; }[]; } - const Module: ModuleConstructor; /** * WebAssembly.Instance -- 2.30.2