diff options
author | Kitson Kelly <me@kitsonkelly.com> | 2020-04-16 00:10:49 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-15 10:10:49 -0400 |
commit | cb64cf3ce2ea46883fa8bc2b4242dfd07e4551e5 (patch) | |
tree | 0eeae9e1d2e5e190804cf362968be0688a161910 /cli/js/lib.deno.shared_globals.d.ts | |
parent | 95eb6d780c2790b524dc3ad6f21958260c2dadfe (diff) |
Add support for AbortController/AbortSignal (#4757)
Diffstat (limited to 'cli/js/lib.deno.shared_globals.d.ts')
-rw-r--r-- | cli/js/lib.deno.shared_globals.d.ts | 16 |
1 files changed, 12 insertions, 4 deletions
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<T = any> 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<K extends keyof AbortSignalEventMap>( |