astx
Version:
super powerful structural search and replace for JavaScript and TypeScript to automate your refactoring
26 lines (25 loc) • 1.75 kB
TypeScript
import { CompileOptions, CompiledMatcher } from '.';
import { Node, NodePath, NodeType } from '../types';
import { Backend } from '../backend/Backend';
export declare function unescapeIdentifier(identifier: string): string;
export declare function getPlaceholder(identifier: string): string | undefined;
export declare function getArrayPlaceholder(identifier: string): string | undefined;
export declare function getRestPlaceholder(identifier: string): string | undefined;
export declare function isPlaceholder(identifier: string): string | undefined;
export declare function isCapturePlaceholder(identifier: string): boolean;
export declare function compileArrayPlaceholderMatcher(pattern: NodePath, identifier: string, compileOptions: CompileOptions, otherOptions?: {
nodeType?: NodeType | NodeType[];
condition?: (path: NodePath) => boolean;
}): CompiledMatcher | void;
export declare function compileRestPlaceholderMatcher(pattern: NodePath, identifier: string, compileOptions: CompileOptions, otherOptions?: {
nodeType?: NodeType | NodeType[];
condition?: (path: NodePath) => boolean;
}): CompiledMatcher | void;
export declare function capturesAreEquivalent(backend: Backend, a: Node, b: Node): boolean;
export default function compilePlaceholderMatcher(pattern: NodePath, identifier: string, compileOptions: CompileOptions, otherOptions?: {
nodeType?: NodeType | NodeType[];
getCondition?: () => ((path: NodePath) => boolean) | undefined;
}): CompiledMatcher | void;
export declare function compileStringPlaceholderMatcher<N extends Node>(pattern: NodePath<N>, getString: (node: N) => string | null, compileOptions: CompileOptions, otherOptions?: {
nodeType?: NodeType | NodeType[];
}): CompiledMatcher | void;