node-opcua-address-space-base 2.98.0 → 2.98.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. package/dist/address_space.d.ts +176 -0
  2. package/dist/address_space.js +3 -0
  3. package/dist/address_space.js.map +1 -0
  4. package/dist/base_node.d.ts +187 -0
  5. package/dist/base_node.js +4 -0
  6. package/dist/base_node.js.map +1 -0
  7. package/dist/bind_variable.d.ts +52 -0
  8. package/dist/bind_variable.js +3 -0
  9. package/dist/bind_variable.js.map +1 -0
  10. package/dist/clone_options.d.ts +49 -0
  11. package/dist/clone_options.js +25 -0
  12. package/dist/clone_options.js.map +1 -0
  13. package/dist/continuation_point.d.ts +2 -0
  14. package/dist/continuation_point.js +3 -0
  15. package/dist/continuation_point.js.map +1 -0
  16. package/dist/event_notifier_flags.d.ts +7 -0
  17. package/dist/event_notifier_flags.js +12 -0
  18. package/dist/event_notifier_flags.js.map +1 -0
  19. package/dist/i_event_data.d.ts +17 -0
  20. package/dist/i_event_data.js +3 -0
  21. package/dist/i_event_data.js.map +1 -0
  22. package/dist/index.d.ts +23 -0
  23. package/dist/index.js +40 -0
  24. package/dist/index.js.map +1 -0
  25. package/dist/instantiate_options.d.ts +80 -0
  26. package/dist/instantiate_options.js +3 -0
  27. package/dist/instantiate_options.js.map +1 -0
  28. package/dist/modelling_rule_type.d.ts +1 -0
  29. package/dist/modelling_rule_type.js +3 -0
  30. package/dist/modelling_rule_type.js.map +1 -0
  31. package/dist/namespace.d.ts +287 -0
  32. package/dist/namespace.js +3 -0
  33. package/dist/namespace.js.map +1 -0
  34. package/dist/session_context.d.ts +56 -0
  35. package/dist/session_context.js +12 -0
  36. package/dist/session_context.js.map +1 -0
  37. package/dist/ua_data_type.d.ts +34 -0
  38. package/dist/ua_data_type.js +3 -0
  39. package/dist/ua_data_type.js.map +1 -0
  40. package/dist/ua_dynamic_variable_array.d.ts +14 -0
  41. package/dist/ua_dynamic_variable_array.js +3 -0
  42. package/dist/ua_dynamic_variable_array.js.map +1 -0
  43. package/dist/ua_event_type.d.ts +3 -0
  44. package/dist/ua_event_type.js +3 -0
  45. package/dist/ua_event_type.js.map +1 -0
  46. package/dist/ua_method.d.ts +41 -0
  47. package/dist/ua_method.js +5 -0
  48. package/dist/ua_method.js.map +1 -0
  49. package/dist/ua_object.d.ts +131 -0
  50. package/dist/ua_object.js +3 -0
  51. package/dist/ua_object.js.map +1 -0
  52. package/dist/ua_object_type.d.ts +29 -0
  53. package/dist/ua_object_type.js +3 -0
  54. package/dist/ua_object_type.js.map +1 -0
  55. package/dist/ua_property.d.ts +16 -0
  56. package/dist/ua_property.js +3 -0
  57. package/dist/ua_property.js.map +1 -0
  58. package/dist/ua_reference.d.ts +12 -0
  59. package/dist/ua_reference.js +3 -0
  60. package/dist/ua_reference.js.map +1 -0
  61. package/dist/ua_reference_type.d.ts +20 -0
  62. package/dist/ua_reference_type.js +4 -0
  63. package/dist/ua_reference_type.js.map +1 -0
  64. package/dist/ua_variable.d.ts +290 -0
  65. package/dist/ua_variable.js +3 -0
  66. package/dist/ua_variable.js.map +1 -0
  67. package/dist/ua_variable_t.d.ts +15 -0
  68. package/dist/ua_variable_t.js +3 -0
  69. package/dist/ua_variable_t.js.map +1 -0
  70. package/dist/ua_variable_type.d.ts +55 -0
  71. package/dist/ua_variable_type.js +4 -0
  72. package/dist/ua_variable_type.js.map +1 -0
  73. package/dist/ua_view.d.ts +7 -0
  74. package/dist/ua_view.js +3 -0
  75. package/dist/ua_view.js.map +1 -0
  76. package/package.json +19 -15
@@ -0,0 +1,131 @@
1
+ /// <reference types="node" />
2
+ import { NodeId } from "node-opcua-nodeid";
3
+ import { DataType, Variant, VariantArrayType } from "node-opcua-variant";
4
+ import { Byte, DateTime, Int16, Int32, SByte, StatusCode, UAString, UInt16, UInt32 } from "node-opcua-basic-types";
5
+ import { LocalizedTextLike, NodeClass, QualifiedNameOptions } from "node-opcua-data-model";
6
+ import { ExtensionObject } from "node-opcua-extension-object";
7
+ import { CloneOptions, CloneFilter, CloneExtraInfo } from "./clone_options";
8
+ import { BaseNode, IPropertyAndComponentHolder } from "./base_node";
9
+ import { UAObjectType } from "./ua_object_type";
10
+ import { IEventData } from "./i_event_data";
11
+ import { UAEventType } from "./ua_event_type";
12
+ import { UAMethod } from "./ua_method";
13
+ import { EventNotifierFlags } from "./event_notifier_flags";
14
+ export type EventTypeLike = string | NodeId | UAEventType;
15
+ export interface PseudoVariantNull {
16
+ dataType: "Null" | DataType.Null;
17
+ }
18
+ export interface PseudoVariantString {
19
+ dataType: "String" | DataType.String;
20
+ value: UAString;
21
+ }
22
+ export interface PseudoVariantStringPredefined<S extends string> {
23
+ dataType: "String" | DataType.String;
24
+ value: S;
25
+ }
26
+ export interface PseudoVariantBoolean {
27
+ dataType: "Boolean" | DataType.Boolean;
28
+ value: boolean;
29
+ }
30
+ export interface PseudoVariantDouble {
31
+ dataType: "Double" | DataType.Double;
32
+ value: number;
33
+ }
34
+ export interface PseudoVariantFloat {
35
+ dataType: "Float" | DataType.Float;
36
+ value: number;
37
+ }
38
+ export interface PseudoVariantNodeId {
39
+ dataType: "NodeId" | DataType.NodeId;
40
+ value: NodeId;
41
+ }
42
+ export interface PseudoVariantUInt32 {
43
+ dataType: "UInt32" | DataType.UInt32;
44
+ value: UInt32;
45
+ }
46
+ export interface PseudoVariantUInt16 {
47
+ dataType: "UInt16" | DataType.UInt16;
48
+ value: UInt16;
49
+ }
50
+ export interface PseudoVariantByte {
51
+ dataType: "UInt8" | DataType.Byte;
52
+ value: Byte;
53
+ }
54
+ export interface PseudoVariantInt32 {
55
+ dataType: "Int32" | DataType.UInt32;
56
+ value: Int32;
57
+ }
58
+ export interface PseudoVariantInt16 {
59
+ dataType: "Int16" | DataType.UInt16;
60
+ value: Int16;
61
+ }
62
+ export interface PseudoVariantSByte {
63
+ dataType: "SByte" | DataType.SByte;
64
+ value: SByte;
65
+ }
66
+ export interface PseudoVariantDateTime {
67
+ dataType: "DateTime" | DataType.DateTime;
68
+ value: DateTime;
69
+ }
70
+ export interface PseudoVariantLocalizedText {
71
+ dataType: "LocalizedText" | DataType.LocalizedText;
72
+ value: LocalizedTextLike;
73
+ }
74
+ export interface PseudoVariantDuration {
75
+ dataType: "Duration";
76
+ value: number;
77
+ }
78
+ export interface PseudoVariantStatusCode {
79
+ dataType: "StatusCode" | DataType.StatusCode;
80
+ value: StatusCode;
81
+ }
82
+ export interface PseudoVariantByteString {
83
+ dataType: "ByteString" | DataType.ByteString;
84
+ value: Buffer | null;
85
+ }
86
+ export interface PseudoVariantExtensionObject {
87
+ dataType: "ExtensionObject" | DataType.ExtensionObject;
88
+ value: ExtensionObject;
89
+ }
90
+ export interface PseudoVariantExtensionObjectArray {
91
+ dataType: "ExtensionObject" | DataType.ExtensionObject;
92
+ arrayType: VariantArrayType.Array;
93
+ value: ExtensionObject[];
94
+ }
95
+ export interface PseudoVariantVariantArray {
96
+ dataType: "Variant" | DataType.Variant;
97
+ arrayType: VariantArrayType.Array;
98
+ value: Variant[];
99
+ }
100
+ export interface PseudoVariantVariant {
101
+ dataType: "Variant" | DataType.Variant;
102
+ value: Variant;
103
+ }
104
+ export type PseudoVariantNumber = PseudoVariantUInt32 | PseudoVariantUInt16 | PseudoVariantByte | PseudoVariantInt32 | PseudoVariantInt16 | PseudoVariantSByte | PseudoVariantDouble | PseudoVariantFloat;
105
+ export type PseudoVariant = PseudoVariantNull | PseudoVariantString | PseudoVariantBoolean | PseudoVariantByteString | PseudoVariantNodeId | PseudoVariantDateTime | PseudoVariantByteString | PseudoVariantDuration | PseudoVariantLocalizedText | PseudoVariantStatusCode | PseudoVariantNumber | PseudoVariantExtensionObject | PseudoVariantExtensionObjectArray | PseudoVariantVariant | PseudoVariantVariantArray;
106
+ export interface RaiseEventData {
107
+ $eventDataSource?: UAEventType;
108
+ sourceNode?: PseudoVariantNodeId | Variant;
109
+ [key: string]: PseudoVariant | Variant | UAEventType | undefined;
110
+ }
111
+ export interface EventRaiser {
112
+ raiseEvent(eventType: EventTypeLike, eventData: RaiseEventData): void;
113
+ }
114
+ export interface UAObject extends BaseNode, EventRaiser, IPropertyAndComponentHolder {
115
+ readonly nodeClass: NodeClass.Object;
116
+ get parent(): BaseNode | null;
117
+ get typeDefinitionObj(): UAObjectType;
118
+ get typeDefinition(): NodeId;
119
+ readonly eventNotifier: EventNotifierFlags;
120
+ readonly hasMethods: boolean;
121
+ getFolderElementByName(browseName: QualifiedNameOptions): BaseNode | null;
122
+ getFolderElementByName(browseName: string, namespaceIndex?: number): BaseNode | null;
123
+ getMethodById(nodeId: NodeId): UAMethod | null;
124
+ getMethodByName(methodName: QualifiedNameOptions): UAMethod | null;
125
+ getMethodByName(methodName: string, namespaceIndex?: number): UAMethod | null;
126
+ getMethods(): UAMethod[];
127
+ raiseEvent(eventType: EventTypeLike | BaseNode, eventData: RaiseEventData): void;
128
+ on(eventName: "event", eventHandler: (eventData: IEventData) => void): this;
129
+ setEventNotifier(eventNotifierFlags: EventNotifierFlags): void;
130
+ clone(options: CloneOptions, optionalFilter?: CloneFilter, extraInfo?: CloneExtraInfo): UAObject;
131
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_object.js","sourceRoot":"","sources":["../source/ua_object.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import { QualifiedNameLike, QualifiedNameOptions } from "node-opcua-data-model";
2
+ import { NodeClass } from "node-opcua-types";
3
+ import { NodeId, NodeIdLike } from "node-opcua-nodeid";
4
+ import { Byte } from "node-opcua-basic-types";
5
+ import { InstantiateOptions } from "./instantiate_options";
6
+ import { BaseNode, IPropertyAndComponentHolder } from "./base_node";
7
+ import { UAObject } from "./ua_object";
8
+ import { UAMethod } from "./ua_method";
9
+ export interface InstantiateObjectOptions extends InstantiateOptions {
10
+ conditionSource?: NodeId | BaseNode | null;
11
+ eventNotifier?: Byte;
12
+ encodingOf?: NodeId | BaseNode;
13
+ }
14
+ export declare interface UAObjectType extends BaseNode, IPropertyAndComponentHolder {
15
+ readonly nodeClass: NodeClass.ObjectType;
16
+ readonly subtypeOf: NodeId | null;
17
+ readonly subtypeOfObj: UAObjectType | null;
18
+ readonly isAbstract: boolean;
19
+ readonly hasMethods: boolean;
20
+ isSubtypeOf(referenceType: NodeIdLike | UAObjectType): boolean;
21
+ /** @deprecated - use isSubtypeOf instead */
22
+ isSupertypeOf(referenceType: NodeIdLike | UAObjectType): boolean;
23
+ instantiate(options: InstantiateObjectOptions): UAObject;
24
+ getMethodById(nodeId: NodeId): UAMethod | null;
25
+ getMethodByName(methodName: QualifiedNameOptions): UAMethod | null;
26
+ getMethodByName(methodName: string, namespaceIndex?: number): UAMethod | null;
27
+ getMethodByName(methodName: QualifiedNameLike, namespaceIndex?: number): UAMethod | null;
28
+ getMethods(): UAMethod[];
29
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_object_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_object_type.js","sourceRoot":"","sources":["../source/ua_object_type.ts"],"names":[],"mappings":""}
@@ -0,0 +1,16 @@
1
+ import { DataType } from "node-opcua-variant";
2
+ import { UAVariableT } from "./ua_variable_t";
3
+ /**
4
+ * | | |
5
+ * |----------------|--------------------------------------------------|
6
+ * |namespace |http://opcfoundation.org/UA/ |
7
+ * |nodeClass |VariableType |
8
+ * |typedDefinition |PropertyType ns=0;i=68 |
9
+ * |dataType |Null |
10
+ * |dataType Name |undefined ns=0;i=0 |
11
+ * |isAbstract |false |
12
+ */
13
+ export interface UAProperty_Base<T, DT extends DataType> {
14
+ }
15
+ export interface UAProperty<T, DT extends DataType> extends UAVariableT<T, /*m*/ DT>, UAProperty_Base<T, DT> {
16
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_property.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_property.js","sourceRoot":"","sources":["../source/ua_property.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { NodeId } from "node-opcua-nodeid";
2
+ import { IAddressSpace } from "./address_space";
3
+ import { BaseNode } from "./base_node";
4
+ export interface UAReference {
5
+ readonly nodeId: NodeId;
6
+ readonly referenceType: NodeId;
7
+ readonly isForward: boolean;
8
+ readonly node?: BaseNode;
9
+ toString(options?: {
10
+ addressSpace?: IAddressSpace;
11
+ }): string;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_reference.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_reference.js","sourceRoot":"","sources":["../source/ua_reference.ts"],"names":[],"mappings":""}
@@ -0,0 +1,20 @@
1
+ import { LocalizedText, NodeClass } from "node-opcua-data-model";
2
+ import { NodeId, NodeIdLike } from "node-opcua-nodeid";
3
+ import { BaseNode } from "./base_node";
4
+ import { UAReference } from "./ua_reference";
5
+ export declare class UAReferenceType extends BaseNode {
6
+ readonly nodeClass: NodeClass.ReferenceType;
7
+ readonly subtypeOfObj: UAReferenceType | null;
8
+ readonly subtypeOf: NodeId | null;
9
+ readonly isAbstract: boolean;
10
+ readonly inverseName: LocalizedText;
11
+ isSubtypeOf(baseType: UAReferenceType | NodeIdLike): boolean;
12
+ /** @deprecated - use isSubtypeOf instead */
13
+ isSupertypeOf(baseType: UAReferenceType | NodeIdLike): boolean;
14
+ getAllSubtypes(): UAReferenceType[];
15
+ /**
16
+ *
17
+ * @param reference
18
+ */
19
+ checkHasSubtype(referenceType: NodeId | UAReference): boolean;
20
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_node_1 = require("./base_node");
4
+ //# sourceMappingURL=ua_reference_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_reference_type.js","sourceRoot":"","sources":["../source/ua_reference_type.ts"],"names":[],"mappings":";;AAEA,2CAAuC"}
@@ -0,0 +1,290 @@
1
+ import { AttributeIds, CallbackT, DataType, PreciseClock, StatusCode, StatusCodeCallback, UInt32 } from "node-opcua-basic-types";
2
+ import { NodeClass, QualifiedNameLike } from "node-opcua-data-model";
3
+ import { NodeId } from "node-opcua-nodeid";
4
+ import { DataValue } from "node-opcua-data-value";
5
+ import { ExtensionObject } from "node-opcua-extension-object";
6
+ import { NumericRange } from "node-opcua-numeric-range";
7
+ import { WriteValueOptions, HistoryReadDetails, HistoryReadResult, ReadRawModifiedDetails, ReadEventDetails, ReadProcessedDetails, ReadAtTimeDetails } from "node-opcua-types";
8
+ import { VariantLike } from "node-opcua-variant";
9
+ import { CloneOptions, CloneFilter, CloneExtraInfo } from "./clone_options";
10
+ import { BaseNode, IPropertyAndComponentHolder } from "./base_node";
11
+ import { ISessionContext, ContinuationData } from "./session_context";
12
+ import { UADataType } from "./ua_data_type";
13
+ import { UAVariableType } from "./ua_variable_type";
14
+ import { BindVariableOptions } from "./bind_variable";
15
+ export interface IVariableHistorian {
16
+ /**
17
+ * push a new value into the history for this variable
18
+ * the method should take a very small amount of time and not
19
+ * directly write to the underlying database
20
+ * @param newDataValue
21
+ */
22
+ push(newDataValue: DataValue): Promise<void>;
23
+ /**
24
+ * Extract a series of dataValue from the History database for this value
25
+ * @param historyReadRawModifiedDetails
26
+ * @param maxNumberToExtract
27
+ * @param isReversed
28
+ * @param reverseDataValue
29
+ * @param callback
30
+ */
31
+ extractDataValues(historyReadRawModifiedDetails: ReadRawModifiedDetails, maxNumberToExtract: number, isReversed: boolean, reverseDataValue: boolean, callback: (err: Error | null, dataValue?: DataValue[]) => void): void;
32
+ }
33
+ export interface IVariableHistorianOptions {
34
+ maxOnlineValues?: number;
35
+ historian?: IVariableHistorian;
36
+ }
37
+ export type IHistoricalDataNodeOptions = IVariableHistorianOptions | {
38
+ historian: IVariableHistorian;
39
+ };
40
+ export interface VariableAttributes {
41
+ dataType: NodeId;
42
+ valueRank: number;
43
+ minimumSamplingInterval: number;
44
+ }
45
+ export interface EnumValue2 {
46
+ name: string;
47
+ value: number;
48
+ }
49
+ export interface BindExtensionObjectOptions {
50
+ createMissingProp?: boolean;
51
+ force?: boolean;
52
+ }
53
+ export interface UAVariable extends BaseNode, VariableAttributes, IPropertyAndComponentHolder {
54
+ readonly nodeClass: NodeClass.Variable;
55
+ readonly parent: BaseNode | null;
56
+ readonly dataTypeObj: UADataType;
57
+ semantic_version: number;
58
+ $extensionObject?: any;
59
+ get typeDefinitionObj(): UAVariableType;
60
+ get typeDefinition(): NodeId;
61
+ dataType: NodeId;
62
+ /**
63
+ * returns the basic type of the variable that correspond to the dataType,
64
+ * that will be used in the dataValue.value.dataType property.
65
+ */
66
+ getBasicDataType(): DataType;
67
+ /**
68
+ * The **AccessLevel Attribute** is used to indicate how the Value of a Variable can be accessed
69
+ * (read/write) and if it contains current and/or historic data.
70
+ *
71
+ * The AccessLevel does not take any user access rights into account, i.e. although the Variable is
72
+ * writable this may be restricted to a certain user / user group.
73
+ *
74
+ * The {{link:AccessLevelType}}
75
+ */
76
+ accessLevel: number;
77
+ /**
78
+ * The UserAccessLevel Attribute is used to indicate how the Value of a Variable can be accessed
79
+ * (read/write) and if it contains current or historic data taking user access rights into account.
80
+ *
81
+ * The AccessLevelType is defined in 8.57.
82
+ */
83
+ userAccessLevel?: number;
84
+ /**
85
+ * This Attribute indicates whether the Value Attribute of the Variable is an array and how many dimensions
86
+ * the array has.
87
+ * It may have the following values:
88
+ *
89
+ * * n > 1 : the Value is an array with the specified number of dimensions.
90
+ * * OneDimension (1): The value is an array with one dimension.
91
+ * * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
92
+ * * Scalar (-1): The value is not an array.
93
+ * * Any (-2): The value can be a scalar or an array with any number of dimensions.
94
+ * * ScalarOrOneDimension (-3): The value can be a scalar or a one dimensional array.
95
+ *
96
+ * NOTE:
97
+ * * All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.
98
+ */
99
+ valueRank: number;
100
+ /**
101
+ * The MinimumSamplingInterval Attribute indicates how 'current' the Value of the Variable will
102
+ * be kept.
103
+ *
104
+ * It specifies (in milliseconds) how fast the Server can reasonably sample the value
105
+ * for changes (see Part 4 for a detailed description of sampling interval).
106
+ *
107
+ * A MinimumSamplingInterval of 0 indicates that the Server is to monitor the item continuously.
108
+ *
109
+ * A MinimumSamplingInterval of -1 means indeterminate.
110
+ */
111
+ minimumSamplingInterval: number;
112
+ /**
113
+ * This Attribute specifies the length of each dimension for an array value.
114
+ *
115
+ * - The Attribute is intended to describe the capability of the Variable, not the current size.
116
+ * - The number of elements shall be equal to the value of the `valueRank` Attribute.
117
+ * - Shall be null if `valueRank` <=0.
118
+ * - A value of 0 for an individual dimension indicates that the dimension has a variable length.
119
+ *
120
+ * **example**
121
+ *
122
+ *
123
+ * For example, if a Variable is defined by the following javascript array with 346 Int32 elements:
124
+ *
125
+ * `const myArray = new Array(346).fill(0);`
126
+ *
127
+ * then:
128
+ * * `DataType` would point to an `Int32`
129
+ * * the Variable's `valueRank` has the value 1 and,
130
+ * * the `arrayDimensions` is an array with one entry having the value 346.
131
+ *
132
+ * ```javascript
133
+ * {
134
+ * dataType: "Int32",
135
+ * valueRank: 1,
136
+ * arrayDimensions: [346]
137
+ * }
138
+ * ```
139
+ *
140
+ *
141
+ * **Note**: the maximum length of an array transferred on the wire is 2147483647 (max Int32)
142
+ * and a multidimensional array is encoded as a one dimensional array.
143
+ *
144
+ */
145
+ arrayDimensions: UInt32[] | null;
146
+ /**
147
+ * The `historizing` attribute indicates whether the server is actively collecting data for the
148
+ * history of the variable.
149
+ *
150
+ * This differs from the `accessLevel` Attribute which identifies if the variable has any historical data.
151
+ *
152
+ * A value of **true** indicates that the server is actively collecting data.
153
+ *
154
+ * A value of **false** indicates the server is not actively collecting data.
155
+ *
156
+ * Default value is **false**.
157
+ */
158
+ historizing: boolean;
159
+ /**
160
+ * returns true if the `accessLevel` flag allows the variable to be readable in the specified context.
161
+ * @param context
162
+ */
163
+ isReadable(context: ISessionContext): boolean;
164
+ /**
165
+ * returns true if the `userAccessLevel` flag allows the variable to be readable in the specified context.
166
+ * @param context
167
+ */
168
+ isUserReadable(context: ISessionContext): boolean;
169
+ /**
170
+ * returns true if the `accessLevel` flag allows the variable to be writeable in the specified context.
171
+ * @param context
172
+ */
173
+ isWritable(context: ISessionContext): boolean;
174
+ /**
175
+ * returns true if the `userAccessLevel` flag allows the variable to be writeable in the specified context.
176
+ * @param context
177
+ */
178
+ isUserWritable(context: ISessionContext): boolean;
179
+ /***
180
+ * from OPC.UA.Spec 1.02 part 4
181
+ * 5.10.2.4 StatusCodes
182
+ * Table 51 defines values for the operation level statusCode contained in the DataValue structure of
183
+ * each values element. Common StatusCodes are defined in Table 166.
184
+ *
185
+ * **Read Operation Level Result Codes**
186
+ *
187
+ * |Symbolic Id | Description|
188
+ * |----------------------------|----------------------------------------|
189
+ * |BadNodeIdInvalid | The syntax of the node id is not valid.|
190
+ * |BadNodeIdUnknown | The node id refers to a node that does not exist in the server address space.|
191
+ * |BadAttributeIdInvalid | BadAttributeIdInvalid The attribute is not supported for the specified node.|
192
+ * |BadIndexRangeInvalid | The syntax of the index range parameter is invalid.|
193
+ * |BadIndexRangeNoData | No data exists within the range of indexes specified.|
194
+ * |BadDataEncodingInvalid | The data encoding is invalid. This result is used if no dataEncoding can be applied because an Attribute other than Value was requested or the DataType of the Value Attribute is not a subtype of the Structure DataType. |
195
+ * |BadDataEncodingUnsupported | The server does not support the requested data encoding for the node. This result is used if a dataEncoding can be applied but the passed data encoding is not known to the Server.|
196
+ * |BadNotReadable | The access level does not allow reading or subscribing to the Node.|
197
+ * |BadUserAccessDenied | User does not have permission to perform the requested operation. (table 165)|
198
+ * | BadSecurityModeInsufficient | The operation is not permitted over the current secure channel. |
199
+ * | BadInsufficientPrivileges | The user does not have enough privileges to perform the requested operation.
200
+ */
201
+ readValue(context?: ISessionContext | null, indexRange?: NumericRange, dataEncoding?: QualifiedNameLike | null): DataValue;
202
+ readValueAsync(context: ISessionContext | null): Promise<DataValue>;
203
+ readValueAsync(context: ISessionContext | null, callback: CallbackT<DataValue>): void;
204
+ isEnumeration(): boolean;
205
+ isExtensionObject(): boolean;
206
+ /**
207
+ *
208
+ */
209
+ readEnumValue(): EnumValue2;
210
+ /**
211
+ *
212
+ * @precondition UAVariable must have a dataType deriving from "Enumeration"
213
+ */
214
+ writeEnumValue(value: string | number): void;
215
+ readAttribute(context: ISessionContext | null, attributeId: AttributeIds, indexRange?: NumericRange, dataEncoding?: QualifiedNameLike | null): DataValue;
216
+ setValueFromSource(value: VariantLike, statusCode?: StatusCode, sourceTimestamp?: Date): void;
217
+ writeValue(context: ISessionContext, dataValue: DataValue, indexRange: string | NumericRange | null, callback: StatusCodeCallback): void;
218
+ writeValue(context: ISessionContext, dataValue: DataValue, callback: StatusCodeCallback): void;
219
+ writeValue(context: ISessionContext, dataValue: DataValue, indexRange?: string | NumericRange | null): Promise<StatusCode>;
220
+ asyncRefresh(oldestDate: Date, callback: CallbackT<DataValue>): void;
221
+ asyncRefresh(oldestDate: Date): Promise<DataValue>;
222
+ /**
223
+ * write a variable attribute (callback version)
224
+ * @param context
225
+ * @param writeValue
226
+ * @param callback
227
+ *
228
+ * **example**
229
+ *
230
+ * ```javascript
231
+ * const writeValue = {
232
+ * attributeId: AttributeIds.Value,
233
+ * dataValue: new DataValue({
234
+ * statusCode: StatusCodes.Good,
235
+ * sourceTimestamp: new Date(),
236
+ * value: new Variant({ dataType: DataType.Double, value: 3.14 })
237
+ * }),
238
+ * nodeId
239
+ * };
240
+ * myVariable.writeAttribute(context,writeValue,(err, statusCode) => {
241
+ * if (err) { console.log("Write has failed"); return; }
242
+ * console.log("write statusCode = ",statusCode.toString());
243
+ * });
244
+ * ```
245
+ *
246
+ */
247
+ writeAttribute(context: ISessionContext | null, writeValue: WriteValueOptions, callback: StatusCodeCallback): void;
248
+ /**
249
+ * write a variable attribute (async/await version)
250
+ * @param context
251
+ * @param writeValue
252
+ *
253
+ *
254
+ * **example**
255
+ *
256
+ * ```javascript
257
+ * try {
258
+ * const writeValue = {
259
+ * attributeId: AttributeIds.Value,
260
+ * dataValue: new DataValue({
261
+ * statusCode: StatusCodes.Good,
262
+ * sourceTimestamp: new Date(),
263
+ * value: new Variant({ dataType: DataType.Double, value: 3.14 })
264
+ * }),
265
+ * nodeId
266
+ * };
267
+ * const statusCode = await myVariable.writeAttribute(context,writeValue);
268
+ * } catch(err) {
269
+ * console.log("Write has failed");
270
+ * return;
271
+ * }
272
+ * console.log("write statusCode = ", statusCode.toString());
273
+ * ```
274
+ *
275
+ */
276
+ writeAttribute(context: ISessionContext | null, writeValue: WriteValueOptions): Promise<StatusCode>;
277
+ touchValue(updateNow?: PreciseClock): void;
278
+ bindVariable(options?: BindVariableOptions, overwrite?: boolean): void;
279
+ bindExtensionObject(optionalExtensionObject?: ExtensionObject | ExtensionObject[], options?: BindExtensionObjectOptions): ExtensionObject | ExtensionObject[] | null;
280
+ bindExtensionObjectScalar(optionalExtensionObject?: ExtensionObject, options?: BindExtensionObjectOptions): ExtensionObject | null;
281
+ bindExtensionObjectArray(optionalExtensionObjectArray?: ExtensionObject[], options?: BindExtensionObjectOptions): ExtensionObject[] | null;
282
+ installExtensionObjectVariables(): void;
283
+ historyRead(context: ISessionContext, historyReadDetails: HistoryReadDetails | ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationData: ContinuationData): Promise<HistoryReadResult>;
284
+ historyRead(context: ISessionContext, historyReadDetails: HistoryReadDetails | ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationData: ContinuationData, callback: CallbackT<HistoryReadResult>): void;
285
+ clone(options: CloneOptions, optionalFilter?: CloneFilter, extraInfo?: CloneExtraInfo): UAVariable;
286
+ on(eventName: "semantic_changed", eventHandler: () => void): this;
287
+ on(eventName: "value_changed", eventHandler: (dataValue: DataValue) => void): this;
288
+ once(eventName: "semantic_changed", eventHandler: () => void): this;
289
+ once(eventName: "value_changed", eventHandler: (dataValue: DataValue) => void): this;
290
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_variable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_variable.js","sourceRoot":"","sources":["../source/ua_variable.ts"],"names":[],"mappings":""}
@@ -0,0 +1,15 @@
1
+ import { QualifiedNameLike } from "node-opcua-data-model";
2
+ import { DataValueT } from "node-opcua-data-value";
3
+ import { NumericRange } from "node-opcua-numeric-range";
4
+ import { CallbackT, StatusCode, StatusCodeCallback } from "node-opcua-status-code";
5
+ import { DataType } from "node-opcua-variant";
6
+ import { ISessionContext } from "./session_context";
7
+ import { UAVariable } from "./ua_variable";
8
+ export interface UAVariableT<T, DT extends DataType> extends UAVariable {
9
+ readValue(context?: ISessionContext | null, indexRange?: NumericRange, dataEncoding?: QualifiedNameLike | null): DataValueT<T, DT>;
10
+ readValueAsync(context: ISessionContext | null): Promise<DataValueT<T, DT>>;
11
+ readValueAsync(context: ISessionContext | null, callback: CallbackT<DataValueT<T, DT>>): void;
12
+ writeValue(context: ISessionContext, dataValue: DataValueT<T, DT>, indexRange: NumericRange | null, callback: StatusCodeCallback): void;
13
+ writeValue(context: ISessionContext, dataValue: DataValueT<T, DT>, callback: StatusCodeCallback): void;
14
+ writeValue(context: ISessionContext, dataValue: DataValueT<T, DT>, indexRange?: NumericRange | null): Promise<StatusCode>;
15
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_variable_t.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_variable_t.js","sourceRoot":"","sources":["../source/ua_variable_t.ts"],"names":[],"mappings":""}
@@ -0,0 +1,55 @@
1
+ import { NodeClass } from "node-opcua-data-model";
2
+ import { NodeId, NodeIdLike } from "node-opcua-nodeid";
3
+ import { UInt32 } from "node-opcua-basic-types";
4
+ import { DataType } from "node-opcua-variant";
5
+ import { ExtensionObject } from "node-opcua-extension-object";
6
+ import { BaseNode } from "./base_node";
7
+ import { InstantiateOptions } from "./instantiate_options";
8
+ import { UAObject } from "./ua_object";
9
+ import { UAObjectType } from "./ua_object_type";
10
+ import { UAVariable, VariableAttributes } from "./ua_variable";
11
+ import { UAVariableT } from "./ua_variable_t";
12
+ import { BindVariableOptions } from "./bind_variable";
13
+ import { UAMethod } from "./ua_method";
14
+ export interface InstantiateVariableOptions extends InstantiateOptions {
15
+ arrayDimensions?: number[] | null;
16
+ dataType?: string | NodeIdLike;
17
+ extensionObject?: ExtensionObject | ExtensionObject[];
18
+ nodeId?: NodeIdLike;
19
+ minimumSamplingInterval?: number;
20
+ propertyOf?: NodeIdLike | UAObject | UAObjectType | UAVariable | UAVariableType | UAMethod;
21
+ value?: BindVariableOptions;
22
+ /**
23
+ * This attribute indicates whether the Value attribute of the Variableis an array and how many dimensions the array has.
24
+ * It may have the following values:
25
+ * * n > 1: the Value is an array with the specified number of dimensions.
26
+ * * OneDimension (1): The value is an array with one dimension.
27
+ * * OneOrMoreDimensions (0): The value is an array with one or more dimensions.
28
+ * * Scalar (−1): The value is not an array.
29
+ * * Any (−2): The value can be a scalar or an array with any number of dimensions.
30
+ * * ScalarOrOneDimension (−3): The value can be a scalar or a one dimensional array.
31
+ * * All DataTypes are considered to be scalar, even if they have array-like semantics like ByteString and String.
32
+ *
33
+ *
34
+ * Note: the valueRank of the instantiated variable must be compatible with the valueRank of the VariableType.
35
+ */
36
+ valueRank?: number;
37
+ }
38
+ export declare class UAVariableType extends BaseNode implements VariableAttributes {
39
+ readonly nodeClass: NodeClass.VariableType;
40
+ readonly subtypeOfObj: UAVariableType | null;
41
+ readonly subtypeOf: NodeId | null;
42
+ dataType: NodeId;
43
+ valueRank: number;
44
+ minimumSamplingInterval: number;
45
+ arrayDimensions: UInt32[] | null;
46
+ historizing: boolean;
47
+ isAbstract: boolean;
48
+ isSubtypeOf(type: UAVariableType | NodeIdLike): boolean;
49
+ /** @deprecated - use isSubtypeOf instead */
50
+ isSupertypeOf(type: UAVariableType | NodeIdLike): boolean;
51
+ instantiate(options: InstantiateVariableOptions): UAVariable;
52
+ }
53
+ export interface UAVariableTypeT<T, DT extends DataType> extends UAVariableType {
54
+ instantiate(options: InstantiateVariableOptions): UAVariableT<T, DT>;
55
+ }
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const base_node_1 = require("./base_node");
4
+ //# sourceMappingURL=ua_variable_type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ua_variable_type.js","sourceRoot":"","sources":["../source/ua_variable_type.ts"],"names":[],"mappings":";;AAMA,2CAAuC"}
@@ -0,0 +1,7 @@
1
+ import { NodeClass } from "node-opcua-data-model";
2
+ import { BaseNode } from "./base_node";
3
+ import { EventNotifierFlags } from "./event_notifier_flags";
4
+ export interface UAView extends BaseNode {
5
+ readonly nodeClass: NodeClass.View;
6
+ readonly eventNotifier: EventNotifierFlags;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=ua_view.js.map