import { Node } from "./model"; import { walk } from "../traversing/structurally"; import { Issue } from "../validation"; declare module './model' { interface Node { /** * Finds the first node that satisfies a condition among this node's descendants. * @param predicate the function expressing the condition that the node must satisfy. * @param walker the function that generates the nodes to operate on in the desired sequence. By default, this * is a depth-first traversal that includes the node on which find() has been called. * @return the first node in the AST for which the predicate is true. Returns undefined if none are found. */ find(predicate: (n: Node, index: number) => boolean, walker?: typeof walk): Node | undefined; hasValidParents(parent?: Node): boolean; invalidPositions(): Generator; } } /** * Finds the first node that satisfies a condition among a node's descendants. * @param startingNode the node which is the root of the subtree. * @param predicate the function expressing the condition that the node must satisfy. * @param walker the function that generates the nodes to operate on in the desired sequence. By default, this is a * depth-first traversal that includes the starting node. * @return the first node in the AST for which the predicate is true. Returns undefined if none are found. */ export declare function find(startingNode: Node, predicate: (n: Node, index: number) => boolean, walker?: typeof walk): Node | undefined; /** * Sets or corrects the parent of all AST nodes. * Kolasu does not see set/add/delete operations on the AST nodes, * so this function should be called manually after modifying the AST. */ export declare function assignParents(node: Node): void; export declare class CodeProcessingResult { readonly code: string; readonly data: D | undefined; readonly issues: Issue[]; constructor(code: string, data: D | undefined, issues: Issue[]); get correct(): boolean; }