Skip to content

Commit f7e94d9

Browse files
authored
Merge pull request #41 from aminya/declaration
fix: adding types for the API
2 parents a21acd6 + f0c39ba commit f7e94d9

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

lib/as-bind.d.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { instantiate, instantiateSync } from "@assemblyscript/loader";
2+
3+
export interface AsBind {
4+
// General asbind versionn
5+
version: number;
6+
7+
// Our APIs
8+
instantiate: typeof instantiate;
9+
10+
instantiateSync: typeof instantiateSync;
11+
}
12+
13+
export type AsBindLib = AsBind;

package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"lib:wasm:build:debug": "asc lib/assembly/as-bind.ts -b dist/as-bind.debug.wasm -t dist/as-bind.debug.wat --sourceMap --debug --runtime full",
1919
"lib:wasm:build:optimized": "asc lib/assembly/as-bind.ts -b dist/as-bind.wasm --sourceMap dist/as-bind.wasm.map -t dist/as-bind.wat --runtime full -O3",
2020
"lib:wasm:build:cp": "cpy 'lib/assembly/**/*' dist",
21-
"lib:js:build": "rollup -c --environment LIB,PROD",
21+
"lib:js:build": "rollup -c --environment LIB,PROD && cpy 'lib/as-bind.d.ts' dist",
2222
"lib:js:build:dev": "rollup -c --environment LIB,DEV",
2323
"lib:test:build": "asc lib/assembly/as-bind.ts test/assembly/test.ts -b test/assembly/test.wasm --runtime full --debug",
2424
"lib:deploy": "npm run build && np",
@@ -46,6 +46,7 @@
4646
"@babel/plugin-proposal-export-default-from": "^7.5.2",
4747
"@babel/plugin-proposal-object-rest-spread": "^7.5.5",
4848
"@babel/plugin-transform-react-jsx": "^7.3.0",
49+
"@assemblyscript/loader": "latest",
4950
"assemblyscript": "^0.14.4",
5051
"babel-preset-es2015-rollup": "^3.0.0",
5152
"chokidar-cli": "^2.0.0",

0 commit comments

Comments
 (0)