mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 20:38:55 +00:00
use tsc for type checking
This commit is contained in:
parent
be7828684b
commit
bfb3cd7a5c
1
Makefile
1
Makefile
@ -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
|
||||
|
||||
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:
|
||||
|
5
main.ts
5
main.ts
@ -1,9 +1,8 @@
|
||||
import * as ts from "typescript";
|
||||
//import * as ts from "typescript";
|
||||
import { main as pb } from "./msg.pb"
|
||||
|
||||
V8Worker2.recv((ab: ArrayBuffer) {
|
||||
V8Worker2.recv((ab: ArrayBuffer) => {
|
||||
let msg = pb.Msg.decode(new Uint8Array(ab));
|
||||
V8Worker2.print("Got array buffer", ab.byteLength);
|
||||
V8Worker2.print("msg.argv", msg.argv);
|
||||
});
|
||||
|
||||
|
6
v8worker2.d.ts
vendored
Normal file
6
v8worker2.d.ts
vendored
Normal 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;
|
||||
}
|
Loading…
Reference in New Issue
Block a user