@webrtc-node/webrtc 0.2.1 → 0.2.3
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/CMakeLists.txt +11 -1
- package/README.md +1 -1
- package/index.d.ts +22 -4
- package/lib/index.js +404 -178
- package/package.json +9 -6
- package/scripts/prebuild-integrity.js +6 -0
- package/src/native/addon.cc +254 -114
- package/src/native/send_queue.hpp +96 -0
- package/src/native/teardown_tasks.hpp +60 -0
package/CMakeLists.txt
CHANGED
|
@@ -45,7 +45,8 @@ execute_process(
|
|
|
45
45
|
string(REPLACE "\"" "" NODE_ADDON_API_DIR "${NODE_ADDON_API_DIR}")
|
|
46
46
|
string(REPLACE "\\" "/" NODE_ADDON_API_DIR "${NODE_ADDON_API_DIR}")
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
# Released libdatachannel v0.24.6.
|
|
49
|
+
set(LIBDATACHANNEL_PINNED_COMMIT "6b1e2e620f1e37f0eafeee702eaea0043cb305fd" CACHE STRING
|
|
49
50
|
"Audited libdatachannel commit for this binding.")
|
|
50
51
|
|
|
51
52
|
set(LIBDATACHANNEL_REPOSITORY "https://github.com/paullouisageneau/libdatachannel.git" CACHE STRING
|
|
@@ -151,6 +152,8 @@ target_include_directories(${PROJECT_NAME} PRIVATE
|
|
|
151
152
|
|
|
152
153
|
target_compile_definitions(${PROJECT_NAME} PRIVATE
|
|
153
154
|
NAPI_VERSION=${WEBRTC_NODE_NAPI_VERSION}
|
|
155
|
+
# Worker termination can interrupt a callback while JavaScript is disabled.
|
|
156
|
+
NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS
|
|
154
157
|
RTC_STATIC
|
|
155
158
|
)
|
|
156
159
|
|
|
@@ -175,3 +178,10 @@ if(MSVC)
|
|
|
175
178
|
else()
|
|
176
179
|
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -Wextra -Wpedantic)
|
|
177
180
|
endif()
|
|
181
|
+
|
|
182
|
+
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/native-send-queue.cc")
|
|
183
|
+
find_package(Threads REQUIRED)
|
|
184
|
+
add_executable(webrtc_node_send_queue_test EXCLUDE_FROM_ALL test/native-send-queue.cc)
|
|
185
|
+
target_include_directories(webrtc_node_send_queue_test PRIVATE src/native)
|
|
186
|
+
target_link_libraries(webrtc_node_send_queue_test PRIVATE Threads::Threads)
|
|
187
|
+
endif()
|
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ to a `cmake-js` source build.
|
|
|
56
56
|
|
|
57
57
|
| OS | Prebuild targets | Node 20 | Node 22 | Node 24 |
|
|
58
58
|
| --- | --- | --- | --- | --- |
|
|
59
|
-
| Linux | x64 glibc, x64 musl | ✅ | ✅ | ✅ |
|
|
59
|
+
| Linux | x64 glibc, x64 musl, arm64 glibc | ✅ | ✅ | ✅ |
|
|
60
60
|
| macOS | x64, arm64 | ✅ | ✅ | ✅ |
|
|
61
61
|
| Windows | x64, arm64 | ✅ | ✅ | ✅ |
|
|
62
62
|
|
package/index.d.ts
CHANGED
|
@@ -53,7 +53,11 @@ export interface EventListenerObject<E extends Event = Event> {
|
|
|
53
53
|
|
|
54
54
|
export type EventListener<E extends Event = Event> = ((event: E) => void) | EventListenerObject<E>;
|
|
55
55
|
|
|
56
|
-
export interface
|
|
56
|
+
export interface EventListenerOptions {
|
|
57
|
+
capture?: boolean;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export interface AddEventListenerOptions extends EventListenerOptions {
|
|
57
61
|
once?: boolean;
|
|
58
62
|
}
|
|
59
63
|
|
|
@@ -63,7 +67,11 @@ export class EventTarget {
|
|
|
63
67
|
callback: EventListener | null,
|
|
64
68
|
options?: AddEventListenerOptions | boolean,
|
|
65
69
|
): void;
|
|
66
|
-
removeEventListener(
|
|
70
|
+
removeEventListener(
|
|
71
|
+
type: string,
|
|
72
|
+
callback: EventListener | null,
|
|
73
|
+
options?: EventListenerOptions | boolean,
|
|
74
|
+
): void;
|
|
67
75
|
dispatchEvent(event: Event): boolean;
|
|
68
76
|
}
|
|
69
77
|
|
|
@@ -82,6 +90,16 @@ export interface RTCIceServer {
|
|
|
82
90
|
credential?: string;
|
|
83
91
|
}
|
|
84
92
|
|
|
93
|
+
export interface RTCConfigurationInput
|
|
94
|
+
extends Omit<RTCConfiguration, "iceServers" | "certificates"> {
|
|
95
|
+
iceServers?: Iterable<RTCIceServerInput>;
|
|
96
|
+
certificates?: Iterable<RTCCertificate>;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export interface RTCIceServerInput extends Omit<RTCIceServer, "urls"> {
|
|
100
|
+
urls: string | Iterable<string>;
|
|
101
|
+
}
|
|
102
|
+
|
|
85
103
|
export interface RTCDataChannelInit {
|
|
86
104
|
ordered?: boolean;
|
|
87
105
|
maxPacketLifeTime?: number;
|
|
@@ -281,7 +299,7 @@ export class RTCSctpTransport extends EventTarget {
|
|
|
281
299
|
|
|
282
300
|
export class RTCPeerConnection extends EventTarget {
|
|
283
301
|
static generateCertificate(algorithm: RTCCertificateKeygenAlgorithm): Promise<RTCCertificate>;
|
|
284
|
-
constructor(configuration?:
|
|
302
|
+
constructor(configuration?: RTCConfigurationInput);
|
|
285
303
|
readonly localDescription: RTCSessionDescription | null;
|
|
286
304
|
readonly currentLocalDescription: RTCSessionDescription | null;
|
|
287
305
|
readonly pendingLocalDescription: RTCSessionDescription | null;
|
|
@@ -328,7 +346,7 @@ export class RTCPeerConnection extends EventTarget {
|
|
|
328
346
|
setRemoteDescription(description: RTCSessionDescriptionInit): Promise<void>;
|
|
329
347
|
addIceCandidate(candidate?: RTCIceCandidateInit | RTCIceCandidate | null): Promise<void>;
|
|
330
348
|
getConfiguration(): RTCConfiguration;
|
|
331
|
-
setConfiguration(configuration?:
|
|
349
|
+
setConfiguration(configuration?: RTCConfigurationInput): void;
|
|
332
350
|
restartIce(): void;
|
|
333
351
|
close(): void;
|
|
334
352
|
}
|