Merge remote-tracking branch 'upstream/master'

This commit is contained in:
tarh
2014-07-06 08:33:23 +01:00
8 changed files with 435 additions and 253 deletions
+30
View File
@@ -0,0 +1,30 @@
///<reference path="../angularjs/angular.d.ts" />
/// <reference path="./ngprogress-lite.d.ts" />
var app = angular.module('testApp', ['ngProgressLite']);
app.config(
['ngProgressLiteProvider',
(ngProgressLiteProvider: ng.progressLite.INgProgressLiteProvider) => {
ngProgressLiteProvider.settings.ease = 'ease';
ngProgressLiteProvider.settings.minimum = 0.08,
ngProgressLiteProvider.settings.speed = 300;
ngProgressLiteProvider.settings.trickleRate = 0.02;
ngProgressLiteProvider.settings.trickleSpeed = 500;
ngProgressLiteProvider.settings.template = '<div class="ngProgressLite"><div class="ngProgressLiteBar"><div class="ngProgressLiteBarShadow"></div></div></div>';
}
]);
app.controller('testCtrl', ($scope: ng.IScope, ngProgressLite : ng.progressLite.INgProgressLite) => {
ngProgressLite.set(0.4);
ngProgressLite.get();
ngProgressLite.inc();
ngProgressLite.inc(0.1);
ngProgressLite.start();
ngProgressLite.done();
});
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for ngprogress-lite
// Project: https://github.com/voronianski/ngprogress-lite
// Definitions by: Luke Forder <https://github.com/LukeForder>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module ng.progressLite {
export interface INgProgressLite {
set(num: number): INgProgressLite;
get(): number;
start(): INgProgressLite;
inc(amount?: number): INgProgressLite;
done(): void;
}
export interface IConfigurationOptions {
minimum: number;
speed: number;
ease: string;
trickleRate: number;
trickleSpeed: number;
template: string;
}
export interface INgProgressLiteProvider {
settings: IConfigurationOptions;
}
}
+13
View File
@@ -0,0 +1,13 @@
// Type definitions for WebCrypto
// Project: http://www.w3.org/TR/WebCryptoAPI/
// Definitions by: Lucas Dixon <https://github.com/iislucas/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module crypto {
// A cryptographically strong pseudo-random number generator seeded with
// truly random values. The buffer passed in is modified, and a reference to
// argument is returned for convenience.
function getRandomValues(array: ArrayBufferView) : ArrayBufferView
}
+17
View File
@@ -0,0 +1,17 @@
# WebCrypto Definition Notes
## The WebCrypto specification
The WebCrypto specification is for performing basic cryptographic operations in
web applications, such as hashing, signature generation and verification, and
encryption and decryption. The API is also for applications to generate and/or
manage the keying material necessary to perform these operations. Uses for this
API range from user or service authentication, document or code signing, and the confidentiality and integrity of communications.
The latest version of the specification can be found at: http://www.w3.org/TR/WebCryptoAPI/
## Adding the reference to your project
```
/// <reference path="WebCrypto.d.ts" />
```
+22 -22
View File
@@ -6,27 +6,27 @@ var mediaTrackConstraintArray: MediaTrackConstraint[] = [];
var mediaTrackConstraints: MediaTrackConstraints = { mandatory: mediaTrackConstraintSet, optional: mediaTrackConstraintArray }
navigator.getUserMedia(mediaStreamConstraints,
stream => {
console.log('label:' + stream.label);
console.log('ended:' + stream.ended);
stream.onended = event => console.log('Stream ended');
var objectUrl = URL.createObjectURL(stream);
var wkObjectUrl = webkitURL.createObjectURL(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
stream => {
console.log('label:' + stream.label);
console.log('ended:' + stream.ended);
stream.onended = (event:Event) => console.log('Stream ended');
var objectUrl = URL.createObjectURL(stream);
var wkObjectUrl = webkitURL.createObjectURL(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
navigator.webkitGetUserMedia(mediaStreamConstraints,
stream => {
console.log('label:' + stream.label);
console.log('ended:' + stream.ended);
stream.onended = event => console.log('Stream ended');
var objectUrl = URL.createObjectURL(stream);
var wkObjectUrl = webkitURL.createObjectURL(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
stream => {
console.log('label:' + stream.label);
console.log('ended:' + stream.ended);
stream.onended = (event:Event) => console.log('Stream ended');
var objectUrl = URL.createObjectURL(stream);
var wkObjectUrl = webkitURL.createObjectURL(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
+85 -77
View File
@@ -6,150 +6,158 @@
// Taken from http://dev.w3.org/2011/webrtc/editor/getusermedia.html
interface MediaStreamConstraints {
audio: any;
video: any;
audio: any;
video: any;
}
declare var MediaStreamConstraints: {
prototype: MediaStreamConstraints;
new (): MediaStreamConstraints;
prototype: MediaStreamConstraints;
new (): MediaStreamConstraints;
}
interface MediaTrackConstraints {
mandatory: MediaTrackConstraintSet;
optional: MediaTrackConstraint[];
mandatory: MediaTrackConstraintSet;
optional: MediaTrackConstraint[];
}
declare var MediaTrackConstraints: {
prototype: MediaTrackConstraints;
new (): MediaTrackConstraints;
prototype: MediaTrackConstraints;
new (): MediaTrackConstraints;
}
// ks - Not defined in the source doc.
interface MediaTrackConstraintSet {
}
declare var MediaTrackConstraintSet: {
prototype: MediaTrackConstraintSet;
new (): MediaTrackConstraintSet;
prototype: MediaTrackConstraintSet;
new (): MediaTrackConstraintSet;
}
// ks - Not defined in the source doc.
interface MediaTrackConstraint {
}
declare var MediaTrackConstraint: {
prototype: MediaTrackConstraint;
new (): MediaTrackConstraints;
prototype: MediaTrackConstraint;
new (): MediaTrackConstraints;
}
interface Navigator {
getUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void);
webkitGetUserMedia(constraints: MediaStreamConstraints, successCallback: (stream: any) => void, errorCallback: (error: Error) => void);
getUserMedia(constraints: MediaStreamConstraints,
successCallback: (stream: any) => void,
errorCallback: (error: Error) => void) : void;
webkitGetUserMedia(constraints: MediaStreamConstraints,
successCallback: (stream: any) => void,
errorCallback: (error: Error) => void): void;
}
interface EventHandler { (event: Event): void; }
interface NavigatorUserMediaSuccessCallback { (stream: LocalMediaStream): void; }
interface NavigatorUserMediaSuccessCallback {
(stream: LocalMediaStream): void;
}
interface NavigatorUserMediaError {
PERMISSION_DENIED: number; // = 1;
code: number;
PERMISSION_DENIED: number; // = 1;
code: number;
}
declare var NavigatorUserMediaError: {
prototype: NavigatorUserMediaError;
new (): NavigatorUserMediaError;
PERMISSION_DENIED: number; // = 1;
prototype: NavigatorUserMediaError;
new (): NavigatorUserMediaError;
PERMISSION_DENIED: number; // = 1;
}
interface NavigatorUserMediaErrorCallback { (error: NavigatorUserMediaError): void; }
interface NavigatorUserMediaErrorCallback {
(error: NavigatorUserMediaError): void;
}
interface MediaStreamTrackList {
length: number;
item: MediaStreamTrack;
add(track: MediaStreamTrack): void;
remove(track: MediaStreamTrack): void;
onaddtrack: (event: Event) => void;
onremovetrack: (event: Event) => void;
length: number;
item: MediaStreamTrack;
add(track: MediaStreamTrack): void;
remove(track: MediaStreamTrack): void;
onaddtrack: (event: Event) => void;
onremovetrack: (event: Event) => void;
}
declare var MediaStreamTrackList: {
prototype: MediaStreamTrackList;
new (): MediaStreamTrackList;
prototype: MediaStreamTrackList;
new (): MediaStreamTrackList;
}
declare var webkitMediaStreamTrackList: {
prototype: MediaStreamTrackList;
new (): MediaStreamTrackList;
prototype: MediaStreamTrackList;
new (): MediaStreamTrackList;
}
interface MediaStream {
label: string;
id: string;
getAudioTracks(): MediaStreamTrackList;
getVideoTracks(): MediaStreamTrackList;
ended: boolean;
onended: (event: Event) => void;
label: string;
id: string;
getAudioTracks(): MediaStreamTrackList;
getVideoTracks(): MediaStreamTrackList;
ended: boolean;
onended: (event: Event) => void;
}
declare var MediaStream: {
prototype: MediaStream;
new (): MediaStream;
new (trackContainers: MediaStream[]): MediaStream;
new (trackContainers: MediaStreamTrackList[]): MediaStream;
new (trackContainers: MediaStreamTrack[]): MediaStream;
prototype: MediaStream;
new (): MediaStream;
new (trackContainers: MediaStream[]): MediaStream;
new (trackContainers: MediaStreamTrackList[]): MediaStream;
new (trackContainers: MediaStreamTrack[]): MediaStream;
}
declare var webkitMediaStream: {
prototype: MediaStream;
new (): MediaStream;
new (trackContainers: MediaStream[]): MediaStream;
new (trackContainers: MediaStreamTrackList[]): MediaStream;
new (trackContainers: MediaStreamTrack[]): MediaStream;
prototype: MediaStream;
new (): MediaStream;
new (trackContainers: MediaStream[]): MediaStream;
new (trackContainers: MediaStreamTrackList[]): MediaStream;
new (trackContainers: MediaStreamTrack[]): MediaStream;
}
// an - not defined in source doc.
interface SourceInfo {
label: string;
id: string;
kind: string;
facing: string;
label: string;
id: string;
kind: string;
facing: string;
}
declare var SourceInfo: {
prototype: SourceInfo;
prototype: SourceInfo;
}
interface LocalMediaStream extends MediaStream {
stop(): void;
stop(): void;
}
interface MediaStreamTrack {
kind: string;
label: string;
enabled: boolean;
LIVE: number; // = 0;
MUTED: number; // = 1;
ENDED: number; // = 2;
readyState: number;
onmute: (event: Event) => void;
onunmute: (event: Event) => void;
onended: (event: Event) => void;
kind: string;
label: string;
enabled: boolean;
LIVE: number; // = 0;
MUTED: number; // = 1;
ENDED: number; // = 2;
readyState: number;
onmute: (event: Event) => void;
onunmute: (event: Event) => void;
onended: (event: Event) => void;
}
declare var MediaStreamTrack: {
prototype: MediaStreamTrack;
new (): MediaStreamTrack;
LIVE: number; // = 0;
MUTED: number; // = 1;
ENDED: number; // = 2;
getSources: (callback: (sources: SourceInfo[]) => void) => void;
prototype: MediaStreamTrack;
new (): MediaStreamTrack;
LIVE: number; // = 0;
MUTED: number; // = 1;
ENDED: number; // = 2;
getSources: (callback: (sources: SourceInfo[]) => void) => void;
}
interface streamURL extends URL {
createObjectURL(stream: MediaStream): string;
createObjectURL(stream: MediaStream): string;
}
//declare var URL: {
// prototype: MediaStreamTrack;
// new (): URL;
// createObjectURL(stream: MediaStream): string;
// prototype: MediaStreamTrack;
// new (): URL;
// createObjectURL(stream: MediaStream): string;
//}
interface WebkitURL extends streamURL {
}
declare var webkitURL: {
prototype: WebkitURL;
new (): streamURL;
createObjectURL(stream: MediaStream): string;
prototype: WebkitURL;
new (): streamURL;
createObjectURL(stream: MediaStream): string;
}
+33 -26
View File
@@ -1,19 +1,22 @@
/// <reference path="MediaStream.d.ts" />
/// <reference path="RTCPeerConnection.d.ts" />
var config: RTCConfiguration = { iceServers: [{ url: "stun.l.google.com:19302" }] };
var constraints: MediaConstraints = { mandatory: { OfferToReceiveAudio: true, OfferToReceiveVideo: true } };
var config: RTCConfiguration =
{ iceServers: [{ url: "stun.l.google.com:19302" }] };
var constraints: RTCMediaConstraints =
{ mandatory: { OfferToReceiveAudio: true, OfferToReceiveVideo: true } };
var peerConnection: RTCPeerConnection = new RTCPeerConnection(config, constraints);
var peerConnection: RTCPeerConnection =
new RTCPeerConnection(config, constraints);
navigator.getUserMedia({ audio: true, video: true },
stream => {
peerConnection.addStream(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
stream => {
peerConnection.addStream(stream);
},
error => {
console.log('Error message: ' + error.message);
console.log('Error name: ' + error.name);
});
peerConnection.onaddstream = ev => console.log(ev.type);
peerConnection.ondatachannel = ev => console.log(ev.type);
@@ -25,27 +28,31 @@ peerConnection.onremovestream = ev => console.log(ev.type);
peerConnection.onstatechange = ev => console.log(ev.type);
peerConnection.createOffer(
offer => {
peerConnection.setLocalDescription(offer,
() => console.log("set local description"),
error => console.log("Error setting local description: " + error));
},
error => console.log("Error creating offer: " + error));
offer => {
peerConnection.setLocalDescription(offer,
() => console.log("set local description"),
error => console.log("Error setting local description: " + error));
},
error => console.log("Error creating offer: " + error));
var type: RTCSdpType = RTCSdpType.offer;
var type: string = RTCSdpType[RTCSdpType.offer];
var offer: RTCSessionDescriptionInit = { type: type, sdp: "some sdp" };
var sessionDescription = new RTCSessionDescription(offer);
peerConnection.setRemoteDescription(sessionDescription, () => {
peerConnection.createAnswer(
answer => {
peerConnection.setLocalDescription(answer,
() => console.log('Set local description'),
error => console.log("Error setting local description from created answer: " + error + "; answer.sdp=" + answer.sdp));
},
error => console.log("Error creating answer: " + error));
peerConnection.createAnswer(
answer => {
peerConnection.setLocalDescription(answer,
() => console.log('Set local description'),
error => console.log(
"Error setting local description from created answer: " + error +
"; answer.sdp=" + answer.sdp));
},
error => console.log("Error creating answer: " + error));
},
error => console.log('Error setting remote description: ' + error + "; offer.sdp=" + offer.sdp));
error => console.log('Error setting remote description: ' + error +
"; offer.sdp=" + offer.sdp));
var wkPeerConnection: webkitRTCPeerConnection = new webkitRTCPeerConnection(config, constraints);
var wkPeerConnection: webkitRTCPeerConnection =
new webkitRTCPeerConnection(config, constraints);
+207 -128
View File
@@ -2,229 +2,308 @@
// Project: http://dev.w3.org/2011/webrtc/
// Definitions by: Ken Smith <https://github.com/smithkl42/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
//
// Definitions taken from http://dev.w3.org/2011/webrtc/editor/webrtc.html
//
// For example code see:
// https://code.google.com/p/webrtc/source/browse/stable/samples/js/apprtc/js/main.js
//
// For a generic implementation see that deals with browser differences, see:
// https://code.google.com/p/webrtc/source/browse/stable/samples/js/base/adapter.js
/// <reference path="MediaStream.d.ts" />
/// <reference path='MediaStream.d.ts' />
// TODO(1): Get Typescript to have string-enum types as WebRtc is full of string
// enums.
// https://typescript.codeplex.com/discussions/549207
// TODO(2): get Typescript to have union types as WebRtc uses them.
// https://typescript.codeplex.com/workitem/1364
interface RTCConfiguration {
iceServers: RTCIceServer[];
iceServers: RTCIceServer[];
}
declare var RTCConfiguration: {
prototype: RTCConfiguration;
new (): RTCConfiguration;
prototype: RTCConfiguration;
new (): RTCConfiguration;
}
interface RTCIceServer {
url: string;
credential?: string;
url: string;
credential?: string;
}
declare var RTCIceServer: {
prototype: RTCIceServer;
new (): RTCIceServer;
prototype: RTCIceServer;
new (): RTCIceServer;
}
// moz (Firefox) specific prefixes.
interface mozRTCPeerConnection extends RTCPeerConnection {
}
declare var mozRTCPeerConnection: {
prototype: mozRTCPeerConnection;
new (settings: RTCPeerConnectionConfig,
constraints?:RTCMediaConstraints): mozRTCPeerConnection;
}
// webkit (Chrome) specific prefixes.
interface webkitRTCPeerConnection extends RTCPeerConnection {
}
declare var webkitRTCPeerConnection: {
prototype: webkitRTCPeerConnection;
new (settings: RTCPeerConnectionConfig, constraints?:MediaConstraints): webkitRTCPeerConnection;
prototype: webkitRTCPeerConnection;
new (settings: RTCPeerConnectionConfig,
constraints?:RTCMediaConstraints): webkitRTCPeerConnection;
}
interface IceState {
}
declare var IceState: {
prototype: IceState;
new (): IceState;
// For Chrome, look at the code here:
// https://code.google.com/p/chromium/codesearch#chromium/src/third_party/libjingle/source/talk/app/webrtc/webrtcsession.cc&sq=package:chromium&dr=C&l=63
interface RTCOptionalMediaConstraint {
// When true, will use DTLS/SCTP data channels
DtlsSrtpKeyAgreement?: boolean;
// When true will use Rtp-based data channels (depreicated)
RtpDataChannels?: boolean;
}
// ks 12/20/12 - There's more here that doesn't seem to be documented very well yet.
interface MediaConstraints {
mandatory: MediaOfferConstraints;
// http://www.w3.org/TR/2013/WD-webrtc-20130910/
interface RTCMediaConstraints {
mandatory?: RTCMediaOfferConstraints;
optional?: RTCOptionalMediaConstraint[]
}
interface MediaOfferConstraints {
OfferToReceiveAudio: boolean;
OfferToReceiveVideo: boolean;
}
interface RTCSessionDescription {
type?: RTCSdpType;
sdp?: string;
}
declare var RTCSessionDescription: {
prototype: RTCSessionDescription;
new (descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;
interface RTCMediaOfferConstraints {
OfferToReceiveAudio: boolean;
OfferToReceiveVideo: boolean;
}
interface RTCSessionDescriptionInit {
type: RTCSdpType;
sdp: string;
}
declare var RTCSessionDescriptionInit: {
prototype: RTCSessionDescriptionInit;
new (): RTCSessionDescriptionInit;
type: string; // RTCSdpType; See TODO(1)
sdp: string;
}
interface SdpType {
interface RTCSessionDescription {
type?: string; // RTCSdpType; See TODO(1)
sdp?: string;
}
interface RTCPeerState {
declare var RTCSessionDescription: {
prototype: RTCSessionDescription;
new (descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;
// TODO: Add serializer.
// See: http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSdpType)
}
interface RTCDataChannelInit {
reliable: boolean;
ordered ?: boolean; // messages must be sent in-order.
maxPacketLifeTime ?: number; // unsigned short
maxRetransmits ?: number; // unsigned short
protocol ?: string; // default = ''
negotiated ?: boolean; // default = false;
id ?: number; // unsigned short
}
// TODO(1)
declare enum RTCSdpType {
offer,
pranswer,
answer
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcsdptype
'offer',
'pranswer',
'answer'
}
interface RTCMessageEvent {
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#event-datachannel-message
// At present, this can be an: ArrayBuffer, a string, or a Blob.
// See TODO(2)
data: any;
}
// TODO(1)
declare enum RTCDataChannelState {
connecting,
open,
closing,
closed
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCDataChannelState
'connecting',
'open',
'closing',
'closed'
}
interface RTCDataChannel extends EventTarget {
label: string;
reliable: boolean;
readyState: RTCDataChannelState;
bufferedAmount: number;
onopen: (event: Event)=> void;
onerror: (event: Event)=> void;
onclose: (event: Event)=> void;
close(): void;
onmessage: (event: Event)=> void;
binaryType: string;
send(data: string);
send(data: ArrayBuffer);
send(data: Blob);
label: string;
reliable: boolean;
readyState: string; // RTCDataChannelState; see TODO(1)
bufferedAmount: number;
binaryType: string;
onopen: (event: Event) => void;
onerror: (event: Event) => void;
onclose: (event: Event) => void;
onmessage: (event: RTCMessageEvent) => void;
close(): void;
send(data: string): void ;
send(data: ArrayBuffer): void;
send(data: ArrayBufferView): void;
send(data: Blob): void;
}
declare var RTCDataChannel: {
prototype: RTCDataChannel;
new (): RTCDataChannel;
prototype: RTCDataChannel;
new (): RTCDataChannel;
}
interface RTCDataChannelEvent extends Event {
constructor (eventInitDict: RTCDataChannelEventInit);
channel: RTCDataChannel;
channel: RTCDataChannel;
}
declare var RTCDataChannelEvent: {
prototype: RTCDataChannelEvent;
new (eventInitDict: RTCDataChannelEventInit);
prototype: RTCDataChannelEvent;
new (eventInitDict: RTCDataChannelEventInit): RTCDataChannelEvent;
}
interface RTCIceCandidateEvent extends Event{
candidate: RTCIceCandidate;
interface RTCIceCandidateEvent extends Event {
candidate: RTCIceCandidate;
}
interface RTCMediaStreamEvent extends Event {
stream: MediaStream;
stream: MediaStream;
}
interface EventInit {
}
interface RTCDataChannelEventInit extends EventInit {
channel: RTCDataChannel;
channel: RTCDataChannel;
}
interface RTCVoidCallback {
(): void;
(): void;
}
interface RTCSessionDescriptionCallback {
(sdp: RTCSessionDescription): void;
(sdp: RTCSessionDescription): void;
}
interface RTCPeerConnectionErrorCallback {
(errorInformation: string): void;
(errorInformation: DOMError): void;
}
/** This should be an enum */
interface RTCIceGatheringState {
string;
// TODO(1)
declare enum RTCIceGatheringState {
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#rtcicegatheringstate-enum
'new',
'gathering',
'complete'
}
/** This should be an enum */
interface RTCIceConnectionState {
string;
// TODO(1)
declare enum RTCIceConnectionState {
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCIceConnectionState
'new',
'checking',
'connected',
'completed',
'failed',
'disconnected',
'closed'
}
/** This should be an enum */
interface RTCSignalingState{
string;
// TODO(1)
declare enum RTCSignalingState {
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCSignalingState
'stable',
'have-local-offer',
'have-remote-offer',
'have-local-pranswer',
'have-remote-pranswer',
'closed'
}
// This is based on the current implementation of WebRtc in Chrome; the spec is
// a little unclear on this.
// http://dev.w3.org/2011/webrtc/editor/webrtc.html#idl-def-RTCStatsReport
interface RTCStatsReport {
stat(id: string): string;
}
interface RTCStatsCallback {
(report: RTCStatsReport): void;
}
interface RTCPeerConnection {
createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, constraints?: MediaConstraints): void;
createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback?: RTCPeerConnectionErrorCallback, constraints?: MediaConstraints): void;
setLocalDescription(description: RTCSessionDescription, successCallback?: RTCVoidCallback, failureCallback?: RTCPeerConnectionErrorCallback): void;
localDescription: RTCSessionDescription;
setRemoteDescription(description: RTCSessionDescription, successCallback?: RTCVoidCallback, failureCallback?: RTCPeerConnectionErrorCallback): void;
remoteDescription: RTCSessionDescription;
signalingState: RTCSignalingState;
updateIce(configuration?: RTCConfiguration, constraints?: MediaConstraints): void;
addIceCandidate(candidate: RTCIceCandidate): void;
iceGatheringState: RTCIceGatheringState;
iceConnectionState: RTCIceConnectionState;
getLocalStreams(): MediaStream[];
getRemoteStreams(): MediaStream[];
createDataChannel(label?: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel;
ondatachannel: (event: Event)=> void;
addStream(stream: MediaStream, constraints?: MediaConstraints): void;
removeStream(stream: MediaStream): void;
close(): void;
onnegotiationneeded: (event: Event)=> void;
onconnecting: (event: Event)=> void;
onopen: (event: Event)=> void;
onaddstream: (event: RTCMediaStreamEvent)=> void;
onremovestream: (event: RTCMediaStreamEvent)=> void;
onstatechange: (event: Event)=> void;
onicechange: (event: Event)=> void;
onicecandidate: (event: RTCIceCandidateEvent)=> void;
onidentityresult: (event: Event)=> void;
createOffer(successCallback: RTCSessionDescriptionCallback,
failureCallback?: RTCPeerConnectionErrorCallback,
constraints?: RTCMediaConstraints): void;
createAnswer(successCallback: RTCSessionDescriptionCallback,
failureCallback?: RTCPeerConnectionErrorCallback,
constraints?: RTCMediaConstraints): void;
setLocalDescription(description: RTCSessionDescription,
successCallback?: RTCVoidCallback,
failureCallback?: RTCPeerConnectionErrorCallback): void;
localDescription: RTCSessionDescription;
setRemoteDescription(description: RTCSessionDescription,
successCallback?: RTCVoidCallback,
failureCallback?: RTCPeerConnectionErrorCallback): void;
remoteDescription: RTCSessionDescription;
signalingState: string; // RTCSignalingState; see TODO(1)
updateIce(configuration?: RTCConfiguration,
constraints?: RTCMediaConstraints): void;
addIceCandidate(candidate: RTCIceCandidate): void;
iceGatheringState: string; // RTCIceGatheringState; see TODO(1)
iceConnectionState: string; // RTCIceConnectionState; see TODO(1)
getLocalStreams(): MediaStream[];
getRemoteStreams(): MediaStream[];
createDataChannel(label?: string,
dataChannelDict?: RTCDataChannelInit): RTCDataChannel;
ondatachannel: (event: Event) => void;
addStream(stream: MediaStream, constraints?: RTCMediaConstraints): void;
removeStream(stream: MediaStream): void;
close(): void;
onnegotiationneeded: (event: Event) => void;
onconnecting: (event: Event) => void;
onopen: (event: Event) => void;
onaddstream: (event: RTCMediaStreamEvent) => void;
onremovestream: (event: RTCMediaStreamEvent) => void;
onstatechange: (event: Event) => void;
onicechange: (event: Event) => void;
onicecandidate: (event: RTCIceCandidateEvent) => void;
onidentityresult: (event: Event) => void;
onsignalingstatechange: (event: Event) => void;
getStats: (successCallback: RTCStatsCallback,
failureCallback: RTCPeerConnectionErrorCallback) => void;
}
declare var RTCPeerConnection: {
prototype: RTCPeerConnection;
new (configuration: RTCConfiguration, constraints?: MediaConstraints): RTCPeerConnection;
prototype: RTCPeerConnection;
new (configuration: RTCConfiguration,
constraints?: RTCMediaConstraints): RTCPeerConnection;
}
interface RTCIceCandidate {
candidate?: string;
sdpMid?: string;
sdpMLineIndex?: number;
candidate?: string;
sdpMid?: string;
sdpMLineIndex?: number;
}
declare var RTCIceCandidate: {
prototype: RTCIceCandidate;
new (candidateInitDict?: RTCIceCandidate);
prototype: RTCIceCandidate;
new (candidateInitDict?: RTCIceCandidate): RTCIceCandidate;
}
interface RTCIceCandidateInit {
candidate: string;
sdpMid: string;
sdpMLineIndex: number;
candidate: string;
sdpMid: string;
sdpMLineIndex: number;
}
declare var RTCIceCandidateInit:{
prototype: RTCIceCandidateInit;
new (): RTCIceCandidateInit;
prototype: RTCIceCandidateInit;
new (): RTCIceCandidateInit;
}
interface PeerConnectionIceEvent {
peer: RTCPeerConnection;
candidate: RTCIceCandidate;
peer: RTCPeerConnection;
candidate: RTCIceCandidate;
}
declare var PeerConnectionIceEvent: {
prototype: PeerConnectionIceEvent;
new (): PeerConnectionIceEvent;
prototype: PeerConnectionIceEvent;
new (): PeerConnectionIceEvent;
}
interface RTCPeerConnectionConfig {
iceServers: RTCIceServer[];
iceServers: RTCIceServer[];
}
declare var RTCPeerConnectionConfig: {
prototype: RTCPeerConnectionConfig;
new (): RTCPeerConnectionConfig;
prototype: RTCPeerConnectionConfig;
new (): RTCPeerConnectionConfig;
}