refactor: Use built-in AbortSignal for typings (#747)
* refactor: Use built-in AbortSignal for typings Signed-off-by: Richie Bendall <richiebendall@gmail.com> * lint * chore: Update dependencies Signed-off-by: Richie Bendall <richiebendall@gmail.com> Co-authored-by: Antoni Kepinski <xxczaki@pm.me>
This commit is contained in:
parent
d15476bb5d
commit
ebbf45cc67
|
@ -1,21 +0,0 @@
|
|||
// `AbortSignal` is defined here to prevent a dependency on a particular
|
||||
// implementation like the `abort-controller` package, and to avoid requiring
|
||||
// the `dom` library in `tsconfig.json`.
|
||||
|
||||
export interface AbortSignal {
|
||||
aborted: boolean;
|
||||
|
||||
addEventListener: (type: 'abort', listener: ((this: AbortSignal, event: any) => any), options?: boolean | {
|
||||
capture?: boolean;
|
||||
once?: boolean;
|
||||
passive?: boolean;
|
||||
}) => void;
|
||||
|
||||
removeEventListener: (type: 'abort', listener: ((this: AbortSignal, event: any) => any), options?: boolean | {
|
||||
capture?: boolean;
|
||||
}) => void;
|
||||
|
||||
dispatchEvent: (event: any) => boolean;
|
||||
|
||||
onabort?: null | ((this: AbortSignal, event: any) => void);
|
||||
}
|
|
@ -9,9 +9,8 @@
|
|||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { URL, URLSearchParams } from 'url';
|
||||
import { Agent } from 'http';
|
||||
import { AbortSignal } from './externals';
|
||||
import {URL, URLSearchParams} from 'url';
|
||||
import {Agent} from 'http';
|
||||
|
||||
export class Request extends Body {
|
||||
method: string;
|
||||
|
|
Loading…
Reference in New Issue