import { EncoderDecoder } from '@iotize/common/converter/api'; import { VariableService, VariableType } from '@iotize/tap/service/impl/variable'; import { KeyTypeType } from '../../utility/editable-data-stream'; import { AbstractVariable } from '../abstract-variable-stream'; import { TapVariableConfig } from '../tap-bundle/tap-bundle'; export declare function createTapVariableFromConfig(variableService: VariableService, key: KeyType, value: TapVariableConfig): TapVariable; export declare namespace TapVariable { interface Config { /** * Tap configured ID */ id: number; dataType?: VariableType.Data; length?: number; } interface InstanceOptions { variableService: Pick; config: Config; converter?: EncoderDecoder; /** * Use this option if you want to extract only a subset of the data * For exemple if your Tap variable is configured to hold 10 bytes of data but you only want bytes 4, 5, 6, and 7 use subIndex option [4,5,6,7] (index starting from 0) */ subIndex?: number[]; } } export declare class TapVariable extends AbstractVariable { /** * Variable name identifier. */ readonly id: KeyType; context: TapVariable.InstanceOptions; get variableId(): number; get converter(): EncoderDecoder; get config(): TapVariable.Config; set converter(converter: EncoderDecoder); constructor( /** * Variable name identifier. */ id: KeyType, context: TapVariable.InstanceOptions); readRawInner(): Promise; writeRaw(value: Uint8Array): Promise; }