namespace ts . server { export enum LogLevel { terse , normal , requestTime , verbose } export const emptyArray = createSortedArray < never > ( ) ; export interface Logger { close ( ) : void ; hasLevel ( level ) : boolean ; loggingEnabled ( ) : boolean ; perftrc ( s ) : void ; info ( s ) : void ; startGroup ( ) : void ; endGroup ( ) : void ; msg ( s , type ? ) : void ; getLogFileName ( ) : string | undefined ; } export enum Msg { Err = "Err" , Info = "Info" , Perf = "Perf" } export namespace Msg { deprecated export type Types = Msg ; } export function createInstallTypingsRequest ( project , typeAcquisition , unresolvedImports , cachePath ? ) { return { projectName : project . getProjectName ( ) , fileNames : project . getFileNames ( true , true ) . concat ( project . getExcludedFiles ( ) as NormalizedPath [ ] ) , compilerOptions : project . getCompilationSettings ( ) , watchOptions : project . projectService . getWatchOptions ( project ) , typeAcquisition , unresolvedImports , projectRootPath : project . getCurrentDirectory ( ) as Path , cachePath , kind : "discover" } ; } export namespace Errors { export function ThrowNoProject ( ) { throw new Error ( "No Project." ) ; } export function ThrowProjectLanguageServiceDisabled ( ) { throw new Error ( "The project's language service is disabled." ) ; } export function ThrowProjectDoesNotContainDocument ( fileName , project ) { throw new Error ( `Project '${ project . getProjectName ( ) }' does not contain document '${ fileName }'` ) ; } } export type NormalizedPath = string & { __normalizedPathTag : any ; } ; export function toNormalizedPath ( fileName ) { return normalizePath ( fileName ) as NormalizedPath ; } export function normalizedPathToPath ( normalizedPath , currentDirectory , getCanonicalFileName ) { const f = isRootedDiskPath ( normalizedPath ) ? normalizedPath : getNormalizedAbsolutePath ( normalizedPath , currentDirectory ) ; return getCanonicalFileName ( f ) as Path ; } export function asNormalizedPath ( fileName ) { return fileName as NormalizedPath ; } export interface NormalizedPathMap < T > { get ( path ) : T | undefined ; set ( path , value ) : void ; contains ( path ) : boolean ; remove ( path ) : void ; } export function createNormalizedPathMap < T > ( ) { const map = new Map < string , T > ( ) ; return { get ( path ) { return map . get ( path ) ; } , set ( path , value ) { map . set ( path , value ) ; } , contains ( path ) { return map . has ( path ) ; } , remove ( path ) { map . delete ( path ) ; } } ; } export interface ProjectOptions { configHasExtendsProperty : boolean ; /**
         * true if config file explicitly listed files
         */ configHasFilesProperty : boolean ; configHasIncludeProperty : boolean ; configHasExcludeProperty : boolean ; } export function isInferredProjectName ( name ) { return /dev\/null\/inferredProject\d+\*/ . test ( name ) ; } export function makeInferredProjectName ( counter ) { return `/dev/null/inferredProject${ counter }*` ; } export function makeAutoImportProviderProjectName ( counter ) { return `/dev/null/autoImportProviderProject${ counter }*` ; } export function createSortedArray < T > ( ) { return [ ] as any as SortedArray < T > ; } }