diff options
Diffstat (limited to 'std/node/global.d.ts')
-rw-r--r-- | std/node/global.d.ts | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/std/node/global.d.ts b/std/node/global.d.ts new file mode 100644 index 000000000..b02a682c6 --- /dev/null +++ b/std/node/global.d.ts @@ -0,0 +1,28 @@ +// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. +import { process as processModule } from "./process.ts"; +import { Buffer as bufferModule } from "./buffer.ts"; + +// d.ts files allow us to declare Buffer as a value and as a type +// type something = Buffer | something_else; is quite common + +type GlobalType = { + process: typeof processModule; + Buffer: typeof bufferModule; +}; + +declare global { + interface Window { + global: GlobalType; + } + + interface globalThis { + global: GlobalType; + } + + var global: GlobalType; + var process: typeof processModule; + var Buffer: typeof bufferModule; + type Buffer = bufferModule; +} + +export {}; |