diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts index 37f66481f5..f2e1f64054 100644 --- a/types/cytoscape/cytoscape-tests.ts +++ b/types/cytoscape/cytoscape-tests.ts @@ -634,3 +634,20 @@ cy.elements(':grabbable').dfs({ roots: '#1' }); // TODO: traversing (need to actively check the nodes/edges distinction) // TODO: algorithms // TODO: compound nodes (there aren't any in current test case) + +// Check eles.boundingBox return type: https://js.cytoscape.org/#eles.boundingBox +const box1 = eles.boundingBox({}); +box1.x1; +box1.x2; +box1.y1; +box1.y2; +box1.w; +box1.h; +// Check eles.renderedBoundingBox return type: https://js.cytoscape.org/#eles.renderedBoundingBox +const box2 = eles.renderedBoundingBox({}); +box2.x1; +box2.x2; +box2.y1; +box2.y2; +box2.w; +box2.h; diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 33643367e4..76235bfae8 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1812,14 +1812,14 @@ declare namespace cytoscape { * @param options An object containing options for the function. * http://js.cytoscape.org/#eles.boundingBox */ - boundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; - boundingbox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + boundingBox(options: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH; + boundingbox(options: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH; /** * Get the bounding box of the elements in rendered coordinates. * @param options An object containing options for the function. */ - renderedBoundingBox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; - renderedBoundingbox(options: BoundingBoxOptions): BoundingBox12 | BoundingBoxWH; + renderedBoundingBox(options: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH; + renderedBoundingbox(options: BoundingBoxOptions): BoundingBox12 & BoundingBoxWH; } /**