declare type ApparatusGenerator = () => void; declare type NodeGenerator = (e: Element) => number[]; export declare type CollationRule = { [name: string]: [NodeGenerator, CollationRule] | NodeGenerator; }; /** * Collator for multiple (TEI-like) XML documents. */ export declare class XMLCollator { rule: CollationRule; appGenerator: ApparatusGenerator; documents: Document[] | undefined; gapOpen: number; gapExt: number; accumulativeTags: string[]; constructor(rule: CollationRule, appGenerator: ApparatusGenerator); /** * Sets the penalty for opening a new gap in the alignment * (rather than aligning it to a non-equal value) * @param gapOpen negative number */ setGapOpen(gapOpen: number): void; /** * Sets the penalty for extending an existing gap in the alignment * process. * @param gapExt negative number */ setGapExt(gapExt: number): void; /** * * @returns the result of alignment as a DOM object */ dom(): Document | undefined; accumulateTag(tagName: string): void; /** * collates multiple TEI-like documents. The result can * later be retrieved using e.g. the serialize() method. * * @param docs set of XML documents to collate */ collate(docs: Document[]): void; /** * Internal method. It recursively iterates over the * user-defined rules and tries to apply them to the given * DOM elements. It functions accumulative: The first document * will be expanded with the readings from the other documents. * * @param rule the current rule to apply * @param contexts the DOM elements to apply the rule to */ private applyRule; } export {};