tc-context
Version:
TwinCAT ADS Communication Library for creating an active TwinCAT Context, with automatic symbol and type mapping
738 lines • 31.1 kB
TypeScript
/**
* Module, which contains the definitions of all types of Bindings, which act as a layer between `TcSymbol` and the
* `TcCom` Object. It manages type checking, all the communication, and event emission, as well as memory locations, which
* are associated with the `TcSymbol`
*
*
* Licensed under MIT License.
*
* Copyright (c) 2020 Dmitrij Trifanov <d.v.trifanov@gmail.com>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*
* @packageDocumentation
*/
/// <reference types="debug" />
import { TcContext } from './tc-context';
import { TcType, TcNumericType, TcStringType, TcEnumType } from './tc-type';
import { TcSymbolPointer, TcDataPackage } from './tc-com';
import { TcEvent, TcEmitter } from './tc-event';
import { TcSymbol } from './tc-symbol';
/**
* Class which acts as an abstraction layer between a `TcSymbol` and the `TcCom` layer.
* It is responsible for value conversion to Data and from it, as well as Type Checking,
* storing all the Memory location which must be read, how to execute clearing of a Symbol.
*
* By itself, the `TcBinding` also acts as a Symbol Pointer, which is used for subscribing
* for change notifications
*
* Lastly, it is also the EventEmitter for the `TcSymbol`
*
*/
export declare abstract class TcBinding extends TcEmitter implements TcSymbolPointer {
/**
* Constructor for a Binding with no information on memory location, but definition of its components
* and different parameters, used by derived classes
*
* @param context - The `TcContext` which owns this binding
* @param symbol - The `TcSymbol` which owns this binding
* @param parent - Parent Emitter, to whom a event will be propagate to
* @param onSet - Alias, which to use in place of 'set'
* @param onGet - Alias, which to use in place of 'get'
* @param onClear - Alias, which to use in place of 'cleared'
* @param onChange - Alias, which to use in place of 'changed'
* @param debug - If enabled, will produce debug information
*/
constructor(context: TcContext, symbol: TcSymbol, parent: TcEmitter, onSet?: string, onGet?: string, onClear?: string, onChange?: string, debug?: boolean);
/**
* Index Group of this `TcBinding`
*/
get indexGroup(): number;
/**
* Index Offset of this `TcBinding`
*/
get indexOffset(): number;
/**
* Size of the Symbol, this `TcBinding` points to
*/
get size(): number;
/**
* The `TcSymbol` owner of this `TcBinding`
*/
get symbol(): TcSymbol;
/**
* The `TcContext` owner of this `TcBinding`
*/
get context(): TcContext;
/**
* Flag, when if true, `TcBinding` is valid
*/
get isValid(): boolean;
/**
* Flag, when if true, `TcBinding` is ReadOnly an no write operation can be invoked
*/
get readOnly(): boolean;
/**
* Performs a read of all the Memory Pointers, belonging to this `TcBinding`
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComDataReadException} - Failed to read data pointers
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @return - Values, of the Target PLC Symbol, which belong to this `TcBinding`
*
*/
read(): Promise<any>;
/**
* Performs a write operation by converting values to memory locations and data to send,
* which are part of this `TcBinding`
*
* @param value - The value that is to be written to the `TcBinding`
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
* @throws {@link TcBindingInvalidTypeException} - Type mismatch with one a value, that is to be written
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComDataWriteException} - Failed to write data packages
* @throws {@link TcComToRawException} - Failed to convert the Raw Data
*
* @return - The value which was written to the Target PLC Symbol, which belong to this `TcBinding`
*
*/
write(value: any): Promise<any>;
/**
* Clears the data of all non-ReadOnly `TcBindings`, which belong to this `TcBinding`
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to clear a ReadOnly `TcBinding`
* @throws {@link TcComIsInvalidException} - Attempting operation on an invalidated `TcCom` Object
* @throws {@link TcComDataWriteException} - Failed to write data packages
*
*/
clear(): Promise<void>;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: any): void;
/**
* Emits a 'set' event, unless it was aliased to a custom name
*
* @param data - The data, to pass along with the event
*/
emitSet(data: TcEvent): void;
/**
* Emits a 'get' event, unless it was aliased to a custom name
*
* @param data - The data, to pass along with the event
*/
emitGet(data: TcEvent): void;
/**
* Emits a 'cleared' event, unless it was aliased to a custom name
*
* @param data - The data, to pass along with the event
*/
emitCleared(data: TcEvent): void;
/**
* Emits a 'changed' event, unless it was aliased to a custom name
*
* @param data - The data, to pass along with the event
*/
emitChange(data: TcEvent): void;
/**
* Performs a subscription of this `TcBinding` for monitoring value change
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComSubscribeException} - Failed to subscribe to the provided pointer
*
* @param sampling - The speed at which change is detected
* @param callback - Callback, which is invoked when a change does happened
*/
subscribe(sampling: number, callback: (value: any) => void): Promise<void>;
/**
* Unsubscribes this `TcBinding` from monitoring value changes
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComUnsubscribeException} - Failed to unsubscribe the handle
*/
unsubscribe(): Promise<void>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
abstract fromRaw(dataPackages: TcDataPackage[]): Promise<any>;
/**
* Converts Values to ADS Data Packages
*
* @param value - The value which is to be converted
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
* @throws {@link TcBindingInvalidTypeException} - Type mismatch with one a value, that is to be written
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComToRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
abstract toRaw(value: any): Promise<TcDataPackage[]>;
/**
* Get all the Data Packages, needed to perform a clear operation
*/
get clearPackages(): TcDataPackage[];
/**
* Get all the Memory Pointers, needed to perform a read operation
*/
get readPackages(): TcSymbolPointer[];
/**
* Stores an array of memory locations, which can be read
* @internal
*/
protected __readPackages: TcSymbolPointer[];
/**
* Invalidates the provided `TcBinding`
*
* @param binding - The `TcBinding`, which is to be invalidated
*/
static invalidate(binding: TcBinding): void;
/**
* Stores an array of data packages locations, which can be used to clear the `TcBinding`
* @internal
*/
protected __clearPackages: TcDataPackage[];
/**
* @internal
*/
private __isValid;
/**
* @internal
*/
private __context;
/**
* @internal
*/
private __onSet;
/**
* @internal
*/
private __onGet;
/**
* @internal
*/
private __onClear;
/**
* @internal
*/
private __onChange;
/**
* @internal
*/
private __subscription?;
/**
* @internal
*/
private __symbol;
/**
* @internal
*/
protected __indexGroup: number;
/**
* @internal
*/
protected __indexOffset: number;
/**
* @internal
*/
protected __size: number;
/**
* @internal
*/
protected __log: debug.Debugger;
}
/**
* Base class for `TcBindings` used on Target PLC Symbols. This excludes `PROGRAMS` and
* variable lists
*/
export declare abstract class TcSymbolBinding extends TcBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcType, parent: TcEmitter, debug?: boolean);
}
/**
* Base class for `TcBindings` used on PlC Symbols, that are not structured.
* This excludes `Structures`, `Function_Blocks` and `Unions`
*
* `TcSimpleBinding` have an explicit default value
*/
declare abstract class TcSimpleBinding extends TcSymbolBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcType, parent: TcEmitter, debug?: boolean);
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(dataPackages: TcDataPackage[]): Promise<boolean | number | bigint | string | {
name: string;
}>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
toRaw(value: boolean | number | bigint | string): Promise<TcDataPackage[]>;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: boolean | number | bigint | string): void;
/**
* @internal
*/
protected __type: string;
/**
* @internal
*/
private __defaultValue?;
}
/**
* Base class for `TcBindings´ used for PLC Symbols of Type `Structure`, `Function_Block` and `Union`
*/
declare abstract class TcComplexBinding extends TcSymbolBinding {
/**
* Internal method, for adding a Child `TcBinding` to a specified `TcComplexBinding`
*
* @param binding - The binding, to which the child is added
* @param child - The child, which is to be added to the binding
*
* @internal
*/
static addChild(binding: TcComplexBinding, child: {
key: string | number;
binding: TcSymbolBinding;
}): void;
/**
* Internal method, for adding a Child `TcBinding` as part of this `TcComplexBinding`
*
* @param child - The Child that is to be added
*/
protected __addChild(child: {
key: string | number;
binding: TcSymbolBinding;
}): void;
/**
* @internal
*/
protected __childrenBindings: {
[name: string]: TcSymbolBinding;
};
}
/**
* `TcBinding` for attaching to `BOOL` PLC Symbol
*/
export declare class TcBooleanBinding extends TcSimpleBinding {
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: boolean): void;
}
/**
* `TcBinding` for attaching to Numeric PLC Symbols
*/
export declare class TcNumericBinding extends TcSimpleBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcNumericType, parent: TcEmitter, debug?: boolean);
/**
* Access the maximum value, that is safe to write to Symbol
*/
get upperBorder(): number | bigint;
/**
* Access the minimum value, that is safe to write to Symbol
*/
get lowerBorder(): number | bigint;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: number | bigint): void;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(value: TcDataPackage[]): Promise<number | bigint>;
/**
* @internal
*/
private __adst;
/**
* @internal
*/
private __upperBorder;
/**
* @internal
*/
private __lowerBorder;
}
/**
* `TcBinding` for attaching to `STRING` or `WSTRING` PLC Symbols
*/
export declare class TcStringBinding extends TcSimpleBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcStringType, parent: TcEmitter, debug?: boolean);
/**
* Access the maximum length of a string, that is safe to write to the PLC Symbol
*/
get length(): number;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: string): void;
/**
* @internal
*/
private __length;
}
/**
* `TcBinding` for attaching to `ENUM` PLC Symbols
*/
export declare class TcEnumBinding extends TcSimpleBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcEnumType, parent: TcEmitter, debug?: boolean);
/**
* Access the fields, which are allowed to be written to the PLC Symbol
*/
get fields(): string[];
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(value: TcDataPackage[]): Promise<string>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
toRaw(value: string): Promise<TcDataPackage[]>;
/**
* @internal
*/
private __fields;
/**
* @internal
*/
private __buffers;
}
/**
* `TcBinding` for attaching to `Structures`, `Function_Blocks` or `Unions` PLC Symbols
*/
export declare class TcStructureBinding extends TcComplexBinding {
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: {
[key: string]: any;
}): void;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(dataPackages: TcDataPackage[]): Promise<{
[key: string]: any;
}>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
toRaw(value: {
[key: string]: any;
}): Promise<TcDataPackage[]>;
/**
* Will attempt to invoke the provided method, based on the variable path and the method name, with the
* provided arguments.
*
* As of now, no type checking is performed on the passed arguments, and this function acts as a simple through put
* to the `TcCom` Module
*
* @param path - The full path to the `Function_Block`, whose method is called
* @param method - The method name, that is to be called
* @param args - All the arguments, as an object, that are passed to the method
*
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComMethodCallException} - Failed to call the Rpc Method on the PLC Side
*
* @return - The result of the method call
*
*/
callMethod(path: string, method: string, args: any): Promise<{
result: any;
outputs?: any;
}>;
}
/**
* `TcBinding` for attaching to `ARRAY OF...` PLC Symbols
*/
export declare class TcArrayBinding extends TcComplexBinding {
/**
* Constructs a binding with information of the Symbol location, and the default Type Parameters
*
* @param symbol - The `TcSymbol` which owns this binding
* @param pointer - The memory location in the PLC, where the Symbol is located
* @param parameters - Symbol Type data
* @param dimension - The dimension definition of this Array Symbol
* @param parent - The parent of this Symbol, to whom events are propagated
* @param debug - If enabled, will produce debug information
*/
constructor(symbol: TcSymbol, pointer: TcSymbolPointer, parameters: TcType, dimension: {
startIndex: number;
length: number;
}, parent: TcEmitter, debug?: boolean);
/**
* Access the Start Index of this Array
*/
get startIndex(): number;
/**
* Access the length of this Array
*/
get length(): number;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: any[]): void;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
toRaw(value: any[]): Promise<TcDataPackage[]>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(dataPackages: TcDataPackage[]): Promise<any[]>;
/**
* @internal
*/
private __startIndex;
/**
* @internal
*/
private __length;
}
/**
* `TcBinding` for attaching to `PROGRAMS` or `Variable Lists` PLC Symbols.
*
* The `TcNamespaceBinding` is unique, because it has no parent - it is the entry point,
* as well as its Memory Definition is based on the Children passed to it
*/
export declare class TcNamespaceBinding extends TcBinding {
/**
* Constructor a namespace Binding, which will grow and adjust, as children are added to it
*
* @param context - The `TcContext` which owns this binding
* @param symbol - The `TcSymbol` which owns this binding
* @param parent - Parent Emitter, to whom a event will be propagate to
* @param debug - If enabled, will produce debug information
*/
constructor(context: TcContext, symbol: TcSymbol, parent: TcEmitter, debug?: boolean);
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
fromRaw(dataPackages: TcDataPackage[]): Promise<{
[key: string]: any;
}>;
/**
* Converts Data Packages from ADS to Values
*
* @throws {@link TcBindingIsInvalidException} - Attempting to use an invalid `TcBinding`
* @throws {@link TcBindingOutOfRangeException} - Failure splitting reading buffer
* @throws {@link TcComIsInvalidException} - Attempted to use an Invalid `TcCom` Object for subscription
* @throws {@link TcComFromRawException} - Failed to convert the Raw Data
*
* @param dataPackages - The ADS Data packages, that are to be transformed
*/
toRaw(value: {
[key: string]: any;
}): Promise<TcDataPackage[]>;
/**
* Checks the input, to see if it valid and can be safely written to the Target PLC
*
* @throws {@link TcBindingIsInvalidException} - Attempting operation on an invalidated `TcBinding`
* @throws {@link TcBindingReadOnlyException} - Attempting to write to a ReadOnly `TcBinding`
*
* @param value - The value to check for validity
*/
checkInput(value: {
[key: string]: any;
}): void;
/**
* Internal method, for adding a Child `TcSymbolBinding` as part of this `TcNamespaceBinding`
*
* The method also readjusts the indexOffset and size of this `TcNamespaceBinding`
*
* @param child - The Child that is to be added
*/
private __addChild;
/**
* Internal method, for adding a Child `TcSymbolBinding` as part of this `TcNamespaceBinding`
*
* @param child - The Child that is to be added
*/
static addChild(binding: TcNamespaceBinding, child: {
key: string | number;
binding: TcSymbolBinding;
}): void;
/**
* @internal
*/
private __childrenBindings;
}
export {};
//# sourceMappingURL=tc-binding.d.ts.map