iotex-antenna
iotex-antenna copied to clipboard
Client Readable Stream duplicate identifier error on Typescript
The following error is thrown by the TypeScript compiler when importing the iotex-antenna in a Typescript project (only tested with a Typescript project).
node_modules/iotex-antenna/lib/rpc-method/types.d.ts:700:18 - error TS2430: Interface 'ClientReadableStream<Response>' incorrectly extends interface 'EventEmitter'.
The types returned by 'on(...)' are incompatible between these types.
Type 'ClientReadableStream<Response>' is not assignable to type 'this'.
'ClientReadableStream<Response>' is assignable to the constraint of type 'this', but 'this' could be instantiated with a different subtype of constraint 'ClientReadableStream<Response>'.
700 export interface ClientReadableStream<Response> {
~~~~~~~~~~~~~~~~~~~~
node_modules/iotex-antenna/lib/rpc-method/types.d.ts:707:22 - error TS2415: Class 'ClientReadableStream<Response>' incorrectly extends base class 'EventEmitter'.
707 export declare class ClientReadableStream<Response> extends EventEmitter {
~~~~~~~~~~~~~~~~~~~~
Upon inspection of the error there seems to be an interface and class of the same name.