1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

use tsc for type checking

This commit is contained in:
Ryan Dahl 2018-05-14 01:19:23 -04:00
parent be7828684b
commit bfb3cd7a5c
3 changed files with 9 additions and 3 deletions

View file

@ -14,6 +14,7 @@ msg.pb.d.ts: msg.pb.js node_modules
./node_modules/.bin/pbts -o msg.pb.d.ts msg.pb.js ./node_modules/.bin/pbts -o msg.pb.d.ts msg.pb.js
dist/main.js: main.ts msg.pb.js msg.pb.d.ts node_modules dist/main.js: main.ts msg.pb.js msg.pb.d.ts node_modules
./node_modules/.bin/tsc --noEmit # Only for type checking.
./node_modules/.bin/parcel build --out-dir=dist/ --no-minify main.ts ./node_modules/.bin/parcel build --out-dir=dist/ --no-minify main.ts
node_modules: node_modules:

View file

@ -1,9 +1,8 @@
import * as ts from "typescript"; //import * as ts from "typescript";
import { main as pb } from "./msg.pb" import { main as pb } from "./msg.pb"
V8Worker2.recv((ab: ArrayBuffer) { V8Worker2.recv((ab: ArrayBuffer) => {
let msg = pb.Msg.decode(new Uint8Array(ab)); let msg = pb.Msg.decode(new Uint8Array(ab));
V8Worker2.print("Got array buffer", ab.byteLength);
V8Worker2.print("msg.argv", msg.argv); V8Worker2.print("msg.argv", msg.argv);
}); });

6
v8worker2.d.ts vendored Normal file
View file

@ -0,0 +1,6 @@
declare namespace V8Worker2 {
function print(...args: any[]): void;
type RecvCallback = (ab: ArrayBuffer) => void;
function recv(cb: RecvCallback): void;
function send(ab: ArrayBuffer): null | ArrayBuffer;
}