@@ -3,7 +3,7 @@ declare module "file-system" {
33
44 import promises = require( "promises/promises" ) ;
55
6- class FileSystemEntity {
6+ export class FileSystemEntity {
77 /**
88 * Gets the Date object specifying the last time this entity was modified.
99 */
@@ -33,62 +33,71 @@ declare module "file-system" {
3333
3434 /**
3535 * Renames the current entity using the specified name.
36+ * @param newName The new name to be applied to the entity.
3637 */
3738 public rename ( newName : string ) : promises . Promise < any > ;
3839 }
3940
40- class File extends FileSystemEntity {
41+ export class File extends FileSystemEntity {
4142 /**
42- * Checks whether a File with the specified path already exists.
43- */
43+ * Checks whether a File with the specified path already exists.
44+ * @param path The path to check for.
45+ */
4446 public static exists ( path : string ) : boolean ;
4547
4648 /**
47- * Gets the extension of the file.
48- */
49+ * Gets the extension of the file.
50+ */
4951 public extension : string ;
5052
5153 /**
52- * Gets a value indicating whether the file is currently locked, meaning a background operation associated with this file is running.
53- */
54+ * Gets a value indicating whether the file is currently locked, meaning a background operation associated with this file is running.
55+ */
5456 public isLocked : boolean ;
5557
5658 /**
57- * Gets or creates a File entity at the specified path.
58- */
59+ * Gets or creates a File entity at the specified path.
60+ * @param path The path to get/create the file at.
61+ */
5962 public static fromPath ( path : string ) : File ;
6063
6164 /**
62- * Reads the content of the file as a string using the specified encoding (defaults to UTF-8).
63- */
65+ * Reads the content of the file as a string using the specified encoding (defaults to UTF-8).
66+ * @param encoding An optional value specifying the preferred encoding (defaults to UTF-8).
67+ */
6468 public readText ( encoding ?: string ) : promises . Promise < string > ;
6569
6670 /**
67- * Writes the provided string to the file, using the specified encoding (defaults to UTF-8).
68- */
71+ * Writes the provided string to the file, using the specified encoding (defaults to UTF-8).
72+ * @param content The content to be saved to the file.
73+ * @param encoding An optional value specifying the preferred encoding (defaults to UTF-8).
74+ */
6975 public writeText ( content : string , encoding ?: string ) : promises . Promise < any > ;
7076 }
7177
72- class Folder extends FileSystemEntity {
78+ export class Folder extends FileSystemEntity {
7379 /**
74- * Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
75- */
80+ * Determines whether this instance is a KnownFolder (accessed through the KnownFolders object).
81+ */
7682 public isKnown : boolean ;
7783
7884 /**
79- * Gets or creates a Folder entity at the specified path.
80- */
85+ * Gets or creates a Folder entity at the specified path.
86+ * @param path The path to get/create the folder at.
87+ */
8188 public static fromPath ( path : string ) : Folder ;
8289
8390 /**
84- * Checks whether a Folder with the specified path already exists.
85- */
91+ * Checks whether a Folder with the specified path already exists.
92+ * @param path The path to check for.
93+ */
8694 public static exists ( path : string ) : boolean ;
8795
8896 /**
89- Checks whether this Folder contains an Entity with the specified name.
90- The path of the folder is added to the name to resolve the complete path to check for.
91- */
97+ * Checks whether this Folder contains an Entity with the specified name.
98+ * The path of the folder is added to the name to resolve the complete path to check for.
99+ * @param name The name of the entity to check for.
100+ */
92101 public contains ( name : string ) : boolean ;
93102
94103 /**
@@ -97,12 +106,14 @@ declare module "file-system" {
97106 public clear ( ) : promises . Promise < any > ;
98107
99108 /**
100- * Gets or creates a File entity with the specified name within this Folder.
101- */
109+ * Gets or creates a File entity with the specified name within this Folder.
110+ * @param name The name of the file to get/create.
111+ */
102112 public getFile ( name : string ) : File ;
103113
104114 /**
105115 * Gets or creates a Folder entity with the specified name within this Folder.
116+ * @param name The name of the folder to get/create.
106117 */
107118 public getFolder ( name : string ) : Folder ;
108119
@@ -112,17 +123,16 @@ declare module "file-system" {
112123 public getEntities ( ) : promises . Promise < Array < FileSystemEntity > > ;
113124
114125 /**
115- Enumerates all the top-level FileSystem entities residing within this folder.
116- The first parameter is a callback that receives the current entity.
117- If the callback returns false this will mean for the iteration to stop.
126+ * Enumerates all the top-level FileSystem entities residing within this folder.
127+ * @param onEntity A callback that receives the current entity. If the callback returns false this will mean for the iteration to stop.
118128 */
119129 public eachEntity ( onEntity : ( entity : FileSystemEntity ) => boolean ) ;
120130 }
121131
122132 /**
123- * Provides access to the top-level Folders instances that are accessible from the application. Use these as entry points to access the FileSystem.
124- */
125- module knownFolders {
133+ * Provides access to the top-level Folders instances that are accessible from the application. Use these as entry points to access the FileSystem.
134+ */
135+ export module knownFolders {
126136 /**
127137 * Gets the Documents folder available for the current application. This Folder is private for the application and not accessible from Users/External apps.
128138 */
@@ -137,14 +147,16 @@ declare module "file-system" {
137147 /**
138148 * Enables path-specific operations like join, extension, etc.
139149 */
140- module path {
150+ export module path {
141151 /**
142- * Normalizes a path, taking care of occurrances like ".." and "//"
152+ * Normalizes a path, taking care of occurrances like ".." and "//".
153+ * @param path The path to be normalized.
143154 */
144155 export function normalize ( path : string ) : string ;
145156
146157 /**
147158 * Joins all the provided string components, forming a valid and normalized path.
159+ * @param paths An array of string components to be joined.
148160 */
149161 export function join ( ...paths : string [ ] ) : string ;
150162
0 commit comments