Bladeren bron

Refactor clipboard plugin to have token and interface defined in implementation instead of in plugin.

Afshin Darian 8 jaren geleden
bovenliggende
commit
5385f1089b
3 gewijzigde bestanden met toevoegingen van 27 en 20 verwijderingen
  1. 23 0
      src/clipboard/index.ts
  2. 3 19
      src/clipboard/plugin.ts
  3. 1 1
      src/notebook/plugin.ts

+ 23 - 0
src/clipboard/index.ts

@@ -1,6 +1,29 @@
 // Copyright (c) Jupyter Development Team.
 // Distributed under the terms of the Modified BSD License.
 
+import {
+  MimeData
+} from 'phosphor/lib/core/mimedata';
+
+import {
+  Token
+} from 'phosphor/lib/core/token';
+
+/* tslint:disable */
+/**
+ * The clipboard token.
+ */
+export
+const IClipboard = new Token<IClipboard>('jupyter.services.clipboard');
+/* tslint:enable */
+
+
+/**
+ * The clipboard interface.
+ */
+export
+interface IClipboard extends MimeData {}
+
 /**
  * Copy text to the system clipboard.
  *

+ 3 - 19
src/clipboard/plugin.ts

@@ -5,29 +5,13 @@ import {
   MimeData
 } from 'phosphor/lib/core/mimedata';
 
-import {
-  Token
-} from 'phosphor/lib/core/token';
-
 import {
   JupyterLabPlugin
 } from '../application';
 
-
-/* tslint:disable */
-/**
- * The clipboard token.
- */
-export
-const IClipboard = new Token<IClipboard>('jupyter.services.clipboard');
-/* tslint:enable */
-
-
-/**
- * The clipboard interface.
- */
-export
-interface IClipboard extends MimeData {}
+import {
+  IClipboard
+} from './';
 
 
 /**

+ 1 - 1
src/notebook/plugin.ts

@@ -15,7 +15,7 @@ import {
 
 import {
   IClipboard
-} from '../clipboard/plugin';
+} from '../clipboard';
 
 import {
   ICommandPalette