node-opcua-basic-types 2.63.1 → 2.64.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/floats.js CHANGED
@@ -1,81 +1,81 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.coerceDouble = exports.coerceFloat = exports.decodeDouble = exports.encodeDouble = exports.randomDouble = exports.isValidDouble = exports.decodeFloat = exports.encodeFloat = exports.randomFloat = exports.isValidFloat = void 0;
4
- const minFloat = -3.4 * Math.pow(10, 38);
5
- const maxFloat = 3.4 * Math.pow(10, 38);
6
- /**
7
- * return a random float value in the range of min inclusive and max exclusive
8
- * @method getRandomInt
9
- * @param min
10
- * @param max
11
- * @return {*}
12
- * @private
13
- */
14
- function getRandomDouble(min, max) {
15
- return Math.random() * (max - min) + min;
16
- }
17
- function isValidFloat(value) {
18
- if (!isFinite(value)) {
19
- return false;
20
- }
21
- return value > minFloat && value < maxFloat;
22
- }
23
- exports.isValidFloat = isValidFloat;
24
- const r = new Float32Array(1);
25
- function roundToFloat(float) {
26
- r[0] = float;
27
- const floatR = r[0];
28
- return floatR;
29
- }
30
- function randomFloat() {
31
- return roundToFloat(getRandomDouble(-1000, 1000));
32
- }
33
- exports.randomFloat = randomFloat;
34
- function encodeFloat(value, stream) {
35
- stream.writeFloat(value);
36
- }
37
- exports.encodeFloat = encodeFloat;
38
- function decodeFloat(stream, value) {
39
- return stream.readFloat();
40
- }
41
- exports.decodeFloat = decodeFloat;
42
- function isValidDouble(value) {
43
- if (!isFinite(value)) {
44
- return false;
45
- }
46
- return true;
47
- }
48
- exports.isValidDouble = isValidDouble;
49
- function randomDouble() {
50
- return getRandomDouble(-1000000, 1000000);
51
- }
52
- exports.randomDouble = randomDouble;
53
- function encodeDouble(value, stream) {
54
- stream.writeDouble(value);
55
- }
56
- exports.encodeDouble = encodeDouble;
57
- function decodeDouble(stream, value) {
58
- return stream.readDouble();
59
- }
60
- exports.decodeDouble = decodeDouble;
61
- function coerceFloat(value) {
62
- if (value === null || value === undefined) {
63
- return 0.0;
64
- }
65
- if (typeof value === "number") {
66
- return value;
67
- }
68
- return parseFloat(value);
69
- }
70
- exports.coerceFloat = coerceFloat;
71
- function coerceDouble(value) {
72
- if (value === null || value === undefined) {
73
- return 0.0;
74
- }
75
- if (typeof value === "number") {
76
- return value;
77
- }
78
- return parseFloat(value);
79
- }
80
- exports.coerceDouble = coerceDouble;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.coerceDouble = exports.coerceFloat = exports.decodeDouble = exports.encodeDouble = exports.randomDouble = exports.isValidDouble = exports.decodeFloat = exports.encodeFloat = exports.randomFloat = exports.isValidFloat = void 0;
4
+ const minFloat = -3.4 * Math.pow(10, 38);
5
+ const maxFloat = 3.4 * Math.pow(10, 38);
6
+ /**
7
+ * return a random float value in the range of min inclusive and max exclusive
8
+ * @method getRandomInt
9
+ * @param min
10
+ * @param max
11
+ * @return {*}
12
+ * @private
13
+ */
14
+ function getRandomDouble(min, max) {
15
+ return Math.random() * (max - min) + min;
16
+ }
17
+ function isValidFloat(value) {
18
+ if (!isFinite(value)) {
19
+ return false;
20
+ }
21
+ return value > minFloat && value < maxFloat;
22
+ }
23
+ exports.isValidFloat = isValidFloat;
24
+ const r = new Float32Array(1);
25
+ function roundToFloat(float) {
26
+ r[0] = float;
27
+ const floatR = r[0];
28
+ return floatR;
29
+ }
30
+ function randomFloat() {
31
+ return roundToFloat(getRandomDouble(-1000, 1000));
32
+ }
33
+ exports.randomFloat = randomFloat;
34
+ function encodeFloat(value, stream) {
35
+ stream.writeFloat(value);
36
+ }
37
+ exports.encodeFloat = encodeFloat;
38
+ function decodeFloat(stream, value) {
39
+ return stream.readFloat();
40
+ }
41
+ exports.decodeFloat = decodeFloat;
42
+ function isValidDouble(value) {
43
+ if (!isFinite(value)) {
44
+ return false;
45
+ }
46
+ return true;
47
+ }
48
+ exports.isValidDouble = isValidDouble;
49
+ function randomDouble() {
50
+ return getRandomDouble(-1000000, 1000000);
51
+ }
52
+ exports.randomDouble = randomDouble;
53
+ function encodeDouble(value, stream) {
54
+ stream.writeDouble(value);
55
+ }
56
+ exports.encodeDouble = encodeDouble;
57
+ function decodeDouble(stream, value) {
58
+ return stream.readDouble();
59
+ }
60
+ exports.decodeDouble = decodeDouble;
61
+ function coerceFloat(value) {
62
+ if (value === null || value === undefined) {
63
+ return 0.0;
64
+ }
65
+ if (typeof value === "number") {
66
+ return value;
67
+ }
68
+ return parseFloat(value);
69
+ }
70
+ exports.coerceFloat = coerceFloat;
71
+ function coerceDouble(value) {
72
+ if (value === null || value === undefined) {
73
+ return 0.0;
74
+ }
75
+ if (typeof value === "number") {
76
+ return value;
77
+ }
78
+ return parseFloat(value);
79
+ }
80
+ exports.coerceDouble = coerceDouble;
81
81
  //# sourceMappingURL=floats.js.map
package/dist/guid.d.ts CHANGED
@@ -1,9 +1,9 @@
1
- /***
2
- * @module node-opcua-basic-types
3
- */
4
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
5
- export { isValidGuid, emptyGuid } from "node-opcua-guid";
6
- export declare type Guid = string;
7
- export declare function randomGuid(): Guid;
8
- export declare function encodeGuid(guid: Guid, stream: OutputBinaryStream): void;
9
- export declare function decodeGuid(stream: BinaryStream, value?: Guid): Guid;
1
+ /***
2
+ * @module node-opcua-basic-types
3
+ */
4
+ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
5
+ export { isValidGuid, emptyGuid } from "node-opcua-guid";
6
+ export declare type Guid = string;
7
+ export declare function randomGuid(): Guid;
8
+ export declare function encodeGuid(guid: Guid, stream: OutputBinaryStream): void;
9
+ export declare function decodeGuid(stream: BinaryStream, value?: Guid): Guid;
package/dist/guid.js CHANGED
@@ -1,122 +1,122 @@
1
- "use strict";
2
- /***
3
- * @module node-opcua-basic-types
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.decodeGuid = exports.encodeGuid = exports.randomGuid = exports.emptyGuid = exports.isValidGuid = void 0;
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
9
- const node_opcua_guid_1 = require("node-opcua-guid");
10
- const utils_1 = require("./utils");
11
- var node_opcua_guid_2 = require("node-opcua-guid");
12
- Object.defineProperty(exports, "isValidGuid", { enumerable: true, get: function () { return node_opcua_guid_2.isValidGuid; } });
13
- Object.defineProperty(exports, "emptyGuid", { enumerable: true, get: function () { return node_opcua_guid_2.emptyGuid; } });
14
- function toHex(i, nb) {
15
- return ("000000000000000" + i.toString(16)).substr(-nb);
16
- }
17
- function randomGuid() {
18
- const b = new node_opcua_binary_stream_1.BinaryStream(20);
19
- for (let i = 0; i < 20; i++) {
20
- b.writeUInt8((0, utils_1.getRandomInt)(0, 255));
21
- }
22
- b.rewind();
23
- const value = decodeGuid(b);
24
- return value;
25
- }
26
- exports.randomGuid = randomGuid;
27
- // 1 2 3
28
- // 012345678901234567890123456789012345
29
- // | | | | | | | | | | |
30
- // 12345678-1234-1234-ABCD-0123456789AB
31
- // 00000000-0000-0000-0000-000000000000";
32
- const hexCharToNum = (h) => {
33
- // tslint:disable-next-line: no-bitwise
34
- const l = h & 0x5f;
35
- const r = l <= 25 ? l - 16 : l - 55;
36
- // xx assert(r >= 0 && r < 16);
37
- return r;
38
- };
39
- (0, node_opcua_assert_1.default)(hexCharToNum("A".charCodeAt(0)) === 10);
40
- (0, node_opcua_assert_1.default)(hexCharToNum("a".charCodeAt(0)) === 10);
41
- (0, node_opcua_assert_1.default)(hexCharToNum("b".charCodeAt(0)) === 11);
42
- (0, node_opcua_assert_1.default)(hexCharToNum("B".charCodeAt(0)) === 11);
43
- (0, node_opcua_assert_1.default)(hexCharToNum("0".charCodeAt(0)) === 0);
44
- (0, node_opcua_assert_1.default)(hexCharToNum("9".charCodeAt(0)) === 9);
45
- const doDebug = false;
46
- function write_UInt32(stream, guid, starts) {
47
- const n = starts.length;
48
- for (let i = 0; i < n; i++) {
49
- const start = starts[i];
50
- const d1 = hexCharToNum(guid.charCodeAt(start));
51
- const d2 = hexCharToNum(guid.charCodeAt(start + 1));
52
- const d3 = hexCharToNum(guid.charCodeAt(start + 2));
53
- const d4 = hexCharToNum(guid.charCodeAt(start + 3));
54
- const d5 = hexCharToNum(guid.charCodeAt(start + 4));
55
- const d6 = hexCharToNum(guid.charCodeAt(start + 5));
56
- const d7 = hexCharToNum(guid.charCodeAt(start + 6));
57
- const d8 = hexCharToNum(guid.charCodeAt(start + 7));
58
- // tslint:disable-next-line: no-bitwise
59
- const value = (((((((((((((d1 << 4) | d2) << 4) | d3) << 4) | d4) << 4) | d5) << 4) | d6) << 4) | d7) << 4) | d8;
60
- stream.writeInteger(value);
61
- }
62
- }
63
- function write_UInt16(stream, guid, starts) {
64
- const n = starts.length;
65
- for (let i = 0; i < n; i++) {
66
- const start = starts[i];
67
- const d1 = hexCharToNum(guid.charCodeAt(start));
68
- const d2 = hexCharToNum(guid.charCodeAt(start + 1));
69
- const d3 = hexCharToNum(guid.charCodeAt(start + 2));
70
- const d4 = hexCharToNum(guid.charCodeAt(start + 3));
71
- // tslint:disable-next-line: no-bitwise
72
- const value = (((((d1 << 4) | d2) << 4) | d3) << 4) | d4;
73
- stream.writeUInt16(value);
74
- }
75
- }
76
- function write_UInt8(stream, guid, starts) {
77
- const n = starts.length;
78
- for (let i = 0; i < n; i++) {
79
- const start = starts[i];
80
- const d1 = hexCharToNum(guid.charCodeAt(start));
81
- const d2 = hexCharToNum(guid.charCodeAt(start + 1));
82
- // tslint:disable-next-line: no-bitwise
83
- const value = (d1 << 4) | d2;
84
- stream.writeUInt8(value);
85
- }
86
- }
87
- function encodeGuid(guid, stream) {
88
- if (!(0, node_opcua_guid_1.isValidGuid)(guid)) {
89
- throw new Error(" Invalid GUID : '" + JSON.stringify(guid) + "'");
90
- }
91
- write_UInt32(stream, guid, [0]);
92
- write_UInt16(stream, guid, [9, 14]);
93
- write_UInt8(stream, guid, [19, 21, 24, 26, 28, 30, 32, 34]);
94
- }
95
- exports.encodeGuid = encodeGuid;
96
- function read_UInt32(stream) {
97
- return toHex(stream.readUInt32(), 8);
98
- }
99
- function read_UInt16(stream) {
100
- return toHex(stream.readUInt16(), 4);
101
- }
102
- function read_UInt8(stream) {
103
- return toHex(stream.readUInt8(), 2);
104
- }
105
- function read_many(stream, func, nb) {
106
- let result = "";
107
- for (let i = 0; i < nb; i++) {
108
- result += func(stream);
109
- }
110
- return result;
111
- }
112
- function decodeGuid(stream, value) {
113
- const data1 = read_UInt32(stream);
114
- const data2 = read_UInt16(stream);
115
- const data3 = read_UInt16(stream);
116
- const data45 = read_many(stream, read_UInt8, 2);
117
- const data6B = read_many(stream, read_UInt8, 6);
118
- const guid = data1 + "-" + data2 + "-" + data3 + "-" + data45 + "-" + data6B;
119
- return guid.toUpperCase();
120
- }
121
- exports.decodeGuid = decodeGuid;
1
+ "use strict";
2
+ /***
3
+ * @module node-opcua-basic-types
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.decodeGuid = exports.encodeGuid = exports.randomGuid = exports.emptyGuid = exports.isValidGuid = void 0;
7
+ const node_opcua_assert_1 = require("node-opcua-assert");
8
+ const node_opcua_binary_stream_1 = require("node-opcua-binary-stream");
9
+ const node_opcua_guid_1 = require("node-opcua-guid");
10
+ const utils_1 = require("./utils");
11
+ var node_opcua_guid_2 = require("node-opcua-guid");
12
+ Object.defineProperty(exports, "isValidGuid", { enumerable: true, get: function () { return node_opcua_guid_2.isValidGuid; } });
13
+ Object.defineProperty(exports, "emptyGuid", { enumerable: true, get: function () { return node_opcua_guid_2.emptyGuid; } });
14
+ function toHex(i, nb) {
15
+ return ("000000000000000" + i.toString(16)).substr(-nb);
16
+ }
17
+ function randomGuid() {
18
+ const b = new node_opcua_binary_stream_1.BinaryStream(20);
19
+ for (let i = 0; i < 20; i++) {
20
+ b.writeUInt8((0, utils_1.getRandomInt)(0, 255));
21
+ }
22
+ b.rewind();
23
+ const value = decodeGuid(b);
24
+ return value;
25
+ }
26
+ exports.randomGuid = randomGuid;
27
+ // 1 2 3
28
+ // 012345678901234567890123456789012345
29
+ // | | | | | | | | | | |
30
+ // 12345678-1234-1234-ABCD-0123456789AB
31
+ // 00000000-0000-0000-0000-000000000000";
32
+ const hexCharToNum = (h) => {
33
+ // tslint:disable-next-line: no-bitwise
34
+ const l = h & 0x5f;
35
+ const r = l <= 25 ? l - 16 : l - 55;
36
+ // xx assert(r >= 0 && r < 16);
37
+ return r;
38
+ };
39
+ (0, node_opcua_assert_1.default)(hexCharToNum("A".charCodeAt(0)) === 10);
40
+ (0, node_opcua_assert_1.default)(hexCharToNum("a".charCodeAt(0)) === 10);
41
+ (0, node_opcua_assert_1.default)(hexCharToNum("b".charCodeAt(0)) === 11);
42
+ (0, node_opcua_assert_1.default)(hexCharToNum("B".charCodeAt(0)) === 11);
43
+ (0, node_opcua_assert_1.default)(hexCharToNum("0".charCodeAt(0)) === 0);
44
+ (0, node_opcua_assert_1.default)(hexCharToNum("9".charCodeAt(0)) === 9);
45
+ const doDebug = false;
46
+ function write_UInt32(stream, guid, starts) {
47
+ const n = starts.length;
48
+ for (let i = 0; i < n; i++) {
49
+ const start = starts[i];
50
+ const d1 = hexCharToNum(guid.charCodeAt(start));
51
+ const d2 = hexCharToNum(guid.charCodeAt(start + 1));
52
+ const d3 = hexCharToNum(guid.charCodeAt(start + 2));
53
+ const d4 = hexCharToNum(guid.charCodeAt(start + 3));
54
+ const d5 = hexCharToNum(guid.charCodeAt(start + 4));
55
+ const d6 = hexCharToNum(guid.charCodeAt(start + 5));
56
+ const d7 = hexCharToNum(guid.charCodeAt(start + 6));
57
+ const d8 = hexCharToNum(guid.charCodeAt(start + 7));
58
+ // tslint:disable-next-line: no-bitwise
59
+ const value = (((((((((((((d1 << 4) | d2) << 4) | d3) << 4) | d4) << 4) | d5) << 4) | d6) << 4) | d7) << 4) | d8;
60
+ stream.writeInteger(value);
61
+ }
62
+ }
63
+ function write_UInt16(stream, guid, starts) {
64
+ const n = starts.length;
65
+ for (let i = 0; i < n; i++) {
66
+ const start = starts[i];
67
+ const d1 = hexCharToNum(guid.charCodeAt(start));
68
+ const d2 = hexCharToNum(guid.charCodeAt(start + 1));
69
+ const d3 = hexCharToNum(guid.charCodeAt(start + 2));
70
+ const d4 = hexCharToNum(guid.charCodeAt(start + 3));
71
+ // tslint:disable-next-line: no-bitwise
72
+ const value = (((((d1 << 4) | d2) << 4) | d3) << 4) | d4;
73
+ stream.writeUInt16(value);
74
+ }
75
+ }
76
+ function write_UInt8(stream, guid, starts) {
77
+ const n = starts.length;
78
+ for (let i = 0; i < n; i++) {
79
+ const start = starts[i];
80
+ const d1 = hexCharToNum(guid.charCodeAt(start));
81
+ const d2 = hexCharToNum(guid.charCodeAt(start + 1));
82
+ // tslint:disable-next-line: no-bitwise
83
+ const value = (d1 << 4) | d2;
84
+ stream.writeUInt8(value);
85
+ }
86
+ }
87
+ function encodeGuid(guid, stream) {
88
+ if (!(0, node_opcua_guid_1.isValidGuid)(guid)) {
89
+ throw new Error(" Invalid GUID : '" + JSON.stringify(guid) + "'");
90
+ }
91
+ write_UInt32(stream, guid, [0]);
92
+ write_UInt16(stream, guid, [9, 14]);
93
+ write_UInt8(stream, guid, [19, 21, 24, 26, 28, 30, 32, 34]);
94
+ }
95
+ exports.encodeGuid = encodeGuid;
96
+ function read_UInt32(stream) {
97
+ return toHex(stream.readUInt32(), 8);
98
+ }
99
+ function read_UInt16(stream) {
100
+ return toHex(stream.readUInt16(), 4);
101
+ }
102
+ function read_UInt8(stream) {
103
+ return toHex(stream.readUInt8(), 2);
104
+ }
105
+ function read_many(stream, func, nb) {
106
+ let result = "";
107
+ for (let i = 0; i < nb; i++) {
108
+ result += func(stream);
109
+ }
110
+ return result;
111
+ }
112
+ function decodeGuid(stream, value) {
113
+ const data1 = read_UInt32(stream);
114
+ const data2 = read_UInt16(stream);
115
+ const data3 = read_UInt16(stream);
116
+ const data45 = read_many(stream, read_UInt8, 2);
117
+ const data6B = read_many(stream, read_UInt8, 6);
118
+ const guid = data1 + "-" + data2 + "-" + data3 + "-" + data45 + "-" + data6B;
119
+ return guid.toUpperCase();
120
+ }
121
+ exports.decodeGuid = decodeGuid;
122
122
  //# sourceMappingURL=guid.js.map
package/dist/index.d.ts CHANGED
@@ -1,18 +1,18 @@
1
- /***
2
- * @module node-opcua-basic-types
3
- */
4
- /// <reference types="node" />
5
- export * from "./boolean";
6
- export * from "./integers";
7
- export * from "./floats";
8
- export * from "./string";
9
- export * from "./date_time";
10
- export * from "./byte_string";
11
- export * from "./node_id";
12
- export * from "./status_code";
13
- export * from "./guid";
14
- export * from "./array";
15
- export * from "./locale_id";
16
- export * from "./attributeIds";
17
- export * from "./round_to_float";
18
- export declare type ByteString = Buffer;
1
+ /***
2
+ * @module node-opcua-basic-types
3
+ */
4
+ /// <reference types="node" />
5
+ export * from "./boolean";
6
+ export * from "./integers";
7
+ export * from "./floats";
8
+ export * from "./string";
9
+ export * from "./date_time";
10
+ export * from "./byte_string";
11
+ export * from "./node_id";
12
+ export * from "./status_code";
13
+ export * from "./guid";
14
+ export * from "./array";
15
+ export * from "./locale_id";
16
+ export * from "./attributeIds";
17
+ export * from "./round_to_float";
18
+ export declare type ByteString = Buffer;
package/dist/index.js CHANGED
@@ -1,29 +1,29 @@
1
- "use strict";
2
- /***
3
- * @module node-opcua-basic-types
4
- */
5
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
- }) : (function(o, m, k, k2) {
9
- if (k2 === undefined) k2 = k;
10
- o[k2] = m[k];
11
- }));
12
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
13
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
14
- };
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- __exportStar(require("./boolean"), exports);
17
- __exportStar(require("./integers"), exports);
18
- __exportStar(require("./floats"), exports);
19
- __exportStar(require("./string"), exports);
20
- __exportStar(require("./date_time"), exports);
21
- __exportStar(require("./byte_string"), exports);
22
- __exportStar(require("./node_id"), exports);
23
- __exportStar(require("./status_code"), exports);
24
- __exportStar(require("./guid"), exports);
25
- __exportStar(require("./array"), exports);
26
- __exportStar(require("./locale_id"), exports);
27
- __exportStar(require("./attributeIds"), exports);
28
- __exportStar(require("./round_to_float"), exports);
1
+ "use strict";
2
+ /***
3
+ * @module node-opcua-basic-types
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
13
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
14
+ };
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ __exportStar(require("./boolean"), exports);
17
+ __exportStar(require("./integers"), exports);
18
+ __exportStar(require("./floats"), exports);
19
+ __exportStar(require("./string"), exports);
20
+ __exportStar(require("./date_time"), exports);
21
+ __exportStar(require("./byte_string"), exports);
22
+ __exportStar(require("./node_id"), exports);
23
+ __exportStar(require("./status_code"), exports);
24
+ __exportStar(require("./guid"), exports);
25
+ __exportStar(require("./array"), exports);
26
+ __exportStar(require("./locale_id"), exports);
27
+ __exportStar(require("./attributeIds"), exports);
28
+ __exportStar(require("./round_to_float"), exports);
29
29
  //# sourceMappingURL=index.js.map
@@ -1,66 +1,66 @@
1
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
2
- export declare function isValidUInt16(value: number): boolean;
3
- export declare type UInt8 = number;
4
- export declare type UInt16 = number;
5
- export declare type UInt32 = number;
6
- export declare type UInt64 = UInt32[];
7
- export declare type Int8 = number;
8
- export declare type Int16 = number;
9
- export declare type Int32 = number;
10
- export declare type Int64 = UInt32[];
11
- export declare type Byte = UInt8;
12
- export declare type SByte = Int8;
13
- export declare function randomUInt16(): UInt16;
14
- export declare function encodeUInt16(value: UInt16, stream: OutputBinaryStream): void;
15
- export declare function decodeUInt16(stream: BinaryStream, value?: number): UInt16;
16
- export declare function isValidInt16(value: number): boolean;
17
- export declare function randomInt16(): Int16;
18
- export declare function encodeInt16(value: Int16, stream: OutputBinaryStream): void;
19
- export declare function decodeInt16(stream: BinaryStream, value?: number): Int16;
20
- export declare function isValidInt32(value: number): boolean;
21
- export declare function randomInt32(): Int32;
22
- export declare function encodeInt32(value: Int32, stream: OutputBinaryStream): void;
23
- export declare function decodeInt32(stream: BinaryStream, value?: number): Int32;
24
- export declare function isValidUInt32(value: number): boolean;
25
- export declare function randomUInt32(): UInt32;
26
- export declare function encodeUInt32(value: UInt32, stream: OutputBinaryStream): void;
27
- export declare function decodeUInt32(stream: BinaryStream, value?: number): UInt32;
28
- export declare function isValidInt8(value: number): boolean;
29
- export declare function randomInt8(): Int8;
30
- export declare function encodeInt8(value: Int8, stream: OutputBinaryStream): void;
31
- export declare function decodeInt8(stream: BinaryStream, value?: number): Int8;
32
- export declare const isValidSByte: typeof isValidInt8;
33
- export declare const randomSByte: typeof randomInt8;
34
- export declare const encodeSByte: typeof encodeInt8;
35
- export declare const decodeSByte: typeof decodeInt8;
36
- export declare function isValidUInt8(value: number): boolean;
37
- export declare function randomUInt8(): UInt8;
38
- export declare function encodeUInt8(value: UInt8, stream: OutputBinaryStream): void;
39
- export declare function decodeUInt8(stream: BinaryStream, value?: number): UInt8;
40
- export declare const isValidByte: typeof isValidUInt8;
41
- export declare const randomByte: typeof randomUInt8;
42
- export declare const encodeByte: typeof encodeUInt8;
43
- export declare const decodeByte: typeof decodeUInt8;
44
- export declare function isValidUInt64(value?: number | number[]): boolean;
45
- export declare function randomUInt64(): UInt64;
46
- export declare function encodeUInt64(value: UInt64 | number, stream: OutputBinaryStream): void;
47
- export declare function decodeUInt64(stream: BinaryStream, value?: UInt64): UInt64;
48
- export declare function constructInt64(high: UInt32, low: UInt32): Int64;
49
- export declare function coerceUInt64(value: number | UInt64 | Int32 | string | null): UInt64;
50
- export declare function randomInt64(): Int64;
51
- export declare const coerceInt64: typeof coerceUInt64;
52
- export declare const isValidInt64: typeof isValidUInt64;
53
- export declare const encodeInt64: typeof encodeUInt64;
54
- export declare const decodeInt64: typeof decodeUInt64;
55
- export declare function coerceInt8(value: number | string | null): Int8;
56
- export declare function coerceUInt8(value: number | string | null): UInt8;
57
- export declare function coerceByte(value: number | string | null): UInt8;
58
- export declare function coerceSByte(value: number | string | null): Int8;
59
- export declare function coerceUInt16(value: number | string | null): UInt16;
60
- export declare function coerceInt16(value: number | string | null): Int16;
61
- interface EnumItemLike {
62
- value: number;
63
- }
64
- export declare function coerceUInt32(value: null | string | number | EnumItemLike): UInt32;
65
- export declare function coerceInt32(value: null | Int64 | UInt64 | number | string): Int32;
66
- export {};
1
+ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
2
+ export declare function isValidUInt16(value: number): boolean;
3
+ export declare type UInt8 = number;
4
+ export declare type UInt16 = number;
5
+ export declare type UInt32 = number;
6
+ export declare type UInt64 = UInt32[];
7
+ export declare type Int8 = number;
8
+ export declare type Int16 = number;
9
+ export declare type Int32 = number;
10
+ export declare type Int64 = UInt32[];
11
+ export declare type Byte = UInt8;
12
+ export declare type SByte = Int8;
13
+ export declare function randomUInt16(): UInt16;
14
+ export declare function encodeUInt16(value: UInt16, stream: OutputBinaryStream): void;
15
+ export declare function decodeUInt16(stream: BinaryStream, value?: number): UInt16;
16
+ export declare function isValidInt16(value: number): boolean;
17
+ export declare function randomInt16(): Int16;
18
+ export declare function encodeInt16(value: Int16, stream: OutputBinaryStream): void;
19
+ export declare function decodeInt16(stream: BinaryStream, value?: number): Int16;
20
+ export declare function isValidInt32(value: number): boolean;
21
+ export declare function randomInt32(): Int32;
22
+ export declare function encodeInt32(value: Int32, stream: OutputBinaryStream): void;
23
+ export declare function decodeInt32(stream: BinaryStream, value?: number): Int32;
24
+ export declare function isValidUInt32(value: number): boolean;
25
+ export declare function randomUInt32(): UInt32;
26
+ export declare function encodeUInt32(value: UInt32, stream: OutputBinaryStream): void;
27
+ export declare function decodeUInt32(stream: BinaryStream, value?: number): UInt32;
28
+ export declare function isValidInt8(value: number): boolean;
29
+ export declare function randomInt8(): Int8;
30
+ export declare function encodeInt8(value: Int8, stream: OutputBinaryStream): void;
31
+ export declare function decodeInt8(stream: BinaryStream, value?: number): Int8;
32
+ export declare const isValidSByte: typeof isValidInt8;
33
+ export declare const randomSByte: typeof randomInt8;
34
+ export declare const encodeSByte: typeof encodeInt8;
35
+ export declare const decodeSByte: typeof decodeInt8;
36
+ export declare function isValidUInt8(value: number): boolean;
37
+ export declare function randomUInt8(): UInt8;
38
+ export declare function encodeUInt8(value: UInt8, stream: OutputBinaryStream): void;
39
+ export declare function decodeUInt8(stream: BinaryStream, value?: number): UInt8;
40
+ export declare const isValidByte: typeof isValidUInt8;
41
+ export declare const randomByte: typeof randomUInt8;
42
+ export declare const encodeByte: typeof encodeUInt8;
43
+ export declare const decodeByte: typeof decodeUInt8;
44
+ export declare function isValidUInt64(value?: number | number[]): boolean;
45
+ export declare function randomUInt64(): UInt64;
46
+ export declare function encodeUInt64(value: UInt64 | number, stream: OutputBinaryStream): void;
47
+ export declare function decodeUInt64(stream: BinaryStream, value?: UInt64): UInt64;
48
+ export declare function constructInt64(high: UInt32, low: UInt32): Int64;
49
+ export declare function coerceUInt64(value: number | UInt64 | Int32 | string | null): UInt64;
50
+ export declare function randomInt64(): Int64;
51
+ export declare const coerceInt64: typeof coerceUInt64;
52
+ export declare const isValidInt64: typeof isValidUInt64;
53
+ export declare const encodeInt64: typeof encodeUInt64;
54
+ export declare const decodeInt64: typeof decodeUInt64;
55
+ export declare function coerceInt8(value: number | string | null): Int8;
56
+ export declare function coerceUInt8(value: number | string | null): UInt8;
57
+ export declare function coerceByte(value: number | string | null): UInt8;
58
+ export declare function coerceSByte(value: number | string | null): Int8;
59
+ export declare function coerceUInt16(value: number | string | null): UInt16;
60
+ export declare function coerceInt16(value: number | string | null): Int16;
61
+ interface EnumItemLike {
62
+ value: number;
63
+ }
64
+ export declare function coerceUInt32(value: null | string | number | EnumItemLike): UInt32;
65
+ export declare function coerceInt32(value: null | Int64 | UInt64 | number | string): Int32;
66
+ export {};