import { JsonPointerString } from "./MetaInfoProducer.js"; import TemplateProcessor from "./TemplateProcessor.js"; /** * Represents a node in a data flow structure. * A DataFlowNode can either be a JsonPointerString or an object with a location * and an optional 'to' field which points to one or more subsequent DataFlowNodes or a JsonPointerString. * * @typedef {Object} DataFlowNode * @property {JsonPointerString} location - The location of the data in a JSON structure. * @property {DataFlowNode[]|DataFlowNode|JsonPointerString} [to] - Optional field that indicates the next node or nodes in the data flow. * * @typedef {string} JsonPointerString - A string that represents a JSON Pointer. */ export type DataFlowNode = { location: JsonPointerString; to?: DataFlowNode[] | DataFlowNode | JsonPointerString; } | JsonPointerString; export type FlowOpt = 0 | 1; /** * Class representing a DataFlow, managing dependencies and data flow nodes. */ export declare class DataFlow { private templateProcessor; private visited; private roots; constructor(templateProcessor: TemplateProcessor); /** * Links the given metaInfo node with its dependees, creating and returning a new DataFlowNode. * * @param {MetaInfo} metaInfo - The metadata information object containing dependencies and location data. * @return {DataFlowNode} - The created DataFlowNode with linked dependees. */ private linkDependees; /** * Recursively compacts the given DataFlowNode, reducing the 'to' field to a single object * if there is only one child node, or omitting it if there are no child nodes. * * @param {DataFlowNode} node - The node to compact. This node may have a 'to' field * that is an array of child nodes. * @return {DataFlowNode} The compacted node, which may have a simplified 'to' field or none at all. */ private level1Compact; /** * Retrieves the roots of the data flow nodes based on the specified option. * * @param {string} level - The option for retrieving roots, it can be either "l0" or "l1". * "l0" returns the roots as they are. * "l1" returns the roots in a compacted form. * @return {DataFlowNode[]} - An array of data flow node roots. * @throws {Error} - Throws an error if the specified option is unknown. */ getRoots(level?: FlowOpt): DataFlowNode[]; } //# sourceMappingURL=DataFlow.d.ts.map