import { NodeClass as _NodeClass } from 'ctrlx-datalayer-flatbuffers/dist/comm/datalayer/node-class'; import { DisplayFormat as _DisplayFormat } from 'ctrlx-datalayer-flatbuffers/dist/comm/datalayer/display-format'; /** * The NodeClass enumeration. */ export import NodeClass = _NodeClass; /** * The DisplayFormat enumeration. */ export import DisplayFormat = _DisplayFormat; /** * The AllowedOperations enumeration flags. */ export declare enum AllowedOperationFlags { None = 0, Read = 1,// 00001 -- the bitshift is unnecessary, but done for consistency Write = 2,// 00010 Create = 4,// 00100 Delete = 8,// 01000 Browse = 16,// 10000 All = 31 } /** * The ReferenceType enumeration. */ export declare enum ReferenceType { /** * Type when reading a value (absolute node address). */ ReadType = "readType", /** * Input type when reading a value. */ ReadInType = "readInType", /** * Output type when reading a value. */ ReadOutType = "readOutType", /** * Type when writing a value (absolute node address). * Input/Output type are the same. */ WriteType = "writeType", /** * Input type when writing a value. */ WriteInType = "writeInType", /** * Input type when writing a value. */ WriteOutType = "writeOutType", /** * Type when creating a value (absolute node address). */ createType = "createType", /** * Referenced (list of) absolute node addresses. */ Uses = "uses", /** * Reference to a save node address which needs to be called after node change to persist the new value. * (must be /admin/cfg/save) */ HasSave = "hasSave" } /** * The MetadataBuilder class */ export declare class MetadataBuilder { private builder; private nodeClass; private operationsOffset; private descriptionOffset; private descriptionUrlOffset; private displayNameOffset; private displayFormat; private unitOffset; private references; private extensions; private displayNames; private descriptions; constructor(allowedOperationFlags: AllowedOperationFlags, description?: string, descriptionUrl?: string); /** * Sets the allowed operations. * @param {AllowedOperationFlags} allowedOperations - The allowed operations as enum flags: e.g. AllowedOperations.Read | AllowedOperations.Write * @returns {MetadataBuilder} - This builder instance. {Builder} - This builder instance. */ private setAllowedOperations; /** * Sets the description. * @param {string} description - The description. * @returns {MetadataBuilder} - This builder instance. */ private setDescription; /** * Sets the description url. * @param {string} descriptionUrl - The description url. * @returns {MetadataBuilder} - This builder instance. */ private setDescriptionUrl; /** * Sets the displayName. * @param {string} displayName - The display name. * @returns {MetadataBuilder} - This builder instance. */ setDisplayName(displayName: string): MetadataBuilder; /** * Sets the unit. * @param {string} unit - The unit. * @returns {MetadataBuilder} - This builder instance. */ setUnit(unit: string): MetadataBuilder; /** * Sets the node. * @param {NodeClass} nodeClass - The node class * @returns {MetadataBuilder} - This builder instance. */ setNodeClass(nodeClass: NodeClass): MetadataBuilder; /** * Sets the node. * @param {DisplayFormat} displayFormat - The display format * @returns {MetadataBuilder} - This builder instance. */ setDisplayFormat(displayFormat: DisplayFormat): MetadataBuilder; /** * Adds a reference. * @param {ReferenceType} type - The reference type. * @param {string} targetAddress - The reference target address. * @returns {MetadataBuilder} - This builder instance. */ addReference(type: ReferenceType, targetAddress: string): MetadataBuilder; /** * Adds an extension. * @param {string} key - The extension key. * @param {value} value - The extension value. * @returns {MetadataBuilder} - This builder instance. */ addExtension(key: string, value: string): MetadataBuilder; /** * Adds a localized display name. * @param {string} id - The id. * @param {string} text - The localized text. * @returns {MetadataBuilder} - This builder instance. */ addDisplayName(id: string, text: string): MetadataBuilder; /** * Adds a localized description. * @param {string} id - The id. * @param {string} text - The localized text. * @returns {MetadataBuilder} - This builder instance. */ addDescription(id: string, text: string): MetadataBuilder; /** * Builds the Metadata flatbuffers object. * @returns {Uint8Array} - The Metadata flatbuffers object as an uint8 array. */ build(): Uint8Array; /** * Sorts the map values by key and returns it as array. * @param map The map to be sorted by key. * @returns The sorted values by key as array. */ private sortValuesByKey; }