Procházet zdrojové kódy

More interface cleanup

Steven Silvester před 8 roky
rodič
revize
34e69674b2
2 změnil soubory, kde provedl 16 přidání a 34 odebrání
  1. 13 13
      src/notebook/cells/editor.ts
  2. 3 21
      src/notebook/notebook/panel.ts

+ 13 - 13
src/notebook/cells/editor.ts

@@ -32,22 +32,22 @@ interface ICoords extends JSONObject {
   /**
    * The left coordinate value.
    */
-  left: number;
+  readonly left: number;
 
   /**
    * The right coordinate value.
    */
-  right: number;
+  readonly right: number;
 
   /**
    * The top coordinate value.
    */
-  top: number;
+  readonly top: number;
 
   /**
    * The bottom coordinate value.
    */
-  bottom: number;
+  readonly bottom: number;
 }
 
 
@@ -59,32 +59,32 @@ interface IEditorState extends JSONObject {
   /**
    * The character number of the editor cursor within a line.
    */
-  ch: number;
+  readonly ch: number;
 
   /**
    * The height of a character in the editor.
    */
-  chHeight: number;
+  readonly chHeight: number;
 
   /**
    * The width of a character in the editor.
    */
-  chWidth: number;
+  readonly chWidth: number;
 
   /**
    * The line number of the editor cursor.
    */
-  line: number;
+  readonly line: number;
 
   /**
    * The coordinate position of the cursor.
    */
-  coords: ICoords;
+  readonly coords: ICoords;
 
   /**
    * The cursor position of the request, including line breaks.
    */
-  position: number;
+  readonly position: number;
 }
 
 
@@ -96,12 +96,12 @@ interface ITextChange extends IEditorState {
   /**
    * The old value of the editor text.
    */
-  oldValue: string;
+  readonly oldValue: string;
 
   /**
    * The new value of the editor text.
    */
-  newValue: string;
+  readonly newValue: string;
 }
 
 
@@ -113,7 +113,7 @@ interface ICompletionRequest extends IEditorState {
   /**
    * The current value of the editor text.
    */
-  currentValue: string;
+  readonly currentValue: string;
 }
 
 

+ 3 - 21
src/notebook/notebook/panel.ts

@@ -114,23 +114,20 @@ class NotebookPanel extends Widget {
   /**
    * A signal emitted when the panel has been activated.
    */
-  activated: ISignal<NotebookPanel, void>;
+  activated: ISignal<this, void>;
 
   /**
    * A signal emitted when the panel context changes.
    */
-  contextChanged: ISignal<NotebookPanel, void>;
+  contextChanged: ISignal<this, void>;
 
   /**
    * A signal emitted when the kernel used by the panel changes.
    */
-  kernelChanged: ISignal<NotebookPanel, IKernel>;
+  kernelChanged: ISignal<this, IKernel>;
 
   /**
    * Get the toolbar used by the widget.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
   get toolbar(): Toolbar {
     return (this.layout as PanelLayout).widgets.at(0) as Toolbar;
@@ -138,9 +135,6 @@ class NotebookPanel extends Widget {
 
   /**
    * Get the content area used by the widget.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
   get content(): Notebook {
     return this._content;
@@ -148,9 +142,6 @@ class NotebookPanel extends Widget {
 
   /**
    * Get the current kernel used by the panel.
-   *
-   * #### Notes
-   * This is a a read-only property.
    */
   get kernel(): IKernel {
     return this._context ? this._context.kernel : null;
@@ -158,9 +149,6 @@ class NotebookPanel extends Widget {
 
   /**
    * Get the rendermime instance used by the widget.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
   get rendermime(): RenderMime {
     return this._rendermime;
@@ -175,9 +163,6 @@ class NotebookPanel extends Widget {
 
   /**
    * Get the clipboard instance used by the widget.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
   get clipboard(): IClipboard {
     return this._clipboard;
@@ -185,9 +170,6 @@ class NotebookPanel extends Widget {
 
   /**
    * The model for the widget.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
   get model(): INotebookModel {
     return this._content ? this._content.model : null;