summaryrefslogtreecommitdiff
path: root/cli/js
diff options
context:
space:
mode:
authorYusuke Sakurai <kerokerokerop@gmail.com>2020-03-25 02:39:41 +0900
committerGitHub <noreply@github.com>2020-03-24 13:39:41 -0400
commit07fc95aceee950316500cf2d770317b6e993356e (patch)
treee4d5fcc1999058d855a31b09b352c9947180fa85 /cli/js
parent30bcf6a2ea620aa989a7362e7f4a62fc11743bb4 (diff)
feat: add queueMicrotask to d.ts (#4477)
Diffstat (limited to 'cli/js')
-rw-r--r--cli/js/lib.deno.shared_globals.d.ts4
-rw-r--r--cli/js/tests/timers_test.ts4
2 files changed, 7 insertions, 1 deletions
diff --git a/cli/js/lib.deno.shared_globals.d.ts b/cli/js/lib.deno.shared_globals.d.ts
index 1be54adff..85b2bbf48 100644
--- a/cli/js/lib.deno.shared_globals.d.ts
+++ b/cli/js/lib.deno.shared_globals.d.ts
@@ -18,8 +18,8 @@ declare interface WindowOrWorkerGlobalScope {
clearInterval: typeof __timers.clearInterval;
clearTimeout: typeof __timers.clearTimeout;
fetch: typeof __fetch.fetch;
- queueMicrotask: (task: () => void) => void;
setInterval: typeof __timers.setInterval;
+ queueMicrotask: typeof __timers.queueMicrotask;
setTimeout: typeof __timers.setTimeout;
// properties
console: __console.Console;
@@ -232,6 +232,7 @@ declare const clearTimeout: typeof __timers.clearTimeout;
declare const fetch: typeof __fetch.fetch;
declare const setInterval: typeof __timers.setInterval;
declare const setTimeout: typeof __timers.setTimeout;
+declare const queueMicrotask: typeof __timers.queueMicrotask;
declare const console: __console.Console;
declare const Blob: typeof __blob.DenoBlob;
@@ -1327,6 +1328,7 @@ declare namespace __timers {
): number;
export function clearTimeout(id?: number): void;
export function clearInterval(id?: number): void;
+ export function queueMicrotask(func: Function): void;
}
declare namespace __urlSearchParams {
diff --git a/cli/js/tests/timers_test.ts b/cli/js/tests/timers_test.ts
index b7da6a847..f758d5fca 100644
--- a/cli/js/tests/timers_test.ts
+++ b/cli/js/tests/timers_test.ts
@@ -362,3 +362,7 @@ unitTest(async function timerNestedMicrotaskOrdering(): Promise<void> {
await promise;
assertEquals(s, "0123456789AB");
});
+
+unitTest(function testQueueMicrotask() {
+ assertEquals(typeof queueMicrotask, "function");
+});