diff options
author | Bert Belder <bertbelder@gmail.com> | 2018-06-14 14:31:31 +0200 |
---|---|---|
committer | Bert Belder <bertbelder@gmail.com> | 2018-06-14 17:24:00 +0200 |
commit | 4f6c8ba54bca4f62fbe4e7dba2fc3c4a7c2f1bb2 (patch) | |
tree | 32c9b75a1bc217406952ca1b5f89f57968f37e5a /deno2/js/deno.d.ts | |
parent | fb98474239a7ffb145e529dbcf069866b2e9296e (diff) |
deno2: add global `deno` namespace
Diffstat (limited to 'deno2/js/deno.d.ts')
-rw-r--r-- | deno2/js/deno.d.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/deno2/js/deno.d.ts b/deno2/js/deno.d.ts index 4c797a5f6..4f8a7bc3d 100644 --- a/deno2/js/deno.d.ts +++ b/deno2/js/deno.d.ts @@ -1,6 +1,11 @@ // Copyright 2018 Ryan Dahl <ry@tinyclouds.org> // All rights reserved. MIT License. type MessageCallback = (msg: ArrayBuffer) => void; -declare function denoSub(channel: string, cb: MessageCallback): void; -declare function denoPub(channel: string, msg: ArrayBuffer): null | ArrayBuffer; -declare function denoPrint(x: string): void; + +interface Deno { + sub(channel: string, cb: MessageCallback): void; + pub(channel: string, msg: ArrayBuffer): null | ArrayBuffer; + print(x: string): void; +} + +declare let deno: Deno; |