diff --git a/index.test-d.ts b/index.test-d.ts index 6d11a88..59cd4e3 100644 --- a/index.test-d.ts +++ b/index.test-d.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-empty-function, @typescript-eslint/no-floating-promises */ import {expectType, expectError, expectNotAssignable, expectAssignable} from 'tsd'; -import {pEvent} from 'p-event'; +import {pEventIterator} from 'p-event'; import Emittery from './index.js'; type AnyListener = (eventData?: unknown) => void | Promise; @@ -254,26 +254,26 @@ type AnyListener = (eventData?: unknown) => void | Promise; }; } -// TODO: Fix type compatibility with `p-event`. // Compatibility with p-event, without explicit types -// { -// const ee = new Emittery(); -// pEvent.iterator(ee, 'data', { -// resolutionEvents: ['finish'] -// }); -// } +{ + const ee = new Emittery(); + pEventIterator(ee, 'data', { + resolutionEvents: ['finish'], + }); +} // Compatibility with p-event, with explicit types -// { -// const ee = new Emittery<{ -// data: unknown; -// error: unknown; -// finish: undefined; -// }>(); -// pEvent.iterator(ee, 'data', { -// resolutionEvents: ['finish'] -// }); -// } +{ + type EventData = { + data: unknown; + error: unknown; + finish: undefined; + }; + const ee = new Emittery(); + pEventIterator(ee, 'data', { + resolutionEvents: ['finish'], + }); +} // Mixin type Emittery.mixin('emittery')(class { diff --git a/package.json b/package.json index fd8af48..01dd74d 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,7 @@ "ava": "^4.3.3", "delay": "^5.0.0", "nyc": "^15.1.0", - "p-event": "^5.0.1", + "p-event": "^6.0.0", "tsd": "^0.23.0", "xo": "^0.55.0" },