File: abortcontroller.d.ts

package info (click to toggle)
nodejs 22.21.1%2Bdfsg%2B~cs22.19.0-6
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 251,928 kB
  • sloc: cpp: 1,542,927; javascript: 597,777; ansic: 114,330; python: 60,784; sh: 4,155; makefile: 2,918; asm: 1,750; pascal: 1,565; perl: 248; lisp: 222; xml: 42
file content (34 lines) | stat: -rw-r--r-- 1,145 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
export {};

type _AbortController = typeof globalThis extends { onmessage: any } ? {} : AbortController;
interface AbortController {
    readonly signal: AbortSignal;
    abort(reason?: any): void;
}

type _AbortSignal = typeof globalThis extends { onmessage: any } ? {} : AbortSignal;
interface AbortSignal extends EventTarget {
    readonly aborted: boolean;
    onabort: ((this: AbortSignal, ev: Event) => any) | null;
    readonly reason: any;
    throwIfAborted(): void;
}

declare global {
    interface AbortController extends _AbortController {}
    var AbortController: typeof globalThis extends { onmessage: any; AbortController: infer T } ? T
        : {
            prototype: AbortController;
            new(): AbortController;
        };

    interface AbortSignal extends _AbortSignal {}
    var AbortSignal: typeof globalThis extends { onmessage: any; AbortSignal: infer T } ? T
        : {
            prototype: AbortSignal;
            new(): AbortSignal;
            abort(reason?: any): AbortSignal;
            any(signals: AbortSignal[]): AbortSignal;
            timeout(milliseconds: number): AbortSignal;
        };
}