import { NodeType, NodePath, Node, Debugger } from '../types'; import * as t from 'ast-types'; import { Backend } from '../backend/Backend'; export declare type RootCompileOptions = { where?: { [captureName: string]: (path: NodePath) => boolean; }; debug?: Debugger; backend: Backend; }; export declare type CompileOptions = { where?: { [captureName: string]: (path: NodePath) => boolean; }; debug: Debugger; backend: Backend; }; export declare type Captures = Record; export declare type ArrayCaptures = Record; export declare type StringCaptures = Record; export declare type MatchResult = { captures?: Captures; arrayCaptures?: ArrayCaptures; stringCaptures?: StringCaptures; } | null; export declare function mergeCaptures(...results: MatchResult[]): MatchResult; export declare type PredicateMatcher = { match: (path: NodePath, matchSoFar: MatchResult) => boolean; nodeType?: keyof typeof t.namedTypes | (keyof typeof t.namedTypes)[]; }; export interface CompiledMatcher { pattern: NodePath | NodePath[]; optional?: true; placeholder?: string; arrayPlaceholder?: string; restPlaceholder?: string; flag?: '$Ordered' | '$Unordered'; match: (path: NodePath, matchSoFar: MatchResult) => MatchResult; nodeType?: NodeType | NodeType[]; } export declare function convertPredicateMatcher(pattern: NodePath, matcher: PredicateMatcher, { debug }: CompileOptions): CompiledMatcher; export default function compileMatcher(path: NodePath, rootCompileOptions: RootCompileOptions): CompiledMatcher;