From c7e213857e5fed133974b6a59ef65da7baa2e6c4 Mon Sep 17 00:00:00 2001 From: Sebastian Kropp Date: Tue, 7 Aug 2018 12:25:48 -0400 Subject: [PATCH] BFS returns void if search not successful return true if search has found the node return false if search is aborted before finding anything returns void/undefined if search should continue therefore return type is a union type of `=> boolean | void` --- types/cytoscape/index.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index c38acead19..59482ad507 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -2819,13 +2819,13 @@ declare namespace cytoscape { /** * The handler returns true when it finds the desired node, and it returns false to cancel the search. - * i - The index indicating this node is the ith visited node. - * depth - How many edge hops away this node is from the root nodes. * v - The current node. * e - The edge connecting the previous node to the current node. * u - The previous node. + * i - The index indicating this node is the ith visited node. + * depth - How many edge hops away this node is from the root nodes. */ - type SearchVisitFunction = (i: number, depth: number, v: NodeCollection, e: EdgeCollection, u: NodeCollection) => boolean; + type SearchVisitFunction = (v: NodeCollection, e: EdgeCollection, u: NodeCollection, i: number, depth: number) => boolean | void; interface SearchFirstOptions { /** * The root nodes (selector or collection) to start the search from.