node-opcua-address-space-base 2.170.1 → 2.172.0

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 (52) hide show
  1. package/dist/address_space.d.ts +20 -20
  2. package/dist/base_node.d.ts +61 -23
  3. package/dist/base_node.js +3 -0
  4. package/dist/base_node.js.map +1 -1
  5. package/dist/bind_variable.d.ts +8 -8
  6. package/dist/clone_helper.js +5 -2
  7. package/dist/clone_helper.js.map +1 -1
  8. package/dist/clone_options.d.ts +10 -10
  9. package/dist/clone_options.js +2 -2
  10. package/dist/clone_options.js.map +1 -1
  11. package/dist/continuation_point.d.ts +1 -1
  12. package/dist/index.d.ts +3 -3
  13. package/dist/index.js +3 -3
  14. package/dist/index.js.map +1 -1
  15. package/dist/instantiate_options.d.ts +5 -5
  16. package/dist/ua_data_type.d.ts +6 -6
  17. package/dist/ua_dynamic_variable_array.d.ts +6 -6
  18. package/dist/ua_event_type.d.ts +1 -1
  19. package/dist/ua_method.d.ts +16 -12
  20. package/dist/ua_object.d.ts +16 -18
  21. package/dist/ua_object_type.d.ts +9 -9
  22. package/dist/ua_property.d.ts +3 -3
  23. package/dist/ua_reference.d.ts +3 -3
  24. package/dist/ua_reference_type.d.ts +5 -5
  25. package/dist/ua_variable.d.ts +19 -19
  26. package/dist/ua_variable_t.d.ts +7 -7
  27. package/dist/ua_variable_type.d.ts +14 -14
  28. package/dist/ua_view.d.ts +3 -3
  29. package/package.json +15 -15
  30. package/source/address_space.ts +20 -20
  31. package/source/base_node.ts +128 -80
  32. package/source/bind_variable.ts +8 -9
  33. package/source/clone_helper.ts +14 -7
  34. package/source/clone_options.ts +13 -14
  35. package/source/continuation_point.ts +1 -2
  36. package/source/i_event_data.ts +0 -1
  37. package/source/index.ts +3 -3
  38. package/source/instantiate_options.ts +5 -6
  39. package/source/namespace.ts +1 -1
  40. package/source/ua_data_type.ts +6 -7
  41. package/source/ua_dynamic_variable_array.ts +6 -6
  42. package/source/ua_event_type.ts +1 -1
  43. package/source/ua_method.ts +33 -29
  44. package/source/ua_object.ts +22 -21
  45. package/source/ua_object_type.ts +9 -10
  46. package/source/ua_property.ts +5 -3
  47. package/source/ua_reference.ts +3 -3
  48. package/source/ua_reference_type.ts +14 -14
  49. package/source/ua_variable.ts +35 -30
  50. package/source/ua_variable_t.ts +7 -7
  51. package/source/ua_variable_type.ts +27 -28
  52. package/source/ua_view.ts +3 -3
@@ -1,17 +1,17 @@
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, NodeIdLike } 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";
1
+ import type { AttributeIds, CallbackT, DataType, PreciseClock, StatusCode, StatusCodeCallback, UInt32 } from "node-opcua-basic-types";
2
+ import type { NodeClass, QualifiedNameLike } from "node-opcua-data-model";
3
+ import type { DataValue } from "node-opcua-data-value";
4
+ import type { ExtensionObject } from "node-opcua-extension-object";
5
+ import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
6
+ import type { NumericRange } from "node-opcua-numeric-range";
7
+ import type { HistoryReadDetails, HistoryReadResult, ReadAtTimeDetails, ReadEventDetails, ReadProcessedDetails, ReadRawModifiedDetails, WriteValueOptions } from "node-opcua-types";
8
+ import type { VariantLike } from "node-opcua-variant";
9
+ import type { BaseNode, BaseNodeEvents, IPropertyAndComponentHolder, ListenerSignature } from "./base_node";
10
+ import type { BindVariableOptions } from "./bind_variable";
11
+ import type { CloneExtraInfo, CloneFilter, CloneOptions } from "./clone_options";
12
+ import type { ContinuationData, ISessionContext } from "./session_context";
13
+ import type { UADataType } from "./ua_data_type";
14
+ import type { UAVariableType } from "./ua_variable_type";
15
15
  export interface IVariableHistorian {
16
16
  /**
17
17
  * push a new value into the history for this variable
@@ -53,7 +53,11 @@ export interface BindExtensionObjectOptions {
53
53
  export interface IVariableDataTypeChange {
54
54
  changeDataType(newDataType: NodeIdLike, newValue?: VariantLike): void;
55
55
  }
56
- export interface UAVariable extends BaseNode, VariableAttributes, IVariableDataTypeChange, IPropertyAndComponentHolder {
56
+ export interface UAVariableEvents extends BaseNodeEvents {
57
+ value_changed: (newDataValue: DataValue, index_range?: NumericRange | null) => void;
58
+ semantic_changed: () => void;
59
+ }
60
+ export interface UAVariable<T extends UAVariableEvents & ListenerSignature<T> = UAVariableEvents> extends BaseNode<T>, VariableAttributes, IVariableDataTypeChange, IPropertyAndComponentHolder {
57
61
  readonly nodeClass: NodeClass.Variable;
58
62
  readonly parent: BaseNode | null;
59
63
  readonly dataTypeObj: UADataType;
@@ -287,8 +291,4 @@ export interface UAVariable extends BaseNode, VariableAttributes, IVariableDataT
287
291
  historyRead(context: ISessionContext, historyReadDetails: HistoryReadDetails | ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationData: ContinuationData): Promise<HistoryReadResult>;
288
292
  historyRead(context: ISessionContext, historyReadDetails: HistoryReadDetails | ReadRawModifiedDetails | ReadEventDetails | ReadProcessedDetails | ReadAtTimeDetails, indexRange: NumericRange | null, dataEncoding: QualifiedNameLike | null, continuationData: ContinuationData, callback: CallbackT<HistoryReadResult>): void;
289
293
  clone(options: CloneOptions, optionalFilter?: CloneFilter, extraInfo?: CloneExtraInfo): UAVariable;
290
- on(eventName: "semantic_changed", eventHandler: () => void): this;
291
- on(eventName: "value_changed", eventHandler: (dataValue: DataValue) => void): this;
292
- once(eventName: "semantic_changed", eventHandler: () => void): this;
293
- once(eventName: "value_changed", eventHandler: (dataValue: DataValue) => void): this;
294
294
  }
@@ -1,10 +1,10 @@
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";
1
+ import type { QualifiedNameLike } from "node-opcua-data-model";
2
+ import type { DataValueT } from "node-opcua-data-value";
3
+ import type { NumericRange } from "node-opcua-numeric-range";
4
+ import type { CallbackT, StatusCode, StatusCodeCallback } from "node-opcua-status-code";
5
+ import type { DataType } from "node-opcua-variant";
6
+ import type { ISessionContext } from "./session_context";
7
+ import type { UAVariable } from "./ua_variable";
8
8
  export interface UAVariableT<T, DT extends DataType> extends UAVariable {
9
9
  readValue(context?: ISessionContext | null, indexRange?: NumericRange, dataEncoding?: QualifiedNameLike | null): DataValueT<T, DT>;
10
10
  readValueAsync(context: ISessionContext | null): Promise<DataValueT<T, DT>>;
@@ -1,16 +1,16 @@
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";
1
+ import type { UInt32 } from "node-opcua-basic-types";
2
+ import type { NodeClass } from "node-opcua-data-model";
3
+ import type { ExtensionObject } from "node-opcua-extension-object";
4
+ import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
5
+ import type { DataType } from "node-opcua-variant";
6
+ import type { BaseNode } from "./base_node";
7
+ import type { BindVariableOptions } from "./bind_variable";
8
+ import type { InstantiateOptions } from "./instantiate_options";
9
+ import type { UAMethod } from "./ua_method";
10
+ import type { UAObject } from "./ua_object";
11
+ import type { UAObjectType } from "./ua_object_type";
12
+ import type { UAVariable, VariableAttributes } from "./ua_variable";
13
+ import type { UAVariableT } from "./ua_variable_t";
14
14
  export interface InstantiateVariableOptions extends InstantiateOptions {
15
15
  arrayDimensions?: number[] | null;
16
16
  dataType?: string | NodeIdLike;
@@ -35,7 +35,7 @@ export interface InstantiateVariableOptions extends InstantiateOptions {
35
35
  */
36
36
  valueRank?: number;
37
37
  }
38
- export declare class UAVariableType extends BaseNode implements VariableAttributes {
38
+ export interface UAVariableType extends BaseNode, VariableAttributes {
39
39
  readonly nodeClass: NodeClass.VariableType;
40
40
  readonly subtypeOfObj: UAVariableType | null;
41
41
  readonly subtypeOf: NodeId | null;
package/dist/ua_view.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { NodeClass } from "node-opcua-data-model";
2
- import { BaseNode } from "./base_node";
3
- import { EventNotifierFlags } from "./event_notifier_flags";
1
+ import type { NodeClass } from "node-opcua-data-model";
2
+ import type { BaseNode } from "./base_node";
3
+ import type { EventNotifierFlags } from "./event_notifier_flags";
4
4
  export interface UAView extends BaseNode {
5
5
  readonly nodeClass: NodeClass.View;
6
6
  readonly eventNotifier: EventNotifierFlags;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "node-opcua-address-space-base",
3
- "version": "2.170.1",
3
+ "version": "2.172.0",
4
4
  "description": "pure nodejs OPCUA SDK - module address-space-base",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -18,20 +18,20 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "node-opcua-assert": "2.164.0",
21
- "node-opcua-basic-types": "2.169.0",
21
+ "node-opcua-basic-types": "2.172.0",
22
22
  "node-opcua-constants": "2.157.0",
23
- "node-opcua-crypto": "5.3.5",
24
- "node-opcua-data-model": "2.170.0",
25
- "node-opcua-data-value": "2.170.0",
26
- "node-opcua-date-time": "2.169.0",
27
- "node-opcua-debug": "2.168.0",
28
- "node-opcua-extension-object": "2.169.0",
29
- "node-opcua-nodeid": "2.169.0",
30
- "node-opcua-numeric-range": "2.169.0",
31
- "node-opcua-schemas": "2.170.0",
32
- "node-opcua-status-code": "2.169.0",
33
- "node-opcua-types": "2.170.0",
34
- "node-opcua-variant": "2.170.0"
23
+ "node-opcua-crypto": "5.3.6",
24
+ "node-opcua-data-model": "2.172.0",
25
+ "node-opcua-data-value": "2.172.0",
26
+ "node-opcua-date-time": "2.172.0",
27
+ "node-opcua-debug": "2.172.0",
28
+ "node-opcua-extension-object": "2.172.0",
29
+ "node-opcua-nodeid": "2.172.0",
30
+ "node-opcua-numeric-range": "2.172.0",
31
+ "node-opcua-schemas": "2.172.0",
32
+ "node-opcua-status-code": "2.172.0",
33
+ "node-opcua-types": "2.172.0",
34
+ "node-opcua-variant": "2.172.0"
35
35
  },
36
36
  "author": "Etienne Rossignon",
37
37
  "license": "MIT",
@@ -48,7 +48,7 @@
48
48
  "internet of things"
49
49
  ],
50
50
  "homepage": "http://node-opcua.github.io/",
51
- "gitHead": "40629feaff284ba70596149e58b3cc2a7a0e8f68",
51
+ "gitHead": "dfe9993a93b5c3897825e898b5f07b25952c7f45",
52
52
  "files": [
53
53
  "dist",
54
54
  "source"
@@ -1,24 +1,24 @@
1
- import { ExtensionObject } from "node-opcua-extension-object";
2
- import { NodeId, NodeIdLike } from "node-opcua-nodeid";
3
- import { AnyConstructorFunc } from "node-opcua-schemas";
4
- import { StatusCode } from "node-opcua-status-code";
5
- import { BrowseDescription, BrowsePath, BrowsePathResult, BrowseResult } from "node-opcua-types";
6
- import { DataType, Variant, VariantByteString } from "node-opcua-variant";
1
+ import type { ExtensionObject } from "node-opcua-extension-object";
2
+ import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
3
+ import type { AnyConstructorFunc } from "node-opcua-schemas";
4
+ import type { StatusCode } from "node-opcua-status-code";
5
+ import type { BrowseDescription, BrowsePath, BrowsePathResult, BrowseResult } from "node-opcua-types";
6
+ import type { DataType, Variant, VariantByteString } from "node-opcua-variant";
7
7
  //
8
- import { AddReferenceOpts, BaseNode } from "./base_node";
9
- import { INamespace } from "./namespace";
10
- import { ISessionContext } from "./session_context";
11
- import { UADataType } from "./ua_data_type";
12
- import { IEventData } from "./i_event_data";
13
- import { UAMethod } from "./ua_method";
14
- import { UAObject } from "./ua_object";
15
- import { UAEventType } from "./ua_event_type";
16
- import { UAObjectType } from "./ua_object_type";
17
- import { UAReference } from "./ua_reference";
18
- import { UAReferenceType } from "./ua_reference_type";
19
- import { IHistoricalDataNodeOptions, UAVariable } from "./ua_variable";
20
- import { UAVariableType } from "./ua_variable_type";
21
- import { UAView } from "./ua_view";
8
+ import type { AddReferenceOpts, BaseNode } from "./base_node";
9
+ import type { IEventData } from "./i_event_data";
10
+ import type { INamespace } from "./namespace";
11
+ import type { ISessionContext } from "./session_context";
12
+ import type { UADataType } from "./ua_data_type";
13
+ import type { UAEventType } from "./ua_event_type";
14
+ import type { UAMethod } from "./ua_method";
15
+ import type { UAObject } from "./ua_object";
16
+ import type { UAObjectType } from "./ua_object_type";
17
+ import type { UAReference } from "./ua_reference";
18
+ import type { UAReferenceType } from "./ua_reference_type";
19
+ import type { IHistoricalDataNodeOptions, UAVariable } from "./ua_variable";
20
+ import type { UAVariableType } from "./ua_variable_type";
21
+ import type { UAView } from "./ua_view";
22
22
 
23
23
  export type ShutdownTask = ((this: IAddressSpace) => void) | ((this: IAddressSpace) => Promise<void>);
24
24
 
@@ -1,8 +1,7 @@
1
- import { EventEmitter } from "events";
2
-
3
- export type Duration = number;
4
-
5
- import {
1
+ import { EventEmitter } from "node:events";
2
+ import type { UAString, UInt32 } from "node-opcua-basic-types";
3
+ import type { ReferenceTypeIds } from "node-opcua-constants";
4
+ import type {
6
5
  AccessRestrictionsFlag,
7
6
  AttributeIds,
8
7
  BrowseDirection,
@@ -13,14 +12,11 @@ import {
13
12
  QualifiedNameLike,
14
13
  QualifiedNameOptions
15
14
  } from "node-opcua-data-model";
16
- import { DataType } from "node-opcua-variant";
17
- import { DataValue, DataValueOptions } from "node-opcua-data-value";
18
- import { NodeId, NodeIdLike } from "node-opcua-nodeid";
19
- import { NumericRange } from "node-opcua-numeric-range";
20
- import { StatusCode } from "node-opcua-status-code";
21
-
22
- import {
23
- BrowseDescription,
15
+ import type { DataValue } from "node-opcua-data-value";
16
+ import type { NodeId, NodeIdLike } from "node-opcua-nodeid";
17
+ import type { NumericRange } from "node-opcua-numeric-range";
18
+ import type { StatusCode } from "node-opcua-status-code";
19
+ import type {
24
20
  BrowseDescriptionOptions,
25
21
  ReferenceDescription,
26
22
  RelativePathElement,
@@ -28,20 +24,19 @@ import {
28
24
  RolePermissionTypeOptions,
29
25
  WriteValueOptions
30
26
  } from "node-opcua-types";
27
+ import type { DataType } from "node-opcua-variant";
28
+ import type { IAddressSpace } from "./address_space";
29
+ import type { IEventData } from "./i_event_data";
30
+ import type { ModellingRuleType } from "./modelling_rule_type";
31
+ import type { INamespace } from "./namespace";
32
+ import type { ISessionContext } from "./session_context";
33
+ import type { UAObject } from "./ua_object";
34
+ import type { UAProperty } from "./ua_property";
35
+ import type { UAReference } from "./ua_reference";
36
+ import type { UAReferenceType } from "./ua_reference_type";
37
+ import type { UAVariable } from "./ua_variable";
31
38
 
32
- import { UAString, UInt32 } from "node-opcua-basic-types";
33
- import { ReferenceTypeIds } from "node-opcua-constants";
34
-
35
- import { INamespace } from "./namespace";
36
- import { IAddressSpace } from "./address_space";
37
- import { ModellingRuleType } from "./modelling_rule_type";
38
- import { ISessionContext } from "./session_context";
39
- import { UAObject } from "./ua_object";
40
- import { UAReferenceType } from "./ua_reference_type";
41
- import { UAVariable } from "./ua_variable";
42
- import { UAVariableT } from "./ua_variable_t";
43
- import { UAReference } from "./ua_reference";
44
- import { UAProperty } from "./ua_property";
39
+ export type Duration = number;
45
40
 
46
41
  export declare interface AddReferenceOpts {
47
42
  referenceType: keyof ReferenceTypeIds | NodeIdLike | UAReferenceType;
@@ -85,45 +80,104 @@ export interface BrowseDescriptionOptions2 extends BrowseDescriptionOptions {
85
80
  resultMask: UInt32;
86
81
  }
87
82
 
88
- export declare class BaseNode extends EventEmitter {
89
- public get addressSpace(): IAddressSpace;
90
- public readonly browseName: QualifiedName;
91
- public get displayName(): LocalizedText[];
92
- public get description(): LocalizedText;
93
- public readonly nodeClass: NodeClass;
94
- public readonly nodeId: NodeId;
95
- public get modellingRule(): ModellingRuleType | undefined;
96
- public get parentNodeId(): NodeId | undefined;
97
- public get accessRestrictions(): AccessRestrictionsFlag | undefined;
98
- public get rolePermissions(): RolePermissionType[] | undefined;
83
+ export type AttributeEventName =
84
+ | "Value_changed"
85
+ | "DisplayName_changed"
86
+ | "Description_changed"
87
+ | "BrowseName_changed"
88
+ | "RolePermissions_changed"
89
+ | "AccessRestrictions_changed";
90
+
91
+ export interface BaseNodeEvents_ {
92
+ dispose: [];
93
+ event: [attribute: IEventData];
94
+ Value_changed: [attribute: DataValue];
95
+ DisplayName_changed: [attribute: DataValue];
96
+ Description_changed: [attribute: DataValue];
97
+ BrowseName_changed: [attribute: DataValue];
98
+ RolePermissions_changed: [attribute: DataValue];
99
+ AccessRestrictions_changed: [attribute: DataValue];
100
+ }
101
+
102
+ export interface BaseNodeEvents {
103
+ dispose: () => void;
104
+ event: (attribute: IEventData) => void;
105
+ Value_changed: (attribute: DataValue) => void;
106
+ DisplayName_changed: (attribute: DataValue) => void;
107
+ Description_changed: (attribute: DataValue) => void;
108
+ BrowseName_changed: (attribute: DataValue) => void;
109
+ RolePermissions_changed: (attribute: DataValue) => void;
110
+ AccessRestrictions_changed: (attribute: DataValue) => void;
111
+ }
112
+
113
+ // Self-referential constraint: every property of L must be a function.
114
+ // Lets us drop the broken `T[K] extends (...) => ...` conditionals while
115
+ // preserving exact callback signatures (named params, optional args) for IntelliSense.
116
+ export type ListenerSignature<L> = {
117
+ // biome-ignore lint/suspicious/noExplicitAny: any is required to bypass function-parameter contravariance; using unknown breaks T[K] assignability
118
+ [E in keyof L]: (...args: any[]) => any;
119
+ };
120
+
121
+ export interface ITypedEventEmitter<T extends ListenerSignature<T>> {
122
+ on<K extends keyof T>(event: K, listener: T[K]): this;
123
+ once<K extends keyof T>(event: K, listener: T[K]): this;
124
+ emit<K extends keyof T>(event: K, ...args: Parameters<T[K]>): boolean;
125
+ off<K extends keyof T>(event: K, listener: T[K]): this;
126
+
127
+ listenerCount<K extends keyof T>(event: K): number;
128
+
129
+ setMaxListeners(n: number): void;
130
+ removeAllListeners(): void;
131
+ removeListener<K extends keyof T>(event: K, listener: T[K]): void;
132
+ }
133
+
134
+ // Aliases Node's EventEmitter directly so listeners receive `this === <emitter>`, matching
135
+ // the standard EventEmitter contract. The previous composition-based implementation invoked
136
+ // listeners with `this` bound to a private inner emitter, breaking that contract.
137
+ export type TypedEventEmitter<T extends ListenerSignature<T>> = ITypedEventEmitter<T>;
138
+ export const TypedEventEmitter = EventEmitter as unknown as {
139
+ new <T extends ListenerSignature<T>>(): ITypedEventEmitter<T>;
140
+ };
141
+ export interface BaseNode<T extends BaseNodeEvents & ListenerSignature<T> = BaseNodeEvents> extends ITypedEventEmitter<T> {
142
+
143
+ readonly nodeClass: NodeClass;
144
+ get addressSpace(): IAddressSpace;
145
+ readonly browseName: QualifiedName;
146
+ get displayName(): LocalizedText[];
147
+ get description(): LocalizedText;
148
+ readonly nodeId: NodeId;
149
+ get modellingRule(): ModellingRuleType | undefined;
150
+ get parentNodeId(): NodeId | undefined;
151
+ get accessRestrictions(): AccessRestrictionsFlag | undefined;
152
+ get rolePermissions(): RolePermissionType[] | undefined;
99
153
 
100
154
  // access to parent namespace
101
- public get namespaceIndex(): number;
102
- public get namespaceUri(): string;
103
- public get namespace(): INamespace;
155
+ get namespaceIndex(): number;
156
+ get namespaceUri(): string;
157
+ get namespace(): INamespace;
104
158
 
105
- public isDisposed(): boolean;
159
+ isDisposed(): boolean;
106
160
 
107
- public onFirstBrowseAction?: (this: BaseNode) => Promise<void>;
161
+ onFirstBrowseAction?: (this: BaseNode) => Promise<void>;
108
162
 
109
163
  /**
110
164
  * return a complete name of this object by pre-pending
111
165
  * name of its parent(s) to its own name
112
166
  */
113
- public fullName(): string;
167
+ fullName(): string;
114
168
 
115
- public addReference(options: AddReferenceOpts): void;
169
+ addReference(options: AddReferenceOpts): void;
116
170
 
117
- public removeReference(referenceOpts: AddReferenceOpts): void;
171
+ removeReference(referenceOpts: AddReferenceOpts): void;
118
172
 
119
- public readAttribute(
173
+ readAttribute(
120
174
  context: ISessionContext | null,
121
175
  attributeId: AttributeIds,
122
176
  indexRange?: NumericRange,
123
177
  dataEncoding?: QualifiedNameLike | null
124
178
  ): DataValue;
125
179
 
126
- public writeAttribute(
180
+ writeAttribute(
127
181
  context: ISessionContext | null,
128
182
  writeValue: WriteValueOptions,
129
183
  callback: (err: Error | null, statusCode?: StatusCode) => void
@@ -133,26 +187,26 @@ export declare class BaseNode extends EventEmitter {
133
187
  * return a array with the event source of this object.
134
188
  * self = HasEventSource => nodes
135
189
  */
136
- public getEventSources(): BaseNode[];
190
+ getEventSources(): BaseNode[];
137
191
 
138
192
  /**
139
193
  * return a array of the objects for which this node is an EventSource
140
194
  * nodes = HasEventSource => self
141
195
  */
142
- public getEventSourceOfs(): BaseNode[];
196
+ getEventSourceOfs(): BaseNode[];
143
197
 
144
198
  /**
145
199
  *
146
200
  * @param locale the locale of the text to return (e.g. en-EN)
147
201
  */
148
- public getDisplayName(locale?: string): string;
202
+ getDisplayName(locale?: string): string;
149
203
 
150
204
  /**
151
205
  * private
152
206
  */
153
- public install_extra_properties(): void;
207
+ install_extra_properties(): void;
154
208
 
155
- public browseNodeByTargetName(relativePathElement: RelativePathElement, isLast: boolean): NodeId[];
209
+ browseNodeByTargetName(relativePathElement: RelativePathElement, isLast: boolean): NodeId[];
156
210
 
157
211
  /**
158
212
  * find all the references that are of type **`reference`** or a sub type of **`reference`**, in the
@@ -160,7 +214,7 @@ export declare class BaseNode extends EventEmitter {
160
214
  *
161
215
  * * BrowseDirection.Forward direction is implied if browseDirection flags is omitted.
162
216
  */
163
- public findReferencesEx(referenceType: string | NodeId | UAReferenceType, browseDirection?: BrowseDirection): UAReference[];
217
+ findReferencesEx(referenceType: string | NodeId | UAReferenceType, browseDirection?: BrowseDirection): UAReference[];
164
218
 
165
219
  /**
166
220
  * find all the references that are strictly of type **`reference`**.
@@ -168,7 +222,7 @@ export declare class BaseNode extends EventEmitter {
168
222
  *
169
223
  * Forward direction is implied if omitted.
170
224
  */
171
- public findReferences(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): UAReference[];
225
+ findReferences(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): UAReference[];
172
226
 
173
227
  /**
174
228
  * find the the references that are strictly of type **`reference`**.
@@ -180,18 +234,15 @@ export declare class BaseNode extends EventEmitter {
180
234
  * * will throw an exception if more than one reference exists with the referenceType.
181
235
  * * will return null if no reference exists.
182
236
  */
183
- public findReference(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): UAReference | null;
237
+ findReference(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): UAReference | null;
184
238
 
185
239
  /**
186
- * find all the nodes that are referenced by references of type **`reference`** or a
240
+ * find all the nodes that are referenced by references of type **`reference`** or a
187
241
  * sub type of **`reference`**, in the direction specified by **`browseDirection`**
188
242
  *
189
243
  * * BrowseDirection.Forward direction is implied if browseDirection flags is omitted.
190
244
  */
191
- public findReferencesExAsObject(
192
- referenceType: string | NodeId | UAReferenceType,
193
- browseDirection?: BrowseDirection
194
- ): BaseNode[];
245
+ findReferencesExAsObject(referenceType: string | NodeId | UAReferenceType, browseDirection?: BrowseDirection): BaseNode[];
195
246
 
196
247
  /**
197
248
  * find all the nodes that are referenced by references strictly of type **`reference`**.
@@ -203,19 +254,18 @@ export declare class BaseNode extends EventEmitter {
203
254
  * * will throw an exception if more than one reference exists with the referenceType.
204
255
  * * will return null if no reference exists.
205
256
  */
206
- public findReferencesAsObject(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): BaseNode[];
257
+ findReferencesAsObject(referenceType: string | NodeId | UAReferenceType, isForward?: boolean): BaseNode[];
207
258
 
208
- public allReferences(): UAReference[];
259
+ allReferences(): UAReference[];
209
260
 
210
261
  /**
211
262
  * Get the Child by name, if browseName is string and namespaceIndex undefined
212
263
  * then the search doesn't care about namespace matching
213
- *
214
- * @param browseName
264
+ *
265
+ * @param browseName
215
266
  */
216
- public getChildByName(browseName: QualifiedNameOptions): BaseNode | null;
217
- public getChildByName(browseName: string, namespaceIndex?: number): BaseNode | null;
218
-
267
+ getChildByName(browseName: QualifiedNameOptions): BaseNode | null;
268
+ getChildByName(browseName: string, namespaceIndex?: number): BaseNode | null;
219
269
 
220
270
  /**
221
271
  * this methods propagates the forward references to the pointed node
@@ -223,12 +273,12 @@ export declare class BaseNode extends EventEmitter {
223
273
  *
224
274
  * @private
225
275
  */
226
- public propagate_back_references(): void;
276
+ propagate_back_references(): void;
227
277
 
228
278
  /**
229
279
  * browse the node to extract information requested in browseDescription
230
280
  */
231
- public browseNode(browseDescription: BrowseDescriptionOptions2, session?: ISessionContext): ReferenceDescription[];
281
+ browseNode(browseDescription: BrowseDescriptionOptions2, session?: ISessionContext): ReferenceDescription[];
232
282
 
233
283
  /**
234
284
  *
@@ -253,28 +303,26 @@ export declare class BaseNode extends EventEmitter {
253
303
  getAccessRestrictions(inherited: boolean): AccessRestrictionsFlag;
254
304
  /**
255
305
  * NodeVersion (Optional) String The NodeVersion Property is used to indicate the version of a Node.
256
- *
257
- * The NodeVersion Property is updated each time a Reference is added or deleted
258
- * to the Node the Property belongs to.
259
- *
306
+ *
307
+ * The NodeVersion Property is updated each time a Reference is added or deleted
308
+ * to the Node the Property belongs to.
309
+ *
260
310
  * Attribute value changes do not cause the NodeVersion to change.
261
- *
262
- * Clients may read the NodeVersion Property or subscribe to it to determine when the
311
+ *
312
+ * Clients may read the NodeVersion Property or subscribe to it to determine when the
263
313
  * structure of a Node has changed.
264
314
  */
265
315
  // nodeVersion?: UAProperty<UAString, DataType.String>;
266
- /**
316
+ /**
267
317
  * return the versioning node
268
318
  */
269
319
  getNodeVersion(): UAProperty<UAString, DataType.String> | null;
270
320
 
271
-
272
-
273
321
  /**
274
322
  *
275
323
  */
276
324
  getAggregates(): BaseNode[];
277
325
 
278
- public setDisplayName(value: LocalizedTextLike[] | LocalizedTextLike): void;
279
- public setDescription(value: LocalizedTextLike | null): void;
326
+ setDisplayName(value: LocalizedTextLike[] | LocalizedTextLike): void;
327
+ setDescription(value: LocalizedTextLike | null): void;
280
328
  }
@@ -1,18 +1,17 @@
1
- import { Variant, VariantLike } from "node-opcua-variant";
2
- import { CallbackT, StatusCode, StatusCodeCallback } from "node-opcua-status-code";
3
- import {
1
+ import type { QualifiedNameLike } from "node-opcua-data-model";
2
+ import type { DataValue } from "node-opcua-data-value";
3
+ import type { NumericRange } from "node-opcua-numeric-range";
4
+ import type { CallbackT, StatusCode } from "node-opcua-status-code";
5
+ import type {
4
6
  HistoryReadResult,
5
7
  ReadAtTimeDetails,
6
8
  ReadEventDetails,
7
9
  ReadProcessedDetails,
8
10
  ReadRawModifiedDetails
9
11
  } from "node-opcua-types";
10
- import { NumericRange } from "node-opcua-numeric-range";
11
- import { QualifiedNameLike } from "node-opcua-data-model";
12
- import { DataValue } from "node-opcua-data-value";
13
-
14
- import { UAVariable } from "./ua_variable";
15
- import { ContinuationData, ISessionContext } from "./session_context";
12
+ import type { Variant, VariantLike } from "node-opcua-variant";
13
+ import type { ContinuationData, ISessionContext } from "./session_context";
14
+ import type { UAVariable } from "./ua_variable";
16
15
 
17
16
  export type VariableSetterVariation1 = (this: UAVariable, value: Variant) => StatusCode;
18
17
 
@@ -20,8 +20,8 @@ const traceLog = errorLog;
20
20
  type UAConcrete = UAVariable | UAObject | UAMethod;
21
21
 
22
22
  /* c8 ignore start */
23
- /**
24
- * @private
23
+ /**
24
+ * @private
25
25
  */
26
26
  export function fullPath(node: BaseNode): string {
27
27
  const browseName = node.browseName.toString();
@@ -128,9 +128,8 @@ function _get_parent_type_and_path(originalObject: BaseNode): {
128
128
  const parents = originalObject.findReferencesEx("HasChild", BrowseDirection.Inverse);
129
129
  // c8 ignore next
130
130
  if (parents.length > 1) {
131
-
132
131
  // it could be a tricky buggy situation like that we have seen with SIOME
133
- //
132
+ //
134
133
  // AnalogUnitTyoe
135
134
  // |-- HasProperty --> EngineeringUnits (i=17052)
136
135
  // MyObjectType
@@ -141,12 +140,20 @@ function _get_parent_type_and_path(originalObject: BaseNode): {
141
140
  const n = addressSpace.findNode(p.nodeId);
142
141
  return n && (n.nodeClass === NodeClass.ObjectType || n.nodeClass === NodeClass.VariableType);
143
142
  });
144
-
143
+
145
144
  if (parentTypes.length === 1) {
146
- return { parentType: addressSpace.findNode(parentTypes[0].nodeId) as UAObjectType | UAVariableType, path: [originalObject.browseName] };
145
+ return {
146
+ parentType: addressSpace.findNode(parentTypes[0].nodeId) as UAObjectType | UAVariableType,
147
+ path: [originalObject.browseName]
148
+ };
147
149
  }
148
150
 
149
- warningLog(" object ", originalObject.browseName.toString(), originalObject.nodeId.toString(), " has more than one parent !");
151
+ warningLog(
152
+ " object ",
153
+ originalObject.browseName.toString(),
154
+ originalObject.nodeId.toString(),
155
+ " has more than one parent !"
156
+ );
150
157
  warningLog(originalObject.toString());
151
158
  warningLog(" parents : ");
152
159
  for (const parent of parents) {