UNPKG

alinea

Version:
11 lines (10 loc) 325 B
export interface Emitter<T> extends AsyncIterable<T> { emit(value: T): void; throw(error: any): void; return(): void; } export interface EmitterOptions { onReturn?: () => void; onThrow?: (error: any) => void; } export declare function createEmitter<T>({ onReturn, onThrow }?: EmitterOptions): Emitter<T>;