Add TS type for init fn

This commit is contained in:
Caio
2019-04-01 19:45:53 -03:00
parent c5f18b6099
commit b6317e3f24
4 changed files with 59 additions and 8 deletions

View File

@ -11,6 +11,13 @@ cargo run -p wasm-bindgen-cli --bin wasm-bindgen -- \
--out-dir pkg \
--typescript
mkdir pkg/web
cargo run -p wasm-bindgen-cli --bin wasm-bindgen -- \
../../target/wasm32-unknown-unknown/debug/typescript_tests.wasm \
--out-dir pkg/web \
--target web \
--typescript
if [ ! -d node_modules ]; then
npm install
fi

View File

@ -0,0 +1,3 @@
import * as wbg from '../../pkg/web/typescript_tests';
const init: Promise<any> = wbg.init('.');

View File

@ -9,6 +9,6 @@
"baseUrl": "."
},
"include": [
"src/*.ts"
"src/**/*.ts"
]
}