From 32871c6f41de92e36647e7c5e238b14488988fbf Mon Sep 17 00:00:00 2001 From: achingbrain Date: Thu, 7 Dec 2023 17:25:01 +0000 Subject: [PATCH] fix: add generate certificate method to peer connection polyfill Adds a dummy implementation that just throws. I don't think this is ideal for the long term but weirdly in my app we only call this method in browsers, but the app builds using the polyfill types so it needs to be present. --- polyfill/RTCPeerConnection.d.ts | 3 +++ polyfill/RTCPeerConnection.js | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/polyfill/RTCPeerConnection.d.ts b/polyfill/RTCPeerConnection.d.ts index 06cf120..20b6aa8 100644 --- a/polyfill/RTCPeerConnection.d.ts +++ b/polyfill/RTCPeerConnection.d.ts @@ -56,4 +56,7 @@ export default class _RTCPeerConnection extends EventTarget implements RTCPeerCo setConfiguration(configuration: RTCConfiguration): void; setLocalDescription(description: RTCSessionDescriptionInit): Promise; setRemoteDescription(description: RTCSessionDescriptionInit): Promise; + + // static methods + static generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise; } diff --git a/polyfill/RTCPeerConnection.js b/polyfill/RTCPeerConnection.js index 100b442..be9913b 100644 --- a/polyfill/RTCPeerConnection.js +++ b/polyfill/RTCPeerConnection.js @@ -7,6 +7,10 @@ import RTCSctpTransport from './RTCSctpTransport.js'; import DOMException from 'node-domexception'; export default class _RTCPeerConnection extends EventTarget { + static async generateCertificate() { + throw new Error('Not implemented'); + } + #peerConnection; #localOffer; #localAnswer;