From de6edeb654cf665e732d822d95c97e2d2fc879bc Mon Sep 17 00:00:00 2001 From: susiwen8 Date: Fri, 14 Feb 2020 00:25:05 +0800 Subject: [PATCH] Remove NarrowNode from walk.d.ts --- acorn-walk/dist/walk.d.ts | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/acorn-walk/dist/walk.d.ts b/acorn-walk/dist/walk.d.ts index a02c0a186..f452bf75b 100644 --- a/acorn-walk/dist/walk.d.ts +++ b/acorn-walk/dist/walk.d.ts @@ -1,9 +1,7 @@ import acorn from 'acorn'; declare module "acorn-walk" { - type NodeType = acorn.Node["type"]; - type DiscriminateUnion = T extends Record ? T : never; - type NarrowNode = DiscriminateUnion; + type NodeType = acorn.Node["type"]; type FullWalkerCallback = ( node: acorn.Node, @@ -20,18 +18,18 @@ declare module "acorn-walk" { type WalkerCallback = (node: acorn.Node, state: TState) => void; type SimpleWalkerFn = ( - node: NarrowNode, + node: acorn.Node, state: TState ) => void; type AncestorWalkerFn = ( - node: NarrowNode, + node: acorn.Node, state: TState| acorn.Node[], ancestors: acorn.Node[] ) => void; type RecursiveWalkerFn = ( - node: NarrowNode, + node: acorn.Node, state: TState, callback: WalkerCallback ) => void; @@ -51,7 +49,7 @@ declare module "acorn-walk" { type FindPredicate = (type: NodeType, node: acorn.Node) => boolean; interface Found { - node: NarrowNode, + node: acorn.Node, state: TState }