import * as fs from 'fs' ; import { SemVer } from 'semver' ; import { Disposable } from 'vscode' ; import { Architecture , OSType } from '../utils/platform' ; export enum RegistryHive { HKCU , HKLM } export const IRegistry = Symbol ( 'IRegistry' ) ; export interface IRegistry { getKeys ( key , hive , arch ? ) : Promise < string [ ] > ; getValue ( key , hive , arch ? , name ? ) : Promise < string | undefined | null > ; } export const IPlatformService = Symbol ( 'IPlatformService' ) ; export interface IPlatformService { readonly osType : OSType ; readonly pathVariableName : 'Path' | 'PATH' ; readonly virtualEnvBinName : 'bin' | 'Scripts' ; readonly isWindows : boolean ; readonly isMac : boolean ; readonly isLinux : boolean ; readonly is64bit : boolean ; getVersion ( ) : Promise < SemVer > ; } export type TemporaryFile = { filePath : string ; } & Disposable ; export type TemporaryDirectory = { path : string ; } & Disposable ; export const IFileSystem = Symbol ( 'IFileSystem' ) ; export interface IFileSystem { directorySeparatorChar : string ; objectExists ( path , statCheck ) : Promise < boolean > ; fileExists ( path ) : Promise < boolean > ; fileExistsSync ( path ) : boolean ; directoryExists ( path ) : Promise < boolean > ; createDirectory ( path ) : Promise < void > ; deleteDirectory ( path ) : Promise < void > ; getSubDirectories ( rootDir ) : Promise < string [ ] > ; getFiles ( rootDir ) : Promise < string [ ] > ; arePathsSame ( path1 , path2 ) : boolean ; readFile ( filePath ) : Promise < string > ; writeFile ( filePath , data , options ? ) : Promise < void > ; appendFileSync ( filename , data , encoding ) : void ; appendFileSync ( filename , data , options ? ) : void ; appendFileSync ( filename , data , options ? ) : void ; getRealPath ( path ) : Promise < string > ; copyFile ( src , dest ) : Promise < void > ; deleteFile ( filename ) : Promise < void > ; getFileHash ( filePath ) : Promise < string | undefined > ; search ( globPattern ) : Promise < string [ ] > ; createTemporaryFile ( extension ) : Promise < TemporaryFile > ; createWriteStream ( path ) : fs . WriteStream ; chmod ( path , mode ) : Promise < void > ; }