diff --git a/lib/baseconnection.ts b/lib/baseconnection.ts index 4d503dc4e..855d67a41 100644 --- a/lib/baseconnection.ts +++ b/lib/baseconnection.ts @@ -60,5 +60,8 @@ export abstract class BaseConnection< abstract close(): void; + /** + * @internal + */ abstract handleMessage(message: ServerMessage): void; } diff --git a/lib/dataconnection.ts b/lib/dataconnection.ts index 181f2b732..ecd5f8c1a 100644 --- a/lib/dataconnection.ts +++ b/lib/dataconnection.ts @@ -365,6 +365,9 @@ export class DataConnection } } + /** + * @internal + */ handleMessage(message: ServerMessage): void { const payload = message.payload; diff --git a/lib/exports.ts b/lib/exports.ts index cd8f3f5e8..4eeeb7eee 100644 --- a/lib/exports.ts +++ b/lib/exports.ts @@ -1,6 +1,6 @@ export { util, type Util } from "./util"; import { Peer } from "./peer"; -export type { PeerEvents, PeerError } from "./peer"; +export type { PeerEvents, PeerError,PeerOptions } from "./peer"; export type { PeerJSOption, @@ -9,7 +9,7 @@ export type { CallOption, } from "./optionInterfaces"; export type { UtilSupportsObj } from "./util"; -export type { BaseConnection } from "./baseconnection"; +export type { BaseConnection, BaseConnectionEvents } from "./baseconnection"; export type { DataConnection, DataConnectionEvents } from "./dataconnection"; export type { MediaConnection, MediaConnectionEvents } from "./mediaconnection"; export type { LogLevel } from "./logger"; diff --git a/lib/mediaconnection.ts b/lib/mediaconnection.ts index 3a37a2d86..1a270a0c8 100644 --- a/lib/mediaconnection.ts +++ b/lib/mediaconnection.ts @@ -68,6 +68,9 @@ export class MediaConnection extends BaseConnection { super.emit("stream", remoteStream); // Should we call this `open`? } + /** + * @internal + */ handleMessage(message: ServerMessage): void { const type = message.type; const payload = message.payload; diff --git a/lib/peer.ts b/lib/peer.ts index 396aefb49..f7b749762 100644 --- a/lib/peer.ts +++ b/lib/peer.ts @@ -76,7 +76,7 @@ class PeerError extends Error { type: PeerErrorType; } -export type { PeerError }; +export type { PeerError, PeerOptions }; export type PeerEvents = { /** @@ -148,6 +148,9 @@ export class Peer extends EventEmitter { return this._open; } + /** + * @internal + */ get socket() { return this._socket; } @@ -449,7 +452,10 @@ export class Peer extends EventEmitter { this._lostMessages.get(connectionId).push(message); } - /** Retrieve messages from lost message store */ + /** + * Retrieve messages from lost message store + * @internal + */ //TODO Change it to private public _getMessages(connectionId: string): ServerMessage[] { const messages = this._lostMessages.get(connectionId);