openrtc 1.0.5 → 1.0.6
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/dist/DelegatingRuntimeAdapter-lFDUNBy9.d.ts +120 -0
- package/dist/assembly-C2G0P2L5.d.ts +718 -0
- package/dist/chunk-SJ5BFL6W.js +2 -0
- package/dist/index.d.ts +8 -56
- package/dist/index.js +1 -2
- package/dist/native.d.ts +5 -5
- package/dist/native.js +1 -1
- package/dist/runtime/WasmRuntimeAdapter.d.ts +2 -2
- package/dist/runtime/device-status.d.ts +2 -2
- package/dist/runtime/index.d.ts +8 -8
- package/dist/runtime/tauri.d.ts +3 -3
- package/dist/spaceTokens-3sbs1mUF.d.ts +297 -0
- package/dist/tauri-WEvOC_Z6.d.ts +33 -0
- package/dist/transport/index.d.ts +2 -2
- package/dist/types-N9s66nF8.d.ts +573 -0
- package/dist/types-ZDsZknDI.d.ts +937 -0
- package/package.json +1 -1
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { D as DiscoveryMode, A as AuthMode, d as SignalingMode, E as ExplicitFileDataSendParams, I as ISignalingBackend, e as RuntimeIdentity, f as Device, g as DeviceStatusSnapshot, P as PeerSessionSnapshot, R as ResolvedPeerIdentity, M as ManagedConnectionRecord, h as SignalingEnvelope, i as DeviceEvent, j as SignalingSession, k as SessionEvent, L as LocalDeviceInfo, N as NativeManagedSessionStartResult, G as GrantScope, B as BackendPeerBiStream, l as BackendPeerUniStream, m as NativeConnectParams, n as NativeConnectResult, o as BackendConnectionState } from './types-ZDsZknDI.js';
|
|
2
|
+
import { A as AuthContext } from './IEngineBridge-C7OT2CRv.js';
|
|
3
|
+
import { R as RuntimeCapabilities } from './capabilities-C4Dqs_pB.js';
|
|
4
|
+
|
|
5
|
+
interface WasmBridgeOptions {
|
|
6
|
+
apiKey?: string;
|
|
7
|
+
discoveryMode?: DiscoveryMode;
|
|
8
|
+
space?: string;
|
|
9
|
+
spaceKey?: string;
|
|
10
|
+
authMode?: AuthMode;
|
|
11
|
+
signalingMode?: SignalingMode;
|
|
12
|
+
projectId?: string;
|
|
13
|
+
storagePrefix?: string;
|
|
14
|
+
deviceIdPersistence?: 'persistent' | 'ephemeral';
|
|
15
|
+
endpointIdPersistence?: 'persistent' | 'ephemeral';
|
|
16
|
+
nodeIdPersistence?: 'persistent' | 'ephemeral';
|
|
17
|
+
localDeviceId?: string;
|
|
18
|
+
deviceName?: string;
|
|
19
|
+
turnCredentialsProvider?: () => Promise<{
|
|
20
|
+
iceServers?: RTCIceServer[];
|
|
21
|
+
} | null | undefined>;
|
|
22
|
+
applicationCrypto?: ExplicitFileDataSendParams['applicationCrypto'];
|
|
23
|
+
spaceAuth?: 'scoped-token';
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
declare abstract class DelegatingRuntimeAdapter implements ISignalingBackend {
|
|
27
|
+
protected readonly backend: ISignalingBackend;
|
|
28
|
+
protected constructor(backend: ISignalingBackend);
|
|
29
|
+
get currentUser(): RuntimeIdentity | null;
|
|
30
|
+
setAuthContext(context: AuthContext | null): Promise<void> | void;
|
|
31
|
+
signInAnonymously(): Promise<void>;
|
|
32
|
+
signInWithPluto(): Promise<void>;
|
|
33
|
+
signOut(): Promise<void>;
|
|
34
|
+
stopAuthScopedActivity(): Promise<void>;
|
|
35
|
+
getTurnCredentials(): Promise<any>;
|
|
36
|
+
updatePresence(localNodeId: string, ticketStr: string, isOnline: boolean, ttlMs: number, metadata?: string): Promise<void>;
|
|
37
|
+
refreshLivePresence(localNodeId: string, ticketStr: string, metadata?: string): Promise<void>;
|
|
38
|
+
setOffline(localNodeId: string): Promise<void>;
|
|
39
|
+
cleanupStaleDevices(): Promise<void>;
|
|
40
|
+
searchDevices(excludeNodeId?: string): Promise<Device[]>;
|
|
41
|
+
listDevicesWithStatus(): Promise<DeviceStatusSnapshot[]>;
|
|
42
|
+
getPeerSession(id: string): Promise<PeerSessionSnapshot | null>;
|
|
43
|
+
listPeerSessions(): Promise<PeerSessionSnapshot[]>;
|
|
44
|
+
waitForSettledPeer(id: string, timeoutMs?: number): Promise<PeerSessionSnapshot | null>;
|
|
45
|
+
resolvePeerIdentity(id: string): Promise<ResolvedPeerIdentity>;
|
|
46
|
+
resolvePeerConnectionRecords(id: string): Promise<ManagedConnectionRecord[]>;
|
|
47
|
+
updateDevice(deviceId: string, updates: {
|
|
48
|
+
deviceName?: string;
|
|
49
|
+
capabilities?: Device['capabilities'];
|
|
50
|
+
metadata?: string;
|
|
51
|
+
}): Promise<void>;
|
|
52
|
+
deleteDevice(deviceId: string): Promise<void>;
|
|
53
|
+
onDevicesChange(callback: (devices: Device[]) => void, excludeNodeId?: string): () => void;
|
|
54
|
+
onAuthChange(callback: (user: RuntimeIdentity | null) => void): () => void;
|
|
55
|
+
checkForSSOToken(): Promise<void>;
|
|
56
|
+
waitForAuth(): Promise<void>;
|
|
57
|
+
sendMessage(targetId: string, payload: string, state?: string, replyPayload?: string): Promise<string>;
|
|
58
|
+
pollMessages(targetId: string): Promise<SignalingEnvelope[]>;
|
|
59
|
+
subscribeDevices(userId: string): Promise<ReadableStream<DeviceEvent[]>>;
|
|
60
|
+
startAutoConnect(userId: string, localDeviceId: string): void;
|
|
61
|
+
startPresenceLoop(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): void;
|
|
62
|
+
createSession(session: SignalingSession): Promise<void>;
|
|
63
|
+
updateSession(sessionId: string, updateData: any): Promise<void>;
|
|
64
|
+
subscribeSessions(localDeviceId: string): Promise<ReadableStream<SessionEvent[]>>;
|
|
65
|
+
forceReconnectSnapshot(): void;
|
|
66
|
+
getLocalDeviceId(): Promise<string | null>;
|
|
67
|
+
getLocalDeviceInfo(): Promise<LocalDeviceInfo | null>;
|
|
68
|
+
updateLocalDeviceName(deviceName: string): Promise<LocalDeviceInfo | null>;
|
|
69
|
+
startManagedSessionNative(options: {
|
|
70
|
+
userId: string;
|
|
71
|
+
deviceName?: string;
|
|
72
|
+
localDeviceId?: string | null;
|
|
73
|
+
metadata?: string;
|
|
74
|
+
autoConnect?: boolean;
|
|
75
|
+
presence?: boolean;
|
|
76
|
+
}): Promise<NativeManagedSessionStartResult>;
|
|
77
|
+
notifyNetworkChange(options?: {
|
|
78
|
+
reason?: string;
|
|
79
|
+
}): Promise<unknown>;
|
|
80
|
+
getManagedNodeId(options?: {
|
|
81
|
+
initializeIfMissing?: boolean;
|
|
82
|
+
}): Promise<string | null>;
|
|
83
|
+
startPresenceLoopOnce(userId: string, localNodeId: string, deviceName: string, ticket: string, metadata?: string): Promise<void>;
|
|
84
|
+
startAutoConnectOnce(userId: string, localDeviceId: string): Promise<void>;
|
|
85
|
+
getEndpointTicket(): Promise<string>;
|
|
86
|
+
getEndpointTicketWithToken(scope: GrantScope, maxConnections: number): Promise<string | null>;
|
|
87
|
+
registerSessionToken(token: string, scope: GrantScope, maxConnections: number): Promise<void>;
|
|
88
|
+
revokeSessionTokensByScope(scope: GrantScope): Promise<string[]>;
|
|
89
|
+
openPeerBi(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
90
|
+
incoming_streams(): Promise<ReadableStream<unknown>>;
|
|
91
|
+
is_current_transport_stable_id(endpointId: string, transportStableId: bigint): Promise<boolean>;
|
|
92
|
+
openPeerNativeBi(id: string, label: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
93
|
+
openPeerBiTransportOnly(id: string, timeoutMs?: number): Promise<BackendPeerBiStream>;
|
|
94
|
+
openPeerUni(id: string, timeoutMs?: number): Promise<BackendPeerUniStream>;
|
|
95
|
+
connectToDevice(params: NativeConnectParams): Promise<NativeConnectResult>;
|
|
96
|
+
disconnectDevice(deviceId: string): Promise<void>;
|
|
97
|
+
isConnected(nodeId: string): Promise<boolean>;
|
|
98
|
+
getConnectionStates(): Promise<BackendConnectionState[]>;
|
|
99
|
+
onConnectionStateChange(callback: (state: BackendConnectionState) => void): Promise<() => void> | (() => void);
|
|
100
|
+
/** @deprecated Use named channels or `openrtc-file-transfer`. */
|
|
101
|
+
sendExplicitFilePath(connectionId: string, filePath: string, transferId?: string): Promise<string>;
|
|
102
|
+
/** @deprecated Use named channels or `openrtc-file-transfer`. */
|
|
103
|
+
sendExplicitFileData(params: ExplicitFileDataSendParams): Promise<void>;
|
|
104
|
+
/** @deprecated Transfer history belongs to the consumer application. */
|
|
105
|
+
getTransferHistory(limit?: number): Promise<Array<[string, unknown]>>;
|
|
106
|
+
/** @deprecated Transfer history belongs to the consumer application. */
|
|
107
|
+
deleteTransferJob(jobId: string): Promise<void>;
|
|
108
|
+
getRuntimeCapabilities(): RuntimeCapabilities;
|
|
109
|
+
onIncomingNativeMessage(callback: (connectionId: string, remoteNodeId: string | null, message: any) => void): Promise<() => void>;
|
|
110
|
+
unwrap(): ISignalingBackend;
|
|
111
|
+
/**
|
|
112
|
+
* Forward setCoreClient() to the inner backend if it implements it. This
|
|
113
|
+
* lets the core Client inject a reference into backends (e.g. WasmBridge)
|
|
114
|
+
* that need to escalate transport-level dials into full Client.connect()
|
|
115
|
+
* handshakes.
|
|
116
|
+
*/
|
|
117
|
+
setCoreClient(client: unknown): void;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export { DelegatingRuntimeAdapter as D, type WasmBridgeOptions as W };
|