mirror of
https://github.com/denoland/deno.git
synced 2024-10-29 08:58:01 -04:00
19 lines
477 B
TypeScript
19 lines
477 B
TypeScript
|
import { RawSourceMap } from "./types";
|
||
|
import { globalEval } from "./global-eval";
|
||
|
|
||
|
// The libdeno functions are moved so that users can't access them.
|
||
|
type MessageCallback = (msg: Uint8Array) => void;
|
||
|
interface Libdeno {
|
||
|
recv(cb: MessageCallback): void;
|
||
|
|
||
|
send(msg: ArrayBufferView): null | Uint8Array;
|
||
|
|
||
|
print(x: string): void;
|
||
|
|
||
|
mainSource: string;
|
||
|
mainSourceMap: RawSourceMap;
|
||
|
}
|
||
|
|
||
|
const window = globalEval("this");
|
||
|
export const libdeno = window.libdeno as Libdeno;
|