Skip to content

Commit

Permalink
docs: export all types used in the api documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Feb 26, 2023
1 parent 3228d3a commit e85a3e7
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 4 deletions.
3 changes: 3 additions & 0 deletions lib/baseconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,5 +60,8 @@ export abstract class BaseConnection<

abstract close(): void;

/**
* @internal
*/
abstract handleMessage(message: ServerMessage): void;
}
3 changes: 3 additions & 0 deletions lib/dataconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ export class DataConnection
}
}

/**
* @internal
*/
handleMessage(message: ServerMessage): void {
const payload = message.payload;

Expand Down
4 changes: 2 additions & 2 deletions lib/exports.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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";
Expand Down
3 changes: 3 additions & 0 deletions lib/mediaconnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ export class MediaConnection extends BaseConnection<MediaConnectionEvents> {
super.emit("stream", remoteStream); // Should we call this `open`?
}

/**
* @internal
*/
handleMessage(message: ServerMessage): void {
const type = message.type;
const payload = message.payload;
Expand Down
10 changes: 8 additions & 2 deletions lib/peer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ class PeerError extends Error {

type: PeerErrorType;
}
export type { PeerError };
export type { PeerError, PeerOptions };

export type PeerEvents = {
/**
Expand Down Expand Up @@ -148,6 +148,9 @@ export class Peer extends EventEmitter<PeerEvents> {
return this._open;
}

/**
* @internal
*/
get socket() {
return this._socket;
}
Expand Down Expand Up @@ -449,7 +452,10 @@ export class Peer extends EventEmitter<PeerEvents> {
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);
Expand Down

0 comments on commit e85a3e7

Please sign in to comment.