mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-20 12:00:53 +08:00
Fixed tests, use proper interface, in 'peerjs'.
This commit is contained in:
@@ -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;
|
||||
|
||||
Vendored
+1
-1
@@ -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).
|
||||
|
||||
Reference in New Issue
Block a user