Skip to content

Commit 28c2edd

Browse files
committed
update docstrings
1 parent ae54abf commit 28c2edd

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

src/requests.ts

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,11 @@ import { Contents } from '@jupyterlab/services';
33
import { PathExt } from '@jupyterlab/coreutils';
44

55
import { requestAPI } from './handler';
6-
import { getFileType, IRegisteredFileTypes } from './token';
6+
import { getFileType, IRegisteredFileTypes, IContentsList } from './token';
77

8+
/**
9+
* The data contents model.
10+
*/
811
let data: Contents.IModel = {
912
name: '',
1013
path: '',
@@ -18,13 +21,9 @@ let data: Contents.IModel = {
1821
type: ''
1922
};
2023

21-
interface IContentsList {
22-
[fileName: string]: Contents.IModel;
23-
}
24-
2524
/**
2625
* Fetch the list of available drives.
27-
* @returns list of drives
26+
* @returns The list of available drives.
2827
*/
2928
export async function getDrivesList() {
3029
return await requestAPI<any>('drives', 'GET');
@@ -33,6 +32,8 @@ export async function getDrivesList() {
3332
/**
3433
* Mount a drive by establishing a connection with it.
3534
* @param driveName
35+
* @param options.provider The provider of the drive to be mounted.
36+
* @param options.region The region of the drive to be mounted.
3637
*/
3738
export async function mountDrive(
3839
driveName: string,
@@ -46,6 +47,15 @@ export async function mountDrive(
4647
return await requestAPI<any>('drives', 'POST', body);
4748
}
4849

50+
/**
51+
* Get contents of a directory or retrieve contents of a specific file.
52+
*
53+
* @param driveName
54+
* @param options.path The path of object to be retrived
55+
* @param options.path The list containing all registered file types.
56+
*
57+
* @returns A promise which resolves with the contents model.
58+
*/
4959
export async function getContents(
5060
driveName: string,
5161
options: { path: string; registeredFileTypes: IRegisteredFileTypes }

src/token.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Token } from '@lumino/coreutils';
2+
import { Contents } from '@jupyterlab/services';
23

34
/**
45
* A token for the plugin that provides the list of drives.
@@ -33,6 +34,13 @@ export interface IDriveInfo {
3334
mounted: boolean;
3435
}
3536

37+
/**
38+
* An interface for storing the contents of a directory.
39+
*/
40+
export interface IContentsList {
41+
[fileName: string]: Contents.IModel;
42+
}
43+
3644
/**
3745
* An interface that stores the registered file type, mimetype and format for each file extension.
3846
*/

0 commit comments

Comments
 (0)