mirror of
https://github.com/denoland/deno.git
synced 2025-01-09 15:48:16 -05:00
fix: move ImportMeta to deno.ns lib (#6588)
This commit is contained in:
parent
538504f57c
commit
2527a6e296
2 changed files with 21 additions and 6 deletions
16
cli/js/lib.deno.ns.d.ts
vendored
16
cli/js/lib.deno.ns.d.ts
vendored
|
@ -3,6 +3,22 @@
|
||||||
/// <reference no-default-lib="true" />
|
/// <reference no-default-lib="true" />
|
||||||
/// <reference lib="esnext" />
|
/// <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 {
|
declare namespace Deno {
|
||||||
/** A set of error constructors that are raised by Deno APIs. */
|
/** A set of error constructors that are raised by Deno APIs. */
|
||||||
export const errors: {
|
export const errors: {
|
||||||
|
|
11
cli/js/lib.deno.shared_globals.d.ts
vendored
11
cli/js/lib.deno.shared_globals.d.ts
vendored
|
@ -219,6 +219,10 @@ declare function clearInterval(id?: number): void;
|
||||||
*/
|
*/
|
||||||
declare function clearTimeout(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
|
/** 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
|
* 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
|
* 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'); });
|
* 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 console: Console;
|
||||||
declare var crypto: Crypto;
|
declare var crypto: Crypto;
|
||||||
|
@ -266,11 +270,6 @@ declare function removeEventListener(
|
||||||
options?: boolean | EventListenerOptions | undefined
|
options?: boolean | EventListenerOptions | undefined
|
||||||
): void;
|
): void;
|
||||||
|
|
||||||
declare interface ImportMeta {
|
|
||||||
url: string;
|
|
||||||
main: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
interface DomIterable<K, V> {
|
interface DomIterable<K, V> {
|
||||||
keys(): IterableIterator<K>;
|
keys(): IterableIterator<K>;
|
||||||
values(): IterableIterator<V>;
|
values(): IterableIterator<V>;
|
||||||
|
|
Loading…
Reference in a new issue