mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-22 20:39:17 +08:00
fix webrtc definitions
This commit is contained in:
20
webrtc/MediaStream.d.ts
vendored
20
webrtc/MediaStream.d.ts
vendored
@@ -110,7 +110,7 @@ interface MediaStreamTrack {
|
||||
onunmute: (event: Event) => void;
|
||||
onended: (event: Event) => void;
|
||||
}
|
||||
var MediaStramTrack: {
|
||||
declare var MediaStramTrack: {
|
||||
prototype: MediaStreamTrack;
|
||||
new (): MediaStreamTrack;
|
||||
LIVE: number; // = 0;
|
||||
@@ -118,19 +118,19 @@ var MediaStramTrack: {
|
||||
ENDED: number; // = 2;
|
||||
}
|
||||
|
||||
interface URL {
|
||||
createObjectURL(stream: MediaStream): string;
|
||||
}
|
||||
var URL: {
|
||||
prototype: MediaStreamTrack;
|
||||
new (): URL;
|
||||
interface streamURL extends URL {
|
||||
createObjectURL(stream: MediaStream): string;
|
||||
}
|
||||
//declare var URL: {
|
||||
// prototype: MediaStreamTrack;
|
||||
// new (): URL;
|
||||
// createObjectURL(stream: MediaStream): string;
|
||||
//}
|
||||
|
||||
interface WebkitURL extends URL {
|
||||
interface WebkitURL extends streamURL {
|
||||
}
|
||||
var webkitURL: {
|
||||
declare var webkitURL: {
|
||||
prototype: WebkitURL;
|
||||
new (): URL;
|
||||
new (): streamURL;
|
||||
createObjectURL(stream: MediaStream): string;
|
||||
}
|
||||
28
webrtc/RTCPeerConnection.d.ts
vendored
28
webrtc/RTCPeerConnection.d.ts
vendored
@@ -9,7 +9,7 @@
|
||||
interface RTCConfiguration {
|
||||
iceServers: RTCIceServer[];
|
||||
}
|
||||
var RTCConfiguration: {
|
||||
declare var RTCConfiguration: {
|
||||
prototype: RTCConfiguration;
|
||||
new (): RTCConfiguration;
|
||||
}
|
||||
@@ -18,21 +18,21 @@ interface RTCIceServer {
|
||||
url: string;
|
||||
credential?: string;
|
||||
}
|
||||
var RTCIceServer: {
|
||||
declare var RTCIceServer: {
|
||||
prototype: RTCIceServer;
|
||||
new (): RTCIceServer;
|
||||
}
|
||||
|
||||
interface webkitRTCPeerConnection extends RTCPeerConnection {
|
||||
}
|
||||
var webkitRTCPeerConnection: {
|
||||
declare var webkitRTCPeerConnection: {
|
||||
prototype: webkitRTCPeerConnection;
|
||||
new (settings: RTCPeerConnectionConfig, constraints?:MediaConstraints): webkitRTCPeerConnection;
|
||||
}
|
||||
|
||||
interface IceState {
|
||||
}
|
||||
var IceState: {
|
||||
declare var IceState: {
|
||||
prototype: IceState;
|
||||
new (): IceState;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ interface RTCSessionDescription {
|
||||
type?: RTCSdpType;
|
||||
sdp?: string;
|
||||
}
|
||||
var RTCSessionDescription: {
|
||||
declare var RTCSessionDescription: {
|
||||
prototype: RTCSessionDescription;
|
||||
new (descriptionInitDict?: RTCSessionDescriptionInit): RTCSessionDescription;
|
||||
}
|
||||
@@ -60,7 +60,7 @@ interface RTCSessionDescriptionInit {
|
||||
type: RTCSdpType;
|
||||
sdp: string;
|
||||
}
|
||||
var RTCSessionDescriptionInit: {
|
||||
declare var RTCSessionDescriptionInit: {
|
||||
prototype: RTCSessionDescriptionInit;
|
||||
new (): RTCSessionDescriptionInit;
|
||||
}
|
||||
@@ -75,13 +75,13 @@ interface RTCDataChannelInit {
|
||||
reliable: bool;
|
||||
}
|
||||
|
||||
enum RTCSdpType {
|
||||
declare enum RTCSdpType {
|
||||
offer,
|
||||
pranswer,
|
||||
answer
|
||||
}
|
||||
|
||||
enum RTCDataChannelState {
|
||||
declare enum RTCDataChannelState {
|
||||
connecting,
|
||||
open,
|
||||
closing,
|
||||
@@ -112,7 +112,7 @@ interface RTCDataChannelEvent extends Event {
|
||||
constructor (eventInitDict: RTCDataChannelEventInit);
|
||||
channel: RTCDataChannel;
|
||||
}
|
||||
var RTCDataChannelEvent: {
|
||||
declare var RTCDataChannelEvent: {
|
||||
prototype: RTCDataChannelEvent;
|
||||
new (eventInitDict: RTCDataChannelEventInit);
|
||||
}
|
||||
@@ -186,7 +186,7 @@ interface RTCPeerConnection {
|
||||
onicecandidate: (event: RTCIceCandidateEvent)=> void;
|
||||
onidentityresult: (event: Event)=> void;
|
||||
}
|
||||
var RTCPeerConnection: {
|
||||
declare var RTCPeerConnection: {
|
||||
prototype: RTCPeerConnection;
|
||||
new (configuration: RTCConfiguration, constraints?: MediaConstraints): RTCPeerConnection;
|
||||
}
|
||||
@@ -196,7 +196,7 @@ interface RTCIceCandidate {
|
||||
sdpMid?: string;
|
||||
sdpMLineIndex?: number;
|
||||
}
|
||||
var RTCIceCandidate: {
|
||||
declare var RTCIceCandidate: {
|
||||
prototype: RTCIceCandidate;
|
||||
new (candidateInitDict?: RTCIceCandidate);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ interface RTCIceCandidateInit {
|
||||
sdpMid: string;
|
||||
sdpMLineIndex: number;
|
||||
}
|
||||
var RTCIceCandidateInit:{
|
||||
declare var RTCIceCandidateInit:{
|
||||
prototype: RTCIceCandidateInit;
|
||||
new (): RTCIceCandidateInit;
|
||||
}
|
||||
@@ -215,7 +215,7 @@ interface PeerConnectionIceEvent {
|
||||
peer: RTCPeerConnection;
|
||||
candidate: RTCIceCandidate;
|
||||
}
|
||||
var PeerConnectionIceEvent: {
|
||||
declare var PeerConnectionIceEvent: {
|
||||
prototype: PeerConnectionIceEvent;
|
||||
new (): PeerConnectionIceEvent;
|
||||
}
|
||||
@@ -223,7 +223,7 @@ var PeerConnectionIceEvent: {
|
||||
interface RTCPeerConnectionConfig {
|
||||
iceServers: RTCIceServer[];
|
||||
}
|
||||
var RTCPeerConnectionConfig: {
|
||||
declare var RTCPeerConnectionConfig: {
|
||||
prototype: RTCPeerConnectionConfig;
|
||||
new (): RTCPeerConnectionConfig;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user