UNPKG

768 BTypeScriptView Raw
1// `AbortSignal` is defined here to prevent a dependency on a particular
2// implementation like the `abort-controller` package, and to avoid requiring
3// the `dom` library in `tsconfig.json`.
4
5export interface AbortSignal {
6 aborted: boolean;
7
8 addEventListener: (type: "abort", listener: ((this: AbortSignal, event: any) => any), options?: boolean | {
9 capture?: boolean | undefined,
10 once?: boolean | undefined,
11 passive?: boolean | undefined
12 }) => void;
13
14 removeEventListener: (type: "abort", listener: ((this: AbortSignal, event: any) => any), options?: boolean | {
15 capture?: boolean | undefined
16 }) => void;
17
18 dispatchEvent: (event: any) => boolean;
19
20 onabort: null | ((this: AbortSignal, event: any) => any);
21}
22
\No newline at end of file