PeerConnection.hx 5.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Copyright (C)2005-2019 Haxe Foundation
  3. *
  4. * Permission is hereby granted, free of charge, to any person obtaining a
  5. * copy of this software and associated documentation files (the "Software"),
  6. * to deal in the Software without restriction, including without limitation
  7. * the rights to use, copy, modify, merge, publish, distribute, sublicense,
  8. * and/or sell copies of the Software, and to permit persons to whom the
  9. * Software is furnished to do so, subject to the following conditions:
  10. *
  11. * The above copyright notice and this permission notice shall be included in
  12. * all copies or substantial portions of the Software.
  13. *
  14. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  20. * DEALINGS IN THE SOFTWARE.
  21. */
  22. // This file is generated from mozilla\RTCPeerConnection.webidl. Do not edit!
  23. package js.html.rtc;
  24. import js.lib.Promise;
  25. /**
  26. The `RTCPeerConnection` interface represents a WebRTC connection between the local computer and a remote peer. It provides methods to connect to a remote peer, maintain and monitor the connection, and close the connection once it's no longer needed.
  27. Documentation [RTCPeerConnection](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection) by [Mozilla Contributors](https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection$history), licensed under [CC-BY-SA 2.5](https://creativecommons.org/licenses/by-sa/2.5/).
  28. @see <https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection>
  29. **/
  30. @:native("RTCPeerConnection")
  31. extern class PeerConnection extends js.html.EventTarget {
  32. /** @throws DOMError */
  33. @:overload( function( keygenAlgorithm : String) : Promise<Certificate> {} )
  34. static function generateCertificate( keygenAlgorithm : Dynamic ) : Promise<Certificate>;
  35. var localDescription(default,null) : SessionDescription;
  36. var currentLocalDescription(default,null) : SessionDescription;
  37. var pendingLocalDescription(default,null) : SessionDescription;
  38. var remoteDescription(default,null) : SessionDescription;
  39. var currentRemoteDescription(default,null) : SessionDescription;
  40. var pendingRemoteDescription(default,null) : SessionDescription;
  41. var signalingState(default,null) : SignalingState;
  42. var canTrickleIceCandidates(default,null) : Bool;
  43. var iceGatheringState(default,null) : IceGatheringState;
  44. var iceConnectionState(default,null) : IceConnectionState;
  45. var peerIdentity(default,null) : Promise<IdentityAssertion>;
  46. var idpLoginUrl(default,null) : String;
  47. var onnegotiationneeded : haxe.Constraints.Function;
  48. var onicecandidate : haxe.Constraints.Function;
  49. var onsignalingstatechange : haxe.Constraints.Function;
  50. var onaddstream : haxe.Constraints.Function;
  51. var onaddtrack : haxe.Constraints.Function;
  52. var ontrack : haxe.Constraints.Function;
  53. var onremovestream : haxe.Constraints.Function;
  54. var oniceconnectionstatechange : haxe.Constraints.Function;
  55. var onicegatheringstatechange : haxe.Constraints.Function;
  56. var ondatachannel : haxe.Constraints.Function;
  57. /** @throws DOMError */
  58. function new( ?configuration : Configuration, ?constraints : Dynamic ) : Void;
  59. function setIdentityProvider( provider : String, ?options : IdentityProviderOptions ) : Void;
  60. function getIdentityAssertion() : Promise<String>;
  61. @:overload( function( ?options : OfferOptions ) : Promise<SessionDescriptionInit> {} )
  62. function createOffer( successCallback : SessionDescriptionInit -> Void, failureCallback : js.html.DOMException -> Void, ?options : OfferOptions ) : Promise<Void>;
  63. @:overload( function( ?options : AnswerOptions ) : Promise<SessionDescriptionInit> {} )
  64. function createAnswer( successCallback : SessionDescriptionInit -> Void, failureCallback : js.html.DOMException -> Void ) : Promise<Void>;
  65. @:overload( function( description : SessionDescriptionInit ) : Promise<Void> {} )
  66. function setLocalDescription( description : SessionDescriptionInit, successCallback : Void -> Void, failureCallback : js.html.DOMException -> Void ) : Promise<Void>;
  67. @:overload( function( description : SessionDescriptionInit ) : Promise<Void> {} )
  68. function setRemoteDescription( description : SessionDescriptionInit, successCallback : Void -> Void, failureCallback : js.html.DOMException -> Void ) : Promise<Void>;
  69. @:overload( function( candidate : IceCandidate) : Promise<Void> {} )
  70. @:overload( function( candidate : IceCandidateInit ) : Promise<Void> {} )
  71. function addIceCandidate( candidate : IceCandidate, successCallback : Void -> Void, failureCallback : js.html.DOMException -> Void ) : Promise<Void>;
  72. function getConfiguration() : Configuration;
  73. function getLocalStreams() : Array<js.html.MediaStream>;
  74. function getRemoteStreams() : Array<js.html.MediaStream>;
  75. function addStream( stream : js.html.MediaStream ) : Void;
  76. function addTrack( track : js.html.MediaStreamTrack, stream : js.html.MediaStream, moreStreams : haxe.extern.Rest<js.html.MediaStream> ) : RtpSender;
  77. function removeTrack( sender : RtpSender ) : Void;
  78. @:overload( function( trackOrKind : String, ?init : RtpTransceiverInit) : RtpTransceiver {} )
  79. function addTransceiver( trackOrKind : js.html.MediaStreamTrack, ?init : RtpTransceiverInit ) : RtpTransceiver;
  80. function getSenders() : Array<RtpSender>;
  81. function getReceivers() : Array<RtpReceiver>;
  82. function getTransceivers() : Array<RtpTransceiver>;
  83. function close() : Void;
  84. @:overload( function( ?selector : js.html.MediaStreamTrack ) : Promise<StatsReport> {} )
  85. function getStats( selector : js.html.MediaStreamTrack, successCallback : StatsReport -> Void, failureCallback : js.html.DOMException -> Void ) : Promise<Void>;
  86. function createDataChannel( label : String, ?dataChannelDict : DataChannelInit ) : DataChannel;
  87. }