NodeOPCUA API Documentation
    Preparing search index...

    Interface Namespace

    Enumerating the nodes a namespace holds.

    The iterators walk the namespace's own index, so they yield only nodes belonging to this namespace, in insertion order, and they do not follow references into any other. A count is a plain size lookup rather than a walk, so preferring it to [...iterator()].length is worth doing on a large model.

    None of these iterators tolerate the namespace being modified while one is open, for the same reason a Map iterator does not: adding or removing a node invalidates it. Collect into an array first when the loop body adds nodes.

    interface Namespace {
        $emulateVersion103?: boolean;
        addressSpace: IAddressSpace;
        index: number;
        namespaceUri: string;
        publicationDate: Date;
        version: string;
        _aliasCount(): number;
        _dataTypeCount(): number;
        _dataTypeIterator(): IterableIterator<UADataType>;
        _objectTypeCount(): number;
        _objectTypeIterator(): IterableIterator<UAObjectType>;
        _referenceTypeCount(): number;
        _referenceTypeIterator(): IterableIterator<UAReferenceType>;
        _variableTypeCount(): number;
        _variableTypeIterator(): IterableIterator<UAVariableType>;
        addAlias(aliasName: string, nodeId: NodeId): void;
        addAnalogDataItem<T, DT extends DataType>(
            options: AddAnalogDataItemOptions,
        ): UAAnalogItemEx<T, DT>;
        addDataItem<T, DT extends DataType>(
            options: AddDataItemOptions,
        ): UADataItem<T, DT>;
        addEnumerationType(options: AddEnumerationTypeOptions): UADataType;
        addEventType(
            options: {
                browseName: QualifiedNameLike;
                isAbstract?: boolean;
                subtypeOf?: string | UAEventType;
            },
        ): UAEventType;
        addFolder(
            parentFolder: NodeIdLike | UAObject<UAObjectEvents>,
            options: string | AddBaseNodeOptions,
        ): UAObject;
        addMethod(
            parent: UAObjectType | UAObject<UAObjectEvents>,
            options: AddMethodOptions,
        ): UAMethod;
        addMultiStateDiscrete<T, DT extends DataType>(
            options: AddMultiStateDiscreteOptions,
        ): UAMultiStateDiscreteEx<T, DT>;
        addMultiStateValueDiscrete<T, DT extends DataType>(
            options: AddMultiStateValueDiscreteOptions,
        ): UAMultiStateValueDiscreteEx<T, DT>;
        addObject(options: AddObjectOptions): UAObject;
        addObjectType(options: AddObjectTypeOptions): UAObjectType;
        addReferenceType(options: AddReferenceTypeOptions): UAReferenceType;
        addState(
            component: UAObjectType | UAObject<UAObjectEvents>,
            stateName: QualifiedNameLike,
            stateNumber: number,
            isInitialState?: boolean,
        ): UAState;
        addTransition(
            component: UAObjectType | UAObject<UAObjectEvents>,
            fromState: string,
            toState: string,
            transitionNumber: number,
            browseName?: QualifiedNameLike,
        ): UATransitionEx;
        addTwoStateDiscrete(
            options: AddTwoStateDiscreteOptions,
        ): UATwoStateDiscreteEx;
        addTwoStateVariable(
            options: AddTwoStateVariableOptions,
        ): UATwoStateVariableEx;
        addVariable(options: AddVariableOptions): UAVariable;
        addVariableType(options: AddVariableTypeOptions): UAVariableType;
        addView(options: AddViewOptions): UAView;
        addYArrayItem<DT extends Float | Double>(
            options: AddYArrayItemOptions,
        ): UAYArrayItemEx<DT>;
        aliasCount(): number;
        constructNodeId(options: ConstructNodeIdOptions): NodeId;
        createDataType(options: CreateDataTypeOptions): UADataType;
        createNode(options: CreateNodeOptions): BaseNode;
        dataTypeCount(): number;
        dataTypeIterator(): IterableIterator<UADataType>;
        deleteNode(node: NodeId | BaseNode<BaseNodeEvents>): void;
        findDataType(dataType: string): UADataType | null;
        findNode(nodeId: NodeIdLike): BaseNode<BaseNodeEvents> | null;
        findNode2(nodeId: NodeId): BaseNode<BaseNodeEvents> | null;
        findObjectType(objectType: string): UAObjectType | null;
        findReferenceType(referenceType: string): UAReferenceType | null;
        findReferenceTypeFromInverseName(
            referenceType: string,
        ): UAReferenceType | null;
        findVariableType(variableType: string): UAVariableType | null;
        getDefaultAccessRestrictions(): AccessRestrictionsFlag;
        getDefaultRolePermissions(): RolePermissionType[] | null;
        getRequiredModels(): RequiredModel[] | undefined;
        instantiateAcknowledgeableCondition(
            conditionTypeId: string | NodeId | UAEventType,
            options: InstantiateAlarmConditionOptions,
            data?: Record<string, VariantOptions>,
        ): UAAcknowledgeableConditionEx;
        instantiateAlarmCondition(
            alarmConditionTypeId: string | NodeId | UAEventType,
            options: InstantiateAlarmConditionOptions,
            data?: Record<string, VariantOptions>,
        ): UAAlarmConditionEx;
        instantiateCondition(
            conditionTypeId: string | NodeId | UAEventType,
            options: InstantiateConditionOptions,
            data?: Record<string, VariantOptions>,
        ): UAConditionEx;
        instantiateDiscreteAlarm(
            discreteAlarmType: string | NodeId | UAEventType,
            options: InstantiateAlarmConditionOptions,
            data?: Record<string, VariantOptions>,
        ): UADiscreteAlarmEx;
        instantiateExclusiveDeviationAlarm(
            options: InstantiateExclusiveDeviationAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UAExclusiveDeviationAlarmEx;
        instantiateExclusiveLimitAlarm(
            exclusiveLimitAlarmTypeId: string | NodeId | UAEventType,
            options: InstantiateExclusiveLimitAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UAExclusiveLimitAlarmEx;
        instantiateLimitAlarm(
            limitAlarmTypeId: string | NodeId | UAEventType,
            options: InstantiateLimitAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UALimitAlarmEx;
        instantiateNonExclusiveDeviationAlarm(
            options: InstantiateNonExclusiveDeviationAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UANonExclusiveDeviationAlarmEx;
        instantiateNonExclusiveLimitAlarm(
            nonExclusiveLimitAlarmTypeId: string | NodeId | UAEventType,
            options: InstantiateNonExclusiveLimitAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UANonExclusiveLimitAlarmEx;
        instantiateOffNormalAlarm(
            options: InstantiateOffNormalAlarmOptions,
            data?: Record<string, VariantOptions>,
        ): UAOffNormalAlarmEx;
        nodeIterator(): IterableIterator<BaseNode<BaseNodeEvents>>;
        objectTypeCount(): number;
        objectTypeIterator(): IterableIterator<UAObjectType>;
        referenceTypeCount(): number;
        referenceTypeIterator(): IterableIterator<UAReferenceType>;
        setDefaultAccessRestrictions(
            accessRestrictions: AccessRestrictionsFlag,
        ): void;
        setDefaultRolePermissions(
            rolePermissions: RolePermissionTypeOptions[] | null,
        ): void;
        toNodeset2XML(): string;
        toNodesetImage(
            options?: NamespaceToImageOptions,
        ): Promise<Uint8Array<ArrayBufferLike>>;
        toNodesetRecords(
            options?: ToNodesetRecordsOptions,
        ): Iterable<NodesetRecord>;
        variableTypeCount(): number;
        variableTypeIterator(): IterableIterator<UAVariableType>;
    }

    Hierarchy (View Summary)

    Index
    $emulateVersion103?: boolean
    addressSpace: IAddressSpace
    index: number
    namespaceUri: string
    publicationDate: Date
    version: string
    • Parameters

      • aliasName: string
      • nodeId: NodeId

      Returns void

    • add a new event type to the address space

      Parameters

      Returns UAEventType

      const evtType = namespace.addEventType({
      browseName: "MyAuditEventType",
      subtypeOf: "AuditEventType"
      });
      const myConditionType = namespace.addEventType({
      browseName: "MyConditionType",
      subtypeOf: "ConditionType",
      isAbstract: false
      });
    • how many aliases this namespace declares

      Returns number

    • how many data types this namespace defines

      Returns number

    • the data types defined in this namespace

      Returns IterableIterator<UADataType>

    • Parameters

      • dataType: string

      Returns UADataType | null

    • Parameters

      • objectType: string

      Returns UAObjectType | null

    • how many object types this namespace defines

      Returns number

    • the object types defined in this namespace

      Returns IterableIterator<UAObjectType>

    • how many reference types this namespace defines

      Returns number

    • the reference types defined in this namespace

      Returns IterableIterator<UAReferenceType>

    • Returns string

    • how many variable types this namespace defines

      Returns number

    • the variable types defined in this namespace

      Returns IterableIterator<UAVariableType>