File tree 1 file changed +3
-3
lines changed
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,8 @@ const version = require("../package.json").version;
12
12
13
13
type Constructable < T > = new ( e : string ) => T ;
14
14
15
- export interface EventSourceOptions {
16
- onmessage ?: ( event : MessageEvent ) => void ;
15
+ export interface EventSourceOptions < T > {
16
+ onmessage ?: ( value : T ) => void ;
17
17
onerror ?: ( event : MessageEvent ) => void ;
18
18
reconnectTimeout ?: number ;
19
19
}
@@ -88,7 +88,7 @@ export class CallBuilder<
88
88
* @param {number } [options.reconnectTimeout] Custom stream connection timeout in ms, default is 15 seconds.
89
89
* @returns {function } Close function. Run to close the connection and stop listening for new events.
90
90
*/
91
- public stream ( options : EventSourceOptions = { } ) : ( ) => void {
91
+ public stream ( options : EventSourceOptions < T > = { } ) : ( ) => void {
92
92
this . checkFilter ( ) ;
93
93
94
94
this . url . setQuery ( "X-Client-Name" , "js-stellar-sdk" ) ;
You can’t perform that action at this time.
0 commit comments