sinch-rtc
Version:
RTC JavaScript/Web SDK
70 lines (69 loc) • 2.61 kB
TypeScript
import { FetchAPI } from "./ocra/api";
import { MediaStreamFactory } from "./rtc/MediaStreamFactory";
import { SinchClient } from "./SinchClient";
/**
* The SinchClientBuilder class builds a new SinchClient instance.
*
* To construct a SinchClient, the required configuration parameters are:
*
* - Application Key
* - Environment host
* - UserID
*
* It is optional to specify:
*
* - CLI (Calling-Line Identifier / Caller-ID) that will be used for calls
* terminated to PSTN (Publicly Switched Telephone Network).
* - hmsDeviceToken & hmsApplicationId if Huawei Push is to be used.
*/
export interface SinchClientBuilder {
/**
* Sets the user id associated with the SinchClient.
* @param userId - Must not be null.
* @returns The SinchClientBuilder instance.
*/
userId(userId: string): SinchClientBuilder;
/**
* Sets the application key associated with the SinchClient.
* @param applicationKey - Must not be null.
* @returns The SinchClientBuilder instance.
*/
applicationKey(applicationKey: string): SinchClientBuilder;
/**
* Sets the environment host associated with the SinchClient.
* @param environmentHost - Must not be null.
* @returns The SinchClientBuilder instance.
*/
environmentHost(environmentHost: string): SinchClientBuilder;
/**
* Sets the caller identifier used when calling with PSTN.
* @param callerIdentifier - Optional, must not be null
* @returns The SinchClientBuilder instance.
*/
callerIdentifier(callerIdentifier: string): SinchClientBuilder;
/**
* Sets the fetch api to be used by rest request. If not set the standard
* FetchApi will be used.
* @param api - Optional, must not be null
* @returns The SinchClientBuilder instance.
*/
fetchApi(api: FetchAPI): SinchClientBuilder;
/**
* Overide internal creation of the local MediaStream.
* @param mediaStreamFactory - MediaStream factory
* @returns The SinchClientBuilder instance.
*/
mediaStreamFactory(mediaStreamFactory: MediaStreamFactory): SinchClientBuilder;
/**
* @deprecated Use {@link CallClient.setVideoTrackConstraints} instead.
* Overide internal creation of the local MediaStream.
* @param videoConfiguration - constraints for video
* @returns The SinchClientBuilder instance.
*/
videoConfiguration(videoConfiguration: MediaTrackConstraints): SinchClientBuilder;
/**
* Creates the resulting SinchClient.
* @returns A new SinchClient instance.
*/
build(): SinchClient;
}