diff --git a/Jakefile.js b/Jakefile.js index a786fb16ed369..3ee8476c842d2 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -456,7 +456,7 @@ function compileFile(outFile, sources, prereqs, prefixes, useBuiltCompiler, opts options += " --stripInternal"; } - options += " --target es5 --noUnusedLocals --noUnusedParameters"; + options += " --target es5 --lib es5,scripthost --noUnusedLocals --noUnusedParameters"; var cmd = host + " " + compilerPath + " " + options + " "; cmd = cmd + sources.join(" "); @@ -726,7 +726,7 @@ compileFile( // Appending exports at the end of the server library var tsserverLibraryDefinitionFileContents = - fs.readFileSync(tsserverLibraryDefinitionFile).toString() + + fs.readFileSync(tsserverLibraryDefinitionFile).toString() + "\r\nexport = ts;" + "\r\nexport as namespace ts;"; diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index 3c28efd0de889..71ff4485343c6 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -1,5 +1,8 @@ /// +declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; +declare function clearTimeout(handle: any): void; + namespace ts { export type FileWatcherCallback = (fileName: string, removed?: boolean) => void; export type DirectoryWatcherCallback = (fileName: string) => void; diff --git a/src/harness/harness.ts b/src/harness/harness.ts index ad2e62067d415..1dd41f9d81cfc 100644 --- a/src/harness/harness.ts +++ b/src/harness/harness.ts @@ -40,6 +40,19 @@ declare namespace NodeJS { ActiveXObject: typeof ActiveXObject; } } + +declare var window: {}; +declare var XMLHttpRequest: { + new(): XMLHttpRequest; +} +interface XMLHttpRequest { + readonly readyState: number; + readonly responseText: string; + readonly status: number; + open(method: string, url: string, async?: boolean, user?: string, password?: string): void; + send(data?: string): void; + setRequestHeader(header: string, value: string): void; +} /* tslint:enable:no-var-keyword */ namespace Utils { diff --git a/src/tsconfig-base.json b/src/tsconfig-base.json index 2eb1851dc5c41..078fdcc91e74b 100644 --- a/src/tsconfig-base.json +++ b/src/tsconfig-base.json @@ -1,5 +1,6 @@ { "compilerOptions": { + "lib": ["es5", "scripthost"], "noEmitOnError": true, "noImplicitAny": true, "noImplicitThis": true,