浏览代码

Add types to DocumentRegistry activity monitors

Jeremy Tuloup 5 年之前
父节点
当前提交
2a7b371aad

+ 4 - 1
packages/csvviewer/src/widget.ts

@@ -366,7 +366,10 @@ export class CSVViewer extends Widget {
   private _context: DocumentRegistry.Context;
   private _grid: DataGrid;
   private _searchService: GridSearchService;
-  private _monitor: ActivityMonitor<any, any> | null = null;
+  private _monitor: ActivityMonitor<
+    DocumentRegistry.IModel,
+    void
+  > | null = null;
   private _delimiter = ',';
   private _revealed = new PromiseDelegate<void>();
 }

+ 1 - 1
packages/docregistry/src/mimedocument.ts

@@ -199,7 +199,7 @@ export class MimeContent extends Widget {
 
   private _context: DocumentRegistry.IContext<DocumentRegistry.IModel>;
   private _fragment = '';
-  private _monitor: ActivityMonitor<any, any> | null;
+  private _monitor: ActivityMonitor<DocumentRegistry.IModel, void> | null;
   private _ready = new PromiseDelegate<void>();
   private _dataType: 'string' | 'json';
   private _isRendering = false;

+ 4 - 1
packages/htmlviewer/src/index.tsx

@@ -203,7 +203,10 @@ export class HTMLViewer extends DocumentWidget<IFrame>
 
   private _renderPending = false;
   private _parser = new DOMParser();
-  private _monitor: ActivityMonitor<any, any> | null = null;
+  private _monitor: ActivityMonitor<
+    DocumentRegistry.IModel,
+    void
+  > | null = null;
   private _objectUrl: string = '';
   private _trustedChanged = new Signal<this, boolean>(this);
 }

+ 1 - 1
packages/markdownviewer/src/widget.ts

@@ -204,7 +204,7 @@ export class MarkdownViewer extends Widget {
 
   private _config = { ...MarkdownViewer.defaultConfig };
   private _fragment = '';
-  private _monitor: ActivityMonitor<any, any> | null;
+  private _monitor: ActivityMonitor<DocumentRegistry.IModel, void> | null;
   private _ready = new PromiseDelegate<void>();
   private _isRendering = false;
   private _renderRequested = false;