node-opcua-factory 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.
@@ -1,46 +1,46 @@
1
- "use strict";
2
- /**
3
- * @module node-opcua-factory
4
- */
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.registerSpecialVariantEncoder = void 0;
7
- const node_opcua_assert_1 = require("node-opcua-assert");
8
- const builtin_types_1 = require("./builtin_types");
9
- function _self_encode(constructor) {
10
- (0, node_opcua_assert_1.assert)(typeof constructor === "function");
11
- return (value, stream) => {
12
- if (!value || !value.encode) {
13
- value = new constructor(value);
14
- }
15
- value.encode(stream);
16
- };
17
- }
18
- function _self_decode(constructor) {
19
- (0, node_opcua_assert_1.assert)(typeof constructor === "function");
20
- return (stream) => {
21
- const value = new constructor();
22
- value.decode(stream);
23
- return value;
24
- };
25
- }
26
- function _self_coerce(constructor) {
27
- (0, node_opcua_assert_1.assert)(typeof constructor === "function");
28
- return (value) => {
29
- const obj = new constructor(value);
30
- return obj;
31
- };
32
- }
33
- function registerSpecialVariantEncoder(constructor) {
34
- (0, node_opcua_assert_1.assert)(typeof constructor === "function");
35
- const name = constructor.prototype.schema.name;
36
- (0, builtin_types_1.registerType)({
37
- name,
38
- subType: name,
39
- encode: _self_encode(constructor),
40
- decode: _self_decode(constructor),
41
- coerce: _self_coerce(constructor),
42
- defaultValue: () => new constructor()
43
- });
44
- }
45
- exports.registerSpecialVariantEncoder = registerSpecialVariantEncoder;
1
+ "use strict";
2
+ /**
3
+ * @module node-opcua-factory
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.registerSpecialVariantEncoder = void 0;
7
+ const node_opcua_assert_1 = require("node-opcua-assert");
8
+ const builtin_types_1 = require("./builtin_types");
9
+ function _self_encode(constructor) {
10
+ (0, node_opcua_assert_1.assert)(typeof constructor === "function");
11
+ return (value, stream) => {
12
+ if (!value || !value.encode) {
13
+ value = new constructor(value);
14
+ }
15
+ value.encode(stream);
16
+ };
17
+ }
18
+ function _self_decode(constructor) {
19
+ (0, node_opcua_assert_1.assert)(typeof constructor === "function");
20
+ return (stream) => {
21
+ const value = new constructor();
22
+ value.decode(stream);
23
+ return value;
24
+ };
25
+ }
26
+ function _self_coerce(constructor) {
27
+ (0, node_opcua_assert_1.assert)(typeof constructor === "function");
28
+ return (value) => {
29
+ const obj = new constructor(value);
30
+ return obj;
31
+ };
32
+ }
33
+ function registerSpecialVariantEncoder(constructor) {
34
+ (0, node_opcua_assert_1.assert)(typeof constructor === "function");
35
+ const name = constructor.prototype.schema.name;
36
+ (0, builtin_types_1.registerType)({
37
+ name,
38
+ subType: name,
39
+ encode: _self_encode(constructor),
40
+ decode: _self_decode(constructor),
41
+ coerce: _self_coerce(constructor),
42
+ defaultValue: () => new constructor()
43
+ });
44
+ }
45
+ exports.registerSpecialVariantEncoder = registerSpecialVariantEncoder;
46
46
  //# sourceMappingURL=builtin_types_special.js.map
@@ -1,43 +1,43 @@
1
- import { ExpandedNodeId, NodeId } from "node-opcua-nodeid";
2
- import { EnumerationDefinitionSchema } from "./enumerations";
3
- import { CommonInterface, IStructuredTypeSchema, ConstructorFuncWithSchema, ConstructorFunc, IBaseUAObject } from "./types";
4
- export interface StructureInfo {
5
- constructor: ConstructorFuncWithSchema | null;
6
- schema: IStructuredTypeSchema;
7
- }
8
- export declare class DataTypeFactory {
9
- defaultByteOrder: string;
10
- targetNamespace: string;
11
- imports: string[];
12
- private _structureInfoByName;
13
- private _structureInfoByDataTypeMap;
14
- private _structureInfoByEncodingMap;
15
- private _enumerations;
16
- private baseDataFactories;
17
- constructor(baseDataFactories: DataTypeFactory[]);
18
- getStructureIterator(): IterableIterator<StructureInfo>;
19
- getEnumIterator(): IterableIterator<EnumerationDefinitionSchema>;
20
- repairBaseDataFactories(baseDataFactories: DataTypeFactory[]): void;
21
- hasBuiltInType(name: string): boolean;
22
- getBuiltInType(name: string): CommonInterface;
23
- getBuiltInTypeByDataType(nodeId: NodeId): CommonInterface;
24
- registerEnumeration(enumeration: EnumerationDefinitionSchema): void;
25
- hasEnumeration(enumName: string): boolean;
26
- getEnumeration(enumName: string): EnumerationDefinitionSchema | null;
27
- findStructureInfoForDataType(dataTypeNodeId: NodeId): StructureInfo;
28
- getStructureInfoForDataType(dataTypeNodeId: NodeId): StructureInfo | null;
29
- structuredTypesNames(): IterableIterator<string>;
30
- enumerations(): IterableIterator<string>;
31
- getStructureInfoByTypeName(typeName: string): StructureInfo;
32
- hasStructureByTypeName(typeName: string): boolean;
33
- getStructuredTypeSchema(typeName: string): IStructuredTypeSchema;
34
- dump(): void;
35
- registerAbstractStructure(dataTypeNodeId: NodeId, className: string, schema: IStructuredTypeSchema): void;
36
- registerClassDefinition(dataTypeNodeId: NodeId, className: string, classConstructor: ConstructorFuncWithSchema): void;
37
- getConstructor(binaryEncodingNodeId: NodeId): ConstructorFunc | null;
38
- hasConstructor(binaryEncodingNodeId: NodeId): boolean;
39
- constructObject(binaryEncodingNodeId: NodeId): IBaseUAObject;
40
- associateWithBinaryEncoding(className: string, expandedNodeId: ExpandedNodeId): void;
41
- toString(): string;
42
- private _registerFactory;
43
- }
1
+ import { ExpandedNodeId, NodeId } from "node-opcua-nodeid";
2
+ import { EnumerationDefinitionSchema } from "./enumerations";
3
+ import { CommonInterface, IStructuredTypeSchema, ConstructorFuncWithSchema, ConstructorFunc, IBaseUAObject } from "./types";
4
+ export interface StructureInfo {
5
+ constructor: ConstructorFuncWithSchema | null;
6
+ schema: IStructuredTypeSchema;
7
+ }
8
+ export declare class DataTypeFactory {
9
+ defaultByteOrder: string;
10
+ targetNamespace: string;
11
+ imports: string[];
12
+ private _structureInfoByName;
13
+ private _structureInfoByDataTypeMap;
14
+ private _structureInfoByEncodingMap;
15
+ private _enumerations;
16
+ private baseDataFactories;
17
+ constructor(baseDataFactories: DataTypeFactory[]);
18
+ getStructureIterator(): IterableIterator<StructureInfo>;
19
+ getEnumIterator(): IterableIterator<EnumerationDefinitionSchema>;
20
+ repairBaseDataFactories(baseDataFactories: DataTypeFactory[]): void;
21
+ hasBuiltInType(name: string): boolean;
22
+ getBuiltInType(name: string): CommonInterface;
23
+ getBuiltInTypeByDataType(nodeId: NodeId): CommonInterface;
24
+ registerEnumeration(enumeration: EnumerationDefinitionSchema): void;
25
+ hasEnumeration(enumName: string): boolean;
26
+ getEnumeration(enumName: string): EnumerationDefinitionSchema | null;
27
+ findStructureInfoForDataType(dataTypeNodeId: NodeId): StructureInfo;
28
+ getStructureInfoForDataType(dataTypeNodeId: NodeId): StructureInfo | null;
29
+ structuredTypesNames(): IterableIterator<string>;
30
+ enumerations(): IterableIterator<string>;
31
+ getStructureInfoByTypeName(typeName: string): StructureInfo;
32
+ hasStructureByTypeName(typeName: string): boolean;
33
+ getStructuredTypeSchema(typeName: string): IStructuredTypeSchema;
34
+ dump(): void;
35
+ registerAbstractStructure(dataTypeNodeId: NodeId, className: string, schema: IStructuredTypeSchema): void;
36
+ registerClassDefinition(dataTypeNodeId: NodeId, className: string, classConstructor: ConstructorFuncWithSchema): void;
37
+ getConstructor(binaryEncodingNodeId: NodeId): ConstructorFunc | null;
38
+ hasConstructor(binaryEncodingNodeId: NodeId): boolean;
39
+ constructObject(binaryEncodingNodeId: NodeId): IBaseUAObject;
40
+ associateWithBinaryEncoding(className: string, expandedNodeId: ExpandedNodeId): void;
41
+ toString(): string;
42
+ private _registerFactory;
43
+ }