Fixed tests, use proper interface, in 'peerjs'.

This commit is contained in:
Daniel Rosenwasser
2015-08-21 18:37:40 -07:00
parent 683a463333
commit 5f2a6b0dc3
2 changed files with 8 additions and 5 deletions
+7 -4
View File
@@ -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;
+1 -1
View File
@@ -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).