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
|
@@ -1,40 +1,49 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
1
2
|
import 'node-domexception';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
import { SelectedCandidateInfo } from '../lib/types';
|
|
4
|
+
import { PeerConnection } from '../lib/index';
|
|
5
|
+
import RTCSessionDescription from './RTCSessionDescription';
|
|
6
|
+
import RTCDataChannel from './RTCDataChannel';
|
|
7
|
+
import RTCIceCandidate from './RTCIceCandidate';
|
|
8
|
+
import { RTCDataChannelEvent, RTCPeerConnectionIceEvent } from './Events';
|
|
9
|
+
import RTCSctpTransport from './RTCSctpTransport';
|
|
10
|
+
import * as exceptions from './Exception';
|
|
11
|
+
import RTCCertificate from './RTCCertificate';
|
|
12
|
+
|
|
13
|
+
// extend RTCConfiguration with peerIdentity
|
|
14
|
+
interface RTCConfiguration extends globalThis.RTCConfiguration {
|
|
15
|
+
peerIdentity?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export default class RTCPeerConnection extends EventTarget implements globalThis.RTCPeerConnection {
|
|
19
|
+
static async generateCertificate(): Promise<RTCCertificate> {
|
|
12
20
|
throw new DOMException('Not implemented');
|
|
13
21
|
}
|
|
14
22
|
|
|
15
|
-
#peerConnection;
|
|
16
|
-
#localOffer;
|
|
17
|
-
#localAnswer;
|
|
18
|
-
#dataChannels
|
|
23
|
+
#peerConnection: PeerConnection;
|
|
24
|
+
#localOffer: any;
|
|
25
|
+
#localAnswer: any;
|
|
26
|
+
#dataChannels: Set<RTCDataChannel>;
|
|
19
27
|
#dataChannelsClosed = 0;
|
|
20
|
-
#config;
|
|
21
|
-
#canTrickleIceCandidates;
|
|
22
|
-
#sctp;
|
|
23
|
-
|
|
24
|
-
#localCandidates = [];
|
|
25
|
-
#remoteCandidates = [];
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
28
|
+
#config: RTCConfiguration;
|
|
29
|
+
#canTrickleIceCandidates: boolean | null;
|
|
30
|
+
#sctp: RTCSctpTransport;
|
|
31
|
+
|
|
32
|
+
#localCandidates: RTCIceCandidate[] = [];
|
|
33
|
+
#remoteCandidates: RTCIceCandidate[] = [];
|
|
34
|
+
|
|
35
|
+
// events
|
|
36
|
+
onconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
37
|
+
ondatachannel: ((this: RTCPeerConnection, ev: RTCDataChannelEvent) => any) | null;
|
|
38
|
+
onicecandidate: ((this: RTCPeerConnection, ev: RTCPeerConnectionIceEvent) => any) | null;
|
|
39
|
+
onicecandidateerror: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
40
|
+
oniceconnectionstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
41
|
+
onicegatheringstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
42
|
+
onnegotiationneeded: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
43
|
+
onsignalingstatechange: ((this: RTCPeerConnection, ev: Event) => any) | null;
|
|
44
|
+
ontrack: ((this: RTCPeerConnection, ev: globalThis.RTCTrackEvent) => any) | null;
|
|
45
|
+
|
|
46
|
+
private _checkConfiguration(config: RTCConfiguration): void {
|
|
38
47
|
if (config && config.iceServers === undefined) config.iceServers = [];
|
|
39
48
|
if (config && config.iceTransportPolicy === undefined) config.iceTransportPolicy = 'all';
|
|
40
49
|
|
|
@@ -49,15 +58,15 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
49
58
|
|
|
50
59
|
// If iceServers is string convert to array
|
|
51
60
|
if (typeof config.iceServers[i].urls === 'string')
|
|
52
|
-
config.iceServers[i].urls = [config.iceServers[i].urls];
|
|
61
|
+
config.iceServers[i].urls = [config.iceServers[i].urls as string];
|
|
53
62
|
|
|
54
63
|
// urls can not be empty
|
|
55
|
-
if (config.iceServers[i].urls?.some((url) => url == ''))
|
|
56
|
-
throw exceptions.SyntaxError('IceServers urls cannot be empty');
|
|
64
|
+
if ((config.iceServers[i].urls as string[])?.some((url) => url == ''))
|
|
65
|
+
throw new exceptions.SyntaxError('IceServers urls cannot be empty');
|
|
57
66
|
|
|
58
67
|
// urls should be valid URLs and match the protocols "stun:|turn:|turns:"
|
|
59
68
|
if (
|
|
60
|
-
config.iceServers[i].urls?.some(
|
|
69
|
+
(config.iceServers[i].urls as string[])?.some(
|
|
61
70
|
(url) => {
|
|
62
71
|
try {
|
|
63
72
|
const parsedURL = new URL(url)
|
|
@@ -69,19 +78,19 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
69
78
|
},
|
|
70
79
|
)
|
|
71
80
|
)
|
|
72
|
-
throw exceptions.SyntaxError('IceServers urls wrong format');
|
|
81
|
+
throw new exceptions.SyntaxError('IceServers urls wrong format');
|
|
73
82
|
|
|
74
83
|
// If this is a turn server check for username and credential
|
|
75
|
-
if (config.iceServers[i].urls?.some((url) => url.startsWith('turn'))) {
|
|
84
|
+
if ((config.iceServers[i].urls as string[])?.some((url) => url.startsWith('turn'))) {
|
|
76
85
|
if (!config.iceServers[i].username)
|
|
77
|
-
throw exceptions.InvalidAccessError('IceServers username cannot be null');
|
|
86
|
+
throw new exceptions.InvalidAccessError('IceServers username cannot be null');
|
|
78
87
|
if (!config.iceServers[i].credential)
|
|
79
|
-
throw exceptions.InvalidAccessError('IceServers username cannot be undefined');
|
|
88
|
+
throw new exceptions.InvalidAccessError('IceServers username cannot be undefined');
|
|
80
89
|
}
|
|
81
90
|
|
|
82
91
|
// length of urls can not be 0
|
|
83
92
|
if (config.iceServers[i].urls?.length === 0)
|
|
84
|
-
throw exceptions.SyntaxError('IceServers urls cannot be empty');
|
|
93
|
+
throw new exceptions.SyntaxError('IceServers urls cannot be empty');
|
|
85
94
|
}
|
|
86
95
|
}
|
|
87
96
|
|
|
@@ -94,12 +103,14 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
94
103
|
throw new TypeError('IceTransportPolicy must be either "all" or "relay"');
|
|
95
104
|
}
|
|
96
105
|
|
|
97
|
-
setConfiguration(config) {
|
|
106
|
+
setConfiguration(config: RTCConfiguration): void {
|
|
98
107
|
this._checkConfiguration(config);
|
|
99
108
|
this.#config = config;
|
|
100
109
|
}
|
|
101
110
|
|
|
102
|
-
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
constructor(config: RTCConfiguration = { iceServers: [], iceTransportPolicy: 'all' }) {
|
|
103
114
|
super();
|
|
104
115
|
|
|
105
116
|
this._checkConfiguration(config);
|
|
@@ -110,8 +121,8 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
110
121
|
this.#canTrickleIceCandidates = null;
|
|
111
122
|
|
|
112
123
|
try {
|
|
113
|
-
|
|
114
|
-
|
|
124
|
+
const peerIdentity = (config as any)?.peerIdentity ?? `peer-${getRandomString(7)}`;
|
|
125
|
+
this.#peerConnection = new PeerConnection(peerIdentity,
|
|
115
126
|
{
|
|
116
127
|
...config,
|
|
117
128
|
iceServers:
|
|
@@ -131,8 +142,8 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
131
142
|
},
|
|
132
143
|
);
|
|
133
144
|
} catch (error) {
|
|
134
|
-
if (!error || !error.message) throw exceptions.NotFoundError('Unknown error');
|
|
135
|
-
throw exceptions.SyntaxError(error.message);
|
|
145
|
+
if (!error || !error.message) throw new exceptions.NotFoundError('Unknown error');
|
|
146
|
+
throw new exceptions.SyntaxError(error.message);
|
|
136
147
|
}
|
|
137
148
|
|
|
138
149
|
// forward peerConnection events
|
|
@@ -192,43 +203,43 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
192
203
|
if (this.onicegatheringstatechange) this.onicegatheringstatechange(e);
|
|
193
204
|
});
|
|
194
205
|
this.addEventListener('datachannel', (e) => {
|
|
195
|
-
if (this.ondatachannel) this.ondatachannel(e);
|
|
206
|
+
if (this.ondatachannel) this.ondatachannel(e as RTCDataChannelEvent);
|
|
196
207
|
});
|
|
197
208
|
this.addEventListener('icecandidate', (e) => {
|
|
198
|
-
if (this.onicecandidate) this.onicecandidate(e);
|
|
209
|
+
if (this.onicecandidate) this.onicecandidate(e as RTCPeerConnectionIceEvent);
|
|
199
210
|
});
|
|
200
211
|
|
|
201
212
|
this.#sctp = new RTCSctpTransport({
|
|
202
213
|
pc: this,
|
|
203
214
|
extraFunctions: {
|
|
204
|
-
maxDataChannelId: () => {
|
|
215
|
+
maxDataChannelId: (): number => {
|
|
205
216
|
return this.#peerConnection.maxDataChannelId();
|
|
206
217
|
},
|
|
207
|
-
maxMessageSize: () => {
|
|
218
|
+
maxMessageSize: (): number => {
|
|
208
219
|
return this.#peerConnection.maxMessageSize();
|
|
209
220
|
},
|
|
210
|
-
localCandidates: () => {
|
|
221
|
+
localCandidates: (): RTCIceCandidate[] => {
|
|
211
222
|
return this.#localCandidates;
|
|
212
223
|
},
|
|
213
|
-
remoteCandidates: () => {
|
|
224
|
+
remoteCandidates: (): RTCIceCandidate[] => {
|
|
214
225
|
return this.#remoteCandidates;
|
|
215
226
|
},
|
|
216
|
-
selectedCandidatePair: () => {
|
|
227
|
+
selectedCandidatePair: (): { local: SelectedCandidateInfo; remote: SelectedCandidateInfo } | null => {
|
|
217
228
|
return this.#peerConnection.getSelectedCandidatePair();
|
|
218
229
|
},
|
|
219
230
|
},
|
|
220
231
|
});
|
|
221
232
|
}
|
|
222
233
|
|
|
223
|
-
get canTrickleIceCandidates() {
|
|
234
|
+
get canTrickleIceCandidates(): boolean | null {
|
|
224
235
|
return this.#canTrickleIceCandidates;
|
|
225
236
|
}
|
|
226
237
|
|
|
227
|
-
get connectionState() {
|
|
238
|
+
get connectionState(): globalThis.RTCPeerConnectionState {
|
|
228
239
|
return this.#peerConnection.state();
|
|
229
240
|
}
|
|
230
241
|
|
|
231
|
-
get iceConnectionState() {
|
|
242
|
+
get iceConnectionState(): globalThis.RTCIceConnectionState {
|
|
232
243
|
let state = this.#peerConnection.iceState();
|
|
233
244
|
// libdatachannel uses 'completed' instead of 'connected'
|
|
234
245
|
// see /webrtc/getstats.html
|
|
@@ -236,43 +247,43 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
236
247
|
return state;
|
|
237
248
|
}
|
|
238
249
|
|
|
239
|
-
get iceGatheringState() {
|
|
250
|
+
get iceGatheringState(): globalThis.RTCIceGatheringState {
|
|
240
251
|
return this.#peerConnection.gatheringState();
|
|
241
252
|
}
|
|
242
253
|
|
|
243
|
-
get currentLocalDescription() {
|
|
244
|
-
return new RTCSessionDescription(this.#peerConnection.localDescription());
|
|
254
|
+
get currentLocalDescription(): RTCSessionDescription {
|
|
255
|
+
return new RTCSessionDescription(this.#peerConnection.localDescription() as any);
|
|
245
256
|
}
|
|
246
257
|
|
|
247
|
-
get currentRemoteDescription() {
|
|
248
|
-
return new RTCSessionDescription(this.#peerConnection.remoteDescription());
|
|
258
|
+
get currentRemoteDescription(): RTCSessionDescription {
|
|
259
|
+
return new RTCSessionDescription(this.#peerConnection.remoteDescription() as any);
|
|
249
260
|
}
|
|
250
261
|
|
|
251
|
-
get localDescription() {
|
|
252
|
-
return new RTCSessionDescription(this.#peerConnection.localDescription());
|
|
262
|
+
get localDescription(): RTCSessionDescription {
|
|
263
|
+
return new RTCSessionDescription(this.#peerConnection.localDescription() as any);
|
|
253
264
|
}
|
|
254
265
|
|
|
255
|
-
get pendingLocalDescription() {
|
|
256
|
-
return new RTCSessionDescription(this.#peerConnection.localDescription());
|
|
266
|
+
get pendingLocalDescription(): RTCSessionDescription {
|
|
267
|
+
return new RTCSessionDescription(this.#peerConnection.localDescription() as any);
|
|
257
268
|
}
|
|
258
269
|
|
|
259
|
-
get pendingRemoteDescription() {
|
|
260
|
-
return new RTCSessionDescription(this.#peerConnection.remoteDescription());
|
|
270
|
+
get pendingRemoteDescription(): RTCSessionDescription {
|
|
271
|
+
return new RTCSessionDescription(this.#peerConnection.remoteDescription() as any);
|
|
261
272
|
}
|
|
262
273
|
|
|
263
|
-
get remoteDescription() {
|
|
264
|
-
return new RTCSessionDescription(this.#peerConnection.remoteDescription());
|
|
274
|
+
get remoteDescription(): RTCSessionDescription {
|
|
275
|
+
return new RTCSessionDescription(this.#peerConnection.remoteDescription() as any);
|
|
265
276
|
}
|
|
266
277
|
|
|
267
|
-
get sctp() {
|
|
278
|
+
get sctp(): RTCSctpTransport {
|
|
268
279
|
return this.#sctp;
|
|
269
280
|
}
|
|
270
281
|
|
|
271
|
-
get signalingState() {
|
|
282
|
+
get signalingState(): globalThis.RTCSignalingState {
|
|
272
283
|
return this.#peerConnection.signalingState();
|
|
273
284
|
}
|
|
274
285
|
|
|
275
|
-
async addIceCandidate(candidate) {
|
|
286
|
+
async addIceCandidate(candidate?: globalThis.RTCIceCandidateInit | RTCIceCandidate): Promise<void> {
|
|
276
287
|
if (!candidate || !candidate.candidate) {
|
|
277
288
|
return;
|
|
278
289
|
}
|
|
@@ -289,12 +300,12 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
289
300
|
// ??
|
|
290
301
|
if (candidate.sdpMid && candidate.sdpMid.length > 3) {
|
|
291
302
|
// console.log(candidate.sdpMid);
|
|
292
|
-
throw exceptions.OperationError('Invalid sdpMid format');
|
|
303
|
+
throw new exceptions.OperationError('Invalid sdpMid format');
|
|
293
304
|
}
|
|
294
305
|
|
|
295
306
|
// We don't care about sdpMLineIndex, just for test
|
|
296
307
|
if (!candidate.sdpMid && candidate.sdpMLineIndex > 1) {
|
|
297
|
-
throw exceptions.OperationError('This is only for test case.');
|
|
308
|
+
throw new exceptions.OperationError('This is only for test case.');
|
|
298
309
|
}
|
|
299
310
|
|
|
300
311
|
try {
|
|
@@ -303,26 +314,28 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
303
314
|
new RTCIceCandidate({ candidate: candidate.candidate, sdpMid: candidate.sdpMid || '0' }),
|
|
304
315
|
);
|
|
305
316
|
} catch (error) {
|
|
306
|
-
if (!error || !error.message) throw exceptions.NotFoundError('Unknown error');
|
|
317
|
+
if (!error || !error.message) throw new exceptions.NotFoundError('Unknown error');
|
|
307
318
|
|
|
308
319
|
// Check error Message if contains specific message
|
|
309
320
|
if (error.message.includes('remote candidate without remote description'))
|
|
310
|
-
throw exceptions.InvalidStateError(error.message);
|
|
311
|
-
if (error.message.includes('Invalid candidate format')) throw exceptions.OperationError(error.message);
|
|
321
|
+
throw new exceptions.InvalidStateError(error.message);
|
|
322
|
+
if (error.message.includes('Invalid candidate format')) throw new exceptions.OperationError(error.message);
|
|
312
323
|
|
|
313
|
-
throw exceptions.NotFoundError(error.message);
|
|
324
|
+
throw new exceptions.NotFoundError(error.message);
|
|
314
325
|
}
|
|
315
326
|
}
|
|
316
327
|
|
|
317
|
-
|
|
328
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
329
|
+
addTrack(_track, ..._streams): globalThis.RTCRtpSender {
|
|
318
330
|
throw new DOMException('Not implemented');
|
|
319
331
|
}
|
|
320
332
|
|
|
321
|
-
|
|
333
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
334
|
+
addTransceiver(_trackOrKind, _init): globalThis.RTCRtpTransceiver {
|
|
322
335
|
throw new DOMException('Not implemented');
|
|
323
336
|
}
|
|
324
337
|
|
|
325
|
-
close() {
|
|
338
|
+
close(): void {
|
|
326
339
|
// close all channels before shutting down
|
|
327
340
|
this.#dataChannels.forEach((channel) => {
|
|
328
341
|
channel.close();
|
|
@@ -332,11 +345,12 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
332
345
|
this.#peerConnection.close();
|
|
333
346
|
}
|
|
334
347
|
|
|
335
|
-
createAnswer() {
|
|
348
|
+
createAnswer(): Promise<globalThis.RTCSessionDescriptionInit | any> {
|
|
336
349
|
return this.#localAnswer;
|
|
337
350
|
}
|
|
338
351
|
|
|
339
|
-
|
|
352
|
+
|
|
353
|
+
createDataChannel(label, opts = {}): RTCDataChannel {
|
|
340
354
|
const channel = this.#peerConnection.createDataChannel(label, opts);
|
|
341
355
|
const dataChannel = new RTCDataChannel(channel, opts);
|
|
342
356
|
|
|
@@ -350,32 +364,32 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
350
364
|
return dataChannel;
|
|
351
365
|
}
|
|
352
366
|
|
|
353
|
-
createOffer() {
|
|
367
|
+
createOffer(): Promise<globalThis.RTCSessionDescriptionInit | any> {
|
|
354
368
|
return this.#localOffer;
|
|
355
369
|
}
|
|
356
370
|
|
|
357
|
-
getConfiguration() {
|
|
371
|
+
getConfiguration(): globalThis.RTCConfiguration {
|
|
358
372
|
return this.#config;
|
|
359
373
|
}
|
|
360
374
|
|
|
361
|
-
getReceivers() {
|
|
375
|
+
getReceivers(): globalThis.RTCRtpReceiver[] {
|
|
362
376
|
throw new DOMException('Not implemented');
|
|
363
377
|
}
|
|
364
378
|
|
|
365
|
-
getSenders() {
|
|
379
|
+
getSenders(): globalThis.RTCRtpSender[] {
|
|
366
380
|
throw new DOMException('Not implemented');
|
|
367
381
|
}
|
|
368
382
|
|
|
369
|
-
getStats() {
|
|
383
|
+
getStats(): Promise<globalThis.RTCStatsReport> {
|
|
370
384
|
return new Promise((resolve) => {
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
385
|
+
const report = new Map();
|
|
386
|
+
const cp = this.#peerConnection.getSelectedCandidatePair();
|
|
387
|
+
const bytesSent = this.#peerConnection.bytesSent();
|
|
388
|
+
const bytesReceived = this.#peerConnection.bytesReceived();
|
|
389
|
+
const rtt = this.#peerConnection.rtt();
|
|
390
|
+
|
|
391
|
+
const localIdRs = getRandomString(8);
|
|
392
|
+
const localId = 'RTCIceCandidate_' + localIdRs;
|
|
379
393
|
report.set(localId, {
|
|
380
394
|
id: localId,
|
|
381
395
|
type: 'local-candidate',
|
|
@@ -385,8 +399,8 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
385
399
|
port: cp.local.port,
|
|
386
400
|
});
|
|
387
401
|
|
|
388
|
-
|
|
389
|
-
|
|
402
|
+
const remoteIdRs = getRandomString(8);
|
|
403
|
+
const remoteId = 'RTCIceCandidate_' + remoteIdRs;
|
|
390
404
|
report.set(remoteId, {
|
|
391
405
|
id: remoteId,
|
|
392
406
|
type: 'remote-candidate',
|
|
@@ -396,7 +410,7 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
396
410
|
port: cp.remote.port,
|
|
397
411
|
});
|
|
398
412
|
|
|
399
|
-
|
|
413
|
+
const candidateId = 'RTCIceCandidatePair_' + localIdRs + '_' + remoteIdRs;
|
|
400
414
|
report.set(candidateId, {
|
|
401
415
|
id: candidateId,
|
|
402
416
|
type: 'candidate-pair',
|
|
@@ -412,7 +426,7 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
412
426
|
currentRoundTripTime: rtt,
|
|
413
427
|
});
|
|
414
428
|
|
|
415
|
-
|
|
429
|
+
const transportId = 'RTCTransport_0_1';
|
|
416
430
|
report.set(transportId, {
|
|
417
431
|
id: transportId,
|
|
418
432
|
timestamp: Date.now(),
|
|
@@ -437,50 +451,50 @@ export default class _RTCPeerConnection extends EventTarget {
|
|
|
437
451
|
});
|
|
438
452
|
}
|
|
439
453
|
|
|
440
|
-
getTransceivers() {
|
|
454
|
+
getTransceivers(): globalThis.RTCRtpTransceiver[] {
|
|
441
455
|
return []; // throw new DOMException('Not implemented');
|
|
442
456
|
}
|
|
443
457
|
|
|
444
|
-
removeTrack() {
|
|
458
|
+
removeTrack(): void {
|
|
445
459
|
throw new DOMException('Not implemented');
|
|
446
460
|
}
|
|
447
461
|
|
|
448
|
-
restartIce() {
|
|
462
|
+
restartIce(): Promise<void> {
|
|
449
463
|
throw new DOMException('Not implemented');
|
|
450
464
|
}
|
|
451
465
|
|
|
452
|
-
async setLocalDescription(description) {
|
|
466
|
+
async setLocalDescription(description: globalThis.RTCSessionDescriptionInit): Promise<void> {
|
|
453
467
|
if (description?.type !== 'offer') {
|
|
454
468
|
// any other type causes libdatachannel to throw
|
|
455
469
|
return;
|
|
456
470
|
}
|
|
457
471
|
|
|
458
|
-
this.#peerConnection.setLocalDescription(description?.type);
|
|
472
|
+
this.#peerConnection.setLocalDescription(description?.type as any);
|
|
459
473
|
}
|
|
460
474
|
|
|
461
|
-
async setRemoteDescription(description) {
|
|
475
|
+
async setRemoteDescription(description: globalThis.RTCSessionDescriptionInit): Promise<void> {
|
|
462
476
|
if (description.sdp == null) {
|
|
463
477
|
throw new DOMException('Remote SDP must be set');
|
|
464
478
|
}
|
|
465
479
|
|
|
466
|
-
this.#peerConnection.setRemoteDescription(description.sdp, description.type);
|
|
480
|
+
this.#peerConnection.setRemoteDescription(description.sdp, description.type as any);
|
|
467
481
|
}
|
|
468
482
|
}
|
|
469
483
|
|
|
470
|
-
function createDeferredPromise() {
|
|
471
|
-
let resolve, reject;
|
|
484
|
+
function createDeferredPromise(): any {
|
|
485
|
+
let resolve: any, reject: any;
|
|
472
486
|
|
|
473
|
-
|
|
487
|
+
const promise = new Promise(function (_resolve, _reject) {
|
|
474
488
|
resolve = _resolve;
|
|
475
489
|
reject = _reject;
|
|
476
490
|
});
|
|
477
491
|
|
|
478
|
-
promise.resolve = resolve;
|
|
479
|
-
promise.reject = reject;
|
|
492
|
+
(promise as any).resolve = resolve;
|
|
493
|
+
(promise as any).reject = reject;
|
|
480
494
|
return promise;
|
|
481
495
|
}
|
|
482
496
|
|
|
483
|
-
function getRandomString(length) {
|
|
497
|
+
function getRandomString(length): string {
|
|
484
498
|
return Math.random()
|
|
485
499
|
.toString(36)
|
|
486
500
|
.substring(2, 2 + length);
|
|
@@ -1,18 +1,20 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
import RTCDtlsTransport from './RTCDtlsTransport';
|
|
3
|
+
import RTCPeerConnection from './RTCPeerConnection';
|
|
2
4
|
|
|
3
|
-
export default class
|
|
4
|
-
#pc = null;
|
|
5
|
+
export default class RTCSctpTransport extends EventTarget implements globalThis.RTCSctpTransport {
|
|
6
|
+
#pc: RTCPeerConnection = null;
|
|
5
7
|
#extraFunctions = null;
|
|
6
|
-
#transport = null;
|
|
8
|
+
#transport: RTCDtlsTransport = null;
|
|
7
9
|
|
|
8
|
-
onstatechange = null;
|
|
10
|
+
onstatechange: ((this: RTCSctpTransport, ev: Event) => any) | null = null;
|
|
9
11
|
|
|
10
|
-
constructor({ pc, extraFunctions }) {
|
|
12
|
+
constructor(initial: { pc: RTCPeerConnection, extraFunctions }) {
|
|
11
13
|
super();
|
|
12
|
-
this.#pc = pc;
|
|
13
|
-
this.#extraFunctions = extraFunctions;
|
|
14
|
+
this.#pc = initial.pc;
|
|
15
|
+
this.#extraFunctions = initial.extraFunctions;
|
|
14
16
|
|
|
15
|
-
this.#transport = new RTCDtlsTransport({ pc, extraFunctions });
|
|
17
|
+
this.#transport = new RTCDtlsTransport({ pc: initial.pc, extraFunctions: initial.extraFunctions });
|
|
16
18
|
|
|
17
19
|
// forward peerConnection events
|
|
18
20
|
this.#pc.addEventListener('connectionstatechange', () => {
|
|
@@ -25,29 +27,29 @@ export default class _RTCSctpTransport extends EventTarget {
|
|
|
25
27
|
});
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
get maxChannels() {
|
|
30
|
+
get maxChannels(): number | null {
|
|
29
31
|
if (this.state !== 'connected') return null;
|
|
30
32
|
return this.#pc ? this.#extraFunctions.maxDataChannelId() : 0;
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
get maxMessageSize() {
|
|
35
|
+
get maxMessageSize(): number {
|
|
34
36
|
if (this.state !== 'connected') return null;
|
|
35
37
|
return this.#pc ? this.#extraFunctions.maxMessageSize() : 0;
|
|
36
38
|
}
|
|
37
39
|
|
|
38
|
-
get state() {
|
|
40
|
+
get state(): globalThis.RTCSctpTransportState {
|
|
39
41
|
// reduce state from new, connecting, connected, disconnected, failed, closed, unknown
|
|
40
42
|
// to RTCSctpTransport states connecting, connected, closed
|
|
41
43
|
let state = this.#pc.connectionState;
|
|
42
44
|
if (state === 'new' || state === 'connecting') {
|
|
43
45
|
state = 'connecting';
|
|
44
|
-
} else if (state === 'disconnected' || state === 'failed' || state === 'closed'
|
|
46
|
+
} else if (state === 'disconnected' || state === 'failed' || state === 'closed') {
|
|
45
47
|
state = 'closed';
|
|
46
48
|
}
|
|
47
49
|
return state;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
|
-
get transport() {
|
|
52
|
+
get transport(): RTCDtlsTransport {
|
|
51
53
|
return this.#transport;
|
|
52
54
|
}
|
|
53
55
|
}
|
|
@@ -6,29 +6,24 @@
|
|
|
6
6
|
// sdp: 'v=0\r\no=- 1234567890 1234567890 IN IP4 192.168.1.1\r\ns=-\r\nt=0 0\r\na=ice-ufrag:abcd\r\na=ice-pwd:efgh\r\n'
|
|
7
7
|
// };
|
|
8
8
|
|
|
9
|
-
export default class
|
|
10
|
-
#type;
|
|
11
|
-
#sdp;
|
|
12
|
-
|
|
13
|
-
constructor(init = {}) {
|
|
14
|
-
// Allow Empty Constructor
|
|
15
|
-
// if (!init || !init.type || !init.sdp) {
|
|
16
|
-
// throw new DOMException('Type and sdp properties are required.');
|
|
17
|
-
// }
|
|
9
|
+
export default class RTCSessionDescription implements globalThis.RTCSessionDescriptionInit {
|
|
10
|
+
#type: globalThis.RTCSdpType;
|
|
11
|
+
#sdp: string;
|
|
18
12
|
|
|
13
|
+
constructor(init: globalThis.RTCSessionDescriptionInit) {
|
|
19
14
|
this.#type = init ? init.type : null;
|
|
20
15
|
this.#sdp = init ? init.sdp : null;
|
|
21
16
|
}
|
|
22
17
|
|
|
23
|
-
get type() {
|
|
18
|
+
get type(): globalThis.RTCSdpType {
|
|
24
19
|
return this.#type;
|
|
25
20
|
}
|
|
26
21
|
|
|
27
|
-
get sdp() {
|
|
22
|
+
get sdp(): string {
|
|
28
23
|
return this.#sdp;
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
toJSON() {
|
|
26
|
+
toJSON(): globalThis.RTCSessionDescriptionInit {
|
|
32
27
|
return {
|
|
33
28
|
sdp: this.#sdp,
|
|
34
29
|
type: this.#type,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import RTCCertificate from './RTCCertificate
|
|
2
|
-
import RTCDataChannel from './RTCDataChannel
|
|
3
|
-
import RTCDtlsTransport from './RTCDtlsTransport
|
|
4
|
-
import RTCIceCandidate from './RTCIceCandidate
|
|
5
|
-
import RTCIceTransport from './RTCIceTransport
|
|
6
|
-
import RTCPeerConnection from './RTCPeerConnection
|
|
7
|
-
import RTCSctpTransport from './RTCSctpTransport
|
|
8
|
-
import RTCSessionDescription from './RTCSessionDescription
|
|
9
|
-
import { RTCDataChannelEvent, RTCPeerConnectionIceEvent } from './Events
|
|
10
|
-
import RTCError from './RTCError
|
|
1
|
+
import RTCCertificate from './RTCCertificate';
|
|
2
|
+
import RTCDataChannel from './RTCDataChannel';
|
|
3
|
+
import RTCDtlsTransport from './RTCDtlsTransport';
|
|
4
|
+
import RTCIceCandidate from './RTCIceCandidate';
|
|
5
|
+
import RTCIceTransport from './RTCIceTransport';
|
|
6
|
+
import RTCPeerConnection from './RTCPeerConnection';
|
|
7
|
+
import RTCSctpTransport from './RTCSctpTransport';
|
|
8
|
+
import RTCSessionDescription from './RTCSessionDescription';
|
|
9
|
+
import { RTCDataChannelEvent, RTCPeerConnectionIceEvent } from './Events';
|
|
10
|
+
import RTCError from './RTCError';
|
|
11
11
|
|
|
12
12
|
export {
|
|
13
13
|
RTCCertificate,
|
package/tsconfig.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ESNext",
|
|
4
|
+
"moduleResolution": "Node",
|
|
5
|
+
"rootDir": ".",
|
|
6
|
+
"importsNotUsedAsValues": "remove",
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"forceConsistentCasingInFileNames": true,
|
|
10
|
+
"noImplicitAny": false,
|
|
11
|
+
"noImplicitThis": false,
|
|
12
|
+
"noImplicitReturns": true,
|
|
13
|
+
"strictNullChecks": false,
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"alwaysStrict": true,
|
|
16
|
+
"outDir": "./dist",
|
|
17
|
+
"module": "CommonJS"
|
|
18
|
+
},
|
|
19
|
+
"include": ["src/**/*", "test/**/*"],
|
|
20
|
+
"exclude": ["node_modules", "dist", "src/cpp", "test/wpt-tests/wpt"]
|
|
21
|
+
}
|
package/.eslintrc.cjs
DELETED
package/.github/FUNDING.yml
DELETED