import { ASTContent, ASTNode } from '@stridespark/model-core'; export interface TransformFunction { (content: null | (string | T)[]): T; } export interface TransformMap { [tag: string]: TransformFunction; } export declare function n(tag: string, content: ASTContent[]): ASTNode; export declare function isASTNode(content: ASTContent): content is ASTNode; /** * Reduce an ASTNode to a 'T' by bottoms-up applying the TransformFunction * specified by tag in the TransformMap (or the default) */ export declare function transform(node: ASTNode, transformMap: TransformMap): T; /** * Replaces any nodes (and their children) that match toRemove with toReplace. Will modify node. **/ export declare function replaceNode(node: ASTContent, toRemove: (node: ASTContent) => boolean, toReplace: ASTNode): ASTContent; /** * Return array of nodes (and their children) that match predicate. */ export declare function filter(node: ASTContent, predicate: (node: ASTNode) => boolean): ASTNode[]; export declare function retagNodes(node: ASTNode, replace: string[], replaceWith: string): ASTNode; //# sourceMappingURL=index.d.ts.map