import type { IAddressSpace, RequiredModel } from "node-opcua-address-space-base"; import type { CallbackT } from "node-opcua-status-code"; import type { NodeSetLoaderOptions } from "../interfaces/nodeset_loader_options.js"; import { type NodesetSource } from "./nodeset_source.js"; interface Model extends RequiredModel { requiredModel: RequiredModel[]; } interface NodesetInfo { namespaceUris: string[]; models: Model[]; } interface NodesetDesc { index: number; xmlData: string; namespaceModel: NodesetInfo; } /** * Detect order of namespace loading */ export declare function preLoad(xmlFiles: string[], xmlLoader: (nodeset2xmlUri: string) => Promise): Promise; /** * whether a model required by a document of this call, and provided by none of them, is * satisfied anyway: the predicate says so for a model the address space already holds * (see {@link loadedModelSatisfies}); by default nothing outside the call counts */ export type RequiredModelPredicate = (requiredModel: RequiredModel, requiredBy: string) => boolean; /** * a required model that the address space already holds, from an earlier call or from an * earlier `registerNamespace`: satisfied when the namespace is registered with a version at * least the required one. A lower version is an error naming both versions; an absent * namespace is not satisfied, and left to the caller to report as missing. */ export declare function loadedModelSatisfies(addressSpace: IAddressSpace): RequiredModelPredicate; /** * the order in which the documents of one call load, each after the documents it requires * * @param nodesetDescs the documents of the call, each with the models it defines and requires * @param isSatisfied a required model that no document of the call defines is an error unless * this says it is satisfied, typically because the address space holds it already */ export declare function findOrder(nodesetDescs: Array<{ namespaceModel: NodesetInfo; }>, isSatisfied?: RequiredModelPredicate): number[]; /** * populate an address space from NodeSet2 documents, in dependency order whatever the order given. * A model that a document requires may come from the same call or from an earlier one: what * the address space already holds, with a sufficient version, counts as loaded. * * @param addressSpace the addressSpace to populate * @param sources the documents, each a {@link NodesetSource}: text, bytes, a stream of chunks or a * function opening one; an array is always a list of documents * @param options */ export declare function generateAddressSpaceRaw(addressSpace: IAddressSpace, sources: NodesetSource | NodesetSource[], options?: NodeSetLoaderOptions): Promise; /** * @param addressSpace the addressSpace to populate * @param xmlFiles a list of xml file uris * @param xmlLoader a helper function returning the content of a xml file as a string * @param options */ export declare function generateAddressSpaceRaw(addressSpace: IAddressSpace, xmlFiles: string | string[], xmlLoader: (nodeset2xmlUri: string) => Promise, options: NodeSetLoaderOptions): Promise; export type XmlLoaderFunc = (nodeset2xmlUri: string, callback: CallbackT) => void; export type XmlLoaderAsyncFunc = (nodeset2xmlUri: string) => Promise; export {};