Refactor dispatch handling (#2452)

Promise id is now created in core and passed back to JS.
This commit is contained in:
andy finch 2019-06-13 23:43:54 -04:00 committed by Ryan Dahl
parent fdd2eb5383
commit dc60fe9f30
18 changed files with 667 additions and 709 deletions

View file

@ -12,14 +12,13 @@ interface EvalErrorInfo {
thrown: any;
}
declare interface MessageCallback {
(msg: Uint8Array): void;
}
declare type MessageCallbackInternal = (msg: Uint8Array) => void;
declare interface DenoCore {
recv(cb: MessageCallback): void;
recv(cb: MessageCallbackInternal): void;
send(
cmdId: number,
control: null | ArrayBufferView,
data?: ArrayBufferView
): null | Uint8Array;