import { EncoderDecoder } from '@iotize/common/converter/api'; import { Observable } from 'rxjs'; import { EditableDataStreamInterface, KeyTypeType } from '../utility/editable-data-stream'; import { AbstractVariable } from './abstract-variable-stream'; /** * You should use ConverterVariableView instead */ export declare class VariableView implements EditableDataStreamInterface { readonly id: KeyType; context: { /** * The underlying variable from whiich the view will be created */ variable: AbstractVariable; /** * Index to extract from the whole buffer (starting from 0) * Buffer size will be the array length * size of one element defined by the variable type */ indexes: number[]; /** * If set to false, Tap will read the current value before editing and writing the new index * If set to true and if Tap already know the current value, it will not perform a read before editing the value */ useLastKnownValueBeforeWrite?: boolean; /** * Defined how the extracted value should be decoded */ converter: EncoderDecoder; }; get converter(): EncoderDecoder>; get indexes(): number[]; get rawValues(): Observable>; get valueSnapshot(): DataType | undefined; get values(): Observable; get rawValueSnaphot(): Uint8Array | undefined; constructor(id: KeyType, context: { /** * The underlying variable from whiich the view will be created */ variable: AbstractVariable; /** * Index to extract from the whole buffer (starting from 0) * Buffer size will be the array length * size of one element defined by the variable type */ indexes: number[]; /** * If set to false, Tap will read the current value before editing and writing the new index * If set to true and if Tap already know the current value, it will not perform a read before editing the value */ useLastKnownValueBeforeWrite?: boolean; /** * Defined how the extracted value should be decoded */ converter: EncoderDecoder; }); notifyRawValue(newValue: Uint8Array): void; read(): Promise; write(value: DataType): Promise; readRaw(): Promise; writeRaw(value: Uint8Array): Promise; private subDataView; private encodeValue; private decodeValue; }