mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Fix asynciterator EventEmitter extension for Node 13 (#41545)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
897add7fa4
commit
4e23dab093
Vendored
+19
-1
@@ -8,7 +8,7 @@
|
||||
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
export abstract class AsyncIterator<T> extends EventEmitter {
|
||||
export abstract class AsyncIterator<T> implements EventEmitter {
|
||||
static STATES: ['INIT', 'OPEN', 'CLOSING', 'CLOSED', 'ENDED'];
|
||||
static INIT: 0;
|
||||
static OPEN: 1;
|
||||
@@ -57,6 +57,24 @@ export abstract class AsyncIterator<T> extends EventEmitter {
|
||||
clone(): ClonedIterator<T>;
|
||||
|
||||
static range(start?: number, end?: number, step?: number): IntegerIterator;
|
||||
|
||||
// From EventEmitter
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
removeAllListeners(event?: string | symbol): this;
|
||||
setMaxListeners(n: number): this;
|
||||
getMaxListeners(): number;
|
||||
listeners(event: string | symbol): Array<() => void>;
|
||||
rawListeners(event: string | symbol): Array<() => void>;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
listenerCount(type: string | symbol): number;
|
||||
// Added in Node 6...
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
eventNames(): Array<string | symbol>;
|
||||
}
|
||||
|
||||
export class EmptyIterator<T> extends AsyncIterator<T> {
|
||||
|
||||
Reference in New Issue
Block a user