diff --git a/types/peerjs/index.d.ts b/types/peerjs/index.d.ts index 4ca88fd50b..faf99dc9b3 100644 --- a/types/peerjs/index.d.ts +++ b/types/peerjs/index.d.ts @@ -2,9 +2,7 @@ // Project: http://peerjs.com/ // Definitions by: Toshiya Nakakura // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// +// TypeScript Version: 3.2 declare namespace PeerJs{ interface PeerJSOption{ @@ -13,7 +11,7 @@ declare namespace PeerJs{ port?: number; path?: string; secure?: boolean; - config?: RTCPeerConnectionConfig; + config?: RTCConfiguration; debug?: number; } diff --git a/types/skyway/index.d.ts b/types/skyway/index.d.ts index eb73937178..e396f8cff0 100644 --- a/types/skyway/index.d.ts +++ b/types/skyway/index.d.ts @@ -2,9 +2,7 @@ // Project: http://nttcom.github.io/skyway/ // Definitions by: Toshiya Nakakura // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.3 - -/// +// TypeScript Version: 3.2 declare namespace PeerJs{ interface PeerJSOption{ @@ -14,7 +12,7 @@ declare namespace PeerJs{ path?: string; secure?: boolean; turn?: boolean; - config?: RTCPeerConnectionConfig; + config?: RTCConfiguration; debug?: number; } diff --git a/types/w3c-generic-sensor/index.d.ts b/types/w3c-generic-sensor/index.d.ts index 40f6db6301..bec987d04f 100644 --- a/types/w3c-generic-sensor/index.d.ts +++ b/types/w3c-generic-sensor/index.d.ts @@ -2,12 +2,10 @@ // Project: https://www.w3.org/TR/generic-sensor/ // Definitions by: Kenneth Rohde Christiansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// TypeScript Version: 2.2 +// TypeScript Version: 3.2 // Explainer: https://www.w3.org/TR/motion-sensors/ -/// - declare class SensorErrorEvent extends Event { constructor(type: string, errorEventInitDict: SensorErrorEventInit); readonly error: Error; @@ -82,7 +80,7 @@ declare class UncalibratedMagnetometer extends Sensor { // Orientation Sensor: https://www.w3.org/TR/orientation-sensor/ -type RotationMatrixType = Float32Array | Float64Array | GeometryDom.DOMMatrix; +type RotationMatrixType = Float32Array | Float64Array | DOMMatrix; declare class OrientationSensor extends Sensor { readonly quaternion?: number[]; diff --git a/types/w3c-screen-orientation/index.d.ts b/types/w3c-screen-orientation/index.d.ts index 7cac6c33f3..74fee2ecb6 100644 --- a/types/w3c-screen-orientation/index.d.ts +++ b/types/w3c-screen-orientation/index.d.ts @@ -2,8 +2,8 @@ // Project: https://www.w3.org/TR/screen-orientation/ // Definitions by: Kenneth Rohde Christiansen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 -type OrientationType = "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; type ScreenOrientationLockType = "any" | "natural" | "landscape" | "portrait" | "portrait-primary" | "portrait-secondary" | "landscape-primary" | "landscape-secondary"; interface ScreenOrientation extends EventTarget { diff --git a/types/web-animations-js/index.d.ts b/types/web-animations-js/index.d.ts index 54c0b8c01b..c317675727 100644 --- a/types/web-animations-js/index.d.ts +++ b/types/web-animations-js/index.d.ts @@ -2,10 +2,10 @@ // Project: https://github.com/web-animations/web-animations-js // Definitions by: Kristian Moerch // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 type AnimationEffectTimingFillMode = "none" | "forwards" | "backwards" | "both" | "auto"; type AnimationEffectTimingPlaybackDirection = "normal" | "reverse" | "alternate" | "alternate-reverse"; -type AnimationPlayState = "idle" | "running" | "paused" | "finished"; interface AnimationPlaybackEvent { target: Animation; @@ -68,18 +68,7 @@ interface ComputedTimingProperties { currentIteration: number | null; } -declare class KeyframeEffect implements AnimationEffectReadOnly { - constructor(target: HTMLElement, effect: AnimationKeyFrame | AnimationKeyFrame[], timing: number | AnimationEffectTiming, id?: string); - activeDuration: number; - onsample: (timeFraction: number | null, effect: KeyframeEffect, animation: Animation) => void | undefined; - parent: KeyframeEffect | null; - target: HTMLElement; - timing: number; - getComputedTiming(): ComputedTimingProperties; - getFrames(): AnimationKeyFrame[]; - remove(): void; -} -type AnimationEventListener = (this: Animation, evt: AnimationPlaybackEvent) => any; +type AnimationEventListener = ((this: Animation, evt: AnimationPlaybackEvent) => any) | null; interface Animation extends EventTarget { currentTime: number | null; @@ -88,7 +77,7 @@ interface Animation extends EventTarget { onfinish: AnimationEventListener; readonly playState: AnimationPlayState; playbackRate: number; - startTime: number; + startTime: number | null; cancel(): void; finish(): void; pause(): void; @@ -96,15 +85,15 @@ interface Animation extends EventTarget { reverse(): void; addEventListener(type: "finish" | "cancel", handler: EventListener): void; removeEventListener(type: "finish" | "cancel", handler: EventListener): void; - effect: AnimationEffectReadOnly; + effect: AnimationEffect | null; readonly finished: Promise; readonly ready: Promise; - timeline: AnimationTimeline; + timeline: AnimationTimeline | null; } declare var Animation: { prototype: Animation; - new(effect?: AnimationEffectReadOnly, timeline?: AnimationTimeline): Animation; + new(effect?: AnimationEffect | null, timeline?: AnimationTimeline | null): Animation; }; declare class SequenceEffect extends KeyframeEffect { @@ -118,5 +107,5 @@ interface Element { getAnimations(): Animation[]; } interface Document { - timeline: AnimationTimeline; + readonly timeline: AnimationTimeline; } diff --git a/types/webrtc/RTCPeerConnection.d.ts b/types/webrtc/RTCPeerConnection.d.ts index 210ab66ddd..4b5c1cea53 100644 --- a/types/webrtc/RTCPeerConnection.d.ts +++ b/types/webrtc/RTCPeerConnection.d.ts @@ -2,6 +2,7 @@ // Project: https://www.w3.org/TR/webrtc/ // Definitions by: Danilo Bargen // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 3.2 // // W3 Spec: https://www.w3.org/TR/webrtc/ // @@ -11,8 +12,6 @@ /// -type EventHandler = (event: Event) => void; - // https://www.w3.org/TR/webrtc/#idl-def-rtcofferansweroptions interface RTCOfferAnswerOptions { voiceActivityDetection?: boolean; // default = true @@ -28,10 +27,10 @@ interface RTCAnswerOptions extends RTCOfferAnswerOptions { } // https://www.w3.org/TR/webrtc/#idl-def-rtcpeerconnectionstate -type RTCPeerConnectionState = 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; +// type RTCPeerConnectionState = 'new' | 'connecting' | 'connected' | 'disconnected' | 'failed' | 'closed'; // https://www.w3.org/TR/webrtc/#idl-def-rtcicecredentialtype -type RTCIceCredentialType = 'password' | 'token'; +// type RTCIceCredentialType = 'password' | 'token'; // https://www.w3.org/TR/webrtc/#idl-def-rtciceserver interface RTCIceServer { @@ -40,7 +39,7 @@ interface RTCIceServer { } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtcpmuxpolicy -type RTCRtcpMuxPolicy = 'negotiate' | 'require'; +// type RTCRtcpMuxPolicy = 'negotiate' | 'require'; // https://www.w3.org/TR/webrtc/#idl-def-rtciceparameters interface RTCIceParameters { @@ -49,6 +48,7 @@ interface RTCIceParameters { } // https://www.w3.org/TR/webrtc/#idl-def-rtcicetransport +type IceTransportEventHandler = ((this: RTCIceTransport, ev: Event) => any) | null; interface RTCIceTransport { //readonly role: RTCIceRole; //readonly component: RTCIceComponent; @@ -59,17 +59,18 @@ interface RTCIceTransport { getSelectedCandidatePair(): RTCIceCandidatePair | null; getLocalParameters(): RTCIceParameters | null; getRemoteParameters(): RTCIceParameters | null; - onstatechange: EventHandler; - ongatheringstatechange: EventHandler; - onselectedcandidatepairchange: EventHandler; + onstatechange: IceTransportEventHandler; + ongatheringstatechange: IceTransportEventHandler; + onselectedcandidatepairchange: IceTransportEventHandler; } // https://www.w3.org/TR/webrtc/#idl-def-rtcdtlstransport +type DtlsTransportEventHandler = ((this: RTCDtlsTransport, ev: Event) => any) | null; interface RTCDtlsTransport { readonly transport: RTCIceTransport; //readonly state: RTCDtlsTransportState; getRemoteCertificates(): ArrayBuffer[]; - onstatechange: EventHandler; + onstatechange: DtlsTransportEventHandler; } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcodeccapability @@ -79,7 +80,7 @@ interface RTCRtpCodecCapability { // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpheaderextensioncapability interface RTCRtpHeaderExtensionCapability { - uri: string; + uri?: string; } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcapabilities @@ -99,17 +100,17 @@ interface RTCRtpFecParameters { } // https://www.w3.org/TR/webrtc/#idl-def-rtcdtxstatus -type RTCDtxStatus = 'disabled' | 'enabled'; +// type RTCDtxStatus = 'disabled' | 'enabled'; // https://www.w3.org/TR/webrtc/#idl-def-rtcprioritytype -type RTCPriorityType = 'very-low' | 'low' | 'medium' | 'high'; +// type RTCPriorityType = 'very-low' | 'low' | 'medium' | 'high'; // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpencodingparameters interface RTCRtpEncodingParameters { //ssrc: number; //rtx: RTCRtpRtxParameters; //fec: RTCRtpFecParameters; - dtx: RTCDtxStatus; + dtx?: RTCDtxStatus; //active: boolean; //priority: RTCPriorityType; //maxBitrate: number; @@ -121,7 +122,7 @@ interface RTCRtpEncodingParameters { interface RTCRtpHeaderExtensionParameters { //uri: string; //id: number; - encrypted: boolean; + encrypted?: boolean; } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtcpparameters @@ -136,7 +137,7 @@ interface RTCRtpCodecParameters { mimeType: string; //clockRate: number; channels?: number; // default = 1 - sdpFmtpLine: string; + sdpFmtpLine?: string; } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpparameters @@ -152,9 +153,9 @@ interface RTCRtpParameters { // https://www.w3.org/TR/webrtc/#dom-rtcrtpcontributingsource interface RTCRtpContributingSource { //readonly timestamp: number; - readonly source: number; + source: number; //readonly audioLevel: number | null; - readonly voiceActivityFlag: boolean | null; + readonly voiceActivityFlag?: boolean | undefined; } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtpcapabilities @@ -183,7 +184,7 @@ interface RTCRtpReceiver { } // https://www.w3.org/TR/webrtc/#idl-def-rtcrtptransceiverdirection -type RTCRtpTransceiverDirection = 'sendrecv' | 'sendonly' | 'recvonly' | 'inactive'; +// type RTCRtpTransceiverDirection = 'sendrecv' | 'sendonly' | 'recvonly' | 'inactive'; // https://www.w3.org/TR/webrtc/#idl-def-rtcrtptransceiver interface RTCRtpTransceiver { @@ -191,7 +192,7 @@ interface RTCRtpTransceiver { readonly sender: RTCRtpSender; readonly receiver: RTCRtpReceiver; readonly stopped: boolean; - readonly direction: RTCRtpTransceiverDirection; + direction: RTCRtpTransceiverDirection; setDirection(direction: RTCRtpTransceiverDirection): void; stop(): void; setCodecPreferences(codecs: RTCRtpCodecCapability[]): void; @@ -200,8 +201,8 @@ interface RTCRtpTransceiver { // https://www.w3.org/TR/webrtc/#idl-def-rtcrtptransceiverinit interface RTCRtpTransceiverInit { direction?: RTCRtpTransceiverDirection; // default = 'sendrecv' - streams: MediaStream[]; - sendEncodings: RTCRtpEncodingParameters[]; + streams?: MediaStream[]; + sendEncodings?: RTCRtpEncodingParameters[]; } // https://www.w3.org/TR/webrtc/#dom-rtccertificate @@ -241,12 +242,13 @@ interface RTCDataChannelInit { } // https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannelstate -type RTCDataChannelState = 'connecting' | 'open' | 'closing' | 'closed'; +// type RTCDataChannelState = 'connecting' | 'open' | 'closing' | 'closed'; // https://www.w3.org/TR/websockets/#dom-websocket-binarytype -type RTCBinaryType = 'blob' | 'arraybuffer'; +// type RTCBinaryType = 'blob' | 'arraybuffer'; // https://www.w3.org/TR/webrtc/#idl-def-rtcdatachannel +type DataChannelEventHandler = ((this: RTCDataChannel, ev: E) => any) | null; interface RTCDataChannel extends EventTarget { readonly label: string; readonly ordered: boolean; @@ -254,33 +256,33 @@ interface RTCDataChannel extends EventTarget { readonly maxRetransmits: number | null; readonly protocol: string; readonly negotiated: boolean; - readonly id: number; + readonly id: number | null; readonly readyState: RTCDataChannelState; readonly bufferedAmount: number; bufferedAmountLowThreshold: number; - binaryType: RTCBinaryType; + binaryType: string; close(): void; send(data: string | Blob | ArrayBuffer | ArrayBufferView): void; - onopen: EventHandler; - onmessage: (event: MessageEvent) => void; - onbufferedamountlow: EventHandler; - onerror: (event: ErrorEvent) => void; - onclose: EventHandler; + onopen: DataChannelEventHandler; + onmessage: DataChannelEventHandler; + onbufferedamountlow: DataChannelEventHandler; + onerror: DataChannelEventHandler; + onclose: DataChannelEventHandler; } // https://www.w3.org/TR/webrtc/#h-rtctrackevent interface RTCTrackEvent extends Event { readonly receiver: RTCRtpReceiver; readonly track: MediaStreamTrack; - readonly streams: MediaStream[]; + readonly streams: ReadonlyArray; readonly transceiver: RTCRtpTransceiver; } // https://www.w3.org/TR/webrtc/#h-rtcpeerconnectioniceevent interface RTCPeerConnectionIceEvent extends Event { - readonly url: string; + readonly url: string | null; } // https://www.w3.org/TR/webrtc/#h-rtcpeerconnectioniceerrorevent @@ -297,6 +299,7 @@ interface RTCDataChannelEvent { } // https://www.w3.org/TR/webrtc/#idl-def-rtcpeerconnection +type PeerConnectionEventHandler = ((this: RTCPeerConnection, ev: E) => any) | null; interface RTCPeerConnection extends EventTarget { createOffer(options?: RTCOfferOptions): Promise; createAnswer(options?: RTCAnswerOptions): Promise; @@ -320,8 +323,8 @@ interface RTCPeerConnection extends EventTarget { setConfiguration(configuration: RTCConfiguration): void; close(): void; - onicecandidateerror: (event: RTCPeerConnectionIceErrorEvent) => void; - onconnectionstatechange: EventHandler; + onicecandidateerror: PeerConnectionEventHandler; + onconnectionstatechange: PeerConnectionEventHandler; // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions getSenders(): RTCRtpSender[]; @@ -330,12 +333,12 @@ interface RTCPeerConnection extends EventTarget { addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender; removeTrack(sender: RTCRtpSender): void; addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver; - ontrack: (event: RTCTrackEvent) => void; + ontrack: PeerConnectionEventHandler; // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-1 readonly sctp: RTCSctpTransport | null; createDataChannel(label: string | null, dataChannelDict?: RTCDataChannelInit): RTCDataChannel; - ondatachannel: (event: RTCDataChannelEvent) => void; + ondatachannel: PeerConnectionEventHandler; // Extension: https://www.w3.org/TR/webrtc/#h-rtcpeerconnection-interface-extensions-2 getStats(selector?: MediaStreamTrack | null): Promise;