Kaynağa Gözat

update doc registry for TS 2.4

S. Chris Colbert 7 yıl önce
ebeveyn
işleme
a1180bf4f5
1 değiştirilmiş dosya ile 15 ekleme ve 1 silme
  1. 15 1
      packages/docregistry/src/default.ts

+ 15 - 1
packages/docregistry/src/default.ts

@@ -574,7 +574,7 @@ class MimeRendererFactory extends ABCWidgetFactory<MimeRenderer, DocumentRegistr
    * Construct a new markdown widget factory.
    */
   constructor(options: MimeRendererFactory.IOptions) {
-    super({ ...options, readOnly: true });
+    super(Private.createRegistryOptions(options));
     this._rendermime = options.rendermime;
     this._mimeType = options.mimeType;
     this._renderTimeout = options.renderTimeout || 1000;
@@ -649,3 +649,17 @@ namespace MimeRendererFactory {
     dataType?: 'string' | 'json';
   }
 }
+
+
+/**
+ * The namespace for the module implementation details.
+ */
+namespace Private {
+  /**
+   * Create the document registry options.
+   */
+  export
+  function createRegistryOptions(options: MimeRendererFactory.IOptions): DocumentRegistry.IWidgetFactoryOptions {
+    return { ...options, readOnly: true } as DocumentRegistry.IWidgetFactoryOptions;
+  }
+}