openrtc 0.1.0 → 0.1.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/README.md +1 -2
- package/dist/{core/types.d.ts → DelegatingRuntimeAdapter-CW8d78dZ.d.ts} +275 -95
- package/dist/IpcRuntimeAdapter-CT-W0Mtp.d.ts +24 -0
- package/dist/auth/index.d.ts +75 -1
- package/dist/auth/index.js +1 -1
- package/dist/auth/internal.d.ts +3 -1
- package/dist/auth/internal.js +1 -1
- package/dist/chunk-4MH42GUI.js +2 -0
- package/dist/chunk-CQAKCS2S.js +4 -0
- package/dist/chunk-D54VGRRH.js +1 -0
- package/dist/chunk-DIQYFAGL.js +2 -0
- package/dist/chunk-PZ25OCVG.js +2 -0
- package/dist/chunk-UVASANPG.js +1 -0
- package/dist/factories-0TxDPMeu.d.ts +1041 -0
- package/dist/index.d.ts +160 -3
- package/dist/index.js +1 -3
- package/dist/openrtc_bg.wasm +0 -0
- package/dist/runtime/WasmRuntimeAdapter.d.ts +5 -3
- package/dist/runtime/WasmRuntimeAdapter.js +1 -11
- package/dist/runtime/index.d.ts +796 -6
- package/dist/runtime/index.js +1 -5
- package/dist/runtime/tauri.d.ts +12 -8
- package/dist/runtime/tauri.js +1 -22
- package/package.json +11 -7
- package/wasm/openrtc.d.ts +61 -25
- package/wasm/openrtc.js +417 -259
- package/wasm/openrtc_bg.wasm +0 -0
- package/wasm/openrtc_bg.wasm.d.ts +27 -24
- package/wasm/package.json +1 -1
- package/dist/OpenRTC.d.ts +0 -71
- package/dist/OpenRTC.js +0 -130
- package/dist/api/MediaTransport.d.ts +0 -7
- package/dist/api/MediaTransport.js +0 -262
- package/dist/api/PlutoPeerConnection.d.ts +0 -50
- package/dist/api/PlutoPeerConnection.js +0 -434
- package/dist/api/PlutoWebSocket.d.ts +0 -24
- package/dist/api/PlutoWebSocket.js +0 -113
- package/dist/api/PlutoWebTransport.d.ts +0 -29
- package/dist/api/PlutoWebTransport.js +0 -105
- package/dist/auth/host.d.ts +0 -73
- package/dist/auth/host.js +0 -513
- package/dist/compat/index.d.ts +0 -20
- package/dist/compat/index.js +0 -20
- package/dist/core/Client.d.ts +0 -352
- package/dist/core/Client.js +0 -3689
- package/dist/core/Connection.d.ts +0 -67
- package/dist/core/Connection.js +0 -404
- package/dist/core/IEngineBridge.d.ts +0 -18
- package/dist/core/IEngineBridge.js +0 -1
- package/dist/core/ISignalingTransport.d.ts +0 -13
- package/dist/core/ISignalingTransport.js +0 -1
- package/dist/core/PeerLifecycleManager.d.ts +0 -43
- package/dist/core/PeerLifecycleManager.js +0 -330
- package/dist/core/PeerProjectionStore.d.ts +0 -43
- package/dist/core/PeerProjectionStore.js +0 -327
- package/dist/core/PlutoRTC.d.ts +0 -13
- package/dist/core/PlutoRTC.js +0 -26
- package/dist/core/Room.d.ts +0 -47
- package/dist/core/Room.js +0 -376
- package/dist/core/Signaling.d.ts +0 -39
- package/dist/core/Signaling.js +0 -147
- package/dist/core/bridges/BridgeCodecs.d.ts +0 -19
- package/dist/core/bridges/BridgeCodecs.js +0 -317
- package/dist/core/bridges/BrowserFirestoreRooms.d.ts +0 -36
- package/dist/core/bridges/BrowserFirestoreRooms.js +0 -169
- package/dist/core/bridges/BrowserFirestoreSignaling.d.ts +0 -111
- package/dist/core/bridges/BrowserFirestoreSignaling.js +0 -1010
- package/dist/core/bridges/NativeIpcBridge.d.ts +0 -156
- package/dist/core/bridges/NativeIpcBridge.js +0 -1472
- package/dist/core/bridges/RtdbPresence.d.ts +0 -122
- package/dist/core/bridges/RtdbPresence.js +0 -201
- package/dist/core/bridges/TauriBridge.d.ts +0 -8
- package/dist/core/bridges/TauriBridge.js +0 -7
- package/dist/core/bridges/WasmBridge.d.ts +0 -233
- package/dist/core/bridges/WasmBridge.js +0 -1811
- package/dist/core/config.d.ts +0 -31
- package/dist/core/config.js +0 -138
- package/dist/core/transports/ITransport.d.ts +0 -12
- package/dist/core/transports/ITransport.js +0 -1
- package/dist/core/transports/LocalDaemonBridge.d.ts +0 -41
- package/dist/core/transports/LocalDaemonBridge.js +0 -227
- package/dist/core/transports/TauriSignaling.d.ts +0 -28
- package/dist/core/transports/TauriSignaling.js +0 -373
- package/dist/core/transports/TransportFactory.d.ts +0 -9
- package/dist/core/transports/TransportFactory.js +0 -59
- package/dist/core/transports/WasmSignaling.d.ts +0 -78
- package/dist/core/transports/WasmSignaling.js +0 -522
- package/dist/core/transports/WebRTCTransport.d.ts +0 -23
- package/dist/core/transports/WebRTCTransport.js +0 -132
- package/dist/core/trust.d.ts +0 -23
- package/dist/core/trust.js +0 -99
- package/dist/core/types.js +0 -19
- package/dist/moq/MoQMediaTransport.d.ts +0 -6
- package/dist/moq/MoQMediaTransport.js +0 -106
- package/dist/moq/MoQPublisher.d.ts +0 -22
- package/dist/moq/MoQPublisher.js +0 -179
- package/dist/moq/MoQSession.d.ts +0 -35
- package/dist/moq/MoQSession.js +0 -166
- package/dist/moq/MoQSubscriber.d.ts +0 -19
- package/dist/moq/MoQSubscriber.js +0 -235
- package/dist/moq/common.d.ts +0 -47
- package/dist/moq/common.js +0 -304
- package/dist/moq/messages.d.ts +0 -105
- package/dist/moq/messages.js +0 -367
- package/dist/presets/plutoHosted.d.ts +0 -13
- package/dist/presets/plutoHosted.js +0 -18
- package/dist/runtime/DelegatingRuntimeAdapter.d.ts +0 -68
- package/dist/runtime/DelegatingRuntimeAdapter.js +0 -250
- package/dist/runtime/IpcRuntimeAdapter.d.ts +0 -9
- package/dist/runtime/IpcRuntimeAdapter.js +0 -13
- package/dist/runtime/RuntimeClient.d.ts +0 -257
- package/dist/runtime/RuntimeClient.js +0 -1484
- package/dist/runtime/TauriRuntimeAdapter.d.ts +0 -1
- package/dist/runtime/TauriRuntimeAdapter.js +0 -1
- package/dist/runtime/factories.d.ts +0 -24
- package/dist/runtime/factories.js +0 -66
- package/dist/runtime/ipc.d.ts +0 -8
- package/dist/runtime/ipc.js +0 -65
- package/dist/runtime/ipcContract.d.ts +0 -46
- package/dist/runtime/ipcContract.js +0 -1
- package/dist/runtime/types.d.ts +0 -110
- package/dist/runtime/types.js +0 -1
- package/dist/transports/TauriTransport.d.ts +0 -17
- package/dist/transports/TauriTransport.js +0 -49
- package/dist/transports/WebTransport.d.ts +0 -23
- package/dist/transports/WebTransport.js +0 -71
- package/dist/utils/debug.d.ts +0 -4
- package/dist/utils/debug.js +0 -33
- package/dist/utils/runtime.d.ts +0 -1
- package/dist/utils/runtime.js +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,160 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
|
|
1
|
+
import { C as ConnectDeviceResult, a as ConnectDeviceHooks, b as ConnectDeviceOptions, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, c as RuntimeCapabilities, A as AuthContext } from './DelegatingRuntimeAdapter-CW8d78dZ.js';
|
|
2
|
+
export { d as AppLimits, e as AuthMode, f as DiscoveryMode, G as GrantScope, g as ProtocolCapability, h as ProtocolCapabilityMap, i as ProtocolName, j as RuntimeAdapterKind, S as SignalingMode } from './DelegatingRuntimeAdapter-CW8d78dZ.js';
|
|
3
|
+
import { R as RuntimeClientOptions, a as RuntimeClient, b as RuntimeDevice, c as RuntimeDeviceStatusSnapshot, d as RuntimeDeviceConnectOptions, e as RuntimeLocalDeviceInfo, f as RuntimeLocalDeviceProfile, g as RuntimePeerState, h as RuntimePeerConnectOptions, C as Connection, i as RuntimePeerReadinessSnapshot, j as RuntimePeerHealth, k as RuntimeChannelDescriptor, l as RuntimePeerStreamOptions, m as RuntimeIncomingStream, n as RuntimePolicySnapshot, o as RuntimeConnectionStateSnapshot, p as RuntimeConnectionEvent, P as PlutoRuntimeAssembly, q as RuntimeRawConnection } from './factories-0TxDPMeu.js';
|
|
4
|
+
export { r as ChannelDescriptor, s as ConnectionEvent, t as ConnectionTarget, D as DeviceProfile, I as IncomingStream, O as OPENRTC_RUNTIME_POLICY, u as PeerConnectOptions, v as PeerReadiness, w as PeerStreamOptions, x as PresenceLoopOptions, y as RawConnection, z as RuntimeAuthContext, A as RuntimeAuthIdentity, B as RuntimeAutoConnectPolicy, E as RuntimeConnectionTarget, F as RuntimeDeviceStatus, G as RuntimeJoinRoomOptions, H as RuntimeManagedSession, J as RuntimeManagedSessionKind, K as RuntimeManagedSessionOptions, L as RuntimeManagedSessionPlatform, M as RuntimePeerLifecycleStatus, N as RuntimePeerScope, Q as RuntimePeerSessionSnapshot, S as RuntimePresenceLoopOptions, T as RuntimePresencePolicy, U as RuntimeRoomMember, V as RuntimeSession, W as RuntimeUiConnectionStatus, X as ScopedSession, Y as Session, Z as SessionOptions, _ as getRuntimePolicy } from './factories-0TxDPMeu.js';
|
|
5
|
+
import { P as PlutoIpcBridge } from './IpcRuntimeAdapter-CT-W0Mtp.js';
|
|
6
|
+
import './runtime/WasmRuntimeAdapter.js';
|
|
7
|
+
|
|
8
|
+
interface OpenRTCDeviceNamespace {
|
|
9
|
+
list(): Promise<RuntimeDevice[]>;
|
|
10
|
+
listWithStatus(): Promise<RuntimeDeviceStatusSnapshot[]>;
|
|
11
|
+
watch(callback: (devices: RuntimeDevice[]) => void): () => void;
|
|
12
|
+
watchWithStatus(callback: (devices: RuntimeDeviceStatusSnapshot[]) => void): () => void;
|
|
13
|
+
connect(device: string | RuntimeDevice, options?: RuntimeDeviceConnectOptions): Promise<ConnectDeviceResult>;
|
|
14
|
+
connectWithRetry(device: string | RuntimeDevice, hooks: ConnectDeviceHooks, options: ConnectDeviceOptions): Promise<ConnectDeviceResult>;
|
|
15
|
+
disconnect(deviceId: string): Promise<void>;
|
|
16
|
+
update(deviceId: string, updates: {
|
|
17
|
+
deviceName?: string;
|
|
18
|
+
capabilities?: RuntimeDevice['capabilities'];
|
|
19
|
+
metadata?: string;
|
|
20
|
+
}): Promise<void>;
|
|
21
|
+
delete(deviceId: string): Promise<void>;
|
|
22
|
+
localId(): Promise<string | null>;
|
|
23
|
+
localInfo(): Promise<RuntimeLocalDeviceInfo | null>;
|
|
24
|
+
localProfile(options?: {
|
|
25
|
+
deviceName?: string;
|
|
26
|
+
localDeviceId?: string | null;
|
|
27
|
+
platform?: 'native' | 'web';
|
|
28
|
+
userId?: string | null;
|
|
29
|
+
}): Promise<RuntimeLocalDeviceProfile>;
|
|
30
|
+
updateLocalName(deviceName: string): Promise<RuntimeLocalDeviceInfo | null>;
|
|
31
|
+
}
|
|
32
|
+
interface OpenRTCPeerNamespace {
|
|
33
|
+
watch(callback: (peers: RuntimePeerState[]) => void): () => void;
|
|
34
|
+
get(id: string): RuntimePeerState | undefined;
|
|
35
|
+
listConnected(): RuntimePeerState[];
|
|
36
|
+
connect(options: RuntimePeerConnectOptions): Promise<Connection>;
|
|
37
|
+
disconnect(id: string, scope?: string): Promise<void>;
|
|
38
|
+
forceDisconnect(id: string): Promise<void>;
|
|
39
|
+
session(id: string): Promise<PeerSessionSnapshot | null>;
|
|
40
|
+
sessions(): Promise<PeerSessionSnapshot[]>;
|
|
41
|
+
waitConnected(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
|
|
42
|
+
readiness(id: string, timeoutMs?: number): Promise<RuntimePeerReadinessSnapshot>;
|
|
43
|
+
health(id: string): Promise<RuntimePeerHealth>;
|
|
44
|
+
identity(id: string): Promise<ResolvedPeerIdentity>;
|
|
45
|
+
addScope(id: string, scope?: string): RuntimePeerState | undefined;
|
|
46
|
+
releaseScope(id: string, scope?: string): RuntimePeerState | undefined;
|
|
47
|
+
scopes(id: string): string[];
|
|
48
|
+
refresh(): Promise<RuntimePeerState[]>;
|
|
49
|
+
}
|
|
50
|
+
interface OpenRTCChannelNamespace {
|
|
51
|
+
register(descriptor: RuntimeChannelDescriptor): void;
|
|
52
|
+
unregister(channelId: string): void;
|
|
53
|
+
list(): RuntimeChannelDescriptor[];
|
|
54
|
+
openBi(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
|
|
55
|
+
connection: Connection;
|
|
56
|
+
readable: ReadableStream<Uint8Array>;
|
|
57
|
+
writable: WritableStream<Uint8Array>;
|
|
58
|
+
}>;
|
|
59
|
+
openUni(id: string, channelId: string, options?: Omit<RuntimePeerStreamOptions, 'channelId'>): Promise<{
|
|
60
|
+
connection: Connection;
|
|
61
|
+
writable: WritableStream<Uint8Array>;
|
|
62
|
+
}>;
|
|
63
|
+
onIncoming(callback: (stream: RuntimeIncomingStream) => boolean | void): () => void;
|
|
64
|
+
onIncomingChannel(channelId: string, callback: (stream: RuntimeIncomingStream & {
|
|
65
|
+
channel: NonNullable<RuntimeIncomingStream['channel']>;
|
|
66
|
+
}) => boolean | void): () => void;
|
|
67
|
+
}
|
|
68
|
+
interface OpenRTCDiagnosticsNamespace {
|
|
69
|
+
status(): Promise<{
|
|
70
|
+
runtime: 'tauri' | 'browser' | 'unknown';
|
|
71
|
+
wasmLoaded: boolean;
|
|
72
|
+
localNodeId?: string;
|
|
73
|
+
userId?: string;
|
|
74
|
+
}>;
|
|
75
|
+
policy(): RuntimePolicySnapshot;
|
|
76
|
+
capabilities(): RuntimeCapabilities;
|
|
77
|
+
connectionStates(): Promise<RuntimeConnectionStateSnapshot[]>;
|
|
78
|
+
onConnectionStateChange(callback: (state: RuntimeConnectionStateSnapshot) => void): Promise<() => void> | (() => void);
|
|
79
|
+
connections(): Connection[];
|
|
80
|
+
onConnection(callback: (connection: Connection) => void): () => void;
|
|
81
|
+
onDisconnection(callback: (connection: Connection) => void): () => void;
|
|
82
|
+
onConnectionEvent(callback: (event: RuntimeConnectionEvent) => void): () => void;
|
|
83
|
+
forceReconnectSnapshot(): void;
|
|
84
|
+
}
|
|
85
|
+
interface OpenRTCAdvancedNamespace {
|
|
86
|
+
readonly runtime: RuntimeClient;
|
|
87
|
+
readonly assembly: PlutoRuntimeAssembly;
|
|
88
|
+
nodeId(): Promise<string>;
|
|
89
|
+
nodeIdFromTicket(ticket: string): Promise<string | null>;
|
|
90
|
+
endpointTicket(): Promise<string>;
|
|
91
|
+
connectRaw(target: {
|
|
92
|
+
ticket: string;
|
|
93
|
+
timeoutMs?: number;
|
|
94
|
+
}): Promise<RuntimeRawConnection>;
|
|
95
|
+
openBi(nodeId: string): Promise<{
|
|
96
|
+
readable: ReadableStream<Uint8Array>;
|
|
97
|
+
writable: WritableStream<Uint8Array>;
|
|
98
|
+
}>;
|
|
99
|
+
openUni(nodeId: string): Promise<WritableStream<Uint8Array>>;
|
|
100
|
+
isConnected(nodeId: string): Promise<boolean>;
|
|
101
|
+
disconnectNode(nodeId: string): Promise<void>;
|
|
102
|
+
setAutoConnectExcluded(deviceId: string, excluded: boolean): Promise<void>;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* OpenRTCClient extends RuntimeClient with auth helpers that were
|
|
106
|
+
* previously only available on PlutoRuntimeAssembly.
|
|
107
|
+
*
|
|
108
|
+
* This is the unified type returned by OpenRTC() and OpenRTC.native().
|
|
109
|
+
*/
|
|
110
|
+
interface OpenRTCClient extends RuntimeClient {
|
|
111
|
+
readonly devices: OpenRTCDeviceNamespace;
|
|
112
|
+
readonly peers: OpenRTCPeerNamespace;
|
|
113
|
+
readonly channels: OpenRTCChannelNamespace;
|
|
114
|
+
readonly diagnostics: OpenRTCDiagnosticsNamespace;
|
|
115
|
+
readonly advanced: OpenRTCAdvancedNamespace;
|
|
116
|
+
/** @deprecated Use setAuth() instead */
|
|
117
|
+
setAuthContext(context: AuthContext | null): Promise<void>;
|
|
118
|
+
/** Set auth context for the runtime */
|
|
119
|
+
setAuth(context: AuthContext | null): Promise<void>;
|
|
120
|
+
/** Sync Pluto-hosted auth to the runtime */
|
|
121
|
+
syncPlutoAuth(options?: {
|
|
122
|
+
userId?: string | null;
|
|
123
|
+
forceRefresh?: boolean;
|
|
124
|
+
}): Promise<void>;
|
|
125
|
+
/** Bind Pluto auth host to auto-sync on token changes */
|
|
126
|
+
bindPlutoAuthHost(): () => void;
|
|
127
|
+
/** Sign in via Pluto SSO */
|
|
128
|
+
signIn(): Promise<void>;
|
|
129
|
+
/** Sign out and clear auth context */
|
|
130
|
+
signOut(): Promise<void>;
|
|
131
|
+
/**
|
|
132
|
+
* Access to the underlying PlutoRuntimeAssembly for backward compatibility.
|
|
133
|
+
* @deprecated Access methods directly on the client instead.
|
|
134
|
+
*/
|
|
135
|
+
readonly runtime: RuntimeClient;
|
|
136
|
+
/**
|
|
137
|
+
* Access to the underlying PlutoRuntimeAssembly for backward compatibility.
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
readonly _assembly: PlutoRuntimeAssembly;
|
|
141
|
+
}
|
|
142
|
+
/**
|
|
143
|
+
* Create an OpenRTC client for browser/WASM environments.
|
|
144
|
+
*
|
|
145
|
+
* @example
|
|
146
|
+
* ```typescript
|
|
147
|
+
* import { OpenRTC } from 'openrtc';
|
|
148
|
+
* const client = OpenRTC({ apiKey: 'pk_live_...' });
|
|
149
|
+
* await client.connect();
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function OpenRTC(options: RuntimeClientOptions): OpenRTCClient;
|
|
153
|
+
declare namespace OpenRTC {
|
|
154
|
+
var native: (options: RuntimeClientOptions, bridge?: PlutoIpcBridge) => OpenRTCClient;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
type UpgradeState = 'none' | 'upgrading' | 'upgraded' | 'failed';
|
|
158
|
+
type OutboundMessage = string | object | ArrayBuffer | Uint8Array;
|
|
159
|
+
|
|
160
|
+
export { OpenRTC, type OpenRTCClient, RuntimeClientOptions as OpenRTCOptions, type OutboundMessage, RuntimeCapabilities, RuntimeChannelDescriptor, RuntimeClientOptions, RuntimeConnectionEvent, RuntimeConnectionStateSnapshot, RuntimeDevice, RuntimeDeviceConnectOptions, RuntimeDeviceStatusSnapshot, RuntimeIncomingStream, RuntimeLocalDeviceInfo, RuntimeLocalDeviceProfile, RuntimePeerConnectOptions, RuntimePeerHealth, RuntimePeerReadinessSnapshot, RuntimePeerState, RuntimePeerStreamOptions, RuntimePolicySnapshot, RuntimeRawConnection, type UpgradeState };
|
package/dist/index.js
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { RuntimeClient } from './runtime/RuntimeClient';
|
|
3
|
-
export { RuntimeClient as Client } from './runtime/RuntimeClient';
|
|
1
|
+
import {l,m as m$1}from'./chunk-CQAKCS2S.js';export{a as ScopedSession}from'./chunk-CQAKCS2S.js';import'./chunk-D54VGRRH.js';import {a}from'./chunk-DIQYFAGL.js';export{p as OPENRTC_RUNTIME_POLICY,q as getRuntimePolicy}from'./chunk-PZ25OCVG.js';import'./chunk-4MH42GUI.js';function m(t){let n={...t};if("auth"in t&&!t.authMode){let o=t.auth;n.authMode=o==="none"?"anonymous":o;}if("identity"in t&&!t.nodeIdPersistence){let o=t.identity;n.nodeIdPersistence=o==="temporary"?"ephemeral":o;}return "namespace"in t&&!t.storagePrefix&&(n.storagePrefix=t.namespace),"privacy"in t&&t.strictMode===void 0&&(n.strictMode=!!t.privacy),n}function d(t){let n=t.runtime,o=Object.create(n),s=async e=>{if(typeof e!="string")return e;let r=(await n.listDevices()).find(h=>h.deviceId===e);if(!r)throw new Error(`OpenRTC device '${e}' is not currently discoverable.`);return r},c=async e=>({...e,localDeviceId:e?.localDeviceId??await n.getLocalDeviceId()??""}),g={list:()=>n.listDevices(),listWithStatus:()=>n.listDevicesWithStatus(),watch:e=>n.watchDevices(e),watchWithStatus:e=>n.watchDevicesWithStatus(e),connect:async(e,i)=>n.connectDevice(await s(e),await c(i)),connectWithRetry:async(e,i,r)=>n.connectDeviceWithRetry(await s(e),i,r),disconnect:e=>n.disconnectDevice(e),update:(e,i)=>n.updateDevice(e,i),delete:e=>n.deleteDevice(e),localId:()=>n.getLocalDeviceId(),localInfo:()=>n.getLocalDeviceInfo(),localProfile:e=>n.getLocalDeviceProfile(e),updateLocalName:e=>n.updateLocalDeviceName(e)},v={watch:e=>n.watchPeerStates(e),get:e=>n.getPeerState(e),listConnected:()=>n.listConnectedPeers(),connect:e=>n.connectPeer(e),disconnect:(e,i)=>n.disconnectPeer(e,i),forceDisconnect:e=>n.forceDisconnectPeer(e),session:e=>n.getPeerSession(e),sessions:()=>n.listPeerSessions(),waitConnected:(e,i)=>n.waitForConnectedPeer(e,i),readiness:(e,i)=>n.getPeerReadiness(e,i),health:e=>n.getPeerHealth(e),identity:e=>n.resolvePeerIdentity(e),addScope:(e,i)=>n.addPeerScope(e,i),releaseScope:(e,i)=>n.releasePeerScope(e,i),scopes:e=>n.getPeerScopes(e),refresh:()=>n.refreshPeerSnapshot()},C={register:e=>n.registerChannel(e),unregister:e=>n.unregisterChannel(e),list:()=>n.listChannels(),openBi:(e,i,r)=>n.openPeerBi(e,{...r,channelId:i}),openUni:(e,i,r)=>n.openPeerUni(e,{...r,channelId:i}),onIncoming:e=>n.onIncomingStream(e),onIncomingChannel:(e,i)=>n.onIncomingChannelStream(e,r=>{if(r.channel)return i(r)})},R={status:()=>n.getRuntimeStatus(),policy:()=>n.getRuntimePolicy(),capabilities:()=>n.getRuntimeCapabilities(),connectionStates:()=>n.getConnectionStates(),onConnectionStateChange:e=>n.onConnectionStateChange(e),connections:()=>n.getConnections(),onConnection:e=>n.onConnection(e),onDisconnection:e=>n.onDisconnection(e),onConnectionEvent:e=>n.onConnectionEvent(e),forceReconnectSnapshot:()=>n.forceReconnectSnapshot()},P={runtime:n,assembly:t,nodeId:()=>n.getNodeId(),nodeIdFromTicket:e=>n.getNodeIdFromTicket(e),endpointTicket:()=>n.getEndpointTicket(),connectRaw:e=>n.connectRaw(e),openBi:e=>n.openBi(e),openUni:e=>n.openUni(e),isConnected:e=>n.isConnected(e),disconnectNode:e=>n.disconnectNode(e),setAutoConnectExcluded:(e,i)=>n.setAutoConnectExcluded(e,i)};return Object.defineProperties(o,{devices:{get:()=>g,enumerable:true},peers:{get:()=>v,enumerable:true},channels:{get:()=>C,enumerable:true},diagnostics:{get:()=>R,enumerable:true},advanced:{get:()=>P,enumerable:true},setAuth:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},setAuthContext:{value:e=>t.setAuthContext(e),enumerable:true,writable:true,configurable:true},syncPlutoAuth:{value:e=>t.syncPlutoAuth(e),enumerable:true,writable:true,configurable:true},bindPlutoAuthHost:{value:()=>t.bindPlutoAuthHost(),enumerable:true,writable:true,configurable:true},signIn:{value:()=>t.signInWithPluto(),enumerable:true,writable:true,configurable:true},signOut:{value:()=>t.signOut(),enumerable:true,writable:true,configurable:true},runtime:{get:()=>n,enumerable:false},_assembly:{get:()=>t,enumerable:false}}),o}function p(t){let n=m(t),o=l(n);return d(o)}p.native=function(t,n){let o=m(t),s=n??a(),c=m$1(o,s);return d(c)};export{p as OpenRTC};
|
|
Binary file
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { D as DelegatingRuntimeAdapter, W as WasmBridgeOptions } from '../DelegatingRuntimeAdapter-CW8d78dZ.js';
|
|
2
|
+
|
|
3
|
+
declare class WasmRuntimeAdapter extends DelegatingRuntimeAdapter {
|
|
4
4
|
constructor(options: WasmBridgeOptions);
|
|
5
5
|
setWasmClient(client: unknown): void;
|
|
6
6
|
}
|
|
7
|
+
|
|
8
|
+
export { WasmRuntimeAdapter };
|
|
@@ -1,11 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { DelegatingRuntimeAdapter } from './DelegatingRuntimeAdapter';
|
|
3
|
-
export class WasmRuntimeAdapter extends DelegatingRuntimeAdapter {
|
|
4
|
-
constructor(options) {
|
|
5
|
-
super(new WasmBridge(options));
|
|
6
|
-
}
|
|
7
|
-
setWasmClient(client) {
|
|
8
|
-
const backend = this.unwrap();
|
|
9
|
-
backend.setWasmClient(client);
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
export{a as WasmRuntimeAdapter}from'../chunk-D54VGRRH.js';import'../chunk-PZ25OCVG.js';import'../chunk-4MH42GUI.js';
|