@skyway-sdk/rtc-api-client
Version:
The official Next Generation JavaScript SDK for SkyWay
33 lines • 1.3 kB
TypeScript
import { SkyWayError } from '@skyway-sdk/common';
import { Event } from '@skyway-sdk/common';
import { Channel } from '@skyway-sdk/model';
import { ChannelInit } from '.';
import { Config, ConfigOptions } from './config';
import { ChannelQuery } from './domain/api';
export declare type RtcApiClientArgs = {
appId: string;
token: string;
} & Partial<ConfigOptions>;
export declare class RtcApiClient {
readonly appId: string;
readonly config: Config;
private apiClient;
private _eventObserverFactory;
/** @throws {@link SkyWayError} */
static Create(args: RtcApiClientArgs): Promise<RtcApiClient>;
closed: boolean;
readonly onFatalError: Event<SkyWayError<Record<string, any>>>;
private constructor();
updateAuthToken(token: string): Promise<void>;
/**ms */
getServerUnixtimeInMs(): Promise<number>;
/**sec */
getServerUnixtimeInSec(): Promise<number>;
/**@throws {@link SkyWayError} */
createChannel(init?: ChannelInit): Promise<import(".").ChannelImpl>;
findChannel(query: ChannelQuery): Promise<import(".").ChannelImpl>;
findOrCreateChannel(query: ChannelInit): Promise<import(".").ChannelImpl>;
deleteChannel(channelId: Channel['id']): Promise<void>;
close(): void;
}
//# sourceMappingURL=client.d.ts.map