@@ -32,7 +32,7 @@ export class MockConnection implements Connection {
3232 * {@link EventEmitter } of {@link Response }. Can be subscribed to in order to be notified when a
3333 * response is available.
3434 */
35- response : any ; // Subject <Response>
35+ response : ReplaySubject < Response > ;
3636
3737 constructor ( req : Request ) {
3838 this . response = take . call ( new ReplaySubject ( 1 ) , 1 ) ;
@@ -176,7 +176,8 @@ export class MockBackend implements ConnectionBackend {
176176 constructor ( ) {
177177 this . connectionsArray = [ ] ;
178178 this . connections = new Subject ( ) ;
179- this . connections . subscribe ( connection => this . connectionsArray . push ( connection ) ) ;
179+ this . connections . subscribe ( ( connection : MockConnection ) =>
180+ this . connectionsArray . push ( connection ) ) ;
180181 this . pendingConnections = new Subject ( ) ;
181182 }
182183
@@ -187,7 +188,7 @@ export class MockBackend implements ConnectionBackend {
187188 */
188189 verifyNoPendingRequests ( ) {
189190 let pending = 0 ;
190- this . pendingConnections . subscribe ( c => pending ++ ) ;
191+ this . pendingConnections . subscribe ( ( c : MockConnection ) => pending ++ ) ;
191192 if ( pending > 0 ) throw new BaseException ( `${ pending } pending connections to be resolved` ) ;
192193 }
193194
@@ -197,15 +198,15 @@ export class MockBackend implements ConnectionBackend {
197198 *
198199 * This method only exists in the mock implementation, not in real Backends.
199200 */
200- resolveAllConnections ( ) { this . connections . subscribe ( c => c . readyState = 4 ) ; }
201+ resolveAllConnections ( ) { this . connections . subscribe ( ( c : MockConnection ) => c . readyState = 4 ) ; }
201202
202203 /**
203204 * Creates a new {@link MockConnection}. This is equivalent to calling `new
204205 * MockConnection()`, except that it also will emit the new `Connection` to the `connections`
205206 * emitter of this `MockBackend` instance. This method will usually only be used by tests
206207 * against the framework itself, not by end-users.
207208 */
208- createConnection ( req : Request ) : Connection {
209+ createConnection ( req : Request ) : MockConnection {
209210 if ( ! isPresent ( req ) || ! ( req instanceof Request ) ) {
210211 throw new BaseException ( `createConnection requires an instance of Request, got ${ req } ` ) ;
211212 }
0 commit comments