// // Title: LiveSwitch for JavaScript // Version: 1.25.4.18706 // Copyright Frozen Mountain Software 2011+ // declare namespace fm.liveswitch { class ArrayExtensions { getTypeString(): string; static getCount(array: T[]): number; static flatten(arr: T[][]): T[]; static add(array: T[], value: T): void; static remove(array: T[], value: T): boolean; static removeAt(array: T[], index: number): void; static insert(array: T[], index: number, value: T): void; static toArray(array: T[]): T[]; static clear(array: T[]): void; static addRange(array: T[], values: T[]): void; static getRange(array: T[], index: number, count: number): T[]; static contains(array: T[], value: T): boolean; static newArray(values: T[]): T[]; static clone(array: T[]): T[]; static map(array: T[], callback: fm.liveswitch.IFunction3): R[]; } } declare namespace fm.liveswitch { /** @hidden */ abstract class AsyncLoggerBase implements fm.liveswitch.ILog { getTypeString(): string; /** @hidden */ private _tag; constructor(tag: string); protected static processLogEvent(logEvent: fm.liveswitch.LogEvent): void; debug(context: fm.liveswitch.LogContext, message: string): void; debug(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; debug(message: string): void; debug(message: string, ex: fm.liveswitch.Exception): void; debug(scope: string, context: fm.liveswitch.LogContext, message: string): void; debug(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; debug(scope: string, message: string): void; debug(scope: string, message: string, ex: fm.liveswitch.Exception): void; protected doLog(level: fm.liveswitch.LogLevel, scope: string, context: fm.liveswitch.LogContext, message: string, exception: fm.liveswitch.Exception): void; protected abstract doQueueLogEvent(logEvent: fm.liveswitch.LogEvent): void; error(context: fm.liveswitch.LogContext, message: string): void; error(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; error(message: string): void; error(message: string, ex: fm.liveswitch.Exception): void; error(scope: string, context: fm.liveswitch.LogContext, message: string): void; error(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; error(scope: string, message: string): void; error(scope: string, message: string, ex: fm.liveswitch.Exception): void; fatal(context: fm.liveswitch.LogContext, message: string): void; fatal(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; fatal(message: string): void; fatal(message: string, ex: fm.liveswitch.Exception): void; fatal(scope: string, context: fm.liveswitch.LogContext, message: string): void; fatal(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; fatal(scope: string, message: string): void; fatal(scope: string, message: string, ex: fm.liveswitch.Exception): void; abstract flush(): void; getIsDebugEnabled(): boolean; getIsErrorEnabled(): boolean; getIsFatalEnabled(): boolean; getIsInfoEnabled(): boolean; getIsVerboseEnabled(): boolean; getIsWarnEnabled(): boolean; getTag(): string; info(context: fm.liveswitch.LogContext, message: string): void; info(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; info(message: string): void; info(message: string, ex: fm.liveswitch.Exception): void; info(scope: string, context: fm.liveswitch.LogContext, message: string): void; info(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; info(scope: string, message: string): void; info(scope: string, message: string, ex: fm.liveswitch.Exception): void; isLogEnabled(level: fm.liveswitch.LogLevel): boolean; log(context: fm.liveswitch.LogContext, message: string): void; log(logEvent: fm.liveswitch.LogEvent): void; log(message: string): void; log(scope: string, context: fm.liveswitch.LogContext, message: string): void; log(scope: string, message: string): void; /** @hidden */ private setTag; verbose(context: fm.liveswitch.LogContext, message: string): void; verbose(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; verbose(message: string): void; verbose(message: string, ex: fm.liveswitch.Exception): void; verbose(scope: string, context: fm.liveswitch.LogContext, message: string): void; verbose(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; verbose(scope: string, message: string): void; verbose(scope: string, message: string, ex: fm.liveswitch.Exception): void; warn(context: fm.liveswitch.LogContext, message: string): void; warn(context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; warn(message: string): void; warn(message: string, ex: fm.liveswitch.Exception): void; warn(scope: string, context: fm.liveswitch.LogContext, message: string): void; warn(scope: string, context: fm.liveswitch.LogContext, message: string, ex: fm.liveswitch.Exception): void; warn(scope: string, message: string): void; warn(scope: string, message: string, ex: fm.liveswitch.Exception): void; } } declare namespace fm.liveswitch { } declare namespace fm.liveswitch { class AtomicInteger { private _value; constructor(startValue?: number); compareAndSwap(expected: number, newValue: number): number; getValue(): number; add(value: number): number; subtract(value: number): number; increment(): number; decrement(): number; } } declare namespace fm.liveswitch { class AtomicLong { private _value; constructor(startValue?: number); compareAndSwap(expected: number, newValue: number): number; getValue(): number; add(value: number): number; subtract(value: number): number; increment(): number; decrement(): number; } } declare namespace fm.liveswitch { class Base64 { getTypeString(): string; private static _base64Regex; static encode(b: Uint8Array): string; static encodeBuffer(buffer: fm.liveswitch.DataBuffer): string; static decode(s: string): Uint8Array; static tryEncode(b: Uint8Array, result: fm.liveswitch.Holder): boolean; static tryEncodeBuffer(buffer: fm.liveswitch.DataBuffer, result: fm.liveswitch.Holder): boolean; static tryDecode(s: string, result: fm.liveswitch.Holder): boolean; private static b64ToUint6; private static decodeIt; private static uint6ToB64; private static encodeIt; } } declare namespace fm.liveswitch { class BitAssistant { getTypeString(): string; static castByte(value: number): number; static castInteger(value: number): number; static castLong(value: number): number; static leftShift(value: number, count: number): number; static leftShiftShort(value: number, count: number): number; static leftShiftInteger(value: number, count: number): number; static leftShiftLong(value: number, count: number): number; static rightShift(value: number, count: number): number; static rightShiftShort(value: number, count: number): number; static rightShiftInteger(value: number, count: number): number; static rightShiftLong(value: number, count: number): number; static sequencesAreEqual(array1: Uint8Array, array2: Uint8Array): boolean; static sequencesAreEqual(array1: Uint8Array, offset1: number, array2: Uint8Array, offset2: number, length: number): boolean; static sequencesAreEqualConstantTime(array1: Uint8Array, array2: Uint8Array): boolean; static sequencesAreEqualConstantTime(array1: Uint8Array, offset1: number, array2: Uint8Array, offset2: number, length: number): boolean; static subArray(array: Uint8Array, offset: number, count?: number): Uint8Array; static reverse(array: Uint8Array): void; static copy(source: Uint8Array, sourceIndex: number, destination: Uint8Array, destinationIndex: number, length: number): void; static set(array: Uint8Array, index: number, length: number, value: number): void; static getHexString(array: Uint8Array): string; static getHexString(array: Uint8Array, offset: number, length: number): string; static getHexBytes(s: string): Uint8Array; } } declare namespace fm.liveswitch { class BooleanExtensions { getTypeString(): string; static toString(value: boolean, format?: string): string; } } declare namespace fm.liveswitch { class ByteCollection { getTypeString(): string; private _buffer; constructor(buffer?: Uint8Array); count(): number; add(b: number): void; addRange(buffer: Uint8Array): void; removeRange(index: number, count: number): void; insertRange(index: number, buffer: Uint8Array): void; getRange(index: number, count: number): Uint8Array; get(index: number): number; toArray(): Uint8Array; } } declare namespace fm.liveswitch { /** Base class for all logging provider implementations. */ abstract class LogProvider { getTypeString(): string; /** @hidden */ private _filter; /** @hidden */ private _level; /** @hidden */ private _processId; private fmliveswitchLogProviderInit; /** Initializes a new instance of the [[fm.liveswitch.logProvider]] class using [[fm.liveswitch.log.defaultLogLevel]] as the log level. */ constructor(); /** Converts a log-level to a 5-character string for consistently-spaced character sequences. @param level The log level. @return The log level as an upper-case string with right-side whitespace padding to ensure a 5-character sequence. */ static getLogLevelString(level: fm.liveswitch.LogLevel): string; /** Converts a timestamp to an ISO-8601-formatted string for rendering in a log message (YYYY-MM-DDThh:mm:ss.sssZ). @param timestamp The timestamp. @return The timestamp as a formatted string. */ static getPrefixTimestamp(timestamp: fm.liveswitch.DateTime): string; /** Returns the name of the current product. */ static getProduct(): string; /** Logs a message at the specified log level. @param logEvent The log event details. */ protected abstract doLog(logEvent: fm.liveswitch.LogEvent): void; /** Generates a default log line. @param logEvent The log event details. */ protected generateLogLine(logEvent: fm.liveswitch.LogEvent): string; /** Gets a filter on the log provider. Returning `true` will log the event, while returning `false` will skip it. */ getFilter(): fm.liveswitch.IFunction1; /** Gets the log level. */ getLevel(): fm.liveswitch.LogLevel; /** Converts a log-level to a 5-character string for consistently-spaced character sequences. @param level The log level. @param includeTimestamp Whether to include a timestamp in the prefix. @return The log level as an upper-case string with right-side whitespace padding to ensure a 5-character sequence. */ protected getPrefix(level: fm.liveswitch.LogLevel, includeTimestamp: boolean): string; /** Gets the current process id. */ protected getProcessId(): number; /** Log a message. @param logEvent The log event details. */ log(logEvent: fm.liveswitch.LogEvent): void; /** Sets a filter on the log provider. Returning `true` will log the event, while returning `false` will skip it. */ setFilter(value: fm.liveswitch.IFunction1): void; /** Sets the log level. */ setLevel(value: fm.liveswitch.LogLevel): void; /** @hidden */ private setProcessId; } } declare namespace fm.liveswitch { class ConsoleLogProvider extends fm.liveswitch.LogProvider { getTypeString(): string; constructor(level?: fm.liveswitch.LogLevel); writeLine(text: string): void; doLog(logItem: fm.liveswitch.LogEvent): void; } } declare namespace fm.liveswitch { class Convert { getTypeString(): string; static toInt32(s: string, base: number): number; } } declare namespace fm.liveswitch { class CultureInfo { static getInvariantCulture(): CultureInfo; static getCurrentCulture(): CultureInfo; constructor(); } } declare namespace fm.liveswitch { class DateTime { getTypeString(): string; private _date; constructor(date: Date); constructor(ticks: number); constructor(year: number, month: number, day: number, hour: number, minute: number, second: number); constructor(year: number, month: number, day: number, hour: number, minute: number, second: number, millisecond: number); static getNow(): DateTime; static getUtcNow(): DateTime; getDate(): Date; getTicks(): number; toUniversalTime(): DateTime; getYear(): number; getMonth(): number; getDay(): number; getHour(): number; getMinute(): number; getSecond(): number; getMillisecond(): number; addHours(hours: number): DateTime; addMinutes(minutes: number): DateTime; addSeconds(seconds: number): DateTime; addMilliseconds(milliseconds: number): DateTime; } } declare namespace fm.liveswitch { class DateTimeFormatInfo { getTypeString(): string; static getInvariantInfo(): DateTimeFormatInfo; } } declare namespace fm.liveswitch { enum DateTimeStyles { AssumeUniversal = 1, AdjustToUniversal = 2 } } declare namespace fm.liveswitch { /** A dispatch queue interface. */ interface IDispatchQueue { destroy(): void; enqueue(item: T): void; getQueueCount(): number; } } declare namespace fm.liveswitch { class DispatchQueue implements fm.liveswitch.IDispatchQueue { getTypeString(): string; private _count; private _action; constructor(action: fm.liveswitch.IAction1); getQueueCount(): number; destroy(): void; enqueue(item: T): void; } } declare namespace fm.liveswitch { class DomLogProvider extends fm.liveswitch.LogProvider { getTypeString(): string; private _container; constructor(container: HTMLElement, level?: fm.liveswitch.LogLevel); writeLine(text: string): void; doLog(logItem: fm.liveswitch.LogEvent): void; } } declare namespace fm.liveswitch { class Encoding { getTypeString(): string; static getAscii(): Encoding; static getUtf8(): Encoding; getString(bytes: Uint8Array, index?: number, count?: number): string; getBytes(str: string): Uint8Array; getByteCount(str: string): number; } } declare class fmliveswitchGlobalError extends Error { } declare namespace fm.liveswitch { class Exception extends fmliveswitchGlobalError { constructor(message?: string); } } declare namespace fm.liveswitch { /** Future base properties/methods. */ abstract class FutureBase { getTypeString(): string; /** @hidden */ private _exception; /** @hidden */ private _result; /** @hidden */ private _state; constructor(); /** Gets the exception if rejected. */ getException(): fm.liveswitch.Exception; /** Gets the result if resolved. */ getResult(): T; /** Gets the current state. */ getState(): fm.liveswitch.FutureState; /** Sets the exception if rejected. */ protected setException(value: fm.liveswitch.Exception): void; /** Sets the result if resolved. */ protected setResult(value: T): void; /** Sets the current state. */ protected setState(value: fm.liveswitch.FutureState): void; } } declare namespace fm.liveswitch { abstract class Future extends fm.liveswitch.FutureBase { getTypeString(): string; abstract fail(rejectAction: fm.liveswitch.IAction1): fm.liveswitch.Future; abstract then(resolve: fm.liveswitch.IAction1 | fm.liveswitch.IFunction1>): fm.liveswitch.Future; abstract then(resolve: fm.liveswitch.IAction1 | fm.liveswitch.IFunction1>, reject: fm.liveswitch.IAction1): fm.liveswitch.Future; } } declare namespace fm.liveswitch { class Global { getTypeString(): string; static tryCast(x: any, t: any): T; static tryCastArray(x: any): any[]; static tryCastObject(x: any): Object; static tryCastString(x: any): string; static tryCastInt(x: any): number; static tryCastFloat(x: any): number; static toInt(x: number): number; static xor(x: boolean, y: boolean): boolean; static equals(x1: any, x2: any): boolean; } } declare namespace fm.liveswitch { class Guid { getTypeString(): string; static empty: Guid; private _guidString; constructor(); constructor(guidString: string); equals(guid: Guid): boolean; toString(): string; static newGuid(): Guid; static equals(guid1: Guid, guid2: Guid): boolean; } } declare namespace fm.liveswitch { interface Hash { [key: string]: V; } } declare namespace fm.liveswitch { /** A hash context. */ abstract class HashContextBase { getTypeString(): string; /** @hidden */ private _type; /** Initializes a new instance of the [[fm.liveswitch.hashContextBase]] class. @param type The type. */ constructor(type: fm.liveswitch.HashType); /** Computes the hash for a given type. @param type The type. @param input The input. */ static compute(type: fm.liveswitch.HashType, input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Computes the hash for a given type. @param type The type. @param inputString The input string. */ static compute(type: fm.liveswitch.HashType, inputString: string): fm.liveswitch.DataBuffer; /** Computes the hash. @param input The input. */ compute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Computes the hash. @param inputString The input. */ compute(inputString: string): fm.liveswitch.DataBuffer; /** Destroys this instance. */ destroy(): void; /** Computes the hash. @param input The input. */ protected abstract doCompute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Destroys this instance. */ protected abstract doDestroy(): void; /** Gets the type. */ getType(): fm.liveswitch.HashType; /** @hidden */ private setType; } } declare namespace fm.liveswitch { class HashContext extends fm.liveswitch.HashContextBase { getTypeString(): string; constructor(type: fm.liveswitch.HashType); doCompute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; doDestroy(): void; } } declare namespace fm.liveswitch { class HashExtensions { getTypeString(): string; static getCount(obj: fm.liveswitch.Hash): number; static getKeys(obj: fm.liveswitch.Hash): string[]; static getValues(obj: fm.liveswitch.Hash): T[]; static tryGetValue(obj: fm.liveswitch.Hash, key: any, holder: fm.liveswitch.Holder): boolean; static containsKey(obj: fm.liveswitch.Hash, key: any): boolean; static containsValue(obj: fm.liveswitch.Hash, value: T): boolean; static add(obj: fm.liveswitch.Hash, key: string, value: T): T; static remove(obj: fm.liveswitch.Hash, key: string): boolean; static clear(obj: fm.liveswitch.Hash): void; } } declare namespace fm.liveswitch { class HmacSha256 { private inner; private outer; blockSize: number; digestLength: number; private istate; private ostate; constructor(key: Uint8Array); reset(): this; clean(): void; update(data: Uint8Array): this; finish(out: Uint8Array): this; digest(): Uint8Array; } } declare namespace fm.liveswitch { class Holder { getTypeString(): string; private _value; constructor(value: T); getValue(): T; setValue(value: T): void; } } declare namespace fm.liveswitch { interface HttpWebRequest { } } declare namespace fm.liveswitch { interface HttpWebRequestFailureArgs { message: string; local: boolean; } } declare namespace fm.liveswitch { interface HttpWebRequestSendOptions { sync: boolean; url: string; frameUrl: string; method: string; content: string; contentBinary: Uint8Array; headers: fm.liveswitch.Hash; timeout: number; robustResponse: boolean; onRequestCreated?: fm.liveswitch.IFunction1; onResponseReceived?: fm.liveswitch.IAction1; onSuccess?: fm.liveswitch.IAction1; onFailure?: fm.liveswitch.IAction1; } } declare namespace fm.liveswitch { interface HttpWebRequestSuccessArgs { content: string; contentBinary: Uint8Array; headers: fm.liveswitch.Hash; statusCode: number; } } declare namespace fm.liveswitch { /** Base class that defines methods for transferring content over HTTP. */ abstract class HttpTransfer { getTypeString(): string; /** @hidden */ private static fm_liveswitch_HttpTransfer___log; /** @hidden */ private static fm_liveswitch_HttpTransfer___onSendFinish; /** @hidden */ private static fm_liveswitch_HttpTransfer___onSendStart; /** @hidden */ private static fm_liveswitch_HttpTransfer___wildcardCharacters; /** @hidden */ private static fm_liveswitch_HttpTransfer__onSendFinish; /** @hidden */ private static fm_liveswitch_HttpTransfer__onSendStart; constructor(); /** Adds a handler that is raised before an HTTP request is sent. */ static addOnSendFinish(value: fm.liveswitch.IAction1): void; /** Adds a handler that is raised before an HTTP request is sent. */ static addOnSendStart(value: fm.liveswitch.IAction1): void; /** Escapes and adds a query parameter as a key/empty-value pair to a URL. @param url The URL with the query to which the key/value should be added. @param key The key of the query parameter to add. @return The original URL with the query parameter added. */ static addQueryToUrl(url: string, key: string): string; /** Escapes and adds a query parameter as a key/value pair to a URL. @param url The URL with the query to which the key/value should be added. @param key The key of the query parameter to add. @param value The value of the query parameter to add. @return The original URL with the query parameter added. */ static addQueryToUrl(url: string, key: string, value: string): string; /** Gets a random wildcard character. @return A random wildcard character. */ static getRandomWildcardCharacter(): string; /** Gets the wildcard characters used to replace asterisks in ReplaceWildcards. */ static getWildcardCharacters(): string; /** Removes a handler that is raised before an HTTP request is sent. */ static removeOnSendFinish(value: fm.liveswitch.IAction1): void; /** Removes a handler that is raised before an HTTP request is sent. */ static removeOnSendStart(value: fm.liveswitch.IAction1): void; /** Replaces asterisks in URLs with characters from WildcardCharacters. @param url The URL with asterisks. */ static replaceWildcards(url: string): string; /** Sets the wildcard characters used to replace asterisks in ReplaceWildcards. */ static setWildcardCharacters(value: string): void; /** @hidden */ private doSend; /** @hidden */ private doSendAsync; /** @hidden */ private finishRequest; /** @hidden */ private raiseOnSendFinish; /** @hidden */ private raiseOnSendStart; /** Sends a request synchronously. @param requestArgs The request parameters. @return The resulting response. */ send(requestArgs: fm.liveswitch.HttpRequestArgs): fm.liveswitch.HttpResponseArgs; /** Sends a request asynchronously. @param requestArgs The request parameters. @param callback The callback to execute with the resulting response. */ sendAsync(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): void; /** @hidden */ private sendAsyncCallback; /** Sends binary content synchronously using the specified arguments. @param requestArgs The request arguments. @return The response arguments from the server. */ abstract sendBinary(requestArgs: fm.liveswitch.HttpRequestArgs): fm.liveswitch.HttpResponseArgs; /** Sends binary content asynchronously using the specified arguments. @param requestArgs The request arguments. @param callback The callback to execute on success or failure. */ abstract sendBinaryAsync(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): void; /** Sends text content synchronously using the specified arguments. @param requestArgs The request arguments. @return The response arguments from the server. */ abstract sendText(requestArgs: fm.liveswitch.HttpRequestArgs): fm.liveswitch.HttpResponseArgs; /** Sends text content asynchronously using the specified arguments. @param requestArgs The request arguments. @param callback The callback to execute on success or failure. */ abstract sendTextAsync(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): void; /** Releases any resources and shuts down. */ abstract shutdown(): void; /** @hidden */ private startRequest; /** @hidden */ private static __fmliveswitchHttpTransferInitialized; /** @hidden */ private static __fmliveswitchHttpTransferInitializing; /** @hidden */ static fmliveswitchHttpTransferInitialize(): void; } } declare let fmliveswitchGlobalIsError: (obj: any) => obj is Error; declare namespace fm.liveswitch { class Util { getTypeString(): string; private static _xdCache; private static _chars; private static _loadFunctions; private static _wildcard; private static _readyRun; private static _readyBound; private static _loaded; static isNumber(obj: any): boolean; static isString(obj: any): boolean; static isBoolean(obj: any): boolean; static isNull(obj: any): boolean; static isUndefined(obj: any): boolean; static isNullOrUndefined(obj: any): boolean; static isFunction(obj: any): boolean; static isArray(obj: any): boolean; static isUint8Array(obj: any): boolean; static isDate(obj: any): boolean; static isRegExp(obj: any): boolean; static isError(obj: any): boolean; static isObject(obj: any): boolean; static isObjectType(obj: any, typeString: string): boolean; static isArrayType(obj: any, typeString: string): boolean; static isPlainObject(obj: any): boolean; static canAttachProperties(instance: T, obj: any): boolean; static attachProperties(instance: T, obj: any): T; static isIE(): boolean; static isIE6(): boolean; static isIE7(): boolean; static isIE8(): boolean; static isIE9(): boolean; static isEdge(): boolean; static isChrome(): boolean; static isFirefox(): boolean; static isSafari9(): boolean; static isSafari10(): boolean; static isSafari11(): boolean; static isSafari12(): boolean; static isSafari12_1(): boolean; static isSafari(): boolean; static isOpera(): boolean; static isOperaMobile(): boolean; static isWindows(): boolean; static isAndroid(): boolean; static isBlackBerry(): boolean; static isiOS(): boolean; static isMobile(): boolean; static hasActiveX(checkFiltering?: boolean): boolean; static getBrowserVersion(): number; static hasJava(): boolean; static getJavaVersion(): string; static isJavaWebStartInstalledActiveX(version: string): boolean; static isXD(url1: string, url2?: string): boolean; private static getHost; private static compareHost; private static getCurrentHost; private static parseUrl; static absolutizeUrl(url?: string): string; static wildcard(str: string): string; static getWildcard(): string; static randomChar(str: string): string; static observe(element: EventTarget, event: string, handler: Function): void; static unobserve(element: EventTarget, event: string, handler: Function): void; static observeAttr(element: EventTarget, handler: Function): void; static construct(func: Function, args: IArguments): T; static extend(dest: any, src: any): any; static addOnLoad(fn: Function): void; static ready(): void; private static _wakeLock; private static logWakeLock; private static obtainWakeLock; static requestWakeLock(reacquire: boolean): fm.liveswitch.Future; static releaseWakeLock(): fm.liveswitch.Future; private static handleVisibilityChange; static cleanup(): fm.liveswitch.Future; static bindReady(): void; private static __initialized; static initialize(): void; } } declare namespace fm.liveswitch { class HttpWebRequestTransfer extends fm.liveswitch.HttpTransfer { getTypeString(): string; private static _corsFailCache; private static _corsSuccessCache; private static _pmFailCache; private static _pmSuccessCache; private static _disableCors; private static _disablePostMessage; private static _disableJsonp; private static _forceJsonp; constructor(); static getPlatformCode: () => string; static setDisableCors(disableCors: boolean): void; static getDisableCors(): boolean; static setDisablePostMessage(disablePostMessage: boolean): void; static getDisablePostMessage(): boolean; static setDisableJsonp(disableJsonp: boolean): void; static getDisableJsonp(): boolean; static setForceJsonp(forceJsonp: boolean): void; static getForceJsonp(): boolean; static canCors(): boolean; static canPostMessage(): boolean; sendTextAsync(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): void; sendText(requestArgs: fm.liveswitch.HttpRequestArgs): fm.liveswitch.HttpResponseArgs; sendBinaryAsync(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): void; sendBinary(requestArgs: fm.liveswitch.HttpRequestArgs): fm.liveswitch.HttpResponseArgs; process(requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): fm.liveswitch.HttpResponseArgs; sendInternal(fn: fm.liveswitch.IAction1, cors: boolean, pm: boolean, requestArgs: fm.liveswitch.HttpRequestArgs, callback: fm.liveswitch.IAction1): fm.liveswitch.HttpResponseArgs; shutdown(): void; } } declare namespace fm.liveswitch { interface HttpWebResponse { } } declare namespace fm.liveswitch { interface IAction0 { (): void; } } declare namespace fm.liveswitch { interface IAction1 { (p: T): void; } } declare namespace fm.liveswitch { interface IAction2 { (p1: T1, p2: T2): void; } } declare namespace fm.liveswitch { interface IAction3 { (p1: T1, p2: T2, p3: T3): void; } } declare namespace fm.liveswitch { interface IAction4 { (p1: T1, p2: T2, p3: T3, p4: T4): void; } } declare namespace fm.liveswitch { interface IAction5 { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): void; } } declare namespace fm.liveswitch { interface IAction6 { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): void; } } declare namespace fm.liveswitch { interface IFunction0 { (): R; } } declare namespace fm.liveswitch { interface IFunction1 { (p: T): R; } } declare namespace fm.liveswitch { interface IFunction2 { (p1: T1, p2: T2): R; } } declare namespace fm.liveswitch { interface IFunction3 { (p1: T1, p2: T2, p3: T3): R; } } declare namespace fm.liveswitch { interface IFunction4 { (p1: T1, p2: T2, p3: T3, p4: T4): R; } } declare namespace fm.liveswitch { interface IFunction5 { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5): R; } } declare namespace fm.liveswitch { interface IFunction6 { (p1: T1, p2: T2, p3: T3, p4: T4, p5: T5, p6: T6): R; } } declare namespace fm.liveswitch { class InternalConcurrentDictionary { getTypeString(): string; private __dict; private __hashFunction; constructor(hashCallback: fm.liveswitch.IFunction1); getIsEmpty(): boolean; getKeys(): TKey[]; getValues(): TValue[]; getCount(): number; containsKey(key: TKey): boolean; getOrAdd(key: TKey, valueFactory: fm.liveswitch.IFunction1): TValue; addOrUpdate(key: TKey, addValue: TValue, updateValueFactory: fm.liveswitch.IFunction2): TValue; tryAdd(key: TKey, value: TValue): boolean; tryGetValue(key: TKey, holder: fm.liveswitch.Holder): boolean; tryRemove(key: TKey, value: fm.liveswitch.Holder): boolean; tryUpdate(key: TKey, newValue: TValue, comparisonValue: TValue): boolean; clear(): void; } } declare namespace fm.liveswitch { /**
Provides Json serialize and deserialize methods for all browsers. It will also turn strings with form "/Date(xxxxxxxxxx-xxxx)" (Microsoft date serialization format) into actual dates.
*/ class Json { getTypeString(): string; static useMicrosoftDateFormat: boolean; private static _dateRegex; private static _reviver; private static _buildReviver; static deserialize(text: string, reviver?: (key: any, value: any) => any): any; static serialize(value: any): string; static serialize(value: any, replacer: (key: string, value: any) => any): string; static serialize(value: any, replacer: any[]): string; static serialize(value: any, replacer: (key: string, value: any) => any, space: string | number): string; static serialize(value: any, replacer: any[], space: string | number): string; } } declare namespace fm.liveswitch { class Jsonp { getTypeString(): string; static maxUrlLength: number; private static _scriptFrame; private static _scriptFrameLoaded; private static _callbackCount; private static _cb; private static _pastScriptFrames; private static _scriptFrameDestroyer; static getNextCallback(options: fm.liveswitch.JsonpSendOptions): string; private static failureHandler; static send(options: fm.liveswitch.JsonpSendOptions): void; private static cleanup; private static callbackExists; } } declare namespace fm.liveswitch { interface JsonpSendOptions extends fm.liveswitch.HttpWebRequestSendOptions { canSegmentJsonArray: boolean; callbackParameterName: string; contentParameterName: string; methodParameterName: string; headersParameterName: string; statusCodeParameterName: string; cacheBusterParameterName: string; useFrame: boolean; } } declare namespace fm.liveswitch { /** A message authentication code (MAC) context. */ abstract class MacContextBase { getTypeString(): string; /** @hidden */ private _type; /** Initializes a new instance of the [[fm.liveswitch.macContextBase]] class. @param type The type. */ constructor(type: fm.liveswitch.MacType); /** Computes the message authentication code (MAC) for a given type. @param type The type. @param key The key. @param input The input. */ static compute(type: fm.liveswitch.MacType, key: fm.liveswitch.DataBuffer, input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Computes the message authentication code (MAC). @param input The input. */ compute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Destroys this instance. */ destroy(): void; /** Computes the message authentication code (MAC). @param input The input. */ protected abstract doCompute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; /** Destroys this instance. */ protected abstract doDestroy(): void; /** Gets the type. */ getType(): fm.liveswitch.MacType; /** @hidden */ private setType; } } declare namespace fm.liveswitch { class MacContext extends fm.liveswitch.MacContextBase { getTypeString(): string; private _key; constructor(type: fm.liveswitch.MacType, key: fm.liveswitch.DataBuffer); doCompute(input: fm.liveswitch.DataBuffer): fm.liveswitch.DataBuffer; doDestroy(): void; } } declare namespace fm.liveswitch { class ManagedStopwatch { getTypeString(): string; static dispatch(action: fm.liveswitch.IAction0): void; private startTime; private stopTime; static getTimestamp(): number; static getTimestampMillis(): number; getElapsedTicks(): number; getElapsedMilliseconds(): number; start(): void; stop(): void; restart(): void; } } declare namespace fm.liveswitch { class ManagedThread { getTypeString(): string; static getCurrentThreadId(): number; static dispatch(action: fm.liveswitch.IAction0): void; static delay(delay: number): fm.liveswitch.Promise; } } declare namespace fm.liveswitch { class MathAssistant { getTypeString(): string; static getPi(): number; static getE(): number; static abs(val: number): number; static acos(val: number): number; static asin(val: number): number; static atan(val: number): number; static atan2(y: number, x: number): number; static ceil(val: number): number; static cos(val: number): number; static cosh(val: number): number; static exp(val: number): number; static floor(val: number): number; static log(val: number): number; static log10(val: number): number; static max(val1: number, val2: number): number; static min(val1: number, val2: number): number; static pow(x: number, y: number): number; static round(value: number): number; static sin(val: number): number; static sinh(val: number): number; static sqrt(val: number): number; static tan(val: number): number; static tanh(val: number): number; } } declare namespace fm.liveswitch { class NameValueCollection { getTypeString(): string; private _value; constructor(value?: fm.liveswitch.Hash); source(): fm.liveswitch.Hash; get(name: string): string; set(name: string, value: string): void; getCount(): number; toHash(): fm.liveswitch.Hash; getKeys(): string[]; getAllKeys(): string[]; } } declare namespace fm.liveswitch { class NumberExtensions { getTypeString(): string; static toString(value: number, formatOrCultureInfo?: string | fm.liveswitch.CultureInfo): string; } } declare namespace fm.liveswitch { class ObjectExtensions { getTypeString(): string; static getType(obj: any): fm.liveswitch.Type; static getHashCode(obj: any): number; } } declare namespace fm.liveswitch { class ParseAssistant { getTypeString(): string; static parseByteValue(s: string): number; static parseShortValue(s: string): number; static parseIntegerValue(s: string): number; static parseLongValue(s: string): number; static parseFloatValue(s: string): number; static parseDoubleValue(s: string): number; static parseDecimalValue(s: string): number; static parseBooleanValue(s: string): boolean; static parseGuidValue(s: string): fm.liveswitch.Guid; static tryParseByteValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseShortValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseIntegerValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseLongValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseFloatValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseDoubleValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseDecimalValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseBooleanValue(s: string, h: fm.liveswitch.Holder): boolean; static tryParseGuidValue(s: string, h: fm.liveswitch.Holder): boolean; } } declare namespace fm.liveswitch { /** Platform-specific methods. */ interface IPlatform { getArchitecture(): fm.liveswitch.Architecture; getCoreCount(): number; getCryptoLibrary(): fm.liveswitch.CryptoLibrary; getDeviceModel(): string; getDirectorySeparator(): string; getIsLittleEndian(): boolean; getIsMobile(): boolean; getMachineName(): string; getOperatingSystem(): fm.liveswitch.OperatingSystem; getOperatingSystemVersion(): string; getPhysicalMemory(): number; getPlatformTypeVersion(): string; getProcessId(): number; getSourceLanguage(): fm.liveswitch.SourceLanguage; getType(): fm.liveswitch.PlatformType; getUseFipsAlgorithms(): boolean; setCryptoLibrary(value: fm.liveswitch.CryptoLibrary): void; setIsMobile(value: boolean): void; setUseFipsAlgorithms(value: boolean): void; toString(isVerbose: boolean): string; } } declare namespace fm.liveswitch { class Platform implements fm.liveswitch.IPlatform { private static instance; static getInstance(): fm.liveswitch.IPlatform; constructor(); private littleEndianChecked; private isLittleEndian; private isMobile; private useFipsAlgorithms; getIsMobile(): boolean; setIsMobile(isMobile: boolean): void; getIsLittleEndian(): boolean; getOperatingSystem(): fm.liveswitch.OperatingSystem; getOperatingSystemVersion(): string; getType(): fm.liveswitch.PlatformType; getPlatformTypeVersion(): string; toString(isVerbose: boolean): string; getMobileType(): string; getArchitecture(): fm.liveswitch.Architecture; getSourceLanguage(): fm.liveswitch.SourceLanguage; getCoreCount(): number; getPhysicalMemory(): number; getMachineName(): string; getDirectorySeparator(): string; getProcessId(): number; getUseFipsAlgorithms(): boolean; setUseFipsAlgorithms(useFipsAlgorithms: boolean): void; getCryptoLibrary(): fm.liveswitch.CryptoLibrary; setCryptoLibrary(cryptoLibrary: fm.liveswitch.CryptoLibrary): void; getDeviceModel(): string; } } declare namespace fm.liveswitch { class Xhr { getTypeString(): string; private static _count; private static _current; private static _disableBinary; private static _defaultWithCredentials; static setDisableBinary(disableBinary: boolean): void; static getDisableBinary(): boolean; static setDefaultWithCredentials(defaultWithCredentials: boolean): void; static getDefaultWithCredentials(): boolean; private static failureHandler; private static successHandler; private static handler; static send(options: fm.liveswitch.XhrSendOptions): boolean; private static __initialized; static initialize(): void; } } declare namespace fm.liveswitch { class PostMessage { getTypeString(): string; private static _cache; private static _optionsCounter; private static _optionsCache; private static getOrigin; private static createFrame; static send(options: fm.liveswitch.PostMessageSendOptions): void; private static listen; } } declare namespace fm.liveswitch { interface PostMessageSendOptions extends fm.liveswitch.XhrSendOptions { id: number; } } declare namespace fm.liveswitch { /** Promise base properties/methods. */ abstract class PromiseBase extends fm.liveswitch.Future implements fm.liveswitch.IPromise { getTypeString(): string; /** @hidden */ private __id; /** @hidden */ private __pendingPromisesToReject; /** @hidden */ private __pendingPromisesToResolve; /** @hidden */ private __pendingRejects; /** @hidden */ private __pendingResolves; /** @hidden */ private __stateLock; /** Initializes a new instance of the [[fm.liveswitch.promiseBase]] class. */ constructor(); /** Returns a promise that resolves when all passed in promises resolve. @param promises The promises to check. */ static all(promises: fm.liveswitch.Future[]): fm.liveswitch.Future; /** Returns a promise that resolves when any passed in promise resolves. @param promises The promises to check. */ static any(promises: fm.liveswitch.Future[]): fm.liveswitch.Future; /** Create a promise that resolves afer a delay. @param delayMs */ static delay(delayMs: number): fm.liveswitch.Future; /** Creates a promise and rejects it immediately. @param ex The exception. */ static rejectNow(ex: fm.liveswitch.Exception): fm.liveswitch.Future; /** Creates a promise and resolves it immediately using a null result value. */ static resolveNow(): fm.liveswitch.Future; /** Creates a promise and resolves it immediately using the given result value. @param result The result. */ static resolveNow(result: R): fm.liveswitch.Future; /** Creates a promise and resolves it using the result from a callback function, or rejects it if an exception is thrown. @param callback The callback function. */ static wrapPromise(callback: fm.liveswitch.IFunction0>): fm.liveswitch.Future; /** @hidden */ private addReject; /** @hidden */ private addResolve; /** Casts the result and resolves the promise. Will throw an exception if the cast fails. @param result The result. */ castAndResolve(result: Object): boolean; /** Internal DoAll. */ protected doAll(promises: fm.liveswitch.Future[], counter: fm.liveswitch.AtomicInteger): void; /** Internal DoAny. @param promises @param resolveCount @param rejectCounter */ protected doAny(promises: fm.liveswitch.Future[], resolveCount: fm.liveswitch.AtomicInteger, rejectCounter: fm.liveswitch.AtomicInteger): void; /** @hidden */ private doRejectAsync; /** @hidden */ private doResolveAsync; /** Gets the identifier of this promise. */ getId(): string; /** @hidden */ private handleResolve; /** Processes the specified promise. @param promise The promise. @param resolve The resolve. @param reject The reject. */ protected process(promise: fm.liveswitch.IPromise, resolve: fm.liveswitch.IAction1, reject: fm.liveswitch.IAction1): void; /** @hidden */ private raiseReject; /** @hidden */ private raiseRejects; /** @hidden */ private raiseResolve; /** @hidden */ private raiseResolves; /** Rejects the promise. @param exception The exception. */ reject(exception: fm.liveswitch.Exception): boolean; /** Rejects the promise asynchronously. @param exception The exception. */ rejectAsync(exception: fm.liveswitch.Exception): fm.liveswitch.Future; /** @hidden */ private reset; /** Resolves the promise. @param result The result. */ resolve(result: T): boolean; /** Resolves the promise asynchronously. @param result The result. */ resolveAsync(result: T): fm.liveswitch.Future; /** @hidden */ resolveAsyncInternal(result: T, diagnosticsLog: fm.liveswitch.IAction2, state: Object): fm.liveswitch.Future; } } declare namespace fm.liveswitch { class Promise extends fm.liveswitch.PromiseBase { getTypeString(): string; then(resolve: fm.liveswitch.IFunction1>, reject?: fm.liveswitch.IAction1): fm.liveswitch.Future; fail(reject?: fm.liveswitch.IAction1): fm.liveswitch.Future; static wrap(callbackAction: fm.liveswitch.IAction0): fm.liveswitch.Future; static wrap(callbackFunction: fm.liveswitch.IFunction0): fm.liveswitch.Future; static wrapAsync(callbackAction: fm.liveswitch.IAction0): fm.liveswitch.Future; static wrapAsync(callbackFunction: fm.liveswitch.IFunction0): fm.liveswitch.Future; } } declare namespace fm.liveswitch { class Randomizer { getTypeString(): string; private static _randomCharset; next(): number; next(maxValue: number): number; next(minValue: number, maxValue: number): number; nextDouble(): number; nextBytes(buffer: Uint8Array): void; randomString(size: number): string; } } declare namespace fm.liveswitch { class Regex { getTypeString(): string; private pattern; constructor(pattern: string); static isMatch(input: string, pattern: string): boolean; isMatch(input: string): boolean; } } declare namespace fm.liveswitch { class Sha256 { digestLength: number; blockSize: number; private state; private temp; private buffer; private bufferLength; private bytesHashed; finished: boolean; constructor(); reset(): this; clean(): void; update(data: Uint8Array, dataLength?: number): this; finish(out: Uint8Array): this; digest(): Uint8Array; _saveState(out: Uint32Array): void; _restoreState(from: Uint32Array, bytesHashed: number): void; } } declare namespace fm.liveswitch { } declare namespace fm.liveswitch { class Stack { getTypeString(): string; private _list; private _depth; constructor(depth?: number); push(o: T): void; pop(): T; peek(): T; getCount(): number; } } declare namespace fm.liveswitch { class StringAssistantExtensions { getTypeString(): string; /** * Determines whether the input string consists entirely of valid hexadecimal characters. * * @param input - The string to check for hexadecimal validity. * @returns True if the input string contains only valid hexadecimal characters (0-9, a-f, A-F); * otherwise, false. */ static isHexString(input: string): boolean; private static isHexChar; } } declare namespace fm.liveswitch { class StringBuilder { getTypeString(): string; private _value; constructor(value?: string); append(s: string, startIndex?: number, count?: number): StringBuilder; toString(): string; getLength(): number; remove(startIndex: number, length: number): StringBuilder; } } declare namespace fm.liveswitch { enum StringComparison { CurrentCulture = 0, CurrentCultureIgnoreCase = 1, InvariantCulture = 2, InvariantCultureIgnoreCase = 3, Ordinal = 4, OrdinalIgnoreCase = 5 } } declare namespace fm.liveswitch { class StringExtensions { getTypeString(): string; static empty: string; static nullCoalesce(value1: string, value2: string): string; static toString(s: string): string; static trim(s: string): string; static trimEnd(s: string, chars: number[]): string; static trimStart(s: string, chars: number[]): string; static replace(s: string, search: string, replace: string): string; static concat(...strings: any[]): string; static contains(str: string, s: string): boolean; static join(separator: string, ...array: any[]): string; static split(s: string, chars: number[]): string[]; static isNullOrEmpty(s: string): boolean; static isEqual(str: string, s: string, stringComparison?: fm.liveswitch.StringComparison): boolean; static indexOf(str: string, s: string, stringComparison?: fm.liveswitch.StringComparison): number; static lastIndexOf(str: string, s: string, stringComparison?: fm.liveswitch.StringComparison): number; static startsWith(str: string, s: string, stringComparison?: fm.liveswitch.StringComparison): boolean; static endsWith(str: string, s: string, stringComparison?: fm.liveswitch.StringComparison): boolean; static compareTo(s1: string, s2: string): number; static format(format: string, ...args: any[]): string; static toLower(str: string): string; static toUpper(str: string): string; static getLength(str: string): number; static getChars(str: string): string[]; static substring(str: string, startIndex: number, length: number): string; static getHashCode(str: string): number; } } declare namespace fm.liveswitch { /** A thread-safe class for running timeouts on asynchronous methods. */ interface ITimeoutTimer { start(timeout: number): void; stop(): boolean; } } declare namespace fm.liveswitch { class TimeoutTimer implements fm.liveswitch.ITimeoutTimer { getTypeString(): string; private _timer; private _callback; private _state; private _currentTimeout; constructor(callback: fm.liveswitch.IAction1, state: any); start(timeout: number): void; stop(): boolean; } } declare namespace fm.liveswitch { class TimeSpan { private _hours; private _minutes; private _seconds; private _milliseconds; constructor(ticks: number); constructor(hours: number, minutes: number, seconds: number); getTotalSeconds(): number; getTotalMilliseconds(): number; } } declare namespace fm.liveswitch { class Type { getTypeString(): string; private _typeString; constructor(typeString: string); getFullName(): string; getBaseType(): Type; } } declare namespace fm.liveswitch { class Uri { getTypeString(): string; private _uriString; constructor(uriString: string); toString(): string; static escapeDataString(s: string): string; } } declare namespace fm.liveswitch { /** WebSocket base properties/methods. */ class WebSocketBase { getTypeString(): string; /** @hidden */ private __lastRoundTripTime; /** @hidden */ private __onLatestRoundTripTime; /** @hidden */ private _onLatestRoundTripTime; /** @hidden */ private static fm_liveswitch_WebSocketBase___log; private fmliveswitchWebSocketBaseInit; constructor(); /** Adds a handler that is raised when the latest round trip time is calculated. */ addOnLatestRoundTripTime(value: fm.liveswitch.IAction1): void; /** Gets the last round trip time. */ getLastRoundTripTime(): number; /** Raises the close complete callback. @param closeArgs The close arguments. @param statusCode The status code. @param reason The reason. */ protected raiseCloseComplete(closeArgs: fm.liveswitch.WebSocketCloseArgs, statusCode: fm.liveswitch.WebSocketStatusCode, reason: string): void; /** Raises the OnLatestRoundTripTime event. @param value */ protected raiseOnLatestRoundTripTime(value: number): void; /** Raises the open failure callback. @param openArgs The open arguments. @param statusCode The status code. @param exception The exception. */ protected raiseOpenFailure(openArgs: fm.liveswitch.WebSocketOpenArgs, statusCode: fm.liveswitch.WebSocketStatusCode, exception: fm.liveswitch.Exception): void; /** Raises the open success callback. @param openArgs The open arguments. */ protected raiseOpenSuccess(openArgs: fm.liveswitch.WebSocketOpenArgs): void; /** Raises the receive callback. @param openArgs The open arguments. @param textMessage The text message. @param binaryMessage The binary message. */ protected raiseReceive(openArgs: fm.liveswitch.WebSocketOpenArgs, textMessage: string, binaryMessage: Uint8Array): void; /** Raises the stream failure callback. @param openArgs The open arguments. @param statusCode The status code. @param exception The exception. */ protected raiseStreamFailure(openArgs: fm.liveswitch.WebSocketOpenArgs, statusCode: fm.liveswitch.WebSocketStatusCode, exception: fm.liveswitch.Exception): void; /** Removes a handler that is raised when the latest round trip time is calculated. */ removeOnLatestRoundTripTime(value: fm.liveswitch.IAction1): void; /** Sets the last round trip time. */ protected setLastRoundTripTime(value: number): void; /** @hidden */ private static __fmliveswitchWebSocketBaseInitialized; /** @hidden */ private static __fmliveswitchWebSocketBaseInitializing; /** @hidden */ static fmliveswitchWebSocketBaseInitialize(): void; } } declare namespace fm.liveswitch { class WebSocket extends fm.liveswitch.WebSocketBase implements fm.liveswitch.IWebSocket { getTypeString(): string; private static _disableBinary; private _requestUrl; private _webSocket; private _protocol; private _onRequestCreated; private _onResponseReceived; private _opening; private _closing; private _aborting; private _openArgs; private _sendArgs; private _timer; private _raisedStreamFailure; private _raisedOpenFailure; private _keepAliveInterval; private _keepAliveTimeout; private _keepAliveTimeoutId; private _pingSendTimes; static getExists(): boolean; static setDisableBinary(disableBinary: boolean): void; static getDisableBinary(): boolean; getSecure(): boolean; constructor(requestUrl: string, protocol?: string); getBufferedAmount(): number; getIsOpen(): boolean; private getIsClosingOrClosed; open(args: fm.liveswitch.WebSocketOpenArgs): void; private onOpen; private onError; private onClose; private startKeepAlive; private tryCloseWebSocket; private doCloseWebSocket; private sendAndTrackPing; private processPong; private stopKeepAlive; private processOnClose; private onMessage; send(args: fm.liveswitch.WebSocketSendArgs): void; close(): void; close(args: fm.liveswitch.WebSocketCloseArgs): void; private raiseOnRequestCreated; private raiseOnResponseReceived; } } declare namespace fm.liveswitch { interface XhrSendOptions extends fm.liveswitch.HttpWebRequestSendOptions { abortOnUnload?: boolean; cacheBusterParameterName?: string; } } declare namespace fm.liveswitch { /** Base definition for classes that allow serialization to/from JSON. */ abstract class Serializable { getTypeString(): string; /** @hidden */ private __serialized; /** @hidden */ private _isDirty; /** @hidden */ private _isSerialized; private fmliveswitchSerializableInit; /** Initializes a new instance of the [[fm.liveswitch.serializable]] class. */ constructor(); /** @hidden */ getIsDirty(): boolean; /** @hidden */ getIsSerialized(): boolean; /** @hidden */ getSerialized(): string; /** @hidden */ setIsDirty(value: boolean): void; /** @hidden */ setIsSerialized(value: boolean): void; /** @hidden */ setSerialized(value: string): void; } } declare namespace fm.liveswitch { /** Supplies class instances with a key-value mapping to support dynamic property storage. */ abstract class Dynamic extends fm.liveswitch.Serializable { getTypeString(): string; /** @hidden */ private __dynamicProperties; /** @hidden */ private __dynamicPropertiesLock; constructor(); /** Gets all dynamic properties on this instance. */ getDynamicProperties(): fm.liveswitch.Hash; /** Gets a property value from the local cache. @param key The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. @return The stored value, if found; otherwise null. */ getDynamicValue(key: string): Object; /** @hidden */ setDynamicProperties(value: fm.liveswitch.Hash): void; /** Sets a property value in the local cache. @param key The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. @param value The property value. This can be any object that needs to be stored for future use. */ setDynamicValue(key: string, value: Object): void; /** @hidden */ private tryInitDynamicProperties; /** Removes a property value from the local cache. Returns true if the value was removed and returns false otherwise. @param key The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. @return `true` if the value was removed; otherwise, `false`. */ unsetDynamicValue(key: string): boolean; } } declare namespace fm.liveswitch { abstract class Stream extends fm.liveswitch.Dynamic implements fm.liveswitch.IExternalStream { getTypeString(): string; getState(): fm.liveswitch.StreamState; /** * Gets the Group Id of the group of straams this stream belongs to. A group typically represents a participant. * @returns group Id. */ getGroupId(): string; setGroupId(groupId: string): void; /** * Registers a handler to be called once the connection state changes.
* This method can track the state of the connection and can be used to display the current status of the connection to the user, add or remove media views in the UI, and handle retry logic if the connection fails.
* The connection object passes to the handler which allows access to the current connection state through the `connection.getState()` method. This returns a `ConnectionState` enum.
* Possible connection states are the following:
* - `New`: The connection object has been created, but __open__ has not yet been called. * - `Initializing`: The connection is initializing, but no connection attempts have been made. * - `Connecting`: The connection is being established. * - `Connected`: The connection has been successfully established. * - `Failing`: The connection has encountered an error and is cleaning up. * - `Failed`: The connection encountered an error and has cleaned up. * - `Closing`: The connection has been instructed to close and is cleaning up. * - `Closed`: The connection has been instructed to close and has cleaned up. */ addOnStateChange(value: fm.liveswitch.IAction0): void; removeOnStateChange(value: fm.liveswitch.IAction0): void; changeDirection(newDirection: fm.liveswitch.StreamDirection): fm.liveswitch.Error; getEncryptionPolicy(): fm.liveswitch.EncryptionPolicy; /** * Gets the Media Direction of a stream as a `StreamDirection` enumerator. The following stream direction values are defined:
* - `SendReceive`: A stream that can send and can receive. * - `SendOnly`: A stream that can send. * - `ReceiveOnly`: A stream that can receive. * - `Inactive`: A stream that cannot send or receive. * - `Unset`: A stream direction has not been set. * @returns The Media Direction as a `StreamDirection` enumerator. */ getDirection(): fm.liveswitch.StreamDirection; /** * Checks whether the local peer supports receiving media on this stream. Returns true if the local peer supports receiving media on this stream and false otherwise.
* Use this method to determine if a stream is used for receiving media. */ getLocalReceive(): boolean; setLocalReceive(receiveEnabled: boolean): void; /** * Checks whether the local peer on this stream supports sending media on this stream. Returns true if the local peer supports sending media and false otherwise.
* Use this method to determine if a stream is used for sending media or only receiving media. */ getLocalSend(): boolean; setLocalSend(sendEnabled: boolean): void; getRemoteReceive(): boolean; getRemoteSend(): boolean; getRemoteDirection(): fm.liveswitch.StreamDirection; getId(): string; getExternalId(): string; getLabel(): string; getLocalDirection(): fm.liveswitch.StreamDirection; /** * Gets the media description ID of this stream.
* The media description ID is only available once a connection is opened with this stream, because it is obtained from the local SDP description of this stream. */ getMediaDescriptionId(): string; getTag(): string; getType(): fm.liveswitch.StreamType; setExternalId(value: string): void; setLocalDirection(value: fm.liveswitch.StreamDirection): void; setRemoteDirection(value: fm.liveswitch.StreamDirection): void; setTag(value: string): void; /** * Registers a handler to be called when the stream direction changes.
* Stream direction indicates the direction of media flow. For example:
* - A stream in an SFU upstream connection has a direction of `SendOnly`.
* - A stream in an SFU downstream connection has a direction of `ReceiveOnly`.
* - A stream in an MCU connection has a direction of `SendReceive` if it is attached to both local and remote media. If it is only attached to local media, it has a direction of `SendOnly`. If it is only attached to remote media, it has a direction of `ReceiveOnly`.
* The direction of a stream can change over its lifecycle. For example:
* - An update to an SFU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the direction of the stream will change to `Inactive`.
* - An update to an SFU downstream connection might cause it to stop receiving audio or video frames. In this case, the direction of the stream will change to `Inactive`.
* - An update to an MCU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the following occurs:
* - If the direction of the stream was `SendOnly`, then the direction changes to `Inactive`.
* - If the direction of the stream was `ReceiveOnly`, then the direction changes to `SendReceive`.
* - An update to an MCU upstream connection might instruct it to stop receiving audio or video frames. In this case, the following occurs:
* - If the direction of the stream was `ReceiveOnly`, then the direction changes to `Inactive`.
* - If the direction of the stream was `SendReceive`, then the direction changes to `SendOnly`.
* An event handler bound to the change in direction can be used to update the UI accordingly so the user is aware of the change in the state of the application. */ addOnDirectionChange(value: fm.liveswitch.IAction0): void; /** * Removes a handler to be called when the stream direction changes.
* Stream direction indicates the direction of media flow. For example:
* - A stream in an SFU upstream connection has a direction of `SendOnly`.
* - A stream in an SFU downstream connection has a direction of `ReceiveOnly`.
* - A stream in an MCU connection has a direction of `SendReceive` if it is attached to both local and remote media. If it is only attached to local media, it has a direction of `SendOnly`. If it is only attached to remote media, it has a direction of `ReceiveOnly`.
* The direction of a stream can change over its lifecycle. For example:
* - An update to an SFU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the direction of the stream will change to `Inactive`.
* - An update to an SFU downstream connection might cause it to stop receiving audio or video frames. In this case, the direction of the stream will change to `Inactive`.
* - An update to an MCU upstream connection might instruct the stream to stop sending audio or video frames. In this case, the following occurs:
* - If the direction of the stream was `SendOnly`, then the direction changes to `Inactive`.
* - If the direction of the stream was `ReceiveOnly`, then the direction changes to `SendReceive`.
* - An update to an MCU upstream connection might instruct it to stop receiving audio or video frames. In this case, the following occurs:
* - If the direction of the stream was `ReceiveOnly`, then the direction changes to `Inactive`.
* - If the direction of the stream was `SendReceive`, then the direction changes to `SendOnly`.
*/ removeOnDirectionChange(value: fm.liveswitch.IAction0): void; getTransportInfo(): fm.liveswitch.TransportInfo; getRelatedSourceConnectionId(): string; setRelatedSourceConnectionId(value: string): void; getRelatedSourceClientId(): string; setRelatedSourceClientId(value: string): void; getRelatedSourceMediaId(): string; setRelatedSourceMediaId(value: string): void; /** * Gets the media stream identification. * @returns Media Stream Identification. */ getMediaStreamIdentification(): string; /** * Set the Media Stream Identification. * @param value Media Stream Identification */ setMediaStreamIdentification(value: string): void; } } declare namespace fm.liveswitch { abstract class MediaStream extends fm.liveswitch.Stream implements fm.liveswitch.IMediaStream, fm.liveswitch.IExternalMediaStream { getTypeString(): string; /** * Gets the track from this media. Returns null if there are no tracks. */ getLocalTrack(): TTrack; getRemoteTrack(): TTrack; getLocalBandwidth(): number; /** * Checks whether the local stream is muted. Returns true if the local stream is muted and false otherwise.
* A muted stream does not show or play media, but the stream is not disabled and its data continues to flow through the processing pipeline. */ getLocalMuted(): boolean; setLocalMuted(value: boolean): void; getRemoteMuted(): boolean; setRemoteMuted(value: boolean): void; getCachedLocalDirection(): fm.liveswitch.StreamDirection; getRemoteRequestedDeactivation(): boolean; /** * Checks whether the stream is muted. Returns true if the stream is muted and false otherwise.
* A muted stream does not show or play media, but the stream is not disabled and its data continues to flow through the processing pipeline. */ getMuted(): boolean; getInputMuted(): boolean; /** * Checks whether the output track is muted. Returns true if the output track is muted and false otherwise.
* A muted stream does not show or play media, but the source is not disabled and its data continues to flow through the processing pipeline. */ getOutputMuted(): boolean; /** * Gets the remote bandwidth in Kbps. This value is signalled in the remote session description received from the remote endpoint.
* Use `setMaxSendBitrate()` to control the outbound media bitrate once the session has been negotiated. */ getRemoteBandwidth(): number; setLocalBandwidth(value: number): void; setMuted(value: boolean): void; setInputMuted(value: boolean): void; setOutputMuted(value: boolean): void; getPreferredCodecs(): string[]; setPreferredCodecs(names: string[]): void; getCodecDisabled(name: string): boolean; setCodecDisabled(name: string, disabled: boolean): void; getRemoteEncoding(): fm.liveswitch.EncodingInfo; setRemoteEncoding(value: fm.liveswitch.EncodingInfo): void; getSimulcastMode(): fm.liveswitch.SimulcastMode; setSimulcastMode(value: fm.liveswitch.SimulcastMode): void; getInfo(): fm.liveswitch.MediaStreamInfo; constructor(localTrack: TTrack, remoteTrack: TTrack); getControlTransportInfo(): fm.liveswitch.TransportInfo; /** * Gets the local canonical end-point identifier (CNAME) used by RTCP.
* The CNAME is a unique identifier for endpoints across an application instance and can be used for third-party monitoring. */ getLocalCanonicalName(): string; getRemoteCanonicalName(): string; /** * Registers a handler to be called after local encoding is disabled. * @param value The method that will be called. The method should return void and it should take single parameters of the type `EncodingInfo`. */ addOnLocalEncodingDisabled(value: fm.liveswitch.IAction1): void; /** * Registers a handler to be called after local encoding is enabled. * @param value The method that will be called. The method should return void and should take single parameters of the type `EncodingInfo`. */ addOnLocalEncodingEnabled(value: fm.liveswitch.IAction1): void; removeOnLocalEncodingDisabled(value: fm.liveswitch.IAction1): void; removeOnLocalEncodingEnabled(value: fm.liveswitch.IAction1): void; addOnDiscardBitrateRequest(value: fm.liveswitch.IAction1): void; removeOnDiscardBitrateRequest(value: fm.liveswitch.IAction1): void; raiseBitrateRequest(bitrateRequest: fm.liveswitch.BitrateRequest): boolean; /** * Registers a handler to be called when a bitrate notification message is discarded by the internal in-band messaging mechanism because the peer does not support bitrate notifications.
* In this case, the bitrate notification needs to be transported out of band. LiveSwitch handles this internally by sending the message over Data Streams. No further action is required by application developers.
* Use this event for for diagnostics and debugging. * @param value The method that is called once a stream bitrate is discarded. The method should return void, and it should take single parameters of the `BitrateNotification` type (representing a bitrate notification). */ addOnDiscardBitrateNotification(value: fm.liveswitch.IAction1): void; removeOnDiscardBitrateNotification(value: fm.liveswitch.IAction1): void; raiseBitrateNotification(bitrateNotification: fm.liveswitch.BitrateNotification): boolean; /** * Gets the maximum bitrate that the upstream connection sends in Kbps.
* The value of the maximum bitrate the stream sends must be less than or equal to the remote bandwidth. */ getMaxSendBitrate(): number; setMaxSendBitrate(value: number): void; /** * Gets the maximum bitrate that the connection receives in Kbps.
* The value of the maximum bitrate the stream receives must be less than or equal to the local bandwidth. */ getMaxReceiveBitrate(): number; setMaxReceiveBitrate(value: number): void; } } declare namespace fm.liveswitch { class AudioStream extends fm.liveswitch.MediaStream implements fm.liveswitch.IAudioStream, fm.liveswitch.IExternalAudioStream { getTypeString(): string; getLocalMedia(): fm.liveswitch.LocalMedia; getRemoteMedia(): fm.liveswitch.RemoteMedia; constructor(localTrack: fm.liveswitch.AudioTrack); constructor(localTrack: fm.liveswitch.AudioTrack, remoteTrack: fm.liveswitch.AudioTrack); constructor(localMedia: fm.liveswitch.LocalMedia); constructor(localMedia: fm.liveswitch.LocalMedia, remoteMedia: fm.liveswitch.RemoteMedia); constructor(remoteMedia: fm.liveswitch.RemoteMedia); addOnReceiveDtmfTone(value: fm.liveswitch.IAction1): void; addOnReceiveDtmfToneChange(value: fm.liveswitch.IAction1): void; addOnSendDtmfTone(value: fm.liveswitch.IAction1): void; addOnSendDtmfToneChange(value: fm.liveswitch.IAction1): void; insertDtmfTone(dtmfTone: fm.liveswitch.dtmf.Tone): boolean; insertDtmfTones(dtmfTones: fm.liveswitch.dtmf.Tone[]): boolean; removeOnReceiveDtmfTone(value: fm.liveswitch.IAction1): void; removeOnReceiveDtmfToneChange(value: fm.liveswitch.IAction1): void; removeOnSendDtmfTone(value: fm.liveswitch.IAction1): void; removeOnSendDtmfToneChange(value: fm.liveswitch.IAction1): void; getOpusDisabled(): boolean; getG722Disabled(): boolean; getPcmuDisabled(): boolean; getPcmaDisabled(): boolean; setOpusDisabled(value: boolean): void; setG722Disabled(value: boolean): void; setPcmuDisabled(value: boolean): void; setPcmaDisabled(value: boolean): void; addOnDiscardOutboundDtmfTones(value: fm.liveswitch.IAction1): void; removeOnDiscardOutboundDtmfTones(value: fm.liveswitch.IAction1): void; /** * Sets the static Jitter Buffer Size for supported connection types. * Currently, only Media-over-Websockets connections are supported. * Defaults to 250 ms. * @param timeMs - size of the jitter buffer in ms. */ static setStaticJitterBufferSize(timeMs: number): void; /** * Gets the static Jitter Buffer Size for supported connection types. * Currently, only Media-over-Websockets connections are supported. * @returns timeMs - size of the jitter buffer in ms. */ static getStaticJitterBufferSize(): number; } } declare namespace fm.liveswitch { abstract class MediaTrack extends fm.liveswitch.Dynamic implements fm.liveswitch.IMediaTrack, fm.liveswitch.IExternalMediaTrack { getTypeString(): string; getMedia(): fm.liveswitch.Media; constructor(media: fm.liveswitch.Media); addOnMuted(value: fm.liveswitch.IAction0): void; addOnUnmuted(value: fm.liveswitch.IAction0): void; addOnStarted(value: fm.liveswitch.IAction0): void; addOnStopped(value: fm.liveswitch.IAction0): void; addOnDestroyed(value: fm.liveswitch.IAction0): void; removeOnMuted(value: fm.liveswitch.IAction0): void; removeOnUnmuted(value: fm.liveswitch.IAction0): void; removeOnStarted(value: fm.liveswitch.IAction0): void; removeOnStopped(value: fm.liveswitch.IAction0): void; removeOnDestroyed(value: fm.liveswitch.IAction0): void; changeSinkOutput(sinkOutput: fm.liveswitch.SinkOutput): fm.liveswitch.Future; changeSourceInput(sourceInput: fm.liveswitch.SourceInput): fm.liveswitch.Future; destroy(): boolean; getMuted(): boolean; getSinkOutput(): fm.liveswitch.SinkOutput; getSinkOutputs(): fm.liveswitch.Future; getSourceInput(): fm.liveswitch.SourceInput; getSourceInputs(): fm.liveswitch.Future; setMuted(value: boolean): void; setSinkOutput(value: fm.liveswitch.SinkOutput): void; setSourceInput(value: fm.liveswitch.SourceInput): void; } } declare namespace fm.liveswitch { class AudioTrack extends fm.liveswitch.MediaTrack implements fm.liveswitch.IAudioTrack, fm.liveswitch.IExternalAudioTrack { getTypeString(): string; constructor(media: fm.liveswitch.Media, internalMedia?: fm.liveswitch.IInternalMedia); addOnLevel(value: fm.liveswitch.IAction1): void; getGain(): number; getLevelInterval(): number; getVolume(): number; removeOnLevel(value: fm.liveswitch.IAction1): void; setGain(value: number): void; setLevelInterval(value: number): void; setVolume(value: number): void; } } declare namespace fm.liveswitch { class Connection extends fm.liveswitch.Dynamic implements fm.liveswitch.IConnection, fm.liveswitch.IExternalConnection { getTypeString(): string; constructor(stream: fm.liveswitch.Stream); constructor(streams: fm.liveswitch.Stream[]); constructor(streams: fm.liveswitch.Stream[], useWebSocketsForMedia: boolean); getDiagnosticsConfig(): fm.liveswitch.diagnostics.config.DiagnosticsConfig; getStreamMatches(): fm.liveswitch.StreamMatch[]; getMediaProtocol(): fm.liveswitch.MediaProtocol; addToWebSocketConnection(openArgs: fm.liveswitch.WssServiceOpenArgs): void; updateWebSocketConnection(config: fm.liveswitch.ConnectionConfig, promise: fm.liveswitch.Promise): void; addOnRoundTripTime(value: fm.liveswitch.IAction1): void; addIceServer(iceServer: fm.liveswitch.IceServer): void; addIceServers(iceServers: fm.liveswitch.IceServer[]): void; addOnGatheringStateChange(value: fm.liveswitch.IAction1): void; addOnIceConnectionStateChange(value: fm.liveswitch.IAction1): void; addOnLocalCandidate(value: fm.liveswitch.IAction2): void; addOnLocalDescription(value: fm.liveswitch.IAction2): void; addOnRemoteCandidate(value: fm.liveswitch.IAction2): void; addOnRemoteDescription(value: fm.liveswitch.IAction2): void; addOnSignallingStateChange(value: fm.liveswitch.IAction1): void; addOnStateChange(value: fm.liveswitch.IAction1): void; addRemoteCandidate(remoteCandidate: fm.liveswitch.Candidate): fm.liveswitch.Future; close(): boolean; createAnswer(): fm.liveswitch.Future; createOffer(): fm.liveswitch.Future; getDeadStreamTimeout(): number; getError(): fm.liveswitch.Error; getFailedTransport(): fm.liveswitch.TransportType; getExternalId(): string; getBundlePolicy(): fm.liveswitch.BundlePolicy; getIceGatherPolicy(): fm.liveswitch.IceGatherPolicy; getIceServer(): fm.liveswitch.IceServer; getGatheringState(): fm.liveswitch.IceGatheringState; getIceConnectionState(): fm.liveswitch.IceConnectionState; getIceServers(): fm.liveswitch.IceServer[]; getId(): string; getLocalDescription(): fm.liveswitch.SessionDescription; getRemoteDescription(): fm.liveswitch.SessionDescription; getSignallingState(): fm.liveswitch.SignallingState; getState(): fm.liveswitch.ConnectionState; getStats(): fm.liveswitch.Future; getStreams(): fm.liveswitch.Stream[]; getTieBreaker(): string; getLegacyTimeout(): boolean; getTimeout(): number; getTrickleIcePolicy(): fm.liveswitch.TrickleIcePolicy; getHasAudio(): boolean; getHasVideo(): boolean; getHasData(): boolean; getAudioStream(): fm.liveswitch.AudioStream; getAudioStreams(): fm.liveswitch.AudioStream[]; getVideoStream(): fm.liveswitch.VideoStream; getVideoStreams(): fm.liveswitch.VideoStream[]; getDataStream(): fm.liveswitch.DataStream; getDataStreams(): fm.liveswitch.DataStream[]; getVideoRetentionPolicy(): fm.liveswitch.VideoRetentionPolicy; getVideoEnabledUpdateConnectionPolicy(): fm.liveswitch.IFunction1; removeIceServer(iceServer: fm.liveswitch.IceServer): void; removeIceServers(iceServers: fm.liveswitch.IceServer[]): void; removeOnRoundTripTime(value: fm.liveswitch.IAction1): void; removeOnGatheringStateChange(value: fm.liveswitch.IAction1): void; removeOnIceConnectionStateChange(value: fm.liveswitch.IAction1): void; removeOnLocalCandidate(value: fm.liveswitch.IAction2): void; removeOnLocalDescription(value: fm.liveswitch.IAction2): void; removeOnRemoteCandidate(value: fm.liveswitch.IAction2): void; removeOnRemoteDescription(value: fm.liveswitch.IAction2): void; removeOnSignallingStateChange(value: fm.liveswitch.IAction1): void; removeOnStateChange(value: fm.liveswitch.IAction1): void; setDeadStreamTimeout(value: number): void; setExternalId(value: string): void; setError(value: fm.liveswitch.Error): void; addOnExternalIdChange(value: fm.liveswitch.IAction2): void; removeOnExternalIdChange(value: fm.liveswitch.IAction2): void; setBundlePolicy(value: fm.liveswitch.BundlePolicy): void; setIceGatherPolicy(value: fm.liveswitch.IceGatherPolicy): void; setIceServer(value: fm.liveswitch.IceServer): void; setIceServers(value: fm.liveswitch.IceServer[]): void; setServerSupportsLsGroups(allowed: boolean): void; setPeerSupportsLsGroups(allowed: boolean): void; setLocalDescription(localDescription: fm.liveswitch.SessionDescription): fm.liveswitch.Future; setLegacyTimeout(legacyTimeout: boolean): void; setRemoteDescription(remoteDescription: fm.liveswitch.SessionDescription): fm.liveswitch.Future; setState(state: fm.liveswitch.ConnectionState, error: fm.liveswitch.Error): void; setTimeout(value: number): void; setTrickleIcePolicy(value: fm.liveswitch.TrickleIcePolicy): void; setTieBreaker(value: string): void; setVideoRetentionPolicy(value: fm.liveswitch.VideoRetentionPolicy): void; setVideoEnabledUpdateConnectionPolicy(value: fm.liveswitch.IFunction1): void; getRemoteMedia(): fm.liveswitch.RemoteMedia; private externalsToInternals; private externalToInternal; private internalsToExternals; private internalToExternal; updateLogContext(logContext: fm.liveswitch.LogContext): void; setStateLedger(ledger: fm.liveswitch.ConnectionStateLedger): void; } } declare namespace fm.liveswitch { class DataChannel extends fm.liveswitch.Dynamic implements fm.liveswitch.IDataChannel, fm.liveswitch.IExternalDataChannel { getTypeString(): string; getIsInternal(): boolean; getInfo(): fm.liveswitch.DataChannelInfo; constructor(label: string, ordered?: boolean, subprotocol?: string); setOnReceive(value: fm.liveswitch.IAction1): void; getSubprotocol(): string; getOnReceive(): fm.liveswitch.IAction1; sendDataString(dataString: string): fm.liveswitch.Future; sendDataBytes(dataBytes: fm.liveswitch.DataBuffer): fm.liveswitch.Future; getState(): fm.liveswitch.DataChannelState; getLabel(): string; getId(): string; getOrdered(): boolean; addOnStateChange(value: fm.liveswitch.IAction1): void; removeOnStateChange(value: fm.liveswitch.IAction1): void; } } declare namespace fm.liveswitch { class DataStream extends fm.liveswitch.Stream implements fm.liveswitch.IDataStream, fm.liveswitch.IExternalDataStream { getTypeString(): string; getInfo(): fm.liveswitch.DataStreamInfo; constructor(channel: fm.liveswitch.DataChannel); constructor(channels: fm.liveswitch.DataChannel[]); constructor(); setGetRemoteConnectionInfo(value: fm.liveswitch.IFunction1): void; getAllChannels(): fm.liveswitch.DataChannel[]; getChannels(): fm.liveswitch.DataChannel[]; private externalToInternal; private externalsToInternals; private internalToExternal; private internalsToExternals; addChannel(channel: fm.liveswitch.DataChannel): void; addOnChannel(value: fm.liveswitch.IAction1): void; removeOnChannel(value: fm.liveswitch.IAction1): void; addOnInternalChannel(value: fm.liveswitch.IAction1): void; removeOnInternalChannel(value: fm.liveswitch.IAction1): void; } } declare namespace fm.liveswitch { class DomAudioSink extends fm.liveswitch.Dynamic implements fm.liveswitch.IExternalDomAudioSink { getTypeString(): string; getAudio(): HTMLAudioElement; constructor(track: fm.liveswitch.AudioTrack); } } declare namespace fm.liveswitch { /** A layout preset. */ class LayoutPreset extends fm.liveswitch.Dynamic { getTypeString(): string; /** @hidden */ private __blockHeight; /** @hidden */ private __blockHeightPercent; /** @hidden */ private __blockMarginX; /** @hidden */ private __blockMarginXPercent; /** @hidden */ private __blockMarginY; /** @hidden */ private __blockMarginYPercent; /** @hidden */ private __blockWidth; /** @hidden */ private __blockWidthPercent; /** @hidden */ private __floatHeight; /** @hidden */ private __floatHeightPercent; /** @hidden */ private __floatMarginX; /** @hidden */ private __floatMarginXPercent; /** @hidden */ private __floatMarginY; /** @hidden */ private __floatMarginYPercent; /** @hidden */ private __floatWidth; /** @hidden */ private __floatWidthPercent; /** @hidden */ private _alignment; /** @hidden */ private _direction; /** @hidden */ private _inlineMargin; /** @hidden */ private _mode; private fmliveswitchLayoutPresetInit; /** Initializes a new instance of the [[fm.liveswitch.layoutPreset]] class. */ constructor(); /** @hidden */ private static calculateInlineOverflowFrame; /** @hidden */ private static calculateTable; /** @hidden */ private static divideByTwo; /** Gets a Facetime-style layout preset. */ static getFacetime(): fm.liveswitch.LayoutPreset; /** Gets a Google Hangouts-style layout preset. Note that this will present differently on mobile devices. */ static getGoogleHangouts(): fm.liveswitch.LayoutPreset; /** @hidden */ private static getSingleLayout; /** Gets a Skype-style layout preset. Note that this will present differently on mobile devices. */ static getSkype(): fm.liveswitch.LayoutPreset; /** @hidden */ private static getXMax; /** @hidden */ private static getXMid; /** @hidden */ private static getXMin; /** @hidden */ private static getYMax; /** @hidden */ private static getYMid; /** @hidden */ private static getYMin; /** @hidden */ private static mergeLayoutFrames; /** @hidden */ private static spliceLayoutFrame; /** @hidden */ private static takeLayoutFrames; /** @hidden */ static transformFrame(frame: fm.liveswitch.LayoutFrame, origin: fm.liveswitch.LayoutOrigin, layoutWidth: number, layoutHeight: number): void; /** Applies a preset. @param preset The preset to apply. */ applyPreset(preset: fm.liveswitch.LayoutPreset): void; /** @hidden */ private calculateBlockFrame; /** @hidden */ private calculateFillFrame; /** @hidden */ private calculateFloatFrame; /** @hidden */ private calculateFloatFrames; /** @hidden */ private calculateInlineFrame; /** @hidden */ private calculateInlineFrames; /** @hidden */ private calculateInlineOverflowFrames; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param local Whether a local frame is needed. @param remoteCount The number of remote frames. @param origin The layout origin. @param localVideoSize The local video size. @param remoteVideoSizes The remote video sizes. @return The video frame layout. */ calculateLayout(layoutWidth: number, layoutHeight: number, local: boolean, remoteCount: number, origin: fm.liveswitch.LayoutOrigin, localVideoSize: fm.liveswitch.Size, remoteVideoSizes: fm.liveswitch.Size[]): fm.liveswitch.Layout; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param remoteCount The number of remote frames. @param origin The layout origin. @return The video frame layout. */ calculateLayout(layoutWidth: number, layoutHeight: number, remoteCount: number, origin: fm.liveswitch.LayoutOrigin): fm.liveswitch.Layout; /** Copies this preset's properties to another preset. @param preset The target preset. */ copyToPreset(preset: fm.liveswitch.LayoutPreset): void; /** Gets the alignment of the layout. Defaults to [[fm.liveswitch.layoutAlignment.BottomRight]]. */ getAlignment(): fm.liveswitch.LayoutAlignment; /** Gets the height of block elements in pixels. Overrides [[fm.liveswitch.layoutPreset.blockHeightPercent]]. */ getBlockHeight(): number; /** Gets the height of block elements as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockHeight]]. */ getBlockHeightPercent(): number; /** @hidden */ private getBlockLayout; /** Gets the X-margin between block elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.blockMarginXPercent]]. */ getBlockMarginX(): number; /** Gets the X-margin between block elements and the layout edge as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockMarginX]]. */ getBlockMarginXPercent(): number; /** Gets the Y-margin between block elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.blockMarginYPercent]]. */ getBlockMarginY(): number; /** Gets the Y-margin between block elements and the layout edge as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockMarginY]]. */ getBlockMarginYPercent(): number; /** Gets the width of block elements in pixels. Overrides [[fm.liveswitch.layoutPreset.blockWidthPercent]]. */ getBlockWidth(): number; /** Gets the width of block elements as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockWidth]]. */ getBlockWidthPercent(): number; /** @hidden */ private getBottomRowIndexes; /** @hidden */ private getCenterColumnIndexes; /** @hidden */ private getCenterRowIndexes; /** Gets the direction of the layout flow. Defaults to [[fm.liveswitch.layoutDirection.Horizontal]]. */ getDirection(): fm.liveswitch.LayoutDirection; /** Gets the height of floating elements in pixels. Overrides [[fm.liveswitch.layoutPreset.floatHeightPercent]]. */ getFloatHeight(): number; /** Gets the height of floating elements as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatHeight]]. */ getFloatHeightPercent(): number; /** @hidden */ private getFloatLocalLayout; /** Gets the X-margin between floating elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.floatMarginXPercent]]. */ getFloatMarginX(): number; /** Gets the X-margin between floating elements and the layout edge as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatMarginX]]. */ getFloatMarginXPercent(): number; /** Gets the Y-margin between floating elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.floatMarginYPercent]]. */ getFloatMarginY(): number; /** Gets the Y-margin between floating elements and the layout edge as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatMarginY]]. */ getFloatMarginYPercent(): number; /** @hidden */ private getFloatRemoteLayout; /** Gets the width of floating elements in pixels. Overrides [[fm.liveswitch.layoutPreset.floatWidthPercent]]. */ getFloatWidth(): number; /** Gets the width of floating elements as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatWidth]]. */ getFloatWidthPercent(): number; /** @hidden */ private getInlineLayout; /** Gets the size of the margin in pixels to use between inline elements. */ getInlineMargin(): number; /** @hidden */ private getInlineOverflowLayout; /** @hidden */ private getLeftColumnIndexes; /** Gets the mode used by the layout engine. Defaults to [[fm.liveswitch.layoutMode.FloatLocal]]. */ getMode(): fm.liveswitch.LayoutMode; /** @hidden */ private getRightColumnIndexes; /** @hidden */ private getTopRowIndexes; /** Sets the alignment of the layout. Defaults to [[fm.liveswitch.layoutAlignment.BottomRight]]. */ setAlignment(value: fm.liveswitch.LayoutAlignment): void; /** Sets the height of block elements in pixels. Overrides [[fm.liveswitch.layoutPreset.blockHeightPercent]]. */ setBlockHeight(value: number): void; /** Sets the height of block elements as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockHeight]]. */ setBlockHeightPercent(value: number): void; /** Sets the X-margin between block elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.blockMarginXPercent]]. */ setBlockMarginX(value: number): void; /** Sets the X-margin between block elements and the layout edge as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockMarginX]]. */ setBlockMarginXPercent(value: number): void; /** Sets the Y-margin between block elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.blockMarginYPercent]]. */ setBlockMarginY(value: number): void; /** Sets the Y-margin between block elements and the layout edge as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockMarginY]]. */ setBlockMarginYPercent(value: number): void; /** Sets the width of block elements in pixels. Overrides [[fm.liveswitch.layoutPreset.blockWidthPercent]]. */ setBlockWidth(value: number): void; /** Sets the width of block elements as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.blockWidth]]. */ setBlockWidthPercent(value: number): void; /** Sets the direction of the layout flow. Defaults to [[fm.liveswitch.layoutDirection.Horizontal]]. */ setDirection(value: fm.liveswitch.LayoutDirection): void; /** Sets the height of floating elements in pixels. Overrides [[fm.liveswitch.layoutPreset.floatHeightPercent]]. */ setFloatHeight(value: number): void; /** Sets the height of floating elements as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatHeight]]. */ setFloatHeightPercent(value: number): void; /** Sets the X-margin between floating elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.floatMarginXPercent]]. */ setFloatMarginX(value: number): void; /** Sets the X-margin between floating elements and the layout edge as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatMarginX]]. */ setFloatMarginXPercent(value: number): void; /** Sets the Y-margin between floating elements and the layout edge in pixels. Overrides [[fm.liveswitch.layoutPreset.floatMarginYPercent]]. */ setFloatMarginY(value: number): void; /** Sets the Y-margin between floating elements and the layout edge as a percent of the container height between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatMarginY]]. */ setFloatMarginYPercent(value: number): void; /** Sets the width of floating elements in pixels. Overrides [[fm.liveswitch.layoutPreset.floatWidthPercent]]. */ setFloatWidth(value: number): void; /** Sets the width of floating elements as a percent of the container width between 0.0 and 1.0. Overrides [[fm.liveswitch.layoutPreset.floatWidth]]. */ setFloatWidthPercent(value: number): void; /** Sets the size of the margin in pixels to use between inline elements. */ setInlineMargin(value: number): void; /** Sets the mode used by the layout engine. Defaults to [[fm.liveswitch.layoutMode.FloatLocal]]. */ setMode(value: fm.liveswitch.LayoutMode): void; } } declare namespace fm.liveswitch { /** A class that supplies simple video frame layout management. */ abstract class LayoutManager extends fm.liveswitch.LayoutPreset { getTypeString(): string; /** @hidden */ private __onLayout; /** @hidden */ private _inBatch; /** @hidden */ private _layoutOrigin; /** @hidden */ private _localView; /** @hidden */ private _onLayout; /** @hidden */ private _remoteViewsLock; /** @hidden */ private _remoteViewsTable; private fmliveswitchLayoutManagerInit; /** Initializes a new instance of the [[fm.liveswitch.layoutManager]] class. */ constructor(); /** Initializes a new instance of the [[fm.liveswitch.layoutManager]] class. */ constructor(preset: fm.liveswitch.LayoutPreset); /** Adds a handler that is raised when a layout is calculated. */ addOnLayout(value: fm.liveswitch.IAction1): void; /** Adds remote media to the layout. @param remoteMedia The remote media. @return `true` if successful; otherwise, `false`. */ addRemoteMedia(remoteMedia: fm.liveswitch.IViewableMedia): boolean; /** Adds a remote view to the layout. @param idValue The remote view ID. @param view The remote view. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ addRemoteView(idValue: string, view: T): boolean; /** Adds remote views to the layout. @param ids The remote view IDs. @param views The remote views. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ addRemoteViews(ids: string[], views: T[]): boolean; /** @hidden */ private addRemoteViewsUI; /** @hidden */ private addRemoteViewUI; /** Adds a view to the container. @param view The view to add. */ protected abstract addView(view: T): void; /** Dispatches an action to the main thread. @param action The action to invoke. @param arg1 The first argument. @param arg2 The second argument. */ protected abstract dispatchToMainThread(action: fm.liveswitch.IAction2, arg1: Object, arg2: Object): void; /** Gets the local view. @return The local view. */ protected doGetLocalView(): T; /** Gets the remote views for a given remote view ID. @param idValue The remote view ID. @return The remote views. */ protected doGetRemoteViews(idValue: string): Array; /** Gets the remote view IDs. @return The remote view IDs. */ protected doGetRemoteViewsIds(): string[]; /** @hidden */ private doSwapRemoteView; /** @hidden */ private doSwapRemoteViews; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param local Whether a local frame is needed. @param remoteCount The number of remote frames. @return The video frame layout. */ protected getLayout(layoutWidth: number, layoutHeight: number, local: boolean, remoteCount: number): fm.liveswitch.Layout; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param local Whether a local frame is needed. @param remoteCount The number of remote frames. @param remoteViewIds The remote view IDs. @return The video frame layout. */ protected getLayout(layoutWidth: number, layoutHeight: number, local: boolean, remoteCount: number, remoteViewIds: string[]): fm.liveswitch.Layout; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param local Whether a local frame is needed. @param remoteCount The number of remote frames. @param remoteViewIds The remote view IDs. @param localVideoSize The local video size. @param remoteVideoSizes The remote video sizes. @return The video frame layout. */ protected getLayout(layoutWidth: number, layoutHeight: number, local: boolean, remoteCount: number, remoteViewIds: string[], localVideoSize: fm.liveswitch.Size, remoteVideoSizes: fm.liveswitch.Size[]): fm.liveswitch.Layout; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param remoteCount The number of remote frames. @return The video frame layout. */ protected getLayout(layoutWidth: number, layoutHeight: number, remoteCount: number): fm.liveswitch.Layout; /** Gets a video frame layout. @param layoutWidth The total width of the layout. @param layoutHeight The total height of the layout. @param remoteCount The number of remote frames. @param remoteViewIds The remote view IDs. @return The video frame layout. */ protected getLayout(layoutWidth: number, layoutHeight: number, remoteCount: number, remoteViewIds: string[]): fm.liveswitch.Layout; /** Gets the layout origin. Defaults to TopLeft. */ getLayoutOrigin(): fm.liveswitch.LayoutOrigin; /** Gets the local view from the layout. @return The local view. */ getLocalView(): T; /** @hidden */ private getNewestRemoteView; /** @hidden */ private getOldestRemoteView; /** Gets a remote view from the layout. @param idValue The remote view ID. @return The remote view. */ getRemoteView(idValue: string): T; /** Gets the IDs of the remote views in the layout. @return The remote view IDs. */ getRemoteViewIds(): string[]; /** Gets all remote views from the layout. @return The remote views. */ getRemoteViews(): Array; /** Gets remote views from the layout. @param ids The remote view IDs. @return The remote views. */ getRemoteViews(ids: string[]): Array; /** @hidden */ private getRemoteViewsInternal; /** Positions the local and remote views within the layout. */ abstract layout(): void; /** Positions the local and remote views within the layout after dispatching to the main thread. */ layoutOnMainThread(): void; /** @hidden */ private layoutOnMainThreadUI; /** Removes a handler that is raised when a layout is calculated. */ removeOnLayout(value: fm.liveswitch.IAction1): void; /** Removes remote media from the layout. @param remoteMedia The remote media. @return `true` if successful; otherwise, `false`. */ removeRemoteMedia(remoteMedia: fm.liveswitch.IViewableMedia): boolean; /** Removes a remote view from the layout. @param idValue The remote view ID. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ removeRemoteView(idValue: string): boolean; /** Removes all remote views from the layout. */ removeRemoteViews(): void; /** Removes remote views from the layout. @param ids The remote view IDs. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ removeRemoteViews(ids: string[]): boolean; /** @hidden */ private removeRemoteViewsUI; /** @hidden */ private removeRemoteViewUI; /** Removes a view from the container. @param view The view to remove. */ protected abstract removeView(view: T): void; /** Removes all remote views from the layout, then removes the local view from the layout. */ reset(): void; /** Sets the layout origin. Defaults to TopLeft. */ protected setLayoutOrigin(value: fm.liveswitch.LayoutOrigin): void; /** Adds the local media to the layout. @param localMedia The local media. @return `true` if successful; otherwise, `false`. */ setLocalMedia(localMedia: fm.liveswitch.IViewableMedia): boolean; /** Adds the local view to the layout. @param view The local view. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ setLocalView(view: T): boolean; /** @hidden */ private setLocalViewUI; /** Swaps remote media in the layout. @param remoteMediaToRemove The remote media to remove. @param remoteMediaToAdd The remote media to add. */ swapRemoteMedia(remoteMediaToRemove: fm.liveswitch.IViewableMedia, remoteMediaToAdd: fm.liveswitch.IViewableMedia): boolean; /** Swaps a remote view in the layout. @param idToRemove The remote view ID to remove. @param idToAdd The remote view ID to add. @param viewToAdd The remote view to add. */ swapRemoteView(idToRemove: string, idToAdd: string, viewToAdd: T): boolean; /** Swaps remote views in the layout. @param idsToRemove The remote view IDs to remove. @param idsToAdd The remote view IDs to add. @param viewsToAdd The remote views to add. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ swapRemoteViews(idsToRemove: string[], idsToAdd: string[], viewsToAdd: T[]): boolean; /** Removes the local view from the layout. @return `true` if successful; otherwise, `false`. Check the logs for additional information. */ unsetLocalView(): boolean; /** @hidden */ private unsetLocalViewUI; } } declare namespace fm.liveswitch { class DomLayoutManager extends fm.liveswitch.LayoutManager { getTypeString(): string; getContainer(): HTMLElement; constructor(container: HTMLElement, preset?: fm.liveswitch.LayoutPreset); private initializeInnerContainer; private destroyInnerContainer; destroy(): void; protected addView(view: HTMLElement): void; protected removeView(view: HTMLElement): void; protected dispatchToMainThread(action: fm.liveswitch.IAction2, arg1: any, arg2: any): void; protected doGetLocalView(): HTMLElement; protected doGetRemoteViewsIds(): string[]; protected doGetRemoteViews(idValue: string): HTMLElement[]; private getViewsByClassName; private getParentViews; private getParentView; private collectionToArray; layout(): void; private getVideoSize; private getWebRtcVideoSize; private addOnVideoSizeChange; private addOnWebRtcVideoSizeChange; private getVerticalScrollbarWidth; private getHorizontalScrollbarHeight; } } declare namespace fm.liveswitch { class DomVideoSink extends fm.liveswitch.Dynamic implements fm.liveswitch.IExternalDomVideoSink { getTypeString(): string; getVideo(): HTMLVideoElement; getView(): HTMLElement; getViewScale(): fm.liveswitch.LayoutScale; setViewScale(viewScale: fm.liveswitch.LayoutScale): void; getViewMirror(): boolean; setViewMirror(viewMirror: boolean): void; constructor(track: fm.liveswitch.VideoTrack); } } declare namespace fm.liveswitch { class Factory { getTypeString(): string; static createConnection(streams: fm.liveswitch.Stream[]): fm.liveswitch.Connection; static createAudioStream(localMedia: fm.liveswitch.LocalMedia): fm.liveswitch.AudioStream; static createVideoStream(localMedia: fm.liveswitch.LocalMedia): fm.liveswitch.VideoStream; static createDataChannel(label: string): fm.liveswitch.DataChannel; static createDataStream(channel: fm.liveswitch.DataChannel): fm.liveswitch.DataStream; static createDomVideoSink(track: fm.liveswitch.VideoTrack): fm.liveswitch.DomVideoSink; static createLocalMedia(audio: any, video: any, screen?: boolean): fm.liveswitch.LocalMedia; } } declare namespace fm.liveswitch { /** * Defines methods to obtain auxiliary information about ICE Candidates. * This class helps in processing WebRTC ICE candidates and extracting their properties, * particularly for relay candidates where we need to determine the protocol being used. */ class IceCandidateProcessor { /** * Returns the type string identifier for this class */ getTypeString(): string; /** * Processes an ICE candidate event and creates a icelink Candidate object. * This method handles the conversion from a WebRTC ICE candidate to icelink's * internal candidate representation, including protocol detection for relay candidates. * * @param event The RTCPeerConnection ICE candidate event containing the candidate * @returns Promise resolving to a icelink Candidate object or null if invalid */ static processCandidate(event: RTCPeerConnectionIceEvent): fm.liveswitch.Candidate; } } declare namespace fm.liveswitch { interface IExternal { } } declare namespace fm.liveswitch { interface IExternalAudioStream extends fm.liveswitch.IAudioStream, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalAudioTrack extends fm.liveswitch.IAudioTrack, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalConnection extends fm.liveswitch.IConnection, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalDataChannel extends fm.liveswitch.IDataChannel, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalDataStream extends fm.liveswitch.IDataStream, fm.liveswitch.IExternal { addChannel(channel: fm.liveswitch.IExternalDataChannel): void; } } declare namespace fm.liveswitch { interface IExternalDomAudioSink extends fm.liveswitch.IExternal { getAudio(): HTMLAudioElement; } } declare namespace fm.liveswitch { interface IExternalDomVideoSink extends fm.liveswitch.IViewSink, fm.liveswitch.IExternal { getVideo(): HTMLVideoElement; } } declare namespace fm.liveswitch { interface IExternalLocalMedia extends fm.liveswitch.ILocalMedia, fm.liveswitch.IViewSinkableMedia, fm.liveswitch.IExternal, fm.liveswitch.IExternalMedia { } } declare namespace fm.liveswitch { interface IExternalMedia extends fm.liveswitch.IMedia, fm.liveswitch.IViewSinkableMedia { getAudioSink(): fm.liveswitch.IExternalDomAudioSink; getVideoSink(): fm.liveswitch.IExternalDomVideoSink; } } declare namespace fm.liveswitch { interface IExternalMediaStream extends fm.liveswitch.IMediaStream, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalMediaTrack extends fm.liveswitch.IMediaTrack, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalRemoteMedia extends fm.liveswitch.IRemoteMedia, fm.liveswitch.IViewSinkableMedia, fm.liveswitch.IExternal, fm.liveswitch.IExternalMedia { } } declare namespace fm.liveswitch { interface IExternalStream extends fm.liveswitch.IStream, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalVideoStream extends fm.liveswitch.IVideoStream, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IExternalVideoTrack extends fm.liveswitch.IVideoTrack, fm.liveswitch.IExternal { } } declare namespace fm.liveswitch { interface IInternal { } } declare namespace fm.liveswitch { interface IInternalAudioStream extends fm.liveswitch.IAudioStream, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalAudioTrack extends fm.liveswitch.IAudioTrack, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalConnection extends fm.liveswitch.IConnection, fm.liveswitch.IInternal { addToWebSocketConnection(openArgs: fm.liveswitch.WssServiceOpenArgs): void; addOnRoundTripTime(value: fm.liveswitch.IAction1): void; updateWebSocketConnection(config: fm.liveswitch.ConnectionConfig, promise: fm.liveswitch.Promise): void; setState(state: fm.liveswitch.ConnectionState): void; getVideoRetentionPolicy(): fm.liveswitch.VideoRetentionPolicy; setVideoRetentionPolicy(value: fm.liveswitch.VideoRetentionPolicy): void; getVideoEnabledUpdateConnectionPolicy(): fm.liveswitch.IFunction1; setVideoEnabledUpdateConnectionPolicy(value: fm.liveswitch.IFunction1): void; updateLogContext(context: fm.liveswitch.LogContext): void; getStreamMatches(): fm.liveswitch.StreamMatch[]; setServerSupportsLsGroups(lsGroupsAllowed: boolean): void; setPeerSupportsLsGroups(lsGroupsAllowed: boolean): void; setStateLedger(ledger: fm.liveswitch.ConnectionStateLedger): void; getFailedTransport(): fm.liveswitch.TransportType; } } declare namespace fm.liveswitch { interface IInternalDataChannel extends fm.liveswitch.IDataChannel, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalDataStream extends fm.liveswitch.IDataStream, fm.liveswitch.IInternal { getAllChannels(): fm.liveswitch.IInternalDataChannel[]; addChannel(channel: fm.liveswitch.IInternalDataChannel): void; } } declare namespace fm.liveswitch { interface IInternalDomAudioSink extends fm.liveswitch.IInternal { getAudio(): HTMLAudioElement; } } declare namespace fm.liveswitch { interface IInternalDomVideoSink extends fm.liveswitch.IViewSink, fm.liveswitch.IInternal { getVideo(): HTMLVideoElement; } } declare namespace fm.liveswitch { interface IInternalLocalMedia extends fm.liveswitch.ILocalMedia, fm.liveswitch.IViewSinkableMedia, fm.liveswitch.IInternal, fm.liveswitch.IInternalMedia { } } declare namespace fm.liveswitch { interface IInternalMedia extends fm.liveswitch.IMedia, fm.liveswitch.IViewSinkableMedia { getAudioSink(): fm.liveswitch.IInternalDomAudioSink; getVideoSink(): fm.liveswitch.IInternalDomVideoSink; isAudioLevelSupported(): boolean; addOnAudioLevelUnavailable(value: fm.liveswitch.IAction0): void; } } declare namespace fm.liveswitch { interface IInternalMediaStream extends fm.liveswitch.IMediaStream, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalMediaTrack extends fm.liveswitch.IMediaTrack, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalRemoteMedia extends fm.liveswitch.IRemoteMedia, fm.liveswitch.IViewSinkableMedia, fm.liveswitch.IInternal, fm.liveswitch.IInternalMedia { } } declare namespace fm.liveswitch { interface IInternalStream extends fm.liveswitch.IStream, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalVideoStream extends fm.liveswitch.IVideoStream, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { interface IInternalVideoTrack extends fm.liveswitch.IVideoTrack, fm.liveswitch.IInternal { } } declare namespace fm.liveswitch { abstract class Media extends fm.liveswitch.Dynamic implements fm.liveswitch.IMedia, fm.liveswitch.IExternalMedia { getTypeString(): string; /** * Registers a handler that triggers when the audio track is destroyed. */ addOnAudioDestroyed(value: fm.liveswitch.IAction0): void; /** * Registers a handler that triggers when the video track is destroyed. */ addOnVideoDestroyed(value: fm.liveswitch.IAction0): void; /** * Removes a handler set to raise when the audio object is destroyed. */ removeOnAudioDestroyed(value: fm.liveswitch.IAction0): void; /** * Removes a handler set to raise when the video object is destroyed. */ removeOnVideoDestroyed(value: fm.liveswitch.IAction0): void; /** * Registers a handler that gives audio level updates for the media. This method can be called before or after the media has started. When the media is in the Started state, the function runs every 100 milliseconds.
* Use this method to determine which audio streams are active. */ addOnAudioLevel(value: fm.liveswitch.IAction1): void; /** * Registers a handler that provides updates about the media’s video size.
* This event can be used to determine when the video size changes. */ addOnVideoSize(value: fm.liveswitch.IAction1): void; addOnVideoSizeChange(value: fm.liveswitch.IAction1): void; /** * Gets a value indicating the gain (input amplification) of this audio track. */ getAudioGain(): number; /** * Gets the interval in milliseconds between audio level events. */ getAudioLevelInterval(): number; /** * Checks whether the audio track is muted. Returns true if the audio track is muted and false otherwise. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. */ getAudioMuted(): boolean; /** * Gets the audio track from this media. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. Returns null if there are no audio tracks. */ getAudioTrack(): fm.liveswitch.AudioTrack; /** * Gets all audio tracks from this media. */ getAudioTracks(): fm.liveswitch.AudioTrack[]; /** * Gets a value that indicates the volume (output resistance) of the audio track.
* Valid values range between 0.0 and 1.0. A value of 1.0 indicates that there is no output resistance and audio is played at the input level. A value of 0.0 mutes the audio.
* If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. */ getAudioVolume(): number; /** * Gets the unique media identifier. */ getId(): string; /** * Checks whether the video track is muted. Returns true if the video track is muted and false otherwise.
* If the muted video track is part of a local media stack, then all outbound video frames are muted for any participants receiving them. If the muted video track is part of a remote media stack, then inbound video frames are muted and other participants are not affected.
* If there are multiple video tracks in a custom media stack, this method calls into the first video track. */ getVideoMuted(): boolean; /** * Gets the video track’s resolution.
* If there are multiple video tracks in a custom media stack, this method calls into the first video track.
* If you need to adjust a UI’s layout, use this method to check video dimensions. You can also use addOnVideoSize to ensure that the code is responsive. */ getVideoSize(): fm.liveswitch.Size; /** * Gets the video track from this media.
* If there are multiple video tracks in a custom media stack, this method calls into the first video track. Returns null if there are no video tracks. */ getVideoTrack(): fm.liveswitch.VideoTrack; /** * Gets all video tracks from this media. */ getVideoTracks(): fm.liveswitch.VideoTrack[]; /** * Gets the next frame from the video track once it is rendered.
* If there are multiple video tracks in a custom media stack, this method calls into the first video track.
* This method could be used for asynchronous video processing or analysis. */ grabVideoFrame(): fm.liveswitch.Future; /** * Removes a handler that gives audio level updates for the media. */ removeOnAudioLevel(value: fm.liveswitch.IAction1): void; /** * Removes a registered function that provides updates about the media’s video size. */ removeOnVideoSize(value: fm.liveswitch.IAction1): void; removeOnVideoSizeChange(value: fm.liveswitch.IAction1): void; /** * Sets the gain (input amplification) of the audio track. Any value greater than or equal to 0.0 is valid. The default value is 1. If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. */ setAudioGain(value: number): void; /** * Sets the interval in milliseconds between audio level events. */ setAudioLevelInterval(value: number): void; /** * Sets the audio track to mute. This method silences audio but does not disable the audio source or prevent its data from flowing through the processing pipeline.
* If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. */ setAudioMuted(value: boolean): void; /** * Sets the audio volume on the audio track. Valid values range between 0.0 and 1.0. A value of 1.0 indicates that there is no output resistance and audio plays at the input level. A value of 0.0 mutes the audio.
* If there are multiple audio tracks in a custom media stack, this method calls into the first audio track. */ setAudioVolume(value: number): void; /** * Sets the unique media identifier. */ setId(value: string): void; /** * Mutes or unmutes video for LocalMedia. For example, if you call setVideoMuted before joining a channel, your video is muted when you join.
* If there are multiple video tracks in a custom media stack, this method calls into the first video track. */ setVideoMuted(value: boolean): void; /** * Destroys all non-persistent internal objects encapsulated by the Media class.
* This method iterates over all audio and video tracks and calls each track's Destroy method for non-persistent tracks. */ destroy(): void; /** * Gets the audio sink. An audio sink is where audio leaves the processing pipeline.
* An example of an audio sink is a playback device like a speaker. */ getAudioSink(): fm.liveswitch.DomAudioSink; /** * Gets the video view sink if video is not disabled. ViewSink controls the view which displays the video.
* For example, in HTML the