Path: blob/master/node_modules/acorn-walk/dist/walk.d.ts
1126 views
import {Node} from 'acorn';12declare module "acorn-walk" {3type FullWalkerCallback<TState> = (4node: Node,5state: TState,6type: string7) => void;89type FullAncestorWalkerCallback<TState> = (10node: Node,11state: TState | Node[],12ancestors: Node[],13type: string14) => void;15type WalkerCallback<TState> = (node: Node, state: TState) => void;1617type SimpleWalkerFn<TState> = (18node: Node,19state: TState20) => void;2122type AncestorWalkerFn<TState> = (23node: Node,24state: TState| Node[],25ancestors: Node[]26) => void;2728type RecursiveWalkerFn<TState> = (29node: Node,30state: TState,31callback: WalkerCallback<TState>32) => void;3334type SimpleVisitors<TState> = {35[type: string]: SimpleWalkerFn<TState>36};3738type AncestorVisitors<TState> = {39[type: string]: AncestorWalkerFn<TState>40};4142type RecursiveVisitors<TState> = {43[type: string]: RecursiveWalkerFn<TState>44};4546type FindPredicate = (type: string, node: Node) => boolean;4748interface Found<TState> {49node: Node,50state: TState51}5253export function simple<TState>(54node: Node,55visitors: SimpleVisitors<TState>,56base?: RecursiveVisitors<TState>,57state?: TState58): void;5960export function ancestor<TState>(61node: Node,62visitors: AncestorVisitors<TState>,63base?: RecursiveVisitors<TState>,64state?: TState65): void;6667export function recursive<TState>(68node: Node,69state: TState,70functions: RecursiveVisitors<TState>,71base?: RecursiveVisitors<TState>72): void;7374export function full<TState>(75node: Node,76callback: FullWalkerCallback<TState>,77base?: RecursiveVisitors<TState>,78state?: TState79): void;8081export function fullAncestor<TState>(82node: Node,83callback: FullAncestorWalkerCallback<TState>,84base?: RecursiveVisitors<TState>,85state?: TState86): void;8788export function make<TState>(89functions: RecursiveVisitors<TState>,90base?: RecursiveVisitors<TState>91): RecursiveVisitors<TState>;9293export function findNodeAt<TState>(94node: Node,95start: number | undefined,96end?: number | undefined,97type?: FindPredicate | string,98base?: RecursiveVisitors<TState>,99state?: TState100): Found<TState> | undefined;101102export function findNodeAround<TState>(103node: Node,104start: number | undefined,105type?: FindPredicate | string,106base?: RecursiveVisitors<TState>,107state?: TState108): Found<TState> | undefined;109110export const findNodeAfter: typeof findNodeAround;111}112113114