import type { Editor } from 'mem-fs-editor'; import { type BuildingBlock, type PageAggregationName, type GenerateBuildingBlockAggregationConfig } from './types.js'; import type { Manifest } from '../common/types.js'; import { type IdGeneratorFunction } from '../common/file.js'; /** * Returns the UI5 xml file document (view/fragment). * * @param basePath - the base path * @param viewPath - the path of the xml view relative to the base path * @param fs - the memfs editor instance * @returns {Document} the view xml file document */ export declare function getUI5XmlDocument(basePath: string, viewPath: string, fs: Editor): Document; /** * Returns the aggregation names to append for a Page building block, or undefined if not a Page. * Full template appends all PAGE_AGGREGATIONS; basic template appends nothing. * * @param data - the building block data * @returns aggregation names array, or undefined if not a Page building block */ export declare function getPageAggregationNames(data: BuildingBlock): readonly PageAggregationName[] | undefined; /** * Throws if the manifest's minUI5Version is set and does not meet the 1.145.0 requirement for the full Page template. * If minUI5Version is not set, it is treated as latest and passes the check. * * @param manifest - the manifest content, or undefined if not available */ export declare function validateFullPageTemplateVersion(manifest: Manifest | undefined): void; /** Controls to generate IDs for per aggregation. `key` is the EJS template variable name, `base` is passed to generateId. */ export declare const AGGREGATION_ID_KEYS: Partial>; /** * Generates a map of unique IDs for all controls in a given Page aggregation template. * Keys match the `ids.*` variable names referenced in the EJS templates. * * @param aggName - the aggregation name * @param generateId - the project-aware ID generator * @param existingIds - IDs already present in the container (prevents collision on subsequent adds) * @returns {Record} an object mapping each template variable name to a unique ID string */ export declare function buildAggregationIds(aggName: PageAggregationName, generateId: IdGeneratorFunction, existingIds?: string[]): Record; /** * * @param fs - the memfs editor instance * @param xmlDocument - the view XML document (used to resolve namespace prefixes) * @param templateDocument - the template document whose root element receives the children * @param generateId - function to generate unique IDs * @param [aggNames] - aggregation names to append; defaults to all PAGE_AGGREGATIONS * @param useDefaults - when true, the items aggregation renders its default IconTabBar content */ export declare function appendPageAggregations(fs: Editor, xmlDocument: Document, templateDocument: Document, generateId: IdGeneratorFunction, aggNames?: readonly PageAggregationName[], useDefaults?: boolean): void; /** * Reorders the child elements of a macros:Page node to match the canonical PAGE_AGGREGATIONS order. * Preserves relative order of siblings with the same local name. Pure whitespace text nodes are dropped * because the xml-formatter call that follows will regenerate proper indentation. * * @param pageElement - the macros:Page DOM node whose children should be sorted */ export declare function sortPageAggregationChildren(pageElement: Node): void; /** * Ensures a namespaced aggregation element exists in the XML document at the given aggregation path. * If the final segment (e.g. 'macros:items') is missing from the DOM, the parent node is located * via the path prefix and the element is inserted in place. This allows generateBuildingBlock to * handle missing aggregation containers in a single write pass, avoiding a separate commit. * * @param xmlDocument - The XML document to mutate * @param aggregationPath - Full XPath to the target aggregation (e.g. '/mvc:View/macros:Page/macros:items') */ export declare function ensureMissingAggregation(xmlDocument: Document, aggregationPath: string): void; /** * Appends a single Page building block aggregation template to an existing `` element in a view XML file. * * @param basePath - the base path of the application * @param config - the aggregation configuration containing aggregationName * @param [fs] - the memfs editor instance * @returns {Editor} the updated memfs editor instance */ export declare function generateBuildingBlockAggregation(basePath: string, config: GenerateBuildingBlockAggregationConfig, fs?: Editor): Promise; //# sourceMappingURL=processAggregation.d.ts.map