index.d.ts 515 B

123456789101112131415161718192021222324252627
  1. declare module "estree-walker" {
  2. export interface Node {
  3. start: number;
  4. end: number;
  5. type: string;
  6. [propName: string]: any;
  7. }
  8. export type WalkerContext = {
  9. skip: () => void;
  10. };
  11. export type WalkerListener = (
  12. this: WalkerContext,
  13. node: Node,
  14. parent?: Node,
  15. prop?: string,
  16. index?: number
  17. ) => void;
  18. export interface WalkerOptions {
  19. enter?: WalkerListener;
  20. leave?: WalkerListener;
  21. }
  22. export function walk(ast: Node, options: WalkerOptions): void;
  23. }