UNPKG

@codemod-utils/ast-template

Version:

Utilities for handling *.hbs files as abstract syntax tree

29 lines (28 loc) 766 B
import { type AST as _AST, type NodeVisitor, print } from 'ember-template-recast'; declare function _traverse(): (file: string, visitMethods?: NodeVisitor) => _AST.Template; /** * Provides methods from `ember-template-recast` to help you parse * and transform `*.hbs` files. * * @example * * ```ts * import { AST } from '@codemod-utils/ast-template'; * * function transformCode(file: string): string { * const traverse = AST.traverse(); * * const ast = traverse(file, { * // Use AST.builders to transform the tree * }); * * return AST.print(ast); * } * ``` */ export declare const AST: { builders: import("ember-template-recast/lib/custom-nodes.js").Builders; print: typeof print; traverse: typeof _traverse; }; export {};