export declare function isNode(maybeNode: any): maybeNode is Node; export declare function isElement(node: Node | null): node is Element; export declare function isElementWithTagName(node: Node | null, tagName: K): node is HTMLElementTagNameMap[K]; export declare function isHTMLOrSVGElement(node: Node | null): node is HTMLElement | SVGElement; export declare function isText(node: Node | null): node is Text; export declare function isComment(node: Node | null): node is Text; export declare function isFragment(node: Node | null): node is DocumentFragment; export declare function isChildNode(node: Node | null): node is Node & ChildNode; export declare function getStartNode(node: Node): (Node & ChildNode) | null; export declare function getEndNode(node: Node): (Node & ChildNode) | null; export declare function getChildNode(node: Node, index: number): (Node & ChildNode) | null; export declare function isWhitespaceText(node: Node): boolean; export declare function trimWhitespaceTextFromNode(node: Node): void; export declare function trimWhitespaceTextFromStartOfNode(node: Node): void; export declare function trimWhitespaceTextFromEndOfNode(node: Node): void; export declare function hasAncestor(node: Node, predicate: (ancestor: Node) => boolean, container: Node): boolean; export declare function findAncestor(node: Node, predicate: (ancestor: Node) => ancestor is T, container: Node): T | null; export declare function findAncestor(node: Node, predicate: (ancestor: Node) => boolean, container: Node): Node | null; export declare function findAncestorSiblings(range: Range, predicate: (ancestor: Node) => boolean, container: Node): { startAncestor: Node; endAncestor: Node; } | null; export declare function findNearestElement(node: Node, container: Element): Element; export declare function findNearestElement(node: Node, container: Node): Element | null; export declare function getNearestNonInlineAncestorElement(node: Node, container: Node): Element | null; export declare function findCommonAncestor(a: Node, b: Node, container: Node): Node | null; export declare function findNextNonWhitespaceSibling(node: Node): Node | null; export declare function findPreviousNonWhitespaceSibling(node: Node): Node | null; export declare function findNextChildOrSibling(node: Node, container: Node): Node | null; /** * Returns node's sibling or the next sibling of its first ancestor having a next sibling within container. * @param node * @param container */ export declare function findNextSibling(node: Node, container: Node): Node | null; export declare function findPreviousChildOrSibling(node: Node, container: Node): Node | null; export declare function findPreviousSibling(node: Node, container: Node): Node | null; export declare function getTextNodes(root: Node): Iterable; export declare function wrapNode(node: T, createElement: (document: Document) => U): T | U; export declare function removeAllChildren(node: Node): void; export declare function findNodeInRange(container: Node, range: Range, predicate: (node: Node) => T | null): T | null; export declare function findNodeInRange(container: Node, range: Range, predicate: (node: Node) => node is T): T | null; export declare function findNodeInRange(container: Node, range: Range, predicate: (node: Node) => boolean): Node | null; export declare function isTextLikeNode(node: Node | null): node is Text | HTMLBRElement; export declare function findFirstTextLikeNode(container: Node, startNode?: Node): Text | HTMLBRElement | null; export declare function findLastTextLikeNode(container: Node, startNode?: Node, maxIterations?: number): Text | HTMLBRElement | null; /** * This function can have unexpected behaviors because it won't return absolutely ALL nodes in range respecting condition: * - If a node is strictly included in the range and matches the condition we'll yield it. * Next considered node will be its sibling or the next sibling of its first ancestor having a next sibling. * Its child nodes will never be considered, so even if they match condition, they won't be returned. * - If a node is strictly included in range and does not match condition, we skip it. * Next considered node will be its first child, or its next sibling, or the next sibling of its first ancestor having a next sibling. * - If a node contains range's end (ie: is not strictly included in range: it starts in it, but ends out of it): * - If it respect condition and strictMode is set to false, we yield it, we skip it otherwise. * - Further candidate research domain is now restrained to this node. * - Next considered node will be its first child. * * @param container: container used to limit the search for next siblings. * @param range: range in which we'll look for nodes. * @param condition: condition a node need to match to be returned (it is a necessary condition but not a sufficient condition). * @param strictMode: determine if node intersecting with range's end is returned if it matchs condition */ export declare function getNodesIntersectingRange(container: Node, range: Range, condition: (node: Node) => node is T, strictMode?: boolean): Iterable; export declare function getNodesIntersectingRange(container: Node, range: Range, condition: (node: Node) => boolean, strictMode?: boolean): Iterable; export declare function getNodeContents(node: Node): DocumentFragment; export declare function unwrapNode(node: Node): void;