"Fossies" - the Fresh Open Source Software Archive

Member "node-v19.8.1-win-x64/node_modules/npm/node_modules/abort-controller/dist/abort-controller.d.ts" (16 Feb 2023, 1063 Bytes) of package /windows/www/node-v19.8.1-win-x64.zip:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 import { EventTarget } from "event-target-shim"
    2 
    3 type Events = {
    4     abort: any
    5 }
    6 type EventAttributes = {
    7     onabort: any
    8 }
    9 /**
   10  * The signal class.
   11  * @see https://dom.spec.whatwg.org/#abortsignal
   12  */
   13 declare class AbortSignal extends EventTarget<Events, EventAttributes> {
   14     /**
   15      * AbortSignal cannot be constructed directly.
   16      */
   17     constructor()
   18     /**
   19      * Returns `true` if this `AbortSignal`"s `AbortController` has signaled to abort, and `false` otherwise.
   20      */
   21     readonly aborted: boolean
   22 }
   23 /**
   24  * The AbortController.
   25  * @see https://dom.spec.whatwg.org/#abortcontroller
   26  */
   27 declare class AbortController {
   28     /**
   29      * Initialize this controller.
   30      */
   31     constructor()
   32     /**
   33      * Returns the `AbortSignal` object associated with this object.
   34      */
   35     readonly signal: AbortSignal
   36     /**
   37      * Abort and signal to any observers that the associated activity is to be aborted.
   38      */
   39     abort(): void
   40 }
   41 
   42 export default AbortController
   43 export { AbortController, AbortSignal }