node-opcua-nodeid 2.97.0 → 2.98.1

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.
package/dist/nodeid.d.ts CHANGED
@@ -1,139 +1,139 @@
1
- /// <reference types="node" />
2
- import { Guid } from "node-opcua-guid";
3
- /**
4
- * `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
5
- */
6
- export declare enum NodeIdType {
7
- /**
8
- * @static
9
- * @property NUMERIC
10
- * @default 0x1
11
- */
12
- NUMERIC = 1,
13
- /**
14
- * @static
15
- * @property STRING
16
- * @default 0x2
17
- */
18
- STRING = 2,
19
- /**
20
- * @static
21
- * @property GUID
22
- * @default 0x3
23
- */
24
- GUID = 3,
25
- /**
26
- * @static
27
- * @property BYTESTRING
28
- * @default 0x4
29
- */
30
- BYTESTRING = 4
31
- }
32
- export interface INodeIdNumeric extends NodeId {
33
- identifierType: NodeIdType.NUMERIC;
34
- value: number;
35
- }
36
- export interface INodeIdGuid extends NodeId {
37
- identifierType: NodeIdType.GUID;
38
- value: string;
39
- }
40
- export interface INodeIdByteString extends NodeId {
41
- identifierType: NodeIdType.BYTESTRING;
42
- value: Buffer;
43
- }
44
- export interface INodeIdString extends NodeId {
45
- identifierType: NodeIdType.STRING;
46
- value: string;
47
- }
48
- export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
49
- /**
50
- * Construct a node ID
51
- *
52
- * @class NodeId
53
- * @example
54
- *
55
- * ``` javascript
56
- * const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
57
- * ```
58
- * @constructor
59
- */
60
- export declare class NodeId {
61
- static NodeIdType: typeof NodeIdType;
62
- static nullNodeId: NodeId;
63
- static resolveNodeId: (a: string | NodeId) => NodeId;
64
- static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
65
- identifierType: NodeIdType;
66
- value: number | string | Buffer | Guid;
67
- namespace: number;
68
- /**
69
- * @param identifierType - the nodeID type
70
- * @param value - the node id value. The type of Value depends on identifierType.
71
- * @param namespace - the index of the related namespace (optional , default value = 0 )
72
- */
73
- constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
74
- /**
75
- * get the string representation of the nodeID.
76
- *
77
- * @method toString
78
- * @example
79
- *
80
- * ``` javascript
81
- * const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
82
- * console.log(nodeid.toString());
83
- * ```
84
- *
85
- * ```
86
- * >"ns=1;i=123"
87
- * ```
88
- *
89
- * @param [options.addressSpace] {AddressSpace}
90
- * @return {String}
91
- */
92
- toString(options?: {
93
- addressSpace?: any;
94
- }): string;
95
- /**
96
- * convert nodeId to a JSON string. same as {@link NodeId#toString }
97
- */
98
- toJSON(): string;
99
- displayText(): string;
100
- /**
101
- * returns true if the NodeId is null or empty
102
- */
103
- isEmpty(): boolean;
104
- }
105
- export type NodeIdLike = string | NodeId | number;
106
- /**
107
- * Convert a value into a nodeId:
108
- * @class opcua
109
- * @method coerceNodeId
110
- * @static
111
- *
112
- * @description:
113
- * - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
114
- * - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
115
- * - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
116
- * - if nodeId is a {@link NodeId} : coerceNodeId returns value
117
- * @param value
118
- * @param namespace {number}
119
- */
120
- export declare function coerceNodeId(value: unknown, namespace?: number): NodeId;
121
- /**
122
- * construct a node Id from a value and a namespace.
123
- * @class opcua
124
- * @method makeNodeId
125
- * @static
126
- * @param {String|Buffer} value
127
- * @param [namespace]=0 {Number} the node id namespace
128
- * @return {NodeId}
129
- */
130
- export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
131
- /**
132
- * @class opcua
133
- * @method resolveNodeId
134
- * @static
135
- * @param nodeIdOrString
136
- * @return the nodeId
137
- */
138
- export declare function resolveNodeId(nodeIdOrString: NodeIdLike): NodeId;
139
- export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;
1
+ /// <reference types="node" />
2
+ import { Guid } from "node-opcua-guid";
3
+ /**
4
+ * `NodeIdType` an enumeration that specifies the possible types of a `NodeId` value.
5
+ */
6
+ export declare enum NodeIdType {
7
+ /**
8
+ * @static
9
+ * @property NUMERIC
10
+ * @default 0x1
11
+ */
12
+ NUMERIC = 1,
13
+ /**
14
+ * @static
15
+ * @property STRING
16
+ * @default 0x2
17
+ */
18
+ STRING = 2,
19
+ /**
20
+ * @static
21
+ * @property GUID
22
+ * @default 0x3
23
+ */
24
+ GUID = 3,
25
+ /**
26
+ * @static
27
+ * @property BYTESTRING
28
+ * @default 0x4
29
+ */
30
+ BYTESTRING = 4
31
+ }
32
+ export interface INodeIdNumeric extends NodeId {
33
+ identifierType: NodeIdType.NUMERIC;
34
+ value: number;
35
+ }
36
+ export interface INodeIdGuid extends NodeId {
37
+ identifierType: NodeIdType.GUID;
38
+ value: string;
39
+ }
40
+ export interface INodeIdByteString extends NodeId {
41
+ identifierType: NodeIdType.BYTESTRING;
42
+ value: Buffer;
43
+ }
44
+ export interface INodeIdString extends NodeId {
45
+ identifierType: NodeIdType.STRING;
46
+ value: string;
47
+ }
48
+ export type INodeId = INodeIdNumeric | INodeIdGuid | INodeIdString | INodeIdByteString;
49
+ /**
50
+ * Construct a node ID
51
+ *
52
+ * @class NodeId
53
+ * @example
54
+ *
55
+ * ``` javascript
56
+ * const nodeId = new NodeId(NodeIdType.NUMERIC,123,1);
57
+ * ```
58
+ * @constructor
59
+ */
60
+ export declare class NodeId {
61
+ static NodeIdType: typeof NodeIdType;
62
+ static nullNodeId: NodeId;
63
+ static resolveNodeId: (a: string | NodeId) => NodeId;
64
+ static sameNodeId: (n1: NodeId, n2: NodeId) => boolean;
65
+ identifierType: NodeIdType;
66
+ value: number | string | Buffer | Guid;
67
+ namespace: number;
68
+ /**
69
+ * @param identifierType - the nodeID type
70
+ * @param value - the node id value. The type of Value depends on identifierType.
71
+ * @param namespace - the index of the related namespace (optional , default value = 0 )
72
+ */
73
+ constructor(identifierType?: NodeIdType | null, value?: number | string | Buffer | Guid, namespace?: number);
74
+ /**
75
+ * get the string representation of the nodeID.
76
+ *
77
+ * @method toString
78
+ * @example
79
+ *
80
+ * ``` javascript
81
+ * const nodeid = new NodeId(NodeIdType.NUMERIC, 123,1);
82
+ * console.log(nodeid.toString());
83
+ * ```
84
+ *
85
+ * ```
86
+ * >"ns=1;i=123"
87
+ * ```
88
+ *
89
+ * @param [options.addressSpace] {AddressSpace}
90
+ * @return {String}
91
+ */
92
+ toString(options?: {
93
+ addressSpace?: any;
94
+ }): string;
95
+ /**
96
+ * convert nodeId to a JSON string. same as {@link NodeId#toString }
97
+ */
98
+ toJSON(): string;
99
+ displayText(): string;
100
+ /**
101
+ * returns true if the NodeId is null or empty
102
+ */
103
+ isEmpty(): boolean;
104
+ }
105
+ export type NodeIdLike = string | NodeId | number;
106
+ /**
107
+ * Convert a value into a nodeId:
108
+ * @class opcua
109
+ * @method coerceNodeId
110
+ * @static
111
+ *
112
+ * @description:
113
+ * - if nodeId is a string of form : "i=1234" => nodeId({value=1234, identifierType: NodeIdType.NUMERIC})
114
+ * - if nodeId is a string of form : "s=foo" => nodeId({value="foo", identifierType: NodeIdType.STRING})
115
+ * - if nodeId is a string of form : "b=ABCD=" => nodeId({value=decodeBase64("ABCD="), identifierType: NodeIdType.BYTESTRING})
116
+ * - if nodeId is a {@link NodeId} : coerceNodeId returns value
117
+ * @param value
118
+ * @param namespace {number}
119
+ */
120
+ export declare function coerceNodeId(value: unknown, namespace?: number): NodeId;
121
+ /**
122
+ * construct a node Id from a value and a namespace.
123
+ * @class opcua
124
+ * @method makeNodeId
125
+ * @static
126
+ * @param {String|Buffer} value
127
+ * @param [namespace]=0 {Number} the node id namespace
128
+ * @return {NodeId}
129
+ */
130
+ export declare function makeNodeId(value: string | Buffer | number, namespace?: number): NodeId;
131
+ /**
132
+ * @class opcua
133
+ * @method resolveNodeId
134
+ * @static
135
+ * @param nodeIdOrString
136
+ * @return the nodeId
137
+ */
138
+ export declare function resolveNodeId(nodeIdOrString: NodeIdLike): NodeId;
139
+ export declare function sameNodeId(n1: NodeId, n2: NodeId): boolean;