@skyway-sdk/core
Version:
The official Next Generation JavaScript SDK for SkyWay
90 lines • 3.28 kB
TypeScript
import { RuntimeInfo, SkyWayError } from '@skyway-sdk/common';
import model from '@skyway-sdk/model';
import { RtcApiClient } from '@skyway-sdk/rtc-api-client';
import { SkyWayAuthToken } from '@skyway-sdk/token';
import { SkyWayChannelImpl } from './channel';
import { ContextConfig, SkyWayConfigOptions } from './config';
import { RemoteMemberImplInterface } from './member/remoteMember';
import { SkyWayPlugin } from './plugin/interface/plugin';
export declare class SkyWayContext {
config: ContextConfig;
authToken: SkyWayAuthToken;
/**@internal */
readonly info: {
endpoint: EndpointInfo;
runtime: RuntimeInfo;
};
/**@internal */
static version: string;
/**
* @description [japanese] Contextの作成
*/
static Create(authTokenString: string, configOptions?: Partial<SkyWayConfigOptions>): Promise<SkyWayContext>;
readonly appId: string;
disposed: boolean;
/**@internal */
plugins: SkyWayPlugin[];
private _unknownPlugin;
/**@private */
readonly _api: RtcApiClient;
private _authTokenString;
/**seconds */
private _reminderSec;
private tokenUpdateReminderTimer;
private tokenExpiredTimer;
private _events;
/**
* @description [japanese] トークンの期限がまもなく切れる
* @example
* context.onTokenUpdateReminder.add(() => {
context.updateAuthToken(tokenString);
});
*/
readonly onTokenUpdateReminder: import("@skyway-sdk/common").Event<void>;
/**
* @description [japanese] トークンの期限切れ。トークンを更新するまでサービスを利用できない
*/
readonly onTokenExpired: import("@skyway-sdk/common").Event<void>;
/**
* @description [japanese] 回復不能なエラー。インターネット接続状況を確認した上で別のインスタンスを作り直す必要がある
*/
readonly onFatalError: import("@skyway-sdk/common").Event<SkyWayError<Record<string, any>>>;
/**@private */
readonly _onTokenUpdated: import("@skyway-sdk/common").Event<string>;
/**@private */
readonly _onDisposed: import("@skyway-sdk/common").Event<void>;
/**@private */
constructor(api: RtcApiClient, config: ContextConfig, authToken: SkyWayAuthToken,
/**@internal */
info: {
endpoint: EndpointInfo;
runtime: RuntimeInfo;
});
get authTokenString(): string;
/**@internal */
_setTokenExpireTimer(): Promise<void>;
/**
* @description [japanese] トークンの更新
*/
updateAuthToken(token: string): Promise<void>;
/**
* @description [japanese] プラグインの登録
*/
registerPlugin(plugin: SkyWayPlugin): void;
/**@private */
_createRemoteMember(channel: SkyWayChannelImpl, memberDto: model.Member): RemoteMemberImplInterface;
/**
* @description [japanese] Contextの利用を終了し次のリソースを解放する
* - イベントリスナー
* - バックエンドサーバとの通信
* - Contextを参照する全Channelインスタンス
*/
dispose(): void;
}
/**@internal */
export interface EndpointInfo {
rapi: string;
signaling: string;
ice: string;
}
//# sourceMappingURL=context.d.ts.map