Skip to content

Commit 426815d

Browse files
committed
Make interface names more consistent
1 parent 19a29df commit 426815d

3 files changed

Lines changed: 51 additions & 51 deletions

File tree

‎common/reviews/api/node-core-library.api.ts‎

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class FileSystem {
2424
static createSymbolicLinkFile(options: IFileSystemCreateLinkOptions): void;
2525
static createSymbolicLinkFolder(options: IFileSystemCreateLinkOptions): void;
2626
static createSymbolicLinkJunction(options: IFileSystemCreateLinkOptions): void;
27-
static deleteFile(filePath: string, options?: IDeleteFileOptions): void;
27+
static deleteFile(filePath: string, options?: IFileSystemDeleteFileOptions): void;
2828
static deleteFolder(folderPath: string): void;
2929
static ensureEmptyFolder(folderPath: string): void;
3030
static ensureFolder(folderPath: string): void;
@@ -35,11 +35,11 @@ class FileSystem {
3535
static getRealPath(linkPath: string): string;
3636
static getStatistics(path: string): fs.Stats;
3737
static move(options: IFileSystemMoveOptions): void;
38-
static readFile(filePath: string, options?: IReadFileOptions): string;
38+
static readFile(filePath: string, options?: IFileSystemReadFileOptions): string;
3939
static readFileToBuffer(filePath: string): Buffer;
40-
static readFolder(folderPath: string, options?: IReadFolderOptions): Array<string>;
41-
static updateTimes(path: string, times: IUpdateTimeParameters): void;
42-
static writeFile(filePath: string, contents: string | Buffer, options?: IWriteFileOptions): void;
40+
static readFolder(folderPath: string, options?: IFileSystemReadFolderOptions): Array<string>;
41+
static updateTimes(path: string, times: IFileSystemUpdateTimeParameters): void;
42+
static writeFile(filePath: string, contents: string | Buffer, options?: IFileSystemWriteFileOptions): void;
4343
}
4444

4545
// @public
@@ -55,11 +55,6 @@ enum FolderConstants {
5555
NodeModules = "node_modules"
5656
}
5757

58-
// @public
59-
interface IDeleteFileOptions {
60-
throwIfNotExists?: boolean;
61-
}
62-
6358
// @beta
6459
interface IExecutableResolveOptions {
6560
currentWorkingDirectory?: string;
@@ -86,6 +81,11 @@ interface IFileSystemCreateLinkOptions {
8681
linkTargetPath: string;
8782
}
8883

84+
// @public
85+
interface IFileSystemDeleteFileOptions {
86+
throwIfNotExists?: boolean;
87+
}
88+
8989
// @public
9090
interface IFileSystemMoveOptions {
9191
destinationPath: string;
@@ -94,6 +94,30 @@ interface IFileSystemMoveOptions {
9494
sourcePath: string;
9595
}
9696

97+
// @public
98+
interface IFileSystemReadFileOptions {
99+
convertLineEndings?: NewlineKind;
100+
encoding?: Encoding;
101+
}
102+
103+
// @public
104+
interface IFileSystemReadFolderOptions {
105+
absolutePaths?: boolean;
106+
}
107+
108+
// @public
109+
interface IFileSystemUpdateTimeParameters {
110+
accessedTime: number | Date;
111+
modifiedTime: number | Date;
112+
}
113+
114+
// @public
115+
interface IFileSystemWriteFileOptions {
116+
convertLineEndings?: NewlineKind;
117+
encoding?: Encoding;
118+
ensureFolderExists?: boolean;
119+
}
120+
97121
// @public
98122
interface IFileWriterFlags {
99123
append?: boolean;
@@ -187,30 +211,6 @@ interface IProtectableMapParameters<K, V> {
187211
onSet?: (source: ProtectableMap<K, V>, key: K, value: V) => V;
188212
}
189213

190-
// @public
191-
interface IReadFileOptions {
192-
convertLineEndings?: NewlineKind;
193-
encoding?: Encoding;
194-
}
195-
196-
// @public
197-
interface IReadFolderOptions {
198-
absolutePaths?: boolean;
199-
}
200-
201-
// @public
202-
interface IUpdateTimeParameters {
203-
accessedTime: number | Date;
204-
modifiedTime: number | Date;
205-
}
206-
207-
// @public
208-
interface IWriteFileOptions {
209-
convertLineEndings?: NewlineKind;
210-
encoding?: Encoding;
211-
ensureFolderExists?: boolean;
212-
}
213-
214214
// @public
215215
class JsonFile {
216216
static load(jsonFilename: string): any;

‎libraries/node-core-library/src/FileSystem.ts‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { PosixModeBits } from './PosixModeBits';
1515
* The options for FileSystem.readFolder()
1616
* @public
1717
*/
18-
export interface IReadFolderOptions {
18+
export interface IFileSystemReadFolderOptions {
1919
/**
2020
* If true, returns the absolute paths of the files in the folder.
2121
* Defaults to `false`.
@@ -27,7 +27,7 @@ export interface IReadFolderOptions {
2727
* The options for FileSystem.writeFile()
2828
* @public
2929
*/
30-
export interface IWriteFileOptions {
30+
export interface IFileSystemWriteFileOptions {
3131
/**
3232
* If true, will ensure the folder is created before writing the file.
3333
* Defaults to `false`.
@@ -51,7 +51,7 @@ export interface IWriteFileOptions {
5151
* The options for FileSystem.readFile()
5252
* @public
5353
*/
54-
export interface IReadFileOptions {
54+
export interface IFileSystemReadFileOptions {
5555
/**
5656
* If specified, will change the encoding of the file that will be written.
5757
* Defaults to `"utf8"`.
@@ -116,7 +116,7 @@ export interface IFileSystemCopyFileOptions {
116116
* The options for FileSystem.deleteFile()
117117
* @public
118118
*/
119-
export interface IDeleteFileOptions {
119+
export interface IFileSystemDeleteFileOptions {
120120
/**
121121
* If true, will throw an exception if the file did not exist before `deleteFile()` was called.
122122
* Defaults to `false`.
@@ -129,7 +129,7 @@ export interface IDeleteFileOptions {
129129
* Both times must be specified.
130130
* @public
131131
*/
132-
export interface IUpdateTimeParameters {
132+
export interface IFileSystemUpdateTimeParameters {
133133
/**
134134
* The POSIX epoch time or Date when this was last accessed.
135135
*/
@@ -142,8 +142,8 @@ export interface IUpdateTimeParameters {
142142
}
143143

144144
/**
145-
* The options for FileSystem.createSymbolicLinkJunction(), createSymbolicLinkFile(), createSymbolicLinkFolder(),
146-
* and createHardLink().
145+
* The options for `FileSystem.createSymbolicLinkJunction()`, `createSymbolicLinkFile()`,
146+
* `createSymbolicLinkFolder()`, and `createHardLink()`.
147147
*
148148
* @public
149149
*/
@@ -213,7 +213,7 @@ export class FileSystem {
213213
* @param path - The path of the file that should be modified.
214214
* @param times - The times that the object should be updated to reflect.
215215
*/
216-
public static updateTimes(path: string, times: IUpdateTimeParameters): void {
216+
public static updateTimes(path: string, times: IFileSystemUpdateTimeParameters): void {
217217
// tslint:disable-next-line:no-any
218218
fsx.utimes(path, times.accessedTime as any, times.modifiedTime as any);
219219
}
@@ -301,7 +301,7 @@ export class FileSystem {
301301
* @param folderPath - The absolute or relative path to the folder which should be read.
302302
* @param options - Optional settings that can change the behavior. Type: `IReadFolderOptions`
303303
*/
304-
public static readFolder(folderPath: string, options?: IReadFolderOptions): Array<string> {
304+
public static readFolder(folderPath: string, options?: IFileSystemReadFolderOptions): Array<string> {
305305
options = {
306306
absolutePaths: false,
307307
...options
@@ -356,7 +356,7 @@ export class FileSystem {
356356
* @param contents - The text that should be written to the file.
357357
* @param options - Optional settings that can change the behavior. Type: `IWriteFileOptions`
358358
*/
359-
public static writeFile(filePath: string, contents: string | Buffer, options?: IWriteFileOptions): void {
359+
public static writeFile(filePath: string, contents: string | Buffer, options?: IFileSystemWriteFileOptions): void {
360360
options = {
361361
ensureFolderExists: false,
362362
convertLineEndings: undefined,
@@ -380,7 +380,7 @@ export class FileSystem {
380380
* @param filePath - The relative or absolute path to the file whose contents should be read.
381381
* @param options - Optional settings that can change the behavior. Type: `IReadFileOptions`
382382
*/
383-
public static readFile(filePath: string, options?: IReadFileOptions): string {
383+
public static readFile(filePath: string, options?: IFileSystemReadFileOptions): string {
384384
options = {
385385
encoding: Encoding.Utf8,
386386
convertLineEndings: undefined,
@@ -415,7 +415,7 @@ export class FileSystem {
415415
* @param filePath - The absolute or relative path to the file that should be deleted.
416416
* @param options - Optional settings that can change the behavior. Type: `IDeleteFileOptions`
417417
*/
418-
public static deleteFile(filePath: string, options?: IDeleteFileOptions): void {
418+
public static deleteFile(filePath: string, options?: IFileSystemDeleteFileOptions): void {
419419
options = {
420420
throwIfNotExists: false,
421421
...options

‎libraries/node-core-library/src/index.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ export { Path } from './Path';
5656
export { Text, NewlineKind } from './Text';
5757
export {
5858
FileSystem,
59-
IReadFolderOptions,
60-
IWriteFileOptions,
61-
IReadFileOptions,
59+
IFileSystemReadFolderOptions,
60+
IFileSystemWriteFileOptions,
61+
IFileSystemReadFileOptions,
6262
IFileSystemMoveOptions,
6363
IFileSystemCopyFileOptions,
64-
IDeleteFileOptions,
65-
IUpdateTimeParameters,
64+
IFileSystemDeleteFileOptions,
65+
IFileSystemUpdateTimeParameters,
6666
IFileSystemCreateLinkOptions
6767
} from './FileSystem';
6868
export {

0 commit comments

Comments
 (0)