From 1d85e7ce982a979bb5411cd00fd9156eecf952a5 Mon Sep 17 00:00:00 2001 From: susiwen Date: Wed, 12 Feb 2020 23:07:09 +0800 Subject: [PATCH] Fix: acorn-walk type work with acorn's --- acorn-walk/dist/walk.d.ts | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/acorn-walk/dist/walk.d.ts b/acorn-walk/dist/walk.d.ts index f0e719e95..a02c0a186 100644 --- a/acorn-walk/dist/walk.d.ts +++ b/acorn-walk/dist/walk.d.ts @@ -1,21 +1,23 @@ +import acorn from 'acorn'; + declare module "acorn-walk" { - type NodeType = import("estree").Node["type"]; + type NodeType = acorn.Node["type"]; type DiscriminateUnion = T extends Record ? T : never; - type NarrowNode = DiscriminateUnion; + type NarrowNode = DiscriminateUnion; type FullWalkerCallback = ( - node: import("estree").Node, + node: acorn.Node, state: TState, type: NodeType ) => void; type FullAncestorWalkerCallback = ( - node: import("estree").Node, - state: TState | import("estree").Node[], - ancestors: import("estree").Node[], + node: acorn.Node, + state: TState | acorn.Node[], + ancestors: acorn.Node[], type: NodeType ) => void; - type WalkerCallback = (node: import("estree").Node, state: TState) => void; + type WalkerCallback = (node: acorn.Node, state: TState) => void; type SimpleWalkerFn = ( node: NarrowNode, @@ -24,8 +26,8 @@ declare module "acorn-walk" { type AncestorWalkerFn = ( node: NarrowNode, - state: TState| import("estree").Node[], - ancestors: import("estree").Node[] + state: TState| acorn.Node[], + ancestors: acorn.Node[] ) => void; type RecursiveWalkerFn = ( @@ -46,7 +48,7 @@ declare module "acorn-walk" { [Type in Types]: RecursiveWalkerFn }; - type FindPredicate = (type: NodeType, node: import("estree").Node) => boolean; + type FindPredicate = (type: NodeType, node: acorn.Node) => boolean; interface Found { node: NarrowNode, @@ -54,35 +56,35 @@ declare module "acorn-walk" { } export function simple( - node: import("estree").Node, + node: acorn.Node, visitors: SimpleVisitors, base?: RecursiveVisitors, state?: TState ): void; export function ancestor( - node: import("estree").Node, + node: acorn.Node, visitors: AncestorVisitors, base?: RecursiveVisitors, state?: TState ): void; export function recursive( - node: import("estree").Node, + node: acorn.Node, state: TState, functions: RecursiveVisitors, base?: RecursiveVisitors ): void; export function full( - node: import("estree").Node, + node: acorn.Node, callback: FullWalkerCallback, base?: RecursiveVisitors, state?: TState ): void; export function fullAncestor( - node: import("estree").Node, + node: acorn.Node, callback: FullAncestorWalkerCallback, base?: RecursiveVisitors, state?: TState @@ -94,7 +96,7 @@ declare module "acorn-walk" { ): RecursiveVisitors; export function findNodeAt( - node: import("estree").Node, + node: acorn.Node, start: number | undefined, end: number | undefined, type: K, @@ -103,7 +105,7 @@ declare module "acorn-walk" { ): Found | undefined; export function findNodeAt( - node: import("estree").Node, + node: acorn.Node, start: number | undefined, end: number | undefined, type?: FindPredicate,