From 10bc9fc21d369868ea82eb83f06b1c28dd5d929a Mon Sep 17 00:00:00 2001 From: Cerberuser Date: Tue, 22 May 2018 10:43:21 +0700 Subject: [PATCH] Added extensions usage for cytoscape --- types/cytoscape/index.d.ts | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 4da9cd9ca0..15df29a1f3 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -4527,4 +4527,23 @@ declare namespace cytoscape { */ promise(animationEvent?: "completed" | "complete" | "frame"): Promise; } -} + + /** + * Cytoscape extension type + * Definition of an extension would be in following form: + * @example + * declare module 'cytoscape-ext' { + * const ext: cytoscape.Ext; + * export = ext; + * } + */ + type Ext = (cytoscape: Function) => void; + /** + * Register imported extension into cytoscape + * @param module Entry point for the extension, got by module = require('cy-ext') + * or by import module from 'cy-ext' + * http://js.cytoscape.org/#extensions + */ + function use(module: Ext): void; + +} \ No newline at end of file