From cb64cf3ce2ea46883fa8bc2b4242dfd07e4551e5 Mon Sep 17 00:00:00 2001 From: Kitson Kelly Date: Thu, 16 Apr 2020 00:10:49 +1000 Subject: Add support for AbortController/AbortSignal (#4757) --- cli/js/lib.deno.shared_globals.d.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'cli/js/lib.deno.shared_globals.d.ts') diff --git a/cli/js/lib.deno.shared_globals.d.ts b/cli/js/lib.deno.shared_globals.d.ts index f84a056db..fd9f3691d 100644 --- a/cli/js/lib.deno.shared_globals.d.ts +++ b/cli/js/lib.deno.shared_globals.d.ts @@ -1256,6 +1256,16 @@ declare class CustomEvent extends Event { readonly detail: T; } +/** A controller object that allows you to abort one or more DOM requests as and + * when desired. */ +declare class AbortController { + /** Returns the AbortSignal object associated with this object. */ + readonly signal: AbortSignal; + /** Invoking this method will set this object's AbortSignal's aborted flag and + * signal to any observers that the associated activity is to be aborted. */ + abort(): void; +} + interface AbortSignalEventMap { abort: Event; } @@ -1263,10 +1273,8 @@ interface AbortSignalEventMap { /** A signal object that allows you to communicate with a DOM request (such as a * Fetch) and abort it if required via an AbortController object. */ interface AbortSignal extends EventTarget { - /** - * Returns true if this AbortSignal's AbortController has signaled to abort, - * and false otherwise. - */ + /** Returns true if this AbortSignal's AbortController has signaled to abort, + * and false otherwise. */ readonly aborted: boolean; onabort: ((this: AbortSignal, ev: Event) => any) | null; addEventListener( -- cgit v1.2.3