Bläddra i källkod

Thread type parameters for widget factory options through the code more.

Jason Grout 6 år sedan
förälder
incheckning
86022859df
2 ändrade filer med 6 tillägg och 4 borttagningar
  1. 3 1
      packages/fileeditor/src/widget.ts
  2. 3 3
      packages/notebook/src/widgetfactory.ts

+ 3 - 1
packages/fileeditor/src/widget.ts

@@ -355,6 +355,8 @@ export namespace FileEditorFactory {
     /**
      * The factory options associated with the factory.
      */
-    factoryOptions: DocumentRegistry.IWidgetFactoryOptions<IDocumentWidget<FileEditor>>;
+    factoryOptions: DocumentRegistry.IWidgetFactoryOptions<
+      IDocumentWidget<FileEditor>
+    >;
   }
 }

+ 3 - 3
packages/notebook/src/widgetfactory.ts

@@ -27,7 +27,7 @@ export class NotebookWidgetFactory extends ABCWidgetFactory<
    *
    * @param options - The options used to construct the factory.
    */
-  constructor(options: NotebookWidgetFactory.IOptions) {
+  constructor(options: NotebookWidgetFactory.IOptions<NotebookPanel>) {
     super(options);
     this.rendermime = options.rendermime;
     this.contentFactory =
@@ -98,8 +98,8 @@ export namespace NotebookWidgetFactory {
   /**
    * The options used to construct a `NotebookWidgetFactory`.
    */
-  export interface IOptions
-    extends DocumentRegistry.IWidgetFactoryOptions<NotebookPanel> {
+  export interface IOptions<T extends NotebookPanel>
+    extends DocumentRegistry.IWidgetFactoryOptions<T> {
     /*
       * A rendermime instance.
       */