diff options
| author | Kitson Kelly <me@kitsonkelly.com> | 2020-07-03 20:44:45 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-03 12:44:45 +0200 |
| commit | 2527a6e296ab2614991c17a2e3ac518a5a579776 (patch) | |
| tree | 533f159037d985cbb099f497b0289aa6a9210028 /cli/js | |
| parent | 538504f57c206cb3d10f9fd53bd0c3fc4bef4e6f (diff) | |
fix: move ImportMeta to deno.ns lib (#6588)
Diffstat (limited to 'cli/js')
| -rw-r--r-- | cli/js/lib.deno.ns.d.ts | 16 | ||||
| -rw-r--r-- | cli/js/lib.deno.shared_globals.d.ts | 11 |
2 files changed, 21 insertions, 6 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index f3ee04243..cd82b4adf 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -3,6 +3,22 @@ /// <reference no-default-lib="true" /> /// <reference lib="esnext" /> +declare interface ImportMeta { + /** A string representation of the fully qualified module URL. */ + url: string; + + /** A flag that indicates if the current module is the main module that was + * called when starting the program under Deno. + * + * ```ts + * if (import.meta.main) { + * // this was loaded as the main module, maybe do some bootstrapping + * } + * ``` + */ + main: boolean; +} + declare namespace Deno { /** A set of error constructors that are raised by Deno APIs. */ export const errors: { diff --git a/cli/js/lib.deno.shared_globals.d.ts b/cli/js/lib.deno.shared_globals.d.ts index 58d25cea4..7bb987ef4 100644 --- a/cli/js/lib.deno.shared_globals.d.ts +++ b/cli/js/lib.deno.shared_globals.d.ts @@ -219,6 +219,10 @@ declare function clearInterval(id?: number): void; */ declare function clearTimeout(id?: number): void; +interface VoidFunction { + (): void; +} + /** A microtask is a short function which is executed after the function or * module which created it exits and only if the JavaScript execution stack is * empty, but before returning control to the event loop being used to drive the @@ -227,7 +231,7 @@ declare function clearTimeout(id?: number): void; * * queueMicrotask(() => { console.log('This event loop stack is complete'); }); */ -declare function queueMicrotask(func: Function): void; +declare function queueMicrotask(func: VoidFunction): void; declare var console: Console; declare var crypto: Crypto; @@ -266,11 +270,6 @@ declare function removeEventListener( options?: boolean | EventListenerOptions | undefined ): void; -declare interface ImportMeta { - url: string; - main: boolean; -} - interface DomIterable<K, V> { keys(): IterableIterator<K>; values(): IterableIterator<V>; |
