update typescript check command
so that it doesn't complain about undefined web apismaster
parent
19f628ec50
commit
3f64ef1424
|
@ -22,20 +22,21 @@ and send it to your friends :)
|
||||||
note, that the api is not yet complete,
|
note, that the api is not yet complete,
|
||||||
this is just a, maybe already useful, proof-of-concept for now.
|
this is just a, maybe already useful, proof-of-concept for now.
|
||||||
|
|
||||||
|
|
||||||
## use type-checking and completion
|
## use type-checking and completion
|
||||||
|
|
||||||
If you are using vscode you can have autocompletion and type-checking even without using typescript.
|
If you are using vscode you can have autocompletion and type-checking even without using typescript.
|
||||||
|
|
||||||
just add these two lines to your javascript source files:
|
just add these two lines to your javascript source files:
|
||||||
|
|
||||||
```js
|
```js
|
||||||
//@ts-check
|
//@ts-check
|
||||||
/** @typedef {import('./webxdc').WEBxDC} WEBxDC */
|
/** @typedef {import('./webxdc').WEBxDC} WEBxDC */
|
||||||
```
|
```
|
||||||
|
|
||||||
Without vscode you need to install typescript and then run the check manually.
|
Without vscode you need to install typescript and then run the check manually.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
npm -g typescript
|
npm -g typescript
|
||||||
tsc --noEmit --allowJs webxdc.js # to check if types and simulator are in sync
|
tsc --noEmit --allowJs --lib es2015,dom webxdc.js # to check if types and simulator are in sync
|
||||||
tsc --noEmit --allowJs your_js_file.js
|
tsc --noEmit --allowJs --lib es2015,dom your_js_file.js
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue