From 38cf733222102bd30f73f0f2862ff1233952ab0a Mon Sep 17 00:00:00 2001 From: Ryan Petrich Date: Mon, 11 Jun 2018 02:20:14 -0400 Subject: [PATCH] babel-traverse: Denote proper return types for getFunctionParent/getStatementParent and add missing getAllPrevSiblings/getAllNextSiblings --- types/babel-traverse/index.d.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/types/babel-traverse/index.d.ts b/types/babel-traverse/index.d.ts index 738f60f3df..c3d7b1d819 100644 --- a/types/babel-traverse/index.d.ts +++ b/types/babel-traverse/index.d.ts @@ -374,10 +374,10 @@ export class NodePath { find(callback: (path: NodePath) => boolean): NodePath; /** Get the parent function of the current path. */ - getFunctionParent(): NodePath; + getFunctionParent(): NodePath; /** Walk up the tree until we hit a parent node path in a list. */ - getStatementParent(): NodePath; + getStatementParent(): NodePath; /** * Get the deepest common ancestor and then from it, get the earliest relationship path @@ -584,7 +584,9 @@ export class NodePath { getCompletionRecords(): NodePath[]; - getSibling(key: string): NodePath; + getSibling(key: string | number): NodePath; + getAllPrevSiblings(): NodePath[]; + getAllNextSiblings(): NodePath[]; get(key: string, context?: boolean | TraversalContext): NodePath;