We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I tried to instantiate with asc loader, lilke this:
instantiate
instantiate<{}>(wasm, { env: { abort: (msg: number, file: number, line: number, column: number) => { console.error("abort called at" + file + " " + line + ":" + column); } }, })
And It gives a following error:
error TS2411: Property 'env' of type '{ memory?: Memory | undefined; table?: Table | undefined; seed?: (() => number) | undefined; abort?(msg: number, file: number, line: number, column: number): void; trace?(msg: number, numArgs?: number | undefined, ...args: number[]): void; } | undefined' is not assignable to string index type 'Record<string, ImportValue>'.
I'm using assemblyscript@0.9.4-nightly.20200325.
assemblyscript@0.9.4-nightly.20200325
The error was gone when I tried this:
export interface WasmEnv { env?: { memory?: WebAssembly.Memory, table?: WebAssembly.Table, seed?: () => number, abort?(msg: number, file: number, line: number, column: number): void, trace?(msg: number, numArgs?: number, ...args: number[]): void }; } /** WebAssembly imports with two levels of nesting. */ export type Imports = WasmEnv & Record<string, Record<string, ImportValue>>;
instead of the existing type:
/** WebAssembly imports with two levels of nesting. */ export interface Imports extends Record<string, Record<string, ImportValue>> { env?: { memory?: WebAssembly.Memory, table?: WebAssembly.Table, seed?: () => number, abort?(msg: number, file: number, line: number, column: number): void, trace?(msg: number, numArgs?: number, ...args: number[]): void }; }
Yeah, so maybe the type definitions of the loader needs to be fixed.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
I tried to
instantiate
with asc loader, lilke this:And It gives a following error:
I'm using
assemblyscript@0.9.4-nightly.20200325
.The error was gone when I tried this:
instead of the existing type:
Yeah, so maybe the type definitions of the loader needs to be fixed.
The text was updated successfully, but these errors were encountered: