UNPKG

rxpoweredup

Version:

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

35 lines (34 loc) 3.58 kB
import { Observable } from 'rxjs'; import { PortModeInformationType } from '../../constants'; import { AttachedIOAttachVirtualInboundMessage, AttachedIODetachInboundMessage, AttachedIOInboundMessage, AttachedIoAttachInboundMessage, IDisposable, IPortValueTransformer, PortInputSetupSingleHandshakeInboundMessage, PortModeInboundMessage, PortModeInformationInboundMessage, PortValueInboundMessage } from '../../types'; import { IOutboundMessenger, IPortsFeature, OnIoAttachFilter, OnIoDetachFilter } from '../../hub'; import { IPortInformationRequestMessageFactory } from './i-port-information-request-message-factory'; import { IPortModeInformationRequestMessageFactory } from './i-port-mode-information-request-message-factory'; import { IPortInputFormatSetupMessageFactory } from '../i-port-input-format-setup-message-factory'; import { IVirtualPortSetupMessageFactory } from './i-virtual-port-setup-message-factory'; export declare class PortsFeature implements IPortsFeature, IDisposable { private readonly portModeReplies; private readonly attachedIoReplies; private readonly attachedIoCachedReplies; private readonly portModeInformationReplies; private readonly portValueSetupSingleHandshakeReplies; private readonly portInformationRequestMessageFactory; private readonly rawPortValueReplies; private readonly portModeInformationMessageFactory; private readonly portInputFormatSetupMessageFactory; private readonly virtualPortSetupMessageFactory; private readonly messenger; private isDisposed; constructor(portModeReplies: Observable<PortModeInboundMessage>, attachedIoReplies: Observable<AttachedIOInboundMessage>, attachedIoCachedReplies: Observable<AttachedIOInboundMessage>, portModeInformationReplies: Observable<PortModeInformationInboundMessage>, portValueSetupSingleHandshakeReplies: Observable<PortInputSetupSingleHandshakeInboundMessage>, portInformationRequestMessageFactory: IPortInformationRequestMessageFactory, rawPortValueReplies: Observable<PortValueInboundMessage>, portModeInformationMessageFactory: IPortModeInformationRequestMessageFactory, portInputFormatSetupMessageFactory: IPortInputFormatSetupMessageFactory, virtualPortSetupMessageFactory: IVirtualPortSetupMessageFactory, messenger: IOutboundMessenger); dispose(): void; onIoAttach(filterOptions?: OnIoAttachFilter | number): Observable<AttachedIoAttachInboundMessage | AttachedIOAttachVirtualInboundMessage>; onIoDetach(filterOptions?: OnIoDetachFilter | number): Observable<AttachedIODetachInboundMessage>; getPortValue<TTransformer extends IPortValueTransformer<unknown> | void>(portId: number, modeId: number, transformer?: TTransformer): TTransformer extends IPortValueTransformer<infer R> ? Observable<R> : Observable<number[]>; portValueChanges<TTransformer extends IPortValueTransformer<unknown> | void>(portId: number, modeId: number, deltaThreshold: TTransformer extends IPortValueTransformer<infer R> ? R : number, transformer?: TTransformer): TTransformer extends IPortValueTransformer<infer R> ? Observable<R> : Observable<number[]>; getPortModes(portId: number): Observable<PortModeInboundMessage>; getPortModeInformation<T extends PortModeInformationType>(portId: number, mode: number, modeInformationType: T): Observable<PortModeInformationInboundMessage & { modeInformationType: T; }>; createVirtualPort(portIdA: number, portIdB: number): Observable<AttachedIOAttachVirtualInboundMessage>; deleteVirtualPort(virtualPortId: number): Observable<AttachedIODetachInboundMessage>; }