@metamask/swappable-obj-proxy
Advanced tools
Comparing version 2.2.0 to 2.3.0
@@ -9,2 +9,6 @@ # Changelog | ||
## [2.3.0] | ||
### Added | ||
- Export `EventEmitterLike` type ([#56](https://github.com/MetaMask/swappable-obj-proxy/pull/56)) | ||
## [2.2.0] | ||
@@ -28,5 +32,6 @@ ### Changed | ||
[Unreleased]: https://github.com/MetaMask/swappable-obj-proxy/compare/v2.2.0...HEAD | ||
[Unreleased]: https://github.com/MetaMask/swappable-obj-proxy/compare/v2.3.0...HEAD | ||
[2.3.0]: https://github.com/MetaMask/swappable-obj-proxy/compare/v2.2.0...v2.3.0 | ||
[2.2.0]: https://github.com/MetaMask/swappable-obj-proxy/compare/v2.1.0...v2.2.0 | ||
[2.1.0]: https://github.com/MetaMask/swappable-obj-proxy/compare/v2.0.0...v2.1.0 | ||
[2.0.0]: https://github.com/MetaMask/swappable-obj-proxy/releases/tag/v2.0.0 |
@@ -1,17 +0,3 @@ | ||
import type { SwappableProxy } from './types'; | ||
import type { SwappableProxy, EventEmitterLike } from './types'; | ||
/** | ||
* A portion of Node's EventEmitter interface that `createEventEmitterProxy` | ||
* expects its `target` to support. | ||
*/ | ||
declare type EventEmitterLike = { | ||
eventNames: () => (string | symbol)[]; | ||
rawListeners(eventName: string | symbol): Function[]; | ||
removeAllListeners(event?: string | symbol): EventEmitterLike; | ||
on(name: string, handler: (...args: unknown[]) => unknown): void; | ||
prependListener(name: string, handler: (...args: unknown[]) => unknown): void; | ||
addListener(name: string, handler: (...args: unknown[]) => unknown): void; | ||
off(name: string, handler: (...args: unknown[]) => unknown): void; | ||
once(name: string, handler: (...args: unknown[]) => unknown): void; | ||
}; | ||
/** | ||
* Creates a proxy object that initially points to the given object but whose | ||
@@ -37,2 +23,1 @@ * target can be substituted with another object later using its `setTarget` | ||
}): SwappableProxy<Type>; | ||
export {}; |
@@ -13,1 +13,15 @@ /** | ||
}; | ||
/** | ||
* A portion of Node's EventEmitter interface that `createEventEmitterProxy` | ||
* expects its `target` to support. | ||
*/ | ||
export declare type EventEmitterLike = { | ||
eventNames: () => (string | symbol)[]; | ||
rawListeners(eventName: string | symbol): Function[]; | ||
removeAllListeners(event?: string | symbol): EventEmitterLike; | ||
on(name: string, handler: (...args: unknown[]) => unknown): void; | ||
prependListener(name: string, handler: (...args: unknown[]) => unknown): void; | ||
addListener(name: string, handler: (...args: unknown[]) => unknown): void; | ||
off(name: string, handler: (...args: unknown[]) => unknown): void; | ||
once(name: string, handler: (...args: unknown[]) => unknown): void; | ||
}; |
{ | ||
"name": "@metamask/swappable-obj-proxy", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "Tools for creating `Proxy`s around objects that are swappable via setTarget", | ||
@@ -5,0 +5,0 @@ "repository": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
37120
289