@@ -6,7 +6,6 @@ import io.scalajs.nodejs.buffer.Buffer
6
6
import io .scalajs .nodejs .events .IEventEmitter
7
7
8
8
import scala .scalajs .js
9
- import scala .scalajs .js .|
10
9
11
10
/**
12
11
* The Readable stream interface is the abstraction for a source of data that you are reading from.
@@ -210,36 +209,36 @@ object Readable {
210
209
* The event indicates that no more events will be emitted, and no further computation will occur.
211
210
*/
212
211
@ inline
213
- def onClose [ A ] (listener : () => A ): readable.type = readable.on(" close" , listener)
212
+ def onClose (listener : () => Any ): readable.type = readable.on(" close" , listener)
214
213
215
214
/**
216
215
* Attaching a 'data' event listener to a stream that has not been explicitly paused will switch the stream into
217
216
* flowing mode. Data will then be passed as soon as it is available.
218
217
*/
219
218
@ inline
220
- def onData [A ](listener : Buffer | String | js. Any => A ): readable.type = readable.on(" data" , listener)
219
+ def onData [A ](listener : A => Any ): readable.type = readable.on(" data" , listener)
221
220
222
221
/**
223
222
* This event fires when there will be no more data to read. Note that the 'end' event will not fire unless the
224
223
* data is completely consumed. This can be done by switching into flowing mode, or by calling stream.read()
225
224
* repeatedly until you get to the end.
226
225
*/
227
226
@ inline
228
- def onEnd [ A ] (listener : () => A ): readable.type = readable.on(" end" , listener)
227
+ def onEnd (listener : () => Any ): readable.type = readable.on(" end" , listener)
229
228
230
229
/**
231
230
* Emitted if there was an error when writing or piping data.
232
231
*/
233
232
@ inline
234
- def onError [ A ] (listener : Error => A ): readable.type = readable.on(" error" , listener)
233
+ def onError (listener : Error => Any ): readable.type = readable.on(" error" , listener)
235
234
236
235
/**
237
236
* When a chunk of data can be read from the stream, it will emit a 'readable' event. In some cases, listening
238
237
* for a 'readable' event will cause some data to be read into the internal buffer from the underlying system,
239
238
* if it hadn't already.
240
239
*/
241
240
@ inline
242
- def onReadable [ A ] (listener : () => A ): readable.type = readable.on(" readable" , listener)
241
+ def onReadable (listener : () => Any ): readable.type = readable.on(" readable" , listener)
243
242
244
243
}
245
244
0 commit comments