diff --git a/peerjs/peerjs-tests.ts b/peerjs/peerjs-tests.ts index 3b99471c7..dee76d9e2 100644 --- a/peerjs/peerjs-tests.ts +++ b/peerjs/peerjs-tests.ts @@ -4,8 +4,10 @@ var peerByOption: PeerJs.Peer = new Peer({ key: 'peerKey', debug: 3, - logFunction: ()=>{ - } +}); + +peerByOption.on("connection", dataConnection => { + var type: string = dataConnection.type; }); peerByOption.listAllPeers(function(items){ @@ -21,9 +23,10 @@ var peerByIdAndOption: PeerJs.Peer = new Peer( { key: 'peerKey', debug: 3, - logFunction: ()=>{ - } }); +peerByIdAndOption.on("call", mediaConnection => { + var isOpen: boolean = mediaConnection.open; +}); var id = peerByOption.id; var connections = peerByOption.connections; diff --git a/peerjs/peerjs.d.ts b/peerjs/peerjs.d.ts index b87d3bc87..7db935ffb 100644 --- a/peerjs/peerjs.d.ts +++ b/peerjs/peerjs.d.ts @@ -78,7 +78,7 @@ declare module PeerJs{ * @param id The brokering ID of the remote peer (their peer.id). * @param options for specifying details about Peer Connection */ - connect(id: string, options?: PeerJs.PeerJSOption): PeerJs.DataConnection; + connect(id: string, options?: PeerJs.PeerConnectOption): PeerJs.DataConnection; /** * Connects to the remote peer specified by id and returns a data connection. * @param id The brokering ID of the remote peer (their peer.id).