node-opcua-variant 2.71.0 → 2.72.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/variant.d.ts CHANGED
@@ -1,81 +1,81 @@
1
- /// <reference types="node" />
2
- import { BaseUAObject, StructuredTypeSchema, DecodeDebugOptions } from "node-opcua-factory";
3
- import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
4
- import { DataType } from "./DataType_enum";
5
- import { VariantArrayType } from "./VariantArrayType_enum";
6
- declare function _coerceVariant(variantLike: VariantOptions | Variant): Variant;
7
- export interface VariantOptions {
8
- dataType?: DataType | string;
9
- arrayType?: VariantArrayType | string;
10
- value?: any;
11
- dimensions?: number[] | null;
12
- }
13
- export interface VariantOptions2 {
14
- dataType: DataType;
15
- arrayType: VariantArrayType;
16
- value: any;
17
- dimensions: number[] | null;
18
- }
19
- export declare class Variant extends BaseUAObject {
20
- static schema: StructuredTypeSchema;
21
- static coerce: typeof _coerceVariant;
22
- static computer_default_value: () => Variant;
23
- dataType: DataType;
24
- arrayType: VariantArrayType;
25
- value: any;
26
- dimensions: number[] | null;
27
- constructor(options?: VariantOptions | null);
28
- encode(stream: OutputBinaryStream): void;
29
- decode(stream: BinaryStream): void;
30
- decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
31
- toString(): string;
32
- isValid(): boolean;
33
- clone(): Variant;
34
- }
35
- export declare type VariantLike = VariantOptions;
36
- /***
37
- * @private
38
- */
39
- export declare const VARIANT_ARRAY_MASK = 128;
40
- /***
41
- * @private
42
- */
43
- export declare const VARIANT_ARRAY_DIMENSIONS_MASK = 64;
44
- /***
45
- * @private
46
- */
47
- export declare const VARIANT_TYPE_MASK = 63;
48
- /***
49
- * @private
50
- */
51
- export declare function encodeVariant(variant: Variant | undefined | null, stream: OutputBinaryStream): void;
52
- /***
53
- * @private
54
- */
55
- export declare function decodeVariant(stream: BinaryStream, value?: Variant): Variant;
56
- /***
57
- * @private
58
- */
59
- export declare type BufferedArray2 = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array;
60
- export declare function coerceVariantType(dataType: DataType, value: undefined | any): any;
61
- export declare function isValidVariant(arrayType: VariantArrayType, dataType: DataType, value: unknown, dimensions?: number[] | null): boolean;
62
- export declare function buildVariantArray(dataType: DataType, nbElements: number, defaultValue: unknown): Float32Array | Float64Array | Uint32Array | Int32Array | Uint16Array | Int16Array | Uint8Array | Int8Array | Array<unknown>;
63
- /***
64
- * returns true if the two variant represent the same value
65
- * @param v1 the first variant to compare
66
- * @param v2 the variant to compare with
67
- */
68
- export declare function sameVariant(v1: Variant, v2: Variant): boolean;
69
- export interface VariantOptionsT<T, DT extends DataType> extends VariantOptions {
70
- dataType: DT;
71
- arrayType?: VariantArrayType | string;
72
- value: T;
73
- dimensions?: number[] | null;
74
- }
75
- export interface VariantT<T, DT extends DataType> extends Variant {
76
- value: T;
77
- dataType: DT;
78
- }
79
- export declare type VariantByteString = VariantT<Buffer, DataType.ByteString>;
80
- export declare type VariantDouble = VariantT<number, DataType.Double>;
81
- export {};
1
+ /// <reference types="node" />
2
+ import { BaseUAObject, StructuredTypeSchema, DecodeDebugOptions } from "node-opcua-factory";
3
+ import { BinaryStream, OutputBinaryStream } from "node-opcua-binary-stream";
4
+ import { DataType } from "./DataType_enum";
5
+ import { VariantArrayType } from "./VariantArrayType_enum";
6
+ declare function _coerceVariant(variantLike: VariantOptions | Variant): Variant;
7
+ export interface VariantOptions {
8
+ dataType?: DataType | string;
9
+ arrayType?: VariantArrayType | string;
10
+ value?: any;
11
+ dimensions?: number[] | null;
12
+ }
13
+ export interface VariantOptions2 {
14
+ dataType: DataType;
15
+ arrayType: VariantArrayType;
16
+ value: any;
17
+ dimensions: number[] | null;
18
+ }
19
+ export declare class Variant extends BaseUAObject {
20
+ static schema: StructuredTypeSchema;
21
+ static coerce: typeof _coerceVariant;
22
+ static computer_default_value: () => Variant;
23
+ dataType: DataType;
24
+ arrayType: VariantArrayType;
25
+ value: any;
26
+ dimensions: number[] | null;
27
+ constructor(options?: VariantOptions | null);
28
+ encode(stream: OutputBinaryStream): void;
29
+ decode(stream: BinaryStream): void;
30
+ decodeDebug(stream: BinaryStream, options: DecodeDebugOptions): void;
31
+ toString(): string;
32
+ isValid(): boolean;
33
+ clone(): Variant;
34
+ }
35
+ export declare type VariantLike = VariantOptions;
36
+ /***
37
+ * @private
38
+ */
39
+ export declare const VARIANT_ARRAY_MASK = 128;
40
+ /***
41
+ * @private
42
+ */
43
+ export declare const VARIANT_ARRAY_DIMENSIONS_MASK = 64;
44
+ /***
45
+ * @private
46
+ */
47
+ export declare const VARIANT_TYPE_MASK = 63;
48
+ /***
49
+ * @private
50
+ */
51
+ export declare function encodeVariant(variant: Variant | undefined | null, stream: OutputBinaryStream): void;
52
+ /***
53
+ * @private
54
+ */
55
+ export declare function decodeVariant(stream: BinaryStream, value?: Variant): Variant;
56
+ /***
57
+ * @private
58
+ */
59
+ export declare type BufferedArray2 = Float32Array | Float64Array | Int8Array | Int16Array | Int32Array | Uint8Array | Uint16Array | Uint32Array;
60
+ export declare function coerceVariantType(dataType: DataType, value: undefined | any): any;
61
+ export declare function isValidVariant(arrayType: VariantArrayType, dataType: DataType, value: unknown, dimensions?: number[] | null): boolean;
62
+ export declare function buildVariantArray(dataType: DataType, nbElements: number, defaultValue: unknown): Float32Array | Float64Array | Uint32Array | Int32Array | Uint16Array | Int16Array | Uint8Array | Int8Array | Array<unknown>;
63
+ /***
64
+ * returns true if the two variant represent the same value
65
+ * @param v1 the first variant to compare
66
+ * @param v2 the variant to compare with
67
+ */
68
+ export declare function sameVariant(v1: Variant, v2: Variant): boolean;
69
+ export interface VariantOptionsT<T, DT extends DataType> extends VariantOptions {
70
+ dataType: DT;
71
+ arrayType?: VariantArrayType | string;
72
+ value: T;
73
+ dimensions?: number[] | null;
74
+ }
75
+ export interface VariantT<T, DT extends DataType> extends Variant {
76
+ value: T;
77
+ dataType: DT;
78
+ }
79
+ export declare type VariantByteString = VariantT<Buffer, DataType.ByteString>;
80
+ export declare type VariantDouble = VariantT<number, DataType.Double>;
81
+ export {};