From 7dfa6fad05c9e081e854d844387cd137a536eef3 Mon Sep 17 00:00:00 2001 From: Drew Youngwerth Date: Wed, 20 Jun 2018 15:31:28 -0600 Subject: [PATCH] @types/serialport: Make the callback of the on method non-optional This resolves a type mismatch between `SerialPort` and its inherited `Readable` class. This fixes an error detected by typescript@2.9.2 in strict mode. --- types/serialport/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/serialport/index.d.ts b/types/serialport/index.d.ts index b0a374efeb..1e8aa9faa5 100644 --- a/types/serialport/index.d.ts +++ b/types/serialport/index.d.ts @@ -36,7 +36,7 @@ declare class SerialPort extends Stream.Duplex { pause(): this; resume(): this; - on(event: string, callback?: (data?: any) => void): this; + on(event: string, callback: (data?: any) => void): this; static Binding: SerialPort.BaseBinding;