mirror of
https://github.com/denoland/deno.git
synced 2025-08-01 09:32:28 +00:00
Prevent circular imports in ts code (#576)
This commit is contained in:
parent
3bcf7e271f
commit
84c38f34ee
12 changed files with 42 additions and 26 deletions
18
js/libdeno.ts
Normal file
18
js/libdeno.ts
Normal file
|
@ -0,0 +1,18 @@
|
|||
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;
|
Loading…
Add table
Add a link
Reference in a new issue