import { Event } from '@skyway-sdk/common';
import type { SkyWayChannelImpl } from '../channel';
import type { Codec } from '../media';
import type { ContentType, WebRTCStats } from '../media/stream';
import type { RemoteStream } from '../media/stream/remote';
import type { RemoteAudioStream } from '../media/stream/remote/audio';
import type { RemoteDataStream } from '../media/stream/remote/data';
import type { RemoteVideoStream } from '../media/stream/remote/video';
import type { Member } from '../member';
import type { RemoteMemberImplInterface } from '../member/remoteMember';
import type { TransportConnectionState } from '../plugin/interface';
import type { Publication, PublicationImpl } from '../publication';
export * from './factory';
export interface Subscription<T extends RemoteVideoStream | RemoteAudioStream | RemoteDataStream = RemoteStream> {
    id: string;
    contentType: ContentType;
    publication: Publication;
    subscriber: Member;
    state: SubscriptionState;
    /** @description [japanese] SubscriptionにStreamが紐つけられた時に発火するイベント */
    onStreamAttached: Event<void>;
    /**
     * @description [japanese] メディア通信の状態が変化した時に発火するイベント
     */
    onConnectionStateChanged: Event<TransportConnectionState>;
    /**
     * @description [japanese] subscribeしているStreamの実体。
     * ローカルでSubscribeしているSubscriptionでなければundefinedとなる
     */
    stream?: T;
    /**
     * @description [japanese] Streamのコーデック
     */
    codec?: Codec;
    /**
     * @description [japanese] 現在の優先エンコーディング設定
     */
    preferredEncoding?: string;
    /** @description [japanese] Streamで優先して受信するエンコード設定の変更 */
    changePreferredEncoding: (id: string) => void;
    /**
     * @experimental
     * @description [japanese] RemoteStreamの通信の統計情報を取得する
     */
    getStats(): Promise<WebRTCStats>;
    /**
     * @experimental
     * @description [japanese] 試験的なAPIです。今後インターフェースや仕様が変更される可能性があります
     * @description [japanese] 対象のMemberとのRTCPeerConnectionを取得する。RTCPeerConnectionを直接操作すると SDK は正しく動作しなくなる可能性があります。
     */
    getRTCPeerConnection(): RTCPeerConnection | undefined;
    /**
     * @description [japanese] メディア通信の状態を取得する
     */
    getConnectionState(): TransportConnectionState;
}
/**@internal */
export declare class SubscriptionImpl<T extends RemoteVideoStream | RemoteAudioStream | RemoteDataStream = RemoteStream> implements Subscription<T> {
    readonly id: string;
    readonly contentType: ContentType;
    readonly subscriber: RemoteMemberImplInterface;
    readonly publication: PublicationImpl;
    private readonly _channel;
    private readonly _context;
    private readonly _disposer;
    private _state;
    get state(): SubscriptionState;
    codec?: Codec;
    preferredEncoding?: string;
    private _stream?;
    readonly onStreamAttached: Event<void>;
    readonly onConnectionStateChanged: Event<TransportConnectionState>;
    /**@internal */
    readonly _onChangeEncoding: Event<void>;
    constructor(args: {
        channel: SkyWayChannelImpl;
        id: string;
        contentType: ContentType;
        subscriber: RemoteMemberImplInterface;
        publication: PublicationImpl;
    });
    private _handlePublicationEnabled;
    /**@internal */
    _setStream(stream: T): void;
    get stream(): T | undefined;
    toJSON(): {
        id: string;
        contentType: ContentType;
        subscriber: RemoteMemberImplInterface;
        publication: PublicationImpl<import("../media/stream").LocalStream>;
        channelId: string;
        state: SubscriptionState;
        stream: T | undefined;
    };
    /**@private */
    _canceled(): void;
    changePreferredEncoding(id: string): void;
    getStats(): Promise<WebRTCStats>;
    getRTCPeerConnection(): RTCPeerConnection | undefined;
    getConnectionState(): TransportConnectionState;
}
export declare type SubscriptionState = 'enabled' | 'canceled';
//# sourceMappingURL=index.d.ts.map