@skyway-sdk/core
Version:
The official Next Generation JavaScript SDK for SkyWay
30 lines • 1.31 kB
TypeScript
import type { Event } from '@skyway-sdk/common';
import type { Member } from '../../member';
import type { LocalPersonImpl } from '../../member/localPerson';
import type { PublicationImpl } from '../../publication';
import type { SubscriptionImpl } from '../../subscription';
/**@internal */
export interface SkyWayConnection {
readonly type: string;
readonly localPerson: LocalPersonImpl;
readonly remoteMember: Pick<Member, 'id' | 'name'>;
readonly onDisconnect: Event<void>;
readonly onClose: Event<void>;
closed: boolean;
close(props?: {
reason?: string;
}): void;
/**@throws {SkyWayError} */
startPublishing?(publication: PublicationImpl, subscriptionId: string): Promise<void>;
stopPublishing?(publication: PublicationImpl): Promise<void>;
startSubscribing?(subscription: SubscriptionImpl): Promise<void>;
stopSubscribing?(subscription: SubscriptionImpl): Promise<void>;
changePreferredEncoding?(subscription: SubscriptionImpl): Promise<void>;
}
/**@internal */
export interface Transport {
connectionState: TransportConnectionState;
rtcPeerConnection: RTCPeerConnection;
}
export declare type TransportConnectionState = 'new' | 'connecting' | 'connected' | 'reconnecting' | 'disconnected';
//# sourceMappingURL=connection.d.ts.map