UNPKG

bacnet-device

Version:

A TypeScript library for implementing BACnet IP devices in Node.js.

40 lines 1.87 kB
/** * BACnet singlet property implementation module * * This module provides the implementation for BACnet properties * that contain a single value (as opposed to array properties). * * @module */ import { type ApplicationTagValueTypeMap, type BACNetAppData, type PropertyIdentifier, type CharacterStringEncoding, ApplicationTag } from '@innovation-system/node-bacnet'; import { BDAbstractProperty, BDPropertyType, type BDPropertyAccessContext } from './abstract.js'; /** * Implementation of a BACnet property with a single value. * * @typeParam Tag - The BACnet application tag for the property value * @typeParam Type - The JavaScript type corresponding to the application tag */ export declare class BDSingletProperty<Tag extends ApplicationTag, Type extends ApplicationTagValueTypeMap[Tag] = ApplicationTagValueTypeMap[Tag]> extends BDAbstractProperty<Tag, Type, BACNetAppData<Tag, Type>> { type: BDPropertyType; constructor(identifier: PropertyIdentifier, type: Tag, writable: boolean, value: Type | ((ctx: BDPropertyAccessContext) => Type), encoding?: CharacterStringEncoding); getValue(): Type; setValue(value: Type): Promise<void>; /** * * @internal */ ___readData(index: number): BACNetAppData | BACNetAppData[]; /** * Writes a new value to this property for BACnet operations * * This internal method is used by BACnet objects to write the property value * when handling BACnet protocol operations. * * @param value - The new value to write in BACnet format * @returns A promise that resolves when the value has been set * @throws BACnetError if the property is not writable or the value type is invalid * @internal */ ___writeData(value: BACNetAppData<Tag, Type> | BACNetAppData<Tag, Type>[]): Promise<void>; } //# sourceMappingURL=singlet.d.ts.map