Skip to content

Commit

Permalink
fix: add generate certificate method to peer connection polyfill
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
achingbrain committed Dec 7, 2023
1 parent 0ca669d commit 32871c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
3 changes: 3 additions & 0 deletions polyfill/RTCPeerConnection.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,4 +56,7 @@ export default class _RTCPeerConnection extends EventTarget implements RTCPeerCo
setConfiguration(configuration: RTCConfiguration): void;
setLocalDescription(description: RTCSessionDescriptionInit): Promise<void>;
setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;

// static methods
static generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
}
4 changes: 4 additions & 0 deletions polyfill/RTCPeerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 32871c6

Please sign in to comment.