import { Node, BaseNode, NodeT, NodeTypes } from './helpers'; import { TraverseOptions, Visitors } from './traverse'; import { Scope } from './scope'; import * as t from './generated/types'; import { NodePathDocs } from './nodepath-doc'; export declare class Context { /** * Don't depend on `pathCache` to get children, * because it may not be initialized when you call it */ pathCache: Map | null, Map>>; scopeCache: Map, Scope>; makeScope: boolean; shouldValidateNodes: boolean; cloneFunction: (node: any) => any; private currentSkipPaths; private readonly skipPathSetStack; /** Store newly added nodes to this queue for traversal */ private readonly queueStack; constructor(options?: TraverseOptions); setSkipped(path: NodePath): void; setNotSkipped(path: NodePath): void; shouldSkip(path: NodePath): boolean; private updateCurrentSkipPaths; newSkipPathStack(): void; restorePrevSkipPathStack(): void; pushToQueue(paths: NodePath[], stackName: keyof Context['queueStack'][number]): void; newQueue(): void; popQueue(): { new: NodePath[]; unSkipped: NodePath[]; }; } type Keys = Exclude; type PickKeysWithValue = { [K in keyof N]: N[K] extends Condition ? K : never; }[keyof N]; type NodePathData = { node: NodePath['node']; key: NodePath['key']; listKey: NodePath['listKey']; parentPath: NodePath['parentPath']; ctx: Context; }; export type NodePathT = NodePath, null extends P ? Node : NodeT>>; export declare class NodePath implements NodePathDocs { readonly node: T | null; readonly type: T['type'] | null; key: string | number | null; listKey: string | null; removed: boolean; readonly parentPath: NodePath

| null; readonly parent: P | null; readonly container: P | Node[] | null; readonly ctx: Context; scope: Scope | undefined | null; private constructor(); /** Get the cached NodePath object or create new if cache is not available */ static for(data: NodePathData): NodePath; init(parentScope?: Scope): this; protected throwNoParent(methodName: string): never; protected assertNotRemoved(): void; protected assertNotNull(methodName: string): void; get parentKey(): string | null; cloneNode(): T | null; skip(): void; skipChildren(): void; unSkip(): void; unskip(): void; unSkipChildren(): void; unskipChildren(): void; traverse(visitors: Visitors, state?: S): void; findParent(predicate: (path: NodePath) => boolean): NodePath | null; find(predicate: (path: NodePath) => boolean): NodePath | null; getFunctionParent(): NodePath | null; getAncestry(): NodePath[]; isAncestorOf(path: NodePath): boolean; isDescendantOf(path: NodePath): boolean; protected updateSiblingIndex(fromIndex: number, incrementBy: number): void; insertBefore(nodes: readonly Node[]): NodePath[]; insertAfter(nodes: readonly Node[]): NodePath[]; unshiftContainer>(listKey: K extends never ? string : K, nodes: Readonly): NodePath[]; pushContainer>(listKey: K extends never ? string : K, nodes: Readonly): NodePath[]; get>(key: K): T[K] extends (infer U | null)[] ? U extends Node ? NodePath[] : NodePath[] : T[K] extends Node ? NodePath : NodePath; get(key: string): unknown extends N ? NodePath | NodePath[] : N extends Node[] ? NodePath[] : N extends Node ? NodePath : NodePath; getSibling(key: string | number): NodePath | undefined | never; getOpposite(): NodePath | undefined; getPrevSibling(): NodePath | undefined | never; getNextSibling(): NodePath | undefined | never; getAllPrevSiblings(): NodePath[] | undefined | never; getAllNextSiblings(): NodePath[] | undefined | never; has(key: Keys extends never ? string : Keys): boolean; is(key: Keys extends never ? string : Keys): boolean; private onRemove; private markRemoved; remove(): void; replaceWith(node: N): NodePath; replaceWithMultiple(nodes: N): NodePath[]; } export {};