Quellcode durchsuchen

Use the path tracker interface

Steven Silvester vor 8 Jahren
Ursprung
Commit
ebcff73513
2 geänderte Dateien mit 12 neuen und 5 gelöschten Zeilen
  1. 11 1
      src/filebrowser/model.ts
  2. 1 4
      src/filebrowser/tracker.ts

+ 11 - 1
src/filebrowser/model.ts

@@ -25,6 +25,10 @@ import {
   IChangedArgs
 } from '../common/interfaces';
 
+import {
+  IPathTracker
+} from './tracker';
+
 
 /**
  * An implementation of a file browser model.
@@ -34,7 +38,7 @@ import {
  * the current directory.  Supports `'../'` syntax.
  */
 export
-class FileBrowserModel implements IDisposable {
+class FileBrowserModel implements IDisposable, IPathTracker {
   /**
    * Construct a new file browser model.
    */
@@ -157,6 +161,8 @@ class FileBrowserModel implements IDisposable {
 
   /**
    * Refresh the current directory.
+   *
+   * @returns A promise that resolves when the action is complete.
    */
   refresh(): Promise<void> {
     return this.cd('.').catch(error => {
@@ -313,6 +319,10 @@ class FileBrowserModel implements IDisposable {
 
   /**
    * Shut down a session by session id.
+   *
+   * @param id - The id of the session.
+   *
+   * @returns A promise that resolves when the action is complete.
    */
   shutdown(id: string): Promise<void> {
     return this._manager.sessions.shutdown(id);

+ 1 - 4
src/filebrowser/tracker.ts

@@ -35,9 +35,6 @@ interface IPathTracker {
 
   /**
    * The current path of the filebrowser.
-   *
-   * #### Notes
-   * This is a read-only property.
    */
-  path: string;
+  readonly path: string;
 }