node-datachannel 0.12.0 → 0.20.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +5 -1
- package/.eslintrc.json +27 -0
- package/.prettierrc +12 -0
- package/CMakeLists.txt +13 -13
- package/dist/cjs/index.cjs +11 -0
- package/dist/cjs/index.cjs.map +1 -0
- package/dist/cjs/lib/datachannel-stream.cjs +101 -0
- package/dist/cjs/lib/datachannel-stream.cjs.map +1 -0
- package/dist/cjs/lib/index.cjs +61 -0
- package/dist/cjs/lib/index.cjs.map +1 -0
- package/dist/cjs/lib/node-datachannel.cjs +14 -0
- package/dist/cjs/lib/node-datachannel.cjs.map +1 -0
- package/dist/cjs/lib/websocket-server.cjs +44 -0
- package/dist/cjs/lib/websocket-server.cjs.map +1 -0
- package/dist/cjs/lib/websocket.cjs +8 -0
- package/dist/cjs/lib/websocket.cjs.map +1 -0
- package/dist/cjs/polyfill/Events.cjs +37 -0
- package/dist/cjs/polyfill/Events.cjs.map +1 -0
- package/dist/cjs/polyfill/Exception.cjs +34 -0
- package/dist/cjs/polyfill/Exception.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCCertificate.cjs +31 -0
- package/dist/cjs/polyfill/RTCCertificate.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCDataChannel.cjs +179 -0
- package/dist/cjs/polyfill/RTCDataChannel.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCDtlsTransport.cjs +52 -0
- package/dist/cjs/polyfill/RTCDtlsTransport.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCError.cjs +76 -0
- package/dist/cjs/polyfill/RTCError.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCIceCandidate.cjs +129 -0
- package/dist/cjs/polyfill/RTCIceCandidate.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCIceTransport.cjs +84 -0
- package/dist/cjs/polyfill/RTCIceTransport.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCPeerConnection.cjs +417 -0
- package/dist/cjs/polyfill/RTCPeerConnection.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCSctpTransport.cjs +61 -0
- package/dist/cjs/polyfill/RTCSctpTransport.cjs.map +1 -0
- package/dist/cjs/polyfill/RTCSessionDescription.cjs +37 -0
- package/dist/cjs/polyfill/RTCSessionDescription.cjs.map +1 -0
- package/dist/cjs/polyfill/index.cjs +42 -0
- package/dist/cjs/polyfill/index.cjs.map +1 -0
- package/dist/esm/index.mjs +8 -0
- package/dist/esm/index.mjs.map +1 -0
- package/dist/esm/lib/datachannel-stream.mjs +78 -0
- package/dist/esm/lib/datachannel-stream.mjs.map +1 -0
- package/dist/esm/lib/index.mjs +44 -0
- package/dist/esm/lib/index.mjs.map +1 -0
- package/dist/esm/lib/node-datachannel.mjs +18 -0
- package/dist/esm/lib/node-datachannel.mjs.map +1 -0
- package/dist/esm/lib/websocket-server.mjs +42 -0
- package/dist/esm/lib/websocket-server.mjs.map +1 -0
- package/dist/esm/lib/websocket.mjs +6 -0
- package/dist/esm/lib/websocket.mjs.map +1 -0
- package/dist/esm/polyfill/Events.mjs +34 -0
- package/dist/esm/polyfill/Events.mjs.map +1 -0
- package/dist/esm/polyfill/Exception.mjs +28 -0
- package/dist/esm/polyfill/Exception.mjs.map +1 -0
- package/dist/esm/polyfill/RTCCertificate.mjs +27 -0
- package/dist/esm/polyfill/RTCCertificate.mjs.map +1 -0
- package/dist/esm/polyfill/RTCDataChannel.mjs +175 -0
- package/dist/esm/polyfill/RTCDataChannel.mjs.map +1 -0
- package/dist/esm/polyfill/RTCDtlsTransport.mjs +48 -0
- package/dist/esm/polyfill/RTCDtlsTransport.mjs.map +1 -0
- package/dist/esm/polyfill/RTCError.mjs +72 -0
- package/dist/esm/polyfill/RTCError.mjs.map +1 -0
- package/dist/esm/polyfill/RTCIceCandidate.mjs +125 -0
- package/dist/esm/polyfill/RTCIceCandidate.mjs.map +1 -0
- package/dist/esm/polyfill/RTCIceTransport.mjs +80 -0
- package/dist/esm/polyfill/RTCIceTransport.mjs.map +1 -0
- package/dist/esm/polyfill/RTCPeerConnection.mjs +413 -0
- package/dist/esm/polyfill/RTCPeerConnection.mjs.map +1 -0
- package/dist/esm/polyfill/RTCSctpTransport.mjs +57 -0
- package/dist/esm/polyfill/RTCSctpTransport.mjs.map +1 -0
- package/dist/esm/polyfill/RTCSessionDescription.mjs +33 -0
- package/dist/esm/polyfill/RTCSessionDescription.mjs.map +1 -0
- package/dist/esm/polyfill/index.mjs +27 -0
- package/dist/esm/polyfill/index.mjs.map +1 -0
- package/dist/types/lib/datachannel-stream.d.ts +24 -0
- package/dist/types/lib/index.d.ts +164 -0
- package/dist/types/lib/types.d.ts +106 -0
- package/dist/types/lib/websocket-server.d.ts +13 -0
- package/dist/types/lib/websocket.d.ts +25 -0
- package/dist/types/polyfill/Events.d.ts +15 -0
- package/dist/types/polyfill/RTCCertificate.d.ts +8 -0
- package/dist/types/polyfill/RTCDataChannel.d.ts +29 -0
- package/dist/types/polyfill/RTCDtlsTransport.d.ts +17 -0
- package/dist/types/polyfill/RTCError.d.ts +16 -0
- package/dist/types/polyfill/RTCIceCandidate.d.ts +21 -0
- package/dist/types/polyfill/RTCIceTransport.d.ts +24 -0
- package/dist/types/polyfill/RTCPeerConnection.d.ts +56 -0
- package/dist/types/polyfill/RTCSctpTransport.d.ts +17 -0
- package/dist/types/polyfill/RTCSessionDescription.d.ts +9 -0
- package/{polyfill → dist/types/polyfill}/index.d.ts +3 -14
- package/jest.config.ts +14 -0
- package/package.json +47 -43
- package/rollup.config.mjs +63 -0
- package/src/index.ts +10 -0
- package/{lib/datachannel-stream.js → src/lib/datachannel-stream.ts} +16 -11
- package/src/lib/index.ts +180 -0
- package/src/lib/node-datachannel.ts +13 -0
- package/src/lib/types.ts +126 -0
- package/{lib/websocket-server.js → src/lib/websocket-server.ts} +10 -8
- package/src/lib/websocket.ts +26 -0
- package/src/polyfill/Events.ts +33 -0
- package/src/polyfill/Exception.ts +37 -0
- package/src/polyfill/RTCCertificate.ts +17 -0
- package/{polyfill/RTCDataChannel.js → src/polyfill/RTCDataChannel.ts} +43 -40
- package/src/polyfill/RTCDtlsTransport.ts +47 -0
- package/src/polyfill/RTCError.ts +71 -0
- package/{polyfill/RTCIceCandidate.js → src/polyfill/RTCIceCandidate.ts} +35 -35
- package/{polyfill/RTCIceTransport.js → src/polyfill/RTCIceTransport.ts} +22 -20
- package/{polyfill/RTCPeerConnection.js → src/polyfill/RTCPeerConnection.ts} +128 -114
- package/{polyfill/RTCSctpTransport.js → src/polyfill/RTCSctpTransport.ts} +16 -14
- package/{polyfill/RTCSessionDescription.js → src/polyfill/RTCSessionDescription.ts} +7 -12
- package/{polyfill/index.js → src/polyfill/index.ts} +10 -10
- package/tsconfig.json +20 -13
- package/.eslintrc.cjs +0 -8
- package/.github/FUNDING.yml +0 -2
- package/.github/workflows/build-linux.yml +0 -109
- package/.github/workflows/build-mac-m1.yml +0 -38
- package/.github/workflows/build-mac-x64.yml +0 -40
- package/.github/workflows/build-win.yml +0 -74
- package/.github/workflows/lint.yml +0 -20
- package/.github/workflows/npm-publish-manual.yml +0 -23
- package/.prettierrc.cjs +0 -8
- package/build-containers/Dockerfile.alpine +0 -6
- package/build-containers/Dockerfile.debian +0 -7
- package/cmake/toolchain/ci.cmake +0 -23
- package/examples/client-server/README.md +0 -22
- package/examples/client-server/client-benchmark.js +0 -230
- package/examples/client-server/client-periodic.js +0 -189
- package/examples/client-server/client.js +0 -111
- package/examples/client-server/package-lock.json +0 -289
- package/examples/client-server/package.json +0 -16
- package/examples/client-server/signaling-server.js +0 -39
- package/examples/electron-demo/README.md +0 -58
- package/examples/electron-demo/forge.config.js +0 -49
- package/examples/electron-demo/package-lock.json +0 -15877
- package/examples/electron-demo/package.json +0 -44
- package/examples/electron-demo/src/index.css +0 -7
- package/examples/electron-demo/src/index.html +0 -29
- package/examples/electron-demo/src/main.js +0 -53
- package/examples/electron-demo/src/node-datachannel.js +0 -123
- package/examples/electron-demo/src/preload.js +0 -28
- package/examples/electron-demo/src/renderer.js +0 -58
- package/examples/electron-demo/webpack.main.config.js +0 -21
- package/examples/electron-demo/webpack.renderer.config.js +0 -13
- package/examples/electron-demo/webpack.rules.js +0 -35
- package/examples/media/README.md +0 -34
- package/examples/media/main.html +0 -45
- package/examples/media/media.js +0 -54
- package/examples/simple-peer-usage/main.js +0 -28
- package/examples/simple-peer-usage/package-lock.json +0 -317
- package/examples/simple-peer-usage/package.json +0 -16
- package/examples/websocket/websocket-client.js +0 -20
- package/examples/websocket/websocket-server.js +0 -22
- package/jest.config.cjs +0 -7
- package/lib/index.cjs +0 -194
- package/lib/index.d.cts +0 -300
- package/lib/index.d.ts +0 -300
- package/lib/index.js +0 -58
- package/lib/node-datachannel.js +0 -7
- package/polyfill/Events.d.ts +0 -9
- package/polyfill/Events.js +0 -29
- package/polyfill/Exception.js +0 -23
- package/polyfill/RTCCertificate.d.ts +0 -7
- package/polyfill/RTCCertificate.js +0 -17
- package/polyfill/RTCDataChannel.d.ts +0 -35
- package/polyfill/RTCDtlsTransport.d.ts +0 -10
- package/polyfill/RTCDtlsTransport.js +0 -47
- package/polyfill/RTCError.d.ts +0 -11
- package/polyfill/RTCError.js +0 -65
- package/polyfill/RTCIceCandidate.d.ts +0 -20
- package/polyfill/RTCIceTransport.d.ts +0 -18
- package/polyfill/RTCPeerConnection.d.ts +0 -62
- package/polyfill/RTCSctpTransport.d.ts +0 -10
- package/polyfill/RTCSessionDescription.d.ts +0 -8
- package/polyfill/index.cjs +0 -1333
- package/polyfill/index.d.cts +0 -37
- package/test/connectivity.js +0 -86
- package/test/jest-tests/basic.test.js +0 -37
- package/test/jest-tests/multiple-run.test.js +0 -73
- package/test/jest-tests/p2p.test.js +0 -99
- package/test/jest-tests/polyfill.test.js +0 -10
- package/test/jest-tests/streams.test.js +0 -48
- package/test/jest-tests/websocket.test.js +0 -69
- package/test/polyfill-connectivity.js +0 -89
- package/test/websockets.js +0 -50
- package/test/wpt-tests/README.md +0 -46
- package/test/wpt-tests/chrome-failed-tests.js +0 -42
- package/test/wpt-tests/index.js +0 -96
- package/test/wpt-tests/last-test-results.md +0 -301
- package/test/wpt-tests/package-lock.json +0 -1712
- package/test/wpt-tests/package.json +0 -19
- package/test/wpt-tests/wpt-test-list.js +0 -139
- package/test/wpt-tests/wpt.js +0 -131
- /package/src/{data-channel-wrapper.cpp → cpp/data-channel-wrapper.cpp} +0 -0
- /package/src/{data-channel-wrapper.h → cpp/data-channel-wrapper.h} +0 -0
- /package/src/{main.cpp → cpp/main.cpp} +0 -0
- /package/src/{media-audio-wrapper.cpp → cpp/media-audio-wrapper.cpp} +0 -0
- /package/src/{media-audio-wrapper.h → cpp/media-audio-wrapper.h} +0 -0
- /package/src/{media-direction.cpp → cpp/media-direction.cpp} +0 -0
- /package/src/{media-direction.h → cpp/media-direction.h} +0 -0
- /package/src/{media-rtcpreceivingsession-wrapper.cpp → cpp/media-rtcpreceivingsession-wrapper.cpp} +0 -0
- /package/src/{media-rtcpreceivingsession-wrapper.h → cpp/media-rtcpreceivingsession-wrapper.h} +0 -0
- /package/src/{media-track-wrapper.cpp → cpp/media-track-wrapper.cpp} +0 -0
- /package/src/{media-track-wrapper.h → cpp/media-track-wrapper.h} +0 -0
- /package/src/{media-video-wrapper.cpp → cpp/media-video-wrapper.cpp} +0 -0
- /package/src/{media-video-wrapper.h → cpp/media-video-wrapper.h} +0 -0
- /package/src/{peer-connection-wrapper.cpp → cpp/peer-connection-wrapper.cpp} +0 -0
- /package/src/{peer-connection-wrapper.h → cpp/peer-connection-wrapper.h} +0 -0
- /package/src/{rtc-wrapper.cpp → cpp/rtc-wrapper.cpp} +0 -0
- /package/src/{rtc-wrapper.h → cpp/rtc-wrapper.h} +0 -0
- /package/src/{thread-safe-callback.cpp → cpp/thread-safe-callback.cpp} +0 -0
- /package/src/{thread-safe-callback.h → cpp/thread-safe-callback.h} +0 -0
- /package/src/{web-socket-server-wrapper.cpp → cpp/web-socket-server-wrapper.cpp} +0 -0
- /package/src/{web-socket-server-wrapper.h → cpp/web-socket-server-wrapper.h} +0 -0
- /package/src/{web-socket-wrapper.cpp → cpp/web-socket-wrapper.cpp} +0 -0
- /package/src/{web-socket-wrapper.h → cpp/web-socket-wrapper.h} +0 -0
- /package/{polyfill → src/polyfill}/README.md +0 -0
package/polyfill/Exception.js
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
export const InvalidStateError = (msg) => {
|
|
2
|
-
return new DOMException(msg, 'InvalidStateError');
|
|
3
|
-
};
|
|
4
|
-
|
|
5
|
-
export const InvalidAccessError = (msg) => {
|
|
6
|
-
return new DOMException(msg, 'InvalidAccessError');
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const NotFoundError = (msg) => {
|
|
10
|
-
return new DOMException(msg, 'NotFoundError');
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
export const OperationError = (msg) => {
|
|
14
|
-
return new DOMException(msg, 'OperationError');
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const TypeError = (msg) => {
|
|
18
|
-
return new DOMException(msg, 'TypeError');
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export const SyntaxError = (msg) => {
|
|
22
|
-
return new DOMException(msg, 'SyntaxError');
|
|
23
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export default class RTCCertificate {
|
|
2
|
-
#expires;
|
|
3
|
-
#fingerprints;
|
|
4
|
-
|
|
5
|
-
constructor() {
|
|
6
|
-
this.#expires = null;
|
|
7
|
-
this.#fingerprints = [];
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
get expires() {
|
|
11
|
-
return this.#expires;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
getFingerprints() {
|
|
15
|
-
return this.#fingerprints;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
import * as NodeDataChannel from '../lib/index.js';
|
|
4
|
-
|
|
5
|
-
export default class _RTCDataChannel extends EventTarget implements RTCDataChannel {
|
|
6
|
-
constructor(dataChannel: NodeDataChannel.DataChannel, opts: RTCDataChannelInit);
|
|
7
|
-
|
|
8
|
-
// events
|
|
9
|
-
onbufferedamountlow: ((this: RTCDataChannel, ev: Event) => any) | null;
|
|
10
|
-
onclose: ((this: RTCDataChannel, ev: Event) => any) | null;
|
|
11
|
-
onclosing: ((this: RTCDataChannel, ev: Event) => any) | null;
|
|
12
|
-
onerror: ((this: RTCDataChannel, ev: Event) => any) | null;
|
|
13
|
-
onmessage: ((this: RTCDataChannel, ev: MessageEvent) => any) | null;
|
|
14
|
-
onopen: ((this: RTCDataChannel, ev: Event) => any) | null;
|
|
15
|
-
|
|
16
|
-
// props
|
|
17
|
-
binaryType: BinaryType;
|
|
18
|
-
bufferedAmountLowThreshold: number;
|
|
19
|
-
readonly bufferedAmount: number;
|
|
20
|
-
readonly id: number | null;
|
|
21
|
-
readonly label: string;
|
|
22
|
-
readonly maxPacketLifeTime: number | null;
|
|
23
|
-
readonly maxRetransmits: number | null;
|
|
24
|
-
readonly negotiated: boolean;
|
|
25
|
-
readonly ordered: boolean;
|
|
26
|
-
readonly protocol: string;
|
|
27
|
-
readonly readyState: RTCDataChannelState;
|
|
28
|
-
|
|
29
|
-
// methods
|
|
30
|
-
close(): void;
|
|
31
|
-
send(data: string): void;
|
|
32
|
-
send(data: ArrayBuffer): void;
|
|
33
|
-
send(data: ArrayBufferView): void;
|
|
34
|
-
send(data: Blob): void;
|
|
35
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export default class _RTCDtlsTransport extends EventTarget implements RTCDtlsTransport {
|
|
4
|
-
readonly iceTransport: RTCIceTransport;
|
|
5
|
-
readonly state: RTCDtlsTransportState;
|
|
6
|
-
getRemoteCertificates(): ArrayBuffer[];
|
|
7
|
-
|
|
8
|
-
onstatechange: ((this: RTCDtlsTransport, ev: Event) => any) | null;
|
|
9
|
-
onerror: ((this: RTCDtlsTransport, ev: Event) => any) | null;
|
|
10
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import RTCIceTransport from './RTCIceTransport.js';
|
|
2
|
-
|
|
3
|
-
export default class _RTCDtlsTransport extends EventTarget {
|
|
4
|
-
#pc = null;
|
|
5
|
-
#extraFunctions = null;
|
|
6
|
-
#iceTransport = null;
|
|
7
|
-
|
|
8
|
-
onerror = null;
|
|
9
|
-
onstatechange = null;
|
|
10
|
-
|
|
11
|
-
constructor({ pc, extraFunctions }) {
|
|
12
|
-
super();
|
|
13
|
-
this.#pc = pc;
|
|
14
|
-
this.#extraFunctions = extraFunctions;
|
|
15
|
-
|
|
16
|
-
this.#iceTransport = new RTCIceTransport({ pc, extraFunctions });
|
|
17
|
-
|
|
18
|
-
// forward peerConnection events
|
|
19
|
-
this.#pc.addEventListener('connectionstatechange', () => {
|
|
20
|
-
this.dispatchEvent(new Event('statechange'));
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
// forward events to properties
|
|
24
|
-
this.addEventListener('statechange', (e) => {
|
|
25
|
-
if (this.onstatechange) this.onstatechange(e);
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
get iceTransport() {
|
|
30
|
-
return this.#iceTransport;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
get state() {
|
|
34
|
-
// reduce state from new, connecting, connected, disconnected, failed, closed, unknown
|
|
35
|
-
// to RTCDtlsTRansport states new, connecting, connected, closed, failed
|
|
36
|
-
let state = this.#pc ? this.#pc.connectionState : 'new';
|
|
37
|
-
if (state === 'disconnected' || state === 'unknown') {
|
|
38
|
-
state = 'closed';
|
|
39
|
-
}
|
|
40
|
-
return state;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
getRemoteCertificates() {
|
|
44
|
-
// TODO: implement
|
|
45
|
-
return new ArrayBuffer(0);
|
|
46
|
-
}
|
|
47
|
-
}
|
package/polyfill/RTCError.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export class _RTCError extends DOMException implements RTCError {
|
|
4
|
-
constructor(init: RTCErrorInit, message?: string);
|
|
5
|
-
// type RTCErrorDetailType = "data-channel-failure" | "dtls-failure" | "fingerprint-failure" | "hardware-encoder-error" | "hardware-encoder-not-available" | "sctp-failure" | "sdp-syntax-error";
|
|
6
|
-
readonly errorDetail: RTCErrorDetailType;
|
|
7
|
-
readonly receivedAlert: number | null;
|
|
8
|
-
readonly sctpCauseCode: number | null;
|
|
9
|
-
readonly sdpLineNumber: number | null;
|
|
10
|
-
readonly sentAlert: number | null;
|
|
11
|
-
}
|
package/polyfill/RTCError.js
DELETED
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
export default class RTCError extends DOMException {
|
|
2
|
-
constructor(init, message = '') {
|
|
3
|
-
super(message, 'OperationError');
|
|
4
|
-
|
|
5
|
-
if (!init || !init.errorDetail) throw new TypeError('Cannot construct RTCError, errorDetail is required');
|
|
6
|
-
if (
|
|
7
|
-
[
|
|
8
|
-
'data-channel-failure',
|
|
9
|
-
'dtls-failure',
|
|
10
|
-
'fingerprint-failure',
|
|
11
|
-
'hardware-encoder-error',
|
|
12
|
-
'hardware-encoder-not-available',
|
|
13
|
-
'sctp-failure',
|
|
14
|
-
'sdp-syntax-error',
|
|
15
|
-
].indexOf(init.errorDetail) === -1
|
|
16
|
-
)
|
|
17
|
-
throw new TypeError('Cannot construct RTCError, errorDetail is invalid');
|
|
18
|
-
|
|
19
|
-
this._errorDetail = init.errorDetail;
|
|
20
|
-
this._receivedAlert = init.receivedAlert ?? null;
|
|
21
|
-
this._sctpCauseCode = init.sctpCauseCode ?? null;
|
|
22
|
-
this._sdpLineNumber = init.sdpLineNumber ?? null;
|
|
23
|
-
this._sentAlert = init.sentAlert ?? null;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
get errorDetail() {
|
|
27
|
-
return this._errorDetail;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
set errorDetail(value) {
|
|
31
|
-
throw new TypeError('Cannot set errorDetail, it is read-only');
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
get receivedAlert() {
|
|
35
|
-
return this._receivedAlert;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
set receivedAlert(value) {
|
|
39
|
-
throw new TypeError('Cannot set receivedAlert, it is read-only');
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
get sctpCauseCode() {
|
|
43
|
-
return this._sctpCauseCode;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
set sctpCauseCode(value) {
|
|
47
|
-
throw new TypeError('Cannot set sctpCauseCode, it is read-only');
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
get sdpLineNumber() {
|
|
51
|
-
return this._sdpLineNumber;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
set sdpLineNumber(value) {
|
|
55
|
-
throw new TypeError('Cannot set sdpLineNumber, it is read-only');
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
get sentAlert() {
|
|
59
|
-
return this._sentAlert;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
set sentAlert(value) {
|
|
63
|
-
throw new TypeError('Cannot set sentAlert, it is read-only');
|
|
64
|
-
}
|
|
65
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export default class _RTCIceCandidate implements RTCIceCandidate {
|
|
4
|
-
constructor(init: RTCIceCandidateInit);
|
|
5
|
-
readonly address: string | null;
|
|
6
|
-
readonly candidate: string;
|
|
7
|
-
readonly component: RTCIceComponent | null;
|
|
8
|
-
readonly foundation: string | null;
|
|
9
|
-
readonly port: number | null;
|
|
10
|
-
readonly priority: number | null;
|
|
11
|
-
readonly protocol: RTCIceProtocol | null;
|
|
12
|
-
readonly relatedAddress: string | null;
|
|
13
|
-
readonly relatedPort: number | null;
|
|
14
|
-
readonly sdpMLineIndex: number | null;
|
|
15
|
-
readonly sdpMid: string | null;
|
|
16
|
-
readonly tcpType: RTCIceTcpCandidateType | null;
|
|
17
|
-
readonly type: RTCIceCandidateType | null;
|
|
18
|
-
readonly usernameFragment: string | null;
|
|
19
|
-
toJSON(): RTCIceCandidateInit;
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export default class _RTCIceTransport extends EventTarget implements RTCIceTransport {
|
|
4
|
-
readonly component: RTCIceComponent;
|
|
5
|
-
readonly gatheringState: RTCIceGatheringState;
|
|
6
|
-
readonly role: string; // RTCIceRole;
|
|
7
|
-
readonly state: RTCIceTransportState;
|
|
8
|
-
|
|
9
|
-
getLocalCandidates(): RTCIceCandidate[];
|
|
10
|
-
getLocalParameters(): any; // RTCIceParameters;
|
|
11
|
-
getRemoteCandidates(): RTCIceCandidate[];
|
|
12
|
-
getRemoteParameters(): any; // RTCIceParameters;
|
|
13
|
-
getSelectedCandidatePair(): RTCIceCandidatePair | null;
|
|
14
|
-
|
|
15
|
-
ongatheringstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;
|
|
16
|
-
onselectedcandidatepairchange: ((this: RTCIceTransport, ev: Event) => any) | null;
|
|
17
|
-
onstatechange: ((this: RTCIceTransport, ev: Event) => any) | null;
|
|
18
|
-
}
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export default class _RTCPeerConnection extends EventTarget implements RTCPeerConnection {
|
|
4
|
-
constructor(config?: RTCConfiguration);
|
|
5
|
-
|
|
6
|
-
// events
|
|
7
|
-
onconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
8
|
-
ondatachannel: ((this: RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null;
|
|
9
|
-
onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;
|
|
10
|
-
onicecandidateerror: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
11
|
-
oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
12
|
-
onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
13
|
-
onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
14
|
-
onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
15
|
-
ontrack: ((this: RTCPeerConnection, ev: RTCTrackEvent) => any) | null;
|
|
16
|
-
|
|
17
|
-
// props
|
|
18
|
-
readonly canTrickleIceCandidates: boolean | null;
|
|
19
|
-
readonly connectionState: RTCPeerConnectionState;
|
|
20
|
-
readonly iceConnectionState: RTCIceConnectionState;
|
|
21
|
-
readonly iceGatheringState: RTCIceGatheringState;
|
|
22
|
-
readonly currentLocalDescription: RTCSessionDescription | null;
|
|
23
|
-
readonly currentRemoteDescription: RTCSessionDescription | null;
|
|
24
|
-
readonly localDescription: RTCSessionDescription | null;
|
|
25
|
-
readonly pendingLocalDescription: RTCSessionDescription | null;
|
|
26
|
-
readonly pendingRemoteDescription: RTCSessionDescription | null;
|
|
27
|
-
readonly remoteDescription: RTCSessionDescription | null;
|
|
28
|
-
readonly sctp: RTCSctpTransport | null;
|
|
29
|
-
readonly signalingState: RTCSignalingState;
|
|
30
|
-
|
|
31
|
-
// methods
|
|
32
|
-
generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
33
|
-
addIceCandidate(candidate?: RTCIceCandidateInit | RTCIceCandidate): Promise<void>;
|
|
34
|
-
addTrack(track: MediaStreamTrack, ...streams: MediaStream[]): RTCRtpSender;
|
|
35
|
-
addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver;
|
|
36
|
-
close(): void;
|
|
37
|
-
createAnswer(options?: RTCAnswerOptions): Promise<RTCSessionDescriptionInit>;
|
|
38
|
-
createAnswer(
|
|
39
|
-
successCallback: RTCSessionDescriptionCallback,
|
|
40
|
-
failureCallback: RTCPeerConnectionErrorCallback,
|
|
41
|
-
): Promise<void>;
|
|
42
|
-
createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel;
|
|
43
|
-
createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;
|
|
44
|
-
createOffer(
|
|
45
|
-
successCallback: RTCSessionDescriptionCallback,
|
|
46
|
-
failureCallback: RTCPeerConnectionErrorCallback,
|
|
47
|
-
options?: RTCOfferOptions,
|
|
48
|
-
): Promise<void>;
|
|
49
|
-
getConfiguration(): RTCConfiguration;
|
|
50
|
-
getReceivers(): RTCRtpReceiver[];
|
|
51
|
-
getSenders(): RTCRtpSender[];
|
|
52
|
-
getStats(selector?: MediaStreamTrack | null): Promise<RTCStatsReport>;
|
|
53
|
-
getTransceivers(): RTCRtpTransceiver[];
|
|
54
|
-
removeTrack(sender: RTCRtpSender): void;
|
|
55
|
-
restartIce(): Promise<void>;
|
|
56
|
-
setConfiguration(configuration: RTCConfiguration): void;
|
|
57
|
-
setLocalDescription(description: RTCSessionDescriptionInit): Promise<void>;
|
|
58
|
-
setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;
|
|
59
|
-
|
|
60
|
-
// static methods
|
|
61
|
-
static generateCertificate(keygenAlgorithm: AlgorithmIdentifier): Promise<RTCCertificate>;
|
|
62
|
-
}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference lib="dom" />
|
|
2
|
-
|
|
3
|
-
export default class _RTCSctpTransport extends EventTarget implements RTCSctpTransport {
|
|
4
|
-
readonly maxChannels: number | null;
|
|
5
|
-
readonly maxMessageSize: number;
|
|
6
|
-
readonly transport: RTCDtlsTransport;
|
|
7
|
-
readonly state: RTCSctpTransportState;
|
|
8
|
-
|
|
9
|
-
onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null;
|
|
10
|
-
}
|