@openxmldev/linq-to-xml
Version:
LINQ to XML for TypeScript
44 lines (43 loc) • 1.3 kB
TypeScript
/**
* @author Thomas Barnekow
* @license MIT
*/
import { LinqElements, XName, XObject } from './internal.js';
/**
* Represents an XML node.
*/
export declare abstract class XNode extends XObject {
protected constructor();
/**
* Gets the next sibling node of this node.
*
* If this node does not have a parent, or if there is no next node,
* then this property returns null.
*/
get nextNode(): XNode | null;
/**
* Gets the previous sibling node of this node.
*
* If this property does not have a parent, or if there is no previous node,
* then this property returns null.
*/
get previousNode(): XNode | null;
/**
* Returns the collection of the ancestor elements for this node.
*
* @param name The optional name of the ancestor elements to find.
* @returns The ancestor elements of this node.
*/
ancestors(name?: XName | null): LinqElements;
/**
* Removes this `XNode` from the underlying XML tree.
*/
remove(): void;
/**
* Replaces this node with the specified content.
*
* @param content Content that replaces this node.
*/
replaceWith(...content: any[]): void;
private getParentXContainerOrThrow;
}