Files
mattermost-mobile/types/modules/react-native-webrtc.d.ts
Christopher Poile a44074247e MM-46312 - Calls: Replace simple-peer with RTCPeer; use up-to-date upstream react-native-webrtc (#6898)
* move to latest react-native-webrtc release

* make this version of rtcpeer as close as possible to Call's version

* remove need for destroyCb

* upgrade webrtc

* continue merge

* upgrade webrtc

* new linting rules
2023-01-26 14:06:05 -05:00

30 lines
1.1 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {EventOnCandidate, EventOnConnectionStateChange, RTCIceCandidate} from 'react-native-webrtc';
import RTCTrackEvent from 'react-native-webrtc/lib/typescript/RTCTrackEvent';
// Only adding the types that are not included in the imported module.
declare module 'react-native-webrtc' {
export type RTCIceCredentialType = 'password';
export interface RTCIceServer {
credential?: string;
credentialType?: RTCIceCredentialType;
urls: string | string[];
username?: string;
}
export interface RTCPeerConnectionIceEvent extends Event {
readonly candidate: RTCIceCandidate | null;
}
export class RTCPeerConnection {
onconnectionstatechange?: ((event: Event) => void) | null;
onnegotiationneeded?: (() => void | Promise<void>) | null;
onicecandidate?: ((event: EventOnCandidate) => void) | null;
oniceconnectionstatechange?: ((event: EventOnConnectionStateChange) => void) | null;
ontrack?: ((event: RTCTrackEvent) => void) | null;
}
}