Jelajahi Sumber

More cleanup

Steven Silvester 8 tahun lalu
induk
melakukan
28629732c8

+ 1 - 0
src/codeeditor/editor.ts

@@ -17,6 +17,7 @@ import {
   IObservableString
 } from '../common/observablestring';
 
+
 /**
  * A namespace for code editors.
  *

+ 1 - 2
src/codeeditor/factory.ts

@@ -5,12 +5,12 @@ import {
   CodeEditor
 } from './editor';
 
+
 /**
  * The editor factory interface.
  */
 export
 interface IEditorFactory {
-
   /**
    * Create a new editor for inline code.
    */
@@ -20,5 +20,4 @@ interface IEditorFactory {
    * Create a new editor for a full document.
    */
   newDocumentEditor(host: HTMLElement, options: CodeEditor.IOptions): CodeEditor.IEditor;
-
 }

+ 3 - 0
src/codeeditor/index.ts

@@ -18,6 +18,7 @@ export * from './widget';
 export * from './factory';
 export * from './mimetype';
 
+
 /* tslint:disable */
 /**
  * Code editor services token.
@@ -26,6 +27,7 @@ export
 const IEditorServices = new Token<IEditorServices>('jupyter.services.editorservices');
 /* tslint:enable */
 
+
 /**
  * Code editor services.
  */
@@ -35,6 +37,7 @@ interface IEditorServices {
    * The code editor factory.
    */
   readonly factory: IEditorFactory;
+
   /**
    * The editor mime type service.
    */

+ 16 - 5
src/codeeditor/mimetype.ts

@@ -5,27 +5,38 @@ import {
   nbformat
 } from '@jupyterlab/services';
 
+
 /**
  * The mime type service of a code editor.
  */
 export
 interface IEditorMimeTypeService {
   /**
-   * Returns a mime type for the given language info.
-   * 
+   * Get a mime type for the given language info.
+   *
+   * @param info - The language information.
+   *
+   * @returns A valid mimetype.
+   *
    * #### Notes
-   * If a mime type cannot be found returns the defaul mime type `text/plain`, never `null`.  
+   * If a mime type cannot be found returns the defaul mime type `text/plain`, never `null`.
    */
   getMimeTypeByLanguage(info: nbformat.ILanguageInfoMetadata): string;
+
   /**
-   * Returns a mime type for the given file path.
-   * 
+   * Get a mime type for the given file path.
+   *
+   * @param filePath - The full path to the file.
+   *
+   * @returns A valid mimetype.
+   *
    * #### Notes
    * If a mime type cannot be found returns the defaul mime type `text/plain`, never `null`.
    */
   getMimeTypeByFilePath(filePath: string): string;
 }
 
+
 /**
  * A namespace for `IEditorMimeTypeService`.
  */

+ 16 - 5
src/codeeditor/widget.ts

@@ -13,12 +13,17 @@ import {
   CodeEditor
 } from './';
 
+
 /**
  * A widget which hosts a code editor.
  */
 export
 class CodeEditorWidget extends Widget {
-
+  /**
+   * Construct a new code editor widget.
+   *
+   * @param editorFactory - The factory used to create a code editor.
+   */
   constructor(editorFactory: (host: Widget) => CodeEditor.IEditor) {
     super();
     this._editor = editorFactory(this);
@@ -26,9 +31,6 @@ class CodeEditorWidget extends Widget {
 
   /**
    * Get the editor wrapped by the widget.
-   *
-   * #### Notes
-   * This is a ready-only property.
    */
    get editor(): CodeEditor.IEditor {
     return this._editor;
@@ -102,6 +104,16 @@ class CodeEditorWidget extends Widget {
     this._needsRefresh = true;
   }
 
+  /**
+   * Handle the DOM events for the widget.
+   *
+   * @param event - The DOM event sent to the widget.
+   *
+   * #### Notes
+   * This method implements the DOM `EventListener` interface and is
+   * called in response to events on the panel's DOM node. It should
+   * not be called directly by user code.
+   */
   handleEvent(event: Event): void {
     switch (event.type) {
     case 'focus':
@@ -125,5 +137,4 @@ class CodeEditorWidget extends Widget {
   private _editor: CodeEditor.IEditor = null;
   private _needsRefresh = true;
   private _resizing = -1;
-
 }