@@ -7,7 +7,7 @@ import { SemVer } from 'semver';
77import * as vscode from 'vscode' ;
88import { Architecture , OSType } from '../utils/platform' ;
99
10- //===========================
10+ //= ==========================
1111// registry
1212
1313export enum RegistryHive {
@@ -21,7 +21,7 @@ export interface IRegistry {
2121 getValue ( key : string , hive : RegistryHive , arch ?: Architecture , name ?: string ) : Promise < string | undefined | null > ;
2222}
2323
24- //===========================
24+ //= ==========================
2525// platform
2626
2727export const IsWindows = Symbol ( 'IS_WINDOWS' ) ;
@@ -41,7 +41,7 @@ export interface IPlatformService {
4141 getVersion ( ) : Promise < SemVer > ;
4242}
4343
44- //===========================
44+ //= ==========================
4545// temp FS
4646
4747export type TemporaryFile = { filePath : string } & vscode . Disposable ;
@@ -51,7 +51,7 @@ export interface ITempFileSystem {
5151 createFile ( suffix : string , mode ?: number ) : Promise < TemporaryFile > ;
5252}
5353
54- //===========================
54+ //= ==========================
5555// FS paths
5656
5757// The low-level file path operations used by the extension.
@@ -87,19 +87,15 @@ export interface IFileSystemPathUtils {
8787 getDisplayName ( pathValue : string , cwd ?: string ) : string ;
8888}
8989
90- //===========================
90+ //= ==========================
9191// filesystem operations
9292
93+ // We could use FileType from utils/filesystem.ts, but it's simpler this way.
9394export import FileType = vscode . FileType ;
9495export import FileStat = vscode . FileStat ;
9596export type ReadStream = fs . ReadStream ;
9697export type WriteStream = fs . WriteStream ;
9798
98- export type DirEntry = {
99- filename : string ;
100- filetype : FileType ;
101- } ;
102-
10399// The low-level filesystem operations on which the extension depends.
104100export interface IRawFileSystem {
105101 // Get information about a file (resolve symlinks).
@@ -111,23 +107,23 @@ export interface IRawFileSystem {
111107 // Move the file to a different location (and/or rename it).
112108 move ( src : string , tgt : string ) : Promise < void > ;
113109
114- //***********************
110+ //* **********************
115111 // files
116112
117113 // Return the raw bytes of the given file.
118114 readData ( filename : string ) : Promise < Buffer > ;
119115 // Return the text of the given file (decoded from UTF-8).
120116 readText ( filename : string ) : Promise < string > ;
121117 // Write the given text to the file (UTF-8 encoded).
122- writeText ( filename : string , data : { } ) : Promise < void > ;
118+ writeText ( filename : string , data : string | Buffer ) : Promise < void > ;
123119 // Write the given text to the end of the file (UTF-8 encoded).
124120 appendText ( filename : string , text : string ) : Promise < void > ;
125121 // Copy a file.
126122 copyFile ( src : string , dest : string ) : Promise < void > ;
127123 // Delete a file.
128124 rmfile ( filename : string ) : Promise < void > ;
129125
130- //***********************
126+ //* **********************
131127 // directories
132128
133129 // Create the directory and any missing parent directories.
@@ -139,7 +135,7 @@ export interface IRawFileSystem {
139135 // Return the contents of the directory.
140136 listdir ( dirname : string ) : Promise < [ string , FileType ] [ ] > ;
141137
142- //***********************
138+ //* **********************
143139 // not async
144140
145141 // Get information about a file (resolve symlinks).
@@ -159,14 +155,14 @@ export interface IFileSystemUtils {
159155 readonly pathUtils : IFileSystemPathUtils ;
160156 readonly tmp : ITempFileSystem ;
161157
162- //***********************
158+ //* **********************
163159 // aliases
164160
165161 createDirectory ( dirname : string ) : Promise < void > ;
166162 deleteDirectory ( dirname : string ) : Promise < void > ;
167163 deleteFile ( filename : string ) : Promise < void > ;
168164
169- //***********************
165+ //* **********************
170166 // helpers
171167
172168 // Determine if the file exists, optionally requiring the type.
@@ -188,7 +184,7 @@ export interface IFileSystemUtils {
188184 // Get the paths of all files matching the pattern.
189185 search ( globPattern : string ) : Promise < string [ ] > ;
190186
191- //***********************
187+ //* **********************
192188 // helpers (non-async)
193189
194190 fileExistsSync ( path : string ) : boolean ;
0 commit comments