From c67f9444e85978f438bee8744cfa34fe467fa5c6 Mon Sep 17 00:00:00 2001 From: Cerberuser Date: Fri, 1 Jun 2018 16:28:14 +0700 Subject: [PATCH] Fix for CollectionElements --- types/cytoscape/cytoscape-tests.ts | 14 ++++++++++++++ types/cytoscape/index.d.ts | 3 +-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts index 0b7bac436e..25d6151259 100644 --- a/types/cytoscape/cytoscape-tests.ts +++ b/types/cytoscape/cytoscape-tests.ts @@ -80,3 +80,17 @@ cy.on('zoom', (event) => { cy.nodes('$node > node').style('opacity', 0); } }); + +cy.animate({ + fit: { + padding: 10, + eles: cy.nodes() + }, + duration: 500 +}); + +const node = cy.nodes()[0]; +cy.animate({ + center: {eles: node}, + duration: 500 +}); diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 18c3c0d1b5..e85041861a 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -1127,8 +1127,7 @@ declare namespace cytoscape { /** * The output is a collection of node and edge elements OR single element. */ - interface CollectionElements extends - EdgeCollection, NodeCollection, SingularElement { } + type CollectionElements = EdgeCollection | NodeCollection | SingularElement; /** * edges -> Cy.EdgeCollection