Quellcode durchsuchen

Redo the typings for the shims for old-style Comms

Jason Grout vor 9 Jahren
Ursprung
Commit
a8a6c6275d
2 geänderte Dateien mit 10 neuen und 5 gelöschten Zeilen
  1. 2 2
      src/notebook/widgetmanager.ts
  2. 8 3
      typings/widgets.d.ts

+ 2 - 2
src/notebook/widgetmanager.ts

@@ -3,7 +3,7 @@
 'use strict';
 
 import {
-    ManagerBase, Comm//, shims
+    ManagerBase, shims
 } from 'jupyter-js-widgets';
 
 //require('jupyter-js-widgets/static/components/bootstrap/css/bootstrap.css')
@@ -36,7 +36,7 @@ class WidgetManager extends ManagerBase {
         // Convert jupyter-js-services comm to old comm
         // so that widget models use it compatibly
         
-        let oldComm = new Comm(comm);
+        let oldComm = new shims.services.Comm(comm);
         return super.handle_comm_open(oldComm, msg);        
     };
 

+ 8 - 3
typings/widgets.d.ts

@@ -4,10 +4,15 @@
 declare module Widgets {
     export class ManagerBase {
         display_view(msg: any, view: any, options: any): Promise<any>;
-        handle_comm_open(comm: Comm, msg: any): Promise<any>;
+        handle_comm_open(comm: shims.services.Comm, msg: any): Promise<any>;
     }
-    export class Comm {
-        constructor(comm: any);
+    
+    export module shims {
+        export module services {
+            export class Comm {
+                constructor(comm: any);
+            }            
+        }
     }
 }