main
Last change
on this file was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | // `AbortSignal`,`AbortController` are defined here to prevent a dependency on the `dom` library which disagrees with node runtime.
|
---|
2 | // The definition for `AbortSignal` is taken from @types/node-fetch (https://github.com/DefinitelyTyped/DefinitelyTyped) for
|
---|
3 | // maximal compatibility with node-fetch.
|
---|
4 | // Original node-fetch definitions are under MIT License.
|
---|
5 |
|
---|
6 | export class AbortSignal {
|
---|
7 | aborted: boolean;
|
---|
8 | reason?: any;
|
---|
9 |
|
---|
10 | addEventListener: (
|
---|
11 | type: "abort",
|
---|
12 | listener: (this: AbortSignal, event: any) => any,
|
---|
13 | options?:
|
---|
14 | | boolean
|
---|
15 | | {
|
---|
16 | capture?: boolean;
|
---|
17 | once?: boolean;
|
---|
18 | passive?: boolean;
|
---|
19 | }
|
---|
20 | ) => void;
|
---|
21 |
|
---|
22 | removeEventListener: (
|
---|
23 | type: "abort",
|
---|
24 | listener: (this: AbortSignal, event: any) => any,
|
---|
25 | options?:
|
---|
26 | | boolean
|
---|
27 | | {
|
---|
28 | capture?: boolean;
|
---|
29 | }
|
---|
30 | ) => void;
|
---|
31 |
|
---|
32 | dispatchEvent: (event: any) => boolean;
|
---|
33 |
|
---|
34 | onabort: null | ((this: AbortSignal, event: any) => void);
|
---|
35 |
|
---|
36 | throwIfAborted(): void;
|
---|
37 |
|
---|
38 | static abort(reason?: any): AbortSignal;
|
---|
39 |
|
---|
40 | static timeout(time: number): AbortSignal;
|
---|
41 | }
|
---|
42 |
|
---|
43 | export class AbortController {
|
---|
44 | signal: AbortSignal;
|
---|
45 |
|
---|
46 | abort(reason?: any): void;
|
---|
47 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.