ngx-i18nsupport-lib
Version:
A Typescript library to work with Angular generated i18n files (xliff, xmb)
75 lines (74 loc) • 2.44 kB
TypeScript
/**
* Created by martin on 01.05.2017.
* Some Tool functions for XML Handling.
*/
export declare class DOMUtilities {
/**
* return the first subelement with the given tag.
* @param element
* @param tagName
* @return {Element} subelement or null, if not existing.
*/
static getFirstElementByTagName(element: Element | Document, tagName: string): Element;
/**
* return an element with the given tag and id attribute.
* @param element
* @param tagName
* @param id
* @return {Element} subelement or null, if not existing.
*/
static getElementByTagNameAndId(element: Element | Document, tagName: string, id: string): Element;
/**
* Get next sibling, that is an element.
* @param element
*/
static getElementFollowingSibling(element: Element): Element;
/**
* Get previous sibling, that is an element.
* @param element
*/
static getElementPrecedingSibling(element: Element): Element;
/**
* return content of element as string, including all markup.
* @param element
* @return {string}
*/
static getXMLContent(element: Element): string;
/**
* return PCDATA content of element.
* @param element
* @return {string}
*/
static getPCDATA(element: Element): string;
/**
* replace PCDATA content with a new one.
* @param element
* @param pcdata
*/
static replaceContentWithXMLContent(element: Element, pcdata: string): void;
/**
* find the previous sibling that is an element.
* @param {Node} element
* @return {Element}
*/
static getPreviousElementSibling(element: Node): Element;
/**
* Create an Element Node that is the next sibling of a given node.
* @param elementNameToCreate
* @param {Node} previousSibling
* @return {Element}
*/
static createFollowingSibling(elementNameToCreate: string, previousSibling: Node): Element;
/**
* Insert newElement directly after previousSibling.
* @param newElement
* @param previousSibling
*/
static insertAfter(newElement: Node, previousSibling: Node): Node;
/**
* Insert newElement directly before nextSibling.
* @param newElement
* @param nextSibling
*/
static insertBefore(newElement: Node, nextSibling: Node): Node;
}