node-datachannel 0.5.0 → 0.5.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.
@@ -17,3 +17,4 @@ jobs:
17
17
  node-version: '16.x'
18
18
  - run: npm ci
19
19
  - run: npm run lint
20
+ - run: npm run test-types
package/CMakeLists.txt CHANGED
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.15)
2
2
  cmake_policy(SET CMP0091 NEW)
3
3
  cmake_policy(SET CMP0042 NEW)
4
4
 
5
- project(node_datachannel VERSION 0.5.0)
5
+ project(node_datachannel VERSION 0.5.1)
6
6
 
7
7
  # -Dnapi_build_version=8
8
8
  add_definitions(-DNAPI_VERSION=8)
@@ -35,7 +35,7 @@ include(FetchContent)
35
35
  FetchContent_Declare(
36
36
  libdatachannel
37
37
  GIT_REPOSITORY https://github.com/paullouisageneau/libdatachannel.git
38
- GIT_TAG "v0.19.2"
38
+ GIT_TAG "v0.19.4"
39
39
  )
40
40
 
41
41
  option(NO_MEDIA "Disable media transport support in libdatachannel" OFF)
package/package.json CHANGED
@@ -1,15 +1,11 @@
1
1
  {
2
2
  "name": "node-datachannel",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "libdatachannel node bindings",
5
5
  "type": "module",
6
6
  "exports": {
7
- ".": {
8
- "import": "./lib/index.js"
9
- },
10
- "./polyfill": {
11
- "import": "./polyfill/index.js"
12
- }
7
+ ".": "./lib/index.js",
8
+ "./polyfill": "./polyfill/index.js"
13
9
  },
14
10
  "typings": "lib/index.d.ts",
15
11
  "engines": {
@@ -30,7 +26,8 @@
30
26
  "clean": "cmake-js clean",
31
27
  "lint": "eslint lib/**/* test/**/*",
32
28
  "test": "NODE_OPTIONS=--experimental-vm-modules jest",
33
- "wpt-test": "node test/wpt.js"
29
+ "wpt-test": "node test/wpt.js",
30
+ "test-types": "tsc"
34
31
  },
35
32
  "binary": {
36
33
  "napi_versions": [
@@ -76,7 +73,7 @@
76
73
  "node-addon-api": "^7.0.0",
77
74
  "prebuild": "^12.0.0",
78
75
  "prettier": "^2.8.8",
79
- "typescript": "^4.6.3"
76
+ "typescript": "^5.3.2"
80
77
  },
81
78
  "dependencies": {
82
79
  "node-domexception": "^2.0.1",
@@ -18,7 +18,6 @@ export default class _RTCIceTransport extends EventTarget {
18
18
  this.dispatchEvent(new Event('gatheringstatechange'));
19
19
  });
20
20
  this.#pc.addEventListener('iceconnectionstatechange', () => {
21
- console.log('*********');
22
21
  this.dispatchEvent(new Event('statechange'));
23
22
  });
24
23
 
@@ -35,8 +35,10 @@ export default class _RTCPeerConnection extends EventTarget implements RTCPeerCo
35
35
  addTransceiver(trackOrKind: MediaStreamTrack | string, init?: RTCRtpTransceiverInit): RTCRtpTransceiver;
36
36
  close(): void;
37
37
  createAnswer(options?: RTCAnswerOptions): Promise<RTCSessionDescriptionInit>;
38
+ createAnswer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback): Promise<void>;
38
39
  createDataChannel(label: string, dataChannelDict?: RTCDataChannelInit): RTCDataChannel;
39
40
  createOffer(options?: RTCOfferOptions): Promise<RTCSessionDescriptionInit>;
41
+ createOffer(successCallback: RTCSessionDescriptionCallback, failureCallback: RTCPeerConnectionErrorCallback, options?: RTCOfferOptions): Promise<void>;
40
42
  getConfiguration(): RTCConfiguration;
41
43
  getReceivers(): RTCRtpReceiver[];
42
44
  getSenders(): RTCRtpSender[];
@@ -1,4 +1,4 @@
1
- import * as nodeDataChannel from '../lib/index.js';
1
+ import nodeDataChannel from '../lib/index.js';
2
2
 
3
3
  nodeDataChannel.initLogger('Debug');
4
4
  nodeDataChannel.preload();
@@ -1,5 +1,5 @@
1
1
  import polyfill from '../polyfill/index.js';
2
- import * as nodeDataChannel from '../lib/index.js';
2
+ import nodeDataChannel from '../lib/index.js';
3
3
 
4
4
  nodeDataChannel.initLogger('Info');
5
5
 
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es5",
4
+ "module": "commonjs",
5
+ "declaration": true,
6
+ "strict": true,
7
+ "esModuleInterop": true,
8
+ "noEmit": true
9
+ },
10
+ "exclude": [
11
+ "node_modules",
12
+ "build"
13
+ ]
14
+ }