@openxmldev/linq-to-xml
Version:
LINQ to XML for TypeScript
35 lines (34 loc) • 1.57 kB
TypeScript
/**
* @author Thomas Barnekow
* @license MIT
*/
import { IterableValueTransform } from '@tsdotnet/linq/dist/IterableTransform.js';
import { XContainer, XElement, XName } from '../internal.js';
/**
* Returns a function that, for the elements of the source sequence passed to
* that function, returns the concatenated sequences of descendants of such
* elements in document order.
*
* If a name is provided, the resulting sequence contains only those ancestors
* having a matching name.
*
* @typeParam T The type of the elements contained in the source sequence.
* @param name The optional name used to filter the sequence of descendants.
* @returns A function that will return a flat sequence of descendants in
* document order.
*/
export declare function descendants<T extends XContainer>(name?: XName | null): IterableValueTransform<T, XElement>;
/**
* Returns a function that, for the elements of the source sequence passed to
* that function, returns the concatenated sequences of descendants of such
* elements, including the elements themselves, in document order.
*
* If a name is provided, the resulting sequence contains only those elements
* and descendants having a matching name.
*
* @param name The optional name used to filter the sequence of descendants
* and elements.
* @returns A function that will return a flat sequence of ancestors, including
* the elements, in document order.
*/
export declare function descendantsAndSelf(name?: XName | null): IterableValueTransform<XElement, XElement>;