UNPKG

rxpoweredup

Version:

A Typescript RxJS-based library for controlling LEGO Powered UP hubs & peripherals.

57 lines (56 loc) 3.11 kB
import { Observable } from 'rxjs'; import { MessageType } from '../constants'; import { IHubConnectionErrorsFactory } from './i-hub-connection-errors-factory'; import { ICharacteristicDataStreamFactory } from './i-characteristic-data-stream-factory'; import type { BluetoothDeviceWithGatt, ILogger } from '../types'; import { IHub } from './i-hub'; import { IOutboundMessengerFactory } from './i-outbound-messenger-factory'; import { IHubPropertiesFeature } from './i-hub-properties-feature'; import { IHubPropertiesFeatureFactory } from './i-hub-properties-feature-factory'; import { IMotorsFeatureFactory } from './i-motors-feature-factory'; import { IMotorsFeature } from './i-motors-feature'; import { IPortsFeatureFactory } from './i-ports-feature-factory'; import { IPortsFeature } from './i-ports-feature'; import { IInboundMessageListenerFactory } from './i-inbound-message-listener-factory'; import { IReplyParser } from './i-reply-parser'; import { HubConfig } from './hub-config'; import { IHubActionsFeatureFactory } from './i-hub-actions-feature-factory'; import { IRgbLightFeatureFactory } from './i-rgb-light-feature-factory'; import { IRgbLightFeature } from './i-rgb-light-feature'; export declare class Hub implements IHub { private readonly device; private readonly logger; private readonly config; private readonly hubConnectionErrorFactory; private readonly outboundMessengerFactory; private readonly propertiesFeatureFactory; private readonly ioFeatureFactory; private readonly characteristicsDataStreamFactory; private readonly commandsFeatureFactory; private readonly genericErrorReplyParser; private readonly messageListenerFactory; private readonly hubActionsFeatureFactory; private readonly ledFeatureFactory; private readonly gattServerDisconnectEventName; private _ports?; private _motors?; private _led?; private _properties?; private _isConnected; private _disconnected$; private _actionsFeature?; private outboundMessenger?; constructor(device: BluetoothDeviceWithGatt, logger: ILogger, config: HubConfig, hubConnectionErrorFactory: IHubConnectionErrorsFactory, outboundMessengerFactory: IOutboundMessengerFactory, propertiesFeatureFactory: IHubPropertiesFeatureFactory, ioFeatureFactory: IPortsFeatureFactory, characteristicsDataStreamFactory: ICharacteristicDataStreamFactory, commandsFeatureFactory: IMotorsFeatureFactory, genericErrorReplyParser: IReplyParser<MessageType.genericError>, messageListenerFactory: IInboundMessageListenerFactory, hubActionsFeatureFactory: IHubActionsFeatureFactory, ledFeatureFactory: IRgbLightFeatureFactory); get willSwitchOff(): Observable<void>; get willDisconnect(): Observable<void>; get ports(): IPortsFeature; get motors(): IMotorsFeature; get rgbLight(): IRgbLightFeature; get properties(): IHubPropertiesFeature; get disconnected(): Observable<void>; connect(): Observable<void>; disconnect(): Observable<void>; switchOff(): Observable<void>; private createFeatures; private connectGattServer; }