import { ConfigParamsCloud } from "./common-types"; import { DeviceImpl } from "./device"; export declare function initSdk(appId: string, configParam?: ConfigParamsCloud): Promise; export declare namespace YLSdkImplCallbacks { type attach = (device: DeviceImpl) => void; type detach = (device: DeviceImpl) => void; type firstScanDone = () => void; } export declare type YLSdkImplEvents = 'attach' | 'detach' | 'firstScanDone'; export declare const ylEventsList: YLSdkImplEvents[]; export declare class YLSdkImpl { private readonly eventEmitter; private readonly deviceList; private readonly promiseFirceScanDone; readonly appId?: string; constructor(appId: string, configParam: ConfigParamsCloud, resolve: (value: YLSdkImpl) => void, reject: (msg: Error) => void); /** * The user must call this function when finished using the wrapper. Otherwise * the node process will not shutdown properly. * * @param {boolean} shutdownServer Optional parameter only applicable to electronrendererhelper, * where it cause API server shutdown if set. Can safely be ignored otherwise. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ disposeAsync(shutdownServer?: boolean): Promise; firseScanForDeviceDoneAsync(): Promise; getAttachedDevice(deviceId: number): DeviceImpl | undefined; getAttachedDevices(): DeviceImpl[]; /** * Integrates softphone app to Yealink applications like Yealink USB Connect(YUC). * @param {string} guid Client unique ID. * @param {string} softphoneName Name of the application to be shown in YUC. * @returns {Promise} - Resolve `boolean` if successful otherwise Reject with `error`. * - Returns `true` if softphone app integrates to Yealink application, `false` otherwise. */ connectToYealinkApplicationAsync(guid: string, softphoneName: string): Promise; /** * Disconnects connected from Yealink applications. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ disconnectFromYealinkApplicationAsync(): Promise; /** * Sets the softphone to Ready. Currently applicable for only Yealink USB Connect(YUC). * @param {boolean} isReady Sets the softphone readiness state. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ setSoftphoneReadyAsync(isReady: boolean): Promise; /** * Indicates whether the softphone is in focus. * @returns {Promise} - Resolve `boolean` if successful otherwise Reject with `error`. * - Returns `true` if softphone is in focus, `false` otherwise. */ isSoftphoneInFocusAsync(): Promise; /** * Get the SDK version. * @returns {Promise} - Resolve SDK version `string` if successful otherwise Reject with `error`. */ getSDKVersionAsync(): Promise; RegEvent(event: 'firstScanDone', listener: YLSdkImplCallbacks.firstScanDone): this; RegEvent(event: 'attach', listener: YLSdkImplCallbacks.attach): this; RegEvent(event: 'detach', listener: YLSdkImplCallbacks.detach): this; UnregEvent(event: 'firstScanDone', listenser: YLSdkImplCallbacks.firstScanDone): this; UnregEvent(event: 'attach', listenser: YLSdkImplCallbacks.attach): this; UnregEvent(event: 'detach', listenser: YLSdkImplCallbacks.detach): this; }