import { FirmwareEventStatus, FirmwareEventType, FirmwareInfo } from './fw-types'; import { BtPairedDeviceList } from './bt-types'; import { CameraDirectionCmd, CameraSmartTrackingOpt, CameraZoomCmd } from './camera-types'; import { AudioModes, BusylightStatus, ContactInfo, ContactInfoList, DateTime, DeviceConnectionType, DeviceFeature, DeviceInfo, EqualizerMode, ErrorStatus, DeviceBtnType, HidWorkState, LogEventType, UploadEventStatus, WizardModes, CallAction } from './common-types'; import { DeviceSettings } from './settings-type'; import { RemoteMmiActionOutput, RemoteMmiInput, RemoteMmiOutput, RemoteMmiPriority, RemoteMmiSequence, RemoteMmiType } from './remotemmi-types'; export declare namespace DeviceTypeCallbacks { type btnPress = (btnType: DeviceBtnType, value: boolean) => void; type busyLightChange = (status: boolean) => void; type downloadFirmwareProgress = (type: FirmwareEventType, status: FirmwareEventStatus, dwnldStatusInPrcntg: number) => void; type onBTParingListChange = (pairedListInfo: BtPairedDeviceList) => void; type onGNPBtnEvent = (btnEvents: Array<{ buttonTypeKey: number; buttonTypeValue: string; buttonEventType: Array<{ key: number; value: string; }>; }>) => void; type onDevLogEvent = (data: LogEventType, result: boolean) => void; type onBatteryStatusUpdate = (levelInPercent: number, isCharging: boolean, isBatteryLow: boolean) => void; type onRemoteMmiEvent = (type: RemoteMmiType, input: RemoteMmiInput) => void; type onUploadProgress = (status: UploadEventStatus, levelInPercent: number) => void; type callAction = (cid: number, action: CallAction) => void; type onDialNumebrChange = (cid: number, dialnumber: string) => void; } export declare type DeviceImplEvents = 'btnPress' | 'busyLightChange' | 'downloadFirmwareProgress' | 'onBTParingListChange' | 'onGNPBtnEvent' | 'onDevLogEvent' | 'onBatteryStatusUpdate' | 'onRemoteMmiEvent' | 'onUploadProgress' | 'onDectInfoEvent' | 'callAction' | 'onDialNumebrChange'; export declare const DeviceEventsList: DeviceImplEvents[]; declare type _EventEmitter = import('events').EventEmitter; export declare class DeviceImpl implements DeviceInfo { readonly _eventEmitter: _EventEmitter; constructor(deviceInfo: DeviceInfo); readonly deviceId: number; readonly productId: number; readonly vendorId: number; readonly deviceName: string; readonly errStatus: ErrorStatus; readonly isDongle: boolean; readonly variant: string; readonly serialNumber: string; readonly isInFirmwareUpdateMode: boolean; readonly deviceconnection: DeviceConnectionType; readonly devicePath: string; readonly parentInstanceId: string; readonly dongleName: string; readonly connectionId: number; readonly parentDeviceId: number; isInUpgradeProgress: boolean; getDeviceInfo(): DeviceInfo; getSupportedFeaturesAsync(): Promise>; isFeatureSupportedAsync(feature: DeviceFeature): Promise; isRingSupportedAsync(): Promise; setRingAsync(enable: boolean): Promise; isOffHookSupportedAsync(): Promise; setOffHookAsync(enable: boolean): Promise; isMuteSupportedAsync(): Promise; setMuteAsync(enable: boolean): Promise; isHoldSupportedAsync(): Promise; setHoldAsync(enable: boolean): Promise; isOnlineSupportedAsync(): Promise; setOnline(enable: boolean): Promise; setHidWorkingStateAsync(hidWorkState: HidWorkState): Promise; getHidWorkingStateAsync(): Promise; IsYlHidStdHidSupportedAsync(): Promise; setStdHidEventsFromYealinkDevicesAsync(enable: boolean): Promise; isStdHidEventsFromYealinkDevicesAsync(): Promise; enterDialCallAsync(cid: number): Promise; ringBackCallAsync(cid: number): Promise; incomingCallAsync(cid: number, contact: ContactInfo): Promise; outgoingCallAsync(cid: number, contact: ContactInfo): Promise; terminateCallAsync(cid: number): Promise; answerCallAsync(cid: number): Promise; holdCallAsync(cid: number, contact: ContactInfo): Promise; resumeCallAsync(cid: number): Promise; muteCallAsync(cid: number): Promise; unmuteCallAsync(cid: number): Promise; updateContactAsync(cid: number, contact: ContactInfo): Promise; isSetDateTimeSupportedAsync(): Promise; setDateTimeAsync(dataTime: DateTime): Promise; isUploadRingtoneSupportedAsync(): Promise; uploadRingtoneAsync(path: string): Promise; playRingtoneAsync(type: number): Promise; isBusylightSupportedAsync(): Promise; setBusylightStatusAsync(busylightStatus: BusylightStatus): Promise; getBusylightStatusAsync(): Promise; isEqualizerSupportedAsync(): Promise; getEqualizerModeAsync(): Promise; setEqualizerModeAsync(mode: EqualizerMode): Promise; isWizardModeSupportedAsync(): Promise; setWizardModeAsync(mode: WizardModes): Promise; getWizardModeAsync(): Promise; factoryResetAsync(): Promise; rebootDeviceAsync(): Promise; startExportAudioAsync(path: string): Promise; stopExportAudioAsync(): Promise; isAudioModeSupportedAsync(): Promise; changeAudioModeAsync(mode: AudioModes): Promise; hasDectInDockedAsync(): Promise; getRegionVersionAsync(): Promise; setCurrentTalkContactAsync(contact: ContactInfo): Promise; setContactInfoListAsync(contactList: ContactInfoList): Promise; getBatteryStatusAsync(): Promise<{ levelInPercent?: number; isCharging?: boolean; isBatteryLow?: boolean; }>; getDeviceImagePathAsync(): Promise; exportDevLogAsync(path: string): Promise; uploadDevLogToCloudAsync(): Promise; /** * Gets the complete settings details (all groups and its settings) for a device. * @returns {Promise, YealinkError>} - Resolve setting `array` if successful otherwise Reject with `error`. */ getSettingsAsync(): Promise; /** * Gets the unique setting identified by a GUID of a device. * @param {string} guid - the unique setting identifier. * @returns {Promise, YealinkError>} - Resolve setting `array` if successful otherwise Reject with `error`. */ getSettingAsync(guid: string): Promise; /** * Sets all the settings( including all groups and its settings) for a device. * @param {Array} settings - pass only changed settings in an array * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`, `reboot` etc. * * Nb. Currently this method returns an error with code=24 if rebooting as bi-result. * TODO: Change signature to return reboot information normally instead. */ setSettingsAsync(settings: DeviceSettings): Promise; /** * Connect/Reconnect Bluetooth device to the Yealink Bluetooth adapter. Ensure the Bluetooth device is switched on and within range. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ connectBTDeviceAsync(): Promise; /** * Get name of connected BT device with BT Adapter(Async). * @returns {Promise} - Resolve deviceName `string` if successful otherwise Reject with `error`. */ getConnectedBTDeviceNameAsync(): Promise; /** * Connect a new device. * @param {string} deviceName - name of device to be connected. * @param {string} deviceBTAddr - BTAddress of device to be connected. * @param {boolean} isConnected - current status of device to be connected. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ connectNewDeviceAsync(deviceName: string, deviceBTAddr: string, isConnected: boolean): Promise; /** * Connect a device which was already paired. * @param {string} deviceName - name of device to be connected. * @param {string} deviceBTAddr - BTAddress of device to be connected. * @param {boolean} isConnected - current status of device to be connected. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. * - **Note** : After device connection, getPairingListAsync api has to be called to get updated connection status. */ connectPairedDeviceAsync(deviceName: string, deviceBTAddr: string, isConnected: boolean): Promise; /** * Disconnect Bluetooth device from Bluetooth adapter. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ disconnectBTDeviceAsync(): Promise; /** * Disconnect a paired device. * @param {string} deviceName - name of device to be disconnected. * @param {string} deviceBTAddr - BTAddress of device to be disconnected. * @param {boolean} isConnected - current status of device to be disconnected. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. * - **Note** : After device disconnection, getPairingListAsync api has to be called to get updated connection status. */ disconnectPairedDeviceAsync(deviceName: string, deviceBTAddr: string, isConnected: boolean): Promise; /** * Get Auto pairing mode enable or disable. * @returns {Promise} - Resolve `boolean` if successful otherwise Reject with `error`. * - `true` if auto pairing mode is enabled, `false` otherwise. */ getAutoConnectingAsync(): Promise; /** * When Bluetooth adapter is plugged into the PC it will attempt to connect with the last connected Bluetooth device. If it cannot connect, it will automatically search for new Bluetooth devices to connect to. * @param {boolean} value - enable or disable for auto pairing. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ setAutoConnectingAsync(value: boolean): Promise; /** * Checks if pairing list is supported by the device. * @returns {Promise} - Resolve `boolean` if successful otherwise Reject with `error`. * - Returns `true` if pairing list is supported, false if device does not support pairing list. */ isPairingListSupportedAsync(): Promise; /** * Gets the list of devices which are paired previously. * @returns { Promise, YealinkError>} - Resolve pairList `array` if successful otherwise Reject with `error`. */ getPairingListAsync(): Promise>; /** * Clear list of paired BT devices from BT adapter. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ clearPairingListAsync(): Promise; /** * Set the bluetooth device in pairing mode. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ setBTDiscoverableAsync(): Promise; /** * Search for available Bluetooth devices which are switched on, within range and ready to connect. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ scanNewDevicesAsync(): Promise; /** * Stop search for available Bluetooth devices. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ stopBTScanAsync(): Promise; /** * Clear a device from paired device list. * @param {string} deviceName - name of device to be connected. * @param {string} deviceBTAddr - BTAddress of device to be connected. * @param {boolean} isConnected - current status of device to be connected. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ clearPairedDeviceAsync(deviceName: string, deviceBTAddr: string, isConnected: boolean): Promise; /** * Gets the list of new devices which are available to pair & connect. * @returns { Promise, YealinkError>} - Resolve pairList `array` if successful otherwise Reject with `error`. * - **Note**: `isConnected`, flag in Pairing List Object, will always be false as device does not give connection status for the found device. */ getSearchDeviceListAsync(): Promise>; /** * Get firmware version of the device. * @returns {Promise} - Resolve version `string` if successful otherwise Reject with `error`. */ getFirmwareVersionAsync(): Promise; /** * Gets details of the latest firmware present in cloud. * @returns {Promise} - Resolve firminfo `object` if successful otherwise Reject with `error`. */ getLatestFirmwareInformationAsync(): Promise; /** * Downloads the specified firmware version file. * @param {string} version - Version for which file download needs to be initiated. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ downloadFirmwareAsync(version: string): Promise; /** * Upgrades / Updates the firmware for the target device with specified version. * @param {string} fwPath - firmware file path. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ updateFirmwareAsync(fwPath: string): Promise; /** * Get the file path of the downloaded file. * @param {string} version - Version for which the path is required. * @returns {Promise} - Resolve firmware file path `string` if successful otherwise Reject with `error`. * - **Note**: Call `downloadFirmwareAsync` first to ensure that data is current */ getFirmwareFilePathAsync(version: string): Promise; /** * Cancels the firmware download (Async). * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ cancelFirmwareDownloadAsync(): Promise; /** * Check if Firmware update available for device. * @returns {Promise} - Resolve `boolean` if successful otherwise Reject with `error`. * - `true` - if a new firmware update is available (existing firmware not up to date), `false` otherwise (existing firmware up to date). */ checkForFirmwareUpdateAsync(): Promise; /** * Gets the focus of the remote MMI specified. Once a remote MMI has * focus, the normal functionality of the MMI (button/LED) is suppressed until * #releaseRemoteMmiFocusAsync is called. * If only the LED output MMI functionality is required, action can be * specified as MMI_ACTION_NONE. * @param {enumRemoteMmiType} type Type of remote MMI to get focus of. * @param {enumRemoteMmiInput} input Action to get focus of, acts as a filter/mask for the * actions on the RemoteMmiCallback callback * @param {enumRemoteMmiPriority} priority Priority of focus. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ getRemoteMmiFocusAsync(type: RemoteMmiType, input: RemoteMmiInput, priority: RemoteMmiPriority): Promise; /** * Releases the focus of the remote MMI specified. Note that focus on * all actions are removed. * @param {enumRemoteMmiType} type Type of remote MMI to release focus of. * @returns {Promise} - Resolve `void` if successful otherwise Reject with `error`. */ releaseRemoteMmiFocusAsync(type: RemoteMmiType): Promise; /** * Gets the status of the remote MMI focus. * @param {enumRemoteMmiType} type Type of remote MMI to get focus status of. * @returns {Promise} returns true if in focus, false if not. */ isRemoteMmiInFocusaAsync(type: RemoteMmiType): Promise; /** * Sets an output action on the remote MMI. Note that * getRemoteMmiFocusAsync must be called once for the enumRemoteMmiType in * question prior to setting the output action, else YealinkError is * returned. * @param {enumRemoteMmiType} type type Type of remote MMI to set action of. * @param {RemoteMmiActionOutput} outputAction Output LED action to set. * @returns {Promise} returns true if in focus, false if not. */ setRemoteMmiActionAsync(type: RemoteMmiType, actionOutput: RemoteMmiActionOutput): Promise; getRemoteMmiTypesAsync(): Promise>; cameraIsReadyAsync(): Promise; cameraIsInIdleAsync(): Promise; cameraDirectionCtrlAsync(cmd: CameraDirectionCmd): Promise; cameraZoomCtrlAsync(cmd: CameraZoomCmd): Promise; cameraPTZResetAsync(): Promise; cameraAddPresetAsync(pathPic: string): Promise; cameraDelPresetAsync(presetIndex: number): Promise; cameraDelAllPresetAsync(): Promise; cameraGetAllPresetAsync(): Promise>; cameraUpdatePresetAsync(presetIndex: number, pathPic: string): Promise; cameraApplyPresetAsync(presetIndex: number): Promise; cameraGetSmartTrackingOptInfoAsync(): Promise>; cameraSetSmartTrackingOptAsync(opt: CameraSmartTrackingOpt): Promise; cameraGetSamrtTrackingOptAsync(): Promise; cameraSetFaceDetectionAsync(enable: boolean): Promise; cameraIsFaceDetectionEnableAsync(): Promise; /** * Add event handler for btnPress device events. * Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'btnPress', listener: DeviceTypeCallbacks.btnPress): this; /** * Add event handler for busyLightChange device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'busyLightChange', listener: DeviceTypeCallbacks.busyLightChange): this; /** * Add event handler for downloadFirmwareProgress device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'downloadFirmwareProgress', listener: DeviceTypeCallbacks.downloadFirmwareProgress): this; /** * Add event handler for onBTParingListChange device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'onBTParingListChange', listener: DeviceTypeCallbacks.onBTParingListChange): this; /** * Add event handler for onGNPBtnEvent device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'onGNPBtnEvent', listener: DeviceTypeCallbacks.onGNPBtnEvent): this; /** * Add event handler for onBatteryStatusUpdate device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'onBatteryStatusUpdate', listener: DeviceTypeCallbacks.onBatteryStatusUpdate): this; /** * Add event handler for remoteMmi events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'onRemoteMmiEvent', listener: DeviceTypeCallbacks.onRemoteMmiEvent): this; /** * Add event handler for onDevLogEvent device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ RegEvent(event: 'onDevLogEvent', listener: DeviceTypeCallbacks.onDevLogEvent): this; RegEvent(event: 'callAction', listener: DeviceTypeCallbacks.callAction): this; RegEvent(event: 'onDialNumebrChange', listener: DeviceTypeCallbacks.onDialNumebrChange): this; /** * Add event handler for btnPress device events. * Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'btnPress', listener: DeviceTypeCallbacks.btnPress): this; /** * Add event handler for busyLightChange device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'busyLightChange', listener: DeviceTypeCallbacks.busyLightChange): this; /** * Add event handler for downloadFirmwareProgress device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'downloadFirmwareProgress', listener: DeviceTypeCallbacks.downloadFirmwareProgress): this; /** * Add event handler for onBTParingListChange device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'onBTParingListChange', listener: DeviceTypeCallbacks.onBTParingListChange): this; /** * Add event handler for onGNPBtnEvent device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'onGNPBtnEvent', listener: DeviceTypeCallbacks.onGNPBtnEvent): this; /** * Add event handler for onBatteryStatusUpdate device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'onBatteryStatusUpdate', listener: DeviceTypeCallbacks.onBatteryStatusUpdate): this; /** * Add event handler for remoteMmi events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'onRemoteMmiEvent', listener: DeviceTypeCallbacks.onRemoteMmiEvent): this; /** * Add event handler for onDevLogEvent device events. * *Please make sure your callback arguments matches the event type or you will get a misleading typescript error. See also {@link https://github.com/microsoft/TypeScript/issues/30843 30843}* */ UnregEvent(event: 'onDevLogEvent', listener: DeviceTypeCallbacks.onDevLogEvent): this; UnregEvent(event: 'callAction', listener: DeviceTypeCallbacks.callAction): this; UnregEvent(event: 'onDialNumebrChange', listener: DeviceTypeCallbacks.onDialNumebrChange): this; } export {};