index.d.ts 630 B

12345678910111213141516171819202122
  1. // Type definitions for estraverse
  2. // Project: https://github.com/estools/estraverse
  3. // Definitions by: Sanex3339 <https://github.com/sanex3339>
  4. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
  5. declare module 'estraverse' {
  6. export interface Visitor {
  7. enter?: (node: any, parentNode: any) => any;
  8. leave?: (node: any, parentNode: any) => any;
  9. fallback?: string;
  10. keys?: {};
  11. }
  12. export enum VisitorOption {
  13. Skip, Break, Remove
  14. }
  15. export function traverse (ast: any, visitor: Visitor): any;
  16. export function replace (ast: any, visitor: Visitor): any;
  17. }