diff --git a/.mailmap b/.mailmap index 774aa4174c374..79e90f32785b0 100644 --- a/.mailmap +++ b/.mailmap @@ -163,7 +163,7 @@ Rostislav Galimsky Richard Knoll Richard Knoll Richard Karmazín Rowan Wyborn -Ryan Cavanaugh Ryan Cavanaugh Ryan Cavanaugh +Ryan Cavanaugh Ryan Cavanaugh Ryan Cavanaugh Ryan Cavanaugh Ryohei Ikegami Sarangan Rajamanickam Sébastien Arod @@ -340,4 +340,21 @@ EcoleKeine # Ecole Keine Khải rhysd # @rhysd Zen <843968788@qq.com> Zzzen <843968788@qq.com> # @Zzzen -bluelovers # @bluelovers \ No newline at end of file +bluelovers # @bluelovers +Dan Freeman +David Sherret +David Staheli +Elizabeth Dinella +John Doe +Kevin Gibbons +Markus Johnsson +Martin Probst +Mateusz Burzyński +Steven # @styfle +Pi Lanningham +Sam Bostock +Vimal Raghubir +Vyacheslav Pukhanov +dangoo # Daniel Gooss +krk # Kerem Kat +micnic # Nicu Micleușanu diff --git a/.travis.yml b/.travis.yml index d7610ed7603cf..9479fffe76331 100644 --- a/.travis.yml +++ b/.travis.yml @@ -19,6 +19,7 @@ branches: - release-2.7 - release-2.8 - release-2.9 + - release-3.0 install: - npm uninstall typescript --no-save diff --git a/AUTHORS.md b/AUTHORS.md index 0c31c45e2ede2..2ee14e49b41d4 100644 --- a/AUTHORS.md +++ b/AUTHORS.md @@ -74,7 +74,9 @@ TypeScript is authored by: * Dafrok Zhang * Dahan Gong * Dan Corder +* Dan Freeman * Dan Quirk +* Daniel Gooss * Daniel Hollocher * Daniel Król * Daniel Lehenbauer @@ -82,7 +84,9 @@ TypeScript is authored by: * David Kmenta * David Li * David Sheldrick +* David Sherret * David Souther +* David Staheli * Denis Nedelyaev * Derek P Sifford * Dhruv Rajvanshi @@ -96,6 +100,7 @@ TypeScript is authored by: * @e-cloud * Ecole Keine * Elisée Maurer +* Elizabeth Dinella * Emilio García-Pumarino * Eric Grube * Eric Tsang @@ -161,6 +166,7 @@ TypeScript is authored by: * Joel Day * Joey Wilson * Johannes Rieken +* John Doe * John Vilk * Jonathan Bond-Caron * Jonathan Park @@ -184,7 +190,9 @@ TypeScript is authored by: * Keith Mashinter * Ken Howard * Kenji Imamula +* Kerem Kat * Kevin Donnelly +* Kevin Gibbons * Kevin Lang * Khải * Kitson Kelly @@ -201,10 +209,13 @@ TypeScript is authored by: * Manish Giri * Marin Marinov * Marius Schulz +* Markus Johnsson * Martin Hiller +* Martin Probst * Martin Vseticka * Martyn Janes * Masahiro Wakame +* Mateusz Burzyński * Matt Bierner * Matt McCutchen * Matt Mitchell @@ -223,10 +234,10 @@ TypeScript is authored by: * Mohamed Hegazy * Mohsen Azimi * Myles Megyesi -* Natalie Coley * Nathan Shively-Sanders * Nathan Yee * Nicolas Henry +* Nicu Micleușanu * @nieltg * Nima Zahedi * Noah Chen @@ -248,6 +259,7 @@ TypeScript is authored by: * Peter Burns * Philip Bulley * Philippe Voinov +* Pi Lanningham * Piero Cangianiello * @piloopin * Prayag Verma @@ -270,6 +282,7 @@ TypeScript is authored by: * Rowan Wyborn * Ryan Cavanaugh * Ryohei Ikegami +* Sam Bostock * Sam El-Husseini * Sarangan Rajamanickam * Sean Barag @@ -290,6 +303,7 @@ TypeScript is authored by: * Stas Vilchik * Stephan Ginthör * Steve Lucco +* @styfle * Sudheesh Singanamalla * Sébastien Arod * @T18970237136 @@ -316,8 +330,10 @@ TypeScript is authored by: * Vidar Tonaas Fauske * Viktor Zozulyak * Vilic Vane +* Vimal Raghubir * Vladimir Kurchatkin * Vladimir Matveev +* Vyacheslav Pukhanov * Wenlu Wang * Wesley Wigham * William Orr diff --git a/Gulpfile.js b/Gulpfile.js index e202b2d983c2b..b31462755adb1 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -24,6 +24,10 @@ const baselineAccept = require("./scripts/build/baselineAccept"); const cmdLineOptions = require("./scripts/build/options"); const exec = require("./scripts/build/exec"); const browserify = require("./scripts/build/browserify"); +const debounce = require("./scripts/build/debounce"); +const prepend = require("./scripts/build/prepend"); +const { removeSourceMaps } = require("./scripts/build/sourcemaps"); +const { CancelSource, CancelError } = require("./scripts/build/cancellation"); const { libraryTargets, generateLibs } = require("./scripts/build/lib"); const { runConsoleTests, cleanTestDirs, writeTestConfigFile, refBaseline, localBaseline, refRwcBaseline, localRwcBaseline } = require("./scripts/build/tests"); @@ -44,17 +48,9 @@ const generateLocalizedDiagnosticMessagesJs = "scripts/generateLocalizedDiagnost const buildProtocolJs = "scripts/buildProtocol.js"; const produceLKGJs = "scripts/produceLKG.js"; const word2mdJs = "scripts/word2md.js"; -gulp.task("scripts", /*help*/ false, () => project.compile(scriptsProject), { - aliases: [ - configurePrereleaseJs, - processDiagnosticMessagesJs, - generateLocalizedDiagnosticMessagesJs, - produceLKGJs, - buildProtocolJs, - word2mdJs - ] -}); -gulp.task("clean-scripts", /*help*/ false, () => project.clean(scriptsProject)); +const scriptsTaskAliases = [configurePrereleaseJs, processDiagnosticMessagesJs, generateLocalizedDiagnosticMessagesJs, produceLKGJs, buildProtocolJs, word2mdJs]; +gulp.task("scripts", /*help*/ false, () => project.compile(scriptsProject), { aliases: scriptsTaskAliases }); +gulp.task("clean:scripts", /*help*/ false, () => project.clean(scriptsProject), { aliases: scriptsTaskAliases.map(alias => `clean:${alias}`)}); // Nightly management tasks gulp.task( @@ -73,7 +69,7 @@ gulp.task( const importDefinitelyTypedTestsProject = "scripts/importDefinitelyTypedTests/tsconfig.json"; const importDefinitelyTypedTestsJs = "scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js"; gulp.task(importDefinitelyTypedTestsJs, /*help*/ false, () => project.compile(importDefinitelyTypedTestsProject)); -gulp.task("clean:" + importDefinitelyTypedTestsJs, /*help*/ false, () => project.clean(importDefinitelyTypedTestsProject)); +gulp.task(`clean:${importDefinitelyTypedTestsJs}`, /*help*/ false, () => project.clean(importDefinitelyTypedTestsProject)); gulp.task( "importDefinitelyTypedTests", @@ -95,7 +91,7 @@ gulp.task(diagnosticInformationMapTs, /*help*/ false, [processDiagnosticMessages return exec(host, [processDiagnosticMessagesJs, diagnosticMessagesJson]); } }); -gulp.task("clean:" + diagnosticInformationMapTs, /*help*/ false, () => del([diagnosticInformationMapTs, diagnosticMessagesGeneratedJson])); +gulp.task(`clean:${diagnosticInformationMapTs}`, /*help*/ false, () => del([diagnosticInformationMapTs, diagnosticMessagesGeneratedJson])); const builtGeneratedDiagnosticMessagesJson = "built/local/diagnosticMessages.generated.json"; gulp.task(builtGeneratedDiagnosticMessagesJson, /*help*/ false, [diagnosticInformationMapTs], () => @@ -140,9 +136,10 @@ gulp.task(typescriptServicesProject, /*help*/ false, () => { // NOTE: flatten services so that we can properly strip @internal project.flatten(servicesProject, typescriptServicesProject, { compilerOptions: { - "removeComments": true, + "removeComments": false, "stripInternal": true, - "outFile": "typescriptServices.js" + "declarationMap": false, + "outFile": "typescriptServices.out.js" // must align with same task in jakefile. We fix this name below. } }); }); @@ -150,7 +147,16 @@ gulp.task(typescriptServicesProject, /*help*/ false, () => { const typescriptServicesJs = "built/local/typescriptServices.js"; const typescriptServicesDts = "built/local/typescriptServices.d.ts"; gulp.task(typescriptServicesJs, /*help*/ false, ["lib", "generate-diagnostics", typescriptServicesProject], () => - project.compile(typescriptServicesProject, { dts: files => files.pipe(convertConstEnums()) }), + project.compile(typescriptServicesProject, { + js: files => files + .pipe(prepend.file(copyright)) + .pipe(rename("typescriptServices.js")), + dts: files => files + .pipe(removeSourceMaps()) + .pipe(prepend.file(copyright)) + .pipe(convertConstEnums()) + .pipe(rename("typescriptServices.d.ts")) + }), { aliases: [typescriptServicesDts] }); const typescriptJs = "built/local/typescript.js"; @@ -179,29 +185,39 @@ gulp.task(typescriptStandaloneDts, /*help*/ false, [typescriptServicesDts], () = // build all 'typescriptServices'-related outputs gulp.task("services", /*help*/ false, [typescriptServicesJs, typescriptServicesDts, typescriptJs, typescriptDts, typescriptStandaloneDts]); +const useCompiler = cmdLineOptions.lkg ? "lkg" : "built"; +const useCompilerDeps = cmdLineOptions.lkg ? ["lib", "generate-diagnostics"] : [typescriptServicesJs]; + const tscProject = "src/tsc/tsconfig.json"; const tscJs = "built/local/tsc.js"; -gulp.task(tscJs, /*help*/ false, [typescriptServicesJs], () => project.compile(tscProject, { typescript: "built" })); +gulp.task(tscJs, /*help*/ false, useCompilerDeps, () => + project.compile(tscProject, { + typescript: useCompiler, + js: files => files.pipe(prepend.file(copyright)) + })); const tscReleaseProject = "src/tsc/tsconfig.release.json"; const tscReleaseJs = "built/local/tsc.release.js"; -gulp.task(tscReleaseJs, /*help*/ false, () => project.compile(tscReleaseProject)); +gulp.task(tscReleaseJs, /*help*/ false, () => + project.compile(tscReleaseProject, { + js: files => files.pipe(prepend.file(copyright)) + })); const cancellationTokenProject = "src/cancellationToken/tsconfig.json"; const cancellationTokenJs = "built/local/cancellationToken.js"; -gulp.task(cancellationTokenJs, /*help*/ false, [typescriptServicesJs], () => project.compile(cancellationTokenProject, { typescript: "built" })); +gulp.task(cancellationTokenJs, /*help*/ false, useCompilerDeps, () => project.compile(cancellationTokenProject, { typescript: useCompiler })); const typingsInstallerProject = "src/typingsInstaller/tsconfig.json"; const typingsInstallerJs = "built/local/typingsInstaller.js"; -gulp.task(typingsInstallerJs, /*help*/ false, [typescriptServicesJs], () => project.compile(typingsInstallerProject, { typescript: "built" })); +gulp.task(typingsInstallerJs, /*help*/ false, useCompilerDeps, () => project.compile(typingsInstallerProject, { typescript: useCompiler })); const tsserverProject = "src/tsserver/tsconfig.json"; const tsserverJs = "built/local/tsserver.js"; -gulp.task(tsserverJs, /*help*/ false, [typescriptServicesJs], () => project.compile(tsserverProject, { typescript: "built" })); +gulp.task(tsserverJs, /*help*/ false, useCompilerDeps, () => project.compile(tsserverProject, { typescript: useCompiler })); const watchGuardProject = "src/watchGuard/tsconfig.json"; const watchGuardJs = "built/local/watchGuard.js"; -gulp.task(watchGuardJs, /*help*/ false, [typescriptServicesJs], () => project.compile(watchGuardProject, { typescript: "built" })); +gulp.task(watchGuardJs, /*help*/ false, useCompilerDeps, () => project.compile(watchGuardProject, { typescript: useCompiler })); const typesMapJson = "built/local/typesMap.json"; gulp.task(typesMapJson, /*help*/ false, [], () => @@ -216,21 +232,28 @@ gulp.task(tsserverlibraryProject, /*help*/ false, () => { project.flatten("src/tsserver/tsconfig.json", tsserverlibraryProject, { exclude: ["src/tsserver/server.ts"], compilerOptions: { - "removeComments": true, + "removeComments": false, "stripInternal": true, - "outFile": "tsserverlibrary.js" + "declarationMap": false, + "outFile": "tsserverlibrary.out.js" // must align with same task in jakefile. We fix this name below. } }); }); const tsserverlibraryJs = "built/local/tsserverlibrary.js"; const tsserverlibraryDts = "built/local/tsserverlibrary.d.ts"; -gulp.task(tsserverlibraryJs, /*help*/ false, [typescriptServicesJs, tsserverlibraryProject], () => +gulp.task(tsserverlibraryJs, /*help*/ false, useCompilerDeps.concat([tsserverlibraryProject]), () => project.compile(tsserverlibraryProject, { + js: files => files + .pipe(prepend.file(copyright)) + .pipe(rename("tsserverlibrary.js")), dts: files => files + .pipe(removeSourceMaps()) + .pipe(prepend.file(copyright)) .pipe(convertConstEnums()) - .pipe(append("\nexport = ts;\nexport as namespace ts;")), - typescript: "built" + .pipe(append("\nexport = ts;\nexport as namespace ts;")) + .pipe(rename("tsserverlibrary.d.ts")), + typescript: useCompiler }), { aliases: [tsserverlibraryDts] }); gulp.task( @@ -294,29 +317,29 @@ gulp.task( // Task to build the tests infrastructure using the built compiler const testRunnerProject = "src/testRunner/tsconfig.json"; const runJs = "built/local/run.js"; -gulp.task(runJs, /*help*/ false, [typescriptServicesJs, tsserverlibraryDts], () => project.compile(testRunnerProject, { typescript: "built" })); +gulp.task(runJs, /*help*/ false, useCompilerDeps, () => project.compile(testRunnerProject, { typescript: useCompiler })); gulp.task( "tests", "Builds the test infrastructure using the built compiler", - [runJs]); + [runJs, tsserverlibraryDts]); gulp.task( "runtests-parallel", "Runs all the tests in parallel using the built run.js file. Optional arguments are: --t[ests]=category1|category2|... --d[ebug]=true.", - ["build-rules", "tests"], - () => runConsoleTests(runJs, "min", /*runInParallel*/ true)); + ["build-rules", "tests", "services", tsserverlibraryDts], + () => runConsoleTests(runJs, "min", /*runInParallel*/ true, /*watchMode*/ false)); gulp.task( "runtests", "Runs the tests using the built run.js file. Optional arguments are: --t[ests]=regex --r[eporter]=[list|spec|json|] --d[ebug]=true --color[s]=false --lint=true.", - ["build-rules", "tests"], - () => runConsoleTests(runJs, "mocha-fivemat-progress-reporter", /*runInParallel*/ false)); + ["build-rules", "tests", "services", tsserverlibraryDts], + () => runConsoleTests(runJs, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ false)); const webTestServerProject = "tests/webTestServer.tsconfig.json"; const webTestServerJs = "tests/webTestServer.js"; -gulp.task(webTestServerJs, /*help*/ false, [typescriptServicesJs], () => project.compile(webTestServerProject, { typescript: "built" })); -gulp.task("clean:" + webTestServerJs, /*help*/ false, () => project.clean(webTestServerProject)); +gulp.task(webTestServerJs, /*help*/ false, useCompilerDeps, () => project.compile(webTestServerProject, { typescript: useCompiler })); +gulp.task(`clean:${webTestServerJs}`, /*help*/ false, () => project.clean(webTestServerProject)); const bundlePath = path.resolve("built/local/bundle.js"); @@ -392,8 +415,8 @@ gulp.task( // Webhost const webtscProject = "tests/webhost/webtsc.tsconfig.json"; const webtscJs = "tests/webhost/webtsc.js"; -gulp.task(webtscJs, /*help*/ false, [typescriptServicesJs], () => project.compile(webtscProject, { typescript: "built" })); -gulp.task("clean:" + webtscJs, /*help*/ false, () => project.clean(webtscProject)); +gulp.task(webtscJs, /*help*/ false, useCompilerDeps, () => project.compile(webtscProject, { typescript: useCompiler })); +gulp.task(`clean:${webtscJs}`, /*help*/ false, () => project.clean(webtscProject)); gulp.task("webhost", "Builds the tsc web host", [webtscJs], () => gulp.src("built/local/lib.d.ts") @@ -402,8 +425,8 @@ gulp.task("webhost", "Builds the tsc web host", [webtscJs], () => // Perf compiler const perftscProject = "tests/perftsc.tsconfig.json"; const perftscJs = "built/local/perftsc.js"; -gulp.task(perftscJs, /*help*/ false, [typescriptServicesJs], () => project.compile(perftscProject, { typescript: "built" })); -gulp.task("clean:" + perftscJs, /*help*/ false, () => project.clean(perftscProject)); +gulp.task(perftscJs, /*help*/ false, useCompilerDeps, () => project.compile(perftscProject, { typescript: useCompiler })); +gulp.task(`clean:${perftscJs}`, /*help*/ false, () => project.clean(perftscProject)); gulp.task( "perftsc", @@ -423,7 +446,7 @@ gulp.task(loggedIOJs, /*help*/ false, [], (done) => { const instrumenterProject = "src/instrumenter/tsconfig.json"; const instrumenterJs = "built/local/instrumenter.js"; gulp.task(instrumenterJs, /*help*/ false, () => project.compile(instrumenterProject)); -gulp.task("clean:" + instrumenterJs, /*help*/ false, () => project.clean(instrumenterProject)); +gulp.task(`clean:${instrumenterJs}`, /*help*/ false, () => project.clean(instrumenterProject)); gulp.task( "tsc-instrumented", @@ -479,43 +502,102 @@ gulp.task( gulp.task( "watch-tsc", /*help*/ false, - ["watch-diagnostics", "watch-lib", typescriptServicesJs], - () => project.watch(tscProject, { typescript: "built" })); + ["watch-diagnostics", "watch-lib"].concat(useCompilerDeps), + () => project.watch(tscProject, { typescript: useCompiler })); + +const watchServicesPatterns = [ + "src/compiler/**/*", + "src/jsTypings/**/*", + "src/services/**/*" +]; gulp.task( "watch-services", /*help*/ false, - ["watch-diagnostics", "watch-lib", typescriptServicesJs], - () => project.watch(servicesProject, { typescript: "built" })); + ["watch-diagnostics", "watch-lib"], + () => gulp.watch(watchServicesPatterns, ["services"])); + +const watchLsslPatterns = [ + ...watchServicesPatterns, + "src/server/**/*", + "src/tsserver/tsconfig.json" +]; + +gulp.task( + "watch-lssl", + /*help*/ false, + () => gulp.watch(watchLsslPatterns, ["lssl"])); gulp.task( "watch-server", /*help*/ false, - ["watch-diagnostics", "watch-lib", typescriptServicesJs], - () => project.watch(tsserverProject, { typescript: "built" })); + ["watch-diagnostics", "watch-lib"].concat(useCompilerDeps), + () => project.watch(tsserverProject, { typescript: useCompiler })); gulp.task( "watch-local", /*help*/ false, ["watch-lib", "watch-tsc", "watch-services", "watch-server"]); +gulp.task( + "watch-runner", + /*help*/ false, + useCompilerDeps, + () => project.watch(testRunnerProject, { typescript: useCompiler })); + +const watchPatterns = [ + runJs, + typescriptDts, + tsserverlibraryDts +]; + gulp.task( "watch", - "Watches for changes to the build inputs for built/local/run.js executes runtests-parallel.", - [typescriptServicesJs], - () => project.watch(testRunnerProject, { typescript: "built" }, ["runtests-parallel"])); + "Watches for changes to the build inputs for built/local/run.js, then executes runtests-parallel.", + ["build-rules", "watch-runner", "watch-services", "watch-lssl"], + () => { + /** @type {CancelSource | undefined} */ + let runTestsSource; + + const fn = debounce(() => { + runTests().catch(error => { + if (error instanceof CancelError) { + log.warn("Operation was canceled"); + } + else { + log.error(error); + } + }); + }, /*timeout*/ 100, { max: 500 }); + + gulp.watch(watchPatterns, () => project.wait().then(fn)); + + // NOTE: gulp.watch is far too slow when watching tests/cases/**/* as it first enumerates *every* file + const testFilePattern = /(\.ts|[\\/]tsconfig\.json)$/; + fs.watch("tests/cases", { recursive: true }, (_, file) => { + if (testFilePattern.test(file)) project.wait().then(fn); + }); + + function runTests() { + if (runTestsSource) runTestsSource.cancel(); + runTestsSource = new CancelSource(); + return cmdLineOptions.tests || cmdLineOptions.failed + ? runConsoleTests(runJs, "mocha-fivemat-progress-reporter", /*runInParallel*/ false, /*watchMode*/ true, runTestsSource.token) + : runConsoleTests(runJs, "min", /*runInParallel*/ true, /*watchMode*/ true, runTestsSource.token); + } + }); -gulp.task("clean-built", /*help*/ false, ["clean:" + diagnosticInformationMapTs], () => del(["built"])); +gulp.task("clean-built", /*help*/ false, [`clean:${diagnosticInformationMapTs}`], () => del(["built"])); gulp.task( "clean", "Cleans the compiler output, declare files, and tests", [ - "clean:" + importDefinitelyTypedTestsJs, - "clean:" + webtscJs, - "clean:" + perftscJs, - "clean:" + instrumenterJs, - "clean:" + webTestServerJs, - "clean-scripts", + `clean:${importDefinitelyTypedTestsJs}`, + `clean:${webtscJs}`, + `clean:${perftscJs}`, + `clean:${instrumenterJs}`, + `clean:${webTestServerJs}`, + "clean:scripts", "clean-rules", "clean-built" ]); \ No newline at end of file diff --git a/Jakefile.js b/Jakefile.js index 2019df45dc1db..1dc4be82faec3 100644 --- a/Jakefile.js +++ b/Jakefile.js @@ -9,6 +9,9 @@ const fold = require("travis-fold"); const ts = require("./lib/typescript"); const del = require("del"); const getDirSize = require("./scripts/build/getDirSize"); +const { base64VLQFormatEncode } = require("./scripts/build/sourcemaps"); +const needsUpdate = require("./scripts/build/needsUpdate"); +const { flatten } = require("./scripts/build/project"); // add node_modules to path so we don't need global modules, prefer the modules by adding them first var nodeModulesPathPrefix = path.resolve("./node_modules/.bin/") + path.delimiter; @@ -64,9 +67,14 @@ Paths.typesMapOutput = "built/local/typesMap.json"; Paths.typescriptFile = "built/local/typescript.js"; Paths.servicesFile = "built/local/typescriptServices.js"; Paths.servicesDefinitionFile = "built/local/typescriptServices.d.ts"; +Paths.servicesOutFile = "built/local/typescriptServices.out.js"; +Paths.servicesDefinitionOutFile = "built/local/typescriptServices.out.d.ts"; Paths.typescriptDefinitionFile = "built/local/typescript.d.ts"; Paths.typescriptStandaloneDefinitionFile = "built/local/typescript_standalone.d.ts"; +Paths.tsserverLibraryFile = "built/local/tsserverlibrary.js"; Paths.tsserverLibraryDefinitionFile = "built/local/tsserverlibrary.d.ts"; +Paths.tsserverLibraryOutFile = "built/local/tsserverlibrary.out.js"; +Paths.tsserverLibraryDefinitionOutFile = "built/local/tsserverlibrary.out.d.ts"; Paths.baselines = {}; Paths.baselines.local = "tests/baselines/local"; Paths.baselines.localTest262 = "tests/baselines/test262/local"; @@ -101,7 +109,9 @@ const ConfigFileFor = { runjs: "src/testRunner", lint: "scripts/tslint", scripts: "scripts", - all: "src" + all: "src", + typescriptServices: "built/local/typescriptServices.tsconfig.json", + tsserverLibrary: "built/local/tsserverlibrary.tsconfig.json", }; const ExpectedLKGFiles = [ @@ -124,13 +134,18 @@ desc("Builds the full compiler and services"); task(TaskNames.local, [ TaskNames.buildFoldStart, TaskNames.coreBuild, + Paths.servicesDefinitionFile, + Paths.typescriptFile, + Paths.typescriptDefinitionFile, + Paths.typescriptStandaloneDefinitionFile, + Paths.tsserverLibraryDefinitionFile, TaskNames.localize, TaskNames.buildFoldEnd ]); task("default", [TaskNames.local]); -const RunTestsPrereqs = [TaskNames.lib, Paths.servicesDefinitionFile, Paths.tsserverLibraryDefinitionFile]; +const RunTestsPrereqs = [TaskNames.lib, Paths.servicesDefinitionFile, Paths.typescriptDefinitionFile, Paths.tsserverLibraryDefinitionFile]; desc("Runs all the tests in parallel using the built run.js file. Optional arguments are: t[ests]=category1|category2|... d[ebug]=true."); task(TaskNames.runtestsParallel, RunTestsPrereqs, function () { tsbuild([ConfigFileFor.runjs], true, () => { @@ -172,6 +187,9 @@ task(TaskNames.lkg, [ TaskNames.release, TaskNames.local, Paths.servicesDefinitionFile, + Paths.typescriptFile, + Paths.typescriptDefinitionFile, + Paths.typescriptStandaloneDefinitionFile, Paths.tsserverLibraryDefinitionFile, Paths.releaseCompiler, ...libraryTargets @@ -333,64 +351,146 @@ file(Paths.diagnosticInformationMap, [Paths.diagnosticMessagesJson], function () }); }, { async: true }); -// tsserverlibrary.d.ts -file(Paths.tsserverLibraryDefinitionFile, [TaskNames.coreBuild], function() { - const sources = ["compiler.d.ts", "jsTyping.d.ts", "services.d.ts", "server.d.ts"].map(f => path.join(Paths.builtLocal, f)); - let output = ""; - for (const f of sources) { - output = output + "\n" + removeConstModifierFromEnumDeclarations(readFileSync(f)); - } - output = output + "\nexport = ts;\nexport as namespace ts;"; - fs.writeFileSync(Paths.tsserverLibraryDefinitionFile, output, { encoding: "utf-8" }); +file(ConfigFileFor.tsserverLibrary, [], function () { + flatten("src/tsserver/tsconfig.json", ConfigFileFor.tsserverLibrary, { + exclude: ["src/tsserver/server.ts"], + compilerOptions: { + "removeComments": false, + "stripInternal": true, + "declarationMap": false, + "outFile": "tsserverlibrary.out.js" + } + }) }); -// typescriptservices.d.ts -file(Paths.servicesDefinitionFile, [TaskNames.coreBuild], function() { - // Generate a config file - const files = []; - recur(`src/services/tsconfig.json`); +// tsserverlibrary.js +// tsserverlibrary.d.ts +file(Paths.tsserverLibraryFile, [TaskNames.coreBuild, ConfigFileFor.tsserverLibrary], function() { + tsbuild(ConfigFileFor.tsserverLibrary, false, () => { + if (needsUpdate([Paths.tsserverLibraryOutFile, Paths.tsserverLibraryDefinitionOutFile], [Paths.tsserverLibraryFile, Paths.tsserverLibraryDefinitionFile])) { + const copyright = readFileSync(Paths.copyright); + + let libraryDefinitionContent = readFileSync(Paths.tsserverLibraryDefinitionOutFile); + libraryDefinitionContent = copyright + removeConstModifierFromEnumDeclarations(libraryDefinitionContent); + libraryDefinitionContent += "\nexport = ts;\nexport as namespace ts;"; + fs.writeFileSync(Paths.tsserverLibraryDefinitionFile, libraryDefinitionContent, "utf8"); + + let libraryContent = readFileSync(Paths.tsserverLibraryOutFile); + libraryContent = copyright + libraryContent; + fs.writeFileSync(Paths.tsserverLibraryFile, libraryContent, "utf8"); + + // adjust source map for tsserverlibrary.js + let libraryMapContent = readFileSync(Paths.tsserverLibraryOutFile + ".map"); + const map = JSON.parse(libraryMapContent); + const lineStarts = /**@type {*}*/(ts).computeLineStarts(copyright); + let prependMappings = ""; + for (let i = 1; i < lineStarts.length; i++) { + prependMappings += ";"; + } + + const offset = copyright.length - lineStarts[lineStarts.length - 1]; + if (offset > 0) { + prependMappings += base64VLQFormatEncode(offset) + ","; + } + + const outputMap = { + version: map.version, + file: map.file, + sources: map.sources, + sourceRoot: map.sourceRoot, + mappings: prependMappings + map.mappings, + names: map.names, + sourcesContent: map.sourcesContent + }; + + libraryMapContent = JSON.stringify(outputMap); + fs.writeFileSync(Paths.tsserverLibraryFile + ".map", libraryMapContent); + } + complete(); + }); +}, { async: true }); +task(Paths.tsserverLibraryDefinitionFile, [Paths.tsserverLibraryFile]); - const config = { - extends: "../../src/tsconfig-base", +file(ConfigFileFor.typescriptServices, [], function () { + flatten("src/services/tsconfig.json", ConfigFileFor.typescriptServices, { compilerOptions: { + "removeComments": false, "stripInternal": true, - "outFile": "typescriptServices.js" - }, - files - }; - - const configFilePath = `built/local/typescriptServices.tsconfig.json`; - fs.writeFileSync(configFilePath, JSON.stringify(config, undefined, 2)); - tsbuild(configFilePath, false, () => { - const servicesContent = readFileSync(Paths.servicesDefinitionFile); - const servicesContentWithoutConstEnums = removeConstModifierFromEnumDeclarations(servicesContent); - fs.writeFileSync(Paths.servicesDefinitionFile, servicesContentWithoutConstEnums); - - // Also build typescript.js, typescript.js.map, and typescript.d.ts - jake.cpR(Paths.servicesFile, Paths.typescriptFile); - if (fs.existsSync(Paths.servicesFile + ".map")) { - jake.cpR(Paths.servicesFile + ".map", Paths.typescriptFile + ".map"); + "declarationMap": false, + "outFile": "typescriptServices.out.js" } + }); +}); + +// typescriptServices.js +// typescriptServices.d.ts +file(Paths.servicesFile, [TaskNames.coreBuild, ConfigFileFor.typescriptServices], function() { + tsbuild(ConfigFileFor.typescriptServices, false, () => { + if (needsUpdate([Paths.servicesOutFile, Paths.servicesDefinitionOutFile], [Paths.servicesFile, Paths.servicesDefinitionFile])) { + const copyright = readFileSync(Paths.copyright); + + let servicesDefinitionContent = readFileSync(Paths.servicesDefinitionOutFile); + servicesDefinitionContent = copyright + removeConstModifierFromEnumDeclarations(servicesDefinitionContent); + fs.writeFileSync(Paths.servicesDefinitionFile, servicesDefinitionContent, "utf8"); + + let servicesContent = readFileSync(Paths.servicesOutFile); + servicesContent = copyright + servicesContent; + fs.writeFileSync(Paths.servicesFile, servicesContent, "utf8"); + + // adjust source map for typescriptServices.js + let servicesMapContent = readFileSync(Paths.servicesOutFile + ".map"); + const map = JSON.parse(servicesMapContent); + const lineStarts = /**@type {*}*/(ts).computeLineStarts(copyright); + let prependMappings = ""; + for (let i = 1; i < lineStarts.length; i++) { + prependMappings += ";"; + } - fs.writeFileSync(Paths.typescriptDefinitionFile, servicesContentWithoutConstEnums + "\r\nexport = ts", { encoding: "utf-8" }); - // And typescript_standalone.d.ts - fs.writeFileSync(Paths.typescriptStandaloneDefinitionFile, servicesContentWithoutConstEnums.replace(/declare (namespace|module) ts(\..+)? \{/g, 'declare module "typescript" {'), { encoding: "utf-8"}); + const offset = copyright.length - lineStarts[lineStarts.length - 1]; + if (offset > 0) { + prependMappings += base64VLQFormatEncode(offset) + ","; + } + + const outputMap = { + version: map.version, + file: map.file, + sources: map.sources, + sourceRoot: map.sourceRoot, + mappings: prependMappings + map.mappings, + names: map.names, + sourcesContent: map.sourcesContent + }; + + servicesMapContent = JSON.stringify(outputMap); + fs.writeFileSync(Paths.servicesFile + ".map", servicesMapContent); + } complete(); }); +}, { async: true }); +task(Paths.servicesDefinitionFile, [Paths.servicesFile]); - function recur(configPath) { - const cfgFile = readJson(configPath); - if (cfgFile.references) { - for (const ref of cfgFile.references) { - recur(path.join(path.dirname(configPath), ref.path, "tsconfig.json")); - } - } - for (const file of cfgFile.files) { - files.push(path.join(`../../`, path.dirname(configPath), file)); +// typescript.js +// typescript.d.ts +file(Paths.typescriptFile, [Paths.servicesFile], function() { + if (needsUpdate([Paths.servicesFile, Paths.servicesDefinitionFile], [Paths.typescriptFile, Paths.typescriptDefinitionFile])) { + jake.cpR(Paths.servicesFile, Paths.typescriptFile); + if (fs.existsSync(Paths.servicesFile + ".map")) { + jake.cpR(Paths.servicesFile + ".map", Paths.typescriptFile + ".map"); } + const content = readFileSync(Paths.servicesDefinitionFile); + fs.writeFileSync(Paths.typescriptDefinitionFile, content + "\r\nexport = ts;", { encoding: "utf-8" }); } -}, { async: true }); +}); +task(Paths.typescriptDefinitionFile, [Paths.typescriptFile]); + +// typescript_standalone.d.ts +file(Paths.typescriptStandaloneDefinitionFile, [Paths.servicesDefinitionFile], function() { + if (needsUpdate(Paths.servicesDefinitionFile, Paths.typescriptStandaloneDefinitionFile)) { + const content = readFileSync(Paths.servicesDefinitionFile); + fs.writeFileSync(Paths.typescriptStandaloneDefinitionFile, content.replace(/declare (namespace|module) ts(\..+)? \{/g, 'declare module "typescript" {'), { encoding: "utf-8"}); + } +}); function getLibraryTargets() { /** @type {{ libs: string[], paths?: Record, sources?: Record }} */ @@ -765,4 +865,4 @@ function getDiffTool() { */ function removeConstModifierFromEnumDeclarations(text) { return text.replace(/^(\s*)(export )?const enum (\S+) {(\s*)$/gm, '$1$2enum $3 {$4'); -} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 638adaf2e0f2d..c180bb97ed159 100644 --- a/package-lock.json +++ b/package-lock.json @@ -5,22 +5,22 @@ "requires": true, "dependencies": { "@gulp-sourcemaps/identity-map": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.1.tgz", - "integrity": "sha1-z6I7xYQPkQTOMqZedNt+epdLvuE=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@gulp-sourcemaps/identity-map/-/identity-map-1.0.2.tgz", + "integrity": "sha512-ciiioYMLdo16ShmfHBXJBOFm3xPC4AuwO4xeRpFeHz7WK9PYsWCmigagG2XyzZpubK4a3qNKoUBDhbzHfa50LQ==", "dev": true, "requires": { - "acorn": "5.7.1", - "css": "2.2.3", - "normalize-path": "2.1.1", - "source-map": "0.5.7", - "through2": "2.0.3" + "acorn": "^5.0.3", + "css": "^2.2.1", + "normalize-path": "^2.1.1", + "source-map": "^0.6.0", + "through2": "^2.0.3" }, "dependencies": { - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -31,24 +31,24 @@ "integrity": "sha1-iQrnxdjId/bThIYCFazp1+yUW9o=", "dev": true, "requires": { - "normalize-path": "2.1.1", - "through2": "2.0.3" + "normalize-path": "^2.0.1", + "through2": "^2.0.3" } }, "@octokit/rest": { - "version": "15.9.2", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-15.9.2.tgz", - "integrity": "sha512-UpV9ZTI9ok73E0iFK+LH//c2/WIm6w/FGQ9LFF5GZFANsXut7z75LE0TCcgMZYdCS4eFm525qa3s+0INkPXigA==", - "dev": true, - "requires": { - "before-after-hook": "1.1.0", - "btoa-lite": "1.0.0", - "debug": "3.1.0", - "http-proxy-agent": "2.1.0", - "https-proxy-agent": "2.2.1", - "lodash": "4.17.10", - "node-fetch": "2.1.2", - "url-template": "2.0.8" + "version": "15.9.4", + "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-15.9.4.tgz", + "integrity": "sha512-v3CS1qW4IjriMvGgm4lDnYFBJlkwvzIbTxiipOcwVP8xeK8ih2pJofRhk7enmLngTtNEa+sIApJNkXxyyDKqLg==", + "dev": true, + "requires": { + "before-after-hook": "^1.1.0", + "btoa-lite": "^1.0.0", + "debug": "^3.1.0", + "http-proxy-agent": "^2.1.0", + "https-proxy-agent": "^2.2.0", + "lodash": "^4.17.4", + "node-fetch": "^2.1.1", + "url-template": "^2.0.8" }, "dependencies": { "debug": { @@ -74,8 +74,8 @@ "integrity": "sha512-mY6dYfq1Ns3Xqz/JFUcyoWaXtm0XDoNhkU1vCwM/ULM5zqNL+SbtacJhce/JCgPeCdbqdVqq77tJ4HwdtypSxg==", "dev": true, "requires": { - "@types/insert-module-globals": "7.0.0", - "@types/node": "8.5.5" + "@types/insert-module-globals": "*", + "@types/node": "*" } }, "@types/chai": { @@ -96,7 +96,7 @@ "integrity": "sha512-y6qRq6raBuu965clKgx6FHuiPu3oHdtmzMPXi8Uahsjdq1L6DL5fS/aY5/s71YwM7k6K1QIWvem5vNwlnNGIkQ==", "dev": true, "requires": { - "@types/glob": "5.0.35" + "@types/glob": "*" } }, "@types/events": { @@ -111,9 +111,9 @@ "integrity": "sha512-wc+VveszMLyMWFvXLkloixT4n0harUIVZjnpzztaZ0nKLuul7Z32iMt2fUFGAaZ4y1XWjFRMtCI5ewvyh4aIeg==", "dev": true, "requires": { - "@types/events": "1.2.0", - "@types/minimatch": "3.0.3", - "@types/node": "8.5.5" + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" } }, "@types/gulp": { @@ -122,9 +122,9 @@ "integrity": "sha512-u6/zWPzYRNPAtvyFJ3/RSXjmBaBM1dVs5kW22/jU6J786ZGLfSndhLoNOpFI6FGQvqTA+QzFHjSMhpkAN+wxcQ==", "dev": true, "requires": { - "@types/node": "8.5.5", - "@types/orchestrator": "0.3.2", - "@types/vinyl": "2.0.2" + "@types/node": "*", + "@types/orchestrator": "*", + "@types/vinyl": "*" } }, "@types/gulp-concat": { @@ -133,7 +133,7 @@ "integrity": "sha512-CUCFADlITzzBfBa2bdGzhKtvBr4eFh+evb+4igVbvPoO5RyPfHifmyQlZl6lM7q19+OKncRlFXDU7B4X9Ayo2g==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/gulp-help": { @@ -142,9 +142,9 @@ "integrity": "sha512-MkW7psZznxxJg2MBk2P2qHE+T8jEZVFz3FG/qGjUYazkyJt7hBJWx5Nuewmay5RVNtUvSWPrdZLr/WTXY3T/6A==", "dev": true, "requires": { - "@types/gulp": "3.8.36", - "@types/node": "8.5.5", - "@types/orchestrator": "0.3.2" + "@types/gulp": "*", + "@types/node": "*", + "@types/orchestrator": "*" } }, "@types/gulp-if": { @@ -153,8 +153,8 @@ "integrity": "sha512-J5lzff21X7r1x/4hSzn02GgIUEyjCqYIXZ9GgGBLhbsD3RiBdqwnkFWgF16/0jO5rcVZ52Zp+6MQMQdvIsWuKg==", "dev": true, "requires": { - "@types/node": "8.5.5", - "@types/vinyl": "2.0.2" + "@types/node": "*", + "@types/vinyl": "*" } }, "@types/gulp-newer": { @@ -163,7 +163,7 @@ "integrity": "sha512-e7J/Zv5Wd7CC0WpuA2syWVitgwrkG0u221e41w7r07XUR6hMH6kHPkq9tUrusHkbeW8QbuLbis5fODOwQCyggQ==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/gulp-rename": { @@ -172,7 +172,7 @@ "integrity": "sha512-FIZQvbZJj6V1gHPTzO+g/BCWpDur7fJrroae4gwV3LaoHBQ+MrR9sB+2HssK8fHv4WdY6hVNxkcft9bYatuPIA==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/gulp-sourcemaps": { @@ -181,7 +181,7 @@ "integrity": "sha512-+7BAmptW2bxyJnJcCEuie7vLoop3FwWgCdBMzyv7MYXED/HeNMeQuX7uPCkp4vfU1TTu4CYFH0IckNPvo0VePA==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/insert-module-globals": { @@ -190,7 +190,7 @@ "integrity": "sha512-zudCJPwluh1VUDB6Gl/OQdRp+fYy3+47huJB/JMQubMS2p+sH18MCVK4WUz3FqaWLB12yh5ELxVR/+tqwlm/qA==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/jake": { @@ -199,7 +199,7 @@ "integrity": "sha512-F5txkK3aW+fAi4YExGq4Q0W+jJXIhjUvqwMNFPh8kmM+ZU90S/KdDcEV4H+Ug9fHFPAVHG+veaHE8ZHmJJxHCw==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/merge2": { @@ -208,7 +208,7 @@ "integrity": "sha512-GjaXY4OultxbaOOk7lCLO7xvEcFpdjExC605YmfI6X29vhHKpJfMWKCDZd3x+BITrZaXKg97DgV/SdGVSwdzxA==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/minimatch": { @@ -229,13 +229,13 @@ "integrity": "sha512-U5icWpv7YnZYGsN4/cmh3WD2onMY0aJIiTE6+51TwJCttdHvtCYmkBNOobHlXwrJRL0nkH9jH4kD+1FAdMN4Tg==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/mocha": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.3.tgz", - "integrity": "sha512-C1wVVr7xhKu6c3Mb27dFzNYR05qvHwgtpN+JOYTGc1pKA7dCEDDYpscn7kul+bCUwa3NoGDbzI1pdznSOa397w==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.4.tgz", + "integrity": "sha512-XMHApnKWI0jvXU5gLcSTsRjJBpSzP0BG+2oGv98JFyS4a5R0tRy0oshHBRndb3BuHb9AwDKaUL8Ja7GfUvsG4g==", "dev": true }, "@types/node": { @@ -250,8 +250,8 @@ "integrity": "sha512-cKB4yTX0wGaRCSkdHDX2fkGQbMAA8UOshC2U7DQky1CE5o+5q2iQQ8VkbPbE/88uaTtsusvBPMcCX7dgmjxBhQ==", "dev": true, "requires": { - "@types/node": "8.5.5", - "@types/q": "1.5.0" + "@types/node": "*", + "@types/q": "*" } }, "@types/q": { @@ -266,8 +266,8 @@ "integrity": "sha512-XwGr1b4yCGUILKeBkzmeWcxmGHQ0vFFFpA6D6y1yLO6gKmYorF+PHqdU5KG+nWt38OvtrkDptmrSmlHX/XtpLw==", "dev": true, "requires": { - "@types/gulp": "3.8.36", - "@types/node": "8.5.5" + "@types/gulp": "*", + "@types/node": "*" } }, "@types/source-map-support": { @@ -276,7 +276,7 @@ "integrity": "sha512-eoyZxYGwaeHq5zCVeoNgY1dQy6dVdm1b7K9k1FRnWkf997Tji3NLBoLAjK5WCobeh1Qs6Q5KUV1rZCmHvzaDBw==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/through2": { @@ -285,7 +285,7 @@ "integrity": "sha1-H/LoihAN+1sUDnu5h5HxGUQA0TE=", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/travis-fold": { @@ -300,7 +300,7 @@ "integrity": "sha512-2iYpNuOl98SrLPBZfEN9Mh2JCJ2EI9HU35SfgBEb51DcmaHkhp8cKMblYeBqMQiwXMgAD3W60DbQ4i/UdLiXhw==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" } }, "@types/xml2js": { @@ -309,7 +309,17 @@ "integrity": "sha512-8aKUBSj3oGcnuiBmDLm3BIk09RYg01mz9HlQ2u4aS17oJ25DxjQrEUVGFSBVNOfM45pQW4OjcBPplq6r/exJdA==", "dev": true, "requires": { - "@types/node": "8.5.5" + "@types/node": "*" + } + }, + "JSONStream": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.3.tgz", + "integrity": "sha512-3Sp6WZZ/lXl+nTDoGpGWHEpTnnC6X5fnkolYZR6nwIfzbxxvA8utPWe1gCt7i0m9uVGsSz2IS8K8mJ7HmlduMg==", + "dev": true, + "requires": { + "jsonparse": "^1.2.0", + "through": ">=2.2.7 <3" } }, "abbrev": { @@ -319,36 +329,38 @@ "dev": true }, "acorn": { - "version": "4.0.13", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-4.0.13.tgz", - "integrity": "sha1-EFSVrlNh1pe9GVyCUZLhrX8lN4c=", + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", + "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", "dev": true }, + "acorn-dynamic-import": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", + "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", + "dev": true, + "requires": { + "acorn": "^5.0.0" + } + }, "acorn-node": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.3.0.tgz", - "integrity": "sha512-efP54n3d1aLfjL2UMdaXa6DsswwzJeI5rqhbFvXMrKiJ6eJFpf+7R0zN7t8IC+XKn2YOAFAv6xbBNgHUkoHWLw==", + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/acorn-node/-/acorn-node-1.5.2.tgz", + "integrity": "sha512-krFKvw/d1F17AN3XZbybIUzEY4YEPNiGo05AfP3dBlfVKrMHETKpgjpuZkSF8qDNt9UkQcqj7am8yJLseklCMg==", "dev": true, "requires": { - "acorn": "5.6.2", - "xtend": "4.0.1" - }, - "dependencies": { - "acorn": { - "version": "5.6.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.6.2.tgz", - "integrity": "sha512-zUzo1E5dI2Ey8+82egfnttyMlMZ2y0D8xOCO3PNPPlYXpl8NZvF6Qk9L9BEtJs+43FqEmfBViDqc5d1ckRDguw==", - "dev": true - } + "acorn": "^5.7.1", + "acorn-dynamic-import": "^3.0.0", + "xtend": "^4.0.1" } }, "agent-base": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.0.tgz", - "integrity": "sha512-c+R/U5X+2zz2+UCrCFv6odQzJdoqI+YecuhnAJLa1zYaMc13zPfwMwZrr91Pd1DYNo/yPRbiM4WVf9whgwFsIg==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, "requires": { - "es6-promisify": "5.0.0" + "es6-promisify": "^5.0.0" } }, "align-text": { @@ -357,9 +369,9 @@ "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", "dev": true, "requires": { - "kind-of": "3.2.2", - "longest": "1.0.1", - "repeat-string": "1.6.1" + "kind-of": "^3.0.2", + "longest": "^1.0.1", + "repeat-string": "^1.5.2" }, "dependencies": { "kind-of": { @@ -368,7 +380,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -380,9 +392,9 @@ "dev": true }, "ansi-colors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-2.0.1.tgz", - "integrity": "sha512-qUIXfMVe0LoHCFPD6dGtjDDuVoP7B2DWBXIfd5aN/hGNIZDndQmqCwNjCChzxi8TPPGmBV4TB3XPc0VfgR7iIQ==", + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-2.0.2.tgz", + "integrity": "sha512-lqxzclDUlcMM72ab/b4imVvMCyO+jELG+a5DPuE2qFAwGkzQilb6iEgzQPhSmNCM7onBHsq/9Mggh4HaqilTlA==", "dev": true }, "ansi-cyan": { @@ -424,7 +436,7 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.1" + "color-convert": "^1.9.0" } }, "ansi-wrap": { @@ -439,7 +451,7 @@ "integrity": "sha1-2CIM9GYIFSXv6lBhTz3mUU36WPE=", "dev": true, "requires": { - "buffer-equal": "1.0.0" + "buffer-equal": "^1.0.0" } }, "archy": { @@ -454,7 +466,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "arr-diff": { @@ -517,7 +529,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -538,9 +550,9 @@ "integrity": "sha512-p32cOF5q0Zqs9uBiONKYLm6BClCoBCM5O9JfeUSlnQLBTxYdTK+pW+nXflm8UkKd2UYlEbYz5qEi0JuZR9ckSw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "bn.js": "^4.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "assert": { @@ -581,15 +593,6 @@ "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", "dev": true }, - "astw": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz", - "integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=", - "dev": true, - "requires": { - "acorn": "4.0.13" - } - }, "async": { "version": "1.5.2", "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", @@ -608,9 +611,9 @@ "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", "dev": true, "requires": { - "chalk": "1.1.3", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^1.1.3", + "esutils": "^2.0.2", + "js-tokens": "^3.0.2" }, "dependencies": { "ansi-styles": { @@ -625,11 +628,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -652,13 +655,13 @@ "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "dev": true, "requires": { - "cache-base": "1.0.1", - "class-utils": "0.3.6", - "component-emitter": "1.2.1", - "define-property": "1.0.0", - "isobject": "3.0.1", - "mixin-deep": "1.3.1", - "pascalcase": "0.1.1" + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" }, "dependencies": { "define-property": { @@ -667,7 +670,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -676,7 +679,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -685,7 +688,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -694,9 +697,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -731,7 +734,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -741,16 +744,16 @@ "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-unique": "0.3.2", - "extend-shallow": "2.0.1", - "fill-range": "4.0.0", - "isobject": "3.0.1", - "repeat-element": "1.1.2", - "snapdragon": "0.8.2", - "snapdragon-node": "2.1.1", - "split-string": "3.1.0", - "to-regex": "3.0.2" + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -759,7 +762,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -776,12 +779,12 @@ "integrity": "sha512-erYug8XoqzU3IfcU8fUgyHqyOXqIE4tUTTQ+7mqUjQlvnXkOO6OlT9c/ZoJVHYoAaqGxr09CN53G7XIsO4KtWA==", "dev": true, "requires": { - "combine-source-map": "0.8.0", - "defined": "1.0.0", - "JSONStream": "1.3.3", - "safe-buffer": "5.1.2", - "through2": "2.0.3", - "umd": "3.0.3" + "JSONStream": "^1.0.3", + "combine-source-map": "~0.8.0", + "defined": "^1.0.0", + "safe-buffer": "^5.1.1", + "through2": "^2.0.0", + "umd": "^3.0.0" } }, "browser-resolve": { @@ -805,54 +808,54 @@ "integrity": "sha512-fMES05wq1Oukts6ksGUU2TMVHHp06LyQt0SIwbXIHm7waSrQmNBZePsU0iM/4f94zbvb/wHma+D1YrdzWYnF/A==", "dev": true, "requires": { - "assert": "1.4.1", - "browser-pack": "6.1.0", - "browser-resolve": "1.11.2", - "browserify-zlib": "0.2.0", - "buffer": "5.1.0", - "cached-path-relative": "1.0.1", - "concat-stream": "1.6.2", - "console-browserify": "1.1.0", - "constants-browserify": "1.0.0", - "crypto-browserify": "3.12.0", - "defined": "1.0.0", - "deps-sort": "2.0.0", - "domain-browser": "1.2.0", - "duplexer2": "0.1.4", - "events": "2.1.0", - "glob": "7.1.2", - "has": "1.0.3", - "htmlescape": "1.1.1", - "https-browserify": "1.0.0", - "inherits": "2.0.3", - "insert-module-globals": "7.1.0", - "JSONStream": "1.3.3", - "labeled-stream-splicer": "2.0.1", - "mkdirp": "0.5.1", - "module-deps": "6.1.0", - "os-browserify": "0.3.0", - "parents": "1.0.1", - "path-browserify": "0.0.0", - "process": "0.11.10", - "punycode": "1.4.1", - "querystring-es3": "0.2.1", - "read-only-stream": "2.0.0", - "readable-stream": "2.3.6", - "resolve": "1.1.7", - "shasum": "1.0.2", - "shell-quote": "1.6.1", - "stream-browserify": "2.0.1", - "stream-http": "2.8.3", - "string_decoder": "1.1.1", - "subarg": "1.0.0", - "syntax-error": "1.4.0", - "through2": "2.0.3", - "timers-browserify": "1.4.2", + "JSONStream": "^1.0.3", + "assert": "^1.4.0", + "browser-pack": "^6.0.1", + "browser-resolve": "^1.11.0", + "browserify-zlib": "~0.2.0", + "buffer": "^5.0.2", + "cached-path-relative": "^1.0.0", + "concat-stream": "^1.6.0", + "console-browserify": "^1.1.0", + "constants-browserify": "~1.0.0", + "crypto-browserify": "^3.0.0", + "defined": "^1.0.0", + "deps-sort": "^2.0.0", + "domain-browser": "^1.2.0", + "duplexer2": "~0.1.2", + "events": "^2.0.0", + "glob": "^7.1.0", + "has": "^1.0.0", + "htmlescape": "^1.1.0", + "https-browserify": "^1.0.0", + "inherits": "~2.0.1", + "insert-module-globals": "^7.0.0", + "labeled-stream-splicer": "^2.0.0", + "mkdirp": "^0.5.0", + "module-deps": "^6.0.0", + "os-browserify": "~0.3.0", + "parents": "^1.0.1", + "path-browserify": "~0.0.0", + "process": "~0.11.0", + "punycode": "^1.3.2", + "querystring-es3": "~0.2.0", + "read-only-stream": "^2.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.1.4", + "shasum": "^1.0.0", + "shell-quote": "^1.6.1", + "stream-browserify": "^2.0.0", + "stream-http": "^2.0.0", + "string_decoder": "^1.1.1", + "subarg": "^1.0.0", + "syntax-error": "^1.1.1", + "through2": "^2.0.0", + "timers-browserify": "^1.0.1", "tty-browserify": "0.0.1", - "url": "0.11.0", - "util": "0.10.4", - "vm-browserify": "1.0.1", - "xtend": "4.0.1" + "url": "~0.11.0", + "util": "~0.10.1", + "vm-browserify": "^1.0.0", + "xtend": "^4.0.0" } }, "browserify-aes": { @@ -861,12 +864,12 @@ "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "dev": true, "requires": { - "buffer-xor": "1.0.3", - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "browserify-cipher": { @@ -875,9 +878,9 @@ "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "dev": true, "requires": { - "browserify-aes": "1.2.0", - "browserify-des": "1.0.1", - "evp_bytestokey": "1.0.3" + "browserify-aes": "^1.0.4", + "browserify-des": "^1.0.0", + "evp_bytestokey": "^1.0.0" } }, "browserify-des": { @@ -886,9 +889,9 @@ "integrity": "sha512-zy0Cobe3hhgpiOM32Tj7KQ3Vl91m0njwsjzZQK1L+JDf11dzP9qIvjreVinsvXrgfjhStXwUWAEpB9D7Gwmayw==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "des.js": "1.0.0", - "inherits": "2.0.3" + "cipher-base": "^1.0.1", + "des.js": "^1.0.0", + "inherits": "^2.0.1" } }, "browserify-rsa": { @@ -897,8 +900,8 @@ "integrity": "sha1-IeCr+vbyApzy+vsTNWenAdQTVSQ=", "dev": true, "requires": { - "bn.js": "4.11.8", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "randombytes": "^2.0.1" } }, "browserify-sign": { @@ -907,13 +910,13 @@ "integrity": "sha1-qk62jl17ZYuqa/alfmMMvXqT0pg=", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "elliptic": "6.4.0", - "inherits": "2.0.3", - "parse-asn1": "5.1.1" + "bn.js": "^4.1.1", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.2", + "elliptic": "^6.0.0", + "inherits": "^2.0.1", + "parse-asn1": "^5.0.0" } }, "browserify-zlib": { @@ -922,7 +925,7 @@ "integrity": "sha512-Z942RysHXmJrhqk88FmKBVq/v5tqmSkDz7p54G/MGyjMnCFFnC79XWNbg+Vta8W6Wb2qtSZTSxIGkJrRpCFEiA==", "dev": true, "requires": { - "pako": "1.0.6" + "pako": "~1.0.5" } }, "btoa-lite": { @@ -937,8 +940,8 @@ "integrity": "sha512-YkIRgwsZwJWTnyQrsBTWefizHh+8GYj3kbL1BTiAQ/9pwpino0G7B2gp5tx/FUBqUlvtxV85KNR3mwfAtv15Yw==", "dev": true, "requires": { - "base64-js": "1.3.0", - "ieee754": "1.1.12" + "base64-js": "^1.0.2", + "ieee754": "^1.1.4" } }, "buffer-equal": { @@ -977,15 +980,15 @@ "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "dev": true, "requires": { - "collection-visit": "1.0.0", - "component-emitter": "1.2.1", - "get-value": "2.0.6", - "has-value": "1.0.0", - "isobject": "3.0.1", - "set-value": "2.0.0", - "to-object-path": "0.3.0", - "union-value": "1.0.0", - "unset-value": "1.0.0" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "cached-path-relative": { @@ -1008,8 +1011,8 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4", - "lazy-cache": "1.0.4" + "align-text": "^0.1.3", + "lazy-cache": "^1.0.3" } }, "chai": { @@ -1018,12 +1021,12 @@ "integrity": "sha1-D2RYS6ZC8PKs4oBiefTwbKI61zw=", "dev": true, "requires": { - "assertion-error": "1.1.0", - "check-error": "1.0.2", - "deep-eql": "3.0.1", - "get-func-name": "2.0.0", - "pathval": "1.1.0", - "type-detect": "4.0.8" + "assertion-error": "^1.0.1", + "check-error": "^1.0.1", + "deep-eql": "^3.0.0", + "get-func-name": "^2.0.0", + "pathval": "^1.0.0", + "type-detect": "^4.0.0" } }, "chalk": { @@ -1032,9 +1035,9 @@ "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "check-error": { @@ -1049,8 +1052,8 @@ "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "class-utils": { @@ -1059,10 +1062,10 @@ "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", "dev": true, "requires": { - "arr-union": "3.1.0", - "define-property": "0.2.5", - "isobject": "3.0.1", - "static-extend": "0.1.2" + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" }, "dependencies": { "define-property": { @@ -1071,7 +1074,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -1083,8 +1086,8 @@ "dev": true, "optional": true, "requires": { - "center-align": "0.1.3", - "right-align": "0.1.3", + "center-align": "^0.1.1", + "right-align": "^0.1.1", "wordwrap": "0.0.2" }, "dependencies": { @@ -1121,9 +1124,9 @@ "integrity": "sha512-Bq6+4t+lbM8vhTs/Bef5c5AdEMtapp/iFb6+s4/Hh9MVTt8OLKH7ZOOZSCT+Ys7hsHvqv0GuMPJ1lnQJVHvxpg==", "dev": true, "requires": { - "inherits": "2.0.3", - "process-nextick-args": "2.0.0", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "process-nextick-args": "^2.0.0", + "readable-stream": "^2.3.5" } }, "code-point-at": { @@ -1138,23 +1141,23 @@ "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", "dev": true, "requires": { - "map-visit": "1.0.0", - "object-visit": "1.0.1" + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" } }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.2.tgz", + "integrity": "sha512-3NUJZdhMhcdPn8vJ9v2UQJoH0qqoGUkYTgFEPZaPjEtwmmKUfNV46zZmgB2M5M4DCEQHMaCfWHCxiBflLm04Tg==", "dev": true, "requires": { - "color-name": "1.1.3" + "color-name": "1.1.1" } }, "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.1.tgz", + "integrity": "sha1-SxQVMEz1ACjqgWQ2Q72C6gWANok=", "dev": true }, "color-support": { @@ -1169,10 +1172,10 @@ "integrity": "sha1-pY0N8ELBhvz4IqjoAV9UUNLXmos=", "dev": true, "requires": { - "convert-source-map": "1.1.3", - "inline-source-map": "0.6.2", - "lodash.memoize": "3.0.4", - "source-map": "0.5.7" + "convert-source-map": "~1.1.0", + "inline-source-map": "~0.6.0", + "lodash.memoize": "~3.0.3", + "source-map": "~0.5.3" }, "dependencies": { "convert-source-map": { @@ -1207,19 +1210,19 @@ "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { - "buffer-from": "1.1.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "typedarray": "0.0.6" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, "concat-with-sourcemaps": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.0.7.tgz", - "integrity": "sha512-5i4Spc9NNvVXzkR77x2kjcYCDZMNPLzP7ZBzJMNKZjXzk+E6tRVL/lPlYw60VM3hb7gf+iBQn2x1T8TpMN0SEw==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/concat-with-sourcemaps/-/concat-with-sourcemaps-1.1.0.tgz", + "integrity": "sha512-4gEjHJFT9e+2W/77h/DS5SGUgwDaOwprX8L/gl5+3ixnzkVJJsZWDSelmN3Oilw3LNDZjZV0yqH1hLG3k6nghg==", "dev": true, "requires": { - "source-map": "0.6.1" + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -1236,7 +1239,7 @@ "integrity": "sha1-8CQcRXMKn8YyOyBtvzjtx0HQuxA=", "dev": true, "requires": { - "date-now": "0.1.4" + "date-now": "^0.1.4" } }, "constants-browserify": { @@ -1269,8 +1272,8 @@ "integrity": "sha512-GbEHQPMOswGpKXM9kCWVrremUcBmjteUaQ01T9rkKCPDXfUHX0IoP9LpHYo2NPFampa4e+/pFDc3jQdxrxQLaw==", "dev": true, "requires": { - "bn.js": "4.11.8", - "elliptic": "6.4.0" + "bn.js": "^4.1.0", + "elliptic": "^6.0.0" } }, "create-hash": { @@ -1279,11 +1282,11 @@ "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "inherits": "2.0.3", - "md5.js": "1.3.4", - "ripemd160": "2.0.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" } }, "create-hmac": { @@ -1292,12 +1295,12 @@ "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "dev": true, "requires": { - "cipher-base": "1.0.4", - "create-hash": "1.2.0", - "inherits": "2.0.3", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "cross-spawn": { @@ -1306,9 +1309,9 @@ "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", "dev": true, "requires": { - "lru-cache": "4.1.3", - "shebang-command": "1.2.0", - "which": "1.3.0" + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, "dependencies": { "lru-cache": { @@ -1317,8 +1320,8 @@ "integrity": "sha512-fFEhvcgzuIoJVUF8fYr5KR0YqxD238zgObTps31YdADwPPAp82a4M8TrckkWyx7ekNlf9aBcVn81cFwwXngrJA==", "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } } } @@ -1329,17 +1332,17 @@ "integrity": "sha512-fz4spIh+znjO2VjL+IdhEpRJ3YN6sMzITSBijk6FK2UvTqruSQW+/cCZTSNsMiZNvUeq0CqurF+dAbyiGOY6Wg==", "dev": true, "requires": { - "browserify-cipher": "1.0.1", - "browserify-sign": "4.0.4", - "create-ecdh": "4.0.3", - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "diffie-hellman": "5.0.3", - "inherits": "2.0.3", - "pbkdf2": "3.0.16", - "public-encrypt": "4.0.2", - "randombytes": "2.0.6", - "randomfill": "1.0.4" + "browserify-cipher": "^1.0.0", + "browserify-sign": "^4.0.0", + "create-ecdh": "^4.0.0", + "create-hash": "^1.1.0", + "create-hmac": "^1.1.0", + "diffie-hellman": "^5.0.0", + "inherits": "^2.0.1", + "pbkdf2": "^3.0.3", + "public-encrypt": "^4.0.0", + "randombytes": "^2.0.0", + "randomfill": "^1.0.3" } }, "css": { @@ -1348,10 +1351,10 @@ "integrity": "sha512-0W171WccAjQGGTKLhw4m2nnl0zPHUlTO/I8td4XzJgIB8Hg3ZZx71qT4G4eX8OVsSiaAKiUMy73E3nsbPlg2DQ==", "dev": true, "requires": { - "inherits": "2.0.3", - "source-map": "0.1.43", - "source-map-resolve": "0.5.1", - "urix": "0.1.0" + "inherits": "^2.0.1", + "source-map": "^0.1.38", + "source-map-resolve": "^0.5.1", + "urix": "^0.1.0" }, "dependencies": { "source-map": { @@ -1360,7 +1363,7 @@ "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -1371,7 +1374,7 @@ "integrity": "sha1-dUu1v+VUUdpppYuU1F9MWwRi1Y8=", "dev": true, "requires": { - "es5-ext": "0.10.45" + "es5-ext": "^0.10.9" } }, "date-now": { @@ -1401,9 +1404,9 @@ "integrity": "sha512-GZqvGIgKNlUnHUPQhepnUZFIMoi3dgZKQBzKDeL2g7oJF9SNAji/AAu36dusFUas0O+pae74lNeoIPHqXWDkLg==", "dev": true, "requires": { - "debug": "3.1.0", - "memoizee": "0.4.12", - "object-assign": "4.1.1" + "debug": "3.X", + "memoizee": "0.4.X", + "object-assign": "4.X" }, "dependencies": { "debug": { @@ -1435,7 +1438,7 @@ "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, "requires": { - "type-detect": "4.0.8" + "type-detect": "^4.0.0" } }, "deep-is": { @@ -1450,7 +1453,7 @@ "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", "dev": true, "requires": { - "clone": "1.0.4" + "clone": "^1.0.2" } }, "define-properties": { @@ -1459,8 +1462,8 @@ "integrity": "sha1-g6c/L+pWmJj7c3GTyPhzyvbUXJQ=", "dev": true, "requires": { - "foreach": "2.0.5", - "object-keys": "1.0.12" + "foreach": "^2.0.5", + "object-keys": "^1.0.8" } }, "define-property": { @@ -1469,8 +1472,8 @@ "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", "dev": true, "requires": { - "is-descriptor": "1.0.2", - "isobject": "3.0.1" + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" }, "dependencies": { "is-accessor-descriptor": { @@ -1479,7 +1482,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1488,7 +1491,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1497,9 +1500,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -1516,12 +1519,12 @@ "integrity": "sha1-U+z2mf/LyzljdpGrE7rxYIGXZuU=", "dev": true, "requires": { - "globby": "6.1.0", - "is-path-cwd": "1.0.0", - "is-path-in-cwd": "1.0.1", - "p-map": "1.2.0", - "pify": "3.0.0", - "rimraf": "2.6.2" + "globby": "^6.1.0", + "is-path-cwd": "^1.0.0", + "is-path-in-cwd": "^1.0.0", + "p-map": "^1.1.1", + "pify": "^3.0.0", + "rimraf": "^2.2.8" } }, "deprecated": { @@ -1536,10 +1539,10 @@ "integrity": "sha1-CRckkC6EZYJg65EHSMzNGvbiH7U=", "dev": true, "requires": { - "JSONStream": "1.3.3", - "shasum": "1.0.2", - "subarg": "1.0.0", - "through2": "2.0.3" + "JSONStream": "^1.0.3", + "shasum": "^1.0.0", + "subarg": "^1.0.0", + "through2": "^2.0.0" } }, "des.js": { @@ -1548,8 +1551,8 @@ "integrity": "sha1-wHTS4qpqipoH29YfmhXCzYPsjsw=", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0" } }, "detect-file": { @@ -1570,9 +1573,9 @@ "integrity": "sha512-TFHMqfOvxlgrfVzTEkNBSh9SvSNX/HfF4OFI2QFGCyPm02EsyILqnUeb5P6q7JZ3SFNTBL5t2sePRgrN4epUWQ==", "dev": true, "requires": { - "acorn-node": "1.3.0", - "defined": "1.0.0", - "minimist": "1.2.0" + "acorn-node": "^1.3.0", + "defined": "^1.0.0", + "minimist": "^1.1.1" } }, "diff": { @@ -1587,9 +1590,9 @@ "integrity": "sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==", "dev": true, "requires": { - "bn.js": "4.11.8", - "miller-rabin": "4.0.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "miller-rabin": "^4.0.0", + "randombytes": "^2.0.0" } }, "domain-browser": { @@ -1604,7 +1607,7 @@ "integrity": "sha1-ixLauHjA1p4+eJEFFmKjL8a93ME=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "duplexify": { @@ -1613,10 +1616,10 @@ "integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "stream-shift": "1.0.0" + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" }, "dependencies": { "end-of-stream": { @@ -1625,7 +1628,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } } } @@ -1636,13 +1639,13 @@ "integrity": "sha1-ysmvh2LIWDYYcAPI3+GT5eLq5d8=", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0", - "hash.js": "1.1.3", - "hmac-drbg": "1.0.1", - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "end-of-stream": { @@ -1651,7 +1654,7 @@ "integrity": "sha1-jhdyBsPICDfYVjLouTWd/osvbq8=", "dev": true, "requires": { - "once": "1.3.3" + "once": "~1.3.0" }, "dependencies": { "once": { @@ -1660,7 +1663,7 @@ "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } } } @@ -1671,9 +1674,9 @@ "integrity": "sha512-FkfM6Vxxfmztilbxxz5UKSD4ICMf5tSpRFtDNtkAhOxZ0EKtX6qwmXNyH/sFyIbX2P/nU5AMiA9jilWsUGJzCQ==", "dev": true, "requires": { - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1", - "next-tick": "1.0.0" + "es6-iterator": "~2.0.3", + "es6-symbol": "~3.1.1", + "next-tick": "1" } }, "es6-iterator": { @@ -1682,26 +1685,24 @@ "integrity": "sha1-p96IkUGgWpSwhUQDstCg+/qY87c=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.45", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.35", + "es6-symbol": "^3.1.1" } }, + "es6-promise": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", + "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", + "dev": true + }, "es6-promisify": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { - "es6-promise": "4.2.4" - }, - "dependencies": { - "es6-promise": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.4.tgz", - "integrity": "sha512-/NdNZVJg+uZgtm9eS3O6lrOLYmQag2DjdEXuPaHlZ6RuVqgqaVZfgYCepEIKsLqwdQArOPtC3XzRLqGGfT8KQQ==", - "dev": true - } + "es6-promise": "^4.0.3" } }, "es6-symbol": { @@ -1710,8 +1711,8 @@ "integrity": "sha1-vwDvT9q2uhtG7Le2KbTH7VcVzHc=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.45" + "d": "1", + "es5-ext": "~0.10.14" } }, "es6-weak-map": { @@ -1720,10 +1721,10 @@ "integrity": "sha1-XjqzIlH/0VOKH45f+hNXdy+S2W8=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.45", - "es6-iterator": "2.0.3", - "es6-symbol": "3.1.1" + "d": "1", + "es5-ext": "^0.10.14", + "es6-iterator": "^2.0.1", + "es6-symbol": "^3.1.1" } }, "escape-string-regexp": { @@ -1738,11 +1739,11 @@ "integrity": "sha1-WltTr0aTEQvrsIZ6o0MN07cKEBg=", "dev": true, "requires": { - "esprima": "2.7.3", - "estraverse": "1.9.3", - "esutils": "2.0.2", - "optionator": "0.8.2", - "source-map": "0.2.0" + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1", + "source-map": "~0.2.0" }, "dependencies": { "source-map": { @@ -1752,7 +1753,7 @@ "dev": true, "optional": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -1781,8 +1782,8 @@ "integrity": "sha1-34xp7vFkeSPHFXuc6DhAYQsCzDk=", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.45" + "d": "1", + "es5-ext": "~0.10.14" } }, "events": { @@ -1797,8 +1798,8 @@ "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "dev": true, "requires": { - "md5.js": "1.3.4", - "safe-buffer": "5.1.2" + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" } }, "execa": { @@ -1807,13 +1808,13 @@ "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", "dev": true, "requires": { - "cross-spawn": "5.1.0", - "get-stream": "3.0.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" } }, "expand-brackets": { @@ -1822,13 +1823,13 @@ "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", "dev": true, "requires": { - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "posix-character-classes": "0.1.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -1837,7 +1838,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -1846,7 +1847,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -1857,7 +1858,7 @@ "integrity": "sha1-l+gBqgUt8CRU3kawK/YhZCzchQI=", "dev": true, "requires": { - "homedir-polyfill": "1.0.1" + "homedir-polyfill": "^1.0.1" } }, "extend": { @@ -1872,8 +1873,8 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "dev": true, "requires": { - "assign-symbols": "1.0.0", - "is-extendable": "1.0.1" + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -1882,7 +1883,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -1893,14 +1894,14 @@ "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", "dev": true, "requires": { - "array-unique": "0.3.2", - "define-property": "1.0.0", - "expand-brackets": "2.1.4", - "extend-shallow": "2.0.1", - "fragment-cache": "0.2.1", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" }, "dependencies": { "define-property": { @@ -1909,7 +1910,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "extend-shallow": { @@ -1918,7 +1919,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "is-accessor-descriptor": { @@ -1927,7 +1928,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -1936,7 +1937,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -1945,9 +1946,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -1958,9 +1959,9 @@ "integrity": "sha1-9BEl49hPLn2JpD0G2VjI94vha+E=", "dev": true, "requires": { - "ansi-gray": "0.1.1", - "color-support": "1.1.3", - "time-stamp": "1.1.0" + "ansi-gray": "^0.1.1", + "color-support": "^1.1.3", + "time-stamp": "^1.0.0" } }, "fast-levenshtein": { @@ -1975,8 +1976,8 @@ "integrity": "sha1-WKZBrR9XV0on/oekQO8xiDS1Vxk=", "dev": true, "requires": { - "minimatch": "3.0.4", - "utilities": "0.0.37" + "minimatch": "^3.0.3", + "utilities": "^0.0.37" }, "dependencies": { "utilities": { @@ -1993,10 +1994,10 @@ "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-number": "3.0.0", - "repeat-string": "1.6.1", - "to-regex-range": "2.1.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" }, "dependencies": { "extend-shallow": { @@ -2005,7 +2006,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -2022,7 +2023,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "findup-sync": { @@ -2031,10 +2032,10 @@ "integrity": "sha1-kyaxSIwi0aYIhlCoaQGy2akKLLw=", "dev": true, "requires": { - "detect-file": "1.0.0", - "is-glob": "3.1.0", - "micromatch": "3.1.10", - "resolve-dir": "1.0.1" + "detect-file": "^1.0.0", + "is-glob": "^3.1.0", + "micromatch": "^3.0.4", + "resolve-dir": "^1.0.1" } }, "fined": { @@ -2043,11 +2044,11 @@ "integrity": "sha1-s33IRLdqL15wgeiE98CuNE8VNHY=", "dev": true, "requires": { - "expand-tilde": "2.0.2", - "is-plain-object": "2.0.4", - "object.defaults": "1.1.0", - "object.pick": "1.3.0", - "parse-filepath": "1.0.2" + "expand-tilde": "^2.0.2", + "is-plain-object": "^2.0.3", + "object.defaults": "^1.1.0", + "object.pick": "^1.2.0", + "parse-filepath": "^1.0.1" } }, "first-chunk-stream": { @@ -2068,8 +2069,8 @@ "integrity": "sha512-calZMC10u0FMUqoiunI2AiGIIUtUIvifNwkHhNupZH4cbNnW1Itkoh/Nf5HFYmDrwWPjrUxpkZT0KhuCq0jmGw==", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.4" } }, "for-in": { @@ -2084,7 +2085,7 @@ "integrity": "sha1-xjMy9BXO3EsE2/5wz4NklMU8tEs=", "dev": true, "requires": { - "for-in": "1.0.2" + "for-in": "^1.0.1" } }, "foreach": { @@ -2105,7 +2106,7 @@ "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", "dev": true, "requires": { - "map-cache": "0.2.2" + "map-cache": "^0.2.2" } }, "fs-extra": { @@ -2114,9 +2115,9 @@ "integrity": "sha512-GnyIkKhhzXZUWFCaJzvyDLEEgDkPfb4/TPvJCJVuS8MWZgoSsErf++QpiAlDnKFcqhRlm+tIOcencCjyJE6ZCA==", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "jsonfile": "4.0.0", - "universalify": "0.1.1" + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" }, "dependencies": { "graceful-fs": { @@ -2133,8 +2134,8 @@ "integrity": "sha1-C3gV/DIBxqaeFNuYzgmMFpNSWes=", "dev": true, "requires": { - "graceful-fs": "4.1.11", - "through2": "2.0.3" + "graceful-fs": "^4.1.11", + "through2": "^2.0.3" }, "dependencies": { "graceful-fs": { @@ -2163,9 +2164,15 @@ "integrity": "sha1-QLcJU30k0dRXZ9takIaJ3+aaxE8=", "dev": true, "requires": { - "globule": "0.1.0" + "globule": "~0.1.0" } }, + "get-assigned-identifiers": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-assigned-identifiers/-/get-assigned-identifiers-1.2.0.tgz", + "integrity": "sha512-mBBwmeGTrxEMO4pMaaf/uUEFHnYtwr8FTe8Y/mer4rcV/bye0qGm6pw1bGZFGStxC5O76c5ZAVBGnqHmOaJpdQ==", + "dev": true + }, "get-caller-file": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.2.tgz", @@ -2196,12 +2203,12 @@ "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "glob-parent": { @@ -2210,8 +2217,8 @@ "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "dev": true, "requires": { - "is-glob": "3.1.0", - "path-dirname": "1.0.2" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" } }, "glob-stream": { @@ -2220,12 +2227,12 @@ "integrity": "sha1-kXCl8St5Awb9/lmPMT+PeVT9FDs=", "dev": true, "requires": { - "glob": "4.5.3", - "glob2base": "0.0.12", - "minimatch": "2.0.10", - "ordered-read-streams": "0.1.0", - "through2": "0.6.5", - "unique-stream": "1.0.0" + "glob": "^4.3.1", + "glob2base": "^0.0.12", + "minimatch": "^2.0.1", + "ordered-read-streams": "^0.1.0", + "through2": "^0.6.1", + "unique-stream": "^1.0.0" }, "dependencies": { "glob": { @@ -2234,10 +2241,10 @@ "integrity": "sha1-xstz0yJsHv7wTePFbQEvAzd+4V8=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "2.0.10", - "once": "1.4.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^2.0.1", + "once": "^1.3.0" } }, "isarray": { @@ -2252,7 +2259,7 @@ "integrity": "sha1-jQh8OcazjAAbl/ynzm0OHoCvusc=", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.0.0" } }, "readable-stream": { @@ -2261,10 +2268,10 @@ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -2279,8 +2286,8 @@ "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } } } @@ -2291,7 +2298,7 @@ "integrity": "sha1-uVtKjfdLOcgymLDAXJeLTZo7cQs=", "dev": true, "requires": { - "gaze": "0.5.2" + "gaze": "^0.5.1" } }, "glob2base": { @@ -2300,7 +2307,7 @@ "integrity": "sha1-nUGbPijxLoOjYhZKJ3BVkiycDVY=", "dev": true, "requires": { - "find-index": "0.1.1" + "find-index": "^0.1.1" } }, "global-modules": { @@ -2309,9 +2316,9 @@ "integrity": "sha512-sKzpEkf11GpOFuw0Zzjzmt4B4UZwjOcG757PPvrfhxcLFbq0wpsgpOqxpxtxFiCG4DtG93M6XRVbF2oGdev7bg==", "dev": true, "requires": { - "global-prefix": "1.0.2", - "is-windows": "1.0.2", - "resolve-dir": "1.0.1" + "global-prefix": "^1.0.1", + "is-windows": "^1.0.1", + "resolve-dir": "^1.0.0" } }, "global-prefix": { @@ -2320,11 +2327,11 @@ "integrity": "sha1-2/dDxsFJklk8ZVVoy2btMsASLr4=", "dev": true, "requires": { - "expand-tilde": "2.0.2", - "homedir-polyfill": "1.0.1", - "ini": "1.3.5", - "is-windows": "1.0.2", - "which": "1.3.0" + "expand-tilde": "^2.0.2", + "homedir-polyfill": "^1.0.1", + "ini": "^1.3.4", + "is-windows": "^1.0.1", + "which": "^1.2.14" } }, "globby": { @@ -2333,11 +2340,11 @@ "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "dev": true, "requires": { - "array-union": "1.0.2", - "glob": "7.1.2", - "object-assign": "4.1.1", - "pify": "2.3.0", - "pinkie-promise": "2.0.1" + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" }, "dependencies": { "pify": { @@ -2354,9 +2361,9 @@ "integrity": "sha1-2cjt3h2nnRJaFRt5UzuXhnY0auU=", "dev": true, "requires": { - "glob": "3.1.21", - "lodash": "1.0.2", - "minimatch": "0.2.14" + "glob": "~3.1.21", + "lodash": "~1.0.1", + "minimatch": "~0.2.11" }, "dependencies": { "glob": { @@ -2365,9 +2372,9 @@ "integrity": "sha1-0p4KBV3qUTj00H7UDomC6DwgZs0=", "dev": true, "requires": { - "graceful-fs": "1.2.3", - "inherits": "1.0.2", - "minimatch": "0.2.14" + "graceful-fs": "~1.2.0", + "inherits": "1", + "minimatch": "~0.2.11" } }, "graceful-fs": { @@ -2388,8 +2395,8 @@ "integrity": "sha1-x054BXT2PG+aCQ6Q775u9TpqdWo=", "dev": true, "requires": { - "lru-cache": "2.7.3", - "sigmund": "1.0.1" + "lru-cache": "2", + "sigmund": "~1.0.0" } } } @@ -2400,7 +2407,7 @@ "integrity": "sha512-ynYqXLoluBKf9XGR1gA59yEJisIL7YHEH4xr3ZziHB5/yl4qWfaK8Js9jGe6gBGCSCKVqiyO30WnRZADvemUNw==", "dev": true, "requires": { - "sparkles": "1.0.0" + "sparkles": "^1.0.0" } }, "graceful-fs": { @@ -2409,7 +2416,7 @@ "integrity": "sha1-dhPHeKGv6mLyXGMKCG1/Osu92Bg=", "dev": true, "requires": { - "natives": "1.1.3" + "natives": "^1.1.0" } }, "growl": { @@ -2424,19 +2431,19 @@ "integrity": "sha1-VxzkWSjdQK9lFPxAEYZgFsE4RbQ=", "dev": true, "requires": { - "archy": "1.0.0", - "chalk": "1.1.3", - "deprecated": "0.0.1", - "gulp-util": "3.0.8", - "interpret": "1.1.0", - "liftoff": "2.5.0", - "minimist": "1.2.0", - "orchestrator": "0.3.8", - "pretty-hrtime": "1.0.3", - "semver": "4.3.6", - "tildify": "1.2.0", - "v8flags": "2.1.1", - "vinyl-fs": "0.3.14" + "archy": "^1.0.0", + "chalk": "^1.0.0", + "deprecated": "^0.0.1", + "gulp-util": "^3.0.0", + "interpret": "^1.0.0", + "liftoff": "^2.1.0", + "minimist": "^1.1.0", + "orchestrator": "^0.3.0", + "pretty-hrtime": "^1.0.0", + "semver": "^4.1.0", + "tildify": "^1.0.0", + "v8flags": "^2.0.2", + "vinyl-fs": "^0.3.0" }, "dependencies": { "ansi-styles": { @@ -2451,11 +2458,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "supports-color": { @@ -2472,8 +2479,8 @@ "integrity": "sha512-SLg/KsHBbinR/pCX3PF5l1YlR28hLp0X+bcpf77PtMJ6zvAQ5kRjtCPV5Wt1wHXsXWZN0eTUZ15R8ZYpi/CdCA==", "dev": true, "requires": { - "plugin-error": "0.1.2", - "through2": "2.0.3" + "plugin-error": "^0.1.2", + "through2": "^2.0.3" }, "dependencies": { "arr-diff": { @@ -2482,8 +2489,8 @@ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" } }, "arr-union": { @@ -2504,7 +2511,7 @@ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", "dev": true, "requires": { - "kind-of": "1.1.0" + "kind-of": "^1.1.0" } }, "kind-of": { @@ -2519,11 +2526,11 @@ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", "dev": true, "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" } } } @@ -2534,9 +2541,9 @@ "integrity": "sha1-Yz0WyV2IUEYorQJmVmPO5aR5M1M=", "dev": true, "requires": { - "concat-with-sourcemaps": "1.0.7", - "through2": "2.0.3", - "vinyl": "2.1.0" + "concat-with-sourcemaps": "^1.0.0", + "through2": "^2.0.0", + "vinyl": "^2.0.0" } }, "gulp-help": { @@ -2545,8 +2552,8 @@ "integrity": "sha1-Jh2xhuGDl/7z9qLCLpwxW/qIrgw=", "dev": true, "requires": { - "chalk": "1.1.3", - "object-assign": "3.0.0" + "chalk": "^1.0.0", + "object-assign": "^3.0.0" }, "dependencies": { "ansi-styles": { @@ -2561,11 +2568,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "object-assign": { @@ -2588,9 +2595,9 @@ "integrity": "sha1-pJe351cwBQQcqivIt92jyARE1ik=", "dev": true, "requires": { - "gulp-match": "1.0.3", - "ternary-stream": "2.0.1", - "through2": "2.0.3" + "gulp-match": "^1.0.3", + "ternary-stream": "^2.0.1", + "through2": "^2.0.1" } }, "gulp-insert": { @@ -2599,7 +2606,7 @@ "integrity": "sha1-MjE/E+SiPPWsylzl8MCAkjx3hgI=", "dev": true, "requires": { - "readable-stream": "1.1.14", + "readable-stream": "^1.0.26-4", "streamqueue": "0.0.6" }, "dependencies": { @@ -2615,10 +2622,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -2635,7 +2642,7 @@ "integrity": "sha1-kcfA1/Kb7NZgbVfYCn+Hdqh6uo4=", "dev": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.3" } }, "gulp-newer": { @@ -2644,9 +2651,9 @@ "integrity": "sha512-h79fGO55S/P9eAADbLAP9aTtVYpLSR1ONj08VPaSdVVNVYhTS8p1CO1TW7kEMu+hC+sytmCqcUr5LesvZEtDoQ==", "dev": true, "requires": { - "glob": "7.1.2", - "kew": "0.7.0", - "plugin-error": "0.1.2" + "glob": "^7.0.3", + "kew": "^0.7.0", + "plugin-error": "^0.1.2" }, "dependencies": { "arr-diff": { @@ -2655,8 +2662,8 @@ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" } }, "arr-union": { @@ -2677,7 +2684,7 @@ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", "dev": true, "requires": { - "kind-of": "1.1.0" + "kind-of": "^1.1.0" } }, "kind-of": { @@ -2692,11 +2699,11 @@ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", "dev": true, "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" } } } @@ -2713,25 +2720,19 @@ "integrity": "sha1-y7IAhFCxvM5s0jv5gze+dRv24wo=", "dev": true, "requires": { - "@gulp-sourcemaps/identity-map": "1.0.1", - "@gulp-sourcemaps/map-sources": "1.0.0", - "acorn": "5.7.1", - "convert-source-map": "1.5.1", - "css": "2.2.3", - "debug-fabulous": "1.1.0", - "detect-newline": "2.1.0", - "graceful-fs": "4.1.11", - "source-map": "0.6.1", - "strip-bom-string": "1.0.0", - "through2": "2.0.3" + "@gulp-sourcemaps/identity-map": "1.X", + "@gulp-sourcemaps/map-sources": "1.X", + "acorn": "5.X", + "convert-source-map": "1.X", + "css": "2.X", + "debug-fabulous": "1.X", + "detect-newline": "2.X", + "graceful-fs": "4.X", + "source-map": "~0.6.0", + "strip-bom-string": "1.X", + "through2": "2.X" }, "dependencies": { - "acorn": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz", - "integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==", - "dev": true - }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", @@ -2747,17 +2748,17 @@ } }, "gulp-typescript": { - "version": "5.0.0-alpha.2", - "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.0-alpha.2.tgz", - "integrity": "sha512-B4kcjtODEthCTdt0VYzCFQtM4fm9i/up0Mh1n63SX9j9orI6fEuwEyvKwAanmjjPOpCq8zbn77scIgpoXBULqA==", + "version": "5.0.0-alpha.3", + "resolved": "https://registry.npmjs.org/gulp-typescript/-/gulp-typescript-5.0.0-alpha.3.tgz", + "integrity": "sha512-6iSBjqBXAUqRsLUh/9XtlOnSzpPMbLrr5rqGj4UPLtGpDwFHW/fVTuRgv6LAWiKesLIUDDM0ourxvcpu2trecQ==", "dev": true, "requires": { - "ansi-colors": "2.0.1", - "plugin-error": "1.0.1", - "source-map": "0.7.3", - "through2": "2.0.3", - "vinyl": "2.1.0", - "vinyl-fs": "3.0.3" + "ansi-colors": "^2.0.2", + "plugin-error": "^1.0.1", + "source-map": "^0.7.3", + "through2": "^2.0.3", + "vinyl": "^2.1.0", + "vinyl-fs": "^3.0.3" }, "dependencies": { "glob-stream": { @@ -2766,16 +2767,16 @@ "integrity": "sha1-cEXJlBOz65SIjYOrRtC0BMx73eQ=", "dev": true, "requires": { - "extend": "3.0.1", - "glob": "7.1.2", - "glob-parent": "3.1.0", - "is-negated-glob": "1.0.0", - "ordered-read-streams": "1.0.1", - "pumpify": "1.5.1", - "readable-stream": "2.3.6", - "remove-trailing-separator": "1.1.0", - "to-absolute-glob": "2.0.2", - "unique-stream": "2.2.1" + "extend": "^3.0.0", + "glob": "^7.1.1", + "glob-parent": "^3.1.0", + "is-negated-glob": "^1.0.0", + "ordered-read-streams": "^1.0.0", + "pumpify": "^1.3.5", + "readable-stream": "^2.1.5", + "remove-trailing-separator": "^1.0.1", + "to-absolute-glob": "^2.0.0", + "unique-stream": "^2.0.2" } }, "graceful-fs": { @@ -2790,7 +2791,7 @@ "integrity": "sha1-mnWdOcXy/1A/1TAGRu1EX4jE+a8=", "dev": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "ordered-read-streams": { @@ -2799,7 +2800,7 @@ "integrity": "sha1-d8DLN8QVJdZBZtmQ/61+xqDhNj4=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.1" } }, "source-map": { @@ -2814,8 +2815,8 @@ "integrity": "sha1-WqADz76Uxf+GbE59ZouxxNuts2k=", "dev": true, "requires": { - "json-stable-stringify": "1.0.1", - "through2-filter": "2.0.0" + "json-stable-stringify": "^1.0.0", + "through2-filter": "^2.0.0" } }, "vinyl-fs": { @@ -2824,23 +2825,23 @@ "integrity": "sha512-vIu34EkyNyJxmP0jscNzWBSygh7VWhqun6RmqVfXePrOwi9lhvRs//dOaGOTRUQr4tx7/zd26Tk5WeSVZitgng==", "dev": true, "requires": { - "fs-mkdirp-stream": "1.0.0", - "glob-stream": "6.1.0", - "graceful-fs": "4.1.11", - "is-valid-glob": "1.0.0", - "lazystream": "1.0.0", - "lead": "1.0.0", - "object.assign": "4.1.0", - "pumpify": "1.5.1", - "readable-stream": "2.3.6", - "remove-bom-buffer": "3.0.0", - "remove-bom-stream": "1.2.0", - "resolve-options": "1.1.0", - "through2": "2.0.3", - "to-through": "2.0.0", - "value-or-function": "3.0.0", - "vinyl": "2.1.0", - "vinyl-sourcemap": "1.1.0" + "fs-mkdirp-stream": "^1.0.0", + "glob-stream": "^6.1.0", + "graceful-fs": "^4.0.0", + "is-valid-glob": "^1.0.0", + "lazystream": "^1.0.0", + "lead": "^1.0.0", + "object.assign": "^4.0.4", + "pumpify": "^1.3.5", + "readable-stream": "^2.3.3", + "remove-bom-buffer": "^3.0.0", + "remove-bom-stream": "^1.2.0", + "resolve-options": "^1.1.0", + "through2": "^2.0.0", + "to-through": "^2.0.0", + "value-or-function": "^3.0.0", + "vinyl": "^2.0.0", + "vinyl-sourcemap": "^1.1.0" } } } @@ -2851,24 +2852,24 @@ "integrity": "sha1-AFTh50RQLifATBh8PsxQXdVLu08=", "dev": true, "requires": { - "array-differ": "1.0.0", - "array-uniq": "1.0.3", - "beeper": "1.1.1", - "chalk": "1.1.3", - "dateformat": "2.2.0", - "fancy-log": "1.3.2", - "gulplog": "1.0.0", - "has-gulplog": "0.1.0", - "lodash._reescape": "3.0.0", - "lodash._reevaluate": "3.0.0", - "lodash._reinterpolate": "3.0.0", - "lodash.template": "3.6.2", - "minimist": "1.2.0", - "multipipe": "0.1.2", - "object-assign": "3.0.0", + "array-differ": "^1.0.0", + "array-uniq": "^1.0.2", + "beeper": "^1.0.0", + "chalk": "^1.0.0", + "dateformat": "^2.0.0", + "fancy-log": "^1.1.0", + "gulplog": "^1.0.0", + "has-gulplog": "^0.1.0", + "lodash._reescape": "^3.0.0", + "lodash._reevaluate": "^3.0.0", + "lodash._reinterpolate": "^3.0.0", + "lodash.template": "^3.0.0", + "minimist": "^1.1.0", + "multipipe": "^0.1.2", + "object-assign": "^3.0.0", "replace-ext": "0.0.1", - "through2": "2.0.3", - "vinyl": "0.5.3" + "through2": "^2.0.0", + "vinyl": "^0.5.0" }, "dependencies": { "ansi-styles": { @@ -2883,11 +2884,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "object-assign": { @@ -2908,8 +2909,8 @@ "integrity": "sha1-sEVbOPxeDPMNQyUTLkYZcMIJHN4=", "dev": true, "requires": { - "clone": "1.0.4", - "clone-stats": "0.0.1", + "clone": "^1.0.0", + "clone-stats": "^0.0.1", "replace-ext": "0.0.1" } } @@ -2921,7 +2922,7 @@ "integrity": "sha1-4oxNRdBey77YGDY86PnFkmIp/+U=", "dev": true, "requires": { - "glogg": "1.0.1" + "glogg": "^1.0.0" } }, "handlebars": { @@ -2930,10 +2931,10 @@ "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", "dev": true, "requires": { - "async": "1.5.2", - "optimist": "0.6.1", - "source-map": "0.4.4", - "uglify-js": "2.8.29" + "async": "^1.4.0", + "optimist": "^0.6.1", + "source-map": "^0.4.4", + "uglify-js": "^2.6" }, "dependencies": { "source-map": { @@ -2942,7 +2943,7 @@ "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", "dev": true, "requires": { - "amdefine": "1.0.1" + "amdefine": ">=0.0.4" } } } @@ -2953,7 +2954,7 @@ "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-ansi": { @@ -2962,7 +2963,7 @@ "integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "has-color": { @@ -2983,7 +2984,7 @@ "integrity": "sha1-ZBTIKRNpfaUVkDl9r7EvIpZ4Ec4=", "dev": true, "requires": { - "sparkles": "1.0.0" + "sparkles": "^1.0.0" } }, "has-symbols": { @@ -2998,9 +2999,9 @@ "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "1.0.0", - "isobject": "3.0.1" + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" } }, "has-values": { @@ -3009,8 +3010,8 @@ "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", "dev": true, "requires": { - "is-number": "3.0.0", - "kind-of": "4.0.0" + "is-number": "^3.0.0", + "kind-of": "^4.0.0" }, "dependencies": { "kind-of": { @@ -3019,7 +3020,7 @@ "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3030,18 +3031,18 @@ "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.4.tgz", + "integrity": "sha512-A6RlQvvZEtFS5fLU43IDu0QUmBy+fDO9VMdTXvufKwIkt/rFfvICAViCax5fbDO4zdNzaC3/27ZhKUok5bAJyw==", "dev": true, "requires": { - "inherits": "2.0.3", - "minimalistic-assert": "1.0.1" + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" } }, "he": { @@ -3056,9 +3057,9 @@ "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "dev": true, "requires": { - "hash.js": "1.1.3", - "minimalistic-assert": "1.0.1", - "minimalistic-crypto-utils": "1.0.1" + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" } }, "homedir-polyfill": { @@ -3067,7 +3068,7 @@ "integrity": "sha1-TCu8inWJmP7r9e1oWA921GdotLw=", "dev": true, "requires": { - "parse-passwd": "1.0.0" + "parse-passwd": "^1.0.0" } }, "htmlescape": { @@ -3082,7 +3083,7 @@ "integrity": "sha512-qwHbBLV7WviBl0rQsOzH6o5lwyOIvwp/BdFnvVxXORldu5TmjFfjzBcWUWS5kWAZhmv+JtiDhSuQCp4sBfbIgg==", "dev": true, "requires": { - "agent-base": "4.2.0", + "agent-base": "4", "debug": "3.1.0" }, "dependencies": { @@ -3109,8 +3110,8 @@ "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, "requires": { - "agent-base": "4.2.0", - "debug": "3.1.0" + "agent-base": "^4.1.0", + "debug": "^3.1.0" }, "dependencies": { "debug": { @@ -3136,8 +3137,8 @@ "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -3158,24 +3159,25 @@ "integrity": "sha1-+Tk0ccGKedFyT4Y/o4tYY3Ct4qU=", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "~0.5.3" } }, "insert-module-globals": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.1.0.tgz", - "integrity": "sha512-LbYZdybvKjbbcKLp03lB323Cgc8f0iL0Rjh8U6JZ7K1gZSf7MxQH191iCNUcLX4qIQ6/yWe4Q4ZsQ+opcReNFg==", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/insert-module-globals/-/insert-module-globals-7.2.0.tgz", + "integrity": "sha512-VE6NlW+WGn2/AeOMd496AHFYmE7eLKkUY6Ty31k4og5vmA3Fjuwe9v6ifH6Xx/Hz27QvdoMoviw1/pqWRB09Sw==", "dev": true, "requires": { - "combine-source-map": "0.8.0", - "concat-stream": "1.6.2", - "is-buffer": "1.1.6", - "JSONStream": "1.3.3", - "lexical-scope": "1.2.0", - "path-is-absolute": "1.0.1", - "process": "0.11.10", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "acorn-node": "^1.5.2", + "combine-source-map": "^0.8.0", + "concat-stream": "^1.6.1", + "is-buffer": "^1.1.0", + "path-is-absolute": "^1.0.1", + "process": "~0.11.0", + "through2": "^2.0.0", + "undeclared-identifiers": "^1.1.2", + "xtend": "^4.0.0" } }, "interpret": { @@ -3196,8 +3198,8 @@ "integrity": "sha512-dOWoqflvcydARa360Gvv18DZ/gRuHKi2NU/wU5X1ZFzdYfH29nkiNZsF3mp4OJ3H4yo9Mx8A/uAGNzpzPN3yBA==", "dev": true, "requires": { - "is-relative": "1.0.0", - "is-windows": "1.0.2" + "is-relative": "^1.0.0", + "is-windows": "^1.0.1" } }, "is-accessor-descriptor": { @@ -3206,7 +3208,7 @@ "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3215,7 +3217,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3232,7 +3234,7 @@ "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3241,7 +3243,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3252,9 +3254,9 @@ "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "dev": true, "requires": { - "is-accessor-descriptor": "0.1.6", - "is-data-descriptor": "0.1.4", - "kind-of": "5.1.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" }, "dependencies": { "kind-of": { @@ -3289,7 +3291,7 @@ "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", "dev": true, "requires": { - "is-extglob": "2.1.1" + "is-extglob": "^2.1.0" } }, "is-negated-glob": { @@ -3304,7 +3306,7 @@ "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -3313,7 +3315,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -3324,7 +3326,7 @@ "integrity": "sha512-OTiixgpZAT1M4NHgS5IguFp/Vz2VI3U7Goh4/HA1adtwyLtSBrxYlcSYkhpAE07s4fKEcjrFxyvtQBND4vFQyQ==", "dev": true, "requires": { - "is-number": "4.0.0" + "is-number": "^4.0.0" }, "dependencies": { "is-number": { @@ -3347,7 +3349,7 @@ "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "dev": true, "requires": { - "is-path-inside": "1.0.1" + "is-path-inside": "^1.0.0" } }, "is-path-inside": { @@ -3356,7 +3358,7 @@ "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "dev": true, "requires": { - "path-is-inside": "1.0.2" + "path-is-inside": "^1.0.1" } }, "is-plain-object": { @@ -3365,7 +3367,7 @@ "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "is-promise": { @@ -3380,7 +3382,7 @@ "integrity": "sha512-Kw/ReK0iqwKeu0MITLFuj0jbPAmEiOsIwyIXvvbfa6QfmN9pkD1M+8pdk7Rl/dTKbH34/XBFMbgD4iMJhLQbGA==", "dev": true, "requires": { - "is-unc-path": "1.0.0" + "is-unc-path": "^1.0.0" } }, "is-stream": { @@ -3395,7 +3397,7 @@ "integrity": "sha512-mrGpVd0fs7WWLfVsStvgF6iEJnbjDFZh9/emhRDcGWTduTfNHd9CHeUwH3gYIjdbwo4On6hunkztwOaAw0yllQ==", "dev": true, "requires": { - "unc-path-regex": "0.1.2" + "unc-path-regex": "^0.1.2" } }, "is-utf8": { @@ -3440,20 +3442,20 @@ "integrity": "sha1-ZcfXPUxNqE1POsMQuRj7C4Azczs=", "dev": true, "requires": { - "abbrev": "1.0.9", - "async": "1.5.2", - "escodegen": "1.8.1", - "esprima": "2.7.3", - "glob": "5.0.15", - "handlebars": "4.0.11", - "js-yaml": "3.11.0", - "mkdirp": "0.5.1", - "nopt": "3.0.6", - "once": "1.4.0", - "resolve": "1.1.7", - "supports-color": "3.2.3", - "which": "1.3.0", - "wordwrap": "1.0.0" + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" }, "dependencies": { "glob": { @@ -3462,11 +3464,11 @@ "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", "dev": true, "requires": { - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "has-flag": { @@ -3481,7 +3483,7 @@ "integrity": "sha1-ZawFBLOVQXHYpklGsq48u4pfVPY=", "dev": true, "requires": { - "has-flag": "1.0.0" + "has-flag": "^1.0.0" } } } @@ -3492,11 +3494,11 @@ "integrity": "sha512-qUTOVCKFkiz3tHgV1WMy7HTxDZgo+sO4X9GxFLAU+Mks4WsDGe9+ONHK6tPsSp8I3x6sPl0TwGbXHwTOhTyzog==", "dev": true, "requires": { - "async": "0.9.2", - "chalk": "0.4.0", - "filelist": "0.0.6", - "minimatch": "3.0.4", - "utilities": "1.0.5" + "async": "0.9.x", + "chalk": "0.4.x", + "filelist": "0.0.x", + "minimatch": "3.x", + "utilities": "1.0.x" }, "dependencies": { "ansi-styles": { @@ -3517,9 +3519,9 @@ "integrity": "sha1-UZmj3c0MHv4jvAjBsCewYXbgxk8=", "dev": true, "requires": { - "ansi-styles": "1.0.0", - "has-color": "0.1.7", - "strip-ansi": "0.1.1" + "ansi-styles": "~1.0.0", + "has-color": "~0.1.0", + "strip-ansi": "~0.1.0" } }, "strip-ansi": { @@ -3537,13 +3539,13 @@ "dev": true }, "js-yaml": { - "version": "3.11.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", - "integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", + "version": "3.12.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", + "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.0" + "argparse": "^1.0.7", + "esprima": "^4.0.0" }, "dependencies": { "esprima": { @@ -3560,7 +3562,7 @@ "integrity": "sha1-YRwj6BTbN1Un34URk9tZ3Sryf0U=", "dev": true, "requires": { - "jsonify": "0.0.0" + "jsonify": "~0.0.0" } }, "jsonfile": { @@ -3569,7 +3571,7 @@ "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", "dev": true, "requires": { - "graceful-fs": "4.1.11" + "graceful-fs": "^4.1.6" }, "dependencies": { "graceful-fs": { @@ -3593,16 +3595,6 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, - "JSONStream": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.3.tgz", - "integrity": "sha512-3Sp6WZZ/lXl+nTDoGpGWHEpTnnC6X5fnkolYZR6nwIfzbxxvA8utPWe1gCt7i0m9uVGsSz2IS8K8mJ7HmlduMg==", - "dev": true, - "requires": { - "jsonparse": "1.3.1", - "through": "2.3.8" - } - }, "kew": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/kew/-/kew-0.7.0.tgz", @@ -3621,9 +3613,9 @@ "integrity": "sha512-MC94mHZRvJ3LfykJlTUipBqenZz1pacOZEMhhQ8dMGcDHs0SBE5GbsavUXV7YtP3icBW17W0Zy1I0lfASmo9Pg==", "dev": true, "requires": { - "inherits": "2.0.3", - "isarray": "2.0.4", - "stream-splicer": "2.0.0" + "inherits": "^2.0.1", + "isarray": "^2.0.4", + "stream-splicer": "^2.0.0" }, "dependencies": { "isarray": { @@ -3647,7 +3639,7 @@ "integrity": "sha1-9plf4PggOS9hOWvolGJAe7dxaOQ=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.5" } }, "lcid": { @@ -3656,7 +3648,7 @@ "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", "dev": true, "requires": { - "invert-kv": "1.0.0" + "invert-kv": "^1.0.0" } }, "lead": { @@ -3665,7 +3657,7 @@ "integrity": "sha1-bxT5mje+Op3XhPVJVpDlkDRm7kI=", "dev": true, "requires": { - "flush-write-stream": "1.0.3" + "flush-write-stream": "^1.0.2" } }, "levn": { @@ -3674,17 +3666,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" - } - }, - "lexical-scope": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/lexical-scope/-/lexical-scope-1.2.0.tgz", - "integrity": "sha1-/Ope3HBKSzqHls3KQZw6CvryLfQ=", - "dev": true, - "requires": { - "astw": "2.2.0" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "liftoff": { @@ -3693,14 +3676,14 @@ "integrity": "sha1-IAkpG7Mc6oYbvxCnwVooyvdcMew=", "dev": true, "requires": { - "extend": "3.0.1", - "findup-sync": "2.0.0", - "fined": "1.1.0", - "flagged-respawn": "1.0.0", - "is-plain-object": "2.0.4", - "object.map": "1.0.1", - "rechoir": "0.6.2", - "resolve": "1.1.7" + "extend": "^3.0.0", + "findup-sync": "^2.0.0", + "fined": "^1.0.1", + "flagged-respawn": "^1.0.0", + "is-plain-object": "^2.0.4", + "object.map": "^1.0.0", + "rechoir": "^0.6.2", + "resolve": "^1.1.7" } }, "locate-path": { @@ -3709,8 +3692,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -3779,7 +3762,7 @@ "integrity": "sha1-mV7g3BjBtIzJLv+ucaEKq1tIdpg=", "dev": true, "requires": { - "lodash._root": "3.0.1" + "lodash._root": "^3.0.0" } }, "lodash.isarguments": { @@ -3800,9 +3783,9 @@ "integrity": "sha1-TbwEcrFWvlCgsoaFXRvQsMZWCYo=", "dev": true, "requires": { - "lodash._getnative": "3.9.1", - "lodash.isarguments": "3.1.0", - "lodash.isarray": "3.0.4" + "lodash._getnative": "^3.0.0", + "lodash.isarguments": "^3.0.0", + "lodash.isarray": "^3.0.0" } }, "lodash.memoize": { @@ -3823,15 +3806,15 @@ "integrity": "sha1-+M3sxhaaJVvpCYrosMU9N4kx0U8=", "dev": true, "requires": { - "lodash._basecopy": "3.0.1", - "lodash._basetostring": "3.0.1", - "lodash._basevalues": "3.0.0", - "lodash._isiterateecall": "3.0.9", - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0", - "lodash.keys": "3.1.2", - "lodash.restparam": "3.6.1", - "lodash.templatesettings": "3.1.1" + "lodash._basecopy": "^3.0.0", + "lodash._basetostring": "^3.0.0", + "lodash._basevalues": "^3.0.0", + "lodash._isiterateecall": "^3.0.0", + "lodash._reinterpolate": "^3.0.0", + "lodash.escape": "^3.0.0", + "lodash.keys": "^3.0.0", + "lodash.restparam": "^3.0.0", + "lodash.templatesettings": "^3.0.0" } }, "lodash.templatesettings": { @@ -3840,8 +3823,8 @@ "integrity": "sha1-+zB4RHU7Zrnxr6VOJix0UwfbqOU=", "dev": true, "requires": { - "lodash._reinterpolate": "3.0.0", - "lodash.escape": "3.2.0" + "lodash._reinterpolate": "^3.0.0", + "lodash.escape": "^3.0.0" } }, "longest": { @@ -3862,7 +3845,7 @@ "integrity": "sha1-Jzi9nw089PhEkMVzbEhpmsYyzaM=", "dev": true, "requires": { - "es5-ext": "0.10.45" + "es5-ext": "~0.10.2" } }, "make-iterator": { @@ -3871,7 +3854,7 @@ "integrity": "sha512-pxiuXh0iVEq7VM7KMIhs5gxsfxCux2URptUQaXo4iZZJxBAzTPOLE2BumO5dbfVYq/hBJFBR/a1mFDmOx5AGmw==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.2" } }, "map-cache": { @@ -3886,7 +3869,7 @@ "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", "dev": true, "requires": { - "object-visit": "1.0.1" + "object-visit": "^1.0.0" } }, "md5.js": { @@ -3895,8 +3878,8 @@ "integrity": "sha1-6b296UogpawYsENA/Fdk1bCdkB0=", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "mem": { @@ -3905,7 +3888,7 @@ "integrity": "sha1-Xt1StIXKHZAP5kiVUFOZoN+kX3Y=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "memoizee": { @@ -3914,14 +3897,14 @@ "integrity": "sha512-sprBu6nwxBWBvBOh5v2jcsGqiGLlL2xr2dLub3vR8dnE8YB17omwtm/0NSHl8jjNbcsJd5GMWJAnTSVe/O0Wfg==", "dev": true, "requires": { - "d": "1.0.0", - "es5-ext": "0.10.45", - "es6-weak-map": "2.0.2", - "event-emitter": "0.3.5", - "is-promise": "2.1.0", - "lru-queue": "0.1.0", - "next-tick": "1.0.0", - "timers-ext": "0.1.5" + "d": "1", + "es5-ext": "^0.10.30", + "es6-weak-map": "^2.0.2", + "event-emitter": "^0.3.5", + "is-promise": "^2.1", + "lru-queue": "0.1", + "next-tick": "1", + "timers-ext": "^0.1.2" } }, "merge-stream": { @@ -3930,7 +3913,7 @@ "integrity": "sha1-QEEgLVCKNCugAXQAjfDCUbjBNeE=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.1" } }, "merge2": { @@ -3945,19 +3928,19 @@ "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "braces": "2.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "extglob": "2.0.4", - "fragment-cache": "0.2.1", - "kind-of": "6.0.2", - "nanomatch": "1.2.9", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" } }, "miller-rabin": { @@ -3966,8 +3949,8 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "dev": true, "requires": { - "bn.js": "4.11.8", - "brorand": "1.1.0" + "bn.js": "^4.0.0", + "brorand": "^1.0.1" } }, "mimic-fn": { @@ -3994,7 +3977,7 @@ "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -4009,8 +3992,8 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "dev": true, "requires": { - "for-in": "1.0.2", - "is-extendable": "1.0.1" + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" }, "dependencies": { "is-extendable": { @@ -4019,7 +4002,7 @@ "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "dev": true, "requires": { - "is-plain-object": "2.0.4" + "is-plain-object": "^2.0.4" } } } @@ -4083,30 +4066,30 @@ "integrity": "sha512-NPs5N511VD1rrVJihSso/LiBShRbJALYBKzDW91uZYy7BpjnO4bGnZL3HjZ9yKcFdZUWwaYjDz9zxbuP7vKMuQ==", "dev": true, "requires": { - "browser-resolve": "1.11.2", - "cached-path-relative": "1.0.1", - "concat-stream": "1.6.2", - "defined": "1.0.0", - "detective": "5.1.0", - "duplexer2": "0.1.4", - "inherits": "2.0.3", - "JSONStream": "1.3.3", - "parents": "1.0.1", - "readable-stream": "2.3.6", - "resolve": "1.7.1", - "stream-combiner2": "1.1.1", - "subarg": "1.0.0", - "through2": "2.0.3", - "xtend": "4.0.1" + "JSONStream": "^1.0.3", + "browser-resolve": "^1.7.0", + "cached-path-relative": "^1.0.0", + "concat-stream": "~1.6.0", + "defined": "^1.0.0", + "detective": "^5.0.2", + "duplexer2": "^0.1.2", + "inherits": "^2.0.1", + "parents": "^1.0.0", + "readable-stream": "^2.0.2", + "resolve": "^1.4.0", + "stream-combiner2": "^1.1.1", + "subarg": "^1.0.0", + "through2": "^2.0.0", + "xtend": "^4.0.0" }, "dependencies": { "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } } } @@ -4132,7 +4115,7 @@ "integrity": "sha1-xhTc9n4vsUmVqRcR5aYX6KYKMds=", "dev": true, "requires": { - "readable-stream": "1.1.14" + "readable-stream": "~1.1.9" } }, "isarray": { @@ -4147,10 +4130,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -4167,18 +4150,18 @@ "integrity": "sha512-n8R9bS8yQ6eSXaV6jHUpKzD8gLsin02w1HSFiegwrs9E098Ylhw5jdyKPaYqvHknHaSCKTPp7C8dGCQ0q9koXA==", "dev": true, "requires": { - "arr-diff": "4.0.0", - "array-unique": "0.3.2", - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "fragment-cache": "0.2.1", - "is-odd": "2.0.0", - "is-windows": "1.0.2", - "kind-of": "6.0.2", - "object.pick": "1.3.0", - "regex-not": "1.0.2", - "snapdragon": "0.8.2", - "to-regex": "3.0.2" + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-odd": "^2.0.0", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" } }, "natives": { @@ -4205,7 +4188,7 @@ "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", "dev": true, "requires": { - "abbrev": "1.0.9" + "abbrev": "1" } }, "normalize-path": { @@ -4214,7 +4197,7 @@ "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "dev": true, "requires": { - "remove-trailing-separator": "1.1.0" + "remove-trailing-separator": "^1.0.1" } }, "now-and-later": { @@ -4223,7 +4206,7 @@ "integrity": "sha1-vGHLtFbXnLMiB85HygUTb/Ln1u4=", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.3.2" } }, "npm-run-path": { @@ -4232,7 +4215,7 @@ "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -4253,9 +4236,9 @@ "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", "dev": true, "requires": { - "copy-descriptor": "0.1.1", - "define-property": "0.2.5", - "kind-of": "3.2.2" + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" }, "dependencies": { "define-property": { @@ -4264,7 +4247,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "kind-of": { @@ -4273,7 +4256,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -4290,7 +4273,7 @@ "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.0" } }, "object.assign": { @@ -4299,10 +4282,10 @@ "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "dev": true, "requires": { - "define-properties": "1.1.2", - "function-bind": "1.1.1", - "has-symbols": "1.0.0", - "object-keys": "1.0.12" + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" } }, "object.defaults": { @@ -4311,10 +4294,10 @@ "integrity": "sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=", "dev": true, "requires": { - "array-each": "1.0.1", - "array-slice": "1.1.0", - "for-own": "1.0.0", - "isobject": "3.0.1" + "array-each": "^1.0.1", + "array-slice": "^1.0.0", + "for-own": "^1.0.0", + "isobject": "^3.0.0" } }, "object.map": { @@ -4323,8 +4306,8 @@ "integrity": "sha1-z4Plncj8wK1fQlDh94s7gb2AHTc=", "dev": true, "requires": { - "for-own": "1.0.0", - "make-iterator": "1.0.1" + "for-own": "^1.0.0", + "make-iterator": "^1.0.0" } }, "object.pick": { @@ -4333,7 +4316,7 @@ "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", "dev": true, "requires": { - "isobject": "3.0.1" + "isobject": "^3.0.1" } }, "once": { @@ -4342,7 +4325,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -4351,8 +4334,8 @@ "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" }, "dependencies": { "minimist": { @@ -4375,12 +4358,12 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" } }, "orchestrator": { @@ -4389,9 +4372,9 @@ "integrity": "sha1-FOfp4nZPcxX7rBhOUGx6pt+UrX4=", "dev": true, "requires": { - "end-of-stream": "0.1.5", - "sequencify": "0.0.7", - "stream-consume": "0.1.1" + "end-of-stream": "~0.1.5", + "sequencify": "~0.0.7", + "stream-consume": "~0.1.0" } }, "ordered-read-streams": { @@ -4418,9 +4401,9 @@ "integrity": "sha512-3sslG3zJbEYcaC4YVAvDorjGxc7tv6KVATnLPZONiljsUncvihe9BQoVCEs0RZ1kmf4Hk9OBqlZfJZWI4GanKA==", "dev": true, "requires": { - "execa": "0.7.0", - "lcid": "1.0.0", - "mem": "1.1.0" + "execa": "^0.7.0", + "lcid": "^1.0.0", + "mem": "^1.1.0" } }, "p-finally": { @@ -4435,7 +4418,7 @@ "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -4444,7 +4427,7 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.3.0" + "p-limit": "^1.1.0" } }, "p-map": { @@ -4471,7 +4454,7 @@ "integrity": "sha1-/t1NK/GTp3dF/nHjcdc8MwfZx1E=", "dev": true, "requires": { - "path-platform": "0.11.15" + "path-platform": "~0.11.15" } }, "parse-asn1": { @@ -4480,11 +4463,11 @@ "integrity": "sha512-KPx7flKXg775zZpnp9SxJlz00gTd4BmJ2yJufSc44gMCRrRQ7NSzAcSJQfifuOLgW6bEi+ftrALtsgALeB2Adw==", "dev": true, "requires": { - "asn1.js": "4.10.1", - "browserify-aes": "1.2.0", - "create-hash": "1.2.0", - "evp_bytestokey": "1.0.3", - "pbkdf2": "3.0.16" + "asn1.js": "^4.0.0", + "browserify-aes": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.0", + "pbkdf2": "^3.0.3" } }, "parse-filepath": { @@ -4493,9 +4476,9 @@ "integrity": "sha1-pjISf1Oq89FYdvWHLz/6x2PWyJE=", "dev": true, "requires": { - "is-absolute": "1.0.0", - "map-cache": "0.2.2", - "path-root": "0.1.1" + "is-absolute": "^1.0.0", + "map-cache": "^0.2.0", + "path-root": "^0.1.1" } }, "parse-passwd": { @@ -4511,9 +4494,9 @@ "dev": true }, "path-browserify": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.0.tgz", - "integrity": "sha1-oLhwcpquIUAFt9UDLsLLuw+0RRo=", + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/path-browserify/-/path-browserify-0.0.1.tgz", + "integrity": "sha512-BapA40NHICOS+USX9SN4tyhq+A2RrN/Ws5F0Z5aMHDp98Fl86lX8Oti8B7uN93L4Ifv4fHOEA+pQw87gmMO/lQ==", "dev": true }, "path-dirname": { @@ -4564,7 +4547,7 @@ "integrity": "sha1-mkpoFMrBwM1zNgqV8yCDyOpHRbc=", "dev": true, "requires": { - "path-root-regex": "0.1.2" + "path-root-regex": "^0.1.0" } }, "path-root-regex": { @@ -4585,11 +4568,11 @@ "integrity": "sha512-y4CXP3thSxqf7c0qmOF+9UeOTrifiVTIM+u7NWlq+PRsHbr7r7dpCmvzrZxa96JJUNi0Y5w9VqG5ZNeCVMoDcA==", "dev": true, "requires": { - "create-hash": "1.2.0", - "create-hmac": "1.1.7", - "ripemd160": "2.0.2", - "safe-buffer": "5.1.2", - "sha.js": "2.4.11" + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" } }, "pify": { @@ -4610,7 +4593,7 @@ "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", "dev": true, "requires": { - "pinkie": "2.0.4" + "pinkie": "^2.0.0" } }, "plugin-error": { @@ -4619,10 +4602,10 @@ "integrity": "sha512-L1zP0dk7vGweZME2i+EeakvUNqSrdiI3F91TwEoYiGrAfUXmVv6fJIq4g82PAXxNsWOp0J7ZqQy/3Szz0ajTxA==", "dev": true, "requires": { - "ansi-colors": "1.1.0", - "arr-diff": "4.0.0", - "arr-union": "3.1.0", - "extend-shallow": "3.0.2" + "ansi-colors": "^1.0.1", + "arr-diff": "^4.0.0", + "arr-union": "^3.1.0", + "extend-shallow": "^3.0.2" }, "dependencies": { "ansi-colors": { @@ -4631,7 +4614,7 @@ "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "dev": true, "requires": { - "ansi-wrap": "0.1.0" + "ansi-wrap": "^0.1.0" } } } @@ -4678,11 +4661,11 @@ "integrity": "sha512-4kJ5Esocg8X3h8YgJsKAuoesBgB7mqH3eowiDzMUPKiRDDE7E/BqqZD1hnTByIaAFiwAw246YEltSq7tdrOH0Q==", "dev": true, "requires": { - "bn.js": "4.11.8", - "browserify-rsa": "4.0.1", - "create-hash": "1.2.0", - "parse-asn1": "5.1.1", - "randombytes": "2.0.6" + "bn.js": "^4.1.0", + "browserify-rsa": "^4.0.0", + "create-hash": "^1.1.0", + "parse-asn1": "^5.0.0", + "randombytes": "^2.0.1" } }, "pump": { @@ -4691,8 +4674,8 @@ "integrity": "sha512-ruPMNRkN3MHP1cWJc9OWr+T/xDP0jhXYCLfJcBuX54hhfIBnaQmAUMfDcG4DM5UMWByBbJY69QSphm3jtDKIkA==", "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" }, "dependencies": { "end-of-stream": { @@ -4701,7 +4684,7 @@ "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } } } @@ -4712,9 +4695,9 @@ "integrity": "sha512-oClZI37HvuUJJxSKKrC17bZ9Cu0ZYhEAGPsPUy9KlMUmv9dKX2o77RUmq7f3XjIxbwyGwYzbzQ1L2Ks8sIradQ==", "dev": true, "requires": { - "duplexify": "3.6.0", - "inherits": "2.0.3", - "pump": "2.0.1" + "duplexify": "^3.6.0", + "inherits": "^2.0.3", + "pump": "^2.0.0" } }, "punycode": { @@ -4747,7 +4730,7 @@ "integrity": "sha512-CIQ5OFxf4Jou6uOKe9t1AOgqpeU5fd70A8NPdHSGeYXqXsPe6peOwI0cUl88RWZ6sP1vPMV3avd/R6cZ5/sP1A==", "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "^5.1.0" } }, "randomfill": { @@ -4756,8 +4739,8 @@ "integrity": "sha512-87lcbR8+MhcWcUiQ+9e+Rwx8MyR2P7qnt15ynUlbm3TU/fjbgz4GsvfSUDTemtCCtVCqb4ZcEFlyPNTh9bBTLw==", "dev": true, "requires": { - "randombytes": "2.0.6", - "safe-buffer": "5.1.2" + "randombytes": "^2.0.5", + "safe-buffer": "^5.1.0" } }, "read-only-stream": { @@ -4766,7 +4749,7 @@ "integrity": "sha1-JyT9aoET1zdkrCiNQ4YnDB2/F/A=", "dev": true, "requires": { - "readable-stream": "2.3.6" + "readable-stream": "^2.0.2" } }, "readable-stream": { @@ -4775,13 +4758,13 @@ "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", - "isarray": "1.0.0", - "process-nextick-args": "2.0.0", - "safe-buffer": "5.1.2", - "string_decoder": "1.1.1", - "util-deprecate": "1.0.2" + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" } }, "rechoir": { @@ -4790,7 +4773,7 @@ "integrity": "sha1-hSBLVNuoLVdC4oyWdW70OvUOM4Q=", "dev": true, "requires": { - "resolve": "1.1.7" + "resolve": "^1.1.6" } }, "regex-not": { @@ -4799,8 +4782,8 @@ "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "dev": true, "requires": { - "extend-shallow": "3.0.2", - "safe-regex": "1.1.0" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, "remove-bom-buffer": { @@ -4809,8 +4792,8 @@ "integrity": "sha512-8v2rWhaakv18qcvNeli2mZ/TMTL2nEyAKRvzo1WtnZBl15SHyEhrCu2/xKlJyUFKHiHgfXIyuY6g2dObJJycXQ==", "dev": true, "requires": { - "is-buffer": "1.1.6", - "is-utf8": "0.2.1" + "is-buffer": "^1.1.5", + "is-utf8": "^0.2.1" } }, "remove-bom-stream": { @@ -4819,9 +4802,9 @@ "integrity": "sha1-BfGlk/FuQuH7kOv1nejlaVJflSM=", "dev": true, "requires": { - "remove-bom-buffer": "3.0.0", - "safe-buffer": "5.1.2", - "through2": "2.0.3" + "remove-bom-buffer": "^3.0.0", + "safe-buffer": "^5.1.0", + "through2": "^2.0.3" } }, "remove-internal": { @@ -4830,9 +4813,9 @@ "integrity": "sha512-+t02ljhWPIbmnamxlAHm0idgbSx4VUEGwjl0Ne1kxDthKfCKFhHeMbalkq5oacoxYlYeYMSXCZtzWuzGqPqZoA==", "dev": true, "requires": { - "mkdirp": "0.5.1", - "typescript": "2.9.1", - "yargs": "11.0.0" + "mkdirp": "^0.5.1", + "typescript": "^2.9.1", + "yargs": "^11.0.0" }, "dependencies": { "ansi-regex": { @@ -4847,9 +4830,9 @@ "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "strip-ansi": { @@ -4858,7 +4841,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "typescript": { @@ -4873,18 +4856,18 @@ "integrity": "sha512-Rjp+lMYQOWtgqojx1dEWorjCofi1YN7AoFvYV7b1gx/7dAAeuI4kN5SZiEvr0ZmsZTOpDRcCqrpI10L31tFkBw==", "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "2.1.0", - "get-caller-file": "1.0.2", - "os-locale": "2.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "3.2.1", - "yargs-parser": "9.0.2" + "cliui": "^4.0.0", + "decamelize": "^1.1.1", + "find-up": "^2.1.0", + "get-caller-file": "^1.0.1", + "os-locale": "^2.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1", + "yargs-parser": "^9.0.2" } } } @@ -4937,8 +4920,8 @@ "integrity": "sha1-eaQGRMNivoLybv/nOcm7U4IEb0M=", "dev": true, "requires": { - "expand-tilde": "2.0.2", - "global-modules": "1.0.0" + "expand-tilde": "^2.0.0", + "global-modules": "^1.0.0" } }, "resolve-options": { @@ -4947,7 +4930,7 @@ "integrity": "sha1-MrueOcBtZzONyTeMDW1gdFZq0TE=", "dev": true, "requires": { - "value-or-function": "3.0.0" + "value-or-function": "^3.0.0" } }, "resolve-url": { @@ -4969,7 +4952,7 @@ "dev": true, "optional": true, "requires": { - "align-text": "0.1.4" + "align-text": "^0.1.1" } }, "rimraf": { @@ -4978,7 +4961,7 @@ "integrity": "sha512-lreewLK/BlghmxtfH36YYVg1i8IAce4TI7oao75I1g245+6BctqTVQiBP3YUJ9C6DQOXJmkYR9X9fCLtCOJc5w==", "dev": true, "requires": { - "glob": "7.1.2" + "glob": "^7.0.5" } }, "ripemd160": { @@ -4987,8 +4970,8 @@ "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "dev": true, "requires": { - "hash-base": "3.0.4", - "inherits": "2.0.3" + "hash-base": "^3.0.0", + "inherits": "^2.0.1" } }, "run-sequence": { @@ -4997,9 +4980,9 @@ "integrity": "sha512-qkzZnQWMZjcKbh3CNly2srtrkaO/2H/SI5f2eliMCapdRD3UhMrwjfOAZJAnZ2H8Ju4aBzFZkBGXUqFs9V0yxw==", "dev": true, "requires": { - "chalk": "1.1.3", - "fancy-log": "1.3.2", - "plugin-error": "0.1.2" + "chalk": "^1.1.3", + "fancy-log": "^1.3.2", + "plugin-error": "^0.1.2" }, "dependencies": { "ansi-styles": { @@ -5014,8 +4997,8 @@ "integrity": "sha1-aHwydYFjWI/vfeezb6vklesaOZo=", "dev": true, "requires": { - "arr-flatten": "1.1.0", - "array-slice": "0.2.3" + "arr-flatten": "^1.0.1", + "array-slice": "^0.2.3" } }, "arr-union": { @@ -5036,11 +5019,11 @@ "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", "dev": true, "requires": { - "ansi-styles": "2.2.1", - "escape-string-regexp": "1.0.5", - "has-ansi": "2.0.0", - "strip-ansi": "3.0.1", - "supports-color": "2.0.0" + "ansi-styles": "^2.2.1", + "escape-string-regexp": "^1.0.2", + "has-ansi": "^2.0.0", + "strip-ansi": "^3.0.0", + "supports-color": "^2.0.0" } }, "extend-shallow": { @@ -5049,7 +5032,7 @@ "integrity": "sha1-Gda/lN/AnXa6cR85uHLSH/TdkHE=", "dev": true, "requires": { - "kind-of": "1.1.0" + "kind-of": "^1.1.0" } }, "kind-of": { @@ -5064,11 +5047,11 @@ "integrity": "sha1-O5uzM1zPAPQl4HQ34ZJ2ln2kes4=", "dev": true, "requires": { - "ansi-cyan": "0.1.1", - "ansi-red": "0.1.1", - "arr-diff": "1.1.0", - "arr-union": "2.1.0", - "extend-shallow": "1.1.4" + "ansi-cyan": "^0.1.1", + "ansi-red": "^0.1.1", + "arr-diff": "^1.0.1", + "arr-union": "^2.0.1", + "extend-shallow": "^1.1.2" } }, "supports-color": { @@ -5091,7 +5074,7 @@ "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "sax": { @@ -5124,10 +5107,10 @@ "integrity": "sha512-hw0yxk9GT/Hr5yJEYnHNKYXkIA8mVJgd9ditYZCe16ZczcaELYYcfvaXesNACk2O8O0nTiPQcQhGUQj8JLzeeg==", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "split-string": "3.1.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" }, "dependencies": { "extend-shallow": { @@ -5136,7 +5119,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -5147,8 +5130,8 @@ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "dev": true, "requires": { - "inherits": "2.0.3", - "safe-buffer": "5.1.2" + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" } }, "shasum": { @@ -5157,8 +5140,8 @@ "integrity": "sha1-5wEjENj0F/TetXEhUOVni4euVl8=", "dev": true, "requires": { - "json-stable-stringify": "0.0.1", - "sha.js": "2.4.11" + "json-stable-stringify": "~0.0.0", + "sha.js": "~2.4.4" } }, "shebang-command": { @@ -5167,7 +5150,7 @@ "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -5182,10 +5165,10 @@ "integrity": "sha1-9HgZSczkAmlxJ0MOo7PFR29IF2c=", "dev": true, "requires": { - "array-filter": "0.0.1", - "array-map": "0.0.0", - "array-reduce": "0.0.0", - "jsonify": "0.0.0" + "array-filter": "~0.0.0", + "array-map": "~0.0.0", + "array-reduce": "~0.0.0", + "jsonify": "~0.0.0" } }, "sigmund": { @@ -5200,20 +5183,26 @@ "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", "dev": true }, + "simple-concat": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.0.tgz", + "integrity": "sha1-c0TLuLbib7J9ZrL8hvn21Zl1IcY=", + "dev": true + }, "snapdragon": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", "dev": true, "requires": { - "base": "0.11.2", - "debug": "2.6.9", - "define-property": "0.2.5", - "extend-shallow": "2.0.1", - "map-cache": "0.2.2", - "source-map": "0.5.7", - "source-map-resolve": "0.5.1", - "use": "3.1.0" + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" }, "dependencies": { "define-property": { @@ -5222,7 +5211,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } }, "extend-shallow": { @@ -5231,7 +5220,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } } } @@ -5242,9 +5231,9 @@ "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", "dev": true, "requires": { - "define-property": "1.0.0", - "isobject": "3.0.1", - "snapdragon-util": "3.0.1" + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" }, "dependencies": { "define-property": { @@ -5253,7 +5242,7 @@ "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", "dev": true, "requires": { - "is-descriptor": "1.0.2" + "is-descriptor": "^1.0.0" } }, "is-accessor-descriptor": { @@ -5262,7 +5251,7 @@ "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-data-descriptor": { @@ -5271,7 +5260,7 @@ "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.0" } }, "is-descriptor": { @@ -5280,9 +5269,9 @@ "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", "dev": true, "requires": { - "is-accessor-descriptor": "1.0.0", - "is-data-descriptor": "1.0.0", - "kind-of": "6.0.2" + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" } } } @@ -5293,7 +5282,7 @@ "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.2.0" }, "dependencies": { "kind-of": { @@ -5302,7 +5291,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5319,11 +5308,11 @@ "integrity": "sha512-0KW2wvzfxm8NCTb30z0LMNyPqWCdDGE2viwzUaucqJdkTRXtZiSY3I+2A6nVAjmdOy0I4gU8DwnVVGsk9jvP2A==", "dev": true, "requires": { - "atob": "2.1.0", - "decode-uri-component": "0.2.0", - "resolve-url": "0.2.1", - "source-map-url": "0.4.0", - "urix": "0.1.0" + "atob": "^2.0.0", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" } }, "source-map-support": { @@ -5332,8 +5321,8 @@ "integrity": "sha512-N4KXEz7jcKqPf2b2vZF11lQIz9W5ZMuUcIOGj243lduidkf2fjkVKJS9vNxVWn3u/uxX38AcE8U9nnH9FPcq+g==", "dev": true, "requires": { - "buffer-from": "1.1.0", - "source-map": "0.6.1" + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" }, "dependencies": { "source-map": { @@ -5362,7 +5351,7 @@ "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", "dev": true, "requires": { - "extend-shallow": "3.0.2" + "extend-shallow": "^3.0.0" } }, "sprintf-js": { @@ -5377,8 +5366,8 @@ "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", "dev": true, "requires": { - "define-property": "0.2.5", - "object-copy": "0.1.0" + "define-property": "^0.2.5", + "object-copy": "^0.1.0" }, "dependencies": { "define-property": { @@ -5387,7 +5376,7 @@ "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", "dev": true, "requires": { - "is-descriptor": "0.1.6" + "is-descriptor": "^0.1.0" } } } @@ -5398,8 +5387,8 @@ "integrity": "sha1-ZiZu5fm9uZQKTkUUyvtDu3Hlyds=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "~2.0.1", + "readable-stream": "^2.0.2" } }, "stream-combiner2": { @@ -5408,8 +5397,8 @@ "integrity": "sha1-+02KFCDqNidk4hrUeAOXvry0HL4=", "dev": true, "requires": { - "duplexer2": "0.1.4", - "readable-stream": "2.3.6" + "duplexer2": "~0.1.0", + "readable-stream": "^2.0.2" } }, "stream-consume": { @@ -5424,11 +5413,11 @@ "integrity": "sha512-+TSkfINHDo4J+ZobQLWiMouQYB+UVYFttRA94FpEzzJ7ZdqcL4uUUQ7WkdkI4DSozGmgBUE/a47L+38PenXhUw==", "dev": true, "requires": { - "builtin-status-codes": "3.0.0", - "inherits": "2.0.3", - "readable-stream": "2.3.6", - "to-arraybuffer": "1.0.1", - "xtend": "4.0.1" + "builtin-status-codes": "^3.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.3.6", + "to-arraybuffer": "^1.0.0", + "xtend": "^4.0.0" } }, "stream-shift": { @@ -5443,8 +5432,8 @@ "integrity": "sha1-G2O+Q4oTPktnHMGTUZdgAXWRDYM=", "dev": true, "requires": { - "inherits": "2.0.3", - "readable-stream": "2.3.6" + "inherits": "^2.0.1", + "readable-stream": "^2.0.2" } }, "streamqueue": { @@ -5453,7 +5442,7 @@ "integrity": "sha1-ZvX17JTpuK8knkrsLdH3Qb/pTeM=", "dev": true, "requires": { - "readable-stream": "1.1.14" + "readable-stream": "^1.0.26-2" }, "dependencies": { "isarray": { @@ -5468,10 +5457,10 @@ "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -5482,23 +5471,14 @@ } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "dev": true, - "requires": { - "safe-buffer": "5.1.2" - } - }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" }, "dependencies": { "ansi-regex": { @@ -5513,18 +5493,27 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } } } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } }, "strip-bom": { @@ -5533,8 +5522,8 @@ "integrity": "sha1-hbiGLzhEtabV7IRnqTWYFzo295Q=", "dev": true, "requires": { - "first-chunk-stream": "1.0.0", - "is-utf8": "0.2.1" + "first-chunk-stream": "^1.0.0", + "is-utf8": "^0.2.0" } }, "strip-bom-string": { @@ -5555,7 +5544,7 @@ "integrity": "sha1-9izxdYHplrSPyWVpn1TAauJouNI=", "dev": true, "requires": { - "minimist": "1.2.0" + "minimist": "^1.1.0" } }, "supports-color": { @@ -5564,7 +5553,7 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, "syntax-error": { @@ -5573,7 +5562,7 @@ "integrity": "sha512-YPPlu67mdnHGTup2A8ff7BC2Pjq0e0Yp/IyTFN03zWO0RcK07uLcbi7C2KpGR2FvWbaB0+bfE27a+sBKebSo7w==", "dev": true, "requires": { - "acorn-node": "1.3.0" + "acorn-node": "^1.2.0" } }, "ternary-stream": { @@ -5582,10 +5571,10 @@ "integrity": "sha1-Bk5Im0tb9gumpre8fy9cJ07Pgmk=", "dev": true, "requires": { - "duplexify": "3.6.0", - "fork-stream": "0.0.4", - "merge-stream": "1.0.1", - "through2": "2.0.3" + "duplexify": "^3.5.0", + "fork-stream": "^0.0.4", + "merge-stream": "^1.0.0", + "through2": "^2.0.1" } }, "through": { @@ -5600,8 +5589,8 @@ "integrity": "sha1-AARWmzfHx0ujnEPzzteNGtlBQL4=", "dev": true, "requires": { - "readable-stream": "2.3.6", - "xtend": "4.0.1" + "readable-stream": "^2.1.5", + "xtend": "~4.0.1" } }, "through2-filter": { @@ -5610,8 +5599,8 @@ "integrity": "sha1-YLxVoNrLdghdsfna6Zq0P4PWIuw=", "dev": true, "requires": { - "through2": "2.0.3", - "xtend": "4.0.1" + "through2": "~2.0.0", + "xtend": "~4.0.0" } }, "tildify": { @@ -5620,7 +5609,7 @@ "integrity": "sha1-3OwD9V3Km3qj5bBPIYF+tW5jWIo=", "dev": true, "requires": { - "os-homedir": "1.0.2" + "os-homedir": "^1.0.0" } }, "time-stamp": { @@ -5635,7 +5624,7 @@ "integrity": "sha1-ycWLV1voQHN1y14kYtrO50NZ9B0=", "dev": true, "requires": { - "process": "0.11.10" + "process": "~0.11.0" } }, "timers-ext": { @@ -5644,8 +5633,8 @@ "integrity": "sha512-tsEStd7kmACHENhsUPaxb8Jf8/+GZZxyNFQbZD07HQOyooOa6At1rQqjffgvg7n+dxscQa9cjjMdWhJtsP2sxg==", "dev": true, "requires": { - "es5-ext": "0.10.45", - "next-tick": "1.0.0" + "es5-ext": "~0.10.14", + "next-tick": "1" } }, "to-absolute-glob": { @@ -5654,8 +5643,8 @@ "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", "dev": true, "requires": { - "is-absolute": "1.0.0", - "is-negated-glob": "1.0.0" + "is-absolute": "^1.0.0", + "is-negated-glob": "^1.0.0" } }, "to-arraybuffer": { @@ -5670,7 +5659,7 @@ "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", "dev": true, "requires": { - "kind-of": "3.2.2" + "kind-of": "^3.0.2" }, "dependencies": { "kind-of": { @@ -5679,7 +5668,7 @@ "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", "dev": true, "requires": { - "is-buffer": "1.1.6" + "is-buffer": "^1.1.5" } } } @@ -5690,10 +5679,10 @@ "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", "dev": true, "requires": { - "define-property": "2.0.2", - "extend-shallow": "3.0.2", - "regex-not": "1.0.2", - "safe-regex": "1.1.0" + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" } }, "to-regex-range": { @@ -5702,8 +5691,8 @@ "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "dev": true, "requires": { - "is-number": "3.0.0", - "repeat-string": "1.6.1" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "to-through": { @@ -5712,7 +5701,7 @@ "integrity": "sha1-/JKtq6ByZHvAtn1rA2ZKoZUJOvY=", "dev": true, "requires": { - "through2": "2.0.3" + "through2": "^2.0.3" } }, "travis-fold": { @@ -5722,9 +5711,9 @@ "dev": true }, "tslib": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.2.tgz", - "integrity": "sha512-AVP5Xol3WivEr7hnssHDsaM+lVrVXWUvd1cfXTRkTj80b//6g2wIFEH6hZG0muGZRnHGrfttpdzRk3YlBkWjKw==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "dev": true }, "tslint": { @@ -5733,27 +5722,27 @@ "integrity": "sha1-EeJrzLiK+gLdDZlWyuPUVAtfVMM=", "dev": true, "requires": { - "babel-code-frame": "6.26.0", - "builtin-modules": "1.1.1", - "chalk": "2.4.1", - "commander": "2.15.1", - "diff": "3.5.0", - "glob": "7.1.2", - "js-yaml": "3.11.0", - "minimatch": "3.0.4", - "resolve": "1.7.1", - "semver": "5.5.0", - "tslib": "1.9.2", - "tsutils": "2.27.1" + "babel-code-frame": "^6.22.0", + "builtin-modules": "^1.1.1", + "chalk": "^2.3.0", + "commander": "^2.12.1", + "diff": "^3.2.0", + "glob": "^7.1.1", + "js-yaml": "^3.7.0", + "minimatch": "^3.0.4", + "resolve": "^1.3.2", + "semver": "^5.3.0", + "tslib": "^1.8.0", + "tsutils": "^2.12.1" }, "dependencies": { "resolve": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", - "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.8.1.tgz", + "integrity": "sha512-AicPrAC7Qu1JxPCZ9ZgCZlY35QgFnNqc+0LtbRNxnVw4TXvjQ72wnuL9JQcEBgXkI9JM8MsT9kaQoHcpCRJOYA==", "dev": true, "requires": { - "path-parse": "1.0.5" + "path-parse": "^1.0.5" } }, "semver": { @@ -5765,12 +5754,12 @@ } }, "tsutils": { - "version": "2.27.1", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.1.tgz", - "integrity": "sha512-AE/7uzp32MmaHvNNFES85hhUDHFdFZp6OAiZcd6y4ZKKIg6orJTm8keYWBhIhrJQH3a4LzNKat7ZPXZt5aTf6w==", + "version": "2.27.2", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.27.2.tgz", + "integrity": "sha512-qf6rmT84TFMuxAKez2pIfR8UCai49iQsfB7YWVjV1bKpy/d0PWT5rEOSM6La9PiHZ0k1RRZQiwVdVJfQ3BPHgg==", "dev": true, "requires": { - "tslib": "1.9.2" + "tslib": "^1.8.1" } }, "tty-browserify": { @@ -5785,7 +5774,7 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" } }, "type-detect": { @@ -5801,9 +5790,9 @@ "dev": true }, "typescript": { - "version": "3.0.0-dev.20180626", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.0-dev.20180626.tgz", - "integrity": "sha512-OQH9osIC4CdsVzVvsb2RenRTVPRKwSIMIpRy2J42XNOEUP+vhX56BX1Z47K3l//LEGY0xG7zF7qVKCDlUhhrlg==", + "version": "3.0.0-dev.20180706", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.0.0-dev.20180706.tgz", + "integrity": "sha512-FDGcMfvqDr4xoYhyspX/0SshPQCHFYbegQtggwxJLAWHtMjmutN+DrdNqEGwpX5nGKP96Ek34SN7HDRJegqZzw==", "dev": true }, "uglify-js": { @@ -5813,9 +5802,9 @@ "dev": true, "optional": true, "requires": { - "source-map": "0.5.7", - "uglify-to-browserify": "1.0.2", - "yargs": "3.10.0" + "source-map": "~0.5.1", + "uglify-to-browserify": "~1.0.0", + "yargs": "~3.10.0" } }, "uglify-to-browserify": { @@ -5837,16 +5826,28 @@ "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", "dev": true }, + "undeclared-identifiers": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/undeclared-identifiers/-/undeclared-identifiers-1.1.2.tgz", + "integrity": "sha512-13EaeocO4edF/3JKime9rD7oB6QI8llAGhgn5fKOPyfkJbRb6NFv9pYV6dFEmpa4uRjKeBqLZP8GpuzqHlKDMQ==", + "dev": true, + "requires": { + "acorn-node": "^1.3.0", + "get-assigned-identifiers": "^1.2.0", + "simple-concat": "^1.0.0", + "xtend": "^4.0.1" + } + }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", "integrity": "sha1-XHHDTLW61dzr4+oM0IIHulqhrqQ=", "dev": true, "requires": { - "arr-union": "3.1.0", - "get-value": "2.0.6", - "is-extendable": "0.1.1", - "set-value": "0.4.3" + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^0.4.3" }, "dependencies": { "extend-shallow": { @@ -5855,7 +5856,7 @@ "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", "dev": true, "requires": { - "is-extendable": "0.1.1" + "is-extendable": "^0.1.0" } }, "set-value": { @@ -5864,10 +5865,10 @@ "integrity": "sha1-fbCPnT0i3H945Trzw79GZuzfzPE=", "dev": true, "requires": { - "extend-shallow": "2.0.1", - "is-extendable": "0.1.1", - "is-plain-object": "2.0.4", - "to-object-path": "0.3.0" + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.1", + "to-object-path": "^0.3.0" } } } @@ -5890,8 +5891,8 @@ "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", "dev": true, "requires": { - "has-value": "0.3.1", - "isobject": "3.0.1" + "has-value": "^0.3.1", + "isobject": "^3.0.0" }, "dependencies": { "has-value": { @@ -5900,9 +5901,9 @@ "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", "dev": true, "requires": { - "get-value": "2.0.6", - "has-values": "0.1.4", - "isobject": "2.1.0" + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" }, "dependencies": { "isobject": { @@ -5960,7 +5961,7 @@ "integrity": "sha512-6UJEQM/L+mzC3ZJNM56Q4DFGLX/evKGRg15UJHGB9X5j5Z3AFbgZvjUh2yq/UJUY4U5dh7Fal++XbNg1uzpRAw==", "dev": true, "requires": { - "kind-of": "6.0.2" + "kind-of": "^6.0.2" } }, "user-home": { @@ -5996,7 +5997,7 @@ "integrity": "sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=", "dev": true, "requires": { - "user-home": "1.1.1" + "user-home": "^1.1.1" } }, "value-or-function": { @@ -6006,17 +6007,17 @@ "dev": true }, "vinyl": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.1.0.tgz", - "integrity": "sha1-Ah+cLPlR1rk5lDyJ617lrdT9kkw=", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/vinyl/-/vinyl-2.2.0.tgz", + "integrity": "sha512-MBH+yP0kC/GQ5GwBqrTPTzEfiiLjta7hTtvQtbxBgTeSXsmKQRQecjibMbxIXzVT3Y9KJK+drOz1/k+vsu8Nkg==", "dev": true, "requires": { - "clone": "2.1.1", - "clone-buffer": "1.0.0", - "clone-stats": "1.0.0", - "cloneable-readable": "1.1.2", - "remove-trailing-separator": "1.1.0", - "replace-ext": "1.0.0" + "clone": "^2.1.1", + "clone-buffer": "^1.0.0", + "clone-stats": "^1.0.0", + "cloneable-readable": "^1.0.0", + "remove-trailing-separator": "^1.0.1", + "replace-ext": "^1.0.0" }, "dependencies": { "clone": { @@ -6045,14 +6046,14 @@ "integrity": "sha1-mmhRzhysHBzqX+hsCTHWIMLPqeY=", "dev": true, "requires": { - "defaults": "1.0.3", - "glob-stream": "3.1.18", - "glob-watcher": "0.0.6", - "graceful-fs": "3.0.11", - "mkdirp": "0.5.1", - "strip-bom": "1.0.0", - "through2": "0.6.5", - "vinyl": "0.4.6" + "defaults": "^1.0.0", + "glob-stream": "^3.1.5", + "glob-watcher": "^0.0.6", + "graceful-fs": "^3.0.0", + "mkdirp": "^0.5.0", + "strip-bom": "^1.0.0", + "through2": "^0.6.1", + "vinyl": "^0.4.0" }, "dependencies": { "clone": { @@ -6073,10 +6074,10 @@ "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", "dev": true, "requires": { - "core-util-is": "1.0.2", - "inherits": "2.0.3", + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", "isarray": "0.0.1", - "string_decoder": "0.10.31" + "string_decoder": "~0.10.x" } }, "string_decoder": { @@ -6091,8 +6092,8 @@ "integrity": "sha1-QaucZ7KdVyCQcUEOHXp6lozTrUg=", "dev": true, "requires": { - "readable-stream": "1.0.34", - "xtend": "4.0.1" + "readable-stream": ">=1.0.33-1 <1.1.0-0", + "xtend": ">=4.0.0 <4.1.0-0" } }, "vinyl": { @@ -6101,8 +6102,8 @@ "integrity": "sha1-LzVsh6VQolVGHza76ypbqL94SEc=", "dev": true, "requires": { - "clone": "0.2.0", - "clone-stats": "0.0.1" + "clone": "^0.2.0", + "clone-stats": "^0.0.1" } } } @@ -6113,13 +6114,13 @@ "integrity": "sha1-kqgAWTo4cDqM2xHYswCtS+Y7PhY=", "dev": true, "requires": { - "append-buffer": "1.0.2", - "convert-source-map": "1.5.1", - "graceful-fs": "4.1.11", - "normalize-path": "2.1.1", - "now-and-later": "2.0.0", - "remove-bom-buffer": "3.0.0", - "vinyl": "2.1.0" + "append-buffer": "^1.0.2", + "convert-source-map": "^1.5.0", + "graceful-fs": "^4.1.6", + "normalize-path": "^2.1.1", + "now-and-later": "^2.0.0", + "remove-bom-buffer": "^3.0.0", + "vinyl": "^2.0.0" }, "dependencies": { "graceful-fs": { @@ -6136,13 +6137,13 @@ "integrity": "sha1-q2VJ1h0XLCsbh75cUI0jnI74dwU=", "dev": true, "requires": { - "source-map": "0.5.7" + "source-map": "^0.5.1" } }, "vm-browserify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.0.1.tgz", - "integrity": "sha512-EqzLchIMYLBjRPoqVsEkZOa/4Vr2RfOWbd58F+I/Gj79AYTrsseMunxbbSkbYfrqZaXSuPBBXNSOhtJgg0PpmA==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/vm-browserify/-/vm-browserify-1.1.0.tgz", + "integrity": "sha512-iq+S7vZJE60yejDYM0ek6zg308+UZsdtPExWP9VZoCFCz1zkJoXFnAX7aZfd/ZwrkidzdUZL0C/ryW+JwAiIGw==", "dev": true }, "which": { @@ -6151,7 +6152,7 @@ "integrity": "sha512-xcJpopdamTuY5duC/KnTTNBraPK54YwpenP4lzxU8H91GudWpFv38u0CKjclE1Wi2EH2EDz5LRcHcKbCIzqGyg==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -6179,8 +6180,8 @@ "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "is-fullwidth-code-point": { @@ -6189,7 +6190,7 @@ "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -6198,9 +6199,9 @@ "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } } } @@ -6217,8 +6218,8 @@ "integrity": "sha512-esZnJZJOiJR9wWKMyuvSE1y6Dq5LCuJanqhxslH2bxM6duahNZ+HMpCLhBQGZkbX6xRf8x1Y2eJlgt2q3qo49Q==", "dev": true, "requires": { - "sax": "1.2.4", - "xmlbuilder": "9.0.7" + "sax": ">=0.6.0", + "xmlbuilder": "~9.0.1" } }, "xmlbuilder": { @@ -6252,9 +6253,9 @@ "dev": true, "optional": true, "requires": { - "camelcase": "1.2.1", - "cliui": "2.1.0", - "decamelize": "1.2.0", + "camelcase": "^1.0.2", + "cliui": "^2.1.0", + "decamelize": "^1.0.0", "window-size": "0.1.0" } }, @@ -6264,7 +6265,7 @@ "integrity": "sha1-nM9qQ0YP5O1Aqbto9I1DuKaMwHc=", "dev": true, "requires": { - "camelcase": "4.1.0" + "camelcase": "^4.1.0" }, "dependencies": { "camelcase": { diff --git a/scripts/build/browserify.js b/scripts/build/browserify.js index 3d9fffa9fa652..1fa5bbdeaf368 100644 --- a/scripts/build/browserify.js +++ b/scripts/build/browserify.js @@ -1,120 +1,34 @@ // @ts-check -const Browserify = require("browserify"); -const Vinyl = require("vinyl"); -const fs = require("fs"); -const path = require("path"); -const convertMap = require("convert-source-map"); -const applySourceMap = require("vinyl-sourcemaps-apply"); -const { Transform, Readable } = require("stream"); +const browserify = require("browserify"); +const Vinyl = require("./vinyl"); +const { Transform } = require("stream"); +const { streamFromFile } = require("./utils"); +const { replaceContents } = require("./sourcemaps"); -module.exports = browserify; +module.exports = browserifyFile; /** * @param {import("browserify").Options} [opts] */ -function browserify(opts) { +function browserifyFile(opts) { return new Transform({ objectMode: true, /** - * @param {string | Buffer | File} input + * @param {string | Buffer | Vinyl} input */ transform(input, _, cb) { if (typeof input === "string" || Buffer.isBuffer(input)) return cb(new Error("Only Vinyl files are supported.")); try { - const sourceMap = input.sourceMap; - const cwd = input.cwd || process.cwd(); - const base = input.base || cwd; - const output = /**@type {File}*/(new Vinyl({ path: input.path, base: input.base })); - const stream = streamFromFile(input); - const b = new Browserify(Object.assign({}, opts, { debug: !!sourceMap, basedir: input.base })); - b.add(stream, { file: input.path, basedir: input.base }); - b.bundle((err, contents) => { - if (err) return cb(err); - output.contents = contents; - if (sourceMap) { - output.sourceMap = typeof sourceMap === "string" ? JSON.parse(sourceMap) : sourceMap; - const sourceRoot = output.sourceMap.sourceRoot; - makeAbsoluteSourceMap(cwd, base, output.sourceMap); - const stringContents = contents.toString("utf8"); - const newSourceMapConverter = convertMap.fromSource(stringContents); - if (newSourceMapConverter) { - const newSourceMap = newSourceMapConverter.toObject(); - makeAbsoluteSourceMap(cwd, base, newSourceMap); - applySourceMap(output, newSourceMap); - makeRelativeSourceMap(cwd, base, sourceRoot, output.sourceMap); - output.contents = new Buffer(convertMap.removeComments(stringContents), "utf8"); - } - } - cb(null, output); - }); + browserify(Object.assign({}, opts, { debug: !!input.sourceMap, basedir: input.base })) + .add(streamFromFile(input), { file: input.path, basedir: input.base }) + .bundle((err, contents) => { + if (err) return cb(err); + cb(null, replaceContents(input, contents)); + }); } catch (e) { cb(e); } } }); -} - -/** - * @param {string | undefined} cwd - * @param {string | undefined} base - * @param {RawSourceMap} sourceMap - * - * @typedef RawSourceMap - * @property {string} version - * @property {string} file - * @property {string} [sourceRoot] - * @property {string[]} sources - * @property {string[]} [sourcesContents] - * @property {string} mappings - * @property {string[]} [names] - */ -function makeAbsoluteSourceMap(cwd = process.cwd(), base = "", sourceMap) { - const sourceRoot = sourceMap.sourceRoot || ""; - const resolvedBase = path.resolve(cwd, base); - const resolvedSourceRoot = path.resolve(resolvedBase, sourceRoot); - sourceMap.file = path.resolve(resolvedBase, sourceMap.file).replace(/\\/g, "/"); - sourceMap.sources = sourceMap.sources.map(source => path.resolve(resolvedSourceRoot, source).replace(/\\/g, "/")); - sourceMap.sourceRoot = ""; -} - -/** - * @param {string | undefined} cwd - * @param {string | undefined} base - * @param {string} sourceRoot - * @param {RawSourceMap} sourceMap - */ -function makeRelativeSourceMap(cwd = process.cwd(), base = "", sourceRoot, sourceMap) { - makeAbsoluteSourceMap(cwd, base, sourceMap); - const resolvedBase = path.resolve(cwd, base); - const resolvedSourceRoot = path.resolve(resolvedBase, sourceRoot); - sourceMap.file = path.relative(resolvedBase, sourceMap.file).replace(/\\/g, "/"); - sourceMap.sources = sourceMap.sources.map(source => path.relative(resolvedSourceRoot, source).replace(/\\/g, "/")); - sourceMap.sourceRoot = sourceRoot; -} - -/** - * @param {File} file - */ -function streamFromFile(file) { - return file.isBuffer() ? streamFromBuffer(file.contents) : - file.isStream() ? file.contents : - fs.createReadStream(file.path, { autoClose: true }); -} - -/** - * @param {Buffer} buffer - */ -function streamFromBuffer(buffer) { - return new Readable({ - read() { - this.push(buffer); - this.push(null); - } - }); -} - -/** - * @typedef {import("vinyl") & { sourceMap?: any }} File - */ -void 0; \ No newline at end of file +} \ No newline at end of file diff --git a/scripts/build/cancellation.js b/scripts/build/cancellation.js new file mode 100644 index 0000000000000..793aaf19d868c --- /dev/null +++ b/scripts/build/cancellation.js @@ -0,0 +1,71 @@ +// @ts-check +const symSource = Symbol("CancelToken.source"); +const symToken = Symbol("CancelSource.token"); +const symCancellationRequested = Symbol("CancelSource.cancellationRequested"); +const symCancellationCallbacks = Symbol("CancelSource.cancellationCallbacks"); + +class CancelSource { + constructor() { + this[symCancellationRequested] = false; + this[symCancellationCallbacks] = []; + } + + /** @type {CancelToken} */ + get token() { + return this[symToken] || (this[symToken] = new CancelToken(this)); + } + + cancel() { + if (!this[symCancellationRequested]) { + this[symCancellationRequested] = true; + for (const callback of this[symCancellationCallbacks]) { + callback(); + } + } + } +} +exports.CancelSource = CancelSource; + +class CancelToken { + /** + * @param {CancelSource} source + */ + constructor(source) { + if (source[symToken]) return source[symToken]; + this[symSource] = source; + } + + /** @type {boolean} */ + get cancellationRequested() { + return this[symSource][symCancellationRequested]; + } + + /** + * @param {() => void} callback + */ + subscribe(callback) { + const source = this[symSource]; + if (source[symCancellationRequested]) { + callback(); + return; + } + + source[symCancellationCallbacks].push(callback); + + return { + unsubscribe() { + const index = source[symCancellationCallbacks].indexOf(callback); + if (index !== -1) source[symCancellationCallbacks].splice(index, 1); + } + }; + } +} +exports.CancelToken = CancelToken; + +class CancelError extends Error { + constructor(message = "Operation was canceled") { + super(message); + this.name = "CancelError"; + } +} +exports.CancelError = CancelError; \ No newline at end of file diff --git a/scripts/build/debounce.js b/scripts/build/debounce.js new file mode 100644 index 0000000000000..7020cb61bbd16 --- /dev/null +++ b/scripts/build/debounce.js @@ -0,0 +1,31 @@ +// @ts-check +module.exports = debounce; + +/** + * @param {() => void} cb + * @param {number} timeout + * @param {DebounceOptions} [opts] + * + * @typedef DebounceOptions + * @property {number} [max] + */ +function debounce(cb, timeout, opts = {}) { + if (timeout < 10) timeout = 10; + let max = opts.max || 10; + if (max < timeout) max = timeout; + let minTimer; + let maxTimer; + return trigger; + + function trigger() { + if (max > timeout && !maxTimer) maxTimer = setTimeout(done, max); + if (minTimer) clearTimeout(minTimer); + minTimer = setTimeout(done, timeout); + } + + function done() { + if (maxTimer) maxTimer = void clearTimeout(maxTimer); + if (minTimer) minTimer = void clearTimeout(minTimer); + cb(); + } +} \ No newline at end of file diff --git a/scripts/build/exec.js b/scripts/build/exec.js index ca7c6e3f6c961..04336321dd468 100644 --- a/scripts/build/exec.js +++ b/scripts/build/exec.js @@ -3,6 +3,7 @@ const cp = require("child_process"); const log = require("fancy-log"); // was `require("gulp-util").log (see https://github.com/gulpjs/gulp-util) const isWin = /^win/.test(process.platform); const chalk = require("./chalk"); +const { CancelToken, CancelError } = require("./cancellation"); module.exports = exec; @@ -10,8 +11,11 @@ module.exports = exec; * Executes the provided command once with the supplied arguments. * @param {string} cmd * @param {string[]} args - * @param {object} [options] - * @param {boolean} [options.ignoreExitCode] + * @param {ExecOptions} [options] + * + * @typedef ExecOptions + * @property {boolean} [ignoreExitCode] + * @property {CancelToken} [cancelToken] */ function exec(cmd, args, options = {}) { return /**@type {Promise<{exitCode: number}>}*/(new Promise((resolve, reject) => { @@ -20,7 +24,13 @@ function exec(cmd, args, options = {}) { const subshellFlag = isWin ? "/c" : "-c"; const command = isWin ? [possiblyQuote(cmd), ...args] : [`${cmd} ${args.join(" ")}`]; const ex = cp.spawn(isWin ? "cmd" : "/bin/sh", [subshellFlag, ...command], { stdio: "inherit", windowsVerbatimArguments: true }); + const subscription = options.cancelToken && options.cancelToken.subscribe(() => { + ex.kill("SIGINT"); + ex.kill("SIGTERM"); + reject(new CancelError()); + }); ex.on("exit", exitCode => { + subscription && subscription.unsubscribe(); if (exitCode === 0 || options.ignoreExitCode) { resolve({ exitCode }); } @@ -28,7 +38,10 @@ function exec(cmd, args, options = {}) { reject(new Error(`Process exited with code: ${exitCode}`)); } }); - ex.on("error", reject); + ex.on("error", error => { + subscription && subscription.unsubscribe(); + reject(error); + }); })); } diff --git a/scripts/build/options.js b/scripts/build/options.js index b69358f0f9874..e9e3bfb7b1bc6 100644 --- a/scripts/build/options.js +++ b/scripts/build/options.js @@ -4,7 +4,7 @@ const os = require("os"); /** @type {CommandLineOptions} */ module.exports = minimist(process.argv.slice(2), { - boolean: ["debug", "inspect", "light", "colors", "lint", "soft", "fix", "failed", "keepFailed"], + boolean: ["debug", "dirty", "inspect", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed"], string: ["browser", "tests", "host", "reporter", "stackTraceLimit", "timeout"], alias: { "b": "browser", @@ -33,17 +33,21 @@ module.exports = minimist(process.argv.slice(2), { fix: process.env.fix || process.env.f, workers: process.env.workerCount || os.cpus().length, failed: false, - keepFailed: false + keepFailed: false, + lkg: false, + dirty: false } }); /** * @typedef TypedOptions * @property {boolean} debug + * @property {boolean} dirty * @property {boolean} inspect * @property {boolean} light * @property {boolean} colors * @property {boolean} lint + * @property {boolean} lkg * @property {boolean} soft * @property {boolean} fix * @property {string} browser @@ -56,7 +60,7 @@ module.exports = minimist(process.argv.slice(2), { * @property {string|number} timeout * @property {boolean} failed * @property {boolean} keepFailed - * + * * @typedef {import("minimist").ParsedArgs & TypedOptions} CommandLineOptions */ void 0; \ No newline at end of file diff --git a/scripts/build/prepend.js b/scripts/build/prepend.js new file mode 100644 index 0000000000000..6e7b794e79bea --- /dev/null +++ b/scripts/build/prepend.js @@ -0,0 +1,66 @@ +// @ts-check +const stream = require("stream"); +const Vinyl = require("./vinyl"); +const ts = require("../../lib/typescript"); +const fs = require("fs"); +const { base64VLQFormatEncode } = require("./sourcemaps"); + +module.exports = exports = prepend; + +/** + * @param {string | ((file: Vinyl) => string)} data + */ +function prepend(data) { + return new stream.Transform({ + objectMode: true, + /** + * @param {string | Buffer | Vinyl} input + * @param {(error: Error, data?: any) => void} cb + */ + transform(input, _, cb) { + if (typeof input === "string" || Buffer.isBuffer(input)) return cb(new Error("Only Vinyl files are supported.")); + if (!input.isBuffer()) return cb(new Error("Streams not supported.")); + try { + const output = input.clone(); + const prependContent = typeof data === "function" ? data(input) : data; + output.contents = Buffer.concat([Buffer.from(prependContent, "utf8"), input.contents]); + if (input.sourceMap) { + if (typeof input.sourceMap === "string") input.sourceMap = /**@type {import("./sourcemaps").RawSourceMap}*/(JSON.parse(input.sourceMap)); + const lineStarts = /**@type {*}*/(ts).computeLineStarts(prependContent); + let prependMappings = ""; + for (let i = 1; i < lineStarts.length; i++) { + prependMappings += ";"; + } + const offset = prependContent.length - lineStarts[lineStarts.length - 1]; + if (offset > 0) { + prependMappings += base64VLQFormatEncode(offset) + ","; + } + output.sourceMap = { + version: input.sourceMap.version, + file: input.sourceMap.file, + sources: input.sourceMap.sources, + sourceRoot: input.sourceMap.sourceRoot, + mappings: prependMappings + input.sourceMap.mappings, + names: input.names, + sourcesContent: input.sourcesContent + }; + } + return cb(null, output); + } + catch (e) { + return cb(e); + } + } + }) +} +exports.prepend = prepend; + +/** + * @param {string | ((file: Vinyl) => string)} file + */ +function prependFile(file) { + const data = typeof file === "string" ? fs.readFileSync(file, "utf8") : + vinyl => fs.readFileSync(file(vinyl), "utf8"); + return prepend(data) +} +exports.file = prependFile; \ No newline at end of file diff --git a/scripts/build/project.js b/scripts/build/project.js index 35b500d749a9c..933f7c44c65fc 100644 --- a/scripts/build/project.js +++ b/scripts/build/project.js @@ -209,6 +209,27 @@ function flatten(projectSpec, flattenedProjectSpec, options = {}) { } exports.flatten = flatten; +/** + * Returns a Promise that resolves when all pending build tasks have completed + */ +function wait() { + return new Promise(resolve => { + if (compilationGulp.allDone()) { + resolve(); + } + else { + const onDone = () => { + compilationGulp.removeListener("onDone", onDone); + compilationGulp.removeListener("err", onDone); + resolve(); + }; + compilationGulp.on("stop", onDone); + compilationGulp.on("err", onDone); + } + }); +} +exports.wait = wait; + /** * Resolve a TypeScript specifier into a fully-qualified module specifier and any requisite dependencies. * @param {string} typescript An unresolved module specifier to a TypeScript version. diff --git a/scripts/build/sourcemaps.js b/scripts/build/sourcemaps.js new file mode 100644 index 0000000000000..66e488287b2b7 --- /dev/null +++ b/scripts/build/sourcemaps.js @@ -0,0 +1,143 @@ +// @ts-check +const path = require("path"); +const Vinyl = require("./vinyl"); +const convertMap = require("convert-source-map"); +const applySourceMap = require("vinyl-sourcemaps-apply"); +const through2 = require("through2"); + +/** + * @param {Vinyl} input + * @param {string | Buffer} contents + * @param {string | RawSourceMap} [sourceMap] + */ +function replaceContents(input, contents, sourceMap) { + const output = input.clone(); + output.contents = typeof contents === "string" ? Buffer.from(contents, "utf8") : contents; + if (input.sourceMap) { + output.sourceMap = typeof input.sourceMap === "string" ? /**@type {RawSourceMap}*/(JSON.parse(input.sourceMap)) : input.sourceMap; + if (typeof sourceMap === "string") { + sourceMap = /**@type {RawSourceMap}*/(JSON.parse(sourceMap)); + } + else if (sourceMap === undefined) { + const stringContents = typeof contents === "string" ? contents : contents.toString("utf8"); + const newSourceMapConverter = convertMap.fromSource(stringContents); + if (newSourceMapConverter) { + sourceMap = /**@type {RawSourceMap}*/(newSourceMapConverter.toObject()); + output.contents = new Buffer(convertMap.removeMapFileComments(stringContents), "utf8"); + } + } + if (sourceMap) { + const cwd = input.cwd || process.cwd(); + const base = input.base || cwd; + const sourceRoot = output.sourceMap.sourceRoot; + makeAbsoluteSourceMap(cwd, base, output.sourceMap); + makeAbsoluteSourceMap(cwd, base, sourceMap); + applySourceMap(output, sourceMap); + makeRelativeSourceMap(cwd, base, sourceRoot, output.sourceMap); + } + else { + output.sourceMap = undefined; + } + } + return output; +} +exports.replaceContents = replaceContents; + +function removeSourceMaps() { + return through2.obj((/**@type {Vinyl}*/file, _, cb) => { + if (file.sourceMap && file.isBuffer()) { + file.contents = Buffer.from(convertMap.removeMapFileComments(file.contents.toString("utf8")), "utf8"); + file.sourceMap = undefined; + } + cb(null, file); + }); +} +exports.removeSourceMaps = removeSourceMaps; + +/** + * @param {string | undefined} cwd + * @param {string | undefined} base + * @param {RawSourceMap} sourceMap + * + * @typedef RawSourceMap + * @property {string} version + * @property {string} file + * @property {string} [sourceRoot] + * @property {string[]} sources + * @property {string[]} [sourcesContent] + * @property {string} mappings + * @property {string[]} [names] + */ +function makeAbsoluteSourceMap(cwd = process.cwd(), base = "", sourceMap) { + const sourceRoot = sourceMap.sourceRoot || ""; + const resolvedBase = path.resolve(cwd, base); + const resolvedSourceRoot = path.resolve(resolvedBase, sourceRoot); + sourceMap.file = path.resolve(resolvedBase, sourceMap.file).replace(/\\/g, "/"); + sourceMap.sources = sourceMap.sources.map(source => path.resolve(resolvedSourceRoot, source).replace(/\\/g, "/")); + sourceMap.sourceRoot = ""; +} +exports.makeAbsoluteSourceMap = makeAbsoluteSourceMap; + +/** + * @param {string | undefined} cwd + * @param {string | undefined} base + * @param {string} sourceRoot + * @param {RawSourceMap} sourceMap + */ +function makeRelativeSourceMap(cwd = process.cwd(), base = "", sourceRoot, sourceMap) { + makeAbsoluteSourceMap(cwd, base, sourceMap); + const resolvedBase = path.resolve(cwd, base); + const resolvedSourceRoot = path.resolve(resolvedBase, sourceRoot); + sourceMap.file = path.relative(resolvedBase, sourceMap.file).replace(/\\/g, "/"); + sourceMap.sources = sourceMap.sources.map(source => path.relative(resolvedSourceRoot, source).replace(/\\/g, "/")); + sourceMap.sourceRoot = sourceRoot; +} +exports.makeRelativeSourceMap = makeRelativeSourceMap; + +/** + * @param {string} message + * @returns {never} + */ +function fail(message) { + throw new Error(message); +} + +/** + * @param {number} value + */ +function base64FormatEncode(value) { + return value < 0 ? fail("Invalid value") : + value < 26 ? 0x41 /*A*/ + value : + value < 52 ? 0x61 /*a*/ + value - 26 : + value < 62 ? 0x30 /*0*/ + value - 52 : + value === 62 ? 0x2B /*+*/ : + value === 63 ? 0x2F /*/*/ : + fail("Invalid value"); +} + +/** + * @param {number} value + */ +function base64VLQFormatEncode(value) { + if (value < 0) { + value = ((-value) << 1) + 1; + } + else { + value = value << 1; + } + + // Encode 5 bits at a time starting from least significant bits + let result = ""; + do { + let currentDigit = value & 31; // 11111 + value = value >> 5; + if (value > 0) { + // There are still more digits to decode, set the msb (6th bit) + currentDigit = currentDigit | 32; + } + result += String.fromCharCode(base64FormatEncode(currentDigit)); + } while (value > 0); + + return result; +} +exports.base64VLQFormatEncode = base64VLQFormatEncode; \ No newline at end of file diff --git a/scripts/build/tests.js b/scripts/build/tests.js index 36615149d701c..d631f1e35acc5 100644 --- a/scripts/build/tests.js +++ b/scripts/build/tests.js @@ -1,4 +1,5 @@ // @ts-check +const gulp = require("./gulp"); const del = require("del"); const fs = require("fs"); const os = require("os"); @@ -6,13 +7,8 @@ const path = require("path"); const mkdirP = require("./mkdirp"); const cmdLineOptions = require("./options"); const exec = require("./exec"); -const runSequence = require("run-sequence"); -const finished = require("./finished"); const log = require("fancy-log"); // was `require("gulp-util").log (see https://github.com/gulpjs/gulp-util) - -const nodeModulesPathPrefix = path.resolve("./node_modules/.bin/"); -const isWin = /^win/.test(process.platform); -const mocha = path.join(nodeModulesPathPrefix, "mocha") + (isWin ? ".cmd" : ""); +const mochaJs = require.resolve("mocha/bin/_mocha"); exports.localBaseline = "tests/baselines/local/"; exports.refBaseline = "tests/baselines/reference/"; @@ -24,8 +20,10 @@ exports.localTest262Baseline = "internal/baselines/test262/local"; * @param {string} runJs * @param {string} defaultReporter * @param {boolean} runInParallel + * @param {boolean} watchMode + * @param {InstanceType} [cancelToken] */ -function runConsoleTests(runJs, defaultReporter, runInParallel) { +async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, cancelToken) { let testTimeout = cmdLineOptions.timeout; let tests = cmdLineOptions.tests; const lintFlag = cmdLineOptions.lint; @@ -36,112 +34,116 @@ function runConsoleTests(runJs, defaultReporter, runInParallel) { const stackTraceLimit = cmdLineOptions.stackTraceLimit; const testConfigFile = "test.config"; const failed = cmdLineOptions.failed; - const keepFailed = cmdLineOptions.keepFailed || failed; - return cleanTestDirs() - .then(() => { - if (fs.existsSync(testConfigFile)) { - fs.unlinkSync(testConfigFile); - } - - let workerCount, taskConfigsFolder; - if (runInParallel) { - // generate name to store task configuration files - const prefix = os.tmpdir() + "/ts-tests"; - let i = 1; - do { - taskConfigsFolder = prefix + i; - i++; - } while (fs.existsSync(taskConfigsFolder)); - fs.mkdirSync(taskConfigsFolder); - - workerCount = cmdLineOptions.workers; - } - - if (tests && tests.toLocaleLowerCase() === "rwc") { - testTimeout = 400000; - } - - if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed) { - writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed); - } - - const colors = cmdLineOptions.colors; - const reporter = cmdLineOptions.reporter || defaultReporter; - - /** @type {string} */ - let host = "node"; - - /** @type {string[]} */ - let args = []; - - // timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally - // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer - if (!runInParallel) { - args.push("-R", "scripts/failed-tests"); - args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + '"'); - if (tests) { - args.push("-g", `"${tests}"`); - } - if (colors) { - args.push("--colors"); - } - else { - args.push("--no-colors"); - } - if (inspect) { - args.unshift("--inspect-brk"); - } - else if (debug) { - args.unshift("--debug-brk"); - } - else { - args.push("-t", "" + testTimeout); - } - args.push(runJs); - host = mocha; - } - else { - // run task to load all tests and partition them between workers - host = "node"; - args.push(runJs); - } - setNodeEnvToDevelopment(); - if (failed) { - return exec(host, ["scripts/run-failed-tests.js"].concat(args)); - } - else { - return exec(host, args); - } - }) - .then(({ exitCode }) => { - if (exitCode !== 0) return finish(undefined, exitCode); - if (lintFlag) return finished(runSequence("lint")).then(() => finish(), finish); - return finish(); - }, finish); - - /** - * @param {any=} error - * @param {number=} errorStatus - */ - function finish(error, errorStatus) { + const keepFailed = cmdLineOptions.keepFailed; + if (!cmdLineOptions.dirty) { + await cleanTestDirs(); + } + + if (fs.existsSync(testConfigFile)) { + fs.unlinkSync(testConfigFile); + } + + let workerCount, taskConfigsFolder; + if (runInParallel) { + // generate name to store task configuration files + const prefix = os.tmpdir() + "/ts-tests"; + let i = 1; + do { + taskConfigsFolder = prefix + i; + i++; + } while (fs.existsSync(taskConfigsFolder)); + fs.mkdirSync(taskConfigsFolder); + + workerCount = cmdLineOptions.workers; + } + + if (tests && tests.toLocaleLowerCase() === "rwc") { + testTimeout = 400000; + } + + if (tests || runners || light || testTimeout || taskConfigsFolder || keepFailed) { + writeTestConfigFile(tests, runners, light, taskConfigsFolder, workerCount, stackTraceLimit, testTimeout, keepFailed); + } + + const colors = cmdLineOptions.colors; + const reporter = cmdLineOptions.reporter || defaultReporter; + + /** @type {string[]} */ + let args = []; + + // timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally + // default timeout is 2sec which really should be enough, but maybe we just need a small amount longer + if (!runInParallel) { + args.push(failed ? "scripts/run-failed-tests.js" : mochaJs); + args.push("-R", "scripts/failed-tests"); + args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + '"'); + if (tests) { + args.push("-g", `"${tests}"`); + } + if (colors) { + args.push("--colors"); + } + else { + args.push("--no-colors"); + } + if (inspect) { + args.unshift("--inspect-brk"); + } + else if (debug) { + args.unshift("--debug-brk"); + } + else { + args.push("-t", "" + testTimeout); + } + args.push(runJs); + } + else { + // run task to load all tests and partition them between workers + args.push(runJs); + } + + /** @type {number | undefined} */ + let errorStatus; + + /** @type {Error | undefined} */ + let error; + + try { + setNodeEnvToDevelopment(); + const { exitCode } = await exec("node", args, { cancelToken }); + if (exitCode !== 0) { + errorStatus = exitCode; + error = new Error(`Process exited with status code ${errorStatus}.`); + } + else if (lintFlag) { + await new Promise((resolve, reject) => gulp.start(["lint"], error => error ? reject(error) : resolve())); + } + } + catch (e) { + errorStatus = undefined; + error = e; + } + finally { restoreSavedNodeEnv(); - return deleteTestConfig() - .then(deleteTemporaryProjectOutput) - .then(() => { - if (error !== undefined || errorStatus !== undefined) { - process.exit(typeof errorStatus === "number" ? errorStatus : 2); - } - }); } - function deleteTestConfig() { - return del("test.config"); + await del("test.config"); + await deleteTemporaryProjectOutput(); + + if (error !== undefined) { + if (watchMode) { + throw error; + } + else { + log.error(error); + process.exit(typeof errorStatus === "number" ? errorStatus : 2); + } } } exports.runConsoleTests = runConsoleTests; function cleanTestDirs() { - return del([exports.localBaseline, exports.localRwcBaseline,]) + return del([exports.localBaseline, exports.localRwcBaseline]) .then(() => mkdirP(exports.localRwcBaseline)) .then(() => mkdirP(exports.localBaseline)); } diff --git a/scripts/build/utils.js b/scripts/build/utils.js new file mode 100644 index 0000000000000..06f55d7288ac3 --- /dev/null +++ b/scripts/build/utils.js @@ -0,0 +1,27 @@ +// @ts-check +const fs = require("fs"); +const File = require("./vinyl"); +const { Readable } = require("stream"); + +/** + * @param {File} file + */ +function streamFromFile(file) { + return file.isBuffer() ? streamFromBuffer(file.contents) : + file.isStream() ? file.contents : + fs.createReadStream(file.path, { autoClose: true }); +} +exports.streamFromFile = streamFromFile; + +/** + * @param {Buffer} buffer + */ +function streamFromBuffer(buffer) { + return new Readable({ + read() { + this.push(buffer); + this.push(null); + } + }); +} +exports.streamFromBuffer = streamFromBuffer; \ No newline at end of file diff --git a/scripts/build/vinyl.d.ts b/scripts/build/vinyl.d.ts new file mode 100644 index 0000000000000..1dfb631499194 --- /dev/null +++ b/scripts/build/vinyl.d.ts @@ -0,0 +1,60 @@ +// NOTE: This makes it possible to correctly type vinyl Files under @ts-check. +export = File; + +declare class File { + constructor(options?: File.VinylOptions); + + cwd: string; + base: string; + path: string; + readonly history: ReadonlyArray; + contents: T; + relative: string; + dirname: string; + basename: string; + stem: string; + extname: string; + symlink: string | null; + stat: import("fs").Stats | null; + sourceMap?: import("./sourcemaps").RawSourceMap | string; + + [custom: string]: any; + + isBuffer(): this is T extends Buffer ? File : never; + isStream(): this is T extends NodeJS.ReadableStream ? File : never; + isNull(): this is T extends null ? File : never; + isDirectory(): this is T extends null ? File.Directory : never; + isSymbolic(): this is T extends null ? File.Symbolic : never; + clone(opts?: { contents?: boolean, deep?: boolean }): this; +} + +namespace File { + export interface VinylOptions { + cwd?: string; + base?: string; + path?: string; + history?: ReadonlyArray; + stat?: import("fs").Stats; + contents?: T; + sourceMap?: import("./sourcemaps").RawSourceMap | string; + [custom: string]: any; + } + + export type Contents = Buffer | NodeJS.ReadableStream | null; + export type File = import("./vinyl"); + export type NullFile = File; + export type BufferFile = File; + export type StreamFile = File; + + export interface Directory extends NullFile { + isNull(): true; + isDirectory(): true; + isSymbolic(): this is never; + } + + export interface Symbolic extends NullFile { + isNull(): true; + isDirectory(): this is never; + isSymbolic(): true; + } +} \ No newline at end of file diff --git a/scripts/build/vinyl.js b/scripts/build/vinyl.js new file mode 100644 index 0000000000000..6cf68f3cd26ce --- /dev/null +++ b/scripts/build/vinyl.js @@ -0,0 +1 @@ +module.exports = require("vinyl"); \ No newline at end of file diff --git a/scripts/failed-tests.js b/scripts/failed-tests.js index 9d54bb8bd02dc..46baa3201ec78 100644 --- a/scripts/failed-tests.js +++ b/scripts/failed-tests.js @@ -4,9 +4,11 @@ const path = require("path"); const fs = require("fs"); const os = require("os"); +const failingHookRegExp = /^(.*) "(before|after) (all|each)" hook$/; + /** * .failed-tests reporter - * + * * @typedef {Object} ReporterOptions * @property {string} [file] * @property {boolean} [keepFailed] @@ -15,7 +17,7 @@ const os = require("os"); */ class FailedTestsReporter extends Mocha.reporters.Base { /** - * @param {Mocha.Runner} runner + * @param {Mocha.Runner} runner * @param {{ reporterOptions?: ReporterOptions }} [options] */ constructor(runner, options) { @@ -49,35 +51,58 @@ class FailedTestsReporter extends Mocha.reporters.Base { /** @type {Mocha.Test[]} */ this.passes = []; - - /** @type {Mocha.Test[]} */ + + /** @type {(Mocha.Test)[]} */ this.failures = []; - + runner.on("pass", test => this.passes.push(test)); runner.on("fail", test => this.failures.push(test)); } /** - * @param {string} file - * @param {ReadonlyArray} passes - * @param {ReadonlyArray} failures - * @param {boolean} keepFailed - * @param {(err?: NodeJS.ErrnoException) => void} done + * @param {string} file + * @param {ReadonlyArray} passes + * @param {ReadonlyArray} failures + * @param {boolean} keepFailed + * @param {(err?: NodeJS.ErrnoException) => void} done */ static writeFailures(file, passes, failures, keepFailed, done) { const failingTests = new Set(fs.existsSync(file) ? readTests() : undefined); - if (failingTests.size > 0) { + const possiblyPassingSuites = /**@type {Set}*/(new Set()); + + // Remove tests that are now passing and track suites that are now + // possibly passing. + if (failingTests.size > 0 && !keepFailed) { for (const test of passes) { - const title = test.fullTitle().trim(); - if (title) failingTests.delete(title); + failingTests.delete(test.fullTitle().trim()); + possiblyPassingSuites.add(test.parent.fullTitle().trim()); } } + + // Add tests that are now failing. If a hook failed, track its + // containing suite as failing. If the suite for a test or hook was + // possibly passing then it is now definitely failing. for (const test of failures) { - const title = test.fullTitle().trim(); - if (title) failingTests.add(title); + const suiteTitle = test.parent.fullTitle().trim(); + if (test.type === "test") { + failingTests.add(test.fullTitle().trim()); + } + else { + failingTests.add(suiteTitle); + } + possiblyPassingSuites.delete(suiteTitle); } + + // Remove all definitely passing suites. + for (const suite of possiblyPassingSuites) { + failingTests.delete(suite); + } + if (failingTests.size > 0) { - const failed = Array.from(failingTests).join(os.EOL); + const failed = Array + .from(failingTests) + .sort() + .join(os.EOL); fs.writeFile(file, failed, "utf8", done); } else if (!keepFailed && fs.existsSync(file)) { @@ -96,7 +121,7 @@ class FailedTestsReporter extends Mocha.reporters.Base { } /** - * @param {number} failures + * @param {number} failures * @param {(failures: number) => void} [fn] */ done(failures, fn) { diff --git a/scripts/produceLKG.ts b/scripts/produceLKG.ts index a49b4fcbe4923..31a81f97a2c69 100644 --- a/scripts/produceLKG.ts +++ b/scripts/produceLKG.ts @@ -54,16 +54,17 @@ async function copyScriptOutputs() { await copyWithCopyright("cancellationToken.js"); await copyWithCopyright("tsc.release.js", "tsc.js"); await copyWithCopyright("tsserver.js"); - await copyWithCopyright("typescript.js"); - await copyWithCopyright("typescriptServices.js"); + await copyFromBuiltLocal("tsserverlibrary.js"); // copyright added by build + await copyFromBuiltLocal("typescript.js"); // copyright added by build + await copyFromBuiltLocal("typescriptServices.js"); // copyright added by build await copyWithCopyright("typingsInstaller.js"); await copyWithCopyright("watchGuard.js"); } async function copyDeclarationOutputs() { - await copyWithCopyright("tsserverlibrary.d.ts"); - await copyWithCopyright("typescript.d.ts"); - await copyWithCopyright("typescriptServices.d.ts"); + await copyFromBuiltLocal("tsserverlibrary.d.ts"); // copyright added by build + await copyFromBuiltLocal("typescript.d.ts"); // copyright added by build + await copyFromBuiltLocal("typescriptServices.d.ts"); // copyright added by build } async function writeGitAttributes() { diff --git a/scripts/run-failed-tests.js b/scripts/run-failed-tests.js index 876c4a34eec8d..bde06df11cb0e 100644 --- a/scripts/run-failed-tests.js +++ b/scripts/run-failed-tests.js @@ -69,7 +69,12 @@ const proc = spawn(process.execPath, args, { proc.on('exit', (code, signal) => { process.on('exit', () => { if (grepFile) { - fs.unlinkSync(grepFile); + try { + fs.unlinkSync(grepFile); + } + catch (e) { + if (e.code !== "ENOENT") throw e; + } } if (signal) { diff --git a/src/compiler/binder.ts b/src/compiler/binder.ts index b571530c5d9d7..20183785dfd10 100644 --- a/src/compiler/binder.ts +++ b/src/compiler/binder.ts @@ -1211,7 +1211,7 @@ namespace ts { bind(node.statement); popActiveLabel(); if (!activeLabel.referenced && !options.allowUnusedLabels) { - errorOrSuggestionOnFirstToken(unusedLabelIsError(options), node, Diagnostics.Unused_label); + errorOrSuggestionOnNode(unusedLabelIsError(options), node.label, Diagnostics.Unused_label); } if (!node.statement || node.statement.kind !== SyntaxKind.DoStatement) { // do statement sets current flow inside bindDoStatement @@ -1918,9 +1918,16 @@ namespace ts { file.bindDiagnostics.push(createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2)); } - function errorOrSuggestionOnFirstToken(isError: boolean, node: Node, message: DiagnosticMessage, arg0?: any, arg1?: any, arg2?: any) { - const span = getSpanOfTokenAtPosition(file, node.pos); - const diag = createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2); + function errorOrSuggestionOnNode(isError: boolean, node: Node, message: DiagnosticMessage): void { + errorOrSuggestionOnRange(isError, node, node, message); + } + + function errorOrSuggestionOnRange(isError: boolean, startNode: Node, endNode: Node, message: DiagnosticMessage): void { + addErrorOrSuggestionDiagnostic(isError, { pos: getTokenPosOfNode(startNode, file), end: endNode.end }, message); + } + + function addErrorOrSuggestionDiagnostic(isError: boolean, range: TextRange, message: DiagnosticMessage): void { + const diag = createFileDiagnostic(file, range.pos, range.end - range.pos, message); if (isError) { file.bindDiagnostics.push(diag); } @@ -2792,7 +2799,7 @@ namespace ts { node.declarationList.declarations.some(d => !!d.initializer) ); - errorOrSuggestionOnFirstToken(isError, node, Diagnostics.Unreachable_code_detected); + eachUnreachableRange(node, (start, end) => errorOrSuggestionOnRange(isError, start, end, Diagnostics.Unreachable_code_detected)); } } } @@ -2800,6 +2807,38 @@ namespace ts { } } + function eachUnreachableRange(node: Node, cb: (start: Node, last: Node) => void): void { + if (isStatement(node) && isExecutableStatement(node) && isBlock(node.parent)) { + const { statements } = node.parent; + const slice = sliceAfter(statements, node); + getRangesWhere(slice, isExecutableStatement, (start, afterEnd) => cb(slice[start], slice[afterEnd - 1])); + } + else { + cb(node, node); + } + } + // As opposed to a pure declaration like an `interface` + function isExecutableStatement(s: Statement): boolean { + // Don't remove statements that can validly be used before they appear. + return !isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && + // `var x;` may declare a variable used above + !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & (NodeFlags.Let | NodeFlags.Const)) && s.declarationList.declarations.some(d => !d.initializer)); + } + + function isPurelyTypeDeclaration(s: Statement): boolean { + switch (s.kind) { + case SyntaxKind.InterfaceDeclaration: + case SyntaxKind.TypeAliasDeclaration: + return true; + case SyntaxKind.ModuleDeclaration: + return getModuleInstanceState(s as ModuleDeclaration) !== ModuleInstanceState.Instantiated; + case SyntaxKind.EnumDeclaration: + return hasModifier(s, ModifierFlags.Const); + default: + return false; + } + } + /* @internal */ export function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean { return isExportsIdentifier(node) || diff --git a/src/compiler/checker.ts b/src/compiler/checker.ts index 3a19ca63b3f9b..2e48c4ca1bc07 100644 --- a/src/compiler/checker.ts +++ b/src/compiler/checker.ts @@ -295,7 +295,7 @@ namespace ts { getAllPossiblePropertiesOfTypes, getSuggestionForNonexistentProperty: (node, type) => getSuggestionForNonexistentProperty(node, type), getSuggestionForNonexistentSymbol: (location, name, meaning) => getSuggestionForNonexistentSymbol(location, escapeLeadingUnderscores(name), meaning), - getSuggestionForNonexistentModule: (node, target) => getSuggestionForNonexistentModule(node, target), + getSuggestionForNonexistentExport: (node, target) => getSuggestionForNonexistentExport(node, target), getBaseConstraintOfType, getDefaultFromTypeParameter: type => type && type.flags & TypeFlags.TypeParameter ? getDefaultFromTypeParameter(type as TypeParameter) : undefined, resolveName(name, location, meaning, excludeGlobals) { @@ -710,7 +710,7 @@ namespace ts { } } - function addRelatedInfo(diagnostic: Diagnostic, ...relatedInformation: DiagnosticRelatedInformation[]) { + function addRelatedInfo(diagnostic: Diagnostic, ...relatedInformation: [DiagnosticRelatedInformation, ...DiagnosticRelatedInformation[]]) { if (!diagnostic.relatedInformation) { diagnostic.relatedInformation = []; } @@ -1059,6 +1059,7 @@ namespace ts { // 5. inside a TS export= declaration (since we will move the export statement during emit to avoid TDZ) // or if usage is in a type context: // 1. inside a type query (typeof in type position) + // 2. inside a jsdoc comment if (usage.parent.kind === SyntaxKind.ExportSpecifier || (usage.parent.kind === SyntaxKind.ExportAssignment && (usage.parent as ExportAssignment).isExportEquals)) { // export specifiers do not use the variable, they only make it available for use return true; @@ -1069,7 +1070,7 @@ namespace ts { } const container = getEnclosingBlockScopeContainer(declaration); - return isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); + return !!(usage.flags & NodeFlags.JSDoc) || isInTypeQuery(usage) || isUsedInFunctionOrInstanceProperty(usage, declaration, container); function isImmediatelyUsedInInitializerOfBlockScopedVariable(declaration: VariableDeclaration, usage: Node): boolean { const container = getEnclosingBlockScopeContainer(declaration); @@ -1434,11 +1435,18 @@ namespace ts { !checkAndReportErrorForUsingTypeAsNamespace(errorLocation, name, meaning) && !checkAndReportErrorForUsingTypeAsValue(errorLocation, name, meaning) && !checkAndReportErrorForUsingNamespaceModuleAsValue(errorLocation, name, meaning)) { - let suggestion: string | undefined; + let suggestion: Symbol | undefined; if (suggestedNameNotFoundMessage && suggestionCount < maximumSuggestionCount) { - suggestion = getSuggestionForNonexistentSymbol(originalLocation, name, meaning); + suggestion = getSuggestedSymbolForNonexistentSymbol(originalLocation, name, meaning); if (suggestion) { - error(errorLocation, suggestedNameNotFoundMessage, diagnosticName(nameArg!), suggestion); + const suggestionName = symbolToString(suggestion); + const diagnostic = error(errorLocation, suggestedNameNotFoundMessage, diagnosticName(nameArg!), suggestionName); + if (suggestion.valueDeclaration) { + addRelatedInfo( + diagnostic, + createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName) + ); + } } } if (!suggestion) { @@ -1674,7 +1682,7 @@ namespace ts { if (diagnosticMessage) { addRelatedInfo(diagnosticMessage, - createDiagnosticForNode(declaration, Diagnostics._0_was_declared_here, declarationName) + createDiagnosticForNode(declaration, Diagnostics._0_is_declared_here, declarationName) ); } } @@ -1866,9 +1874,15 @@ namespace ts { if (!symbol) { const moduleName = getFullyQualifiedName(moduleSymbol); const declarationName = declarationNameToString(name); - const suggestion = getSuggestionForNonexistentModule(name, targetSymbol); + const suggestion = getSuggestedSymbolForNonexistentModule(name, targetSymbol); if (suggestion !== undefined) { - error(name, Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestion); + const suggestionName = symbolToString(suggestion); + const diagnostic = error(name, Diagnostics.Module_0_has_no_exported_member_1_Did_you_mean_2, moduleName, declarationName, suggestionName); + if (suggestion.valueDeclaration) { + addRelatedInfo(diagnostic, + createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestionName) + ); + } } else { error(name, Diagnostics.Module_0_has_no_exported_member_1, moduleName, declarationName); @@ -2993,7 +3007,8 @@ namespace ts { } function typeToString(type: Type, enclosingDeclaration?: Node, flags: TypeFormatFlags = TypeFormatFlags.AllowUniqueESSymbolType | TypeFormatFlags.UseAliasDefinedOutsideCurrentScope, writer: EmitTextWriter = createTextWriter("")): string { - const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | NodeBuilderFlags.IgnoreErrors, writer); + const noTruncation = compilerOptions.noErrorTruncation || flags & TypeFormatFlags.NoTruncation; + const typeNode = nodeBuilder.typeToTypeNode(type, enclosingDeclaration, toNodeBuilderFlags(flags) | NodeBuilderFlags.IgnoreErrors | (noTruncation ? NodeBuilderFlags.NoTruncation : 0), writer); if (typeNode === undefined) return Debug.fail("should always get typenode"); const options = { removeComments: true }; const printer = createPrinter(options); @@ -3001,7 +3016,7 @@ namespace ts { printer.writeNode(EmitHint.Unspecified, typeNode, /*sourceFile*/ sourceFile, writer); const result = writer.getText(); - const maxLength = compilerOptions.noErrorTruncation || flags & TypeFormatFlags.NoTruncation ? undefined : 100; + const maxLength = noTruncation ? undefined : defaultMaximumTruncationLength * 2; if (maxLength && result && result.length >= maxLength) { return result.substr(0, maxLength - "...".length) + "..."; } @@ -3040,12 +3055,18 @@ namespace ts { tracker: tracker && tracker.trackSymbol ? tracker : { trackSymbol: noop }, encounteredError: false, visitedSymbols: undefined, - inferTypeParameters: undefined + inferTypeParameters: undefined, + approximateLength: 0 }; const resultingNode = cb(context); return context.encounteredError ? undefined : resultingNode; } + function checkTruncationLength(context: NodeBuilderContext): boolean { + if (context.truncating) return context.truncating; + return context.truncating = !(context.flags & NodeBuilderFlags.NoTruncation) && context.approximateLength > defaultMaximumTruncationLength; + } + function typeToTypeNodeHelper(type: Type, context: NodeBuilderContext): TypeNode { if (cancellationToken && cancellationToken.throwIfCancellationRequested) { cancellationToken.throwIfCancellationRequested(); @@ -3059,66 +3080,83 @@ namespace ts { } if (type.flags & TypeFlags.Any) { + context.approximateLength += 3; return createKeywordTypeNode(SyntaxKind.AnyKeyword); } if (type.flags & TypeFlags.Unknown) { return createKeywordTypeNode(SyntaxKind.UnknownKeyword); } if (type.flags & TypeFlags.String) { + context.approximateLength += 6; return createKeywordTypeNode(SyntaxKind.StringKeyword); } if (type.flags & TypeFlags.Number) { + context.approximateLength += 6; return createKeywordTypeNode(SyntaxKind.NumberKeyword); } if (type.flags & TypeFlags.Boolean) { + context.approximateLength += 7; return createKeywordTypeNode(SyntaxKind.BooleanKeyword); } if (type.flags & TypeFlags.EnumLiteral && !(type.flags & TypeFlags.Union)) { const parentSymbol = getParentOfSymbol(type.symbol)!; const parentName = symbolToName(parentSymbol, context, SymbolFlags.Type, /*expectsIdentifier*/ false); const enumLiteralName = getDeclaredTypeOfSymbol(parentSymbol) === type ? parentName : createQualifiedName(parentName, symbolName(type.symbol)); + context.approximateLength += symbolName(type.symbol).length; return createTypeReferenceNode(enumLiteralName, /*typeArguments*/ undefined); } if (type.flags & TypeFlags.EnumLike) { const name = symbolToName(type.symbol, context, SymbolFlags.Type, /*expectsIdentifier*/ false); + context.approximateLength += symbolName(type.symbol).length; return createTypeReferenceNode(name, /*typeArguments*/ undefined); } - if (type.flags & (TypeFlags.StringLiteral)) { + if (type.flags & TypeFlags.StringLiteral) { + context.approximateLength += ((type).value.length + 2); return createLiteralTypeNode(setEmitFlags(createLiteral((type).value), EmitFlags.NoAsciiEscaping)); } - if (type.flags & (TypeFlags.NumberLiteral)) { + if (type.flags & TypeFlags.NumberLiteral) { + context.approximateLength += (("" + (type).value).length); return createLiteralTypeNode((createLiteral((type).value))); } if (type.flags & TypeFlags.BooleanLiteral) { + context.approximateLength += (type).intrinsicName.length; return (type).intrinsicName === "true" ? createTrue() : createFalse(); } if (type.flags & TypeFlags.UniqueESSymbol) { if (!(context.flags & NodeBuilderFlags.AllowUniqueESSymbolType)) { if (isValueSymbolAccessible(type.symbol, context.enclosingDeclaration!)) { + context.approximateLength += 6; return symbolToTypeNode(type.symbol, context, SymbolFlags.Value); } if (context.tracker.reportInaccessibleUniqueSymbolError) { context.tracker.reportInaccessibleUniqueSymbolError(); } } + context.approximateLength += 13; return createTypeOperatorNode(SyntaxKind.UniqueKeyword, createKeywordTypeNode(SyntaxKind.SymbolKeyword)); } if (type.flags & TypeFlags.Void) { + context.approximateLength += 4; return createKeywordTypeNode(SyntaxKind.VoidKeyword); } if (type.flags & TypeFlags.Undefined) { + context.approximateLength += 9; return createKeywordTypeNode(SyntaxKind.UndefinedKeyword); } if (type.flags & TypeFlags.Null) { + context.approximateLength += 4; return createKeywordTypeNode(SyntaxKind.NullKeyword); } if (type.flags & TypeFlags.Never) { + context.approximateLength += 5; return createKeywordTypeNode(SyntaxKind.NeverKeyword); } if (type.flags & TypeFlags.ESSymbol) { + context.approximateLength += 6; return createKeywordTypeNode(SyntaxKind.SymbolKeyword); } if (type.flags & TypeFlags.NonPrimitive) { + context.approximateLength += 6; return createKeywordTypeNode(SyntaxKind.ObjectKeyword); } if (type.flags & TypeFlags.TypeParameter && (type as TypeParameter).isThisType) { @@ -3130,6 +3168,7 @@ namespace ts { context.tracker.reportInaccessibleThisError(); } } + context.approximateLength += 4; return createThis(); } @@ -3141,6 +3180,7 @@ namespace ts { } if (type.flags & TypeFlags.TypeParameter || objectFlags & ObjectFlags.ClassOrInterface) { if (type.flags & TypeFlags.TypeParameter && contains(context.inferTypeParameters, type)) { + context.approximateLength += (symbolName(type.symbol).length + 6); return createInferTypeNode(typeParameterToDeclarationWithConstraint(type as TypeParameter, context, /*constraintNode*/ undefined)); } if (context.flags & NodeBuilderFlags.GenerateNamesForShadowedTypeParams && @@ -3149,7 +3189,9 @@ namespace ts { isTypeParameterDeclaration(type.symbol.declarations[0]) && typeParameterShadowsNameInScope(type, context) && !isTypeSymbolAccessible(type.symbol, context.enclosingDeclaration)) { - return createTypeReferenceNode(getGeneratedNameForNode((type.symbol.declarations[0] as TypeParameterDeclaration).name, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.ReservedInNestedScopes), /*typeArguments*/ undefined); + const name = (type.symbol.declarations[0] as TypeParameterDeclaration).name; + context.approximateLength += idText(name).length; + return createTypeReferenceNode(getGeneratedNameForNode(name, GeneratedIdentifierFlags.Optimistic | GeneratedIdentifierFlags.ReservedInNestedScopes), /*typeArguments*/ undefined); } // Ignore constraint/default when creating a usage (as opposed to declaration) of a type parameter. return type.symbol @@ -3163,7 +3205,7 @@ namespace ts { } if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) { const types = type.flags & TypeFlags.Union ? formatUnionTypes((type).types) : (type).types; - const typeNodes = mapToTypeNodes(types, context); + const typeNodes = mapToTypeNodes(types, context, /*isBareList*/ true); if (typeNodes && typeNodes.length > 0) { const unionOrIntersectionTypeNode = createUnionOrIntersectionTypeNode(type.flags & TypeFlags.Union ? SyntaxKind.UnionType : SyntaxKind.IntersectionType, typeNodes); return unionOrIntersectionTypeNode; @@ -3182,12 +3224,14 @@ namespace ts { } if (type.flags & TypeFlags.Index) { const indexedType = (type).type; + context.approximateLength += 6; const indexTypeNode = typeToTypeNodeHelper(indexedType, context); return createTypeOperatorNode(indexTypeNode); } if (type.flags & TypeFlags.IndexedAccess) { const objectTypeNode = typeToTypeNodeHelper((type).objectType, context); const indexTypeNode = typeToTypeNodeHelper((type).indexType, context); + context.approximateLength += 2; return createIndexedAccessTypeNode(objectTypeNode, indexTypeNode); } if (type.flags & TypeFlags.Conditional) { @@ -3198,6 +3242,7 @@ namespace ts { context.inferTypeParameters = saveInferTypeParameters; const trueTypeNode = typeToTypeNodeHelper(getTrueTypeFromConditionalType(type), context); const falseTypeNode = typeToTypeNodeHelper(getFalseTypeFromConditionalType(type), context); + context.approximateLength += 15; return createConditionalTypeNode(checkTypeNode, extendsTypeNode, trueTypeNode, falseTypeNode); } if (type.flags & TypeFlags.Substitution) { @@ -3222,6 +3267,7 @@ namespace ts { const typeParameterNode = typeParameterToDeclarationWithConstraint(getTypeParameterFromMappedType(type), context, appropriateConstraintTypeNode); const templateTypeNode = typeToTypeNodeHelper(getTemplateTypeFromMappedType(type), context); const mappedTypeNode = createMappedTypeNode(readonlyToken, typeParameterNode, questionToken, templateTypeNode); + context.approximateLength += 10; return setEmitFlags(mappedTypeNode, EmitFlags.SingleLine); } @@ -3250,6 +3296,7 @@ namespace ts { return symbolToTypeNode(typeAlias, context, SymbolFlags.Type); } else { + context.approximateLength += 3; return createKeywordTypeNode(SyntaxKind.AnyKeyword); } } @@ -3294,6 +3341,7 @@ namespace ts { const resolved = resolveStructuredTypeMembers(type); if (!resolved.properties.length && !resolved.stringIndexInfo && !resolved.numberIndexInfo) { if (!resolved.callSignatures.length && !resolved.constructSignatures.length) { + context.approximateLength += 2; return setEmitFlags(createTypeLiteralNode(/*members*/ undefined), EmitFlags.SingleLine); } @@ -3316,6 +3364,7 @@ namespace ts { const members = createTypeNodesFromResolvedType(resolved); context.flags = savedFlags; const typeLiteralNode = createTypeLiteralNode(members); + context.approximateLength += 2; return setEmitFlags(typeLiteralNode, (context.flags & NodeBuilderFlags.MultilineObjectLiterals) ? 0 : EmitFlags.SingleLine); } @@ -3437,6 +3486,9 @@ namespace ts { } function createTypeNodesFromResolvedType(resolvedType: ResolvedType): TypeElement[] | undefined { + if (checkTruncationLength(context)) { + return [createPropertySignature(/*modifiers*/ undefined, "...", /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined)]; + } const typeElements: TypeElement[] = []; for (const signature of resolvedType.callSignatures) { typeElements.push(signatureToSignatureDeclarationHelper(signature, SyntaxKind.CallSignature, context)); @@ -3459,7 +3511,9 @@ namespace ts { return typeElements; } + let i = 0; for (const propertySymbol of properties) { + i++; if (context.flags & NodeBuilderFlags.WriteClassExpressionAsTypeLiteral) { if (propertySymbol.flags & SymbolFlags.Prototype) { continue; @@ -3468,65 +3522,102 @@ namespace ts { context.tracker.reportPrivateInBaseOfClassExpression(unescapeLeadingUnderscores(propertySymbol.escapedName)); } } - const propertyType = getCheckFlags(propertySymbol) & CheckFlags.ReverseMapped && context.flags & NodeBuilderFlags.InReverseMappedType ? - anyType : getTypeOfSymbol(propertySymbol); - const saveEnclosingDeclaration = context.enclosingDeclaration; - context.enclosingDeclaration = undefined; - if (getCheckFlags(propertySymbol) & CheckFlags.Late) { - const decl = first(propertySymbol.declarations); - if (context.tracker.trackSymbol && hasLateBindableName(decl)) { - // get symbol of the first identifier of the entityName - const firstIdentifier = getFirstIdentifier(decl.name.expression); - const name = resolveName(firstIdentifier, firstIdentifier.escapedText, SymbolFlags.Value | SymbolFlags.ExportValue, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); - if (name) { - context.tracker.trackSymbol(name, saveEnclosingDeclaration, SymbolFlags.Value); - } - } + if (checkTruncationLength(context) && (i + 2 < properties.length - 1)) { + typeElements.push(createPropertySignature(/*modifiers*/ undefined, `... ${properties.length - i} more ...`, /*questionToken*/ undefined, /*type*/ undefined, /*initializer*/ undefined)); + addPropertyToElementList(properties[properties.length - 1], context, typeElements); + break; } - const propertyName = symbolToName(propertySymbol, context, SymbolFlags.Value, /*expectsIdentifier*/ true); - context.enclosingDeclaration = saveEnclosingDeclaration; - const optionalToken = propertySymbol.flags & SymbolFlags.Optional ? createToken(SyntaxKind.QuestionToken) : undefined; - if (propertySymbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfObjectType(propertyType).length) { - const signatures = getSignaturesOfType(propertyType, SignatureKind.Call); - for (const signature of signatures) { - const methodDeclaration = signatureToSignatureDeclarationHelper(signature, SyntaxKind.MethodSignature, context); - methodDeclaration.name = propertyName; - methodDeclaration.questionToken = optionalToken; - if (propertySymbol.valueDeclaration) { - // Copy comments to node for declaration emit - setCommentRange(methodDeclaration, propertySymbol.valueDeclaration); - } - typeElements.push(methodDeclaration); - } + addPropertyToElementList(propertySymbol, context, typeElements); + + } + return typeElements.length ? typeElements : undefined; + } + } + + function addPropertyToElementList(propertySymbol: Symbol, context: NodeBuilderContext, typeElements: TypeElement[]) { + const propertyType = getCheckFlags(propertySymbol) & CheckFlags.ReverseMapped && context.flags & NodeBuilderFlags.InReverseMappedType ? + anyType : getTypeOfSymbol(propertySymbol); + const saveEnclosingDeclaration = context.enclosingDeclaration; + context.enclosingDeclaration = undefined; + if (getCheckFlags(propertySymbol) & CheckFlags.Late) { + const decl = first(propertySymbol.declarations); + if (context.tracker.trackSymbol && hasLateBindableName(decl)) { + // get symbol of the first identifier of the entityName + const firstIdentifier = getFirstIdentifier(decl.name.expression); + const name = resolveName(firstIdentifier, firstIdentifier.escapedText, SymbolFlags.Value | SymbolFlags.ExportValue, /*nodeNotFoundErrorMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ true); + if (name) { + context.tracker.trackSymbol(name, saveEnclosingDeclaration, SymbolFlags.Value); } - else { - const savedFlags = context.flags; - context.flags |= !!(getCheckFlags(propertySymbol) & CheckFlags.ReverseMapped) ? NodeBuilderFlags.InReverseMappedType : 0; - const propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : createKeywordTypeNode(SyntaxKind.AnyKeyword); - context.flags = savedFlags; - - const modifiers = isReadonlySymbol(propertySymbol) ? [createToken(SyntaxKind.ReadonlyKeyword)] : undefined; - const propertySignature = createPropertySignature( - modifiers, - propertyName, - optionalToken, - propertyTypeNode, - /*initializer*/ undefined); - if (propertySymbol.valueDeclaration) { - // Copy comments to node for declaration emit - setCommentRange(propertySignature, propertySymbol.valueDeclaration); - } - typeElements.push(propertySignature); + } + } + const propertyName = symbolToName(propertySymbol, context, SymbolFlags.Value, /*expectsIdentifier*/ true); + context.approximateLength += (symbolName(propertySymbol).length + 1); + context.enclosingDeclaration = saveEnclosingDeclaration; + const optionalToken = propertySymbol.flags & SymbolFlags.Optional ? createToken(SyntaxKind.QuestionToken) : undefined; + if (propertySymbol.flags & (SymbolFlags.Function | SymbolFlags.Method) && !getPropertiesOfObjectType(propertyType).length) { + const signatures = getSignaturesOfType(propertyType, SignatureKind.Call); + for (const signature of signatures) { + const methodDeclaration = signatureToSignatureDeclarationHelper(signature, SyntaxKind.MethodSignature, context); + methodDeclaration.name = propertyName; + methodDeclaration.questionToken = optionalToken; + if (propertySymbol.valueDeclaration) { + // Copy comments to node for declaration emit + setCommentRange(methodDeclaration, propertySymbol.valueDeclaration); } + typeElements.push(methodDeclaration); } - return typeElements.length ? typeElements : undefined; + } + else { + const savedFlags = context.flags; + context.flags |= !!(getCheckFlags(propertySymbol) & CheckFlags.ReverseMapped) ? NodeBuilderFlags.InReverseMappedType : 0; + const propertyTypeNode = propertyType ? typeToTypeNodeHelper(propertyType, context) : createKeywordTypeNode(SyntaxKind.AnyKeyword); + context.flags = savedFlags; + + const modifiers = isReadonlySymbol(propertySymbol) ? [createToken(SyntaxKind.ReadonlyKeyword)] : undefined; + if (modifiers) { + context.approximateLength += 9; + } + const propertySignature = createPropertySignature( + modifiers, + propertyName, + optionalToken, + propertyTypeNode, + /*initializer*/ undefined); + if (propertySymbol.valueDeclaration) { + // Copy comments to node for declaration emit + setCommentRange(propertySignature, propertySymbol.valueDeclaration); + } + typeElements.push(propertySignature); } } - function mapToTypeNodes(types: ReadonlyArray | undefined, context: NodeBuilderContext): TypeNode[] | undefined { + function mapToTypeNodes(types: ReadonlyArray | undefined, context: NodeBuilderContext, isBareList?: boolean): TypeNode[] | undefined { if (some(types)) { + if (checkTruncationLength(context)) { + if (!isBareList) { + return [createTypeReferenceNode("...", /*typeArguments*/ undefined)]; + } + else if (types.length > 2) { + return [ + typeToTypeNodeHelper(types[0], context), + createTypeReferenceNode(`... ${types.length - 2} more ...`, /*typeArguments*/ undefined), + typeToTypeNodeHelper(types[types.length - 1], context) + ]; + } + } const result = []; + let i = 0; for (const type of types) { + i++; + if (checkTruncationLength(context) && (i + 2 < types.length - 1)) { + result.push(createTypeReferenceNode(`... ${types.length - i} more ...`, /*typeArguments*/ undefined)); + const typeNode = typeToTypeNodeHelper(types[types.length - 1], context); + if (typeNode) { + result.push(typeNode); + } + break; + } + context.approximateLength += 2; // Account for whitespace + separator const typeNode = typeToTypeNodeHelper(type, context); if (typeNode) { result.push(typeNode); @@ -3553,6 +3644,7 @@ namespace ts { if (!indexInfo.type && !(context.flags & NodeBuilderFlags.AllowEmptyIndexInfoType)) { context.encounteredError = true; } + context.approximateLength += (name.length + 4); return createIndexSignature( /*decorators*/ undefined, indexInfo.isReadonly ? [createToken(SyntaxKind.ReadonlyKeyword)] : undefined, @@ -3597,6 +3689,7 @@ namespace ts { else if (!returnTypeNode) { returnTypeNode = createKeywordTypeNode(SyntaxKind.AnyKeyword); } + context.approximateLength += 3; // Usually a signature contributes a few more characters than this, but 3 is the minimum return createSignatureDeclaration(kind, typeParameters, parameters, returnTypeNode, typeArguments); } @@ -3658,6 +3751,7 @@ namespace ts { questionToken, parameterTypeNode, /*initializer*/ undefined); + context.approximateLength += symbolName(parameterSymbol).length + 3; return parameterNode; function cloneBindingName(node: BindingName): BindingName { @@ -3812,7 +3906,9 @@ namespace ts { // module is root, must use `ImportTypeNode` const nonRootParts = chain.length > 1 ? createAccessFromSymbolChain(chain, chain.length - 1, 1) : undefined; const typeParameterNodes = overrideTypeArguments || lookupTypeParameterNodes(chain, 0, context); - const lit = createLiteralTypeNode(createLiteral(getSpecifierForModuleSymbol(chain[0], context))); + const specifier = getSpecifierForModuleSymbol(chain[0], context); + const lit = createLiteralTypeNode(createLiteral(specifier)); + context.approximateLength += specifier.length + 10; // specifier + import("") if (!nonRootParts || isEntityName(nonRootParts)) { if (nonRootParts) { const lastId = isIdentifier(nonRootParts) ? nonRootParts : nonRootParts.right; @@ -3849,6 +3945,7 @@ namespace ts { context.flags |= NodeBuilderFlags.InInitialEntityName; } const symbolName = getNameOfSymbolAsWritten(symbol, context); + context.approximateLength += symbolName.length + 1; if (index === 0) { context.flags ^= NodeBuilderFlags.InInitialEntityName; } @@ -4033,6 +4130,8 @@ namespace ts { encounteredError: boolean; visitedSymbols: Map | undefined; inferTypeParameters: TypeParameter[] | undefined; + approximateLength: number; + truncating?: boolean; } function isDefaultBindingContext(location: Node) { @@ -5904,6 +6003,12 @@ namespace ts { && isTypeUsableAsLateBoundName(checkComputedPropertyName(node)); } + function isLateBoundName(name: __String): boolean { + return (name as string).charCodeAt(0) === CharacterCodes._ && + (name as string).charCodeAt(1) === CharacterCodes._ && + (name as string).charCodeAt(2) === CharacterCodes.at; + } + /** * Indicates whether a declaration has a late-bindable dynamic name. */ @@ -7010,6 +7115,7 @@ namespace ts { function createUnionOrIntersectionProperty(containingType: UnionOrIntersectionType, name: __String): Symbol | undefined { let props: Symbol[] | undefined; + let indexTypes: Type[] | undefined; const isUnion = containingType.flags & TypeFlags.Union; const excludeModifiers = isUnion ? ModifierFlags.NonPublicAccessibilityModifier : 0; // Flags we want to propagate to the result if they exist in all source symbols @@ -7034,14 +7140,21 @@ namespace ts { } } else if (isUnion) { - checkFlags |= CheckFlags.Partial; + const index = !isLateBoundName(name) && ((isNumericLiteralName(name) && getIndexInfoOfType(type, IndexKind.Number)) || getIndexInfoOfType(type, IndexKind.String)); + if (index) { + checkFlags |= index.isReadonly ? CheckFlags.Readonly : 0; + indexTypes = append(indexTypes, index.type); + } + else { + checkFlags |= CheckFlags.Partial; + } } } } if (!props) { return undefined; } - if (props.length === 1 && !(checkFlags & CheckFlags.Partial)) { + if (props.length === 1 && !(checkFlags & CheckFlags.Partial) && !indexTypes) { return props[0]; } let declarations: Declaration[] | undefined; @@ -7072,6 +7185,7 @@ namespace ts { } propTypes.push(type); } + addRange(propTypes, indexTypes); const result = createSymbol(SymbolFlags.Property | commonFlags, name, syntheticFlag | checkFlags); result.containingType = containingType; if (!hasNonUniformValueDeclaration && commonValueDeclaration) { @@ -8137,7 +8251,7 @@ namespace ts { // The expression is processed as an identifier expression (section 4.3) // or property access expression(section 4.10), // the widened type(section 3.9) of which becomes the result. - links.resolvedType = getWidenedType(checkExpression(node.exprName)); + links.resolvedType = getRegularTypeOfLiteralType(getWidenedType(checkExpression(node.exprName))); } return links.resolvedType; } @@ -10254,9 +10368,9 @@ namespace ts { } } - if (!issuedElaboration && (length(targetProp && targetProp.declarations) || length(target.symbol && target.symbol.declarations))) { + if (!issuedElaboration && (targetProp && length(targetProp.declarations) || target.symbol && length(target.symbol.declarations))) { addRelatedInfo(reportedDiag, createDiagnosticForNode( - targetProp ? targetProp.declarations[0] : target.symbol.declarations[0], + targetProp && length(targetProp.declarations) ? targetProp.declarations[0] : target.symbol.declarations[0], Diagnostics.The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1, propertyName && !(nameType.flags & TypeFlags.UniqueESSymbol) ? unescapeLeadingUnderscores(propertyName) : typeToString(nameType), typeToString(target) @@ -17661,7 +17775,7 @@ namespace ts { if (diagnosticMessage) { addRelatedInfo(diagnosticMessage, - createDiagnosticForNode(valueDeclaration, Diagnostics._0_was_declared_here, declarationName) + createDiagnosticForNode(valueDeclaration, Diagnostics._0_is_declared_here, declarationName) ); } } @@ -17711,6 +17825,7 @@ namespace ts { function reportNonexistentProperty(propNode: Identifier, containingType: Type) { let errorInfo: DiagnosticMessageChain | undefined; + let relatedInfo: Diagnostic | undefined; if (containingType.flags & TypeFlags.Union && !(containingType.flags & TypeFlags.Primitive)) { for (const subtype of (containingType as UnionType).types) { if (!getPropertyOfType(subtype, propNode.escapedText)) { @@ -17724,30 +17839,34 @@ namespace ts { errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await, declarationNameToString(propNode), typeToString(containingType)); } else { - const suggestion = getSuggestionForNonexistentProperty(propNode, containingType); + const suggestion = getSuggestedSymbolForNonexistentProperty(propNode, containingType); if (suggestion !== undefined) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestion); + const suggestedName = symbolName(suggestion); + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestedName); + relatedInfo = suggestion.valueDeclaration && createDiagnosticForNode(suggestion.valueDeclaration, Diagnostics._0_is_declared_here, suggestedName); } else { - const suggestion = getSuggestionForNonexistentProperty(propNode, containingType); - if (suggestion !== undefined) { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1_Did_you_mean_2, declarationNameToString(propNode), typeToString(containingType), suggestion); - } - else { - errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); - } + errorInfo = chainDiagnosticMessages(errorInfo, Diagnostics.Property_0_does_not_exist_on_type_1, declarationNameToString(propNode), typeToString(containingType)); } } - diagnostics.add(createDiagnosticForNodeFromMessageChain(propNode, errorInfo)); + const resultDiagnostic = createDiagnosticForNodeFromMessageChain(propNode, errorInfo); + if (relatedInfo) { + addRelatedInfo(resultDiagnostic, relatedInfo); + } + diagnostics.add(resultDiagnostic); + } + + function getSuggestedSymbolForNonexistentProperty(name: Identifier | string, containingType: Type): Symbol | undefined { + return getSpellingSuggestionForName(isString(name) ? name : idText(name), getPropertiesOfType(containingType), SymbolFlags.Value); } function getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined { - const suggestion = getSpellingSuggestionForName(isString(name) ? name : idText(name), getPropertiesOfType(containingType), SymbolFlags.Value); + const suggestion = getSuggestedSymbolForNonexistentProperty(name, containingType); return suggestion && symbolName(suggestion); } - function getSuggestionForNonexistentSymbol(location: Node | undefined, outerName: __String, meaning: SymbolFlags): string | undefined { + function getSuggestedSymbolForNonexistentSymbol(location: Node | undefined, outerName: __String, meaning: SymbolFlags): Symbol | undefined { Debug.assert(outerName !== undefined, "outername should always be defined"); const result = resolveNameHelper(location, outerName, meaning, /*nameNotFoundMessage*/ undefined, outerName, /*isUse*/ false, /*excludeGlobals*/ false, (symbols, name, meaning) => { Debug.assertEqual(outerName, name, "name should equal outerName"); @@ -17757,11 +17876,20 @@ namespace ts { // However, resolveNameHelper will continue and call this callback again, so we'll eventually get a correct suggestion. return symbol || getSpellingSuggestionForName(unescapeLeadingUnderscores(name), arrayFrom(symbols.values()), meaning); }); - return result && symbolName(result); + return result; + } + + function getSuggestionForNonexistentSymbol(location: Node | undefined, outerName: __String, meaning: SymbolFlags): string | undefined { + const symbolResult = getSuggestedSymbolForNonexistentSymbol(location, outerName, meaning); + return symbolResult && symbolName(symbolResult); } - function getSuggestionForNonexistentModule(name: Identifier, targetModule: Symbol): string | undefined { - const suggestion = targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember); + function getSuggestedSymbolForNonexistentModule(name: Identifier, targetModule: Symbol): Symbol | undefined { + return targetModule.exports && getSpellingSuggestionForName(idText(name), getExportsOfModuleAsArray(targetModule), SymbolFlags.ModuleMember); + } + + function getSuggestionForNonexistentExport(name: Identifier, targetModule: Symbol): string | undefined { + const suggestion = getSuggestedSymbolForNonexistentModule(name, targetModule); return suggestion && symbolName(suggestion); } @@ -19218,6 +19346,38 @@ namespace ts { return resolveErrorCall(node); } + function typeHasProtectedAccessibleBase(target: Symbol, type: InterfaceType): boolean { + const baseTypes = getBaseTypes(type); + if (!length(baseTypes)) { + return false; + } + const firstBase = baseTypes[0]; + if (firstBase.flags & TypeFlags.Intersection) { + const types = (firstBase as IntersectionType).types; + const mixinCount = countWhere(types, isMixinConstructorType); + let i = 0; + for (const intersectionMember of (firstBase as IntersectionType).types) { + i++; + // We want to ignore mixin ctors + if (mixinCount === 0 || mixinCount === types.length && i === 0 || !isMixinConstructorType(intersectionMember)) { + if (getObjectFlags(intersectionMember) & (ObjectFlags.Class | ObjectFlags.Interface)) { + if (intersectionMember.symbol === target) { + return true; + } + if (typeHasProtectedAccessibleBase(target, intersectionMember as InterfaceType)) { + return true; + } + } + } + } + return false; + } + if (firstBase.symbol === target) { + return true; + } + return typeHasProtectedAccessibleBase(target, firstBase as InterfaceType); + } + function isConstructorAccessible(node: NewExpression, signature: Signature) { if (!signature || !signature.declaration) { return true; @@ -19237,16 +19397,10 @@ namespace ts { // A private or protected constructor can only be instantiated within its own class (or a subclass, for protected) if (!isNodeWithinClass(node, declaringClassDeclaration)) { const containingClass = getContainingClass(node); - if (containingClass) { + if (containingClass && modifiers & ModifierFlags.Protected) { const containingType = getTypeOfNode(containingClass); - let baseTypes = getBaseTypes(containingType as InterfaceType); - while (baseTypes.length) { - const baseType = baseTypes[0]; - if (modifiers & ModifierFlags.Protected && - baseType.symbol === declaration.parent.symbol) { - return true; - } - baseTypes = getBaseTypes(baseType as InterfaceType); + if (typeHasProtectedAccessibleBase(declaration.parent.symbol, containingType as InterfaceType)) { + return true; } } if (modifiers & ModifierFlags.Private) { @@ -20975,7 +21129,7 @@ namespace ts { getUnionType([removeDefinitelyFalsyTypes(leftType), rightType], UnionReduction.Subtype) : leftType; case SyntaxKind.EqualsToken: - const special = getSpecialPropertyAssignmentKind(left.parent as BinaryExpression); + const special = isBinaryExpression(left.parent) ? getSpecialPropertyAssignmentKind(left.parent) : SpecialPropertyAssignmentKind.None; checkSpecialAssignment(special, right); if (isJSSpecialPropertyAssignment(special)) { return leftType; diff --git a/src/compiler/diagnosticMessages.json b/src/compiler/diagnosticMessages.json index 87d8297e74d5b..68eafc6b99814 100644 --- a/src/compiler/diagnosticMessages.json +++ b/src/compiler/diagnosticMessages.json @@ -2401,8 +2401,8 @@ "category": "Error", "code": 2727 }, - "'{0}' was declared here.": { - "category": "Error", + "'{0}' is declared here.": { + "category": "Message", "code": 2728 }, "Property '{0}' is used before its initialization.": { @@ -2864,6 +2864,10 @@ "category": "Error", "code": 5070 }, + "Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'.": { + "category": "Error", + "code": 5071 + }, "Generates a sourcemap for each corresponding '.d.ts' file.": { "category": "Message", @@ -3886,7 +3890,7 @@ "code": 7037 }, "Type originates at this import. A namespace-style import cannot be called or constructed, and will cause a failure at runtime. Consider using a default import or import require here instead.": { - "category": "Error", + "category": "Message", "code": 7038 }, "Mapped object type implicitly has an 'any' template type.": { diff --git a/src/compiler/emitter.ts b/src/compiler/emitter.ts index 62d10dedfba9b..e0bc826f66ce5 100644 --- a/src/compiler/emitter.ts +++ b/src/compiler/emitter.ts @@ -43,7 +43,7 @@ namespace ts { if (sourceFile.kind === SyntaxKind.Bundle) { const jsFilePath = options.outFile || options.out!; const sourceMapFilePath = getSourceMapFilePath(jsFilePath, options); - const declarationFilePath = (forceDtsPaths || options.declaration) ? removeFileExtension(jsFilePath) + Extension.Dts : undefined; + const declarationFilePath = (forceDtsPaths || getEmitDeclarations(options)) ? removeFileExtension(jsFilePath) + Extension.Dts : undefined; const declarationMapPath = getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; const bundleInfoPath = options.references && jsFilePath ? (removeFileExtension(jsFilePath) + infoExtension) : undefined; return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, bundleInfoPath }; @@ -53,7 +53,7 @@ namespace ts { const sourceMapFilePath = isJsonSourceFile(sourceFile) ? undefined : getSourceMapFilePath(jsFilePath, options); // For legacy reasons (ie, we have baselines capturing the behavior), js files don't report a .d.ts output path - this would only matter if `declaration` and `allowJs` were both on, which is currently an error const isJs = isSourceFileJavaScript(sourceFile); - const declarationFilePath = ((forceDtsPaths || options.declaration) && !isJs) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; + const declarationFilePath = ((forceDtsPaths || getEmitDeclarations(options)) && !isJs) ? getDeclarationEmitOutputFilePath(sourceFile, host) : undefined; const declarationMapPath = getAreDeclarationMapsEnabled(options) ? declarationFilePath + ".map" : undefined; return { jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath, bundleInfoPath: undefined }; } @@ -192,7 +192,7 @@ namespace ts { // Setup and perform the transformation to retrieve declarations from the input files const nonJsFiles = filter(sourceFiles, isSourceFileNotJavaScript); const inputListOrBundle = (compilerOptions.outFile || compilerOptions.out) ? [createBundle(nonJsFiles, !isSourceFile(sourceFileOrBundle) ? sourceFileOrBundle.prepends : undefined)] : nonJsFiles; - if (emitOnlyDtsFiles && !compilerOptions.declaration) { + if (emitOnlyDtsFiles && !getEmitDeclarations(compilerOptions)) { // Checker wont collect the linked aliases since thats only done when declaration is enabled. // Do that here when emitting only dts files nonJsFiles.forEach(collectLinkedAliases); diff --git a/src/compiler/factory.ts b/src/compiler/factory.ts index c215daf7935a6..7c8ec909eb57f 100644 --- a/src/compiler/factory.ts +++ b/src/compiler/factory.ts @@ -4183,11 +4183,15 @@ namespace ts { */ export function parenthesizeDefaultExpression(e: Expression) { const check = skipPartiallyEmittedExpressions(e); - return check.kind === SyntaxKind.ClassExpression || - check.kind === SyntaxKind.FunctionExpression || - isCommaSequence(check) - ? createParen(e) - : e; + let needsParens = isCommaSequence(check); + if (!needsParens) { + switch (getLeftmostExpression(check, /*stopAtCallExpression*/ false).kind) { + case SyntaxKind.ClassExpression: + case SyntaxKind.FunctionExpression: + needsParens = true; + } + } + return needsParens ? createParen(e) : e; } /** diff --git a/src/compiler/program.ts b/src/compiler/program.ts index 75cdcaea32885..a1a06eaa1eaca 100644 --- a/src/compiler/program.ts +++ b/src/compiler/program.ts @@ -2329,7 +2329,7 @@ namespace ts { if (!sourceFile.isDeclarationFile) { const absoluteSourceFilePath = host.getCanonicalFileName(getNormalizedAbsolutePath(sourceFile.fileName, currentDirectory)); if (absoluteSourceFilePath.indexOf(absoluteRootDirectoryPath) !== 0) { - programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, options.rootDir)); + programDiagnostics.add(createCompilerDiagnostic(Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files, sourceFile.fileName, rootDirectory)); allFilesBelongToPath = false; } } @@ -2500,7 +2500,7 @@ namespace ts { } } - if (options.declarationMap && !options.declaration) { + if (options.declarationMap && !getEmitDeclarations(options)) { createDiagnosticForOptionName(Diagnostics.Option_0_cannot_be_specified_without_specifying_option_1, "declarationMap", "declaration"); } @@ -2548,6 +2548,10 @@ namespace ts { if (getEmitModuleResolutionKind(options) !== ModuleResolutionKind.NodeJs) { createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy, "resolveJsonModule"); } + // Any emit other than common js is error + else if (getEmitModuleKind(options) !== ModuleKind.CommonJS) { + createDiagnosticForOptionName(Diagnostics.Option_resolveJsonModule_can_only_be_specified_when_module_code_generation_is_commonjs, "resolveJsonModule", "module"); + } } // there has to be common source directory if user specified --outdir || --sourceRoot diff --git a/src/compiler/resolutionCache.ts b/src/compiler/resolutionCache.ts index d5f574762a1c8..d05d83505089a 100644 --- a/src/compiler/resolutionCache.ts +++ b/src/compiler/resolutionCache.ts @@ -81,6 +81,7 @@ namespace ts { let filesWithInvalidatedResolutions: Map | undefined; let filesWithInvalidatedNonRelativeUnresolvedImports: Map> | undefined; let allFilesHaveInvalidatedResolution = false; + const nonRelativeExternalModuleResolutions = createMultiMap(); const getCurrentDirectory = memoize(() => resolutionHost.getCurrentDirectory!()); // TODO: GH#18217 const cachedDirectoryStructureHost = resolutionHost.getCachedDirectoryStructureHost(); @@ -154,6 +155,7 @@ namespace ts { function clear() { clearMap(directoryWatchesOfFailedLookups, closeFileWatcherOf); customFailedLookupPaths.clear(); + nonRelativeExternalModuleResolutions.clear(); closeTypeRootsWatch(); resolvedModuleNames.clear(); resolvedTypeReferenceDirectives.clear(); @@ -199,19 +201,20 @@ namespace ts { perDirectoryResolvedModuleNames.clear(); nonRelaticeModuleNameCache.clear(); perDirectoryResolvedTypeReferenceDirectives.clear(); + nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions); + nonRelativeExternalModuleResolutions.clear(); } function finishCachingPerDirectoryResolution() { allFilesHaveInvalidatedResolution = false; filesWithInvalidatedNonRelativeUnresolvedImports = undefined; + clearPerDirectoryResolutions(); directoryWatchesOfFailedLookups.forEach((watcher, path) => { if (watcher.refCount === 0) { directoryWatchesOfFailedLookups.delete(path); watcher.watcher.close(); } }); - - clearPerDirectoryResolutions(); } function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost): CachedResolvedModuleWithFailedLookupLocations { @@ -275,7 +278,7 @@ namespace ts { perDirectoryResolution.set(name, resolution); } resolutionsInFile.set(name, resolution); - watchFailedLookupLocationOfResolution(resolution); + watchFailedLookupLocationsOfExternalModuleResolutions(name, resolution); if (existingResolution) { stopWatchFailedLookupLocationOfResolution(existingResolution); } @@ -441,18 +444,27 @@ namespace ts { return fileExtensionIsOneOf(path, failedLookupDefaultExtensions); } - function watchFailedLookupLocationOfResolution(resolution: ResolutionWithFailedLookupLocations) { + function watchFailedLookupLocationsOfExternalModuleResolutions(name: string, resolution: ResolutionWithFailedLookupLocations) { // No need to set the resolution refCount - if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { - return; + if (resolution.failedLookupLocations && resolution.failedLookupLocations.length) { + if (resolution.refCount) { + resolution.refCount++; + } + else { + resolution.refCount = 1; + if (isExternalModuleNameRelative(name)) { + watchFailedLookupLocationOfResolution(resolution); + } + else { + nonRelativeExternalModuleResolutions.add(name, resolution); + } + } } + } - if (resolution.refCount !== undefined) { - resolution.refCount++; - return; - } + function watchFailedLookupLocationOfResolution(resolution: ResolutionWithFailedLookupLocations) { + Debug.assert(!!resolution.refCount); - resolution.refCount = 1; const { failedLookupLocations } = resolution; let setAtRoot = false; for (const failedLookupLocation of failedLookupLocations) { @@ -480,6 +492,16 @@ namespace ts { } } + function setRefCountToUndefined(resolution: ResolutionWithFailedLookupLocations) { + resolution.refCount = undefined; + } + + function watchFailedLookupLocationOfNonRelativeModuleResolutions(resolutions: ResolutionWithFailedLookupLocations[], name: string) { + const updateResolution = resolutionHost.getCurrentProgram().getTypeChecker().tryFindAmbientModuleWithoutAugmentations(name) ? + setRefCountToUndefined : watchFailedLookupLocationOfResolution; + resolutions.forEach(updateResolution); + } + function setDirectoryWatcher(dir: string, dirPath: Path, nonRecursive?: boolean) { const dirWatcher = directoryWatchesOfFailedLookups.get(dirPath); if (dirWatcher) { @@ -492,11 +514,11 @@ namespace ts { } function stopWatchFailedLookupLocationOfResolution(resolution: ResolutionWithFailedLookupLocations) { - if (!resolution.failedLookupLocations || !resolution.failedLookupLocations.length) { + if (!resolution.refCount) { return; } - resolution.refCount!--; + resolution.refCount--; if (resolution.refCount) { return; } diff --git a/src/compiler/sys.ts b/src/compiler/sys.ts index e9f15b6fa84ca..0fa06d9d2670f 100644 --- a/src/compiler/sys.ts +++ b/src/compiler/sys.ts @@ -332,9 +332,9 @@ namespace ts { /*@internal*/ export interface RecursiveDirectoryWatcherHost { watchDirectory: HostWatchDirectory; + useCaseSensitiveFileNames: boolean; getAccessibleSortedChildDirectories(path: string): ReadonlyArray; directoryExists(dir: string): boolean; - filePathComparer: Comparer; realpath(s: string): string; } @@ -345,60 +345,94 @@ namespace ts { */ /*@internal*/ export function createRecursiveDirectoryWatcher(host: RecursiveDirectoryWatcherHost): (directoryName: string, callback: DirectoryWatcherCallback) => FileWatcher { - type ChildWatches = ReadonlyArray; - interface DirectoryWatcher extends FileWatcher { - childWatches: ChildWatches; + interface ChildDirectoryWatcher extends FileWatcher { dirName: string; } + type ChildWatches = ReadonlyArray; + interface HostDirectoryWatcher { + watcher: FileWatcher; + childWatches: ChildWatches; + refCount: number; + } + + const cache = createMap(); + const callbackCache = createMultiMap(); + const filePathComparer = getStringComparer(!host.useCaseSensitiveFileNames); + const toCanonicalFilePath = createGetCanonicalFileName(host.useCaseSensitiveFileNames); return createDirectoryWatcher; /** * Create the directory watcher for the dirPath. */ - function createDirectoryWatcher(dirName: string, callback: DirectoryWatcherCallback): DirectoryWatcher { - const watcher = host.watchDirectory(dirName, fileName => { - // Call the actual callback - callback(fileName); + function createDirectoryWatcher(dirName: string, callback?: DirectoryWatcherCallback): ChildDirectoryWatcher { + const dirPath = toCanonicalFilePath(dirName) as Path; + let directoryWatcher = cache.get(dirPath); + if (directoryWatcher) { + directoryWatcher.refCount++; + } + else { + directoryWatcher = { + watcher: host.watchDirectory(dirName, fileName => { + // Call the actual callback + callbackCache.forEach((callbacks, rootDirName) => { + if (rootDirName === dirPath || (startsWith(dirPath, rootDirName) && dirPath[rootDirName.length] === directorySeparator)) { + callbacks.forEach(callback => callback(fileName)); + } + }); - // Iterate through existing children and update the watches if needed - updateChildWatches(result, callback); - }); + // Iterate through existing children and update the watches if needed + updateChildWatches(dirName, dirPath); + }), + refCount: 1, + childWatches: emptyArray + }; + cache.set(dirPath, directoryWatcher); + updateChildWatches(dirName, dirPath); + } - let result: DirectoryWatcher = { - close: () => { - watcher.close(); - result.childWatches.forEach(closeFileWatcher); - result = undefined!; - }, + if (callback) { + callbackCache.add(dirPath, callback); + } + + return { dirName, - childWatches: emptyArray + close: () => { + const directoryWatcher = Debug.assertDefined(cache.get(dirPath)); + if (callback) callbackCache.remove(dirPath, callback); + directoryWatcher.refCount--; + + if (directoryWatcher.refCount) return; + + cache.delete(dirPath); + closeFileWatcherOf(directoryWatcher); + directoryWatcher.childWatches.forEach(closeFileWatcher); + } }; - updateChildWatches(result, callback); - return result; } - function updateChildWatches(watcher: DirectoryWatcher, callback: DirectoryWatcherCallback) { + function updateChildWatches(dirName: string, dirPath: Path) { // Iterate through existing children and update the watches if needed - if (watcher) { - watcher.childWatches = watchChildDirectories(watcher.dirName, watcher.childWatches, callback); + const parentWatcher = cache.get(dirPath); + if (parentWatcher) { + parentWatcher.childWatches = watchChildDirectories(dirName, parentWatcher.childWatches); } } /** * Watch the directories in the parentDir */ - function watchChildDirectories(parentDir: string, existingChildWatches: ChildWatches, callback: DirectoryWatcherCallback): ChildWatches { - let newChildWatches: DirectoryWatcher[] | undefined; - enumerateInsertsAndDeletes( + function watchChildDirectories(parentDir: string, existingChildWatches: ChildWatches): ChildWatches { + let newChildWatches: ChildDirectoryWatcher[] | undefined; + enumerateInsertsAndDeletes( host.directoryExists(parentDir) ? mapDefined(host.getAccessibleSortedChildDirectories(parentDir), child => { const childFullName = getNormalizedAbsolutePath(child, parentDir); // Filter our the symbolic link directories since those arent included in recursive watch // which is same behaviour when recursive: true is passed to fs.watch - return host.filePathComparer(childFullName, host.realpath(childFullName)) === Comparison.EqualTo ? childFullName : undefined; + return filePathComparer(childFullName, normalizePath(host.realpath(childFullName))) === Comparison.EqualTo ? childFullName : undefined; }) : emptyArray, existingChildWatches, - (child, childWatcher) => host.filePathComparer(child, childWatcher.dirName), + (child, childWatcher) => filePathComparer(child, childWatcher.dirName), createAndAddChildDirectoryWatcher, closeFileWatcher, addChildDirectoryWatcher @@ -410,14 +444,14 @@ namespace ts { * Create new childDirectoryWatcher and add it to the new ChildDirectoryWatcher list */ function createAndAddChildDirectoryWatcher(childName: string) { - const result = createDirectoryWatcher(childName, callback); + const result = createDirectoryWatcher(childName); addChildDirectoryWatcher(result); } /** * Add child directory watcher to the new ChildDirectoryWatcher list */ - function addChildDirectoryWatcher(childWatcher: DirectoryWatcher) { + function addChildDirectoryWatcher(childWatcher: ChildDirectoryWatcher) { (newChildWatches || (newChildWatches = [])).push(childWatcher); } } @@ -710,7 +744,7 @@ namespace ts { createWatchDirectoryUsing(dynamicPollingWatchFile || createDynamicPriorityPollingWatchFile({ getModifiedTime, setTimeout })) : watchDirectoryUsingFsWatch; const watchDirectoryRecursively = createRecursiveDirectoryWatcher({ - filePathComparer: getStringComparer(!useCaseSensitiveFileNames), + useCaseSensitiveFileNames, directoryExists, getAccessibleSortedChildDirectories: path => getAccessibleFileSystemEntries(path).directories, watchDirectory, diff --git a/src/compiler/transformers/declarations.ts b/src/compiler/transformers/declarations.ts index 055fc3d2e0f5c..dcfc50dd007de 100644 --- a/src/compiler/transformers/declarations.ts +++ b/src/compiler/transformers/declarations.ts @@ -11,11 +11,12 @@ namespace ts { const declarationEmitNodeBuilderFlags = NodeBuilderFlags.MultilineObjectLiterals | - TypeFormatFlags.WriteClassExpressionAsTypeLiteral | + NodeBuilderFlags.WriteClassExpressionAsTypeLiteral | NodeBuilderFlags.UseTypeOfFunction | NodeBuilderFlags.UseStructuralFallback | NodeBuilderFlags.AllowEmptyTuple | - NodeBuilderFlags.GenerateNamesForShadowedTypeParams; + NodeBuilderFlags.GenerateNamesForShadowedTypeParams | + NodeBuilderFlags.NoTruncation; /** * Transforms a ts file into a .d.ts file diff --git a/src/compiler/transformers/ts.ts b/src/compiler/transformers/ts.ts index 4a696c6d130bf..2bebe6c7101ec 100644 --- a/src/compiler/transformers/ts.ts +++ b/src/compiler/transformers/ts.ts @@ -1982,18 +1982,16 @@ namespace ts { const kind = resolver.getTypeReferenceSerializationKind(node.typeName, currentNameScope || currentLexicalScope); switch (kind) { case TypeReferenceSerializationKind.Unknown: - const serialized = serializeEntityNameAsExpression(node.typeName, /*useFallback*/ true); + const serialized = serializeEntityNameAsExpressionFallback(node.typeName); const temp = createTempVariable(hoistVariableDeclaration); - return createLogicalOr( - createLogicalAnd( - createTypeCheck(createAssignment(temp, serialized), "function"), - temp - ), + return createConditional( + createTypeCheck(createAssignment(temp, serialized), "function"), + temp, createIdentifier("Object") ); case TypeReferenceSerializationKind.TypeWithConstructSignatureAndValue: - return serializeEntityNameAsExpression(node.typeName, /*useFallback*/ false); + return serializeEntityNameAsExpression(node.typeName); case TypeReferenceSerializationKind.VoidNullableOrNeverType: return createVoidZero(); @@ -2028,14 +2026,46 @@ namespace ts { } } + function createCheckedValue(left: Expression, right: Expression) { + return createLogicalAnd( + createStrictInequality(createTypeOf(left), createLiteral("undefined")), + right + ); + } + + /** + * Serializes an entity name which may not exist at runtime, but whose access shouldn't throw + * + * @param node The entity name to serialize. + */ + function serializeEntityNameAsExpressionFallback(node: EntityName): BinaryExpression { + if (node.kind === SyntaxKind.Identifier) { + // A -> typeof A !== undefined && A + const copied = serializeEntityNameAsExpression(node); + return createCheckedValue(copied, copied); + } + if (node.left.kind === SyntaxKind.Identifier) { + // A.B -> typeof A !== undefined && A.B + return createCheckedValue(serializeEntityNameAsExpression(node.left), serializeEntityNameAsExpression(node)); + } + // A.B.C -> typeof A !== undefined && (_a = A.B) !== void 0 && _a.C + const left = serializeEntityNameAsExpressionFallback(node.left); + const temp = createTempVariable(hoistVariableDeclaration); + return createLogicalAnd( + createLogicalAnd( + left.left, + createStrictInequality(createAssignment(temp, left.right), createVoidZero()) + ), + createPropertyAccess(temp, node.right) + ); + } + /** * Serializes an entity name as an expression for decorator type metadata. * * @param node The entity name to serialize. - * @param useFallback A value indicating whether to use logical operators to test for the - * entity name at runtime. */ - function serializeEntityNameAsExpression(node: EntityName, useFallback: boolean): SerializedEntityNameAsExpression { + function serializeEntityNameAsExpression(node: EntityName): SerializedEntityNameAsExpression { switch (node.kind) { case SyntaxKind.Identifier: // Create a clone of the name with a new parent, and treat it as if it were @@ -2044,20 +2074,11 @@ namespace ts { name.flags &= ~NodeFlags.Synthesized; name.original = undefined; name.parent = getParseTreeNode(currentLexicalScope); // ensure the parent is set to a parse tree node. - if (useFallback) { - return createLogicalAnd( - createStrictInequality( - createTypeOf(name), - createLiteral("undefined") - ), - name - ); - } return name; case SyntaxKind.QualifiedName: - return serializeQualifiedNameAsExpression(node, useFallback); + return serializeQualifiedNameAsExpression(node); } } @@ -2068,26 +2089,8 @@ namespace ts { * @param useFallback A value indicating whether to use logical operators to test for the * qualified name at runtime. */ - function serializeQualifiedNameAsExpression(node: QualifiedName, useFallback: boolean): PropertyAccessExpression { - let left: SerializedEntityNameAsExpression; - if (node.left.kind === SyntaxKind.Identifier) { - left = serializeEntityNameAsExpression(node.left, useFallback); - } - else if (useFallback) { - const temp = createTempVariable(hoistVariableDeclaration); - left = createLogicalAnd( - createAssignment( - temp, - serializeEntityNameAsExpression(node.left, /*useFallback*/ true) - ), - temp - ); - } - else { - left = serializeEntityNameAsExpression(node.left, /*useFallback*/ false); - } - - return createPropertyAccess(left, node.right); + function serializeQualifiedNameAsExpression(node: QualifiedName): SerializedEntityNameAsExpression { + return createPropertyAccess(serializeEntityNameAsExpression(node.left), node.right); } /** diff --git a/src/compiler/tsbuild.ts b/src/compiler/tsbuild.ts index 751f5221167c4..695b9f8622f7d 100644 --- a/src/compiler/tsbuild.ts +++ b/src/compiler/tsbuild.ts @@ -304,7 +304,7 @@ namespace ts { const outputs: string[] = []; outputs.push(getOutputJavaScriptFileName(inputFileName, configFile)); - if (configFile.options.declaration && !fileExtensionIs(inputFileName, Extension.Json)) { + if (getEmitDeclarations(configFile.options) && !fileExtensionIs(inputFileName, Extension.Json)) { const dts = getOutputDeclarationFileName(inputFileName, configFile); outputs.push(dts); if (configFile.options.declarationMap) { @@ -320,7 +320,7 @@ namespace ts { } const outputs: string[] = []; outputs.push(project.options.outFile); - if (project.options.declaration) { + if (getEmitDeclarations(project.options)) { const dts = changeExtension(project.options.outFile, Extension.Dts); outputs.push(dts); if (project.options.declarationMap) { @@ -769,7 +769,10 @@ namespace ts { const program = createProgram(programOptions); // Don't emit anything in the presence of syntactic errors or options diagnostics - const syntaxDiagnostics = [...program.getOptionsDiagnostics(), ...program.getSyntacticDiagnostics()]; + const syntaxDiagnostics = [ + ...program.getOptionsDiagnostics(), + ...program.getConfigFileParsingDiagnostics(), + ...program.getSyntacticDiagnostics()]; if (syntaxDiagnostics.length) { resultFlags |= BuildResultFlags.SyntaxErrors; for (const diag of syntaxDiagnostics) { @@ -780,7 +783,7 @@ namespace ts { } // Don't emit .d.ts if there are decl file errors - if (program.getCompilerOptions().declaration) { + if (getEmitDeclarations(program.getCompilerOptions())) { const declDiagnostics = program.getDeclarationDiagnostics(); if (declDiagnostics.length) { resultFlags |= BuildResultFlags.DeclarationEmitErrors; diff --git a/src/compiler/types.ts b/src/compiler/types.ts index d096cba6c5589..e1f347282b92b 100644 --- a/src/compiler/types.ts +++ b/src/compiler/types.ts @@ -2994,9 +2994,9 @@ namespace ts { */ /* @internal */ tryGetMemberInModuleExportsAndProperties(memberName: string, moduleSymbol: Symbol): Symbol | undefined; getApparentType(type: Type): Type; - getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined; - getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; - getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined; + /* @internal */ getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined; + /* @internal */ getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; + /* @internal */ getSuggestionForNonexistentExport(node: Identifier, target: Symbol): string | undefined; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; diff --git a/src/compiler/utilities.ts b/src/compiler/utilities.ts index c5fa7d155d519..7034c284c727b 100644 --- a/src/compiler/utilities.ts +++ b/src/compiler/utilities.ts @@ -21,6 +21,8 @@ namespace ts { export const externalHelpersModuleNameText = "tslib"; + export const defaultMaximumTruncationLength = 160; + export function getDeclarationOfKind(symbol: Symbol, kind: T["kind"]): T | undefined { const declarations = symbol.declarations; if (declarations) { @@ -3351,21 +3353,6 @@ namespace ts { return node.type || (isInJavaScriptFile(node) ? getJSDocReturnType(node) : undefined); } - /** - * Gets the effective type parameters. If the node was parsed in a - * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. - */ - export function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray { - if (isJSDocSignature(node)) { - return emptyArray; - } - if (isJSDocTypeAlias(node)) { - Debug.assert(node.parent.kind === SyntaxKind.JSDocComment); - return flatMap(node.parent.tags, tag => isJSDocTemplateTag(tag) ? tag.typeParameters : undefined) as ReadonlyArray; - } - return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : emptyArray); - } - export function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray { return flatMap(getJSDocTags(node), tag => isNonTypeAliasTemplate(tag) ? tag.typeParameters : undefined); } @@ -5022,14 +5009,27 @@ namespace ts { } /** - * Gets the return type node for the node if provided via JSDoc's return tag. + * Gets the return type node for the node if provided via JSDoc return tag or type tag. * * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function - * gets the type from inside the braces. + * gets the type from inside the braces, after the fat arrow, etc. */ export function getJSDocReturnType(node: Node): TypeNode | undefined { const returnTag = getJSDocReturnTag(node); - return returnTag && returnTag.typeExpression && returnTag.typeExpression.type; + if (returnTag && returnTag.typeExpression) { + return returnTag.typeExpression.type; + } + const typeTag = getJSDocTypeTag(node); + if (typeTag && typeTag.typeExpression) { + const type = typeTag.typeExpression.type; + if (isTypeLiteralNode(type)) { + const sig = find(type.members, isCallSignatureDeclaration); + return sig && sig.type; + } + if (isFunctionTypeNode(type)) { + return type.type; + } + } } /** Get all JSDoc tags related to a node, including those on parent nodes. */ @@ -5053,6 +5053,21 @@ namespace ts { export function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray { return getJSDocTags(node).filter(doc => doc.kind === kind); } + + /** + * Gets the effective type parameters. If the node was parsed in a + * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. + */ + export function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray { + if (isJSDocSignature(node)) { + return emptyArray; + } + if (isJSDocTypeAlias(node)) { + Debug.assert(node.parent.kind === SyntaxKind.JSDocComment); + return flatMap(node.parent.tags, tag => isJSDocTemplateTag(tag) ? tag.typeParameters : undefined) as ReadonlyArray; + } + return node.typeParameters || (isInJavaScriptFile(node) ? getJSDocTypeParameterDeclarations(node) : emptyArray); + } } // Simple node tests of the form `node.kind === SyntaxKind.Foo`. @@ -6572,45 +6587,6 @@ namespace ts { return !!(node as HasType).type; } - /* True if the node could have a type node a `.type` */ - /* @internal */ - export function couldHaveType(node: Node): node is HasType { - switch (node.kind) { - case SyntaxKind.Parameter: - case SyntaxKind.PropertySignature: - case SyntaxKind.PropertyDeclaration: - case SyntaxKind.MethodSignature: - case SyntaxKind.MethodDeclaration: - case SyntaxKind.Constructor: - case SyntaxKind.GetAccessor: - case SyntaxKind.SetAccessor: - case SyntaxKind.CallSignature: - case SyntaxKind.ConstructSignature: - case SyntaxKind.IndexSignature: - case SyntaxKind.TypePredicate: - case SyntaxKind.FunctionType: - case SyntaxKind.ConstructorType: - case SyntaxKind.ParenthesizedType: - case SyntaxKind.TypeOperator: - case SyntaxKind.MappedType: - case SyntaxKind.TypeAssertionExpression: - case SyntaxKind.FunctionExpression: - case SyntaxKind.ArrowFunction: - case SyntaxKind.AsExpression: - case SyntaxKind.VariableDeclaration: - case SyntaxKind.FunctionDeclaration: - case SyntaxKind.TypeAliasDeclaration: - case SyntaxKind.JSDocTypeExpression: - case SyntaxKind.JSDocNullableType: - case SyntaxKind.JSDocNonNullableType: - case SyntaxKind.JSDocOptionalType: - case SyntaxKind.JSDocFunctionType: - case SyntaxKind.JSDocVariadicType: - return true; - } - return false; - } - /** True if has initializer node attached to it. */ /* @internal */ export function hasInitializer(node: Node): node is HasInitializer { @@ -6939,7 +6915,7 @@ namespace ts { } export function getAreDeclarationMapsEnabled(options: CompilerOptions) { - return !!(options.declaration && options.declarationMap); + return !!(getEmitDeclarations(options) && options.declarationMap); } export function getAllowSyntheticDefaultImports(compilerOptions: CompilerOptions) { @@ -8108,4 +8084,10 @@ namespace ts { } export type Mutable = { -readonly [K in keyof T]: T[K] }; + + export function sliceAfter(arr: ReadonlyArray, value: T): ReadonlyArray { + const index = arr.indexOf(value); + Debug.assert(index !== -1); + return arr.slice(index); + } } diff --git a/src/compiler/watchUtilities.ts b/src/compiler/watchUtilities.ts index 45ae2e3547828..502e66dac1a60 100644 --- a/src/compiler/watchUtilities.ts +++ b/src/compiler/watchUtilities.ts @@ -398,7 +398,7 @@ namespace ts { case WatchLogLevel.TriggerOnly: return createFileWatcherWithTriggerLogging; case WatchLogLevel.Verbose: - return createFileWatcherWithLogging; + return addWatch === watchDirectory ? createDirectoryWatcherWithLogging : createFileWatcherWithLogging; } } @@ -413,6 +413,25 @@ namespace ts { }; } + function createDirectoryWatcherWithLogging(host: H, file: string, cb: WatchCallback, flags: T, passThrough: V | undefined, detailInfo1: X | undefined, detailInfo2: Y | undefined, addWatch: AddWatch, log: (s: string) => void, watchCaption: string, getDetailWatchInfo: GetDetailWatchInfo | undefined): FileWatcher { + const watchInfo = `${watchCaption}:: Added:: ${getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)}`; + log(watchInfo); + const start = timestamp(); + const watcher = createFileWatcherWithTriggerLogging(host, file, cb, flags, passThrough, detailInfo1, detailInfo2, addWatch, log, watchCaption, getDetailWatchInfo); + const elapsed = timestamp() - start; + log(`Elapsed:: ${elapsed}ms ${watchInfo}`); + return { + close: () => { + const watchInfo = `${watchCaption}:: Close:: ${getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)}`; + log(watchInfo); + const start = timestamp(); + watcher.close(); + const elapsed = timestamp() - start; + log(`Elapsed:: ${elapsed}ms ${watchInfo}`); + } + }; + } + function createFileWatcherWithTriggerLogging(host: H, file: string, cb: WatchCallback, flags: T, passThrough: V | undefined, detailInfo1: X | undefined, detailInfo2: Y | undefined, addWatch: AddWatch, log: (s: string) => void, watchCaption: string, getDetailWatchInfo: GetDetailWatchInfo | undefined): FileWatcher { return addWatch(host, file, (fileName, cbOptional) => { const triggerredInfo = `${watchCaption}:: Triggered with ${fileName}${cbOptional !== undefined ? cbOptional : ""}:: ${getWatchInfo(file, flags, detailInfo1, detailInfo2, getDetailWatchInfo)}`; diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index 3465ef333a0a0..095de4cecb04c 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1515,7 +1515,9 @@ Actual: ${stringify(fullActual)}`); "argumentCount", ]; for (const key in options) { - ts.Debug.assert(ts.contains(allKeys, key)); + if (!ts.contains(allKeys, key)) { + ts.Debug.fail("Unexpected key " + key); + } } } @@ -3367,7 +3369,7 @@ Actual: ${stringify(fullActual)}`); this.languageServiceAdapterHost.renameFileOrDirectory(oldPath, newPath); this.languageService.cleanupSemanticCache(); - const pathUpdater = ts.getPathUpdater(oldPath, newPath, ts.createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ false)); + const pathUpdater = ts.getPathUpdater(oldPath, newPath, ts.createGetCanonicalFileName(/*useCaseSensitiveFileNames*/ false), /*sourceMapper*/ undefined); test(renameKeys(newFileContents, key => pathUpdater(key) || key), "with file moved"); } diff --git a/src/harness/harnessLanguageService.ts b/src/harness/harnessLanguageService.ts index 761be1ae9998b..fa9c88d3ffafc 100644 --- a/src/harness/harnessLanguageService.ts +++ b/src/harness/harnessLanguageService.ts @@ -155,7 +155,7 @@ namespace Harness.LanguageService { this.vfs.mkdirpSync(ts.getDirectoryPath(newPath)); this.vfs.renameSync(oldPath, newPath); - const updater = ts.getPathUpdater(oldPath, newPath, ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames())); + const updater = ts.getPathUpdater(oldPath, newPath, ts.createGetCanonicalFileName(this.useCaseSensitiveFileNames()), /*sourceMapper*/ undefined); this.scriptInfos.forEach((scriptInfo, key) => { const newFileName = updater(key); if (newFileName !== undefined) { diff --git a/src/harness/virtualFileSystemWithWatch.ts b/src/harness/virtualFileSystemWithWatch.ts index 8f3fbe1ad2d4c..572c59bb305fd 100644 --- a/src/harness/virtualFileSystemWithWatch.ts +++ b/src/harness/virtualFileSystemWithWatch.ts @@ -352,9 +352,9 @@ interface Array {}` if (tscWatchDirectory === Tsc_WatchDirectory.WatchFile) { const watchDirectory: HostWatchDirectory = (directory, cb) => this.watchFile(directory, () => cb(directory), PollingInterval.Medium); this.customRecursiveWatchDirectory = createRecursiveDirectoryWatcher({ + useCaseSensitiveFileNames: this.useCaseSensitiveFileNames, directoryExists: path => this.directoryExists(path), getAccessibleSortedChildDirectories: path => this.getDirectories(path), - filePathComparer: this.useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive, watchDirectory, realpath: s => this.realpath(s) }); @@ -362,9 +362,9 @@ interface Array {}` else if (tscWatchDirectory === Tsc_WatchDirectory.NonRecursiveWatchDirectory) { const watchDirectory: HostWatchDirectory = (directory, cb) => this.watchDirectory(directory, fileName => cb(fileName), /*recursive*/ false); this.customRecursiveWatchDirectory = createRecursiveDirectoryWatcher({ + useCaseSensitiveFileNames: this.useCaseSensitiveFileNames, directoryExists: path => this.directoryExists(path), getAccessibleSortedChildDirectories: path => this.getDirectories(path), - filePathComparer: this.useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive, watchDirectory, realpath: s => this.realpath(s) }); @@ -373,9 +373,9 @@ interface Array {}` const watchFile = createDynamicPriorityPollingWatchFile(this); const watchDirectory: HostWatchDirectory = (directory, cb) => watchFile(directory, () => cb(directory), PollingInterval.Medium); this.customRecursiveWatchDirectory = createRecursiveDirectoryWatcher({ + useCaseSensitiveFileNames: this.useCaseSensitiveFileNames, directoryExists: path => this.directoryExists(path), getAccessibleSortedChildDirectories: path => this.getDirectories(path), - filePathComparer: this.useCaseSensitiveFileNames ? compareStringsCaseSensitive : compareStringsCaseInsensitive, watchDirectory, realpath: s => this.realpath(s) }); diff --git a/src/jsTyping/types.ts b/src/jsTyping/types.ts index dfa47ccd7def8..4e00c2eb6f5e4 100644 --- a/src/jsTyping/types.ts +++ b/src/jsTyping/types.ts @@ -1,4 +1,3 @@ -/* @internal */ declare namespace ts.server { export type ActionSet = "action::set"; export type ActionInvalidate = "action::invalidate"; diff --git a/src/server/scriptInfo.ts b/src/server/scriptInfo.ts index f35ac090f295c..b5e892162ad80 100644 --- a/src/server/scriptInfo.ts +++ b/src/server/scriptInfo.ts @@ -1,5 +1,4 @@ namespace ts.server { - /*@internal*/ export interface ScriptInfoVersion { svc: number; text: number; diff --git a/src/server/session.ts b/src/server/session.ts index 1f22c7baa7152..0440d8cecee88 100644 --- a/src/server/session.ts +++ b/src/server/session.ts @@ -286,6 +286,16 @@ namespace ts.server { : deduplicate(outputs, areEqual); } + function combineProjectOutputFromEveryProject(projectService: ProjectService, action: (project: Project) => ReadonlyArray, areEqual: (a: T, b: T) => boolean) { + const outputs: T[] = []; + projectService.forEachProject(project => { + if (project.isOrphan() || !project.languageServiceEnabled) return; + const theseOutputs = action(project); + outputs.push(...theseOutputs.filter(output => !outputs.some(o => areEqual(o, output)))); + }); + return outputs; + } + function combineProjectOutputWhileOpeningReferencedProjects( projects: Projects, projectService: ProjectService, @@ -1147,7 +1157,9 @@ namespace ts.server { const refs: protocol.ReferencesResponseItem[] = flatMap(references, referencedSymbol => referencedSymbol.references.map(({ fileName, textSpan, isWriteAccess, isDefinition }): protocol.ReferencesResponseItem => { const scriptInfo = Debug.assertDefined(this.projectService.getScriptInfo(fileName)); - const lineText = scriptInfo.getSnapshot().getText(textSpan.start, textSpanEnd(textSpan)); + const start = scriptInfo.positionToLineOffset(textSpan.start); + const lineSpan = scriptInfo.lineToTextSpan(start.line - 1); + const lineText = scriptInfo.getSnapshot().getText(lineSpan.start, textSpanEnd(lineSpan)).replace(/\r|\n/g, ""); return { ...toFileSpan(fileName, textSpan, scriptInfo), lineText, isWriteAccess, isDefinition }; })); const result: protocol.ReferencesResponseBody = { refs, symbolName, symbolStartOffset, symbolDisplayString }; @@ -1747,19 +1759,11 @@ namespace ts.server { const newPath = toNormalizedPath(args.newFilePath); const formatOptions = this.getHostFormatOptions(); const preferences = this.getHostPreferences(); - - const changes: (protocol.FileCodeEdits | FileTextChanges)[] = []; - this.projectService.forEachProject(project => { - if (project.isOrphan() || !project.languageServiceEnabled) return; - for (const fileTextChanges of project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences)) { - // Subsequent projects may make conflicting edits to the same file -- just go with the first. - if (!changes.some(f => f.fileName === fileTextChanges.fileName)) { - changes.push(simplifiedResult ? this.mapTextChangeToCodeEdit(project, fileTextChanges) : fileTextChanges); - } - } - }); - - return changes as ReadonlyArray | ReadonlyArray; + const changes = combineProjectOutputFromEveryProject( + this.projectService, + project => project.getLanguageService().getEditsForFileRename(oldPath, newPath, formatOptions, preferences), + (a, b) => a.fileName === b.fileName); + return simplifiedResult ? changes.map(c => this.mapTextChangeToCodeEditUsingScriptInfo(c)) : changes; } private getCodeFixes(args: protocol.CodeFixRequestArgs, simplifiedResult: boolean): ReadonlyArray | ReadonlyArray | undefined { @@ -1833,8 +1837,15 @@ namespace ts.server { } private mapTextChangeToCodeEdit(project: Project, change: FileTextChanges): protocol.FileCodeEdits { - const path = normalizedPathToPath(toNormalizedPath(change.fileName), this.host.getCurrentDirectory(), fileName => this.getCanonicalFileName(fileName)); - return mapTextChangesToCodeEdits(change, project.getSourceFileOrConfigFile(path)); + return mapTextChangesToCodeEditsForFile(change, project.getSourceFileOrConfigFile(this.normalizePath(change.fileName))); + } + + private mapTextChangeToCodeEditUsingScriptInfo(change: FileTextChanges): protocol.FileCodeEdits { + return mapTextChangesToCodeEditsUsingScriptInfo(change, this.projectService.getScriptInfo(this.normalizePath(change.fileName))); + } + + private normalizePath(fileName: string) { + return normalizedPathToPath(toNormalizedPath(fileName), this.host.getCurrentDirectory(), fileName => this.getCanonicalFileName(fileName)); } private convertTextChangeToCodeEdit(change: TextChange, scriptInfo: ScriptInfo): protocol.CodeEdit { @@ -2346,8 +2357,8 @@ namespace ts.server { return { file: fileName, start: scriptInfo.positionToLineOffset(textSpan.start), end: scriptInfo.positionToLineOffset(textSpanEnd(textSpan)) }; } - function mapTextChangesToCodeEdits(textChanges: FileTextChanges, sourceFile: SourceFile | undefined): protocol.FileCodeEdits { - Debug.assert(!!textChanges.isNewFile === !sourceFile); + function mapTextChangesToCodeEditsForFile(textChanges: FileTextChanges, sourceFile: SourceFile | undefined): protocol.FileCodeEdits { + Debug.assert(!!textChanges.isNewFile === !sourceFile, "Expected isNewFile for (only) new files", () => JSON.stringify({ isNewFile: textChanges.isNewFile, hasSourceFile: !!sourceFile })); if (sourceFile) { return { fileName: textChanges.fileName, @@ -2359,6 +2370,13 @@ namespace ts.server { } } + function mapTextChangesToCodeEditsUsingScriptInfo(textChanges: FileTextChanges, scriptInfo: ScriptInfo | undefined): protocol.FileCodeEdits { + Debug.assert(!!textChanges.isNewFile === !scriptInfo); + return scriptInfo + ? { fileName: textChanges.fileName, textChanges: textChanges.textChanges.map(textChange => convertTextChangeToCodeEditUsingScriptInfo(textChange, scriptInfo)) } + : convertNewFileTextChangeToCodeEdit(textChanges); + } + function convertTextChangeToCodeEdit(change: TextChange, sourceFile: SourceFile): protocol.CodeEdit { return { start: convertToLocation(sourceFile.getLineAndCharacterOfPosition(change.span.start)), @@ -2367,6 +2385,10 @@ namespace ts.server { }; } + function convertTextChangeToCodeEditUsingScriptInfo(change: TextChange, scriptInfo: ScriptInfo) { + return { start: scriptInfo.positionToLineOffset(change.span.start), end: scriptInfo.positionToLineOffset(textSpanEnd(change.span)), newText: change.newText }; + } + function convertNewFileTextChangeToCodeEdit(textChanges: FileTextChanges): protocol.FileCodeEdits { Debug.assert(textChanges.textChanges.length === 1); const change = first(textChanges.textChanges); diff --git a/src/services/codefixes/fixSpelling.ts b/src/services/codefixes/fixSpelling.ts index fbe3953c1b567..d504cefd863a0 100644 --- a/src/services/codefixes/fixSpelling.ts +++ b/src/services/codefixes/fixSpelling.ts @@ -43,7 +43,7 @@ namespace ts.codefix { const importDeclaration = findAncestor(node, isImportDeclaration)!; const resolvedSourceFile = getResolvedSourceFileFromImportDeclaration(sourceFile, context, importDeclaration); if (resolvedSourceFile && resolvedSourceFile.symbol) { - suggestion = checker.getSuggestionForNonexistentModule(node as Identifier, resolvedSourceFile.symbol); + suggestion = checker.getSuggestionForNonexistentExport(node as Identifier, resolvedSourceFile.symbol); } } else { diff --git a/src/services/codefixes/fixUnreachableCode.ts b/src/services/codefixes/fixUnreachableCode.ts index 1c6c53efe8e60..4fdb2c2016fd5 100644 --- a/src/services/codefixes/fixUnreachableCode.ts +++ b/src/services/codefixes/fixUnreachableCode.ts @@ -5,14 +5,14 @@ namespace ts.codefix { registerCodeFix({ errorCodes, getCodeActions(context) { - const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start)); + const changes = textChanges.ChangeTracker.with(context, t => doChange(t, context.sourceFile, context.span.start, context.span.length)); return [createCodeFixAction(fixId, changes, Diagnostics.Remove_unreachable_code, fixId, Diagnostics.Remove_all_unreachable_code)]; }, fixIds: [fixId], - getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => doChange(changes, diag.file, diag.start)), + getAllCodeActions: context => codeFixAll(context, errorCodes, (changes, diag) => doChange(changes, diag.file, diag.start, diag.length)), }); - function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, start: number): void { + function doChange(changes: textChanges.ChangeTracker, sourceFile: SourceFile, start: number, length: number): void { const token = getTokenAtPosition(sourceFile, start); const statement = findAncestor(token, isStatement)!; Debug.assert(statement.getStart(sourceFile) === token.getStart(sourceFile)); @@ -36,7 +36,9 @@ namespace ts.codefix { break; default: if (isBlock(statement.parent)) { - split(sliceAfter(statement.parent.statements, statement), shouldRemove, (start, end) => changes.deleteNodeRange(sourceFile, start, end)); + const end = start + length; + const lastStatement = Debug.assertDefined(lastWhere(sliceAfter(statement.parent.statements, statement), s => s.pos < end)); + changes.deleteNodeRange(sourceFile, statement, lastStatement); } else { changes.delete(sourceFile, statement); @@ -44,35 +46,12 @@ namespace ts.codefix { } } - function shouldRemove(s: Statement): boolean { - // Don't remove statements that can validly be used before they appear. - return !isFunctionDeclaration(s) && !isPurelyTypeDeclaration(s) && - // `var x;` may declare a variable used above - !(isVariableStatement(s) && !(getCombinedNodeFlags(s) & (NodeFlags.Let | NodeFlags.Const)) && s.declarationList.declarations.some(d => !d.initializer)); - } - - function isPurelyTypeDeclaration(s: Statement): boolean { - switch (s.kind) { - case SyntaxKind.InterfaceDeclaration: - case SyntaxKind.TypeAliasDeclaration: - return true; - case SyntaxKind.ModuleDeclaration: - return getModuleInstanceState(s as ModuleDeclaration) !== ModuleInstanceState.Instantiated; - case SyntaxKind.EnumDeclaration: - return hasModifier(s, ModifierFlags.Const); - default: - return false; + function lastWhere(a: ReadonlyArray, pred: (value: T) => boolean): T | undefined { + let last: T | undefined; + for (const value of a) { + if (!pred(value)) break; + last = value; } - } - - function sliceAfter(arr: ReadonlyArray, value: T): ReadonlyArray { - const index = arr.indexOf(value); - Debug.assert(index !== -1); - return arr.slice(index); - } - - // Calls 'cb' with the start and end of each range where 'pred' is true. - function split(arr: ReadonlyArray, pred: (t: T) => boolean, cb: (start: T, end: T) => void): void { - getRangesWhere(arr, pred, (start, afterEnd) => cb(arr[start], arr[afterEnd - 1])); + return last; } } diff --git a/src/services/completions.ts b/src/services/completions.ts index c049c1e4daebb..08ac5ce7b5beb 100644 --- a/src/services/completions.ts +++ b/src/services/completions.ts @@ -2,12 +2,20 @@ namespace ts.Completions { export type Log = (message: string) => void; - type SymbolOriginInfo = { type: "this-type" } | { type: "symbol-member" } | SymbolOriginInfoExport; + const enum SymbolOriginInfoKind { ThisType, SymbolMemberNoExport, SymbolMemberExport, Export } + type SymbolOriginInfo = { kind: SymbolOriginInfoKind.ThisType } | { kind: SymbolOriginInfoKind.SymbolMemberNoExport } | SymbolOriginInfoExport; interface SymbolOriginInfoExport { - type: "export"; + kind: SymbolOriginInfoKind.SymbolMemberExport | SymbolOriginInfoKind.Export; moduleSymbol: Symbol; isDefaultExport: boolean; } + function originIsSymbolMember(origin: SymbolOriginInfo): boolean { + return origin.kind === SymbolOriginInfoKind.SymbolMemberExport || origin.kind === SymbolOriginInfoKind.SymbolMemberNoExport; + } + function originIsExport(origin: SymbolOriginInfo): origin is SymbolOriginInfoExport { + return origin.kind === SymbolOriginInfoKind.SymbolMemberExport || origin.kind === SymbolOriginInfoKind.Export; + } + /** * Map from symbol id -> SymbolOriginInfo. * Only populated for symbols that come from other modules. @@ -103,20 +111,22 @@ namespace ts.Completions { function completionInfoFromData(sourceFile: SourceFile, typeChecker: TypeChecker, compilerOptions: CompilerOptions, log: Log, completionData: CompletionData, preferences: UserPreferences): CompletionInfo | undefined { const { symbols, completionKind, isInSnippetScope, isNewIdentifierLocation, location, propertyAccessToConvert, keywordFilters, literals, symbolToOriginInfoMap, recommendedCompletion, isJsxInitializer } = completionData; - if (sourceFile.languageVariant === LanguageVariant.JSX && location && location.parent && isJsxClosingElement(location.parent)) { + if (location && location.parent && isJsxClosingElement(location.parent)) { // In the TypeScript JSX element, if such element is not defined. When users query for completion at closing tag, // instead of simply giving unknown value, the completion will return the tag-name of an associated opening-element. // For example: - // var x =
- // The completion list at "1" will contain "div" with type any + // var x =
" with type any + // And at `
` (with a closing `>`), the completion list will contain "div". const tagName = location.parent.parent.openingElement.tagName; - return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, - entries: [{ - name: tagName.getFullText(), - kind: ScriptElementKind.classElement, - kindModifiers: undefined, - sortText: "0", - }]}; + const hasClosingAngleBracket = !!findChildOfKind(location.parent, SyntaxKind.GreaterThanToken, sourceFile); + const entry: CompletionEntry = { + name: tagName.getFullText(sourceFile) + (hasClosingAngleBracket ? "" : ">"), + kind: ScriptElementKind.classElement, + kindModifiers: undefined, + sortText: "0", + }; + return { isGlobalCompletion: false, isMemberCompletion: true, isNewIdentifierLocation: false, entries: [entry] }; } const entries: CompletionEntry[] = []; @@ -214,12 +224,12 @@ namespace ts.Completions { let insertText: string | undefined; let replacementSpan: TextSpan | undefined; - if (origin && origin.type === "this-type") { + if (origin && origin.kind === SymbolOriginInfoKind.ThisType) { insertText = needsConvertPropertyAccess ? `this[${quote(name, preferences)}]` : `this.${name}`; } // We should only have needsConvertPropertyAccess if there's a property access to convert. But see #21790. // Somehow there was a global with a non-identifier name. Hopefully someone will complain about getting a "foo bar" global completion and provide a repro. - else if ((origin && origin.type === "symbol-member" || needsConvertPropertyAccess) && propertyAccessToConvert) { + else if ((origin && originIsSymbolMember(origin) || needsConvertPropertyAccess) && propertyAccessToConvert) { insertText = needsConvertPropertyAccess ? `[${quote(name, preferences)}]` : `[${name}]`; const dot = findChildOfKind(propertyAccessToConvert, SyntaxKind.DotToken, sourceFile)!; // If the text after the '.' starts with this name, write over it. Else, add new text. @@ -253,7 +263,7 @@ namespace ts.Completions { kindModifiers: SymbolDisplay.getSymbolModifiers(symbol), sortText: "0", source: getSourceFromOrigin(origin), - hasAction: trueOrUndefined(!!origin && origin.type === "export"), + hasAction: trueOrUndefined(!!origin && originIsExport(origin)), isRecommended: trueOrUndefined(isRecommendedCompletionMatch(symbol, recommendedCompletion, typeChecker)), insertText, replacementSpan, @@ -283,7 +293,7 @@ namespace ts.Completions { } function getSourceFromOrigin(origin: SymbolOriginInfo | undefined): string | undefined { - return origin && origin.type === "export" ? stripQuotes(origin.moduleSymbol.name) : undefined; + return origin && originIsExport(origin) ? stripQuotes(origin.moduleSymbol.name) : undefined; } function getCompletionEntriesFromSymbols( @@ -529,7 +539,7 @@ namespace ts.Completions { } function getSymbolName(symbol: Symbol, origin: SymbolOriginInfo | undefined, target: ScriptTarget): string { - return origin && origin.type === "export" && origin.isDefaultExport && symbol.escapedName === InternalSymbolName.Default + return origin && originIsExport(origin) && origin.isDefaultExport && symbol.escapedName === InternalSymbolName.Default // Name of "export default foo;" is "foo". Name of "export default 0" is the filename converted to camelCase. ? firstDefined(symbol.declarations, d => isExportAssignment(d) && isIdentifier(d.expression) ? d.expression.text : undefined) || codefix.moduleSymbolToValidIdentifier(origin.moduleSymbol, target) @@ -648,7 +658,7 @@ namespace ts.Completions { preferences: UserPreferences, ): CodeActionsAndSourceDisplay { const symbolOriginInfo = symbolToOriginInfoMap[getSymbolId(symbol)]; - if (!symbolOriginInfo || symbolOriginInfo.type !== "export") { + if (!symbolOriginInfo || !originIsExport(symbolOriginInfo)) { return { codeActions: undefined, sourceDisplay: undefined }; } @@ -1124,7 +1134,9 @@ namespace ts.Completions { const firstAccessibleSymbol = nameSymbol && getFirstSymbolInChain(nameSymbol, contextToken, typeChecker); if (firstAccessibleSymbol && !symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)]) { symbols.push(firstAccessibleSymbol); - symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)] = { type: "symbol-member" }; + const moduleSymbol = firstAccessibleSymbol.parent; + symbolToOriginInfoMap[getSymbolId(firstAccessibleSymbol)] = + !moduleSymbol || !isExternalModuleSymbol(moduleSymbol) ? { kind: SymbolOriginInfoKind.SymbolMemberNoExport } : { kind: SymbolOriginInfoKind.SymbolMemberExport, moduleSymbol, isDefaultExport: false }; } } else { @@ -1222,7 +1234,7 @@ namespace ts.Completions { const thisType = typeChecker.tryGetThisTypeAt(scopeNode); if (thisType) { for (const symbol of getPropertiesForCompletion(thisType, typeChecker)) { - symbolToOriginInfoMap[getSymbolId(symbol)] = { type: "this-type" }; + symbolToOriginInfoMap[getSymbolId(symbol)] = { kind: SymbolOriginInfoKind.ThisType }; symbols.push(symbol); } } @@ -1374,7 +1386,7 @@ namespace ts.Completions { symbol = getLocalSymbolForExportDefault(symbol) || symbol; } - const origin: SymbolOriginInfo = { type: "export", moduleSymbol, isDefaultExport }; + const origin: SymbolOriginInfoExport = { kind: SymbolOriginInfoKind.Export, moduleSymbol, isDefaultExport }; if (detailsEntryId || stringContainsCharactersInOrder(getSymbolName(symbol, origin, target).toLowerCase(), tokenTextLowerCase)) { symbols.push(symbol); symbolToOriginInfoMap[getSymbolId(symbol)] = origin; diff --git a/src/services/findAllReferences.ts b/src/services/findAllReferences.ts index 6bc55f54ff738..a24012cd4e3c1 100644 --- a/src/services/findAllReferences.ts +++ b/src/services/findAllReferences.ts @@ -234,7 +234,8 @@ namespace ts.FindAllReferences.Core { export function getReferencedSymbolsForNode(position: number, node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options: Options = {}, sourceFilesSet: ReadonlyMap = arrayToSet(sourceFiles, f => f.fileName)): SymbolAndEntries[] | undefined { if (isSourceFile(node)) { const reference = GoToDefinition.getReferenceAtPosition(node, position, program); - return reference && getReferencedSymbolsForModule(program, program.getTypeChecker().getMergedSymbol(reference.file.symbol), /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet); + const moduleSymbol = reference && program.getTypeChecker().getMergedSymbol(reference.file.symbol); + return moduleSymbol && getReferencedSymbolsForModule(program, moduleSymbol, /*excludeImportTypeOfExportEquals*/ false, sourceFiles, sourceFilesSet); } if (!options.implementations) { @@ -703,7 +704,7 @@ namespace ts.FindAllReferences.Core { - But if the parent has `export as namespace`, the symbol is globally visible through that namespace. */ const exposedByParent = parent && !(symbol.flags & SymbolFlags.TypeParameter); - if (exposedByParent && !((parent!.flags & SymbolFlags.Module) && isExternalModuleSymbol(parent!) && !parent!.globalExports)) { + if (exposedByParent && !(isExternalModuleSymbol(parent!) && !parent!.globalExports)) { return undefined; } @@ -1462,12 +1463,14 @@ namespace ts.FindAllReferences.Core { } /** Gets all symbols for one property. Does not get symbols for every property. */ - function getPropertySymbolsFromContextualType(node: ObjectLiteralElement, checker: TypeChecker): ReadonlyArray { + function getPropertySymbolsFromContextualType(node: ObjectLiteralElementWithName, checker: TypeChecker): ReadonlyArray { const contextualType = checker.getContextualType(node.parent); - const name = getNameFromPropertyName(node.name!); - const symbol = contextualType && name && contextualType.getProperty(name); + if (!contextualType) return emptyArray; + const name = getNameFromPropertyName(node.name); + if (!name) return emptyArray; + const symbol = contextualType.getProperty(name); return symbol ? [symbol] : - contextualType && contextualType.isUnion() ? mapDefined(contextualType.types, t => t.getProperty(name!)) : emptyArray; // TODO: GH#18217 + contextualType.isUnion() ? mapDefined(contextualType.types, t => t.getProperty(name)) : emptyArray; } /** diff --git a/src/services/getEditsForFileRename.ts b/src/services/getEditsForFileRename.ts index bfb737ef03c73..932c777907ed5 100644 --- a/src/services/getEditsForFileRename.ts +++ b/src/services/getEditsForFileRename.ts @@ -1,10 +1,18 @@ /* @internal */ namespace ts { - export function getEditsForFileRename(program: Program, oldFileOrDirPath: string, newFileOrDirPath: string, host: LanguageServiceHost, formatContext: formatting.FormatContext, preferences: UserPreferences): ReadonlyArray { + export function getEditsForFileRename( + program: Program, + oldFileOrDirPath: string, + newFileOrDirPath: string, + host: LanguageServiceHost, + formatContext: formatting.FormatContext, + preferences: UserPreferences, + sourceMapper: SourceMapper, + ): ReadonlyArray { const useCaseSensitiveFileNames = hostUsesCaseSensitiveFileNames(host); const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames); - const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName); - const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName); + const oldToNew = getPathUpdater(oldFileOrDirPath, newFileOrDirPath, getCanonicalFileName, sourceMapper); + const newToOld = getPathUpdater(newFileOrDirPath, oldFileOrDirPath, getCanonicalFileName, sourceMapper); return textChanges.ChangeTracker.with({ host, formatContext }, changeTracker => { updateTsconfigFiles(program, changeTracker, oldToNew, newFileOrDirPath, host.getCurrentDirectory(), useCaseSensitiveFileNames); updateImports(program, changeTracker, oldToNew, newToOld, host, getCanonicalFileName, preferences); @@ -14,13 +22,27 @@ namespace ts { /** If 'path' refers to an old directory, returns path in the new directory. */ type PathUpdater = (path: string) => string | undefined; // exported for tests - export function getPathUpdater(oldFileOrDirPath: string, newFileOrDirPath: string, getCanonicalFileName: GetCanonicalFileName): PathUpdater { + export function getPathUpdater(oldFileOrDirPath: string, newFileOrDirPath: string, getCanonicalFileName: GetCanonicalFileName, sourceMapper: SourceMapper | undefined): PathUpdater { const canonicalOldPath = getCanonicalFileName(oldFileOrDirPath); return path => { - if (getCanonicalFileName(path) === canonicalOldPath) return newFileOrDirPath; - const suffix = tryRemoveDirectoryPrefix(path, canonicalOldPath, getCanonicalFileName); - return suffix === undefined ? undefined : newFileOrDirPath + "/" + suffix; + const originalPath = sourceMapper && sourceMapper.tryGetOriginalLocation({ fileName: path, position: 0 }); + const updatedPath = getUpdatedPath(originalPath ? originalPath.fileName : path); + return originalPath + ? updatedPath === undefined ? undefined : makeCorrespondingRelativeChange(originalPath.fileName, updatedPath, path, getCanonicalFileName) + : updatedPath; }; + + function getUpdatedPath(pathToUpdate: string): string | undefined { + if (getCanonicalFileName(pathToUpdate) === canonicalOldPath) return newFileOrDirPath; + const suffix = tryRemoveDirectoryPrefix(pathToUpdate, canonicalOldPath, getCanonicalFileName); + return suffix === undefined ? undefined : newFileOrDirPath + "/" + suffix; + } + } + + // Relative path from a0 to b0 should be same as relative path from a1 to b1. Returns b1. + function makeCorrespondingRelativeChange(a0: string, b0: string, a1: string, getCanonicalFileName: GetCanonicalFileName): string { + const rel = getRelativePathFromFile(a0, b0, getCanonicalFileName); + return combinePathsSafe(getDirectoryPath(a1), rel); } function updateTsconfigFiles(program: Program, changeTracker: textChanges.ChangeTracker, oldToNew: PathUpdater, newFileOrDirPath: string, currentDirectory: string, useCaseSensitiveFileNames: boolean): void { diff --git a/src/services/outliningElementsCollector.ts b/src/services/outliningElementsCollector.ts index bae6bc7222c17..9d2c61a1a7d2c 100644 --- a/src/services/outliningElementsCollector.ts +++ b/src/services/outliningElementsCollector.ts @@ -183,6 +183,26 @@ namespace ts.OutliningElementsCollector { return spanForObjectOrArrayLiteral(n); case SyntaxKind.ArrayLiteralExpression: return spanForObjectOrArrayLiteral(n, SyntaxKind.OpenBracketToken); + case SyntaxKind.JsxElement: + return spanForJSXElement(n); + case SyntaxKind.JsxSelfClosingElement: + case SyntaxKind.JsxOpeningElement: + return spanForJSXAttributes((n).attributes); + } + + function spanForJSXElement(node: JsxElement): OutliningSpan | undefined { + const textSpan = createTextSpanFromBounds(node.openingElement.getStart(sourceFile), node.closingElement.getEnd()); + const tagName = node.openingElement.tagName.getText(sourceFile); + const bannerText = "<" + tagName + ">..."; + return createOutliningSpan(textSpan, OutliningSpanKind.Code, textSpan, /*autoCollapse*/ false, bannerText); + } + + function spanForJSXAttributes(node: JsxAttributes): OutliningSpan | undefined { + if (node.properties.length === 0) { + return undefined; + } + + return createOutliningSpanFromBounds(node.getStart(sourceFile), node.getEnd(), OutliningSpanKind.Code); } function spanForObjectOrArrayLiteral(node: Node, open: SyntaxKind.OpenBraceToken | SyntaxKind.OpenBracketToken = SyntaxKind.OpenBraceToken): OutliningSpan | undefined { diff --git a/src/services/services.ts b/src/services/services.ts index d294f53830cb1..eb7b9edefcdb4 100644 --- a/src/services/services.ts +++ b/src/services/services.ts @@ -1537,7 +1537,8 @@ namespace ts { } function getDocumentHighlights(fileName: string, position: number, filesToSearch: ReadonlyArray): DocumentHighlights[] | undefined { - Debug.assert(filesToSearch.some(f => normalizePath(f) === fileName)); + const normalizedFileName = normalizePath(fileName); + Debug.assert(filesToSearch.some(f => normalizePath(f) === normalizedFileName)); synchronizeHostData(); const sourceFilesToSearch = map(filesToSearch, f => Debug.assertDefined(program.getSourceFile(f))); const sourceFile = getValidSourceFile(fileName); @@ -1812,7 +1813,7 @@ namespace ts { } function getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences = emptyOptions): ReadonlyArray { - return ts.getEditsForFileRename(getProgram()!, oldFilePath, newFilePath, host, formatting.getFormatContext(formatOptions), preferences); + return ts.getEditsForFileRename(getProgram()!, oldFilePath, newFilePath, host, formatting.getFormatContext(formatOptions), preferences, sourceMapper); } function applyCodeActionCommand(action: CodeActionCommand): Promise; @@ -1883,11 +1884,16 @@ namespace ts { if (!token) return undefined; const element = token.kind === SyntaxKind.GreaterThanToken && isJsxOpeningElement(token.parent) ? token.parent.parent : isJsxText(token) ? token.parent : undefined; - if (element && !tagNamesAreEquivalent(element.openingElement.tagName, element.closingElement.tagName)) { + if (element && isUnclosedTag(element)) { return { newText: `` }; } } + function isUnclosedTag({ openingElement, closingElement, parent }: JsxElement): boolean { + return !tagNamesAreEquivalent(openingElement.tagName, closingElement.tagName) || + isJsxElement(parent) && tagNamesAreEquivalent(openingElement.tagName, parent.openingElement.tagName) && isUnclosedTag(parent); + } + function getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined { const sourceFile = syntaxTreeCache.getCurrentSourceFile(fileName); const range = formatting.getRangeOfEnclosingComment(sourceFile, position); @@ -2180,21 +2186,23 @@ namespace ts { * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } */ /* @internal */ - export function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement | undefined { + export function getContainingObjectLiteralElement(node: Node): ObjectLiteralElementWithName | undefined { switch (node.kind) { case SyntaxKind.StringLiteral: case SyntaxKind.NumericLiteral: if (node.parent.kind === SyntaxKind.ComputedPropertyName) { - return isObjectLiteralElement(node.parent.parent) ? node.parent.parent : undefined; + return isObjectLiteralElement(node.parent.parent) ? node.parent.parent as ObjectLiteralElementWithName : undefined; } // falls through case SyntaxKind.Identifier: return isObjectLiteralElement(node.parent) && (node.parent.parent.kind === SyntaxKind.ObjectLiteralExpression || node.parent.parent.kind === SyntaxKind.JsxAttributes) && - node.parent.name === node ? node.parent : undefined; + node.parent.name === node ? node.parent as ObjectLiteralElementWithName : undefined; } return undefined; } + /* @internal */ + export type ObjectLiteralElementWithName = ObjectLiteralElement & { name: PropertyName }; /* @internal */ export function getPropertySymbolsFromContextualType(typeChecker: TypeChecker, node: ObjectLiteralElement): Symbol[] { diff --git a/src/services/signatureHelp.ts b/src/services/signatureHelp.ts index 2884f7a7a0ccc..491c905785e68 100644 --- a/src/services/signatureHelp.ts +++ b/src/services/signatureHelp.ts @@ -29,9 +29,12 @@ namespace ts.SignatureHelp { return undefined; } - if (shouldCarefullyCheckContext(triggerReason)) { - // In the middle of a string, don't provide signature help unless the user explicitly requested it. - if (isInString(sourceFile, position, startingToken)) { + // Only need to be careful if the user typed a character and signature help wasn't showing. + const shouldCarefullyCheckContext = !!triggerReason && triggerReason.kind === "characterTyped"; + + // Bail out quickly in the middle of a string or comment, don't provide signature help unless the user explicitly requested it. + if (shouldCarefullyCheckContext) { + if (isInString(sourceFile, position, startingToken) || isInComment(sourceFile, position)) { return undefined; } } @@ -41,8 +44,8 @@ namespace ts.SignatureHelp { cancellationToken.throwIfCancellationRequested(); - // Semantic filtering of signature help - const candidateInfo = getCandidateInfo(argumentInfo, typeChecker); + // Extra syntactic and semantic filtering of signature help + const candidateInfo = getCandidateInfo(argumentInfo, typeChecker, sourceFile, startingToken, shouldCarefullyCheckContext); cancellationToken.throwIfCancellationRequested(); if (!candidateInfo) { @@ -57,24 +60,57 @@ namespace ts.SignatureHelp { return typeChecker.runWithCancellationToken(cancellationToken, typeChecker => createSignatureHelpItems(candidateInfo.candidates, candidateInfo.resolvedSignature, argumentInfo, sourceFile, typeChecker)); } - function shouldCarefullyCheckContext(reason: SignatureHelpTriggerReason | undefined) { - // Only need to be careful if the user typed a character and signature help wasn't showing. - return !!reason && reason.kind === "characterTyped"; - } + function getCandidateInfo( + argumentInfo: ArgumentListInfo, checker: TypeChecker, sourceFile: SourceFile, startingToken: Node, onlyUseSyntacticOwners: boolean): + { readonly candidates: ReadonlyArray, readonly resolvedSignature: Signature } | undefined { - function getCandidateInfo(argumentInfo: ArgumentListInfo, checker: TypeChecker): { readonly candidates: ReadonlyArray, readonly resolvedSignature: Signature } | undefined { const { invocation } = argumentInfo; if (invocation.kind === InvocationKind.Call) { + if (onlyUseSyntacticOwners) { + if (isCallOrNewExpression(invocation.node)) { + const invocationChildren = invocation.node.getChildren(sourceFile); + switch (startingToken.kind) { + case SyntaxKind.OpenParenToken: + if (!contains(invocationChildren, startingToken)) { + return undefined; + } + break; + case SyntaxKind.CommaToken: + const containingList = findContainingList(startingToken); + if (!containingList || !contains(invocationChildren, findContainingList(startingToken))) { + return undefined; + } + break; + case SyntaxKind.LessThanToken: + if (!lessThanFollowsCalledExpression(startingToken, sourceFile, invocation.node.expression)) { + return undefined; + } + break; + default: + return undefined; + } + } + else { + return undefined; + } + } + const candidates: Signature[] = []; const resolvedSignature = checker.getResolvedSignature(invocation.node, candidates, argumentInfo.argumentCount)!; // TODO: GH#18217 return candidates.length === 0 ? undefined : { candidates, resolvedSignature }; } - else { + else if (invocation.kind === InvocationKind.TypeArgs) { + if (onlyUseSyntacticOwners && !lessThanFollowsCalledExpression(startingToken, sourceFile, invocation.called)) { + return undefined; + } const type = checker.getTypeAtLocation(invocation.called)!; // TODO: GH#18217 const signatures = isNewExpression(invocation.called.parent) ? type.getConstructSignatures() : type.getCallSignatures(); const candidates = signatures.filter(candidate => !!candidate.typeParameters && candidate.typeParameters.length >= argumentInfo.argumentCount); return candidates.length === 0 ? undefined : { candidates, resolvedSignature: first(candidates) }; } + else { + Debug.assertNever(invocation); + } } function createJavaScriptSignatureHelpItems(argumentInfo: ArgumentListInfo, program: Program, cancellationToken: CancellationToken): SignatureHelpItems | undefined { @@ -107,6 +143,14 @@ namespace ts.SignatureHelp { } } + function lessThanFollowsCalledExpression(startingToken: Node, sourceFile: SourceFile, calledExpression: Expression) { + const precedingToken = Debug.assertDefined( + findPrecedingToken(startingToken.getFullStart(), sourceFile, startingToken.parent, /*excludeJsdoc*/ true) + ); + + return rangeContainsRange(calledExpression, precedingToken); + } + export interface ArgumentInfoForCompletions { readonly invocation: CallLikeExpression; readonly argumentIndex: number; diff --git a/src/services/utilities.ts b/src/services/utilities.ts index b87ec2610d856..42f6a3da60b17 100644 --- a/src/services/utilities.ts +++ b/src/services/utilities.ts @@ -679,7 +679,7 @@ namespace ts { let current: Node = sourceFile; outer: while (true) { // find the child that contains 'position' - for (const child of current.getChildren()) { + for (const child of current.getChildren(sourceFile)) { const start = allowPositionInLeadingTrivia ? child.getFullStart() : child.getStart(sourceFile, /*includeJsDoc*/ true); if (start > position) { // If this child begins after position, then all subsequent children will as well. @@ -1184,8 +1184,7 @@ namespace ts { /** True if the symbol is for an external module, as opposed to a namespace. */ export function isExternalModuleSymbol(moduleSymbol: Symbol): boolean { - Debug.assert(!!(moduleSymbol.flags & SymbolFlags.Module)); - return moduleSymbol.name.charCodeAt(0) === CharacterCodes.doubleQuote; + return !!(moduleSymbol.flags & SymbolFlags.Module) && moduleSymbol.name.charCodeAt(0) === CharacterCodes.doubleQuote; } /** Returns `true` the first time it encounters a node and `false` afterwards. */ @@ -1435,14 +1434,25 @@ namespace ts { const displayPartWriter = getDisplayPartWriter(); function getDisplayPartWriter(): DisplayPartsSymbolWriter { + const absoluteMaximumLength = defaultMaximumTruncationLength * 10; // A hard cutoff to avoid overloading the messaging channel in worst-case scenarios let displayParts: SymbolDisplayPart[]; let lineStart: boolean; let indent: number; + let length: number; resetWriter(); const unknownWrite = (text: string) => writeKind(text, SymbolDisplayPartKind.text); return { - displayParts: () => displayParts, + displayParts: () => { + const finalText = displayParts.length && displayParts[displayParts.length - 1].text; + if (length > absoluteMaximumLength && finalText && finalText !== "...") { + if (!isWhiteSpaceLike(finalText.charCodeAt(finalText.length - 1))) { + displayParts.push(displayPart(" ", SymbolDisplayPartKind.space)); + } + displayParts.push(displayPart("...", SymbolDisplayPartKind.punctuation)); + } + return displayParts; + }, writeKeyword: text => writeKind(text, SymbolDisplayPartKind.keyword), writeOperator: text => writeKind(text, SymbolDisplayPartKind.operator), writePunctuation: text => writeKind(text, SymbolDisplayPartKind.punctuation), @@ -1472,9 +1482,11 @@ namespace ts { }; function writeIndent() { + if (length > absoluteMaximumLength) return; if (lineStart) { const indentString = getIndentString(indent); if (indentString) { + length += indentString.length; displayParts.push(displayPart(indentString, SymbolDisplayPartKind.space)); } lineStart = false; @@ -1482,16 +1494,22 @@ namespace ts { } function writeKind(text: string, kind: SymbolDisplayPartKind) { + if (length > absoluteMaximumLength) return; writeIndent(); + length += text.length; displayParts.push(displayPart(text, kind)); } function writeSymbol(text: string, symbol: Symbol) { + if (length > absoluteMaximumLength) return; writeIndent(); + length += text.length; displayParts.push(symbolPart(text, symbol)); } function writeLine() { + if (length > absoluteMaximumLength) return; + length += 1; displayParts.push(lineBreakPart()); lineStart = true; } @@ -1500,6 +1518,7 @@ namespace ts { displayParts = []; lineStart = true; indent = 0; + length = 0; } } diff --git a/src/testRunner/unittests/factory.ts b/src/testRunner/unittests/factory.ts index 5324970ecd5fe..11ff65a855848 100644 --- a/src/testRunner/unittests/factory.ts +++ b/src/testRunner/unittests/factory.ts @@ -1,5 +1,32 @@ namespace ts { describe("FactoryAPI", () => { + describe("createExportAssignment", () => { + it("parenthesizes default export if necessary", () => { + function checkExpression(expression: Expression) { + const node = createExportAssignment( + /*decorators*/ undefined, + /*modifiers*/ undefined, + /*isExportEquals*/ false, + expression, + ); + assert.strictEqual(node.expression.kind, SyntaxKind.ParenthesizedExpression); + } + + const clazz = createClassExpression(/*modifiers*/ undefined, "C", /*typeParameters*/ undefined, /*heritageClauses*/ undefined, [ + createProperty(/*decorators*/ undefined, [createToken(SyntaxKind.StaticKeyword)], "prop", /*questionOrExclamationToken*/ undefined, /*type*/ undefined, createLiteral("1")), + ]); + checkExpression(clazz); + checkExpression(createPropertyAccess(clazz, "prop")); + + const func = createFunctionExpression(/*modifiers*/ undefined, /*asteriskToken*/ undefined, "fn", /*typeParameters*/ undefined, /*parameters*/ undefined, /*type*/ undefined, createBlock([])); + checkExpression(func); + checkExpression(createCall(func, /*typeArguments*/ undefined, /*argumentsArray*/ undefined)); + + checkExpression(createBinary(createLiteral("a"), SyntaxKind.CommaToken, createLiteral("b"))); + checkExpression(createCommaList([createLiteral("a"), createLiteral("b")])); + }); + }); + describe("createArrowFunction", () => { it("parenthesizes concise body if necessary", () => { function checkBody(body: ConciseBody) { diff --git a/src/testRunner/unittests/projectReferences.ts b/src/testRunner/unittests/projectReferences.ts index 070d26cccd5f9..4702c0c26ceb9 100644 --- a/src/testRunner/unittests/projectReferences.ts +++ b/src/testRunner/unittests/projectReferences.ts @@ -285,4 +285,23 @@ namespace ts { }); }); + describe("errors when a file in a composite project occurs outside the root", () => { + it("Errors when a file is outside the rootdir", () => { + const spec: TestSpecification = { + "/alpha": { + files: { "/alpha/src/a.ts": "import * from '../../beta/b'", "/beta/b.ts": "export { }" }, + options: { + declaration: true, + outDir: "bin" + }, + references: [] + } + }; + testProjectReferences(spec, "/alpha/tsconfig.json", (program) => { + assertHasError("Issues an error about the rootDir", program.getOptionsDiagnostics(), Diagnostics.File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files); + assertHasError("Issues an error about the fileList", program.getOptionsDiagnostics(), Diagnostics.File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern); + }); + }); + }); + } diff --git a/src/testRunner/unittests/tsserverProjectSystem.ts b/src/testRunner/unittests/tsserverProjectSystem.ts index e38d80667bc6a..d2a398849c967 100644 --- a/src/testRunner/unittests/tsserverProjectSystem.ts +++ b/src/testRunner/unittests/tsserverProjectSystem.ts @@ -8486,7 +8486,7 @@ new C();` }); }); - it("when watching directories for failed lookup locations in amd resolution", () => { + describe("when watching directories for failed lookup locations in amd resolution", () => { const projectRoot = "/user/username/projects/project"; const nodeFile: File = { path: `${projectRoot}/src/typings/node.d.ts`, @@ -8530,19 +8530,35 @@ export const x = 10;` } }) }; - const files = [nodeFile, electronFile, srcFile, moduleFile, configFile, libFile]; - const host = createServerHost(files); - const service = createProjectService(host); - service.openClientFile(srcFile.path, srcFile.content, ScriptKind.TS, projectRoot); - checkProjectActualFiles(service.configuredProjects.get(configFile.path)!, files.map(f => f.path)); - checkWatchedFilesDetailed(host, mapDefined(files, f => f === srcFile ? undefined : f.path), 1); - checkWatchedDirectoriesDetailed(host, [`${projectRoot}`], 1, /*recursive*/ false); // failed lookup for fs - const expectedWatchedDirectories = createMap(); - expectedWatchedDirectories.set(`${projectRoot}/src`, 2); // Wild card and failed lookup - expectedWatchedDirectories.set(`${projectRoot}/somefolder`, 1); // failed lookup for somefolder/module2 - expectedWatchedDirectories.set(`${projectRoot}/node_modules`, 1); // failed lookup for with node_modules/@types/fs - expectedWatchedDirectories.set(`${projectRoot}/src/typings`, 1); // typeroot directory - checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ true); + + function verifyModuleResolution(useNodeFile: boolean) { + const files = [...(useNodeFile ? [nodeFile] : []), electronFile, srcFile, moduleFile, configFile, libFile]; + const host = createServerHost(files); + const service = createProjectService(host); + service.openClientFile(srcFile.path, srcFile.content, ScriptKind.TS, projectRoot); + checkProjectActualFiles(service.configuredProjects.get(configFile.path)!, files.map(f => f.path)); + checkWatchedFilesDetailed(host, mapDefined(files, f => f === srcFile ? undefined : f.path), 1); + if (useNodeFile) { + checkWatchedDirectories(host, emptyArray, /*recursive*/ false); // since fs resolves to ambient module, shouldnt watch failed lookup + } + else { + checkWatchedDirectoriesDetailed(host, [`${projectRoot}`], 1, /*recursive*/ false); // failed lookup for fs + } + const expectedWatchedDirectories = createMap(); + expectedWatchedDirectories.set(`${projectRoot}/src`, 2); // Wild card and failed lookup + expectedWatchedDirectories.set(`${projectRoot}/somefolder`, 1); // failed lookup for somefolder/module2 + expectedWatchedDirectories.set(`${projectRoot}/node_modules`, 1); // failed lookup for with node_modules/@types/fs + expectedWatchedDirectories.set(`${projectRoot}/src/typings`, 1); // typeroot directory + checkWatchedDirectoriesDetailed(host, expectedWatchedDirectories, /*recursive*/ true); + } + + it("when resolves to ambient module", () => { + verifyModuleResolution(/*useNodeFile*/ true); + }); + + it("when resolution fails", () => { + verifyModuleResolution(/*useNodeFile*/ false); + }); }); }); @@ -8573,10 +8589,10 @@ export const x = 10;` tscWatchDirectory === Tsc_WatchDirectory.WatchFile ? expectedWatchedFiles : createMap(); - // For failed resolution lookup and tsconfig files - mapOfDirectories.set(projectFolder, 2); + // For failed resolution lookup and tsconfig files => cached so only watched only once + mapOfDirectories.set(projectFolder, 1); // Through above recursive watches - mapOfDirectories.set(projectSrcFolder, 2); + mapOfDirectories.set(projectSrcFolder, 1); // node_modules/@types folder mapOfDirectories.set(`${projectFolder}/${nodeModulesAtTypes}`, 1); const expectedCompletions = ["file1"]; @@ -9042,9 +9058,9 @@ export function Test2() { const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnA()")); assert.deepEqual(response, { refs: [ - makeReferenceItem(userTs, /*isDefinition*/ true, "fnA"), - makeReferenceItem(userTs, /*isDefinition*/ false, "fnA", { index: 1 }), - makeReferenceItem(aTs, /*isDefinition*/ true, "fnA"), + makeReferenceItem(userTs, /*isDefinition*/ true, "fnA", "import { fnA, instanceA } from \"../a/bin/a\";"), + makeReferenceItem(userTs, /*isDefinition*/ false, "fnA", "export function fnUser() { fnA(); fnB(); instanceA; }", { index: 1 }), + makeReferenceItem(aTs, /*isDefinition*/ true, "fnA", "export function fnA() {}"), ], symbolName: "fnA", symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnA()").offset, @@ -9118,9 +9134,9 @@ export function Test2() { const response = executeSessionRequest(session, protocol.CommandTypes.References, protocolFileLocationFromSubstring(userTs, "fnB()")); assert.deepEqual(response, { refs: [ - makeReferenceItem(userTs, /*isDefinition*/ true, "fnB"), - makeReferenceItem(userTs, /*isDefinition*/ false, "fnB", { index: 1 }), - makeReferenceItem(bDts, /*isDefinition*/ true, "fnB"), + makeReferenceItem(userTs, /*isDefinition*/ true, "fnB", "import { fnB } from \"../b/bin/b\";"), + makeReferenceItem(userTs, /*isDefinition*/ false, "fnB", "export function fnUser() { fnA(); fnB(); instanceA; }", { index: 1 }), + makeReferenceItem(bDts, /*isDefinition*/ true, "fnB", "export declare function fnB(): void;"), ], symbolName: "fnB", symbolStartOffset: protocolLocationFromSubstring(userTs.content, "fnB()").offset, @@ -9194,14 +9210,30 @@ export function Test2() { }); }); + + it("getEditsForFileRename", () => { + const { session, aTs, userTs } = makeSampleProjects(); + const response = executeSessionRequest(session, protocol.CommandTypes.GetEditsForFileRename, { + oldFilePath: aTs.path, + newFilePath: "/a/aNew.ts", + }); + assert.deepEqual>(response, [ + { + fileName: userTs.path, + textChanges: [ + { ...protocolTextSpanFromSubstring(userTs.content, "../a/bin/a"), newText: "../a/bin/aNew" }, + ], + }, + ]); + }); }); - function makeReferenceItem(file: File, isDefinition: boolean, text: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { + function makeReferenceItem(file: File, isDefinition: boolean, text: string, lineText: string, options?: SpanFromSubstringOptions): protocol.ReferencesResponseItem { return { ...protocolFileSpanFromSubstring(file, text, options), isDefinition, isWriteAccess: isDefinition, - lineText: text, + lineText, }; } diff --git a/tests/baselines/reference/ES5For-of17.errors.txt b/tests/baselines/reference/ES5For-of17.errors.txt index bddcd678ac2f6..ee24a232bd2af 100644 --- a/tests/baselines/reference/ES5For-of17.errors.txt +++ b/tests/baselines/reference/ES5For-of17.errors.txt @@ -7,7 +7,7 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts(3,20): error for (let v of [v]) { ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts:3:14: 'v' was declared here. +!!! related TS2728 tests/cases/conformance/statements/for-ofStatements/ES5For-of17.ts:3:14: 'v' is declared here. var x = v; v++; } diff --git a/tests/baselines/reference/ES5For-of20.errors.txt b/tests/baselines/reference/ES5For-of20.errors.txt index bc2e4ee0f2b7f..c72dee5d27ffc 100644 --- a/tests/baselines/reference/ES5For-of20.errors.txt +++ b/tests/baselines/reference/ES5For-of20.errors.txt @@ -8,7 +8,7 @@ tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts(4,15): error for (let v of [v]) { ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts:3:14: 'v' was declared here. +!!! related TS2728 tests/cases/conformance/statements/for-ofStatements/ES5For-of20.ts:3:14: 'v' is declared here. const v; ~ !!! error TS1155: 'const' declarations must be initialized. diff --git a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt index e89e993b6bd64..207d3569b31ef 100644 --- a/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt +++ b/tests/baselines/reference/ModuleAndClassWithSameNameAndCommonRoot.errors.txt @@ -32,7 +32,7 @@ tests/cases/conformance/internalModules/DeclarationMerging/simple.ts(2,31): erro export var Instance = new A(); ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/conformance/internalModules/DeclarationMerging/simple.ts:6:7: 'A' was declared here. +!!! related TS2728 tests/cases/conformance/internalModules/DeclarationMerging/simple.ts:6:7: 'A' is declared here. } // duplicate identifier diff --git a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt index 96864565d85e9..68033f3eeec9f 100644 --- a/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt +++ b/tests/baselines/reference/ModuleWithExportedAndNonExportedFunctions.errors.txt @@ -35,4 +35,5 @@ tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAnd !!! error TS2339: Property 'fn2' does not exist on type 'typeof A'. var fng2 = A.fng2; ~~~~ -!!! error TS2551: Property 'fng2' does not exist on type 'typeof A'. Did you mean 'fng'? \ No newline at end of file +!!! error TS2551: Property 'fng2' does not exist on type 'typeof A'. Did you mean 'fng'? +!!! related TS2728 tests/cases/conformance/internalModules/exportDeclarations/ModuleWithExportedAndNonExportedFunctions.ts:7:21: 'fng' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/anonymousClassExpression2.errors.txt b/tests/baselines/reference/anonymousClassExpression2.errors.txt index 6bc858bc5426b..fb8bec4e315ef 100644 --- a/tests/baselines/reference/anonymousClassExpression2.errors.txt +++ b/tests/baselines/reference/anonymousClassExpression2.errors.txt @@ -17,6 +17,7 @@ tests/cases/compiler/anonymousClassExpression2.ts(13,18): error TS2551: Property this.methodA; // error ~~~~~~~ !!! error TS2551: Property 'methodA' does not exist on type 'B'. Did you mean 'methodB'? +!!! related TS2728 tests/cases/compiler/anonymousClassExpression2.ts:12:9: 'methodB' is declared here. this.methodB; // ok } } diff --git a/tests/baselines/reference/api/tsserverlibrary.d.ts b/tests/baselines/reference/api/tsserverlibrary.d.ts index 82b7e0c3ef833..840ebc1f259cc 100644 --- a/tests/baselines/reference/api/tsserverlibrary.d.ts +++ b/tests/baselines/reference/api/tsserverlibrary.d.ts @@ -1,3 +1,17 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ declare namespace ts { const versionMajorMinor = "3.0"; @@ -46,526 +60,6 @@ declare namespace ts { interface Push { push(...values: T[]): void; } - type EqualityComparer = (a: T, b: T) => boolean; - type Comparer = (a: T, b: T) => Comparison; - enum Comparison { - LessThan = -1, - EqualTo = 0, - GreaterThan = 1 - } -} -declare namespace ts { - /** Create a new map. If a template object is provided, the map will copy entries from it. */ - function createMap(): Map; - function createMapFromEntries(entries: [string, T][]): Map; - function createMapFromTemplate(template: MapLike): Map; - const MapCtr: new () => Map; - function length(array: ReadonlyArray | undefined): number; - /** - * Iterates through 'array' by index and performs the callback on each element of array until the callback - * returns a truthy value, then returns that value. - * If no such value is found, the callback is applied to each element of array and undefined is returned. - */ - function forEach(array: ReadonlyArray | undefined, callback: (element: T, index: number) => U | undefined): U | undefined; - /** Like `forEach`, but suitable for use with numbers and strings (which may be falsy). */ - function firstDefined(array: ReadonlyArray | undefined, callback: (element: T, index: number) => U | undefined): U | undefined; - function firstDefinedIterator(iter: Iterator, callback: (element: T) => U | undefined): U | undefined; - function zipWith(arrayA: ReadonlyArray, arrayB: ReadonlyArray, callback: (a: T, b: U, index: number) => V): V[]; - function zipToIterator(arrayA: ReadonlyArray, arrayB: ReadonlyArray): Iterator<[T, U]>; - function zipToMap(keys: ReadonlyArray, values: ReadonlyArray): Map; - /** - * Iterates through `array` by index and performs the callback on each element of array until the callback - * returns a falsey value, then returns false. - * If no such value is found, the callback is applied to each element of array and `true` is returned. - */ - function every(array: ReadonlyArray, callback: (element: T, index: number) => boolean): boolean; - /** Works like Array.prototype.find, returning `undefined` if no element satisfying the predicate is found. */ - function find(array: ReadonlyArray, predicate: (element: T, index: number) => element is U): U | undefined; - function find(array: ReadonlyArray, predicate: (element: T, index: number) => boolean): T | undefined; - function findLast(array: ReadonlyArray, predicate: (element: T, index: number) => element is U): U | undefined; - function findLast(array: ReadonlyArray, predicate: (element: T, index: number) => boolean): T | undefined; - /** Works like Array.prototype.findIndex, returning `-1` if no element satisfying the predicate is found. */ - function findIndex(array: ReadonlyArray, predicate: (element: T, index: number) => boolean, startIndex?: number): number; - function findLastIndex(array: ReadonlyArray, predicate: (element: T, index: number) => boolean, startIndex?: number): number; - /** - * Returns the first truthy result of `callback`, or else fails. - * This is like `forEach`, but never returns undefined. - */ - function findMap(array: ReadonlyArray, callback: (element: T, index: number) => U | undefined): U; - function contains(array: ReadonlyArray | undefined, value: T, equalityComparer?: EqualityComparer): boolean; - function arraysEqual(a: ReadonlyArray, b: ReadonlyArray, equalityComparer?: EqualityComparer): boolean; - function indexOfAnyCharCode(text: string, charCodes: ReadonlyArray, start?: number): number; - function countWhere(array: ReadonlyArray, predicate: (x: T, i: number) => boolean): number; - /** - * Filters an array by a predicate function. Returns the same array instance if the predicate is - * true for all elements, otherwise returns a new array instance containing the filtered subset. - */ - function filter(array: T[], f: (x: T) => x is U): U[]; - function filter(array: T[], f: (x: T) => boolean): T[]; - function filter(array: ReadonlyArray, f: (x: T) => x is U): ReadonlyArray; - function filter(array: ReadonlyArray, f: (x: T) => boolean): ReadonlyArray; - function filter(array: T[] | undefined, f: (x: T) => x is U): U[] | undefined; - function filter(array: T[] | undefined, f: (x: T) => boolean): T[] | undefined; - function filter(array: ReadonlyArray | undefined, f: (x: T) => x is U): ReadonlyArray | undefined; - function filter(array: ReadonlyArray | undefined, f: (x: T) => boolean): ReadonlyArray | undefined; - function filterMutate(array: T[], f: (x: T, i: number, array: T[]) => boolean): void; - function clear(array: {}[]): void; - function map(array: ReadonlyArray, f: (x: T, i: number) => U): U[]; - function map(array: ReadonlyArray | undefined, f: (x: T, i: number) => U): U[] | undefined; - function mapIterator(iter: Iterator, mapFn: (x: T) => U): Iterator; - function sameMap(array: T[], f: (x: T, i: number) => T): T[]; - function sameMap(array: ReadonlyArray, f: (x: T, i: number) => T): ReadonlyArray; - function sameMap(array: T[] | undefined, f: (x: T, i: number) => T): T[] | undefined; - function sameMap(array: ReadonlyArray | undefined, f: (x: T, i: number) => T): ReadonlyArray | undefined; - /** - * Flattens an array containing a mix of array or non-array elements. - * - * @param array The array to flatten. - */ - function flatten(array: ReadonlyArray | undefined>): T[]; - function flatten(array: ReadonlyArray | undefined> | undefined): T[] | undefined; - /** - * Maps an array. If the mapped value is an array, it is spread into the result. - * - * @param array The array to map. - * @param mapfn The callback used to map the result into one or more values. - */ - function flatMap(array: ReadonlyArray, mapfn: (x: T, i: number) => U | ReadonlyArray | undefined): U[]; - function flatMap(array: ReadonlyArray | undefined, mapfn: (x: T, i: number) => U | ReadonlyArray | undefined): U[] | undefined; - function flatMapIterator(iter: Iterator, mapfn: (x: T) => ReadonlyArray | Iterator | undefined): Iterator; - /** - * Maps an array. If the mapped value is an array, it is spread into the result. - * Avoids allocation if all elements map to themselves. - * - * @param array The array to map. - * @param mapfn The callback used to map the result into one or more values. - */ - function sameFlatMap(array: T[], mapfn: (x: T, i: number) => T | ReadonlyArray): T[]; - function sameFlatMap(array: ReadonlyArray, mapfn: (x: T, i: number) => T | ReadonlyArray): ReadonlyArray; - function mapAllOrFail(array: ReadonlyArray, mapFn: (x: T, i: number) => U | undefined): U[] | undefined; - function mapDefined(array: ReadonlyArray | undefined, mapFn: (x: T, i: number) => U | undefined): U[]; - function mapDefinedIterator(iter: Iterator, mapFn: (x: T) => U | undefined): Iterator; - const emptyIterator: Iterator; - function singleIterator(value: T): Iterator; - /** - * Maps contiguous spans of values with the same key. - * - * @param array The array to map. - * @param keyfn A callback used to select the key for an element. - * @param mapfn A callback used to map a contiguous chunk of values to a single value. - */ - function spanMap(array: ReadonlyArray, keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[]; - function spanMap(array: ReadonlyArray | undefined, keyfn: (x: T, i: number) => K, mapfn: (chunk: T[], key: K, start: number, end: number) => U): U[] | undefined; - function mapEntries(map: ReadonlyMap, f: (key: string, value: T) => [string, U]): Map; - function mapEntries(map: ReadonlyMap | undefined, f: (key: string, value: T) => [string, U]): Map | undefined; - function some(array: ReadonlyArray | undefined): array is ReadonlyArray; - function some(array: ReadonlyArray | undefined, predicate: (value: T) => boolean): boolean; - /** Calls the callback with (start, afterEnd) index pairs for each range where 'pred' is true. */ - function getRangesWhere(arr: ReadonlyArray, pred: (t: T) => boolean, cb: (start: number, afterEnd: number) => void): void; - function concatenate(array1: T[], array2: T[]): T[]; - function concatenate(array1: ReadonlyArray, array2: ReadonlyArray): ReadonlyArray; - function concatenate(array1: T[] | undefined, array2: T[] | undefined): T[]; - function concatenate(array1: ReadonlyArray | undefined, array2: ReadonlyArray | undefined): ReadonlyArray; - /** - * Deduplicates an unsorted array. - * @param equalityComparer An optional `EqualityComparer` used to determine if two values are duplicates. - * @param comparer An optional `Comparer` used to sort entries before comparison, though the - * result will remain in the original order in `array`. - */ - function deduplicate(array: ReadonlyArray, equalityComparer?: EqualityComparer, comparer?: Comparer): T[]; - function deduplicate(array: ReadonlyArray | undefined, equalityComparer?: EqualityComparer, comparer?: Comparer): T[] | undefined; - function insertSorted(array: SortedArray, insert: T, compare: Comparer): void; - function sortAndDeduplicate(array: ReadonlyArray, comparer: Comparer, equalityComparer?: EqualityComparer): T[]; - function arrayIsEqualTo(array1: ReadonlyArray | undefined, array2: ReadonlyArray | undefined, equalityComparer?: (a: T, b: T) => boolean): boolean; - /** - * Compacts an array, removing any falsey elements. - */ - function compact(array: T[]): T[]; - function compact(array: ReadonlyArray): ReadonlyArray; - /** - * Gets the relative complement of `arrayA` with respect to `arrayB`, returning the elements that - * are not present in `arrayA` but are present in `arrayB`. Assumes both arrays are sorted - * based on the provided comparer. - */ - function relativeComplement(arrayA: T[] | undefined, arrayB: T[] | undefined, comparer: Comparer): T[] | undefined; - function sum, K extends string>(array: ReadonlyArray, prop: K): number; - /** - * Appends a value to an array, returning the array. - * - * @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array - * is created if `value` was appended. - * @param value The value to append to the array. If `value` is `undefined`, nothing is - * appended. - */ - function append(to: T[], value: T | undefined): T[]; - function append(to: T[] | undefined, value: T): T[]; - function append(to: T[] | undefined, value: T | undefined): T[] | undefined; - function append(to: Push, value: T | undefined): void; - /** - * Appends a range of value to an array, returning the array. - * - * @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array - * is created if `value` was appended. - * @param from The values to append to the array. If `from` is `undefined`, nothing is - * appended. If an element of `from` is `undefined`, that element is not appended. - * @param start The offset in `from` at which to start copying values. - * @param end The offset in `from` at which to stop copying values (non-inclusive). - */ - function addRange(to: T[], from: ReadonlyArray | undefined, start?: number, end?: number): T[]; - function addRange(to: T[] | undefined, from: ReadonlyArray | undefined, start?: number, end?: number): T[] | undefined; - /** - * @return Whether the value was added. - */ - function pushIfUnique(array: T[], toAdd: T, equalityComparer?: EqualityComparer): boolean; - /** - * Unlike `pushIfUnique`, this can take `undefined` as an input, and returns a new array. - */ - function appendIfUnique(array: T[] | undefined, toAdd: T, equalityComparer?: EqualityComparer): T[]; - /** - * Returns a new sorted array. - */ - function sort(array: ReadonlyArray, comparer: Comparer): T[]; - function arrayIterator(array: ReadonlyArray): Iterator; - /** - * Stable sort of an array. Elements equal to each other maintain their relative position in the array. - */ - function stableSort(array: ReadonlyArray, comparer: Comparer): T[]; - function rangeEquals(array1: ReadonlyArray, array2: ReadonlyArray, pos: number, end: number): boolean; - /** - * Returns the element at a specific offset in an array if non-empty, `undefined` otherwise. - * A negative offset indicates the element should be retrieved from the end of the array. - */ - function elementAt(array: ReadonlyArray | undefined, offset: number): T | undefined; - /** - * Returns the first element of an array if non-empty, `undefined` otherwise. - */ - function firstOrUndefined(array: ReadonlyArray): T | undefined; - function first(array: ReadonlyArray): T; - /** - * Returns the last element of an array if non-empty, `undefined` otherwise. - */ - function lastOrUndefined(array: ReadonlyArray): T | undefined; - function last(array: ReadonlyArray): T; - /** - * Returns the only element of an array if it contains only one element, `undefined` otherwise. - */ - function singleOrUndefined(array: ReadonlyArray | undefined): T | undefined; - /** - * Returns the only element of an array if it contains only one element; otheriwse, returns the - * array. - */ - function singleOrMany(array: T[]): T | T[]; - function singleOrMany(array: ReadonlyArray): T | ReadonlyArray; - function singleOrMany(array: T[] | undefined): T | T[] | undefined; - function singleOrMany(array: ReadonlyArray | undefined): T | ReadonlyArray | undefined; - function replaceElement(array: ReadonlyArray, index: number, value: T): T[]; - /** - * Performs a binary search, finding the index at which `value` occurs in `array`. - * If no such index is found, returns the 2's-complement of first index at which - * `array[index]` exceeds `value`. - * @param array A sorted array whose first element must be no larger than number - * @param value The value to be searched for in the array. - * @param keySelector A callback used to select the search key from `value` and each element of - * `array`. - * @param keyComparer A callback used to compare two keys in a sorted array. - * @param offset An offset into `array` at which to start the search. - */ - function binarySearch(array: ReadonlyArray, value: T, keySelector: (v: T) => U, keyComparer: Comparer, offset?: number): number; - function reduceLeft(array: ReadonlyArray | undefined, f: (memo: U, value: T, i: number) => U, initial: U, start?: number, count?: number): U; - function reduceLeft(array: ReadonlyArray, f: (memo: T, value: T, i: number) => T): T | undefined; - /** - * Indicates whether a map-like contains an own property with the specified key. - * - * @param map A map-like. - * @param key A property key. - */ - function hasProperty(map: MapLike, key: string): boolean; - /** - * Gets the value of an owned property in a map-like. - * - * @param map A map-like. - * @param key A property key. - */ - function getProperty(map: MapLike, key: string): T | undefined; - /** - * Gets the owned, enumerable property keys of a map-like. - */ - function getOwnKeys(map: MapLike): string[]; - function getOwnValues(sparseArray: T[]): T[]; - /** Shims `Array.from`. */ - function arrayFrom(iterator: Iterator, map: (t: T) => U): U[]; - function arrayFrom(iterator: Iterator): T[]; - function assign(t: T, ...args: (T | undefined)[]): T; - /** - * Performs a shallow equality comparison of the contents of two map-likes. - * - * @param left A map-like whose properties should be compared. - * @param right A map-like whose properties should be compared. - */ - function equalOwnProperties(left: MapLike | undefined, right: MapLike | undefined, equalityComparer?: EqualityComparer): boolean; - /** - * Creates a map from the elements of an array. - * - * @param array the array of input elements. - * @param makeKey a function that produces a key for a given element. - * - * This function makes no effort to avoid collisions; if any two elements produce - * the same key with the given 'makeKey' function, then the element with the higher - * index in the array will be the one associated with the produced key. - */ - function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined): Map; - function arrayToMap(array: ReadonlyArray, makeKey: (value: T) => string | undefined, makeValue: (value: T) => U): Map; - function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number): T[]; - function arrayToNumericMap(array: ReadonlyArray, makeKey: (value: T) => number, makeValue: (value: T) => U): U[]; - function arrayToMultiMap(values: ReadonlyArray, makeKey: (value: T) => string): MultiMap; - function arrayToMultiMap(values: ReadonlyArray, makeKey: (value: T) => string, makeValue: (value: T) => U): MultiMap; - function group(values: ReadonlyArray, getGroupId: (value: T) => string): ReadonlyArray>; - function clone(object: T): T; - function extend(first: T1, second: T2): T1 & T2; - interface MultiMap extends Map { - /** - * Adds the value to an array of values associated with the key, and returns the array. - * Creates the array if it does not already exist. - */ - add(key: string, value: T): T[]; - /** - * Removes a value from an array of values associated with the key. - * Does not preserve the order of those values. - * Does nothing if `key` is not in `map`, or `value` is not in `map[key]`. - */ - remove(key: string, value: T): void; - } - function createMultiMap(): MultiMap; - /** - * Tests whether a value is an array. - */ - function isArray(value: any): value is ReadonlyArray<{}>; - function toArray(value: T | T[]): T[]; - function toArray(value: T | ReadonlyArray): ReadonlyArray; - /** - * Tests whether a value is string - */ - function isString(text: any): text is string; - function tryCast(value: TIn | undefined, test: (value: TIn) => value is TOut): TOut | undefined; - function tryCast(value: T, test: (value: T) => boolean): T | undefined; - function cast(value: TIn | undefined, test: (value: TIn) => value is TOut): TOut; - /** Does nothing. */ - function noop(_?: {} | null | undefined): void; - /** Do nothing and return false */ - function returnFalse(): false; - /** Do nothing and return true */ - function returnTrue(): true; - /** Returns its argument. */ - function identity(x: T): T; - /** Returns lower case string */ - function toLowerCase(x: string): string; - /** Throws an error because a function is not implemented. */ - function notImplemented(): never; - function memoize(callback: () => T): () => T; - /** - * High-order function, creates a function that executes a function composition. - * For example, `chain(a, b)` is the equivalent of `x => ((a', b') => y => b'(a'(y)))(a(x), b(x))` - * - * @param args The functions to chain. - */ - function chain(...args: ((t: T) => (u: U) => U)[]): (t: T) => (u: U) => U; - /** - * High-order function, composes functions. Note that functions are composed inside-out; - * for example, `compose(a, b)` is the equivalent of `x => b(a(x))`. - * - * @param args The functions to compose. - */ - function compose(...args: ((t: T) => T)[]): (t: T) => T; - enum AssertionLevel { - None = 0, - Normal = 1, - Aggressive = 2, - VeryAggressive = 3 - } - /** - * Safer version of `Function` which should not be called. - * Every function should be assignable to this, but this should not be assignable to every function. - */ - type AnyFunction = (...args: never[]) => void; - namespace Debug { - let currentAssertionLevel: AssertionLevel; - let isDebugging: boolean; - function shouldAssert(level: AssertionLevel): boolean; - function assert(expression: boolean, message?: string, verboseDebugInfo?: string | (() => string), stackCrawlMark?: AnyFunction): void; - function assertEqual(a: T, b: T, msg?: string, msg2?: string): void; - function assertLessThan(a: number, b: number, msg?: string): void; - function assertLessThanOrEqual(a: number, b: number): void; - function assertGreaterThanOrEqual(a: number, b: number): void; - function fail(message?: string, stackCrawlMark?: AnyFunction): never; - function assertDefined(value: T | null | undefined, message?: string): T; - function assertEachDefined>(value: A, message?: string): A; - function assertNever(member: never, message?: string, stackCrawlMark?: AnyFunction): never; - function getFunctionName(func: AnyFunction): any; - } - function equateValues(a: T, b: T): boolean; - /** - * Compare the equality of two strings using a case-sensitive ordinal comparison. - * - * Case-sensitive comparisons compare both strings one code-point at a time using the integer - * value of each code-point after applying `toUpperCase` to each string. We always map both - * strings to their upper-case form as some unicode characters do not properly round-trip to - * lowercase (such as `ẞ` (German sharp capital s)). - */ - function equateStringsCaseInsensitive(a: string, b: string): boolean; - /** - * Compare the equality of two strings using a case-sensitive ordinal comparison. - * - * Case-sensitive comparisons compare both strings one code-point at a time using the - * integer value of each code-point. - */ - function equateStringsCaseSensitive(a: string, b: string): boolean; - /** - * Compare two numeric values for their order relative to each other. - * To compare strings, use any of the `compareStrings` functions. - */ - function compareValues(a: number | undefined, b: number | undefined): Comparison; - function min(a: T, b: T, compare: Comparer): T; - /** - * Compare two strings using a case-insensitive ordinal comparison. - * - * Ordinal comparisons are based on the difference between the unicode code points of both - * strings. Characters with multiple unicode representations are considered unequal. Ordinal - * comparisons provide predictable ordering, but place "a" after "B". - * - * Case-insensitive comparisons compare both strings one code-point at a time using the integer - * value of each code-point after applying `toUpperCase` to each string. We always map both - * strings to their upper-case form as some unicode characters do not properly round-trip to - * lowercase (such as `ẞ` (German sharp capital s)). - */ - function compareStringsCaseInsensitive(a: string, b: string): Comparison; - /** - * Compare two strings using a case-sensitive ordinal comparison. - * - * Ordinal comparisons are based on the difference between the unicode code points of both - * strings. Characters with multiple unicode representations are considered unequal. Ordinal - * comparisons provide predictable ordering, but place "a" after "B". - * - * Case-sensitive comparisons compare both strings one code-point at a time using the integer - * value of each code-point. - */ - function compareStringsCaseSensitive(a: string | undefined, b: string | undefined): Comparison; - function getStringComparer(ignoreCase?: boolean): typeof compareStringsCaseInsensitive; - function getUILocale(): string | undefined; - function setUILocale(value: string | undefined): void; - /** - * Compare two strings in a using the case-sensitive sort behavior of the UI locale. - * - * Ordering is not predictable between different host locales, but is best for displaying - * ordered data for UI presentation. Characters with multiple unicode representations may - * be considered equal. - * - * Case-sensitive comparisons compare strings that differ in base characters, or - * accents/diacritic marks, or case as unequal. - */ - function compareStringsCaseSensitiveUI(a: string, b: string): Comparison; - function compareProperties(a: T | undefined, b: T | undefined, key: K, comparer: Comparer): Comparison; - /** True is greater than false. */ - function compareBooleans(a: boolean, b: boolean): Comparison; - /** - * Given a name and a list of names that are *not* equal to the name, return a spelling suggestion if there is one that is close enough. - * Names less than length 3 only check for case-insensitive equality, not Levenshtein distance. - * - * If there is a candidate that's the same except for case, return that. - * If there is a candidate that's within one edit of the name, return that. - * Otherwise, return the candidate with the smallest Levenshtein distance, - * except for candidates: - * * With no name - * * Whose length differs from the target name by more than 0.34 of the length of the name. - * * Whose levenshtein distance is more than 0.4 of the length of the name - * (0.4 allows 1 substitution/transposition for every 5 characters, - * and 1 insertion/deletion at 3 characters) - */ - function getSpellingSuggestion(name: string, candidates: T[], getName: (candidate: T) => string | undefined): T | undefined; - function endsWith(str: string, suffix: string): boolean; - function removeSuffix(str: string, suffix: string): string; - function tryRemoveSuffix(str: string, suffix: string): string | undefined; - function stringContains(str: string, substring: string): boolean; - function fileExtensionIs(path: string, extension: string): boolean; - function fileExtensionIsOneOf(path: string, extensions: ReadonlyArray): boolean; - /** - * Takes a string like "jquery-min.4.2.3" and returns "jquery" - */ - function removeMinAndVersionNumbers(fileName: string): string; - /** Remove an item from an array, moving everything to its right one space left. */ - function orderedRemoveItem(array: T[], item: T): boolean; - /** Remove an item by index from an array, moving everything to its right one space left. */ - function orderedRemoveItemAt(array: T[], index: number): void; - function unorderedRemoveItemAt(array: T[], index: number): void; - /** Remove the *first* occurrence of `item` from the array. */ - function unorderedRemoveItem(array: T[], item: T): boolean; - type GetCanonicalFileName = (fileName: string) => string; - function createGetCanonicalFileName(useCaseSensitiveFileNames: boolean): GetCanonicalFileName; - /** Represents a "prefix*suffix" pattern. */ - interface Pattern { - prefix: string; - suffix: string; - } - function patternText({ prefix, suffix }: Pattern): string; - /** - * Given that candidate matches pattern, returns the text matching the '*'. - * E.g.: matchedText(tryParsePattern("foo*baz"), "foobarbaz") === "bar" - */ - function matchedText(pattern: Pattern, candidate: string): string; - /** Return the object corresponding to the best pattern to match `candidate`. */ - function findBestPatternMatch(values: ReadonlyArray, getPattern: (value: T) => Pattern, candidate: string): T | undefined; - function startsWith(str: string, prefix: string): boolean; - function removePrefix(str: string, prefix: string): string; - function tryRemovePrefix(str: string, prefix: string, getCanonicalFileName?: GetCanonicalFileName): string | undefined; - function and(f: (arg: T) => boolean, g: (arg: T) => boolean): (arg: T) => boolean; - function or(f: (arg: T) => boolean, g: (arg: T) => boolean): (arg: T) => boolean; - function assertTypeIsNever(_: never): void; - function singleElementArray(t: T | undefined): T[] | undefined; - function enumerateInsertsAndDeletes(newItems: ReadonlyArray, oldItems: ReadonlyArray, comparer: (a: T, b: U) => Comparison, inserted: (newItem: T) => void, deleted: (oldItem: U) => void, unchanged?: (oldItem: U, newItem: T) => void): void; -} -declare namespace ts { - /** Gets a timestamp with (at least) ms resolution */ - const timestamp: () => number; -} -/** Performance measurements for the compiler. */ -declare namespace ts.performance { - /** - * Marks a performance event. - * - * @param markName The name of the mark. - */ - function mark(markName: string): void; - /** - * Adds a performance measurement with the specified name. - * - * @param measureName The name of the performance measurement. - * @param startMarkName The name of the starting mark. If not supplied, the point at which the - * profiler was enabled is used. - * @param endMarkName The name of the ending mark. If not supplied, the current timestamp is - * used. - */ - function measure(measureName: string, startMarkName?: string, endMarkName?: string): void; - /** - * Gets the number of times a marker was encountered. - * - * @param markName The name of the mark. - */ - function getCount(markName: string): number; - /** - * Gets the total duration of all measurements with the supplied name. - * - * @param measureName The name of the measure whose durations should be accumulated. - */ - function getDuration(measureName: string): number; - /** - * Iterate over each measure, performing some action - * - * @param cb The action to perform for each measure - */ - function forEachMeasure(cb: (measureName: string, duration: number) => void): void; - /** Enables (and resets) performance measurements for the compiler. */ - function enable(): void; - /** Disables performance measurements for the compiler. */ - function disable(): void; } declare namespace ts { type Path = string & { @@ -916,9 +410,7 @@ declare namespace ts { FirstJSDocNode = 281, LastJSDocNode = 302, FirstJSDocTagNode = 292, - LastJSDocTagNode = 302, - FirstContextualKeyword = 117, - LastContextualKeyword = 145 + LastJSDocTagNode = 302 } enum NodeFlags { None = 0, @@ -941,18 +433,13 @@ declare namespace ts { JavaScriptFile = 65536, ThisNodeOrAnySubNodesHasError = 131072, HasAggregatedChildData = 262144, - PossiblyContainsDynamicImport = 524288, - PossiblyContainsImportMeta = 1048576, JSDoc = 2097152, - Ambient = 4194304, - InWithStatement = 8388608, JsonFile = 16777216, BlockScoped = 3, ReachabilityCheckFlags = 384, ReachabilityAndEmitFlags = 1408, ContextFlags = 12679168, - TypeExcludesFlags = 20480, - PermanentlySetIncrementalFlags = 1572864 + TypeExcludesFlags = 20480 } enum ModifierFlags { None = 0, @@ -983,42 +470,21 @@ declare namespace ts { IntrinsicIndexedElement = 2, IntrinsicElement = 3 } - enum RelationComparisonResult { - Succeeded = 1, - Failed = 2, - FailedAndReported = 3 - } interface Node extends TextRange { kind: SyntaxKind; flags: NodeFlags; - modifierFlagsCache?: ModifierFlags; - transformFlags: TransformFlags; decorators?: NodeArray; modifiers?: ModifiersArray; - id?: number; parent: Node; - original?: Node; - symbol: Symbol; - locals?: SymbolTable; - nextContainer?: Node; - localSymbol?: Symbol; - flowNode?: FlowNode; - emitNode?: EmitNode; - contextualType?: Type; - contextualMapper?: TypeMapper; } interface JSDocContainer { - jsDoc?: JSDoc[]; - jsDocCache?: ReadonlyArray; } type HasJSDoc = ParameterDeclaration | CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | PropertySignature | ArrowFunction | ParenthesizedExpression | SpreadAssignment | ShorthandPropertyAssignment | PropertyAssignment | FunctionExpression | LabeledStatement | ExpressionStatement | VariableStatement | FunctionDeclaration | ConstructorDeclaration | MethodDeclaration | PropertyDeclaration | AccessorDeclaration | ClassLikeDeclaration | InterfaceDeclaration | TypeAliasDeclaration | EnumMember | EnumDeclaration | ModuleDeclaration | ImportEqualsDeclaration | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | EndOfFileToken; type HasType = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertySignature | PropertyDeclaration | TypePredicateNode | ParenthesizedTypeNode | TypeOperatorNode | MappedTypeNode | AssertionExpression | TypeAliasDeclaration | JSDocTypeExpression | JSDocNonNullableType | JSDocNullableType | JSDocOptionalType | JSDocVariadicType; type HasInitializer = HasExpressionInitializer | ForStatement | ForInStatement | ForOfStatement | JsxAttribute; type HasExpressionInitializer = VariableDeclaration | ParameterDeclaration | BindingElement | PropertySignature | PropertyDeclaration | PropertyAssignment | EnumMember; - type MutableNodeArray = NodeArray & T[]; interface NodeArray extends ReadonlyArray, TextRange { hasTrailingComma?: boolean; - transformFlags: TransformFlags; } interface Token extends Node { kind: TKind; @@ -1038,17 +504,6 @@ declare namespace ts { type MinusToken = Token; type Modifier = Token | Token | Token | Token | Token | Token | Token | Token | Token | Token | Token; type ModifiersArray = NodeArray; - enum GeneratedIdentifierFlags { - None = 0, - Auto = 1, - Loop = 2, - Unique = 3, - Node = 4, - KindMask = 7, - ReservedInNestedScopes = 8, - Optimistic = 16, - FileLevel = 32 - } interface Identifier extends PrimaryExpression, Declaration { kind: SyntaxKind.Identifier; /** @@ -1057,23 +512,15 @@ declare namespace ts { */ escapedText: __String; originalKeywordKind?: SyntaxKind; - autoGenerateFlags?: GeneratedIdentifierFlags; - autoGenerateId?: number; isInJSDocNamespace?: boolean; - typeArguments?: NodeArray; - jsdocDotPos?: number; } interface TransientIdentifier extends Identifier { resolvedSymbol: Symbol; } - interface GeneratedIdentifier extends Identifier { - autoGenerateFlags: GeneratedIdentifierFlags; - } interface QualifiedName extends Node { kind: SyntaxKind.QualifiedName; left: EntityName; right: Identifier; - jsdocDotPos?: number; } type EntityName = Identifier | QualifiedName; type PropertyName = Identifier | StringLiteral | NumericLiteral | ComputedPropertyName; @@ -1084,12 +531,6 @@ declare namespace ts { interface NamedDeclaration extends Declaration { name?: DeclarationName; } - interface DynamicNamedDeclaration extends NamedDeclaration { - name: ComputedPropertyName; - } - interface LateBoundDeclaration extends DynamicNamedDeclaration { - name: LateBoundName; - } interface DeclarationStatement extends NamedDeclaration, Statement { name?: Identifier | StringLiteral | NumericLiteral; } @@ -1097,9 +538,6 @@ declare namespace ts { kind: SyntaxKind.ComputedPropertyName; expression: Expression; } - interface LateBoundName extends ComputedPropertyName { - expression: EntityNameExpression; - } interface Decorator extends Node { kind: SyntaxKind.Decorator; parent: NamedDeclaration; @@ -1119,7 +557,6 @@ declare namespace ts { typeParameters?: NodeArray; parameters: NodeArray; type?: TypeNode; - typeArguments?: NodeArray; } type SignatureDeclaration = CallSignatureDeclaration | ConstructSignatureDeclaration | MethodSignature | IndexSignatureDeclaration | FunctionTypeNode | ConstructorTypeNode | JSDocFunctionType | FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction; interface CallSignatureDeclaration extends SignatureDeclarationBase, TypeElement { @@ -1159,7 +596,6 @@ declare namespace ts { name: BindingName; initializer?: Expression; } - type BindingElementGrandparent = BindingElement["parent"]["parent"]; interface PropertySignature extends TypeElement, JSDocContainer { kind: SyntaxKind.PropertySignature; name: PropertyName; @@ -1254,7 +690,6 @@ declare namespace ts { kind: SyntaxKind.Constructor; parent: ClassLikeDeclaration; body?: FunctionBody; - returnFlowNode?: FlowNode; } /** For when we encounter a semicolon in a class declaration. ES6 allows these as class elements. */ interface SemicolonClassElement extends ClassElement { @@ -1290,11 +725,6 @@ declare namespace ts { argument: TypeNode; qualifier?: EntityName; } - type LiteralImportTypeNode = ImportTypeNode & { - argument: LiteralTypeNode & { - literal: StringLiteral; - }; - }; interface ThisTypeNode extends TypeNode { kind: SyntaxKind.ThisType; } @@ -1376,9 +806,6 @@ declare namespace ts { operator: SyntaxKind.KeyOfKeyword | SyntaxKind.UniqueKeyword; type: TypeNode; } - interface UniqueTypeOperatorNode extends TypeOperatorNode { - operator: SyntaxKind.UniqueKeyword; - } interface IndexedAccessTypeNode extends TypeNode { kind: SyntaxKind.IndexedAccessType; objectType: TypeNode; @@ -1397,9 +824,6 @@ declare namespace ts { } interface StringLiteral extends LiteralExpression { kind: SyntaxKind.StringLiteral; - textSourceNode?: Identifier | StringLiteralLike | NumericLiteral; - /** Note: this is only set when synthesizing a node, not during parsing. */ - singleQuote?: boolean; } type StringLiteralLike = StringLiteral | NoSubstitutionTemplateLiteral; interface Expression extends Node { @@ -1562,24 +986,8 @@ declare namespace ts { interface NoSubstitutionTemplateLiteral extends LiteralExpression { kind: SyntaxKind.NoSubstitutionTemplateLiteral; } - enum TokenFlags { - None = 0, - PrecedingLineBreak = 1, - PrecedingJSDocComment = 2, - Unterminated = 4, - ExtendedUnicodeEscape = 8, - Scientific = 16, - Octal = 32, - HexSpecifier = 64, - BinarySpecifier = 128, - OctalSpecifier = 256, - ContainsSeparator = 512, - BinaryOrOctalSpecifier = 384, - NumericLiteralFlags = 1008 - } interface NumericLiteral extends LiteralExpression { kind: SyntaxKind.NumericLiteral; - numericLiteralFlags: TokenFlags; } interface TemplateHead extends LiteralLikeNode { kind: SyntaxKind.TemplateHead; @@ -1612,7 +1020,6 @@ declare namespace ts { interface ArrayLiteralExpression extends PrimaryExpression { kind: SyntaxKind.ArrayLiteralExpression; elements: NodeArray; - multiLine?: boolean; } interface SpreadElement extends Expression { kind: SyntaxKind.SpreadElement; @@ -1630,7 +1037,6 @@ declare namespace ts { } interface ObjectLiteralExpression extends ObjectLiteralExpressionBase { kind: SyntaxKind.ObjectLiteralExpression; - multiLine?: boolean; } type EntityNameExpression = Identifier | PropertyAccessEntityNameExpression; type EntityNameOrEntityNameExpression = EntityName | EntityNameExpression; @@ -1782,12 +1188,6 @@ declare namespace ts { interface NotEmittedStatement extends Statement { kind: SyntaxKind.NotEmittedStatement; } - /** - * Marks the end of transformed declaration to properly emit exports. - */ - interface EndOfDeclarationMarker extends Statement { - kind: SyntaxKind.EndOfDeclarationMarker; - } /** * A list of comma-separated expressions. This node is only created by transformations. */ @@ -1795,12 +1195,6 @@ declare namespace ts { kind: SyntaxKind.CommaListExpression; elements: NodeArray; } - /** - * Marks the beginning of a merged transformed declaration. - */ - interface MergeDeclarationMarker extends Statement { - kind: SyntaxKind.MergeDeclarationMarker; - } interface EmptyStatement extends Statement { kind: SyntaxKind.EmptyStatement; } @@ -1815,7 +1209,6 @@ declare namespace ts { interface Block extends Statement { kind: SyntaxKind.Block; statements: NodeArray; - multiLine?: boolean; } interface VariableStatement extends Statement, JSDocContainer { kind: SyntaxKind.VariableStatement; @@ -1825,9 +1218,6 @@ declare namespace ts { kind: SyntaxKind.ExpressionStatement; expression: Expression; } - interface PrologueDirective extends ExpressionStatement { - expression: StringLiteral; - } interface IfStatement extends Statement { kind: SyntaxKind.IfStatement; expression: Expression; @@ -1985,9 +1375,6 @@ declare namespace ts { } type ModuleName = Identifier | StringLiteral; type ModuleBody = NamespaceBody | JSDocNamespaceBody; - interface AmbientModuleDeclaration extends ModuleDeclaration { - body?: ModuleBlock; - } interface ModuleDeclaration extends DeclarationStatement, JSDocContainer { kind: SyntaxKind.ModuleDeclaration; parent: ModuleBody | SourceFile; @@ -2289,36 +1676,12 @@ declare namespace ts { path: string; name?: string; } - /** - * Subset of properties from SourceFile that are used in multiple utility functions - */ - interface SourceFileLike { - readonly text: string; - lineMap?: ReadonlyArray; - } - interface RedirectInfo { - /** Source file this redirects to. */ - readonly redirectTarget: SourceFile; - /** - * Source file for the duplicate package. This will not be used by the Program, - * but we need to keep this around so we can watch for changes in underlying. - */ - readonly unredirected: SourceFile; - } interface SourceFile extends Declaration { kind: SyntaxKind.SourceFile; statements: NodeArray; endOfFileToken: Token; fileName: string; - path: Path; text: string; - resolvedPath: Path; - /** - * If two source files are for the same version of the same package, one will redirect to the other. - * (See `createRedirectSourceFile` in program.ts.) - * The redirect will have this set. The redirected-to source file will be in `redirectTargetsSet`. - */ - redirectInfo?: RedirectInfo; amdDependencies: ReadonlyArray; moduleName?: string; referencedFiles: ReadonlyArray; @@ -2326,7 +1689,6 @@ declare namespace ts { libReferenceDirectives: ReadonlyArray; languageVariant: LanguageVariant; isDeclarationFile: boolean; - renamedDependencies?: ReadonlyMap; /** * lib.d.ts should have a reference comment like * @@ -2337,49 +1699,11 @@ declare namespace ts { */ hasNoDefaultLib: boolean; languageVersion: ScriptTarget; - scriptKind: ScriptKind; - /** - * The first "most obvious" node that makes a file an external module. - * This is intended to be the first top-level import/export, - * but could be arbitrarily nested (e.g. `import.meta`). - */ - externalModuleIndicator?: Node; - commonJsModuleIndicator?: Node; - identifiers: Map; - nodeCount: number; - identifierCount: number; - symbolCount: number; - parseDiagnostics: DiagnosticWithLocation[]; - bindDiagnostics: DiagnosticWithLocation[]; - bindSuggestionDiagnostics?: DiagnosticWithLocation[]; - jsDocDiagnostics?: DiagnosticWithLocation[]; - additionalSyntacticDiagnostics?: ReadonlyArray; - lineMap: ReadonlyArray; - classifiableNames?: ReadonlyUnderscoreEscapedMap; - resolvedModules?: Map; - resolvedTypeReferenceDirectiveNames: Map; - imports: ReadonlyArray; - /** - * When a file's references are redirected due to project reference directives, - * the original names of the references are stored in this array - */ - redirectedReferences?: ReadonlyArray; - moduleAugmentations: ReadonlyArray; - patternAmbientModules?: PatternAmbientModule[]; - ambientModuleNames: ReadonlyArray; - checkJsDirective?: CheckJsDirective; - version: string; - pragmas: PragmaMap; - localJsxNamespace?: __String; - localJsxFactory?: EntityName; } interface Bundle extends Node { kind: SyntaxKind.Bundle; prepends: ReadonlyArray; sourceFiles: ReadonlyArray; - syntheticFileReferences?: ReadonlyArray; - syntheticTypeReferences?: ReadonlyArray; - hasNoDefaultLib?: boolean; } interface InputFiles extends Node { kind: SyntaxKind.InputFiles; @@ -2451,11 +1775,6 @@ declare namespace ts { * Get a list of files in the program */ getSourceFiles(): ReadonlyArray; - /** - * Get a list of file names that were passed to 'createProgram' or referenced in a - * program source file but could not be located. - */ - getMissingFilePaths(): ReadonlyArray; /** * Emits the JavaScript and declaration files. If targetSourceFile is not specified, then * the JavaScript and declaration files will be produced for all the files in this program. @@ -2474,44 +1793,18 @@ declare namespace ts { getSemanticDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; getDeclarationDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; getConfigFileParsingDiagnostics(): ReadonlyArray; - getSuggestionDiagnostics(sourceFile: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; /** * Gets a type checker that can be used to semantically analyze source files in the program. */ getTypeChecker(): TypeChecker; - getCommonSourceDirectory(): string; - getDiagnosticsProducingTypeChecker(): TypeChecker; - dropDiagnosticsProducingTypeChecker(): void; - getClassifiableNames(): UnderscoreEscapedMap; - getNodeCount(): number; - getIdentifierCount(): number; - getSymbolCount(): number; - getTypeCount(): number; - getFileProcessingDiagnostics(): DiagnosticCollection; - getResolvedTypeReferenceDirectives(): Map; isSourceFileFromExternalLibrary(file: SourceFile): boolean; isSourceFileDefaultLibrary(file: SourceFile): boolean; - structureIsReused?: StructureIsReused; - getSourceFileFromReference(referencingFile: SourceFile, ref: FileReference): SourceFile | undefined; - getLibFileFromReference(ref: FileReference): SourceFile | undefined; - /** Given a source file, get the name of the package it was imported from. */ - sourceFileToPackageName: Map; - /** Set of all source files that some other source file redirects to. */ - redirectTargetsSet: Map; - /** Is the file emitted file */ - isEmittedFile(file: string): boolean; - getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined; getProjectReferences(): (ResolvedProjectReference | undefined)[] | undefined; } interface ResolvedProjectReference { commandLine: ParsedCommandLine; sourceFile: SourceFile; } - enum StructureIsReused { - Not = 0, - SafeModules = 1, - Completely = 2 - } interface CustomTransformers { /** Custom transformers to evaluate before built-in .js transformations. */ before?: TransformerFactory[]; @@ -2556,20 +1849,12 @@ declare namespace ts { /** Contains declaration emit diagnostics */ diagnostics: ReadonlyArray; emittedFiles?: string[]; - sourceMaps?: SourceMapData[]; - } - interface TypeCheckerHost { - getCompilerOptions(): CompilerOptions; - getSourceFiles(): ReadonlyArray; - getSourceFile(fileName: string): SourceFile | undefined; - getResolvedTypeReferenceDirectives(): ReadonlyMap; } interface TypeChecker { getTypeOfSymbolAtLocation(symbol: Symbol, node: Node): Type; getDeclaredTypeOfSymbol(symbol: Symbol): Type; getPropertiesOfType(type: Type): Symbol[]; getPropertyOfType(type: Type, propertyName: string): Symbol | undefined; - getTypeOfPropertyOfType(type: Type, propertyName: string): Type | undefined; getIndexInfoOfType(type: Type, kind: IndexKind): IndexInfo | undefined; getSignaturesOfType(type: Type, kind: SignatureKind): ReadonlyArray; getIndexTypeOfType(type: Type, kind: IndexKind): Type | undefined; @@ -2577,16 +1862,10 @@ declare namespace ts { getBaseTypeOfLiteralType(type: Type): Type; getWidenedType(type: Type): Type; getReturnTypeOfSignature(signature: Signature): Type; - /** - * Gets the type of a parameter at a given position in a signature. - * Returns `any` if the index is not valid. - */ - getParameterType(signature: Signature, parameterIndex: number): Type; getNullableType(type: Type, flags: TypeFlags): Type; getNonNullableType(type: Type): Type; /** Note that the resulting nodes cannot be checked. */ typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): TypeNode | undefined; - typeToTypeNode(type: Type, enclosingDeclaration?: Node, flags?: NodeBuilderFlags, tracker?: SymbolTracker): TypeNode | undefined; /** Note that the resulting nodes cannot be checked. */ signatureToSignatureDeclaration(signature: Signature, kind: SyntaxKind, enclosingDeclaration?: Node, flags?: NodeBuilderFlags): (SignatureDeclaration & { typeArguments?: NodeArray; @@ -2628,17 +1907,10 @@ declare namespace ts { typeToString(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; symbolToString(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): string; typePredicateToString(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags): string; - writeSignature(signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags, kind?: SignatureKind, writer?: EmitTextWriter): string; - writeType(type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags, writer?: EmitTextWriter): string; - writeSymbol(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags, writer?: EmitTextWriter): string; - writeTypePredicate(predicate: TypePredicate, enclosingDeclaration?: Node, flags?: TypeFormatFlags, writer?: EmitTextWriter): string; getFullyQualifiedName(symbol: Symbol): string; getAugmentedPropertiesOfType(type: Type): Symbol[]; getRootSymbols(symbol: Symbol): Symbol[]; getContextualType(node: Expression): Type | undefined; - getContextualTypeForArgumentAtIndex(call: CallLikeExpression, argIndex: number): Type | undefined; - getContextualTypeForJsxAttribute(attribute: JsxAttribute | JsxSpreadAttribute): Type | undefined; - isContextSensitive(node: Expression | MethodDeclaration | ObjectLiteralElementLike | JsxAttributeLike): boolean; /** * returns unknownSignature in the case of an error. * returns undefined if the node is not valid. @@ -2650,96 +1922,19 @@ declare namespace ts { isUndefinedSymbol(symbol: Symbol): boolean; isArgumentsSymbol(symbol: Symbol): boolean; isUnknownSymbol(symbol: Symbol): boolean; - getMergedSymbol(symbol: Symbol): Symbol; getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined; isValidPropertyAccess(node: PropertyAccessExpression | QualifiedName | ImportTypeNode, propertyName: string): boolean; - /** Exclude accesses to private properties or methods with a `this` parameter that `type` doesn't satisfy. */ - isValidPropertyAccessForCompletions(node: PropertyAccessExpression | ImportTypeNode, type: Type, property: Symbol): boolean; /** Follow all aliases to get the original symbol. */ getAliasedSymbol(symbol: Symbol): Symbol; - /** Follow a *single* alias to get the immediately aliased symbol. */ - getImmediateAliasedSymbol(symbol: Symbol): Symbol | undefined; getExportsOfModule(moduleSymbol: Symbol): Symbol[]; - /** Unlike `getExportsOfModule`, this includes properties of an `export =` value. */ - getExportsAndPropertiesOfModule(moduleSymbol: Symbol): Symbol[]; getAllAttributesTypeFromJsxOpeningLikeElement(elementNode: JsxOpeningLikeElement): Type | undefined; getJsxIntrinsicTagNamesAt(location: Node): Symbol[]; isOptionalParameter(node: ParameterDeclaration): boolean; getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; - /** - * Unlike `tryGetMemberInModuleExports`, this includes properties of an `export =` value. - * Does *not* return properties of primitive types. - */ - tryGetMemberInModuleExportsAndProperties(memberName: string, moduleSymbol: Symbol): Symbol | undefined; getApparentType(type: Type): Type; - getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined; - getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; - getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; - getAnyType(): Type; - getStringType(): Type; - getNumberType(): Type; - getBooleanType(): Type; - getFalseType(): Type; - getTrueType(): Type; - getVoidType(): Type; - getUndefinedType(): Type; - getNullType(): Type; - getESSymbolType(): Type; - getNeverType(): Type; - getUnionType(types: Type[], subtypeReduction?: UnionReduction): Type; - createArrayType(elementType: Type): Type; - createPromiseType(type: Type): Type; - createAnonymousType(symbol: Symbol, members: SymbolTable, callSignatures: Signature[], constructSignatures: Signature[], stringIndexInfo: IndexInfo | undefined, numberIndexInfo: IndexInfo | undefined): Type; - createSignature(declaration: SignatureDeclaration, typeParameters: TypeParameter[] | undefined, thisParameter: Symbol | undefined, parameters: Symbol[], resolvedReturnType: Type, typePredicate: TypePredicate | undefined, minArgumentCount: number, hasRestParameter: boolean, hasLiteralTypes: boolean): Signature; - createSymbol(flags: SymbolFlags, name: __String): TransientSymbol; - createIndexInfo(type: Type, isReadonly: boolean, declaration?: SignatureDeclaration): IndexInfo; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult; - tryFindAmbientModuleWithoutAugmentations(moduleName: string): Symbol | undefined; - getSymbolWalker(accept?: (symbol: Symbol) => boolean): SymbolWalker; - getDiagnostics(sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; - getGlobalDiagnostics(): Diagnostic[]; - getEmitResolver(sourceFile?: SourceFile, cancellationToken?: CancellationToken): EmitResolver; - getNodeCount(): number; - getIdentifierCount(): number; - getSymbolCount(): number; - getTypeCount(): number; - isArrayLikeType(type: Type): boolean; - /** - * True if `contextualType` should not be considered for completions because - * e.g. it specifies `kind: "a"` and obj has `kind: "b"`. - */ - isTypeInvalidDueToUnionDiscriminant(contextualType: Type, obj: ObjectLiteralExpression): boolean; - /** - * For a union, will include a property if it's defined in *any* of the member types. - * So for `{ a } | { b }`, this will include both `a` and `b`. - * Does not include properties of primitive types. - */ - getAllPossiblePropertiesOfTypes(type: ReadonlyArray): Symbol[]; - resolveName(name: string, location: Node, meaning: SymbolFlags, excludeGlobals: boolean): Symbol | undefined; - getJsxNamespace(location?: Node): string; - /** - * Note that this will return undefined in the following case: - * // a.ts - * export namespace N { export class C { } } - * // b.ts - * <> - * Where `C` is the symbol we're looking for. - * This should be called in a loop climbing parents of the symbol, so we'll get `N`. - */ - getAccessibleSymbolChain(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags, useOnlyExternalAliasing: boolean): Symbol[] | undefined; - getTypePredicateOfSignature(signature: Signature): TypePredicate; - resolveExternalModuleSymbol(symbol: Symbol): Symbol; - /** @param node A location where we might consider accessing `this`. Not necessarily a ThisExpression. */ - tryGetThisTypeAt(node: Node): Type | undefined; - getTypeArgumentConstraint(node: TypeNode): Type | undefined; - /** - * Does *not* get *all* suggestion diagnostics, just the ones that were convenient to report in the checker. - * Others are added in computeSuggestionDiagnostics. - */ - getSuggestionDiagnostics(file: SourceFile, cancellationToken?: CancellationToken): ReadonlyArray; /** * Depending on the operation performed, it may be appropriate to throw away the checker * if the cancellation token is triggered. Typically, if it is used for error checking @@ -2747,11 +1942,6 @@ declare namespace ts { */ runWithCancellationToken(token: CancellationToken, cb: (checker: TypeChecker) => T): T; } - enum UnionReduction { - None = 0, - Literal = 1, - Subtype = 2 - } enum NodeBuilderFlags { None = 0, NoTruncation = 1, @@ -2812,41 +2002,6 @@ declare namespace ts { AllowAnyNodeKind = 4, UseAliasDefinedOutsideCurrentScope = 8 } - interface SymbolWalker { - /** Note: Return values are not ordered. */ - walkType(root: Type): { - visitedTypes: ReadonlyArray; - visitedSymbols: ReadonlyArray; - }; - /** Note: Return values are not ordered. */ - walkSymbol(root: Symbol): { - visitedTypes: ReadonlyArray; - visitedSymbols: ReadonlyArray; - }; - } - interface SymbolWriter extends SymbolTracker { - writeKeyword(text: string): void; - writeOperator(text: string): void; - writePunctuation(text: string): void; - writeSpace(text: string): void; - writeStringLiteral(text: string): void; - writeParameter(text: string): void; - writeProperty(text: string): void; - writeSymbol(text: string, symbol: Symbol): void; - writeLine(): void; - increaseIndent(): void; - decreaseIndent(): void; - clear(): void; - } - enum SymbolAccessibility { - Accessible = 0, - NotAccessible = 1, - CannotBeNamed = 2 - } - enum SyntheticSymbolKind { - UnionOrIntersection = 0, - Spread = 1 - } enum TypePredicateKind { This = 0, Identifier = 1 @@ -2864,88 +2019,6 @@ declare namespace ts { parameterIndex: number; } type TypePredicate = IdentifierTypePredicate | ThisTypePredicate; - type AnyImportSyntax = ImportDeclaration | ImportEqualsDeclaration; - type AnyImportOrReExport = AnyImportSyntax | ExportDeclaration; - interface ValidImportTypeNode extends ImportTypeNode { - argument: LiteralTypeNode & { - literal: StringLiteral; - }; - } - type AnyValidImportOrReExport = (ImportDeclaration | ExportDeclaration) & { - moduleSpecifier: StringLiteral; - } | ImportEqualsDeclaration & { - moduleReference: ExternalModuleReference & { - expression: StringLiteral; - }; - } | RequireOrImportCall | ValidImportTypeNode; - type RequireOrImportCall = CallExpression & { - arguments: [StringLiteralLike]; - }; - type LateVisibilityPaintedStatement = AnyImportSyntax | VariableStatement | ClassDeclaration | FunctionDeclaration | ModuleDeclaration | TypeAliasDeclaration | InterfaceDeclaration | EnumDeclaration; - interface SymbolVisibilityResult { - accessibility: SymbolAccessibility; - aliasesToMakeVisible?: LateVisibilityPaintedStatement[]; - errorSymbolName?: string; - errorNode?: Node; - } - interface SymbolAccessibilityResult extends SymbolVisibilityResult { - errorModuleName?: string; - } - interface AllAccessorDeclarations { - firstAccessor: AccessorDeclaration; - secondAccessor: AccessorDeclaration | undefined; - getAccessor: AccessorDeclaration | undefined; - setAccessor: AccessorDeclaration | undefined; - } - /** Indicates how to serialize the name for a TypeReferenceNode when emitting decorator metadata */ - enum TypeReferenceSerializationKind { - Unknown = 0, - TypeWithConstructSignatureAndValue = 1, - VoidNullableOrNeverType = 2, - NumberLikeType = 3, - StringLikeType = 4, - BooleanType = 5, - ArrayLikeType = 6, - ESSymbolType = 7, - Promise = 8, - TypeWithCallSignature = 9, - ObjectType = 10 - } - interface EmitResolver { - hasGlobalName(name: string): boolean; - getReferencedExportContainer(node: Identifier, prefixLocals?: boolean): SourceFile | ModuleDeclaration | EnumDeclaration | undefined; - getReferencedImportDeclaration(node: Identifier): Declaration | undefined; - getReferencedDeclarationWithCollidingName(node: Identifier): Declaration | undefined; - isDeclarationWithCollidingName(node: Declaration): boolean; - isValueAliasDeclaration(node: Node): boolean; - isReferencedAliasDeclaration(node: Node, checkChildren?: boolean): boolean; - isTopLevelValueImportEqualsWithEntityName(node: ImportEqualsDeclaration): boolean; - getNodeCheckFlags(node: Node): NodeCheckFlags; - isDeclarationVisible(node: Declaration | AnyImportSyntax): boolean; - isLateBound(node: Declaration): node is LateBoundDeclaration; - collectLinkedAliases(node: Identifier, setVisibility?: boolean): Node[] | undefined; - isImplementationOfOverload(node: FunctionLike): boolean | undefined; - isRequiredInitializedParameter(node: ParameterDeclaration): boolean; - isOptionalUninitializedParameterProperty(node: ParameterDeclaration): boolean; - createTypeOfDeclaration(declaration: AccessorDeclaration | VariableLikeDeclaration, enclosingDeclaration: Node, flags: NodeBuilderFlags, tracker: SymbolTracker, addUndefined?: boolean): TypeNode | undefined; - createReturnTypeOfSignatureDeclaration(signatureDeclaration: SignatureDeclaration, enclosingDeclaration: Node, flags: NodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined; - createTypeOfExpression(expr: Expression, enclosingDeclaration: Node, flags: NodeBuilderFlags, tracker: SymbolTracker): TypeNode | undefined; - createLiteralConstValue(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): Expression; - isSymbolAccessible(symbol: Symbol, enclosingDeclaration: Node | undefined, meaning: SymbolFlags | undefined, shouldComputeAliasToMarkVisible: boolean): SymbolAccessibilityResult; - isEntityNameVisible(entityName: EntityNameOrEntityNameExpression, enclosingDeclaration: Node): SymbolVisibilityResult; - getConstantValue(node: EnumMember | PropertyAccessExpression | ElementAccessExpression): string | number | undefined; - getReferencedValueDeclaration(reference: Identifier): Declaration | undefined; - getTypeReferenceSerializationKind(typeName: EntityName, location?: Node): TypeReferenceSerializationKind; - isOptionalParameter(node: ParameterDeclaration): boolean; - moduleExportsSomeValue(moduleReferenceExpression: Expression): boolean; - isArgumentsLocalBinding(node: Identifier): boolean; - getExternalModuleFileFromDeclaration(declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration | ImportTypeNode): SourceFile | undefined; - getTypeReferenceDirectivesForEntityName(name: EntityNameOrEntityNameExpression): string[] | undefined; - getTypeReferenceDirectivesForSymbol(symbol: Symbol, meaning?: SymbolFlags): string[] | undefined; - isLiteralConstDeclaration(node: VariableDeclaration | PropertyDeclaration | PropertySignature | ParameterDeclaration): boolean; - getJsxFactoryEntity(location?: Node): EntityName | undefined; - getAllAccessorDeclarations(declaration: AccessorDeclaration): AllAccessorDeclarations; - } enum SymbolFlags { None = 0, FunctionScopedVariable = 1, @@ -2975,7 +2048,6 @@ declare namespace ts { Optional = 16777216, Transient = 33554432, JSContainer = 67108864, - All = 67108863, Enum = 384, Variable = 3, Value = 67216319, @@ -3007,9 +2079,7 @@ declare namespace ts { HasMembers = 6240, BlockScoped = 418, PropertyOrAccessor = 98308, - ClassMember = 106500, - Classifiable = 2885600, - LateBindingContainer = 6240 + ClassMember = 106500 } interface Symbol { flags: SymbolFlags; @@ -3019,72 +2089,6 @@ declare namespace ts { members?: SymbolTable; exports?: SymbolTable; globalExports?: SymbolTable; - id?: number; - mergeId?: number; - parent?: Symbol; - exportSymbol?: Symbol; - nameType?: Type; - constEnumOnlyModule?: boolean; - isReferenced?: SymbolFlags; - isReplaceableByMethod?: boolean; - isAssigned?: boolean; - } - interface SymbolLinks { - immediateTarget?: Symbol; - target?: Symbol; - type?: Type; - uniqueESSymbolType?: Type; - declaredType?: Type; - typeParameters?: TypeParameter[]; - outerTypeParameters?: TypeParameter[]; - inferredClassType?: Type; - instantiations?: Map; - mapper?: TypeMapper; - referenced?: boolean; - containingType?: UnionOrIntersectionType; - leftSpread?: Symbol; - rightSpread?: Symbol; - syntheticOrigin?: Symbol; - isDiscriminantProperty?: boolean; - resolvedExports?: SymbolTable; - resolvedMembers?: SymbolTable; - exportsChecked?: boolean; - typeParametersChecked?: boolean; - isDeclarationWithCollidingName?: boolean; - bindingElement?: BindingElement; - exportsSomeValue?: boolean; - enumKind?: EnumKind; - originatingImport?: ImportDeclaration | ImportCall; - lateSymbol?: Symbol; - specifierCache?: Map; - } - enum EnumKind { - Numeric = 0, - Literal = 1 - } - enum CheckFlags { - Instantiated = 1, - SyntheticProperty = 2, - SyntheticMethod = 4, - Readonly = 8, - Partial = 16, - HasNonUniformType = 32, - ContainsPublic = 64, - ContainsProtected = 128, - ContainsPrivate = 256, - ContainsStatic = 512, - Late = 1024, - ReverseMapped = 2048, - OptionalParameter = 4096, - RestParameter = 8192, - Synthetic = 6 - } - interface TransientSymbol extends Symbol, SymbolLinks { - checkFlags: CheckFlags; - } - interface ReverseMappedSymbol extends TransientSymbol { - propertyType: Type; - mappedType: MappedType; } enum InternalSymbolName { Call = "__call", @@ -3135,54 +2139,6 @@ declare namespace ts { } /** SymbolTable based on ES6 Map interface. */ type SymbolTable = UnderscoreEscapedMap; - /** Used to track a `declare module "foo*"`-like declaration. */ - interface PatternAmbientModule { - pattern: Pattern; - symbol: Symbol; - } - enum NodeCheckFlags { - TypeChecked = 1, - LexicalThis = 2, - CaptureThis = 4, - CaptureNewTarget = 8, - SuperInstance = 256, - SuperStatic = 512, - ContextChecked = 1024, - AsyncMethodWithSuper = 2048, - AsyncMethodWithSuperBinding = 4096, - CaptureArguments = 8192, - EnumValuesComputed = 16384, - LexicalModuleMergesWithClass = 32768, - LoopWithCapturedBlockScopedBinding = 65536, - CapturedBlockScopedBinding = 131072, - BlockScopedBindingInLoop = 262144, - ClassWithBodyScopedClassBinding = 524288, - BodyScopedClassBinding = 1048576, - NeedsLoopOutParameter = 2097152, - AssignmentsMarked = 4194304, - ClassWithConstructorReference = 8388608, - ConstructorReferenceInClass = 16777216 - } - interface NodeLinks { - flags: NodeCheckFlags; - resolvedType?: Type; - resolvedSignature?: Signature; - resolvedSignatures?: Map; - resolvedSymbol?: Symbol; - resolvedIndexInfo?: IndexInfo; - maybeTypePredicate?: boolean; - enumMemberValue?: string | number; - isVisible?: boolean; - containsArgumentsReference?: boolean; - hasReportedStatementInAmbientContext?: boolean; - jsxFlags: JsxFlags; - resolvedJsxElementAttributesType?: Type; - resolvedJsxElementAllAttributesType?: Type; - hasSuperCall?: boolean; - superCall?: SuperCall; - switchTypes?: Type[]; - jsxNamespace?: Symbol | false; - } enum TypeFlags { Any = 1, Unknown = 2, @@ -3209,28 +2165,16 @@ declare namespace ts { Conditional = 4194304, Substitution = 8388608, NonPrimitive = 16777216, - FreshLiteral = 33554432, - UnionOfUnitTypes = 67108864, - ContainsWideningType = 134217728, - ContainsObjectLiteral = 268435456, - ContainsAnyFunctionType = 536870912, - AnyOrUnknown = 3, - Nullable = 24576, Literal = 448, Unit = 27072, StringOrNumberLiteral = 192, - StringOrNumberLiteralOrUnique = 2240, - DefinitelyFalsy = 29120, PossiblyFalsy = 29148, - Intrinsic = 16839967, - Primitive = 32764, StringLike = 68, NumberLike = 168, BooleanLike = 272, EnumLike = 544, ESSymbolLike = 3072, VoidLike = 12288, - DisjointDomains = 16809468, UnionOrIntersection = 786432, StructuredType = 917504, TypeVariable = 2162688, @@ -3239,30 +2183,15 @@ declare namespace ts { Instantiable = 15794176, StructuredOrInstantiable = 16711680, Narrowable = 33492479, - NotUnionOrUnit = 16909315, - NotUnit = 16749629, - RequiresWidening = 402653184, - PropagatingFlags = 939524096, - NonWideningType = 134217728, - Wildcard = 268435456, - EmptyObject = 536870912, - ConstructionFlags = 939524096, - GenericMappedType = 134217728 + NotUnionOrUnit = 16909315 } type DestructuringPattern = BindingPattern | ObjectLiteralExpression | ArrayLiteralExpression; interface Type { flags: TypeFlags; - id: number; - checker: TypeChecker; symbol: Symbol; pattern?: DestructuringPattern; aliasSymbol?: Symbol; aliasTypeArguments?: ReadonlyArray; - wildcardInstantiation?: Type; - immediateBaseConstraint?: Type; - } - interface IntrinsicType extends Type { - intrinsicName: string; } interface LiteralType extends Type { value: string | number; @@ -3299,12 +2228,6 @@ declare namespace ts { } interface ObjectType extends Type { objectFlags: ObjectFlags; - members?: SymbolTable; - properties?: Symbol[]; - callSignatures?: ReadonlyArray; - constructSignatures?: ReadonlyArray; - stringIndexInfo?: IndexInfo; - numberIndexInfo?: IndexInfo; } /** Class and interface types (ObjectFlags.Class and ObjectFlags.Interface). */ interface InterfaceType extends ObjectType { @@ -3312,8 +2235,6 @@ declare namespace ts { outerTypeParameters: TypeParameter[] | undefined; localTypeParameters: TypeParameter[] | undefined; thisType: TypeParameter | undefined; - resolvedBaseConstructorType?: Type; - resolvedBaseTypes: BaseType[]; } type BaseType = ObjectType | IntersectionType; interface InterfaceTypeWithDeclaredMembers extends InterfaceType { @@ -3337,16 +2258,7 @@ declare namespace ts { target: GenericType; typeArguments?: ReadonlyArray; } - enum Variance { - Invariant = 0, - Covariant = 1, - Contravariant = 2, - Bivariant = 3, - Independent = 4 - } interface GenericType extends InterfaceType, TypeReference { - instantiations: Map; - variances?: Variance[]; } interface TupleType extends GenericType { minLength: number; @@ -3358,74 +2270,19 @@ declare namespace ts { } interface UnionOrIntersectionType extends Type { types: Type[]; - propertyCache: SymbolTable; - resolvedProperties: Symbol[]; - resolvedIndexType: IndexType; - resolvedStringIndexType: IndexType; - resolvedBaseConstraint: Type; - couldContainTypeVariables: boolean; } interface UnionType extends UnionOrIntersectionType { } interface IntersectionType extends UnionOrIntersectionType { - resolvedApparentType: Type; } type StructuredType = ObjectType | UnionType | IntersectionType; - interface AnonymousType extends ObjectType { - target?: AnonymousType; - mapper?: TypeMapper; - } - interface MappedType extends AnonymousType { - declaration: MappedTypeNode; - typeParameter?: TypeParameter; - constraintType?: Type; - templateType?: Type; - modifiersType?: Type; - } interface EvolvingArrayType extends ObjectType { elementType: Type; finalArrayType?: Type; } - interface ReverseMappedType extends ObjectType { - source: Type; - mappedType: MappedType; - } - interface ResolvedType extends ObjectType, UnionOrIntersectionType { - members: SymbolTable; - properties: Symbol[]; - callSignatures: ReadonlyArray; - constructSignatures: ReadonlyArray; - } - interface FreshObjectLiteralType extends ResolvedType { - regularType: ResolvedType; - } - interface IterableOrIteratorType extends ObjectType, UnionType { - iteratedTypeOfIterable?: Type; - iteratedTypeOfIterator?: Type; - iteratedTypeOfAsyncIterable?: Type; - iteratedTypeOfAsyncIterator?: Type; - } - interface PromiseOrAwaitableType extends ObjectType, UnionType { - promiseTypeOfPromiseConstructor?: Type; - promisedTypeOfPromise?: Type; - awaitedTypeOfType?: Type; - } - interface SyntheticDefaultModuleType extends Type { - syntheticType?: Type; - } interface InstantiableType extends Type { - resolvedBaseConstraint?: Type; - resolvedIndexType?: IndexType; - resolvedStringIndexType?: IndexType; } interface TypeParameter extends InstantiableType { - /** Retrieve using getConstraintFromTypeParameter */ - constraint?: Type; - default?: Type; - target?: TypeParameter; - mapper?: TypeMapper; - isThisType?: boolean; - resolvedDefaultType?: Type; } interface IndexedAccessType extends InstantiableType { objectType: Type; @@ -3436,7 +2293,6 @@ declare namespace ts { type TypeVariable = TypeParameter | IndexedAccessType; interface IndexType extends InstantiableType { type: InstantiableType | UnionOrIntersectionType; - stringsOnly: boolean; } interface ConditionalRoot { node: ConditionalTypeNode; @@ -3457,9 +2313,6 @@ declare namespace ts { extendsType: Type; resolvedTrueType?: Type; resolvedFalseType?: Type; - resolvedDefaultConstraint?: Type; - mapper?: TypeMapper; - combinedMapper?: TypeMapper; } interface SubstitutionType extends InstantiableType { typeVariable: TypeVariable; @@ -3473,19 +2326,6 @@ declare namespace ts { declaration?: SignatureDeclaration | JSDocSignature; typeParameters?: ReadonlyArray; parameters: ReadonlyArray; - thisParameter?: Symbol; - resolvedReturnType?: Type; - resolvedTypePredicate?: TypePredicate; - minArgumentCount: number; - hasRestParameter: boolean; - hasLiteralTypes: boolean; - target?: Signature; - mapper?: TypeMapper; - unionSignatures?: Signature[]; - erasedSignatureCache?: Signature; - canonicalSignatureCache?: Signature; - isolatedSignatureType?: ObjectType; - instantiations?: Map; } enum IndexKind { String = 0, @@ -3496,7 +2336,6 @@ declare namespace ts { isReadonly: boolean; declaration?: IndexSignatureDeclaration; } - type TypeMapper = (t: TypeParameter) => Type; enum InferencePriority { NakedTypeVariable = 1, HomomorphicMappedType = 2, @@ -3507,58 +2346,6 @@ declare namespace ts { AlwaysStrict = 64, PriorityImpliesCombination = 28 } - interface InferenceInfo { - typeParameter: TypeParameter; - candidates: Type[] | undefined; - contraCandidates: Type[] | undefined; - inferredType?: Type; - priority?: InferencePriority; - topLevel: boolean; - isFixed: boolean; - } - enum InferenceFlags { - None = 0, - InferUnionTypes = 1, - NoDefault = 2, - AnyDefault = 4 - } - /** - * Ternary values are defined such that - * x & y is False if either x or y is False. - * x & y is Maybe if either x or y is Maybe, but neither x or y is False. - * x & y is True if both x and y are True. - * x | y is False if both x and y are False. - * x | y is Maybe if either x or y is Maybe, but neither x or y is True. - * x | y is True if either x or y is True. - */ - enum Ternary { - False = 0, - Maybe = 1, - True = -1 - } - type TypeComparer = (s: Type, t: Type, reportErrors?: boolean) => Ternary; - interface InferenceContext extends TypeMapper { - typeParameters: ReadonlyArray; - signature?: Signature; - inferences: InferenceInfo[]; - flags: InferenceFlags; - compareTypes: TypeComparer; - } - interface WideningContext { - parent?: WideningContext; - propertyName?: __String; - siblings?: Type[]; - resolvedProperties?: Symbol[]; - } - enum SpecialPropertyAssignmentKind { - None = 0, - ExportsProperty = 1, - ModuleExports = 2, - PrototypeProperty = 3, - ThisProperty = 4, - Property = 5, - Prototype = 6 - } /** @deprecated Use FileExtensionInfo instead. */ type JsFileExtensionInfo = FileExtensionInfo; interface FileExtensionInfo { @@ -3610,9 +2397,6 @@ declare namespace ts { Suggestion = 2, Message = 3 } - function diagnosticCategoryName(d: { - category: DiagnosticCategory; - }, lowerCase?: boolean): string; enum ModuleResolutionKind { Classic = 1, NodeJs = 2 @@ -3632,44 +2416,31 @@ declare namespace ts { } type CompilerOptionsValue = string | number | boolean | (string | number)[] | string[] | MapLike | PluginImport[] | ProjectReference[] | null | undefined; interface CompilerOptions { - all?: boolean; allowJs?: boolean; - allowNonTsExtensions?: boolean; allowSyntheticDefaultImports?: boolean; allowUnreachableCode?: boolean; allowUnusedLabels?: boolean; alwaysStrict?: boolean; baseUrl?: string; - /** An error if set - this should only go through the -b pipeline and not actually be observed */ - build?: boolean; charset?: string; checkJs?: boolean; - configFilePath?: string; - /** configFile is set as non enumerable property so as to avoid checking of json source files */ - readonly configFile?: TsConfigSourceFile; declaration?: boolean; declarationMap?: boolean; emitDeclarationOnly?: boolean; declarationDir?: string; - diagnostics?: boolean; - extendedDiagnostics?: boolean; disableSizeLimit?: boolean; downlevelIteration?: boolean; emitBOM?: boolean; emitDecoratorMetadata?: boolean; experimentalDecorators?: boolean; forceConsistentCasingInFileNames?: boolean; - help?: boolean; importHelpers?: boolean; - init?: boolean; inlineSourceMap?: boolean; inlineSources?: boolean; isolatedModules?: boolean; jsx?: JsxEmit; keyofStringsOnly?: boolean; lib?: string[]; - listEmittedFiles?: boolean; - listFiles?: boolean; locale?: string; mapRoot?: string; maxNodeModuleJsDepth?: number; @@ -3677,7 +2448,6 @@ declare namespace ts { moduleResolution?: ModuleResolutionKind; newLine?: NewLineKind; noEmit?: boolean; - noEmitForJsFiles?: boolean; noEmitHelpers?: boolean; noEmitOnError?: boolean; noErrorTruncation?: boolean; @@ -3695,12 +2465,9 @@ declare namespace ts { outDir?: string; outFile?: string; paths?: MapLike; - plugins?: PluginImport[]; preserveConstEnums?: boolean; preserveSymlinks?: boolean; - preserveWatchOutput?: boolean; project?: string; - pretty?: boolean; reactNamespace?: string; jsxFactory?: string; composite?: boolean; @@ -3715,18 +2482,14 @@ declare namespace ts { strictFunctionTypes?: boolean; strictNullChecks?: boolean; strictPropertyInitialization?: boolean; - stripInternal?: boolean; suppressExcessPropertyErrors?: boolean; suppressImplicitAnyIndexErrors?: boolean; - suppressOutputPathCheck?: boolean; target?: ScriptTarget; traceResolution?: boolean; resolveJsonModule?: boolean; types?: string[]; /** Paths used to compute primary types search locations */ typeRoots?: string[]; - version?: boolean; - watch?: boolean; esModuleInterop?: boolean; [option: string]: CompilerOptionsValue | TsConfigSourceFile | undefined; } @@ -3800,32 +2563,15 @@ declare namespace ts { errors: Diagnostic[]; wildcardDirectories?: MapLike; compileOnSave?: boolean; - configFileSpecs?: ConfigFileSpecs; } enum WatchDirectoryFlags { None = 0, Recursive = 1 } - interface ConfigFileSpecs { - filesSpecs: ReadonlyArray | undefined; - referencesSpecs: ReadonlyArray | undefined; - /** - * Present to report errors (user specified specs), validatedIncludeSpecs are used for file name matching - */ - includeSpecs?: ReadonlyArray; - /** - * Present to report errors (user specified specs), validatedExcludeSpecs are used for file name matching - */ - excludeSpecs?: ReadonlyArray; - validatedIncludeSpecs?: ReadonlyArray; - validatedExcludeSpecs?: ReadonlyArray; - wildcardDirectories: MapLike; - } interface ExpandResult { fileNames: string[]; projectReferences: ReadonlyArray | undefined; wildcardDirectories: MapLike; - spec: ConfigFileSpecs; } interface CreateProgramOptions { rootNames: ReadonlyArray; @@ -3835,160 +2581,6 @@ declare namespace ts { oldProgram?: Program; configFileParsingDiagnostics?: ReadonlyArray; } - interface CommandLineOptionBase { - name: string; - type: "string" | "number" | "boolean" | "object" | "list" | Map; - isFilePath?: boolean; - shortName?: string; - description?: DiagnosticMessage; - paramType?: DiagnosticMessage; - isTSConfigOnly?: boolean; - isCommandLineOnly?: boolean; - showInSimplifiedHelpView?: boolean; - category?: DiagnosticMessage; - } - interface CommandLineOptionOfPrimitiveType extends CommandLineOptionBase { - type: "string" | "number" | "boolean"; - } - interface CommandLineOptionOfCustomType extends CommandLineOptionBase { - type: Map; - } - interface TsConfigOnlyOption extends CommandLineOptionBase { - type: "object"; - elementOptions?: Map; - extraKeyDiagnosticMessage?: DiagnosticMessage; - } - interface CommandLineOptionOfListType extends CommandLineOptionBase { - type: "list"; - element: CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType | TsConfigOnlyOption; - } - type CommandLineOption = CommandLineOptionOfCustomType | CommandLineOptionOfPrimitiveType | TsConfigOnlyOption | CommandLineOptionOfListType; - enum CharacterCodes { - nullCharacter = 0, - maxAsciiCharacter = 127, - lineFeed = 10, - carriageReturn = 13, - lineSeparator = 8232, - paragraphSeparator = 8233, - nextLine = 133, - space = 32, - nonBreakingSpace = 160, - enQuad = 8192, - emQuad = 8193, - enSpace = 8194, - emSpace = 8195, - threePerEmSpace = 8196, - fourPerEmSpace = 8197, - sixPerEmSpace = 8198, - figureSpace = 8199, - punctuationSpace = 8200, - thinSpace = 8201, - hairSpace = 8202, - zeroWidthSpace = 8203, - narrowNoBreakSpace = 8239, - ideographicSpace = 12288, - mathematicalSpace = 8287, - ogham = 5760, - _ = 95, - $ = 36, - _0 = 48, - _1 = 49, - _2 = 50, - _3 = 51, - _4 = 52, - _5 = 53, - _6 = 54, - _7 = 55, - _8 = 56, - _9 = 57, - a = 97, - b = 98, - c = 99, - d = 100, - e = 101, - f = 102, - g = 103, - h = 104, - i = 105, - j = 106, - k = 107, - l = 108, - m = 109, - n = 110, - o = 111, - p = 112, - q = 113, - r = 114, - s = 115, - t = 116, - u = 117, - v = 118, - w = 119, - x = 120, - y = 121, - z = 122, - A = 65, - B = 66, - C = 67, - D = 68, - E = 69, - F = 70, - G = 71, - H = 72, - I = 73, - J = 74, - K = 75, - L = 76, - M = 77, - N = 78, - O = 79, - P = 80, - Q = 81, - R = 82, - S = 83, - T = 84, - U = 85, - V = 86, - W = 87, - X = 88, - Y = 89, - Z = 90, - ampersand = 38, - asterisk = 42, - at = 64, - backslash = 92, - backtick = 96, - bar = 124, - caret = 94, - closeBrace = 125, - closeBracket = 93, - closeParen = 41, - colon = 58, - comma = 44, - dot = 46, - doubleQuote = 34, - equals = 61, - exclamation = 33, - greaterThan = 62, - hash = 35, - lessThan = 60, - minus = 45, - openBrace = 123, - openBracket = 91, - openParen = 40, - percent = 37, - plus = 43, - question = 63, - semicolon = 59, - singleQuote = 39, - slash = 47, - tilde = 126, - backspace = 8, - formFeed = 12, - byteOrderMark = 65279, - tab = 9, - verticalTab = 11 - } interface UpToDateHost { fileExists(fileName: string): boolean; getModifiedTime(fileName: string): Date; @@ -4029,7 +2621,6 @@ declare namespace ts { * If changing this, remember to change `moduleResolutionIsEqualTo`. */ interface ResolvedModuleFull extends ResolvedModule { - readonly originalPath?: string; /** * Extension of resolvedFileName. This must match what's at the end of resolvedFileName. * This is optional for backwards-compatibility, but will be added if not provided. @@ -4066,7 +2657,6 @@ declare namespace ts { } interface ResolvedModuleWithFailedLookupLocations { readonly resolvedModule: ResolvedModuleFull | undefined; - readonly failedLookupLocations: ReadonlyArray; } interface ResolvedTypeReferenceDirective { primary: boolean; @@ -4077,7 +2667,6 @@ declare namespace ts { readonly resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective | undefined; readonly failedLookupLocations: ReadonlyArray; } - type HasInvalidatedResolution = (sourceFile: Path) => boolean; interface CompilerHost extends ModuleResolutionHost { getSourceFile(fileName: string, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; getSourceFileByPath?(fileName: string, path: Path, languageVersion: ScriptTarget, onError?: (message: string) => void, shouldCreateNewSourceFile?: boolean): SourceFile | undefined; @@ -4097,97 +2686,19 @@ declare namespace ts { */ resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; getEnvironmentVariable?(name: string): string | undefined; - onReleaseOldSourceFile?(oldSourceFile: SourceFile, oldOptions: CompilerOptions): void; - hasInvalidatedResolution?: HasInvalidatedResolution; - hasChangedAutomaticTypeDirectiveNames?: boolean; createHash?(data: string): string; getModifiedTime?(fileName: string): Date; setModifiedTime?(fileName: string, date: Date): void; deleteFile?(fileName: string): void; } - enum TransformFlags { - None = 0, - TypeScript = 1, - ContainsTypeScript = 2, - ContainsJsx = 4, - ContainsESNext = 8, - ContainsES2017 = 16, - ContainsES2016 = 32, - ES2015 = 64, - ContainsES2015 = 128, - Generator = 256, - ContainsGenerator = 512, - DestructuringAssignment = 1024, - ContainsDestructuringAssignment = 2048, - ContainsDecorators = 4096, - ContainsPropertyInitializer = 8192, - ContainsLexicalThis = 16384, - ContainsCapturedLexicalThis = 32768, - ContainsLexicalThisInComputedPropertyName = 65536, - ContainsDefaultValueAssignments = 131072, - ContainsParameterPropertyAssignments = 262144, - ContainsSpread = 524288, - ContainsObjectSpread = 1048576, - ContainsRest = 524288, - ContainsObjectRest = 1048576, - ContainsComputedPropertyName = 2097152, - ContainsBlockScopedBinding = 4194304, - ContainsBindingPattern = 8388608, - ContainsYield = 16777216, - ContainsHoistedDeclarationOrCompletion = 33554432, - ContainsDynamicImport = 67108864, - Super = 134217728, - ContainsSuper = 268435456, - HasComputedFlags = 536870912, - AssertTypeScript = 3, - AssertJsx = 4, - AssertESNext = 8, - AssertES2017 = 16, - AssertES2016 = 32, - AssertES2015 = 192, - AssertGenerator = 768, - AssertDestructuringAssignment = 3072, - OuterExpressionExcludes = 536872257, - PropertyAccessExcludes = 671089985, - NodeExcludes = 939525441, - ArrowFunctionExcludes = 1003902273, - FunctionExcludes = 1003935041, - ConstructorExcludes = 1003668801, - MethodOrAccessorExcludes = 1003668801, - ClassExcludes = 942011713, - ModuleExcludes = 977327425, - TypeExcludes = -3, - ObjectLiteralExcludes = 942740801, - ArrayLiteralOrCallOrNewExcludes = 940049729, - VariableDeclarationListExcludes = 948962625, - ParameterExcludes = 939525441, - CatchClauseExcludes = 940574017, - BindingPatternExcludes = 940049729, - TypeScriptClassSyntaxMask = 274432, - ES2015FunctionSyntaxMask = 163840 - } interface SourceMapRange extends TextRange { source?: SourceMapSource; } interface SourceMapSource { fileName: string; text: string; - lineMap: ReadonlyArray; skipTrivia?: (pos: number) => number; } - interface EmitNode { - annotatedNodes?: Node[]; - flags: EmitFlags; - leadingComments?: SynthesizedComment[]; - trailingComments?: SynthesizedComment[]; - commentRange?: TextRange; - sourceMapRange?: SourceMapRange; - tokenSourceMapRanges?: (SourceMapRange | undefined)[]; - constantValue?: string | number; - externalHelpersModuleName?: Identifier; - helpers?: EmitHelper[]; - startsOnNewLine?: boolean; - } enum EmitFlags { None = 0, SingleLine = 1, @@ -4217,9 +2728,7 @@ declare namespace ts { NoHoisting = 2097152, HasEndOfDeclarationMarker = 4194304, Iterator = 8388608, - NoAsciiEscaping = 16777216, - TypeScriptClassWrapper = 33554432, - NeverApplyImportHelper = 67108864 + NoAsciiEscaping = 16777216 } interface EmitHelper { readonly name: string; @@ -4227,38 +2736,7 @@ declare namespace ts { readonly text: string | ((node: EmitHelperUniqueNameCallback) => string); readonly priority?: number; } - type UniqueNameHandler = (baseName: string, checkFn?: (name: string) => boolean, optimistic?: boolean) => string; type EmitHelperUniqueNameCallback = (name: string) => string; - /** - * Used by the checker, this enum keeps track of external emit helpers that should be type - * checked. - */ - enum ExternalEmitHelpers { - Extends = 1, - Assign = 2, - Rest = 4, - Decorate = 8, - Metadata = 16, - Param = 32, - Awaiter = 64, - Generator = 128, - Values = 256, - Read = 512, - Spread = 1024, - Await = 2048, - AsyncGenerator = 4096, - AsyncDelegator = 8192, - AsyncValues = 16384, - ExportStar = 32768, - MakeTemplateObject = 65536, - FirstEmitHelper = 1, - LastEmitHelper = 65536, - ForOfIncludes = 256, - ForAwaitOfIncludes = 16384, - AsyncGeneratorIncludes = 6144, - AsyncDelegatorIncludes = 26624, - SpreadIncludes = 1536 - } enum EmitHint { SourceFile = 0, Expression = 1, @@ -4266,21 +2744,7 @@ declare namespace ts { MappedTypeParameter = 3, Unspecified = 4 } - interface EmitHost extends ScriptReferenceHost, ModuleSpecifierResolutionHost { - getSourceFiles(): ReadonlyArray; - useCaseSensitiveFileNames(): boolean; - getCurrentDirectory(): string; - isSourceFileFromExternalLibrary(file: SourceFile): boolean; - getCommonSourceDirectory(): string; - getCanonicalFileName(fileName: string): string; - getNewLine(): string; - isEmitBlocked(emitFileName: string): boolean; - getPrependNodes(): ReadonlyArray; - writeFile: WriteFileCallback; - } interface TransformationContext { - getEmitResolver(): EmitResolver; - getEmitHost(): EmitHost; /** Gets the compiler options supplied to the transformer. */ getCompilerOptions(): CompilerOptions; /** Starts a new lexical environment. */ @@ -4329,7 +2793,6 @@ declare namespace ts { * before returning the `NodeTransformer` callback. */ onEmitNode: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; - addDiagnostic(diag: DiagnosticWithLocation): void; } interface TransformationResult { /** Gets the transformed source files. */ @@ -4397,20 +2860,6 @@ declare namespace ts { * Prints a bundle of source files as-is, without any emit transformations. */ printBundle(bundle: Bundle): string; - writeNode(hint: EmitHint, node: Node, sourceFile: SourceFile | undefined, writer: EmitTextWriter): void; - writeList(format: ListFormat, list: NodeArray | undefined, sourceFile: SourceFile | undefined, writer: EmitTextWriter): void; - writeFile(sourceFile: SourceFile, writer: EmitTextWriter): void; - writeBundle(bundle: Bundle, writer: EmitTextWriter, info?: BundleInfo): void; - } - /** - * When a bundle contains prepended content, we store a file on disk indicating where the non-prepended - * content of that file starts. On a subsequent build where there are no upstream .d.ts changes, we - * read the bundle info file and the original .js file to quickly re-use portion of the file - * that didn't originate in prepended content. - */ - interface BundleInfo { - originalOffset: number; - totalLength: number; } interface PrintHandlers { /** @@ -4454,58 +2903,17 @@ declare namespace ts { * ``` */ substituteNode?(hint: EmitHint, node: Node): Node; - onEmitSourceMapOfNode?: (hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void) => void; - onEmitSourceMapOfToken?: (node: Node | undefined, token: SyntaxKind, writer: (s: string) => void, pos: number, emitCallback: (token: SyntaxKind, writer: (s: string) => void, pos: number) => number) => number; - onEmitSourceMapOfPosition?: (pos: number) => void; - onSetSourceFile?: (node: SourceFile) => void; - onBeforeEmitNodeArray?: (nodes: NodeArray | undefined) => void; - onAfterEmitNodeArray?: (nodes: NodeArray | undefined) => void; - onBeforeEmitToken?: (node: Node) => void; - onAfterEmitToken?: (node: Node) => void; } interface PrinterOptions { removeComments?: boolean; newLine?: NewLineKind; omitTrailingSemicolon?: boolean; noEmitHelpers?: boolean; - module?: CompilerOptions["module"]; - target?: CompilerOptions["target"]; - sourceMap?: boolean; - inlineSourceMap?: boolean; - extendedDiagnostics?: boolean; - onlyPrintJsDocStyle?: boolean; - } - interface EmitTextWriter extends SymbolWriter { - write(s: string): void; - writeTextOfNode(text: string, node: Node): void; - getText(): string; - rawWrite(s: string): void; - writeLiteral(s: string): void; - getTextPos(): number; - getLine(): number; - getColumn(): number; - getIndent(): number; - isAtStartOfLine(): boolean; } interface GetEffectiveTypeRootsHost { directoryExists?(directoryName: string): boolean; getCurrentDirectory?(): string; } - /** @internal */ - interface ModuleSpecifierResolutionHost extends GetEffectiveTypeRootsHost { - useCaseSensitiveFileNames?(): boolean; - fileExists?(path: string): boolean; - readFile?(path: string): string | undefined; - getSourceFiles?(): ReadonlyArray; - } - interface SymbolTracker { - trackSymbol?(symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags): void; - reportInaccessibleThisError?(): void; - reportPrivateInBaseOfClassExpression?(propertyName: string): void; - reportInaccessibleUniqueSymbolError?(): void; - moduleResolverHost?: ModuleSpecifierResolutionHost; - trackReferencedAmbientModule?(decl: ModuleDeclaration, symbol: Symbol): void; - } interface TextSpan { start: number; length: number; @@ -4514,14 +2922,6 @@ declare namespace ts { span: TextSpan; newLength: number; } - interface DiagnosticCollection { - add(diagnostic: Diagnostic): void; - lookup(diagnostic: Diagnostic): Diagnostic | undefined; - getGlobalDiagnostics(): Diagnostic[]; - getDiagnostics(fileName: string): DiagnosticWithLocation[]; - getDiagnostics(): Diagnostic[]; - reattachFileDiagnostics(newFile: SourceFile): void; - } interface SyntaxList extends Node { _children: Node[]; } @@ -4590,145 +2990,10 @@ declare namespace ts { Parameters = 1296, IndexSignatureParameters = 4432 } - enum PragmaKindFlags { - None = 0, - /** - * Triple slash comment of the form - * /// - */ - TripleSlashXML = 1, - /** - * Single line comment of the form - * // @pragma-name argval1 argval2 - * or - * /// @pragma-name argval1 argval2 - */ - SingleLine = 2, - /** - * Multiline non-jsdoc pragma of the form - * /* @pragma-name argval1 argval2 * / - */ - MultiLine = 4, - All = 7, - Default = 7 - } - interface PragmaArgumentSpecification { - name: TName; - optional?: boolean; - captureSpan?: boolean; - } - interface PragmaDefinition { - args?: [PragmaArgumentSpecification] | [PragmaArgumentSpecification, PragmaArgumentSpecification] | [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification] | [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification]; - kind?: PragmaKindFlags; - } - const commentPragmas: { - "reference": { - args: [{ - name: "types"; - optional: true; - captureSpan: true; - }, { - name: "lib"; - optional: true; - captureSpan: true; - }, { - name: "path"; - optional: true; - captureSpan: true; - }, { - name: "no-default-lib"; - optional: true; - }]; - kind: PragmaKindFlags; - }; - "amd-dependency": { - args: [{ - name: "path"; - }, { - name: "name"; - optional: true; - }]; - kind: PragmaKindFlags; - }; - "amd-module": { - args: [{ - name: "name"; - }]; - kind: PragmaKindFlags; - }; - "ts-check": { - kind: PragmaKindFlags; - }; - "ts-nocheck": { - kind: PragmaKindFlags; - }; - "jsx": { - args: [{ - name: "factory"; - }]; - kind: PragmaKindFlags; - }; - }; - type PragmaArgTypeMaybeCapture = TDesc extends { - captureSpan: true; - } ? { - value: string; - pos: number; - end: number; - } : string; - type PragmaArgTypeOptional = TDesc extends { - optional: true; - } ? { - [K in TName]?: PragmaArgTypeMaybeCapture; - } : { - [K in TName]: PragmaArgTypeMaybeCapture; - }; - /** - * Maps a pragma definition into the desired shape for its arguments object - * Maybe the below is a good argument for types being iterable on struture in some way. - */ - type PragmaArgumentType = T extends { - args: [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification]; - } ? PragmaArgTypeOptional & PragmaArgTypeOptional & PragmaArgTypeOptional & PragmaArgTypeOptional : T extends { - args: [PragmaArgumentSpecification, PragmaArgumentSpecification, PragmaArgumentSpecification]; - } ? PragmaArgTypeOptional & PragmaArgTypeOptional & PragmaArgTypeOptional : T extends { - args: [PragmaArgumentSpecification, PragmaArgumentSpecification]; - } ? PragmaArgTypeOptional & PragmaArgTypeOptional : T extends { - args: [PragmaArgumentSpecification]; - } ? PragmaArgTypeOptional : object; - type ConcretePragmaSpecs = typeof commentPragmas; - type PragmaPsuedoMap = { - [K in keyof ConcretePragmaSpecs]?: { - arguments: PragmaArgumentType; - range: CommentRange; - }; - }; - type PragmaPsuedoMapEntry = { - [K in keyof PragmaPsuedoMap]: { - name: K; - args: PragmaPsuedoMap[K]; - }; - }[keyof PragmaPsuedoMap]; - /** - * A strongly-typed es6 map of pragma entries, the values of which are either a single argument - * value (if only one was found), or an array of multiple argument values if the pragma is present - * in multiple places - */ - interface PragmaMap extends Map { - set(key: TKey, value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]): this; - get(key: TKey): PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][]; - forEach(action: (value: PragmaPsuedoMap[TKey] | PragmaPsuedoMap[TKey][], key: TKey) => void): void; - } } declare function setTimeout(handler: (...args: any[]) => void, timeout: number): any; declare function clearTimeout(handle: any): void; declare namespace ts { - /** - * Set a high stack trace limit to provide more information in case of an error. - * Called for command-line and server use cases. - * Not called if TypeScript is used as a library. - */ - function setStackTraceLimit(): void; enum FileWatcherEventKind { Created = 0, Changed = 1, @@ -4736,47 +3001,6 @@ declare namespace ts { } type FileWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind) => void; type DirectoryWatcherCallback = (fileName: string) => void; - interface WatchedFile { - readonly fileName: string; - readonly callback: FileWatcherCallback; - mtime: Date; - } - enum PollingInterval { - High = 2000, - Medium = 500, - Low = 250 - } - function watchFileUsingPriorityPollingInterval(host: System, fileName: string, callback: FileWatcherCallback, watchPriority: PollingInterval): FileWatcher; - type HostWatchFile = (fileName: string, callback: FileWatcherCallback, pollingInterval: PollingInterval | undefined) => FileWatcher; - type HostWatchDirectory = (fileName: string, callback: DirectoryWatcherCallback, recursive?: boolean) => FileWatcher; - const missingFileModifiedTime: Date; - let unchangedPollThresholds: { - [PollingInterval.Low]: number; - [PollingInterval.Medium]: number; - [PollingInterval.High]: number; - }; - function setCustomPollingValues(system: System): void; - function createDynamicPriorityPollingWatchFile(host: { - getModifiedTime: System["getModifiedTime"]; - setTimeout: System["setTimeout"]; - }): HostWatchFile; - /** - * Returns true if file status changed - */ - function onWatchedFileStat(watchedFile: WatchedFile, modifiedTime: Date): boolean; - interface RecursiveDirectoryWatcherHost { - watchDirectory: HostWatchDirectory; - getAccessibleSortedChildDirectories(path: string): ReadonlyArray; - directoryExists(dir: string): boolean; - filePathComparer: Comparer; - realpath(s: string): string; - } - /** - * Watch the directory recursively using host provided method to watch child directories - * that means if this is recursive watcher, watch the children directories as well - * (eg on OS that dont support recursive watch using fs.watch use fs.watchFile) - */ - function createRecursiveDirectoryWatcher(host: RecursiveDirectoryWatcherHost): (directoryName: string, callback: DirectoryWatcherCallback) => FileWatcher; interface System { args: string[]; newLine: string; @@ -4812,13 +3036,9 @@ declare namespace ts { getMemoryUsage?(): number; exit(exitCode?: number): void; realpath?(path: string): string; - getEnvironmentVariable(name: string): string; - tryEnableSourceMapsForHost?(): void; - debugMode?: boolean; setTimeout?(callback: (...args: any[]) => void, ms: number, ...args: any[]): any; clearTimeout?(timeoutId: any): void; clearScreen?(): void; - setBlocking?(): void; base64decode?(input: string): string; base64encode?(input: string): string; } @@ -4828,1132 +3048,8 @@ declare namespace ts { function getNodeMajorVersion(): number | undefined; let sys: System; } -declare namespace ts { - const Diagnostics: { - Unterminated_string_literal: DiagnosticMessage; - Identifier_expected: DiagnosticMessage; - _0_expected: DiagnosticMessage; - A_file_cannot_have_a_reference_to_itself: DiagnosticMessage; - Trailing_comma_not_allowed: DiagnosticMessage; - Asterisk_Slash_expected: DiagnosticMessage; - An_element_access_expression_should_take_an_argument: DiagnosticMessage; - Unexpected_token: DiagnosticMessage; - A_rest_parameter_or_binding_pattern_may_not_have_a_trailing_comma: DiagnosticMessage; - A_rest_parameter_must_be_last_in_a_parameter_list: DiagnosticMessage; - Parameter_cannot_have_question_mark_and_initializer: DiagnosticMessage; - A_required_parameter_cannot_follow_an_optional_parameter: DiagnosticMessage; - An_index_signature_cannot_have_a_rest_parameter: DiagnosticMessage; - An_index_signature_parameter_cannot_have_an_accessibility_modifier: DiagnosticMessage; - An_index_signature_parameter_cannot_have_a_question_mark: DiagnosticMessage; - An_index_signature_parameter_cannot_have_an_initializer: DiagnosticMessage; - An_index_signature_must_have_a_type_annotation: DiagnosticMessage; - An_index_signature_parameter_must_have_a_type_annotation: DiagnosticMessage; - An_index_signature_parameter_type_must_be_string_or_number: DiagnosticMessage; - readonly_modifier_can_only_appear_on_a_property_declaration_or_index_signature: DiagnosticMessage; - Accessibility_modifier_already_seen: DiagnosticMessage; - _0_modifier_must_precede_1_modifier: DiagnosticMessage; - _0_modifier_already_seen: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_class_element: DiagnosticMessage; - super_must_be_followed_by_an_argument_list_or_member_access: DiagnosticMessage; - Only_ambient_modules_can_use_quoted_names: DiagnosticMessage; - Statements_are_not_allowed_in_ambient_contexts: DiagnosticMessage; - A_declare_modifier_cannot_be_used_in_an_already_ambient_context: DiagnosticMessage; - Initializers_are_not_allowed_in_ambient_contexts: DiagnosticMessage; - _0_modifier_cannot_be_used_in_an_ambient_context: DiagnosticMessage; - _0_modifier_cannot_be_used_with_a_class_declaration: DiagnosticMessage; - _0_modifier_cannot_be_used_here: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_data_property: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_module_or_namespace_element: DiagnosticMessage; - A_0_modifier_cannot_be_used_with_an_interface_declaration: DiagnosticMessage; - A_declare_modifier_is_required_for_a_top_level_declaration_in_a_d_ts_file: DiagnosticMessage; - A_rest_parameter_cannot_be_optional: DiagnosticMessage; - A_rest_parameter_cannot_have_an_initializer: DiagnosticMessage; - A_set_accessor_must_have_exactly_one_parameter: DiagnosticMessage; - A_set_accessor_cannot_have_an_optional_parameter: DiagnosticMessage; - A_set_accessor_parameter_cannot_have_an_initializer: DiagnosticMessage; - A_set_accessor_cannot_have_rest_parameter: DiagnosticMessage; - A_get_accessor_cannot_have_parameters: DiagnosticMessage; - Type_0_is_not_a_valid_async_function_return_type_in_ES5_SlashES3_because_it_does_not_refer_to_a_Promise_compatible_constructor_value: DiagnosticMessage; - Accessors_are_only_available_when_targeting_ECMAScript_5_and_higher: DiagnosticMessage; - An_async_function_or_method_must_have_a_valid_awaitable_return_type: DiagnosticMessage; - The_return_type_of_an_async_function_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: DiagnosticMessage; - A_promise_must_have_a_then_method: DiagnosticMessage; - The_first_parameter_of_the_then_method_of_a_promise_must_be_a_callback: DiagnosticMessage; - Enum_member_must_have_initializer: DiagnosticMessage; - Type_is_referenced_directly_or_indirectly_in_the_fulfillment_callback_of_its_own_then_method: DiagnosticMessage; - An_export_assignment_cannot_be_used_in_a_namespace: DiagnosticMessage; - The_return_type_of_an_async_function_or_method_must_be_the_global_Promise_T_type: DiagnosticMessage; - In_ambient_enum_declarations_member_initializer_must_be_constant_expression: DiagnosticMessage; - Unexpected_token_A_constructor_method_accessor_or_property_was_expected: DiagnosticMessage; - Unexpected_token_A_type_parameter_name_was_expected_without_curly_braces: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_type_member: DiagnosticMessage; - _0_modifier_cannot_appear_on_an_index_signature: DiagnosticMessage; - A_0_modifier_cannot_be_used_with_an_import_declaration: DiagnosticMessage; - Invalid_reference_directive_syntax: DiagnosticMessage; - Octal_literals_are_not_available_when_targeting_ECMAScript_5_and_higher_Use_the_syntax_0: DiagnosticMessage; - An_accessor_cannot_be_declared_in_an_ambient_context: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_constructor_declaration: DiagnosticMessage; - _0_modifier_cannot_appear_on_a_parameter: DiagnosticMessage; - Only_a_single_variable_declaration_is_allowed_in_a_for_in_statement: DiagnosticMessage; - Type_parameters_cannot_appear_on_a_constructor_declaration: DiagnosticMessage; - Type_annotation_cannot_appear_on_a_constructor_declaration: DiagnosticMessage; - An_accessor_cannot_have_type_parameters: DiagnosticMessage; - A_set_accessor_cannot_have_a_return_type_annotation: DiagnosticMessage; - An_index_signature_must_have_exactly_one_parameter: DiagnosticMessage; - _0_list_cannot_be_empty: DiagnosticMessage; - Type_parameter_list_cannot_be_empty: DiagnosticMessage; - Type_argument_list_cannot_be_empty: DiagnosticMessage; - Invalid_use_of_0_in_strict_mode: DiagnosticMessage; - with_statements_are_not_allowed_in_strict_mode: DiagnosticMessage; - delete_cannot_be_called_on_an_identifier_in_strict_mode: DiagnosticMessage; - A_for_await_of_statement_is_only_allowed_within_an_async_function_or_async_generator: DiagnosticMessage; - A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement: DiagnosticMessage; - A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement: DiagnosticMessage; - Jump_target_cannot_cross_function_boundary: DiagnosticMessage; - A_return_statement_can_only_be_used_within_a_function_body: DiagnosticMessage; - Expression_expected: DiagnosticMessage; - Type_expected: DiagnosticMessage; - A_default_clause_cannot_appear_more_than_once_in_a_switch_statement: DiagnosticMessage; - Duplicate_label_0: DiagnosticMessage; - A_continue_statement_can_only_jump_to_a_label_of_an_enclosing_iteration_statement: DiagnosticMessage; - A_break_statement_can_only_jump_to_a_label_of_an_enclosing_statement: DiagnosticMessage; - An_object_literal_cannot_have_multiple_properties_with_the_same_name_in_strict_mode: DiagnosticMessage; - An_object_literal_cannot_have_multiple_get_Slashset_accessors_with_the_same_name: DiagnosticMessage; - An_object_literal_cannot_have_property_and_accessor_with_the_same_name: DiagnosticMessage; - An_export_assignment_cannot_have_modifiers: DiagnosticMessage; - Octal_literals_are_not_allowed_in_strict_mode: DiagnosticMessage; - Variable_declaration_list_cannot_be_empty: DiagnosticMessage; - Digit_expected: DiagnosticMessage; - Hexadecimal_digit_expected: DiagnosticMessage; - Unexpected_end_of_text: DiagnosticMessage; - Invalid_character: DiagnosticMessage; - Declaration_or_statement_expected: DiagnosticMessage; - Statement_expected: DiagnosticMessage; - case_or_default_expected: DiagnosticMessage; - Property_or_signature_expected: DiagnosticMessage; - Enum_member_expected: DiagnosticMessage; - Variable_declaration_expected: DiagnosticMessage; - Argument_expression_expected: DiagnosticMessage; - Property_assignment_expected: DiagnosticMessage; - Expression_or_comma_expected: DiagnosticMessage; - Parameter_declaration_expected: DiagnosticMessage; - Type_parameter_declaration_expected: DiagnosticMessage; - Type_argument_expected: DiagnosticMessage; - String_literal_expected: DiagnosticMessage; - Line_break_not_permitted_here: DiagnosticMessage; - or_expected: DiagnosticMessage; - Declaration_expected: DiagnosticMessage; - Import_declarations_in_a_namespace_cannot_reference_a_module: DiagnosticMessage; - Cannot_use_imports_exports_or_module_augmentations_when_module_is_none: DiagnosticMessage; - File_name_0_differs_from_already_included_file_name_1_only_in_casing: DiagnosticMessage; - new_T_cannot_be_used_to_create_an_array_Use_new_Array_T_instead: DiagnosticMessage; - const_declarations_must_be_initialized: DiagnosticMessage; - const_declarations_can_only_be_declared_inside_a_block: DiagnosticMessage; - let_declarations_can_only_be_declared_inside_a_block: DiagnosticMessage; - Unterminated_template_literal: DiagnosticMessage; - Unterminated_regular_expression_literal: DiagnosticMessage; - An_object_member_cannot_be_declared_optional: DiagnosticMessage; - A_yield_expression_is_only_allowed_in_a_generator_body: DiagnosticMessage; - Computed_property_names_are_not_allowed_in_enums: DiagnosticMessage; - A_computed_property_name_in_an_ambient_context_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: DiagnosticMessage; - A_computed_property_name_in_a_class_property_declaration_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: DiagnosticMessage; - A_computed_property_name_in_a_method_overload_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: DiagnosticMessage; - A_computed_property_name_in_an_interface_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: DiagnosticMessage; - A_computed_property_name_in_a_type_literal_must_refer_to_an_expression_whose_type_is_a_literal_type_or_a_unique_symbol_type: DiagnosticMessage; - A_comma_expression_is_not_allowed_in_a_computed_property_name: DiagnosticMessage; - extends_clause_already_seen: DiagnosticMessage; - extends_clause_must_precede_implements_clause: DiagnosticMessage; - Classes_can_only_extend_a_single_class: DiagnosticMessage; - implements_clause_already_seen: DiagnosticMessage; - Interface_declaration_cannot_have_implements_clause: DiagnosticMessage; - Binary_digit_expected: DiagnosticMessage; - Octal_digit_expected: DiagnosticMessage; - Unexpected_token_expected: DiagnosticMessage; - Property_destructuring_pattern_expected: DiagnosticMessage; - Array_element_destructuring_pattern_expected: DiagnosticMessage; - A_destructuring_declaration_must_have_an_initializer: DiagnosticMessage; - An_implementation_cannot_be_declared_in_ambient_contexts: DiagnosticMessage; - Modifiers_cannot_appear_here: DiagnosticMessage; - Merge_conflict_marker_encountered: DiagnosticMessage; - A_rest_element_cannot_have_an_initializer: DiagnosticMessage; - A_parameter_property_may_not_be_declared_using_a_binding_pattern: DiagnosticMessage; - Only_a_single_variable_declaration_is_allowed_in_a_for_of_statement: DiagnosticMessage; - The_variable_declaration_of_a_for_in_statement_cannot_have_an_initializer: DiagnosticMessage; - The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer: DiagnosticMessage; - An_import_declaration_cannot_have_modifiers: DiagnosticMessage; - Module_0_has_no_default_export: DiagnosticMessage; - An_export_declaration_cannot_have_modifiers: DiagnosticMessage; - Export_declarations_are_not_permitted_in_a_namespace: DiagnosticMessage; - Catch_clause_variable_cannot_have_a_type_annotation: DiagnosticMessage; - Catch_clause_variable_cannot_have_an_initializer: DiagnosticMessage; - An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive: DiagnosticMessage; - Unterminated_Unicode_escape_sequence: DiagnosticMessage; - Line_terminator_not_permitted_before_arrow: DiagnosticMessage; - Import_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_import_Asterisk_as_ns_from_mod_import_a_from_mod_import_d_from_mod_or_another_module_format_instead: DiagnosticMessage; - Export_assignment_cannot_be_used_when_targeting_ECMAScript_modules_Consider_using_export_default_or_another_module_format_instead: DiagnosticMessage; - Cannot_re_export_a_type_when_the_isolatedModules_flag_is_provided: DiagnosticMessage; - Decorators_are_not_valid_here: DiagnosticMessage; - Decorators_cannot_be_applied_to_multiple_get_Slashset_accessors_of_the_same_name: DiagnosticMessage; - Cannot_compile_namespaces_when_the_isolatedModules_flag_is_provided: DiagnosticMessage; - Ambient_const_enums_are_not_allowed_when_the_isolatedModules_flag_is_provided: DiagnosticMessage; - Invalid_use_of_0_Class_definitions_are_automatically_in_strict_mode: DiagnosticMessage; - A_class_declaration_without_the_default_modifier_must_have_a_name: DiagnosticMessage; - Identifier_expected_0_is_a_reserved_word_in_strict_mode: DiagnosticMessage; - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Class_definitions_are_automatically_in_strict_mode: DiagnosticMessage; - Identifier_expected_0_is_a_reserved_word_in_strict_mode_Modules_are_automatically_in_strict_mode: DiagnosticMessage; - Invalid_use_of_0_Modules_are_automatically_in_strict_mode: DiagnosticMessage; - Identifier_expected_esModule_is_reserved_as_an_exported_marker_when_transforming_ECMAScript_modules: DiagnosticMessage; - Export_assignment_is_not_supported_when_module_flag_is_system: DiagnosticMessage; - Experimental_support_for_decorators_is_a_feature_that_is_subject_to_change_in_a_future_release_Set_the_experimentalDecorators_option_to_remove_this_warning: DiagnosticMessage; - Generators_are_only_available_when_targeting_ECMAScript_2015_or_higher: DiagnosticMessage; - Generators_are_not_allowed_in_an_ambient_context: DiagnosticMessage; - An_overload_signature_cannot_be_declared_as_a_generator: DiagnosticMessage; - _0_tag_already_specified: DiagnosticMessage; - Signature_0_must_be_a_type_predicate: DiagnosticMessage; - Cannot_find_parameter_0: DiagnosticMessage; - Type_predicate_0_is_not_assignable_to_1: DiagnosticMessage; - Parameter_0_is_not_in_the_same_position_as_parameter_1: DiagnosticMessage; - A_type_predicate_is_only_allowed_in_return_type_position_for_functions_and_methods: DiagnosticMessage; - A_type_predicate_cannot_reference_a_rest_parameter: DiagnosticMessage; - A_type_predicate_cannot_reference_element_0_in_a_binding_pattern: DiagnosticMessage; - An_export_assignment_can_only_be_used_in_a_module: DiagnosticMessage; - An_import_declaration_can_only_be_used_in_a_namespace_or_module: DiagnosticMessage; - An_export_declaration_can_only_be_used_in_a_module: DiagnosticMessage; - An_ambient_module_declaration_is_only_allowed_at_the_top_level_in_a_file: DiagnosticMessage; - A_namespace_declaration_is_only_allowed_in_a_namespace_or_module: DiagnosticMessage; - The_return_type_of_a_property_decorator_function_must_be_either_void_or_any: DiagnosticMessage; - The_return_type_of_a_parameter_decorator_function_must_be_either_void_or_any: DiagnosticMessage; - Unable_to_resolve_signature_of_class_decorator_when_called_as_an_expression: DiagnosticMessage; - Unable_to_resolve_signature_of_parameter_decorator_when_called_as_an_expression: DiagnosticMessage; - Unable_to_resolve_signature_of_property_decorator_when_called_as_an_expression: DiagnosticMessage; - Unable_to_resolve_signature_of_method_decorator_when_called_as_an_expression: DiagnosticMessage; - abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration: DiagnosticMessage; - _0_modifier_cannot_be_used_with_1_modifier: DiagnosticMessage; - Abstract_methods_can_only_appear_within_an_abstract_class: DiagnosticMessage; - Method_0_cannot_have_an_implementation_because_it_is_marked_abstract: DiagnosticMessage; - An_interface_property_cannot_have_an_initializer: DiagnosticMessage; - A_type_literal_property_cannot_have_an_initializer: DiagnosticMessage; - A_class_member_cannot_have_the_0_keyword: DiagnosticMessage; - A_decorator_can_only_decorate_a_method_implementation_not_an_overload: DiagnosticMessage; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5: DiagnosticMessage; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Class_definitions_are_automatically_in_strict_mode: DiagnosticMessage; - Function_declarations_are_not_allowed_inside_blocks_in_strict_mode_when_targeting_ES3_or_ES5_Modules_are_automatically_in_strict_mode: DiagnosticMessage; - _0_tag_cannot_be_used_independently_as_a_top_level_JSDoc_tag: DiagnosticMessage; - A_const_initializer_in_an_ambient_context_must_be_a_string_or_numeric_literal: DiagnosticMessage; - A_definite_assignment_assertion_is_not_permitted_in_this_context: DiagnosticMessage; - A_rest_element_must_be_last_in_a_tuple_type: DiagnosticMessage; - A_required_element_cannot_follow_an_optional_element: DiagnosticMessage; - with_statements_are_not_allowed_in_an_async_function_block: DiagnosticMessage; - await_expression_is_only_allowed_within_an_async_function: DiagnosticMessage; - can_only_be_used_in_an_object_literal_property_inside_a_destructuring_assignment: DiagnosticMessage; - The_body_of_an_if_statement_cannot_be_the_empty_statement: DiagnosticMessage; - Global_module_exports_may_only_appear_in_module_files: DiagnosticMessage; - Global_module_exports_may_only_appear_in_declaration_files: DiagnosticMessage; - Global_module_exports_may_only_appear_at_top_level: DiagnosticMessage; - A_parameter_property_cannot_be_declared_using_a_rest_parameter: DiagnosticMessage; - An_abstract_accessor_cannot_have_an_implementation: DiagnosticMessage; - A_default_export_can_only_be_used_in_an_ECMAScript_style_module: DiagnosticMessage; - Type_of_await_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: DiagnosticMessage; - Type_of_yield_operand_in_an_async_generator_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: DiagnosticMessage; - Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_contain_a_callable_then_member: DiagnosticMessage; - Dynamic_import_is_only_supported_when_module_flag_is_commonjs_or_esNext: DiagnosticMessage; - Dynamic_import_must_have_one_specifier_as_an_argument: DiagnosticMessage; - Specifier_of_dynamic_import_cannot_be_spread_element: DiagnosticMessage; - Dynamic_import_cannot_have_type_arguments: DiagnosticMessage; - String_literal_with_double_quotes_expected: DiagnosticMessage; - Property_value_can_only_be_string_literal_numeric_literal_true_false_null_object_literal_or_array_literal: DiagnosticMessage; - _0_accepts_too_few_arguments_to_be_used_as_a_decorator_here_Did_you_mean_to_call_it_first_and_write_0: DiagnosticMessage; - A_property_of_an_interface_or_type_literal_whose_type_is_a_unique_symbol_type_must_be_readonly: DiagnosticMessage; - A_property_of_a_class_whose_type_is_a_unique_symbol_type_must_be_both_static_and_readonly: DiagnosticMessage; - A_variable_whose_type_is_a_unique_symbol_type_must_be_const: DiagnosticMessage; - unique_symbol_types_may_not_be_used_on_a_variable_declaration_with_a_binding_name: DiagnosticMessage; - unique_symbol_types_are_only_allowed_on_variables_in_a_variable_statement: DiagnosticMessage; - unique_symbol_types_are_not_allowed_here: DiagnosticMessage; - An_index_signature_parameter_type_cannot_be_a_type_alias_Consider_writing_0_Colon_1_Colon_2_instead: DiagnosticMessage; - An_index_signature_parameter_type_cannot_be_a_union_type_Consider_using_a_mapped_object_type_instead: DiagnosticMessage; - infer_declarations_are_only_permitted_in_the_extends_clause_of_a_conditional_type: DiagnosticMessage; - Module_0_does_not_refer_to_a_value_but_is_used_as_a_value_here: DiagnosticMessage; - Module_0_does_not_refer_to_a_type_but_is_used_as_a_type_here_Did_you_mean_typeof_import_0: DiagnosticMessage; - Type_arguments_cannot_be_used_here: DiagnosticMessage; - The_import_meta_meta_property_is_only_allowed_using_ESNext_for_the_target_and_module_compiler_options: DiagnosticMessage; - Duplicate_identifier_0: DiagnosticMessage; - Initializer_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor: DiagnosticMessage; - Static_members_cannot_reference_class_type_parameters: DiagnosticMessage; - Circular_definition_of_import_alias_0: DiagnosticMessage; - Cannot_find_name_0: DiagnosticMessage; - Module_0_has_no_exported_member_1: DiagnosticMessage; - File_0_is_not_a_module: DiagnosticMessage; - Cannot_find_module_0: DiagnosticMessage; - Module_0_has_already_exported_a_member_named_1_Consider_explicitly_re_exporting_to_resolve_the_ambiguity: DiagnosticMessage; - An_export_assignment_cannot_be_used_in_a_module_with_other_exported_elements: DiagnosticMessage; - Type_0_recursively_references_itself_as_a_base_type: DiagnosticMessage; - A_class_may_only_extend_another_class: DiagnosticMessage; - An_interface_may_only_extend_a_class_or_another_interface: DiagnosticMessage; - Type_parameter_0_has_a_circular_constraint: DiagnosticMessage; - Generic_type_0_requires_1_type_argument_s: DiagnosticMessage; - Type_0_is_not_generic: DiagnosticMessage; - Global_type_0_must_be_a_class_or_interface_type: DiagnosticMessage; - Global_type_0_must_have_1_type_parameter_s: DiagnosticMessage; - Cannot_find_global_type_0: DiagnosticMessage; - Named_property_0_of_types_1_and_2_are_not_identical: DiagnosticMessage; - Interface_0_cannot_simultaneously_extend_types_1_and_2: DiagnosticMessage; - Excessive_stack_depth_comparing_types_0_and_1: DiagnosticMessage; - Type_0_is_not_assignable_to_type_1: DiagnosticMessage; - Cannot_redeclare_exported_variable_0: DiagnosticMessage; - Property_0_is_missing_in_type_1: DiagnosticMessage; - Property_0_is_private_in_type_1_but_not_in_type_2: DiagnosticMessage; - Types_of_property_0_are_incompatible: DiagnosticMessage; - Property_0_is_optional_in_type_1_but_required_in_type_2: DiagnosticMessage; - Types_of_parameters_0_and_1_are_incompatible: DiagnosticMessage; - Index_signature_is_missing_in_type_0: DiagnosticMessage; - Index_signatures_are_incompatible: DiagnosticMessage; - this_cannot_be_referenced_in_a_module_or_namespace_body: DiagnosticMessage; - this_cannot_be_referenced_in_current_location: DiagnosticMessage; - this_cannot_be_referenced_in_constructor_arguments: DiagnosticMessage; - this_cannot_be_referenced_in_a_static_property_initializer: DiagnosticMessage; - super_can_only_be_referenced_in_a_derived_class: DiagnosticMessage; - super_cannot_be_referenced_in_constructor_arguments: DiagnosticMessage; - Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors: DiagnosticMessage; - super_property_access_is_permitted_only_in_a_constructor_member_function_or_member_accessor_of_a_derived_class: DiagnosticMessage; - Property_0_does_not_exist_on_type_1: DiagnosticMessage; - Only_public_and_protected_methods_of_the_base_class_are_accessible_via_the_super_keyword: DiagnosticMessage; - Property_0_is_private_and_only_accessible_within_class_1: DiagnosticMessage; - An_index_expression_argument_must_be_of_type_string_number_symbol_or_any: DiagnosticMessage; - This_syntax_requires_an_imported_helper_named_1_but_module_0_has_no_exported_member_1: DiagnosticMessage; - Type_0_does_not_satisfy_the_constraint_1: DiagnosticMessage; - Argument_of_type_0_is_not_assignable_to_parameter_of_type_1: DiagnosticMessage; - Call_target_does_not_contain_any_signatures: DiagnosticMessage; - Untyped_function_calls_may_not_accept_type_arguments: DiagnosticMessage; - Value_of_type_0_is_not_callable_Did_you_mean_to_include_new: DiagnosticMessage; - Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures: DiagnosticMessage; - Only_a_void_function_can_be_called_with_the_new_keyword: DiagnosticMessage; - Cannot_use_new_with_an_expression_whose_type_lacks_a_call_or_construct_signature: DiagnosticMessage; - Type_0_cannot_be_converted_to_type_1: DiagnosticMessage; - Object_literal_may_only_specify_known_properties_and_0_does_not_exist_in_type_1: DiagnosticMessage; - This_syntax_requires_an_imported_helper_but_module_0_cannot_be_found: DiagnosticMessage; - A_function_whose_declared_type_is_neither_void_nor_any_must_return_a_value: DiagnosticMessage; - An_arithmetic_operand_must_be_of_type_any_number_or_an_enum_type: DiagnosticMessage; - The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access: DiagnosticMessage; - The_left_hand_side_of_an_instanceof_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: DiagnosticMessage; - The_right_hand_side_of_an_instanceof_expression_must_be_of_type_any_or_of_a_type_assignable_to_the_Function_interface_type: DiagnosticMessage; - The_left_hand_side_of_an_in_expression_must_be_of_type_any_string_number_or_symbol: DiagnosticMessage; - The_right_hand_side_of_an_in_expression_must_be_of_type_any_an_object_type_or_a_type_parameter: DiagnosticMessage; - The_left_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: DiagnosticMessage; - The_right_hand_side_of_an_arithmetic_operation_must_be_of_type_any_number_or_an_enum_type: DiagnosticMessage; - The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access: DiagnosticMessage; - Operator_0_cannot_be_applied_to_types_1_and_2: DiagnosticMessage; - Function_lacks_ending_return_statement_and_return_type_does_not_include_undefined: DiagnosticMessage; - This_condition_will_always_return_0_since_the_types_1_and_2_have_no_overlap: DiagnosticMessage; - Type_parameter_name_cannot_be_0: DiagnosticMessage; - A_parameter_property_is_only_allowed_in_a_constructor_implementation: DiagnosticMessage; - A_rest_parameter_must_be_of_an_array_type: DiagnosticMessage; - A_parameter_initializer_is_only_allowed_in_a_function_or_constructor_implementation: DiagnosticMessage; - Parameter_0_cannot_be_referenced_in_its_initializer: DiagnosticMessage; - Initializer_of_parameter_0_cannot_reference_identifier_1_declared_after_it: DiagnosticMessage; - Duplicate_string_index_signature: DiagnosticMessage; - Duplicate_number_index_signature: DiagnosticMessage; - A_super_call_must_be_the_first_statement_in_the_constructor_when_a_class_contains_initialized_properties_or_has_parameter_properties: DiagnosticMessage; - Constructors_for_derived_classes_must_contain_a_super_call: DiagnosticMessage; - A_get_accessor_must_return_a_value: DiagnosticMessage; - Getter_and_setter_accessors_do_not_agree_in_visibility: DiagnosticMessage; - get_and_set_accessor_must_have_the_same_type: DiagnosticMessage; - A_signature_with_an_implementation_cannot_use_a_string_literal_type: DiagnosticMessage; - Specialized_overload_signature_is_not_assignable_to_any_non_specialized_signature: DiagnosticMessage; - Overload_signatures_must_all_be_exported_or_non_exported: DiagnosticMessage; - Overload_signatures_must_all_be_ambient_or_non_ambient: DiagnosticMessage; - Overload_signatures_must_all_be_public_private_or_protected: DiagnosticMessage; - Overload_signatures_must_all_be_optional_or_required: DiagnosticMessage; - Function_overload_must_be_static: DiagnosticMessage; - Function_overload_must_not_be_static: DiagnosticMessage; - Function_implementation_name_must_be_0: DiagnosticMessage; - Constructor_implementation_is_missing: DiagnosticMessage; - Function_implementation_is_missing_or_not_immediately_following_the_declaration: DiagnosticMessage; - Multiple_constructor_implementations_are_not_allowed: DiagnosticMessage; - Duplicate_function_implementation: DiagnosticMessage; - Overload_signature_is_not_compatible_with_function_implementation: DiagnosticMessage; - Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local: DiagnosticMessage; - Duplicate_identifier_arguments_Compiler_uses_arguments_to_initialize_rest_parameters: DiagnosticMessage; - Declaration_name_conflicts_with_built_in_global_identifier_0: DiagnosticMessage; - Duplicate_identifier_this_Compiler_uses_variable_declaration_this_to_capture_this_reference: DiagnosticMessage; - Expression_resolves_to_variable_declaration_this_that_compiler_uses_to_capture_this_reference: DiagnosticMessage; - Duplicate_identifier_super_Compiler_uses_super_to_capture_base_class_reference: DiagnosticMessage; - Expression_resolves_to_super_that_compiler_uses_to_capture_base_class_reference: DiagnosticMessage; - Subsequent_variable_declarations_must_have_the_same_type_Variable_0_must_be_of_type_1_but_here_has_type_2: DiagnosticMessage; - The_left_hand_side_of_a_for_in_statement_cannot_use_a_type_annotation: DiagnosticMessage; - The_left_hand_side_of_a_for_in_statement_must_be_of_type_string_or_any: DiagnosticMessage; - The_left_hand_side_of_a_for_in_statement_must_be_a_variable_or_a_property_access: DiagnosticMessage; - The_right_hand_side_of_a_for_in_statement_must_be_of_type_any_an_object_type_or_a_type_parameter_but_here_has_type_0: DiagnosticMessage; - Setters_cannot_return_a_value: DiagnosticMessage; - Return_type_of_constructor_signature_must_be_assignable_to_the_instance_type_of_the_class: DiagnosticMessage; - The_with_statement_is_not_supported_All_symbols_in_a_with_block_will_have_type_any: DiagnosticMessage; - Property_0_of_type_1_is_not_assignable_to_string_index_type_2: DiagnosticMessage; - Property_0_of_type_1_is_not_assignable_to_numeric_index_type_2: DiagnosticMessage; - Numeric_index_type_0_is_not_assignable_to_string_index_type_1: DiagnosticMessage; - Class_name_cannot_be_0: DiagnosticMessage; - Class_0_incorrectly_extends_base_class_1: DiagnosticMessage; - Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2: DiagnosticMessage; - Class_static_side_0_incorrectly_extends_base_class_static_side_1: DiagnosticMessage; - Type_of_computed_property_s_value_is_0_which_is_not_assignable_to_type_1: DiagnosticMessage; - Class_0_incorrectly_implements_interface_1: DiagnosticMessage; - A_class_may_only_implement_another_class_or_interface: DiagnosticMessage; - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_accessor: DiagnosticMessage; - Class_0_defines_instance_member_function_1_but_extended_class_2_defines_it_as_instance_member_property: DiagnosticMessage; - Class_0_defines_instance_member_property_1_but_extended_class_2_defines_it_as_instance_member_function: DiagnosticMessage; - Class_0_defines_instance_member_accessor_1_but_extended_class_2_defines_it_as_instance_member_function: DiagnosticMessage; - Interface_name_cannot_be_0: DiagnosticMessage; - All_declarations_of_0_must_have_identical_type_parameters: DiagnosticMessage; - Interface_0_incorrectly_extends_interface_1: DiagnosticMessage; - Enum_name_cannot_be_0: DiagnosticMessage; - In_an_enum_with_multiple_declarations_only_one_declaration_can_omit_an_initializer_for_its_first_enum_element: DiagnosticMessage; - A_namespace_declaration_cannot_be_in_a_different_file_from_a_class_or_function_with_which_it_is_merged: DiagnosticMessage; - A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged: DiagnosticMessage; - Ambient_modules_cannot_be_nested_in_other_modules_or_namespaces: DiagnosticMessage; - Ambient_module_declaration_cannot_specify_relative_module_name: DiagnosticMessage; - Module_0_is_hidden_by_a_local_declaration_with_the_same_name: DiagnosticMessage; - Import_name_cannot_be_0: DiagnosticMessage; - Import_or_export_declaration_in_an_ambient_module_declaration_cannot_reference_module_through_relative_module_name: DiagnosticMessage; - Import_declaration_conflicts_with_local_declaration_of_0: DiagnosticMessage; - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module: DiagnosticMessage; - Types_have_separate_declarations_of_a_private_property_0: DiagnosticMessage; - Property_0_is_protected_but_type_1_is_not_a_class_derived_from_2: DiagnosticMessage; - Property_0_is_protected_in_type_1_but_public_in_type_2: DiagnosticMessage; - Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses: DiagnosticMessage; - Property_0_is_protected_and_only_accessible_through_an_instance_of_class_1: DiagnosticMessage; - The_0_operator_is_not_allowed_for_boolean_types_Consider_using_1_instead: DiagnosticMessage; - Block_scoped_variable_0_used_before_its_declaration: DiagnosticMessage; - Class_0_used_before_its_declaration: DiagnosticMessage; - Enum_0_used_before_its_declaration: DiagnosticMessage; - Cannot_redeclare_block_scoped_variable_0: DiagnosticMessage; - An_enum_member_cannot_have_a_numeric_name: DiagnosticMessage; - The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly: DiagnosticMessage; - Variable_0_is_used_before_being_assigned: DiagnosticMessage; - Type_argument_candidate_1_is_not_a_valid_type_argument_because_it_is_not_a_supertype_of_candidate_0: DiagnosticMessage; - Type_alias_0_circularly_references_itself: DiagnosticMessage; - Type_alias_name_cannot_be_0: DiagnosticMessage; - An_AMD_module_cannot_have_multiple_name_assignments: DiagnosticMessage; - Type_0_has_no_property_1_and_no_string_index_signature: DiagnosticMessage; - Type_0_has_no_property_1: DiagnosticMessage; - Type_0_is_not_an_array_type: DiagnosticMessage; - A_rest_element_must_be_last_in_a_destructuring_pattern: DiagnosticMessage; - A_binding_pattern_parameter_cannot_be_optional_in_an_implementation_signature: DiagnosticMessage; - A_computed_property_name_must_be_of_type_string_number_symbol_or_any: DiagnosticMessage; - this_cannot_be_referenced_in_a_computed_property_name: DiagnosticMessage; - super_cannot_be_referenced_in_a_computed_property_name: DiagnosticMessage; - A_computed_property_name_cannot_reference_a_type_parameter_from_its_containing_type: DiagnosticMessage; - Cannot_find_global_value_0: DiagnosticMessage; - The_0_operator_cannot_be_applied_to_type_symbol: DiagnosticMessage; - Symbol_reference_does_not_refer_to_the_global_Symbol_constructor_object: DiagnosticMessage; - A_computed_property_name_of_the_form_0_must_be_of_type_symbol: DiagnosticMessage; - Spread_operator_in_new_expressions_is_only_available_when_targeting_ECMAScript_5_and_higher: DiagnosticMessage; - Enum_declarations_must_all_be_const_or_non_const: DiagnosticMessage; - In_const_enum_declarations_member_initializer_must_be_constant_expression: DiagnosticMessage; - const_enums_can_only_be_used_in_property_or_index_access_expressions_or_the_right_hand_side_of_an_import_declaration_or_export_assignment_or_type_query: DiagnosticMessage; - A_const_enum_member_can_only_be_accessed_using_a_string_literal: DiagnosticMessage; - const_enum_member_initializer_was_evaluated_to_a_non_finite_value: DiagnosticMessage; - const_enum_member_initializer_was_evaluated_to_disallowed_value_NaN: DiagnosticMessage; - Property_0_does_not_exist_on_const_enum_1: DiagnosticMessage; - let_is_not_allowed_to_be_used_as_a_name_in_let_or_const_declarations: DiagnosticMessage; - Cannot_initialize_outer_scoped_variable_0_in_the_same_scope_as_block_scoped_declaration_1: DiagnosticMessage; - The_left_hand_side_of_a_for_of_statement_cannot_use_a_type_annotation: DiagnosticMessage; - Export_declaration_conflicts_with_exported_declaration_of_0: DiagnosticMessage; - The_left_hand_side_of_a_for_of_statement_must_be_a_variable_or_a_property_access: DiagnosticMessage; - Type_0_must_have_a_Symbol_iterator_method_that_returns_an_iterator: DiagnosticMessage; - An_iterator_must_have_a_next_method: DiagnosticMessage; - The_type_returned_by_the_next_method_of_an_iterator_must_have_a_value_property: DiagnosticMessage; - The_left_hand_side_of_a_for_in_statement_cannot_be_a_destructuring_pattern: DiagnosticMessage; - Cannot_redeclare_identifier_0_in_catch_clause: DiagnosticMessage; - Tuple_type_0_with_length_1_cannot_be_assigned_to_tuple_with_length_2: DiagnosticMessage; - Using_a_string_in_a_for_of_statement_is_only_supported_in_ECMAScript_5_and_higher: DiagnosticMessage; - Type_0_is_not_an_array_type_or_a_string_type: DiagnosticMessage; - The_arguments_object_cannot_be_referenced_in_an_arrow_function_in_ES3_and_ES5_Consider_using_a_standard_function_expression: DiagnosticMessage; - Module_0_resolves_to_a_non_module_entity_and_cannot_be_imported_using_this_construct: DiagnosticMessage; - Module_0_uses_export_and_cannot_be_used_with_export_Asterisk: DiagnosticMessage; - An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments: DiagnosticMessage; - A_class_can_only_implement_an_identifier_Slashqualified_name_with_optional_type_arguments: DiagnosticMessage; - A_rest_element_cannot_contain_a_binding_pattern: DiagnosticMessage; - _0_is_referenced_directly_or_indirectly_in_its_own_type_annotation: DiagnosticMessage; - Cannot_find_namespace_0: DiagnosticMessage; - Type_0_must_have_a_Symbol_asyncIterator_method_that_returns_an_async_iterator: DiagnosticMessage; - A_generator_cannot_have_a_void_type_annotation: DiagnosticMessage; - _0_is_referenced_directly_or_indirectly_in_its_own_base_expression: DiagnosticMessage; - Type_0_is_not_a_constructor_function_type: DiagnosticMessage; - No_base_constructor_has_the_specified_number_of_type_arguments: DiagnosticMessage; - Base_constructor_return_type_0_is_not_a_class_or_interface_type: DiagnosticMessage; - Base_constructors_must_all_have_the_same_return_type: DiagnosticMessage; - Cannot_create_an_instance_of_an_abstract_class: DiagnosticMessage; - Overload_signatures_must_all_be_abstract_or_non_abstract: DiagnosticMessage; - Abstract_method_0_in_class_1_cannot_be_accessed_via_super_expression: DiagnosticMessage; - Classes_containing_abstract_methods_must_be_marked_abstract: DiagnosticMessage; - Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_class_2: DiagnosticMessage; - All_declarations_of_an_abstract_method_must_be_consecutive: DiagnosticMessage; - Cannot_assign_an_abstract_constructor_type_to_a_non_abstract_constructor_type: DiagnosticMessage; - A_this_based_type_guard_is_not_compatible_with_a_parameter_based_type_guard: DiagnosticMessage; - An_async_iterator_must_have_a_next_method: DiagnosticMessage; - Duplicate_identifier_0_Compiler_uses_declaration_1_to_support_async_functions: DiagnosticMessage; - Expression_resolves_to_variable_declaration_0_that_compiler_uses_to_support_async_functions: DiagnosticMessage; - The_arguments_object_cannot_be_referenced_in_an_async_function_or_method_in_ES3_and_ES5_Consider_using_a_standard_function_or_method: DiagnosticMessage; - yield_expressions_cannot_be_used_in_a_parameter_initializer: DiagnosticMessage; - await_expressions_cannot_be_used_in_a_parameter_initializer: DiagnosticMessage; - Initializer_provides_no_value_for_this_binding_element_and_the_binding_element_has_no_default_value: DiagnosticMessage; - A_this_type_is_available_only_in_a_non_static_member_of_a_class_or_interface: DiagnosticMessage; - The_inferred_type_of_0_references_an_inaccessible_1_type_A_type_annotation_is_necessary: DiagnosticMessage; - A_module_cannot_have_multiple_default_exports: DiagnosticMessage; - Duplicate_identifier_0_Compiler_reserves_name_1_in_top_level_scope_of_a_module_containing_async_functions: DiagnosticMessage; - Property_0_is_incompatible_with_index_signature: DiagnosticMessage; - Object_is_possibly_null: DiagnosticMessage; - Object_is_possibly_undefined: DiagnosticMessage; - Object_is_possibly_null_or_undefined: DiagnosticMessage; - A_function_returning_never_cannot_have_a_reachable_end_point: DiagnosticMessage; - Enum_type_0_has_members_with_initializers_that_are_not_literals: DiagnosticMessage; - Type_0_cannot_be_used_to_index_type_1: DiagnosticMessage; - Type_0_has_no_matching_index_signature_for_type_1: DiagnosticMessage; - Type_0_cannot_be_used_as_an_index_type: DiagnosticMessage; - Cannot_assign_to_0_because_it_is_not_a_variable: DiagnosticMessage; - Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property: DiagnosticMessage; - The_target_of_an_assignment_must_be_a_variable_or_a_property_access: DiagnosticMessage; - Index_signature_in_type_0_only_permits_reading: DiagnosticMessage; - Duplicate_identifier_newTarget_Compiler_uses_variable_declaration_newTarget_to_capture_new_target_meta_property_reference: DiagnosticMessage; - Expression_resolves_to_variable_declaration_newTarget_that_compiler_uses_to_capture_new_target_meta_property_reference: DiagnosticMessage; - A_mixin_class_must_have_a_constructor_with_a_single_rest_parameter_of_type_any: DiagnosticMessage; - Property_0_has_conflicting_declarations_and_is_inaccessible_in_type_1: DiagnosticMessage; - The_type_returned_by_the_next_method_of_an_async_iterator_must_be_a_promise_for_a_type_with_a_value_property: DiagnosticMessage; - Type_0_is_not_an_array_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: DiagnosticMessage; - Type_0_is_not_an_array_type_or_a_string_type_or_does_not_have_a_Symbol_iterator_method_that_returns_an_iterator: DiagnosticMessage; - Generic_type_instantiation_is_excessively_deep_and_possibly_infinite: DiagnosticMessage; - Property_0_does_not_exist_on_type_1_Did_you_mean_2: DiagnosticMessage; - Cannot_find_name_0_Did_you_mean_1: DiagnosticMessage; - Computed_values_are_not_permitted_in_an_enum_with_string_valued_members: DiagnosticMessage; - Expected_0_arguments_but_got_1: DiagnosticMessage; - Expected_at_least_0_arguments_but_got_1: DiagnosticMessage; - Expected_0_arguments_but_got_1_or_more: DiagnosticMessage; - Expected_at_least_0_arguments_but_got_1_or_more: DiagnosticMessage; - Expected_0_type_arguments_but_got_1: DiagnosticMessage; - Type_0_has_no_properties_in_common_with_type_1: DiagnosticMessage; - Value_of_type_0_has_no_properties_in_common_with_type_1_Did_you_mean_to_call_it: DiagnosticMessage; - Object_literal_may_only_specify_known_properties_but_0_does_not_exist_in_type_1_Did_you_mean_to_write_2: DiagnosticMessage; - Base_class_expressions_cannot_reference_class_type_parameters: DiagnosticMessage; - The_containing_function_or_module_body_is_too_large_for_control_flow_analysis: DiagnosticMessage; - Property_0_has_no_initializer_and_is_not_definitely_assigned_in_the_constructor: DiagnosticMessage; - Property_0_is_used_before_being_assigned: DiagnosticMessage; - A_rest_element_cannot_have_a_property_name: DiagnosticMessage; - Enum_declarations_can_only_merge_with_namespace_or_other_enum_declarations: DiagnosticMessage; - Type_0_is_not_an_array_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: DiagnosticMessage; - Type_0_is_not_an_array_type_or_a_string_type_Use_compiler_option_downlevelIteration_to_allow_iterating_of_iterators: DiagnosticMessage; - Property_0_does_not_exist_on_type_1_Did_you_forget_to_use_await: DiagnosticMessage; - Object_is_of_type_unknown: DiagnosticMessage; - Rest_signatures_are_incompatible: DiagnosticMessage; - Property_0_is_incompatible_with_rest_element_type: DiagnosticMessage; - A_rest_element_type_must_be_an_array_type: DiagnosticMessage; - JSX_element_attributes_type_0_may_not_be_a_union_type: DiagnosticMessage; - The_return_type_of_a_JSX_element_constructor_must_return_an_object_type: DiagnosticMessage; - JSX_element_implicitly_has_type_any_because_the_global_type_JSX_Element_does_not_exist: DiagnosticMessage; - Property_0_in_type_1_is_not_assignable_to_type_2: DiagnosticMessage; - JSX_element_type_0_does_not_have_any_construct_or_call_signatures: DiagnosticMessage; - JSX_element_type_0_is_not_a_constructor_function_for_JSX_elements: DiagnosticMessage; - Property_0_of_JSX_spread_attribute_is_not_assignable_to_target_property: DiagnosticMessage; - JSX_element_class_does_not_support_attributes_because_it_does_not_have_a_0_property: DiagnosticMessage; - The_global_type_JSX_0_may_not_have_more_than_one_property: DiagnosticMessage; - JSX_spread_child_must_be_an_array_type: DiagnosticMessage; - Cannot_augment_module_0_with_value_exports_because_it_resolves_to_a_non_module_entity: DiagnosticMessage; - A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums: DiagnosticMessage; - Merged_declaration_0_cannot_include_a_default_export_declaration_Consider_adding_a_separate_export_default_0_declaration_instead: DiagnosticMessage; - Non_abstract_class_expression_does_not_implement_inherited_abstract_member_0_from_class_1: DiagnosticMessage; - Exported_external_package_typings_file_cannot_contain_tripleslash_references_Please_contact_the_package_author_to_update_the_package_definition: DiagnosticMessage; - Exported_external_package_typings_file_0_is_not_a_module_Please_contact_the_package_author_to_update_the_package_definition: DiagnosticMessage; - JSX_expressions_must_have_one_parent_element: DiagnosticMessage; - Type_0_provides_no_match_for_the_signature_1: DiagnosticMessage; - super_is_only_allowed_in_members_of_object_literal_expressions_when_option_target_is_ES2015_or_higher: DiagnosticMessage; - super_can_only_be_referenced_in_members_of_derived_classes_or_object_literal_expressions: DiagnosticMessage; - Cannot_export_0_Only_local_declarations_can_be_exported_from_a_module: DiagnosticMessage; - Cannot_find_name_0_Did_you_mean_the_static_member_1_0: DiagnosticMessage; - Cannot_find_name_0_Did_you_mean_the_instance_member_this_0: DiagnosticMessage; - Invalid_module_name_in_augmentation_module_0_cannot_be_found: DiagnosticMessage; - Invalid_module_name_in_augmentation_Module_0_resolves_to_an_untyped_module_at_1_which_cannot_be_augmented: DiagnosticMessage; - Exports_and_export_assignments_are_not_permitted_in_module_augmentations: DiagnosticMessage; - Imports_are_not_permitted_in_module_augmentations_Consider_moving_them_to_the_enclosing_external_module: DiagnosticMessage; - export_modifier_cannot_be_applied_to_ambient_modules_and_module_augmentations_since_they_are_always_visible: DiagnosticMessage; - Augmentations_for_the_global_scope_can_only_be_directly_nested_in_external_modules_or_ambient_module_declarations: DiagnosticMessage; - Augmentations_for_the_global_scope_should_have_declare_modifier_unless_they_appear_in_already_ambient_context: DiagnosticMessage; - Cannot_augment_module_0_because_it_resolves_to_a_non_module_entity: DiagnosticMessage; - Cannot_assign_a_0_constructor_type_to_a_1_constructor_type: DiagnosticMessage; - Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration: DiagnosticMessage; - Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration: DiagnosticMessage; - Cannot_extend_a_class_0_Class_constructor_is_marked_as_private: DiagnosticMessage; - Accessors_must_both_be_abstract_or_non_abstract: DiagnosticMessage; - A_type_predicate_s_type_must_be_assignable_to_its_parameter_s_type: DiagnosticMessage; - Type_0_is_not_comparable_to_type_1: DiagnosticMessage; - A_function_that_is_called_with_the_new_keyword_cannot_have_a_this_type_that_is_void: DiagnosticMessage; - A_0_parameter_must_be_the_first_parameter: DiagnosticMessage; - A_constructor_cannot_have_a_this_parameter: DiagnosticMessage; - get_and_set_accessor_must_have_the_same_this_type: DiagnosticMessage; - this_implicitly_has_type_any_because_it_does_not_have_a_type_annotation: DiagnosticMessage; - The_this_context_of_type_0_is_not_assignable_to_method_s_this_of_type_1: DiagnosticMessage; - The_this_types_of_each_signature_are_incompatible: DiagnosticMessage; - _0_refers_to_a_UMD_global_but_the_current_file_is_a_module_Consider_adding_an_import_instead: DiagnosticMessage; - All_declarations_of_0_must_have_identical_modifiers: DiagnosticMessage; - Cannot_find_type_definition_file_for_0: DiagnosticMessage; - Cannot_extend_an_interface_0_Did_you_mean_implements: DiagnosticMessage; - An_import_path_cannot_end_with_a_0_extension_Consider_importing_1_instead: DiagnosticMessage; - _0_is_a_primitive_but_1_is_a_wrapper_object_Prefer_using_0_when_possible: DiagnosticMessage; - _0_only_refers_to_a_type_but_is_being_used_as_a_value_here: DiagnosticMessage; - Namespace_0_has_no_exported_member_1: DiagnosticMessage; - Left_side_of_comma_operator_is_unused_and_has_no_side_effects: DiagnosticMessage; - The_Object_type_is_assignable_to_very_few_other_types_Did_you_mean_to_use_the_any_type_instead: DiagnosticMessage; - An_async_function_or_method_must_return_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: DiagnosticMessage; - Spread_types_may_only_be_created_from_object_types: DiagnosticMessage; - Static_property_0_conflicts_with_built_in_property_Function_0_of_constructor_function_1: DiagnosticMessage; - Rest_types_may_only_be_created_from_object_types: DiagnosticMessage; - The_target_of_an_object_rest_assignment_must_be_a_variable_or_a_property_access: DiagnosticMessage; - _0_only_refers_to_a_type_but_is_being_used_as_a_namespace_here: DiagnosticMessage; - The_operand_of_a_delete_operator_must_be_a_property_reference: DiagnosticMessage; - The_operand_of_a_delete_operator_cannot_be_a_read_only_property: DiagnosticMessage; - An_async_function_or_method_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: DiagnosticMessage; - Required_type_parameters_may_not_follow_optional_type_parameters: DiagnosticMessage; - Generic_type_0_requires_between_1_and_2_type_arguments: DiagnosticMessage; - Cannot_use_namespace_0_as_a_value: DiagnosticMessage; - Cannot_use_namespace_0_as_a_type: DiagnosticMessage; - _0_are_specified_twice_The_attribute_named_0_will_be_overwritten: DiagnosticMessage; - A_dynamic_import_call_returns_a_Promise_Make_sure_you_have_a_declaration_for_Promise_or_include_ES2015_in_your_lib_option: DiagnosticMessage; - A_dynamic_import_call_in_ES5_SlashES3_requires_the_Promise_constructor_Make_sure_you_have_a_declaration_for_the_Promise_constructor_or_include_ES2015_in_your_lib_option: DiagnosticMessage; - Cannot_access_0_1_because_0_is_a_type_but_not_a_namespace_Did_you_mean_to_retrieve_the_type_of_the_property_1_in_0_with_0_1: DiagnosticMessage; - The_expression_of_an_export_assignment_must_be_an_identifier_or_qualified_name_in_an_ambient_context: DiagnosticMessage; - Abstract_property_0_in_class_1_cannot_be_accessed_in_the_constructor: DiagnosticMessage; - Type_parameter_0_has_a_circular_default: DiagnosticMessage; - Subsequent_property_declarations_must_have_the_same_type_Property_0_must_be_of_type_1_but_here_has_type_2: DiagnosticMessage; - Duplicate_declaration_0: DiagnosticMessage; - Type_0_is_not_assignable_to_type_1_Two_different_types_with_this_name_exist_but_they_are_unrelated: DiagnosticMessage; - Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass: DiagnosticMessage; - Cannot_invoke_an_object_which_is_possibly_null: DiagnosticMessage; - Cannot_invoke_an_object_which_is_possibly_undefined: DiagnosticMessage; - Cannot_invoke_an_object_which_is_possibly_null_or_undefined: DiagnosticMessage; - Module_0_has_no_exported_member_1_Did_you_mean_2: DiagnosticMessage; - Class_name_cannot_be_Object_when_targeting_ES5_with_module_0: DiagnosticMessage; - Cannot_find_lib_definition_for_0: DiagnosticMessage; - Cannot_find_lib_definition_for_0_Did_you_mean_1: DiagnosticMessage; - _0_was_declared_here: DiagnosticMessage; - Property_0_is_used_before_its_initialization: DiagnosticMessage; - Import_declaration_0_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Type_parameter_0_of_exported_function_has_or_is_using_private_name_1: DiagnosticMessage; - Implements_clause_of_exported_class_0_has_or_is_using_private_name_1: DiagnosticMessage; - extends_clause_of_exported_class_0_has_or_is_using_private_name_1: DiagnosticMessage; - extends_clause_of_exported_interface_0_has_or_is_using_private_name_1: DiagnosticMessage; - Exported_variable_0_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Exported_variable_0_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Exported_variable_0_has_or_is_using_private_name_1: DiagnosticMessage; - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Public_static_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Public_static_property_0_of_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Public_property_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Public_property_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Public_property_0_of_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Property_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Property_0_of_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_type_of_public_static_setter_0_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_type_of_public_setter_0_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Return_type_of_public_static_getter_0_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Return_type_of_public_getter_0_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_call_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_call_signature_from_exported_interface_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_index_signature_from_exported_interface_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_index_signature_from_exported_interface_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: DiagnosticMessage; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_public_static_method_from_exported_class_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: DiagnosticMessage; - Return_type_of_public_method_from_exported_class_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_public_method_from_exported_class_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_method_from_exported_interface_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_method_from_exported_interface_has_or_is_using_private_name_0: DiagnosticMessage; - Return_type_of_exported_function_has_or_is_using_name_0_from_external_module_1_but_cannot_be_named: DiagnosticMessage; - Return_type_of_exported_function_has_or_is_using_name_0_from_private_module_1: DiagnosticMessage; - Return_type_of_exported_function_has_or_is_using_private_name_0: DiagnosticMessage; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_constructor_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_constructor_signature_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_call_signature_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_public_static_method_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_public_method_from_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_method_from_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_method_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Parameter_0_of_exported_function_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Parameter_0_of_exported_function_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_exported_function_has_or_is_using_private_name_1: DiagnosticMessage; - Exported_type_alias_0_has_or_is_using_private_name_1: DiagnosticMessage; - Default_export_of_the_module_has_or_is_using_private_name_0: DiagnosticMessage; - Type_parameter_0_of_exported_type_alias_has_or_is_using_private_name_1: DiagnosticMessage; - Conflicting_definitions_for_0_found_at_1_and_2_Consider_installing_a_specific_version_of_this_library_to_resolve_the_conflict: DiagnosticMessage; - Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Parameter_0_of_index_signature_from_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - Property_0_of_exported_class_expression_may_not_be_private_or_protected: DiagnosticMessage; - Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Public_static_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Public_static_method_0_of_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Public_method_0_of_exported_class_has_or_is_using_name_1_from_external_module_2_but_cannot_be_named: DiagnosticMessage; - Public_method_0_of_exported_class_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Public_method_0_of_exported_class_has_or_is_using_private_name_1: DiagnosticMessage; - Method_0_of_exported_interface_has_or_is_using_name_1_from_private_module_2: DiagnosticMessage; - Method_0_of_exported_interface_has_or_is_using_private_name_1: DiagnosticMessage; - The_current_host_does_not_support_the_0_option: DiagnosticMessage; - Cannot_find_the_common_subdirectory_path_for_the_input_files: DiagnosticMessage; - File_specification_cannot_end_in_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: DiagnosticMessage; - Cannot_read_file_0_Colon_1: DiagnosticMessage; - Failed_to_parse_file_0_Colon_1: DiagnosticMessage; - Unknown_compiler_option_0: DiagnosticMessage; - Compiler_option_0_requires_a_value_of_type_1: DiagnosticMessage; - Could_not_write_file_0_Colon_1: DiagnosticMessage; - Option_project_cannot_be_mixed_with_source_files_on_a_command_line: DiagnosticMessage; - Option_isolatedModules_can_only_be_used_when_either_option_module_is_provided_or_option_target_is_ES2015_or_higher: DiagnosticMessage; - Option_0_can_only_be_used_when_either_option_inlineSourceMap_or_option_sourceMap_is_provided: DiagnosticMessage; - Option_0_cannot_be_specified_without_specifying_option_1: DiagnosticMessage; - Option_0_cannot_be_specified_with_option_1: DiagnosticMessage; - A_tsconfig_json_file_is_already_defined_at_Colon_0: DiagnosticMessage; - Cannot_write_file_0_because_it_would_overwrite_input_file: DiagnosticMessage; - Cannot_write_file_0_because_it_would_be_overwritten_by_multiple_input_files: DiagnosticMessage; - Cannot_find_a_tsconfig_json_file_at_the_specified_directory_Colon_0: DiagnosticMessage; - The_specified_path_does_not_exist_Colon_0: DiagnosticMessage; - Invalid_value_for_reactNamespace_0_is_not_a_valid_identifier: DiagnosticMessage; - Option_paths_cannot_be_used_without_specifying_baseUrl_option: DiagnosticMessage; - Pattern_0_can_have_at_most_one_Asterisk_character: DiagnosticMessage; - Substitution_0_in_pattern_1_in_can_have_at_most_one_Asterisk_character: DiagnosticMessage; - Substitutions_for_pattern_0_should_be_an_array: DiagnosticMessage; - Substitution_0_for_pattern_1_has_incorrect_type_expected_string_got_2: DiagnosticMessage; - File_specification_cannot_contain_a_parent_directory_that_appears_after_a_recursive_directory_wildcard_Asterisk_Asterisk_Colon_0: DiagnosticMessage; - Substitutions_for_pattern_0_shouldn_t_be_an_empty_array: DiagnosticMessage; - Invalid_value_for_jsxFactory_0_is_not_a_valid_identifier_or_qualified_name: DiagnosticMessage; - Adding_a_tsconfig_json_file_will_help_organize_projects_that_contain_both_TypeScript_and_JavaScript_files_Learn_more_at_https_Colon_Slash_Slashaka_ms_Slashtsconfig: DiagnosticMessage; - Option_0_cannot_be_specified_without_specifying_option_1_or_option_2: DiagnosticMessage; - Option_resolveJsonModule_cannot_be_specified_without_node_module_resolution_strategy: DiagnosticMessage; - Generates_a_sourcemap_for_each_corresponding_d_ts_file: DiagnosticMessage; - Concatenate_and_emit_output_to_single_file: DiagnosticMessage; - Generates_corresponding_d_ts_file: DiagnosticMessage; - Specify_the_location_where_debugger_should_locate_map_files_instead_of_generated_locations: DiagnosticMessage; - Specify_the_location_where_debugger_should_locate_TypeScript_files_instead_of_source_locations: DiagnosticMessage; - Watch_input_files: DiagnosticMessage; - Redirect_output_structure_to_the_directory: DiagnosticMessage; - Do_not_erase_const_enum_declarations_in_generated_code: DiagnosticMessage; - Do_not_emit_outputs_if_any_errors_were_reported: DiagnosticMessage; - Do_not_emit_comments_to_output: DiagnosticMessage; - Do_not_emit_outputs: DiagnosticMessage; - Allow_default_imports_from_modules_with_no_default_export_This_does_not_affect_code_emit_just_typechecking: DiagnosticMessage; - Skip_type_checking_of_declaration_files: DiagnosticMessage; - Do_not_resolve_the_real_path_of_symlinks: DiagnosticMessage; - Only_emit_d_ts_declaration_files: DiagnosticMessage; - Specify_ECMAScript_target_version_Colon_ES3_default_ES5_ES2015_ES2016_ES2017_ES2018_or_ESNEXT: DiagnosticMessage; - Specify_module_code_generation_Colon_none_commonjs_amd_system_umd_es2015_or_ESNext: DiagnosticMessage; - Print_this_message: DiagnosticMessage; - Print_the_compiler_s_version: DiagnosticMessage; - Compile_the_project_given_the_path_to_its_configuration_file_or_to_a_folder_with_a_tsconfig_json: DiagnosticMessage; - Syntax_Colon_0: DiagnosticMessage; - options: DiagnosticMessage; - file: DiagnosticMessage; - Examples_Colon_0: DiagnosticMessage; - Options_Colon: DiagnosticMessage; - Version_0: DiagnosticMessage; - Insert_command_line_options_and_files_from_a_file: DiagnosticMessage; - Starting_compilation_in_watch_mode: DiagnosticMessage; - File_change_detected_Starting_incremental_compilation: DiagnosticMessage; - KIND: DiagnosticMessage; - FILE: DiagnosticMessage; - VERSION: DiagnosticMessage; - LOCATION: DiagnosticMessage; - DIRECTORY: DiagnosticMessage; - STRATEGY: DiagnosticMessage; - FILE_OR_DIRECTORY: DiagnosticMessage; - Generates_corresponding_map_file: DiagnosticMessage; - Compiler_option_0_expects_an_argument: DiagnosticMessage; - Unterminated_quoted_string_in_response_file_0: DiagnosticMessage; - Argument_for_0_option_must_be_Colon_1: DiagnosticMessage; - Locale_must_be_of_the_form_language_or_language_territory_For_example_0_or_1: DiagnosticMessage; - Unsupported_locale_0: DiagnosticMessage; - Unable_to_open_file_0: DiagnosticMessage; - Corrupted_locale_file_0: DiagnosticMessage; - Raise_error_on_expressions_and_declarations_with_an_implied_any_type: DiagnosticMessage; - File_0_not_found: DiagnosticMessage; - File_0_has_unsupported_extension_The_only_supported_extensions_are_1: DiagnosticMessage; - Suppress_noImplicitAny_errors_for_indexing_objects_lacking_index_signatures: DiagnosticMessage; - Do_not_emit_declarations_for_code_that_has_an_internal_annotation: DiagnosticMessage; - Specify_the_root_directory_of_input_files_Use_to_control_the_output_directory_structure_with_outDir: DiagnosticMessage; - File_0_is_not_under_rootDir_1_rootDir_is_expected_to_contain_all_source_files: DiagnosticMessage; - Specify_the_end_of_line_sequence_to_be_used_when_emitting_files_Colon_CRLF_dos_or_LF_unix: DiagnosticMessage; - NEWLINE: DiagnosticMessage; - Option_0_can_only_be_specified_in_tsconfig_json_file: DiagnosticMessage; - Enables_experimental_support_for_ES7_decorators: DiagnosticMessage; - Enables_experimental_support_for_emitting_type_metadata_for_decorators: DiagnosticMessage; - Enables_experimental_support_for_ES7_async_functions: DiagnosticMessage; - Specify_module_resolution_strategy_Colon_node_Node_js_or_classic_TypeScript_pre_1_6: DiagnosticMessage; - Initializes_a_TypeScript_project_and_creates_a_tsconfig_json_file: DiagnosticMessage; - Successfully_created_a_tsconfig_json_file: DiagnosticMessage; - Suppress_excess_property_checks_for_object_literals: DiagnosticMessage; - Stylize_errors_and_messages_using_color_and_context_experimental: DiagnosticMessage; - Do_not_report_errors_on_unused_labels: DiagnosticMessage; - Report_error_when_not_all_code_paths_in_function_return_a_value: DiagnosticMessage; - Report_errors_for_fallthrough_cases_in_switch_statement: DiagnosticMessage; - Do_not_report_errors_on_unreachable_code: DiagnosticMessage; - Disallow_inconsistently_cased_references_to_the_same_file: DiagnosticMessage; - Specify_library_files_to_be_included_in_the_compilation: DiagnosticMessage; - Specify_JSX_code_generation_Colon_preserve_react_native_or_react: DiagnosticMessage; - File_0_has_an_unsupported_extension_so_skipping_it: DiagnosticMessage; - Only_amd_and_system_modules_are_supported_alongside_0: DiagnosticMessage; - Base_directory_to_resolve_non_absolute_module_names: DiagnosticMessage; - Deprecated_Use_jsxFactory_instead_Specify_the_object_invoked_for_createElement_when_targeting_react_JSX_emit: DiagnosticMessage; - Enable_tracing_of_the_name_resolution_process: DiagnosticMessage; - Resolving_module_0_from_1: DiagnosticMessage; - Explicitly_specified_module_resolution_kind_Colon_0: DiagnosticMessage; - Module_resolution_kind_is_not_specified_using_0: DiagnosticMessage; - Module_name_0_was_successfully_resolved_to_1: DiagnosticMessage; - Module_name_0_was_not_resolved: DiagnosticMessage; - paths_option_is_specified_looking_for_a_pattern_to_match_module_name_0: DiagnosticMessage; - Module_name_0_matched_pattern_1: DiagnosticMessage; - Trying_substitution_0_candidate_module_location_Colon_1: DiagnosticMessage; - Resolving_module_name_0_relative_to_base_url_1_2: DiagnosticMessage; - Loading_module_as_file_Slash_folder_candidate_module_location_0_target_file_type_1: DiagnosticMessage; - File_0_does_not_exist: DiagnosticMessage; - File_0_exist_use_it_as_a_name_resolution_result: DiagnosticMessage; - Loading_module_0_from_node_modules_folder_target_file_type_1: DiagnosticMessage; - Found_package_json_at_0: DiagnosticMessage; - package_json_does_not_have_a_0_field: DiagnosticMessage; - package_json_has_0_field_1_that_references_2: DiagnosticMessage; - Allow_javascript_files_to_be_compiled: DiagnosticMessage; - Option_0_should_have_array_of_strings_as_a_value: DiagnosticMessage; - Checking_if_0_is_the_longest_matching_prefix_for_1_2: DiagnosticMessage; - Expected_type_of_0_field_in_package_json_to_be_string_got_1: DiagnosticMessage; - baseUrl_option_is_set_to_0_using_this_value_to_resolve_non_relative_module_name_1: DiagnosticMessage; - rootDirs_option_is_set_using_it_to_resolve_relative_module_name_0: DiagnosticMessage; - Longest_matching_prefix_for_0_is_1: DiagnosticMessage; - Loading_0_from_the_root_dir_1_candidate_location_2: DiagnosticMessage; - Trying_other_entries_in_rootDirs: DiagnosticMessage; - Module_resolution_using_rootDirs_has_failed: DiagnosticMessage; - Do_not_emit_use_strict_directives_in_module_output: DiagnosticMessage; - Enable_strict_null_checks: DiagnosticMessage; - Unknown_option_excludes_Did_you_mean_exclude: DiagnosticMessage; - Raise_error_on_this_expressions_with_an_implied_any_type: DiagnosticMessage; - Resolving_type_reference_directive_0_containing_file_1_root_directory_2: DiagnosticMessage; - Resolving_using_primary_search_paths: DiagnosticMessage; - Resolving_from_node_modules_folder: DiagnosticMessage; - Type_reference_directive_0_was_successfully_resolved_to_1_primary_Colon_2: DiagnosticMessage; - Type_reference_directive_0_was_not_resolved: DiagnosticMessage; - Resolving_with_primary_search_path_0: DiagnosticMessage; - Root_directory_cannot_be_determined_skipping_primary_search_paths: DiagnosticMessage; - Resolving_type_reference_directive_0_containing_file_1_root_directory_not_set: DiagnosticMessage; - Type_declaration_files_to_be_included_in_compilation: DiagnosticMessage; - Looking_up_in_node_modules_folder_initial_location_0: DiagnosticMessage; - Containing_file_is_not_specified_and_root_directory_cannot_be_determined_skipping_lookup_in_node_modules_folder: DiagnosticMessage; - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_1: DiagnosticMessage; - Resolving_type_reference_directive_0_containing_file_not_set_root_directory_not_set: DiagnosticMessage; - Resolving_real_path_for_0_result_1: DiagnosticMessage; - Cannot_compile_modules_using_option_0_unless_the_module_flag_is_amd_or_system: DiagnosticMessage; - File_name_0_has_a_1_extension_stripping_it: DiagnosticMessage; - _0_is_declared_but_its_value_is_never_read: DiagnosticMessage; - Report_errors_on_unused_locals: DiagnosticMessage; - Report_errors_on_unused_parameters: DiagnosticMessage; - The_maximum_dependency_depth_to_search_under_node_modules_and_load_JavaScript_files: DiagnosticMessage; - Cannot_import_type_declaration_files_Consider_importing_0_instead_of_1: DiagnosticMessage; - Property_0_is_declared_but_its_value_is_never_read: DiagnosticMessage; - Import_emit_helpers_from_tslib: DiagnosticMessage; - Auto_discovery_for_typings_is_enabled_in_project_0_Running_extra_resolution_pass_for_module_1_using_cache_location_2: DiagnosticMessage; - Parse_in_strict_mode_and_emit_use_strict_for_each_source_file: DiagnosticMessage; - Module_0_was_resolved_to_1_but_jsx_is_not_set: DiagnosticMessage; - Module_0_was_resolved_as_locally_declared_ambient_module_in_file_1: DiagnosticMessage; - Module_0_was_resolved_as_ambient_module_declared_in_1_since_this_file_was_not_modified: DiagnosticMessage; - Specify_the_JSX_factory_function_to_use_when_targeting_react_JSX_emit_e_g_React_createElement_or_h: DiagnosticMessage; - Resolution_for_module_0_was_found_in_cache_from_location_1: DiagnosticMessage; - Directory_0_does_not_exist_skipping_all_lookups_in_it: DiagnosticMessage; - Show_diagnostic_information: DiagnosticMessage; - Show_verbose_diagnostic_information: DiagnosticMessage; - Emit_a_single_file_with_source_maps_instead_of_having_a_separate_file: DiagnosticMessage; - Emit_the_source_alongside_the_sourcemaps_within_a_single_file_requires_inlineSourceMap_or_sourceMap_to_be_set: DiagnosticMessage; - Transpile_each_file_as_a_separate_module_similar_to_ts_transpileModule: DiagnosticMessage; - Print_names_of_generated_files_part_of_the_compilation: DiagnosticMessage; - Print_names_of_files_part_of_the_compilation: DiagnosticMessage; - The_locale_used_when_displaying_messages_to_the_user_e_g_en_us: DiagnosticMessage; - Do_not_generate_custom_helper_functions_like_extends_in_compiled_output: DiagnosticMessage; - Do_not_include_the_default_library_file_lib_d_ts: DiagnosticMessage; - Do_not_add_triple_slash_references_or_imported_modules_to_the_list_of_compiled_files: DiagnosticMessage; - Deprecated_Use_skipLibCheck_instead_Skip_type_checking_of_default_library_declaration_files: DiagnosticMessage; - List_of_folders_to_include_type_definitions_from: DiagnosticMessage; - Disable_size_limitations_on_JavaScript_projects: DiagnosticMessage; - The_character_set_of_the_input_files: DiagnosticMessage; - Emit_a_UTF_8_Byte_Order_Mark_BOM_in_the_beginning_of_output_files: DiagnosticMessage; - Do_not_truncate_error_messages: DiagnosticMessage; - Output_directory_for_generated_declaration_files: DiagnosticMessage; - A_series_of_entries_which_re_map_imports_to_lookup_locations_relative_to_the_baseUrl: DiagnosticMessage; - List_of_root_folders_whose_combined_content_represents_the_structure_of_the_project_at_runtime: DiagnosticMessage; - Show_all_compiler_options: DiagnosticMessage; - Deprecated_Use_outFile_instead_Concatenate_and_emit_output_to_single_file: DiagnosticMessage; - Command_line_Options: DiagnosticMessage; - Basic_Options: DiagnosticMessage; - Strict_Type_Checking_Options: DiagnosticMessage; - Module_Resolution_Options: DiagnosticMessage; - Source_Map_Options: DiagnosticMessage; - Additional_Checks: DiagnosticMessage; - Experimental_Options: DiagnosticMessage; - Advanced_Options: DiagnosticMessage; - Provide_full_support_for_iterables_in_for_of_spread_and_destructuring_when_targeting_ES5_or_ES3: DiagnosticMessage; - Enable_all_strict_type_checking_options: DiagnosticMessage; - List_of_language_service_plugins: DiagnosticMessage; - Scoped_package_detected_looking_in_0: DiagnosticMessage; - Reusing_resolution_of_module_0_to_file_1_from_old_program: DiagnosticMessage; - Reusing_module_resolutions_originating_in_0_since_resolutions_are_unchanged_from_old_program: DiagnosticMessage; - Disable_strict_checking_of_generic_signatures_in_function_types: DiagnosticMessage; - Enable_strict_checking_of_function_types: DiagnosticMessage; - Enable_strict_checking_of_property_initialization_in_classes: DiagnosticMessage; - Numeric_separators_are_not_allowed_here: DiagnosticMessage; - Multiple_consecutive_numeric_separators_are_not_permitted: DiagnosticMessage; - Found_package_json_at_0_Package_ID_is_1: DiagnosticMessage; - Whether_to_keep_outdated_console_output_in_watch_mode_instead_of_clearing_the_screen: DiagnosticMessage; - All_imports_in_import_declaration_are_unused: DiagnosticMessage; - Found_1_error_Watching_for_file_changes: DiagnosticMessage; - Found_0_errors_Watching_for_file_changes: DiagnosticMessage; - Resolve_keyof_to_string_valued_property_names_only_no_numbers_or_symbols: DiagnosticMessage; - _0_is_declared_but_never_used: DiagnosticMessage; - Include_modules_imported_with_json_extension: DiagnosticMessage; - All_destructured_elements_are_unused: DiagnosticMessage; - All_variables_are_unused: DiagnosticMessage; - Definitions_of_the_following_identifiers_conflict_with_those_in_another_file_Colon_0: DiagnosticMessage; - Conflicts_are_in_this_file: DiagnosticMessage; - _0_was_also_declared_here: DiagnosticMessage; - and_here: DiagnosticMessage; - Projects_to_reference: DiagnosticMessage; - Enable_project_compilation: DiagnosticMessage; - Project_references_may_not_form_a_circular_graph_Cycle_detected_Colon_0: DiagnosticMessage; - Composite_projects_may_not_disable_declaration_emit: DiagnosticMessage; - Output_file_0_has_not_been_built_from_source_file_1: DiagnosticMessage; - Referenced_project_0_must_have_setting_composite_Colon_true: DiagnosticMessage; - File_0_is_not_in_project_file_list_Projects_must_list_all_files_or_use_an_include_pattern: DiagnosticMessage; - Cannot_prepend_project_0_because_it_does_not_have_outFile_set: DiagnosticMessage; - Output_file_0_from_project_1_does_not_exist: DiagnosticMessage; - Project_0_is_out_of_date_because_oldest_output_1_is_older_than_newest_input_2: DiagnosticMessage; - Project_0_is_up_to_date_because_newest_input_1_is_older_than_oldest_output_2: DiagnosticMessage; - Project_0_is_out_of_date_because_output_file_1_does_not_exist: DiagnosticMessage; - Project_0_is_out_of_date_because_its_dependency_1_is_out_of_date: DiagnosticMessage; - Project_0_is_up_to_date_with_d_ts_files_from_its_dependencies: DiagnosticMessage; - Projects_in_this_build_Colon_0: DiagnosticMessage; - A_non_dry_build_would_delete_the_following_files_Colon_0: DiagnosticMessage; - A_non_dry_build_would_build_project_0: DiagnosticMessage; - Building_project_0: DiagnosticMessage; - Updating_output_timestamps_of_project_0: DiagnosticMessage; - delete_this_Project_0_is_up_to_date_because_it_was_previously_built: DiagnosticMessage; - Project_0_is_up_to_date: DiagnosticMessage; - Skipping_build_of_project_0_because_its_dependency_1_has_errors: DiagnosticMessage; - Project_0_can_t_be_built_because_its_dependency_1_has_errors: DiagnosticMessage; - Build_one_or_more_projects_and_their_dependencies_if_out_of_date: DiagnosticMessage; - Delete_the_outputs_of_all_projects: DiagnosticMessage; - Enable_verbose_logging: DiagnosticMessage; - Show_what_would_be_built_or_deleted_if_specified_with_clean: DiagnosticMessage; - Build_all_projects_including_those_that_appear_to_be_up_to_date: DiagnosticMessage; - Option_build_must_be_the_first_command_line_argument: DiagnosticMessage; - Options_0_and_1_cannot_be_combined: DiagnosticMessage; - Skipping_clean_because_not_all_projects_could_be_located: DiagnosticMessage; - The_expected_type_comes_from_property_0_which_is_declared_here_on_type_1: DiagnosticMessage; - The_expected_type_comes_from_this_index_signature: DiagnosticMessage; - Variable_0_implicitly_has_an_1_type: DiagnosticMessage; - Parameter_0_implicitly_has_an_1_type: DiagnosticMessage; - Member_0_implicitly_has_an_1_type: DiagnosticMessage; - new_expression_whose_target_lacks_a_construct_signature_implicitly_has_an_any_type: DiagnosticMessage; - _0_which_lacks_return_type_annotation_implicitly_has_an_1_return_type: DiagnosticMessage; - Function_expression_which_lacks_return_type_annotation_implicitly_has_an_0_return_type: DiagnosticMessage; - Construct_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: DiagnosticMessage; - Element_implicitly_has_an_any_type_because_index_expression_is_not_of_type_number: DiagnosticMessage; - Could_not_find_a_declaration_file_for_module_0_1_implicitly_has_an_any_type: DiagnosticMessage; - Element_implicitly_has_an_any_type_because_type_0_has_no_index_signature: DiagnosticMessage; - Object_literal_s_property_0_implicitly_has_an_1_type: DiagnosticMessage; - Rest_parameter_0_implicitly_has_an_any_type: DiagnosticMessage; - Call_signature_which_lacks_return_type_annotation_implicitly_has_an_any_return_type: DiagnosticMessage; - _0_implicitly_has_type_any_because_it_does_not_have_a_type_annotation_and_is_referenced_directly_or_indirectly_in_its_own_initializer: DiagnosticMessage; - _0_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: DiagnosticMessage; - Function_implicitly_has_return_type_any_because_it_does_not_have_a_return_type_annotation_and_is_referenced_directly_or_indirectly_in_one_of_its_return_expressions: DiagnosticMessage; - Generator_implicitly_has_type_0_because_it_does_not_yield_any_values_Consider_supplying_a_return_type: DiagnosticMessage; - JSX_element_implicitly_has_type_any_because_no_interface_JSX_0_exists: DiagnosticMessage; - Unreachable_code_detected: DiagnosticMessage; - Unused_label: DiagnosticMessage; - Fallthrough_case_in_switch: DiagnosticMessage; - Not_all_code_paths_return_a_value: DiagnosticMessage; - Binding_element_0_implicitly_has_an_1_type: DiagnosticMessage; - Property_0_implicitly_has_type_any_because_its_set_accessor_lacks_a_parameter_type_annotation: DiagnosticMessage; - Property_0_implicitly_has_type_any_because_its_get_accessor_lacks_a_return_type_annotation: DiagnosticMessage; - Variable_0_implicitly_has_type_1_in_some_locations_where_its_type_cannot_be_determined: DiagnosticMessage; - Try_npm_install_types_Slash_0_if_it_exists_or_add_a_new_declaration_d_ts_file_containing_declare_module_0: DiagnosticMessage; - Dynamic_import_s_specifier_must_be_of_type_string_but_here_has_type_0: DiagnosticMessage; - Enables_emit_interoperability_between_CommonJS_and_ES_Modules_via_creation_of_namespace_objects_for_all_imports_Implies_allowSyntheticDefaultImports: DiagnosticMessage; - Type_originates_at_this_import_A_namespace_style_import_cannot_be_called_or_constructed_and_will_cause_a_failure_at_runtime_Consider_using_a_default_import_or_import_require_here_instead: DiagnosticMessage; - Mapped_object_type_implicitly_has_an_any_template_type: DiagnosticMessage; - If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_Slash_Slashgithub_com_SlashDefinitelyTyped_SlashDefinitelyTyped_Slashtree_Slashmaster_Slashtypes_Slash_0: DiagnosticMessage; - You_cannot_rename_this_element: DiagnosticMessage; - You_cannot_rename_elements_that_are_defined_in_the_standard_TypeScript_library: DiagnosticMessage; - import_can_only_be_used_in_a_ts_file: DiagnosticMessage; - export_can_only_be_used_in_a_ts_file: DiagnosticMessage; - type_parameter_declarations_can_only_be_used_in_a_ts_file: DiagnosticMessage; - implements_clauses_can_only_be_used_in_a_ts_file: DiagnosticMessage; - interface_declarations_can_only_be_used_in_a_ts_file: DiagnosticMessage; - module_declarations_can_only_be_used_in_a_ts_file: DiagnosticMessage; - type_aliases_can_only_be_used_in_a_ts_file: DiagnosticMessage; - _0_can_only_be_used_in_a_ts_file: DiagnosticMessage; - types_can_only_be_used_in_a_ts_file: DiagnosticMessage; - type_arguments_can_only_be_used_in_a_ts_file: DiagnosticMessage; - parameter_modifiers_can_only_be_used_in_a_ts_file: DiagnosticMessage; - non_null_assertions_can_only_be_used_in_a_ts_file: DiagnosticMessage; - enum_declarations_can_only_be_used_in_a_ts_file: DiagnosticMessage; - type_assertion_expressions_can_only_be_used_in_a_ts_file: DiagnosticMessage; - Octal_literal_types_must_use_ES2015_syntax_Use_the_syntax_0: DiagnosticMessage; - Octal_literals_are_not_allowed_in_enums_members_initializer_Use_the_syntax_0: DiagnosticMessage; - Report_errors_in_js_files: DiagnosticMessage; - JSDoc_types_can_only_be_used_inside_documentation_comments: DiagnosticMessage; - JSDoc_typedef_tag_should_either_have_a_type_annotation_or_be_followed_by_property_or_member_tags: DiagnosticMessage; - JSDoc_0_is_not_attached_to_a_class: DiagnosticMessage; - JSDoc_0_1_does_not_match_the_extends_2_clause: DiagnosticMessage; - JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name: DiagnosticMessage; - Class_declarations_cannot_have_more_than_one_augments_or_extends_tag: DiagnosticMessage; - Expected_0_type_arguments_provide_these_with_an_extends_tag: DiagnosticMessage; - Expected_0_1_type_arguments_provide_these_with_an_extends_tag: DiagnosticMessage; - JSDoc_may_only_appear_in_the_last_parameter_of_a_signature: DiagnosticMessage; - JSDoc_param_tag_has_name_0_but_there_is_no_parameter_with_that_name_It_would_match_arguments_if_it_had_an_array_type: DiagnosticMessage; - Only_identifiers_Slashqualified_names_with_optional_type_arguments_are_currently_supported_in_a_class_extends_clause: DiagnosticMessage; - class_expressions_are_not_currently_supported: DiagnosticMessage; - Language_service_is_disabled: DiagnosticMessage; - JSX_attributes_must_only_be_assigned_a_non_empty_expression: DiagnosticMessage; - JSX_elements_cannot_have_multiple_attributes_with_the_same_name: DiagnosticMessage; - Expected_corresponding_JSX_closing_tag_for_0: DiagnosticMessage; - JSX_attribute_expected: DiagnosticMessage; - Cannot_use_JSX_unless_the_jsx_flag_is_provided: DiagnosticMessage; - A_constructor_cannot_contain_a_super_call_when_its_class_extends_null: DiagnosticMessage; - An_unary_expression_with_the_0_operator_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: DiagnosticMessage; - A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Consider_enclosing_the_expression_in_parentheses: DiagnosticMessage; - JSX_element_0_has_no_corresponding_closing_tag: DiagnosticMessage; - super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class: DiagnosticMessage; - Unknown_type_acquisition_option_0: DiagnosticMessage; - super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class: DiagnosticMessage; - _0_is_not_a_valid_meta_property_for_keyword_1_Did_you_mean_2: DiagnosticMessage; - Meta_property_0_is_only_allowed_in_the_body_of_a_function_declaration_function_expression_or_constructor: DiagnosticMessage; - JSX_fragment_has_no_corresponding_closing_tag: DiagnosticMessage; - Expected_corresponding_closing_tag_for_JSX_fragment: DiagnosticMessage; - JSX_fragment_is_not_supported_when_using_jsxFactory: DiagnosticMessage; - JSX_fragment_is_not_supported_when_using_an_inline_JSX_factory_pragma: DiagnosticMessage; - Circularity_detected_while_resolving_configuration_Colon_0: DiagnosticMessage; - A_path_in_an_extends_option_must_be_relative_or_rooted_but_0_is_not: DiagnosticMessage; - The_files_list_in_config_file_0_is_empty: DiagnosticMessage; - No_inputs_were_found_in_config_file_0_Specified_include_paths_were_1_and_exclude_paths_were_2: DiagnosticMessage; - File_is_a_CommonJS_module_it_may_be_converted_to_an_ES6_module: DiagnosticMessage; - This_constructor_function_may_be_converted_to_a_class_declaration: DiagnosticMessage; - Import_may_be_converted_to_a_default_import: DiagnosticMessage; - JSDoc_types_may_be_moved_to_TypeScript_types: DiagnosticMessage; - require_call_may_be_converted_to_an_import: DiagnosticMessage; - Add_missing_super_call: DiagnosticMessage; - Make_super_call_the_first_statement_in_the_constructor: DiagnosticMessage; - Change_extends_to_implements: DiagnosticMessage; - Remove_declaration_for_Colon_0: DiagnosticMessage; - Remove_import_from_0: DiagnosticMessage; - Implement_interface_0: DiagnosticMessage; - Implement_inherited_abstract_class: DiagnosticMessage; - Add_0_to_unresolved_variable: DiagnosticMessage; - Remove_destructuring: DiagnosticMessage; - Remove_variable_statement: DiagnosticMessage; - Import_0_from_module_1: DiagnosticMessage; - Change_0_to_1: DiagnosticMessage; - Add_0_to_existing_import_declaration_from_1: DiagnosticMessage; - Declare_property_0: DiagnosticMessage; - Add_index_signature_for_property_0: DiagnosticMessage; - Disable_checking_for_this_file: DiagnosticMessage; - Ignore_this_error_message: DiagnosticMessage; - Initialize_property_0_in_the_constructor: DiagnosticMessage; - Initialize_static_property_0: DiagnosticMessage; - Change_spelling_to_0: DiagnosticMessage; - Declare_method_0: DiagnosticMessage; - Declare_static_method_0: DiagnosticMessage; - Prefix_0_with_an_underscore: DiagnosticMessage; - Rewrite_as_the_indexed_access_type_0: DiagnosticMessage; - Declare_static_property_0: DiagnosticMessage; - Call_decorator_expression: DiagnosticMessage; - Add_async_modifier_to_containing_function: DiagnosticMessage; - Convert_function_to_an_ES2015_class: DiagnosticMessage; - Convert_function_0_to_class: DiagnosticMessage; - Extract_to_0_in_1: DiagnosticMessage; - Extract_function: DiagnosticMessage; - Extract_constant: DiagnosticMessage; - Extract_to_0_in_enclosing_scope: DiagnosticMessage; - Extract_to_0_in_1_scope: DiagnosticMessage; - Annotate_with_type_from_JSDoc: DiagnosticMessage; - Annotate_with_types_from_JSDoc: DiagnosticMessage; - Infer_type_of_0_from_usage: DiagnosticMessage; - Infer_parameter_types_from_usage: DiagnosticMessage; - Convert_to_default_import: DiagnosticMessage; - Install_0: DiagnosticMessage; - Replace_import_with_0: DiagnosticMessage; - Use_synthetic_default_member: DiagnosticMessage; - Convert_to_ES6_module: DiagnosticMessage; - Add_undefined_type_to_property_0: DiagnosticMessage; - Add_initializer_to_property_0: DiagnosticMessage; - Add_definite_assignment_assertion_to_property_0: DiagnosticMessage; - Add_all_missing_members: DiagnosticMessage; - Infer_all_types_from_usage: DiagnosticMessage; - Delete_all_unused_declarations: DiagnosticMessage; - Prefix_all_unused_declarations_with_where_possible: DiagnosticMessage; - Fix_all_detected_spelling_errors: DiagnosticMessage; - Add_initializers_to_all_uninitialized_properties: DiagnosticMessage; - Add_definite_assignment_assertions_to_all_uninitialized_properties: DiagnosticMessage; - Add_undefined_type_to_all_uninitialized_properties: DiagnosticMessage; - Change_all_jsdoc_style_types_to_TypeScript: DiagnosticMessage; - Change_all_jsdoc_style_types_to_TypeScript_and_add_undefined_to_nullable_types: DiagnosticMessage; - Implement_all_unimplemented_interfaces: DiagnosticMessage; - Install_all_missing_types_packages: DiagnosticMessage; - Rewrite_all_as_indexed_access_types: DiagnosticMessage; - Convert_all_to_default_imports: DiagnosticMessage; - Make_all_super_calls_the_first_statement_in_their_constructor: DiagnosticMessage; - Add_qualifier_to_all_unresolved_variables_matching_a_member_name: DiagnosticMessage; - Change_all_extended_interfaces_to_implements: DiagnosticMessage; - Add_all_missing_super_calls: DiagnosticMessage; - Implement_all_inherited_abstract_classes: DiagnosticMessage; - Add_all_missing_async_modifiers: DiagnosticMessage; - Add_ts_ignore_to_all_error_messages: DiagnosticMessage; - Annotate_everything_with_types_from_JSDoc: DiagnosticMessage; - Add_to_all_uncalled_decorators: DiagnosticMessage; - Convert_all_constructor_functions_to_classes: DiagnosticMessage; - Generate_get_and_set_accessors: DiagnosticMessage; - Convert_require_to_import: DiagnosticMessage; - Convert_all_require_to_import: DiagnosticMessage; - Move_to_a_new_file: DiagnosticMessage; - Remove_unreachable_code: DiagnosticMessage; - Remove_all_unreachable_code: DiagnosticMessage; - Add_missing_typeof: DiagnosticMessage; - Remove_unused_label: DiagnosticMessage; - Remove_all_unused_labels: DiagnosticMessage; - Convert_0_to_mapped_object_type: DiagnosticMessage; - Convert_namespace_import_to_named_imports: DiagnosticMessage; - Convert_named_imports_to_namespace_import: DiagnosticMessage; - Add_or_remove_braces_in_an_arrow_function: DiagnosticMessage; - Add_braces_to_arrow_function: DiagnosticMessage; - Remove_braces_from_arrow_function: DiagnosticMessage; - Convert_default_export_to_named_export: DiagnosticMessage; - Convert_named_export_to_default_export: DiagnosticMessage; - Add_missing_enum_member_0: DiagnosticMessage; - Add_all_missing_imports: DiagnosticMessage; - }; -} declare namespace ts { type ErrorCallback = (message: DiagnosticMessage, length: number) => void; - function tokenIsIdentifierOrKeyword(token: SyntaxKind): boolean; - function tokenIsIdentifierOrKeywordOrGreaterThan(token: SyntaxKind): boolean; interface Scanner { getStartPos(): number; getToken(): SyntaxKind; @@ -5966,7 +3062,6 @@ declare namespace ts { isIdentifier(): boolean; isReservedWord(): boolean; isUnterminated(): boolean; - getTokenFlags(): TokenFlags; reScanGreaterToken(): SyntaxKind; reScanSlashToken(): SyntaxKind; reScanTemplateToken(): SyntaxKind; @@ -5986,25 +3081,14 @@ declare namespace ts { scanRange(start: number, length: number, callback: () => T): T; tryScan(callback: () => T): T; } - function isUnicodeIdentifierStart(code: number, languageVersion: ScriptTarget | undefined): boolean; function tokenToString(t: SyntaxKind): string | undefined; - function stringToToken(s: string): SyntaxKind | undefined; - function computeLineStarts(text: string): number[]; function getPositionOfLineAndCharacter(sourceFile: SourceFileLike, line: number, character: number): number; - function computePositionOfLineAndCharacter(lineStarts: ReadonlyArray, line: number, character: number, debugText?: string): number; - function getLineStarts(sourceFile: SourceFileLike): ReadonlyArray; - /** - * We assume the first line starts at position 0 and 'position' is non-negative. - */ - function computeLineAndCharacterOfPosition(lineStarts: ReadonlyArray, position: number): LineAndCharacter; function getLineAndCharacterOfPosition(sourceFile: SourceFileLike, position: number): LineAndCharacter; function isWhiteSpaceLike(ch: number): boolean; /** Does not include line breaks. For that, see isWhiteSpaceLike. */ function isWhiteSpaceSingleLine(ch: number): boolean; function isLineBreak(ch: number): boolean; - function isOctalDigit(ch: number): boolean; function couldStartTrivia(text: string, pos: number): boolean; - function skipTrivia(text: string, pos: number, stopAfterLineBreak?: boolean, stopAtComments?: boolean): number; function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; function forEachLeadingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean, state: T) => U, state: T): U | undefined; function forEachTrailingCommentRange(text: string, pos: number, cb: (pos: number, end: number, kind: CommentKind, hasTrailingNewLine: boolean) => U): U | undefined; @@ -6017,7 +3101,6 @@ declare namespace ts { function getShebang(text: string): string | undefined; function isIdentifierStart(ch: number, languageVersion: ScriptTarget | undefined): boolean; function isIdentifierPart(ch: number, languageVersion: ScriptTarget | undefined): boolean; - function isIdentifierText(name: string, languageVersion: ScriptTarget | undefined): boolean; function createScanner(languageVersion: ScriptTarget, skipTrivia: boolean, languageVariant?: LanguageVariant, textInitial?: string, onError?: ErrorCallback, start?: number, length?: number): Scanner; } /** Non-internal stuff goes here */ @@ -6025,625 +3108,11 @@ declare namespace ts { function isExternalModuleNameRelative(moduleName: string): boolean; function sortAndDeduplicateDiagnostics(diagnostics: ReadonlyArray): T[]; } -declare namespace ts { - const emptyArray: never[]; - const resolvingEmptyArray: never[]; - const emptyMap: ReadonlyMap; - const emptyUnderscoreEscapedMap: ReadonlyUnderscoreEscapedMap; - const externalHelpersModuleNameText = "tslib"; - function getDeclarationOfKind(symbol: Symbol, kind: T["kind"]): T | undefined; - /** Create a new escaped identifier map. */ - function createUnderscoreEscapedMap(): UnderscoreEscapedMap; - function hasEntries(map: ReadonlyUnderscoreEscapedMap | undefined): map is ReadonlyUnderscoreEscapedMap; - function createSymbolTable(symbols?: ReadonlyArray): SymbolTable; - function toPath(fileName: string, basePath: string | undefined, getCanonicalFileName: (path: string) => string): Path; - function changesAffectModuleResolution(oldOptions: CompilerOptions, newOptions: CompilerOptions): boolean; - /** - * Iterates through the parent chain of a node and performs the callback on each parent until the callback - * returns a truthy value, then returns that value. - * If no such value is found, it applies the callback until the parent pointer is undefined or the callback returns "quit" - * At that point findAncestor returns undefined. - */ - function findAncestor(node: Node | undefined, callback: (element: Node) => element is T): T | undefined; - function findAncestor(node: Node | undefined, callback: (element: Node) => boolean | "quit"): Node | undefined; - /** - * Calls `callback` for each entry in the map, returning the first truthy result. - * Use `map.forEach` instead for normal iteration. - */ - function forEachEntry(map: ReadonlyUnderscoreEscapedMap, callback: (value: T, key: __String) => U | undefined): U | undefined; - function forEachEntry(map: ReadonlyMap, callback: (value: T, key: string) => U | undefined): U | undefined; - /** `forEachEntry` for just keys. */ - function forEachKey(map: ReadonlyUnderscoreEscapedMap<{}>, callback: (key: __String) => T | undefined): T | undefined; - function forEachKey(map: ReadonlyMap<{}>, callback: (key: string) => T | undefined): T | undefined; - /** Copy entries from `source` to `target`. */ - function copyEntries(source: ReadonlyUnderscoreEscapedMap, target: UnderscoreEscapedMap): void; - function copyEntries(source: ReadonlyMap, target: Map): void; - /** - * Creates a set from the elements of an array. - * - * @param array the array of input elements. - */ - function arrayToSet(array: ReadonlyArray): Map; - function arrayToSet(array: ReadonlyArray, makeKey: (value: T) => string | undefined): Map; - function arrayToSet(array: ReadonlyArray, makeKey: (value: T) => __String | undefined): UnderscoreEscapedMap; - function cloneMap(map: SymbolTable): SymbolTable; - function cloneMap(map: ReadonlyMap): Map; - function cloneMap(map: ReadonlyUnderscoreEscapedMap): UnderscoreEscapedMap; - function usingSingleLineStringWriter(action: (writer: EmitTextWriter) => void): string; - function getFullWidth(node: Node): number; - function getResolvedModule(sourceFile: SourceFile, moduleNameText: string): ResolvedModuleFull | undefined; - function setResolvedModule(sourceFile: SourceFile, moduleNameText: string, resolvedModule: ResolvedModuleFull): void; - function setResolvedTypeReferenceDirective(sourceFile: SourceFile, typeReferenceDirectiveName: string, resolvedTypeReferenceDirective: ResolvedTypeReferenceDirective): void; - function moduleResolutionIsEqualTo(oldResolution: ResolvedModuleFull, newResolution: ResolvedModuleFull): boolean; - function packageIdToString({ name, subModuleName, version }: PackageId): string; - function typeDirectiveIsEqualTo(oldResolution: ResolvedTypeReferenceDirective, newResolution: ResolvedTypeReferenceDirective): boolean; - function hasChangesInResolutions(names: ReadonlyArray, newResolutions: ReadonlyArray, oldResolutions: ReadonlyMap | undefined, comparer: (oldResolution: T, newResolution: T) => boolean): boolean; - function containsParseError(node: Node): boolean; - function getSourceFileOfNode(node: Node): SourceFile; - function getSourceFileOfNode(node: Node | undefined): SourceFile | undefined; - function isStatementWithLocals(node: Node): boolean; - function getStartPositionOfLine(line: number, sourceFile: SourceFileLike): number; - function nodePosToString(node: Node): string; - function getEndLinePosition(line: number, sourceFile: SourceFileLike): number; - /** - * Returns a value indicating whether a name is unique globally or within the current file. - * Note: This does not consider whether a name appears as a free identifier or not, so at the expression `x.y` this includes both `x` and `y`. - */ - function isFileLevelUniqueName(sourceFile: SourceFile, name: string, hasGlobalName?: PrintHandlers["hasGlobalName"]): boolean; - function nodeIsMissing(node: Node | undefined): boolean; - function nodeIsPresent(node: Node | undefined): boolean; - /** - * Appends a range of value to begin of an array, returning the array. - * - * @param to The array to which `value` is to be appended. If `to` is `undefined`, a new array - * is created if `value` was appended. - * @param from The values to append to the array. If `from` is `undefined`, nothing is - * appended. If an element of `from` is `undefined`, that element is not appended. - */ - function prependStatements(to: T[], from: ReadonlyArray | undefined): T[] | undefined; - /** - * Determine if the given comment is a triple-slash - * - * @return true if the comment is a triple-slash comment else false - */ - function isRecognizedTripleSlashComment(text: string, commentPos: number, commentEnd: number): boolean; - function isPinnedComment(text: string, start: number): boolean; - function getTokenPosOfNode(node: Node, sourceFile?: SourceFileLike, includeJsDoc?: boolean): number; - function getNonDecoratorTokenPosOfNode(node: Node, sourceFile?: SourceFileLike): number; - function getSourceTextOfNodeFromSourceFile(sourceFile: SourceFile, node: Node, includeTrivia?: boolean): string; - function getTextOfNodeFromSourceText(sourceText: string, node: Node, includeTrivia?: boolean): string; - function getTextOfNode(node: Node, includeTrivia?: boolean): string; - /** - * Note: it is expected that the `nodeArray` and the `node` are within the same file. - * For example, searching for a `SourceFile` in a `SourceFile[]` wouldn't work. - */ - function indexOfNode(nodeArray: ReadonlyArray, node: Node): number; - /** - * Gets flags that control emit behavior of a node. - */ - function getEmitFlags(node: Node): EmitFlags; - function getLiteralText(node: LiteralLikeNode, sourceFile: SourceFile): string; - function getTextOfConstantValue(value: string | number): string; - function escapeLeadingUnderscores(identifier: string): __String; - function makeIdentifierFromModuleName(moduleName: string): string; - function isBlockOrCatchScoped(declaration: Declaration): boolean; - function isCatchClauseVariableDeclarationOrBindingElement(declaration: Declaration): boolean; - function isAmbientModule(node: Node): node is AmbientModuleDeclaration; - function isModuleWithStringLiteralName(node: Node): node is ModuleDeclaration; - function isNonGlobalAmbientModule(node: Node): node is ModuleDeclaration & { - name: StringLiteral; - }; - /** - * An effective module (namespace) declaration is either - * 1. An actual declaration: namespace X { ... } - * 2. A Javascript declaration, which is: - * An identifier in a nested property access expression: Y in `X.Y.Z = { ... }` - */ - function isEffectiveModuleDeclaration(node: Node): boolean; - /** Given a symbol for a module, checks that it is a shorthand ambient module. */ - function isShorthandAmbientModuleSymbol(moduleSymbol: Symbol): boolean; - function isBlockScopedContainerTopLevel(node: Node): boolean; - function isGlobalScopeAugmentation(module: ModuleDeclaration): boolean; - function isExternalModuleAugmentation(node: Node): node is AmbientModuleDeclaration; - function isModuleAugmentationExternal(node: AmbientModuleDeclaration): boolean; - function isEffectiveExternalModule(node: SourceFile, compilerOptions: CompilerOptions): boolean; - function isBlockScope(node: Node, parentNode: Node): boolean; - function isDeclarationWithTypeParameters(node: Node): node is DeclarationWithTypeParameters; - function isAnyImportSyntax(node: Node): node is AnyImportSyntax; - function isLateVisibilityPaintedStatement(node: Node): node is LateVisibilityPaintedStatement; - function isAnyImportOrReExport(node: Node): node is AnyImportOrReExport; - function getEnclosingBlockScopeContainer(node: Node): Node; - function declarationNameToString(name: DeclarationName | QualifiedName | undefined): string; - function getNameFromIndexInfo(info: IndexInfo): string | undefined; - function getTextOfPropertyName(name: PropertyName): __String; - function entityNameToString(name: EntityNameOrEntityNameExpression): string; - function createDiagnosticForNode(node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): DiagnosticWithLocation; - function createDiagnosticForNodeArray(sourceFile: SourceFile, nodes: NodeArray, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): Diagnostic; - function createDiagnosticForNodeInSourceFile(sourceFile: SourceFile, node: Node, message: DiagnosticMessage, arg0?: string | number, arg1?: string | number, arg2?: string | number, arg3?: string | number): DiagnosticWithLocation; - function createDiagnosticForNodeFromMessageChain(node: Node, messageChain: DiagnosticMessageChain, relatedInformation?: DiagnosticRelatedInformation[]): DiagnosticWithLocation; - function getSpanOfTokenAtPosition(sourceFile: SourceFile, pos: number): TextSpan; - function getErrorSpanForNode(sourceFile: SourceFile, node: Node): TextSpan; - function isExternalOrCommonJsModule(file: SourceFile): boolean; - function isJsonSourceFile(file: SourceFile): file is JsonSourceFile; - function isEnumConst(node: EnumDeclaration): boolean; - function isVarConst(node: VariableDeclaration | VariableDeclarationList): boolean; - function isLet(node: Node): boolean; - function isSuperCall(n: Node): n is SuperCall; - function isImportCall(n: Node): n is ImportCall; - function isLiteralImportTypeNode(n: Node): n is LiteralImportTypeNode; - function isPrologueDirective(node: Node): node is PrologueDirective; - function getLeadingCommentRangesOfNode(node: Node, sourceFileOfNode: SourceFile): CommentRange[] | undefined; - function getJSDocCommentRanges(node: Node, text: string): CommentRange[] | undefined; - const fullTripleSlashReferencePathRegEx: RegExp; - const fullTripleSlashAMDReferencePathRegEx: RegExp; - function isPartOfTypeNode(node: Node): boolean; - function isChildOfNodeWithKind(node: Node, kind: SyntaxKind): boolean; - function forEachReturnStatement(body: Block, visitor: (stmt: ReturnStatement) => T): T | undefined; - function forEachYieldExpression(body: Block, visitor: (expr: YieldExpression) => void): void; - /** - * Gets the most likely element type for a TypeNode. This is not an exhaustive test - * as it assumes a rest argument can only be an array type (either T[], or Array). - * - * @param node The type node. - */ - function getRestParameterElementType(node: TypeNode | undefined): TypeNode | undefined; - function getMembersOfDeclaration(node: Declaration): NodeArray | undefined; - function isVariableLike(node: Node): node is VariableLikeDeclaration; - function isVariableLikeOrAccessor(node: Node): node is AccessorDeclaration | VariableLikeDeclaration; - function isVariableDeclarationInVariableStatement(node: VariableDeclaration): boolean; - function isValidESSymbolDeclaration(node: Node): node is VariableDeclaration | PropertyDeclaration | SignatureDeclaration; - function introducesArgumentsExoticObject(node: Node): boolean; - function unwrapInnermostStatementOfLabel(node: LabeledStatement, beforeUnwrapLabelCallback?: (node: LabeledStatement) => void): Statement; - function isFunctionBlock(node: Node): boolean; - function isObjectLiteralMethod(node: Node): node is MethodDeclaration; - function isObjectLiteralOrClassExpressionMethod(node: Node): node is MethodDeclaration; - function isIdentifierTypePredicate(predicate: TypePredicate): predicate is IdentifierTypePredicate; - function isThisTypePredicate(predicate: TypePredicate): predicate is ThisTypePredicate; - function getPropertyAssignment(objectLiteral: ObjectLiteralExpression, key: string, key2?: string): ReadonlyArray; - function getTsConfigObjectLiteralExpression(tsConfigSourceFile: TsConfigSourceFile | undefined): ObjectLiteralExpression | undefined; - function getTsConfigPropArrayElementValue(tsConfigSourceFile: TsConfigSourceFile | undefined, propKey: string, elementValue: string): StringLiteral | undefined; - function getTsConfigPropArray(tsConfigSourceFile: TsConfigSourceFile | undefined, propKey: string): ReadonlyArray; - function getContainingFunction(node: Node): SignatureDeclaration | undefined; - function getContainingClass(node: Node): ClassLikeDeclaration | undefined; - function getThisContainer(node: Node, includeArrowFunctions: boolean): Node; - function getNewTargetContainer(node: Node): Node | undefined; - /** - * Given an super call/property node, returns the closest node where - * - a super call/property access is legal in the node and not legal in the parent node the node. - * i.e. super call is legal in constructor but not legal in the class body. - * - the container is an arrow function (so caller might need to call getSuperContainer again in case it needs to climb higher) - * - a super call/property is definitely illegal in the container (but might be legal in some subnode) - * i.e. super property access is illegal in function declaration but can be legal in the statement list - */ - function getSuperContainer(node: Node, stopOnFunctions: boolean): Node; - function getImmediatelyInvokedFunctionExpression(func: Node): CallExpression | undefined; - /** - * Determines whether a node is a property or element access expression for `super`. - */ - function isSuperProperty(node: Node): node is SuperProperty; - /** - * Determines whether a node is a property or element access expression for `this`. - */ - function isThisProperty(node: Node): boolean; - function getEntityNameFromTypeNode(node: TypeNode): EntityNameOrEntityNameExpression | undefined; - function getInvokedExpression(node: CallLikeExpression): Expression; - function nodeCanBeDecorated(node: ClassDeclaration): true; - function nodeCanBeDecorated(node: ClassElement, parent: Node): boolean; - function nodeCanBeDecorated(node: Node, parent: Node, grandparent: Node): boolean; - function nodeIsDecorated(node: ClassDeclaration): boolean; - function nodeIsDecorated(node: ClassElement, parent: Node): boolean; - function nodeIsDecorated(node: Node, parent: Node, grandparent: Node): boolean; - function nodeOrChildIsDecorated(node: ClassDeclaration): boolean; - function nodeOrChildIsDecorated(node: ClassElement, parent: Node): boolean; - function nodeOrChildIsDecorated(node: Node, parent: Node, grandparent: Node): boolean; - function childIsDecorated(node: ClassDeclaration): boolean; - function childIsDecorated(node: Node, parent: Node): boolean; - function isJSXTagName(node: Node): boolean; - function isExpressionNode(node: Node): boolean; - function isInExpressionContext(node: Node): boolean; - function isExternalModuleImportEqualsDeclaration(node: Node): boolean; - function getExternalModuleImportEqualsDeclarationExpression(node: Node): Expression; - function isInternalModuleImportEqualsDeclaration(node: Node): node is ImportEqualsDeclaration; - function isSourceFileJavaScript(file: SourceFile): boolean; - function isSourceFileNotJavaScript(file: SourceFile): boolean; - function isInJavaScriptFile(node: Node | undefined): boolean; - function isInJsonFile(node: Node | undefined): boolean; - function isInJSDoc(node: Node | undefined): boolean; - function isJSDocIndexSignature(node: TypeReferenceNode | ExpressionWithTypeArguments): boolean | undefined; - /** - * Returns true if the node is a CallExpression to the identifier 'require' with - * exactly one argument (of the form 'require("name")'). - * This function does not test if the node is in a JavaScript file or not. - */ - function isRequireCall(callExpression: Node, checkArgumentIsStringLiteralLike: true): callExpression is RequireOrImportCall & { - expression: Identifier; - arguments: [StringLiteralLike]; - }; - function isRequireCall(callExpression: Node, checkArgumentIsStringLiteralLike: boolean): callExpression is CallExpression; - function isSingleOrDoubleQuote(charCode: number): boolean; - function isStringDoubleQuoted(str: StringLiteralLike, sourceFile: SourceFile): boolean; - function getDeclarationOfJSInitializer(node: Node): Node | undefined; - /** Get the initializer, taking into account defaulted Javascript initializers */ - function getEffectiveInitializer(node: HasExpressionInitializer): Expression | undefined; - /** Get the declaration initializer when it is container-like (See getJavascriptInitializer). */ - function getDeclaredJavascriptInitializer(node: HasExpressionInitializer): Expression | undefined; - /** - * Get the assignment 'initializer' -- the righthand side-- when the initializer is container-like (See getJavascriptInitializer). - * We treat the right hand side of assignments with container-like initalizers as declarations. - */ - function getAssignedJavascriptInitializer(node: Node): Expression | undefined; - /** - * Recognized Javascript container-like initializers are: - * 1. (function() {})() -- IIFEs - * 2. function() { } -- Function expressions - * 3. class { } -- Class expressions - * 4. {} -- Empty object literals - * 5. { ... } -- Non-empty object literals, when used to initialize a prototype, like `C.prototype = { m() { } }` - * - * This function returns the provided initializer, or undefined if it is not valid. - */ - function getJavascriptInitializer(initializer: Node, isPrototypeAssignment: boolean): Expression | undefined; - function isDefaultedJavascriptInitializer(node: BinaryExpression): boolean | undefined; - /** Given a Javascript initializer, return the outer name. That is, the lhs of the assignment or the declaration name. */ - function getOuterNameOfJsInitializer(node: Declaration): DeclarationName | undefined; - function getRightMostAssignedExpression(node: Expression): Expression; - function isExportsIdentifier(node: Node): boolean; - function isModuleExportsPropertyAccessExpression(node: Node): boolean; - function getSpecialPropertyAssignmentKind(expr: BinaryExpression): SpecialPropertyAssignmentKind; - function getSpecialPropertyAccessKind(lhs: PropertyAccessExpression): SpecialPropertyAssignmentKind; - function getInitializerOfBinaryExpression(expr: BinaryExpression): Expression; - function isPrototypePropertyAssignment(node: Node): boolean; - function isSpecialPropertyDeclaration(expr: PropertyAccessExpression): boolean; - function importFromModuleSpecifier(node: StringLiteralLike): AnyValidImportOrReExport; - function tryGetImportFromModuleSpecifier(node: StringLiteralLike): AnyValidImportOrReExport | undefined; - function getExternalModuleName(node: AnyImportOrReExport | ImportTypeNode): Expression | undefined; - function getNamespaceDeclarationNode(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): ImportEqualsDeclaration | NamespaceImport | undefined; - function isDefaultImport(node: ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration): boolean; - function hasQuestionToken(node: Node): boolean; - function isJSDocConstructSignature(node: Node): boolean; - function isJSDocTypeAlias(node: Node): node is JSDocTypedefTag | JSDocCallbackTag; - function isTypeAlias(node: Node): node is JSDocTypedefTag | JSDocCallbackTag | TypeAliasDeclaration; - function getJSDocCommentsAndTags(hostNode: Node): ReadonlyArray; - /** Does the opposite of `getJSDocParameterTags`: given a JSDoc parameter, finds the parameter corresponding to it. */ - function getParameterSymbolFromJSDoc(node: JSDocParameterTag): Symbol | undefined; - function getHostSignatureFromJSDoc(node: Node): SignatureDeclaration | undefined; - function getHostSignatureFromJSDocHost(host: HasJSDoc): SignatureDeclaration | undefined; - function getJSDocHost(node: Node): HasJSDoc; - function getTypeParameterFromJsDoc(node: TypeParameterDeclaration & { - parent: JSDocTemplateTag; - }): TypeParameterDeclaration | undefined; - function hasRestParameter(s: SignatureDeclaration | JSDocSignature): boolean; - function isRestParameter(node: ParameterDeclaration | JSDocParameterTag): boolean; - enum AssignmentKind { - None = 0, - Definite = 1, - Compound = 2 - } - function getAssignmentTargetKind(node: Node): AssignmentKind; - function isAssignmentTarget(node: Node): boolean; - type NodeWithPossibleHoistedDeclaration = Block | VariableStatement | WithStatement | IfStatement | SwitchStatement | CaseBlock | CaseClause | DefaultClause | LabeledStatement | ForStatement | ForInStatement | ForOfStatement | DoStatement | WhileStatement | TryStatement | CatchClause; - /** - * Indicates whether a node could contain a `var` VariableDeclarationList that contributes to - * the same `var` declaration scope as the node's parent. - */ - function isNodeWithPossibleHoistedDeclaration(node: Node): node is NodeWithPossibleHoistedDeclaration; - type ValueSignatureDeclaration = FunctionDeclaration | MethodDeclaration | ConstructorDeclaration | AccessorDeclaration | FunctionExpression | ArrowFunction; - function isValueSignatureDeclaration(node: Node): node is ValueSignatureDeclaration; - function walkUpParenthesizedTypes(node: Node): Node; - function walkUpParenthesizedExpressions(node: Node): Node; - function skipParentheses(node: Expression): Expression; - function skipParentheses(node: Node): Node; - function isDeleteTarget(node: Node): boolean; - function isNodeDescendantOf(node: Node, ancestor: Node): boolean; - function isDeclarationName(name: Node): boolean; - function isAnyDeclarationName(name: Node): boolean; - function isLiteralComputedPropertyDeclarationName(node: Node): boolean; - function isIdentifierName(node: Identifier): boolean; - function isAliasSymbolDeclaration(node: Node): boolean; - function exportAssignmentIsAlias(node: ExportAssignment | BinaryExpression): boolean; - function getEffectiveBaseTypeNode(node: ClassLikeDeclaration | InterfaceDeclaration): ExpressionWithTypeArguments | undefined; - function getClassExtendsHeritageElement(node: ClassLikeDeclaration | InterfaceDeclaration): ExpressionWithTypeArguments | undefined; - function getClassImplementsHeritageClauseElements(node: ClassLikeDeclaration): NodeArray | undefined; - /** Returns the node in an `extends` or `implements` clause of a class or interface. */ - function getAllSuperTypeNodes(node: Node): ReadonlyArray; - function getInterfaceBaseTypeNodes(node: InterfaceDeclaration): NodeArray | undefined; - function getHeritageClause(clauses: NodeArray | undefined, kind: SyntaxKind): HeritageClause | undefined; - function tryResolveScriptReference(host: ScriptReferenceHost, sourceFile: SourceFile, reference: FileReference): SourceFile | undefined; - function getAncestor(node: Node | undefined, kind: SyntaxKind): Node | undefined; - function isKeyword(token: SyntaxKind): boolean; - function isContextualKeyword(token: SyntaxKind): boolean; - function isNonContextualKeyword(token: SyntaxKind): boolean; - function isStringANonContextualKeyword(name: string): boolean; - type TriviaKind = SyntaxKind.SingleLineCommentTrivia | SyntaxKind.MultiLineCommentTrivia | SyntaxKind.NewLineTrivia | SyntaxKind.WhitespaceTrivia | SyntaxKind.ShebangTrivia | SyntaxKind.ConflictMarkerTrivia; - function isTrivia(token: SyntaxKind): token is TriviaKind; - enum FunctionFlags { - Normal = 0, - Generator = 1, - Async = 2, - Invalid = 4, - AsyncGenerator = 3 - } - function getFunctionFlags(node: SignatureDeclaration | undefined): FunctionFlags; - function isAsyncFunction(node: Node): boolean; - function isStringOrNumericLiteral(node: Node): node is StringLiteral | NumericLiteral; - /** - * A declaration has a dynamic name if both of the following are true: - * 1. The declaration has a computed property name - * 2. The computed name is *not* expressed as Symbol., where name - * is a property of the Symbol constructor that denotes a built in - * Symbol. - */ - function hasDynamicName(declaration: Declaration): declaration is DynamicNamedDeclaration; - function isDynamicName(name: DeclarationName): boolean; - /** - * Checks if the expression is of the form: - * Symbol.name - * where Symbol is literally the word "Symbol", and name is any identifierName - */ - function isWellKnownSymbolSyntactically(node: Expression): boolean; - function getPropertyNameForPropertyNameNode(name: DeclarationName): __String | undefined; - type PropertyNameLiteral = Identifier | StringLiteralLike | NumericLiteral; - function isPropertyNameLiteral(node: Node): node is PropertyNameLiteral; - function getTextOfIdentifierOrLiteral(node: PropertyNameLiteral): string; - function getEscapedTextOfIdentifierOrLiteral(node: PropertyNameLiteral): __String; - function getPropertyNameForKnownSymbolName(symbolName: string): __String; - function isKnownSymbol(symbol: Symbol): boolean; - /** - * Includes the word "Symbol" with unicode escapes - */ - function isESSymbolIdentifier(node: Node): boolean; - function isPushOrUnshiftIdentifier(node: Identifier): boolean; - function isParameterDeclaration(node: VariableLikeDeclaration): boolean; - function getRootDeclaration(node: Node): Node; - function nodeStartsNewLexicalEnvironment(node: Node): boolean; - function nodeIsSynthesized(range: TextRange): boolean; - function getOriginalSourceFile(sourceFile: SourceFile): SourceFile; - enum Associativity { - Left = 0, - Right = 1 - } - function getExpressionAssociativity(expression: Expression): Associativity; - function getOperatorAssociativity(kind: SyntaxKind, operator: SyntaxKind, hasArguments?: boolean): Associativity; - function getExpressionPrecedence(expression: Expression): number; - function getOperator(expression: Expression): SyntaxKind; - function getOperatorPrecedence(nodeKind: SyntaxKind, operatorKind: SyntaxKind, hasArguments?: boolean): number; - function getBinaryOperatorPrecedence(kind: SyntaxKind): number; - function createDiagnosticCollection(): DiagnosticCollection; - /** - * Based heavily on the abstract 'Quote'/'QuoteJSONString' operation from ECMA-262 (24.3.2.2), - * but augmented for a few select characters (e.g. lineSeparator, paragraphSeparator, nextLine) - * Note that this doesn't actually wrap the input in double quotes. - */ - function escapeString(s: string, quoteChar?: CharacterCodes.doubleQuote | CharacterCodes.singleQuote | CharacterCodes.backtick): string; - function isIntrinsicJsxName(name: __String | string): boolean; - function escapeNonAsciiString(s: string, quoteChar?: CharacterCodes.doubleQuote | CharacterCodes.singleQuote | CharacterCodes.backtick): string; - function getIndentString(level: number): string; - function getIndentSize(): number; - function createTextWriter(newLine: string): EmitTextWriter; - function getResolvedExternalModuleName(host: EmitHost, file: SourceFile, referenceFile?: SourceFile): string; - function getExternalModuleNameFromDeclaration(host: EmitHost, resolver: EmitResolver, declaration: ImportEqualsDeclaration | ImportDeclaration | ExportDeclaration | ModuleDeclaration | ImportTypeNode): string | undefined; - /** - * Resolves a local path to a path which is absolute to the base of the emit - */ - function getExternalModuleNameFromPath(host: EmitHost, fileName: string, referencePath?: string): string; - function getOwnEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost, extension: string): string; - function getDeclarationEmitOutputFilePath(sourceFile: SourceFile, host: EmitHost): string; - interface EmitFileNames { - jsFilePath: string; - sourceMapFilePath: string | undefined; - declarationFilePath: string | undefined; - declarationMapPath: string | undefined; - bundleInfoPath: string | undefined; - } - /** - * Gets the source files that are expected to have an emit output. - * - * Originally part of `forEachExpectedEmitFile`, this functionality was extracted to support - * transformations. - * - * @param host An EmitHost. - * @param targetSourceFile An optional target source file to emit. - */ - function getSourceFilesToEmit(host: EmitHost, targetSourceFile?: SourceFile): ReadonlyArray; - /** Don't call this for `--outFile`, just for `--outDir` or plain emit. `--outFile` needs additional checks. */ - function sourceFileMayBeEmitted(sourceFile: SourceFile, options: CompilerOptions, isSourceFileFromExternalLibrary: (file: SourceFile) => boolean): boolean; - function getSourceFilePathInNewDir(sourceFile: SourceFile, host: EmitHost, newDirPath: string): string; - function writeFile(host: EmitHost, diagnostics: DiagnosticCollection, fileName: string, data: string, writeByteOrderMark: boolean, sourceFiles?: ReadonlyArray): void; - function getLineOfLocalPosition(currentSourceFile: SourceFile, pos: number): number; - function getLineOfLocalPositionFromLineMap(lineMap: ReadonlyArray, pos: number): number; - function getFirstConstructorWithBody(node: ClassLikeDeclaration): ConstructorDeclaration | undefined; - /** Get the type annotation for the value parameter. */ - function getSetAccessorTypeAnnotationNode(accessor: SetAccessorDeclaration): TypeNode | undefined; - function getThisParameter(signature: SignatureDeclaration | JSDocSignature): ParameterDeclaration | undefined; - function parameterIsThisKeyword(parameter: ParameterDeclaration): boolean; - function isThisIdentifier(node: Node | undefined): boolean; - function identifierIsThisKeyword(id: Identifier): boolean; - function getAllAccessorDeclarations(declarations: NodeArray, accessor: AccessorDeclaration): AllAccessorDeclarations; - /** - * Gets the effective type annotation of a variable, parameter, or property. If the node was - * parsed in a JavaScript file, gets the type annotation from JSDoc. - */ - function getEffectiveTypeAnnotationNode(node: Node): TypeNode | undefined; - function getTypeAnnotationNode(node: Node): TypeNode | undefined; - /** - * Gets the effective return type annotation of a signature. If the node was parsed in a - * JavaScript file, gets the return type annotation from JSDoc. - */ - function getEffectiveReturnTypeNode(node: SignatureDeclaration | JSDocSignature): TypeNode | undefined; - /** - * Gets the effective type parameters. If the node was parsed in a - * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. - */ - function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray; - function getJSDocTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray; - /** - * Gets the effective type annotation of the value parameter of a set accessor. If the node - * was parsed in a JavaScript file, gets the type annotation from JSDoc. - */ - function getEffectiveSetAccessorTypeAnnotationNode(node: SetAccessorDeclaration): TypeNode | undefined; - function emitNewLineBeforeLeadingComments(lineMap: ReadonlyArray, writer: EmitTextWriter, node: TextRange, leadingComments: ReadonlyArray | undefined): void; - function emitNewLineBeforeLeadingCommentsOfPosition(lineMap: ReadonlyArray, writer: EmitTextWriter, pos: number, leadingComments: ReadonlyArray | undefined): void; - function emitNewLineBeforeLeadingCommentOfPosition(lineMap: ReadonlyArray, writer: EmitTextWriter, pos: number, commentPos: number): void; - function emitComments(text: string, lineMap: ReadonlyArray, writer: EmitTextWriter, comments: ReadonlyArray | undefined, leadingSeparator: boolean, trailingSeparator: boolean, newLine: string, writeComment: (text: string, lineMap: ReadonlyArray, writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void): void; - /** - * Detached comment is a comment at the top of file or function body that is separated from - * the next statement by space. - */ - function emitDetachedComments(text: string, lineMap: ReadonlyArray, writer: EmitTextWriter, writeComment: (text: string, lineMap: ReadonlyArray, writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string) => void, node: TextRange, newLine: string, removeComments: boolean): { - nodePos: number; - detachedCommentEndPos: number; - } | undefined; - function writeCommentRange(text: string, lineMap: ReadonlyArray, writer: EmitTextWriter, commentPos: number, commentEnd: number, newLine: string): void; - function hasModifiers(node: Node): boolean; - function hasModifier(node: Node, flags: ModifierFlags): boolean; - function hasStaticModifier(node: Node): boolean; - function hasReadonlyModifier(node: Node): boolean; - function getSelectedModifierFlags(node: Node, flags: ModifierFlags): ModifierFlags; - function getModifierFlags(node: Node): ModifierFlags; - function getModifierFlagsNoCache(node: Node): ModifierFlags; - function modifierToFlag(token: SyntaxKind): ModifierFlags; - function isLogicalOperator(token: SyntaxKind): boolean; - function isAssignmentOperator(token: SyntaxKind): boolean; - /** Get `C` given `N` if `N` is in the position `class C extends N` where `N` is an ExpressionWithTypeArguments. */ - function tryGetClassExtendingExpressionWithTypeArguments(node: Node): ClassLikeDeclaration | undefined; - function isAssignmentExpression(node: Node, excludeCompoundAssignment: true): node is AssignmentExpression; - function isAssignmentExpression(node: Node, excludeCompoundAssignment?: false): node is AssignmentExpression; - function isDestructuringAssignment(node: Node): node is DestructuringAssignment; - function isExpressionWithTypeArgumentsInClassExtendsClause(node: Node): boolean; - function isExpressionWithTypeArgumentsInClassImplementsClause(node: Node): node is ExpressionWithTypeArguments; - function isEntityNameExpression(node: Node): node is EntityNameExpression; - function isPropertyAccessEntityNameExpression(node: Node): node is PropertyAccessEntityNameExpression; - function isPrototypeAccess(node: Node): node is PropertyAccessExpression; - function isRightSideOfQualifiedNameOrPropertyAccess(node: Node): boolean; - function isEmptyObjectLiteral(expression: Node): boolean; - function isEmptyArrayLiteral(expression: Node): boolean; - function getLocalSymbolForExportDefault(symbol: Symbol): Symbol | undefined; - /** Return ".ts", ".d.ts", or ".tsx", if that is the extension. */ - function tryExtractTypeScriptExtension(fileName: string): string | undefined; - /** - * Converts a string to a base-64 encoded ASCII string. - */ - function convertToBase64(input: string): string; - function base64encode(host: { - base64encode?(input: string): string; - } | undefined, input: string): string; - function base64decode(host: { - base64decode?(input: string): string; - } | undefined, input: string): string; - function getNewLineCharacter(options: CompilerOptions | PrinterOptions, getNewLine?: () => string): string; - function formatSyntaxKind(kind: SyntaxKind | undefined): string; - function formatModifierFlags(flags: ModifierFlags | undefined): string; - function formatTransformFlags(flags: TransformFlags | undefined): string; - function formatEmitFlags(flags: EmitFlags | undefined): string; - function formatSymbolFlags(flags: SymbolFlags | undefined): string; - function formatTypeFlags(flags: TypeFlags | undefined): string; - function formatObjectFlags(flags: ObjectFlags | undefined): string; - /** - * Creates a new TextRange from the provided pos and end. - * - * @param pos The start position. - * @param end The end position. - */ - function createRange(pos: number, end: number): TextRange; - /** - * Creates a new TextRange from a provided range with a new end position. - * - * @param range A TextRange. - * @param end The new end position. - */ - function moveRangeEnd(range: TextRange, end: number): TextRange; - /** - * Creates a new TextRange from a provided range with a new start position. - * - * @param range A TextRange. - * @param pos The new Start position. - */ - function moveRangePos(range: TextRange, pos: number): TextRange; - /** - * Moves the start position of a range past any decorators. - */ - function moveRangePastDecorators(node: Node): TextRange; - /** - * Moves the start position of a range past any decorators or modifiers. - */ - function moveRangePastModifiers(node: Node): TextRange; - /** - * Determines whether a TextRange has the same start and end positions. - * - * @param range A TextRange. - */ - function isCollapsedRange(range: TextRange): boolean; - /** - * Creates a new TextRange for a token at the provides start position. - * - * @param pos The start position. - * @param token The token. - */ - function createTokenRange(pos: number, token: SyntaxKind): TextRange; - function rangeIsOnSingleLine(range: TextRange, sourceFile: SourceFile): boolean; - function rangeStartPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeEndPositionsAreOnSameLine(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeStartIsOnSameLineAsRangeEnd(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function rangeEndIsOnSameLineAsRangeStart(range1: TextRange, range2: TextRange, sourceFile: SourceFile): boolean; - function positionsAreOnSameLine(pos1: number, pos2: number, sourceFile: SourceFile): boolean; - function getStartPositionOfRange(range: TextRange, sourceFile: SourceFile): number; - /** - * Determines whether a name was originally the declaration name of an enum or namespace - * declaration. - */ - function isDeclarationNameOfEnumOrNamespace(node: Identifier): boolean; - function getInitializedVariables(node: VariableDeclarationList): ReadonlyArray; - function isWatchSet(options: CompilerOptions): boolean | undefined; - function closeFileWatcher(watcher: FileWatcher): void; - function getCheckFlags(symbol: Symbol): CheckFlags; - function getDeclarationModifierFlagsFromSymbol(s: Symbol): ModifierFlags; - function skipAlias(symbol: Symbol, checker: TypeChecker): Symbol; - /** See comment on `declareModuleMember` in `binder.ts`. */ - function getCombinedLocalAndExportSymbolFlags(symbol: Symbol): SymbolFlags; - function isWriteOnlyAccess(node: Node): boolean; - function isWriteAccess(node: Node): boolean; - function compareDataObjects(dst: any, src: any): boolean; - /** - * clears already present map by calling onDeleteExistingValue callback before deleting that key/value - */ - function clearMap(map: Map, onDeleteValue: (valueInMap: T, key: string) => void): void; - interface MutateMapOptions { - createNewValue(key: string, valueInNewMap: U): T; - onDeleteValue(existingValue: T, key: string): void; - /** - * If present this is called with the key when there is value for that key both in new map as well as existing map provided - * Caller can then decide to update or remove this key. - * If the key is removed, caller will get callback of createNewValue for that key. - * If this callback is not provided, the value of such keys is not updated. - */ - onExistingValue?(existingValue: T, valueInNewMap: U, key: string): void; - } - /** - * Mutates the map with newMap such that keys in map will be same as newMap. - */ - function mutateMap(map: Map, newMap: ReadonlyMap, options: MutateMapOptions): void; - /** Calls `callback` on `directory` and every ancestor directory it has, returning the first defined result. */ - function forEachAncestorDirectory(directory: string, callback: (directory: string) => T | undefined): T | undefined; - function isAbstractConstructorType(type: Type): boolean; - function isAbstractConstructorSymbol(symbol: Symbol): boolean; - function getClassLikeDeclarationOfSymbol(symbol: Symbol): ClassLikeDeclaration | undefined; - function getObjectFlags(type: Type): ObjectFlags; - function typeHasCallOrConstructSignatures(type: Type, checker: TypeChecker): boolean; - function forSomeAncestorDirectory(directory: string, callback: (directory: string) => boolean): boolean; - function isUMDExportSymbol(symbol: Symbol | undefined): boolean; - function showModuleSpecifier({ moduleSpecifier }: ImportDeclaration): string; - function getLastChild(node: Node): Node | undefined; - /** Add a value to a set, and return true if it wasn't already present. */ - function addToSeen(seen: Map, key: string | number): boolean; - function addToSeen(seen: Map, key: string | number, value: T): boolean; - function isObjectTypeDeclaration(node: Node): node is ObjectTypeDeclaration; -} declare namespace ts { function getDefaultLibFileName(options: CompilerOptions): string; function textSpanEnd(span: TextSpan): number; function textSpanIsEmpty(span: TextSpan): boolean; function textSpanContainsPosition(span: TextSpan, position: number): boolean; - function textRangeContainsPositionInclusive(span: TextRange, position: number): boolean; function textSpanContainsTextSpan(span: TextSpan, other: TextSpan): boolean; function textSpanOverlapsWith(span: TextSpan, other: TextSpan): boolean; function textSpanOverlap(span1: TextSpan, span2: TextSpan): TextSpan | undefined; @@ -6653,7 +3122,6 @@ declare namespace ts { function textSpanIntersectsWithPosition(span: TextSpan, position: number): boolean; function textSpanIntersection(span1: TextSpan, span2: TextSpan): TextSpan | undefined; function createTextSpan(start: number, length: number): TextSpan; - function createTextRange(pos: number, end?: number): TextRange; function createTextSpanFromBounds(start: number, end: number): TextSpan; function textChangeRangeNewSpan(range: TextChangeRange): TextSpan; function textChangeRangeIsUnchanged(range: TextChangeRange): boolean; @@ -6724,12 +3192,6 @@ declare namespace ts { function idText(identifier: Identifier): string; function symbolName(symbol: Symbol): string; function getNameOfJSDocTypedef(declaration: JSDocTypedefTag): Identifier | undefined; - /** @internal */ - function isNamedDeclaration(node: Node): node is NamedDeclaration & { - name: DeclarationName; - }; - /** @internal */ - function getNonAssignedNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined; function getNameOfDeclaration(declaration: Declaration | Expression): DeclarationName | undefined; /** * Gets the JSDoc parameter tags for the node if present. @@ -6777,16 +3239,21 @@ declare namespace ts { */ function getJSDocType(node: Node): TypeNode | undefined; /** - * Gets the return type node for the node if provided via JSDoc's return tag. + * Gets the return type node for the node if provided via JSDoc return tag or type tag. * * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function - * gets the type from inside the braces. + * gets the type from inside the braces, after the fat arrow, etc. */ function getJSDocReturnType(node: Node): TypeNode | undefined; /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray; /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray; + /** + * Gets the effective type parameters. If the node was parsed in a + * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. + */ + function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; @@ -6813,7 +3280,6 @@ declare namespace ts { function isCallSignatureDeclaration(node: Node): node is CallSignatureDeclaration; function isConstructSignatureDeclaration(node: Node): node is ConstructSignatureDeclaration; function isIndexSignatureDeclaration(node: Node): node is IndexSignatureDeclaration; - function isGetOrSetAccessorDeclaration(node: Node): node is AccessorDeclaration; function isTypePredicateNode(node: Node): node is TypePredicateNode; function isTypeReferenceNode(node: Node): node is TypeReferenceNode; function isFunctionTypeNode(node: Node): node is FunctionTypeNode; @@ -6957,39 +3423,25 @@ declare namespace ts { function isJSDocSignature(node: Node): node is JSDocSignature; } declare namespace ts { - function isSyntaxList(n: Node): n is SyntaxList; - function isNode(node: Node): boolean; - function isNodeKind(kind: SyntaxKind): boolean; /** * True if node is of some token syntax kind. * For example, this is true for an IfKeyword but not for an IfStatement. * Literals are considered tokens, except TemplateLiteral, but does include TemplateHead/Middle/Tail. */ function isToken(n: Node): boolean; - function isNodeArray(array: ReadonlyArray): array is NodeArray; - function isLiteralKind(kind: SyntaxKind): boolean; function isLiteralExpression(node: Node): node is LiteralExpression; - function isTemplateLiteralKind(kind: SyntaxKind): boolean; type TemplateLiteralToken = NoSubstitutionTemplateLiteral | TemplateHead | TemplateMiddle | TemplateTail; function isTemplateLiteralToken(node: Node): node is TemplateLiteralToken; function isTemplateMiddleOrTemplateTail(node: Node): node is TemplateMiddle | TemplateTail; function isStringTextContainingNode(node: Node): node is StringLiteral | TemplateLiteralToken; - function isGeneratedIdentifier(node: Node): node is GeneratedIdentifier; - function isModifierKind(token: SyntaxKind): token is Modifier["kind"]; - function isParameterPropertyModifier(kind: SyntaxKind): boolean; - function isClassMemberModifier(idToken: SyntaxKind): boolean; function isModifier(node: Node): node is Modifier; function isEntityName(node: Node): node is EntityName; function isPropertyName(node: Node): node is PropertyName; function isBindingName(node: Node): node is BindingName; function isFunctionLike(node: Node): node is SignatureDeclaration; - function isFunctionLikeDeclaration(node: Node): node is FunctionLikeDeclaration; - function isFunctionLikeKind(kind: SyntaxKind): boolean; - function isFunctionOrModuleBlock(node: Node): boolean; function isClassElement(node: Node): node is ClassElement; function isClassLike(node: Node): node is ClassLikeDeclaration; function isAccessor(node: Node): node is AccessorDeclaration; - function isMethodOrAccessor(node: Node): node is MethodDeclaration | AccessorDeclaration; function isTypeElement(node: Node): node is TypeElement; function isClassOrTypeElement(node: Node): node is ClassElement | TypeElement; function isObjectLiteralElementLike(node: Node): node is ObjectLiteralElementLike; @@ -7000,409 +3452,24 @@ declare namespace ts { */ function isTypeNode(node: Node): node is TypeNode; function isFunctionOrConstructorTypeNode(node: Node): node is FunctionTypeNode | ConstructorTypeNode; - function isBindingPattern(node: Node | undefined): node is BindingPattern; - function isAssignmentPattern(node: Node): node is AssignmentPattern; - function isArrayBindingElement(node: Node): node is ArrayBindingElement; - /** - * Determines whether the BindingOrAssignmentElement is a BindingElement-like declaration - */ - function isDeclarationBindingElement(bindingElement: BindingOrAssignmentElement): bindingElement is VariableDeclaration | ParameterDeclaration | BindingElement; - /** - * Determines whether a node is a BindingOrAssignmentPattern - */ - function isBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is BindingOrAssignmentPattern; - /** - * Determines whether a node is an ObjectBindingOrAssignmentPattern - */ - function isObjectBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is ObjectBindingOrAssignmentPattern; - /** - * Determines whether a node is an ArrayBindingOrAssignmentPattern - */ - function isArrayBindingOrAssignmentPattern(node: BindingOrAssignmentElementTarget): node is ArrayBindingOrAssignmentPattern; - function isPropertyAccessOrQualifiedNameOrImportTypeNode(node: Node): node is PropertyAccessExpression | QualifiedName | ImportTypeNode; function isPropertyAccessOrQualifiedName(node: Node): node is PropertyAccessExpression | QualifiedName; function isCallLikeExpression(node: Node): node is CallLikeExpression; function isCallOrNewExpression(node: Node): node is CallExpression | NewExpression; function isTemplateLiteral(node: Node): node is TemplateLiteral; - function isLeftHandSideExpression(node: Node): node is LeftHandSideExpression; - function isUnaryExpression(node: Node): node is UnaryExpression; - function isUnaryExpressionWithWrite(expr: Node): expr is PrefixUnaryExpression | PostfixUnaryExpression; - /** - * Determines whether a node is an expression based only on its kind. - * Use `isExpressionNode` if not in transforms. - */ - function isExpression(node: Node): node is Expression; function isAssertionExpression(node: Node): node is AssertionExpression; - function isPartiallyEmittedExpression(node: Node): node is PartiallyEmittedExpression; - function isNotEmittedStatement(node: Node): node is NotEmittedStatement; - function isNotEmittedOrPartiallyEmittedNode(node: Node): node is NotEmittedStatement | PartiallyEmittedExpression; function isIterationStatement(node: Node, lookInLabeledStatements: false): node is IterationStatement; function isIterationStatement(node: Node, lookInLabeledStatements: boolean): node is IterationStatement | LabeledStatement; - function isForInOrOfStatement(node: Node): node is ForInOrOfStatement; - function isConciseBody(node: Node): node is ConciseBody; - function isFunctionBody(node: Node): node is FunctionBody; - function isForInitializer(node: Node): node is ForInitializer; - function isModuleBody(node: Node): node is ModuleBody; - function isNamespaceBody(node: Node): node is NamespaceBody; - function isJSDocNamespaceBody(node: Node): node is JSDocNamespaceBody; - function isNamedImportBindings(node: Node): node is NamedImportBindings; - function isModuleOrEnumDeclaration(node: Node): node is ModuleDeclaration | EnumDeclaration; - function isDeclaration(node: Node): node is NamedDeclaration; - function isDeclarationStatement(node: Node): node is DeclarationStatement; - /** - * Determines whether the node is a statement that is not also a declaration - */ - function isStatementButNotDeclaration(node: Node): node is Statement; - function isStatement(node: Node): node is Statement; - function isModuleReference(node: Node): node is ModuleReference; - function isJsxTagNameExpression(node: Node): node is JsxTagNameExpression; - function isJsxChild(node: Node): node is JsxChild; - function isJsxAttributeLike(node: Node): node is JsxAttributeLike; - function isStringLiteralOrJsxExpression(node: Node): node is StringLiteral | JsxExpression; function isJsxOpeningLikeElement(node: Node): node is JsxOpeningLikeElement; function isCaseOrDefaultClause(node: Node): node is CaseOrDefaultClause; - /** True if node is of some JSDoc syntax kind. */ - function isJSDocNode(node: Node): boolean; /** True if node is of a kind that may contain comment text. */ function isJSDocCommentContainingNode(node: Node): boolean; - function isJSDocTag(node: Node): boolean; function isSetAccessor(node: Node): node is SetAccessorDeclaration; function isGetAccessor(node: Node): node is GetAccessorDeclaration; - /** True if has jsdoc nodes attached to it. */ - function hasJSDocNodes(node: Node): node is HasJSDoc; - /** True if has type node attached to it. */ - function hasType(node: Node): node is HasType; - function couldHaveType(node: Node): node is HasType; - /** True if has initializer node attached to it. */ - function hasInitializer(node: Node): node is HasInitializer; - /** True if has initializer node attached to it. */ - function hasOnlyExpressionInitializer(node: Node): node is HasExpressionInitializer; function isObjectLiteralElement(node: Node): node is ObjectLiteralElement; - function isTypeReferenceType(node: Node): node is TypeReferenceType; - function guessIndentation(lines: string[]): number | undefined; function isStringLiteralLike(node: Node): node is StringLiteralLike; } -declare namespace ts { - /** @internal */ - function isNamedImportsOrExports(node: Node): node is NamedImportsOrExports; - interface ObjectAllocator { - getNodeConstructor(): new (kind: SyntaxKind, pos?: number, end?: number) => Node; - getTokenConstructor(): new (kind: TKind, pos?: number, end?: number) => Token; - getIdentifierConstructor(): new (kind: SyntaxKind.Identifier, pos?: number, end?: number) => Identifier; - getSourceFileConstructor(): new (kind: SyntaxKind.SourceFile, pos?: number, end?: number) => SourceFile; - getSymbolConstructor(): new (flags: SymbolFlags, name: __String) => Symbol; - getTypeConstructor(): new (checker: TypeChecker, flags: TypeFlags) => Type; - getSignatureConstructor(): new (checker: TypeChecker) => Signature; - getSourceMapSourceConstructor(): new (fileName: string, text: string, skipTrivia?: (pos: number) => number) => SourceMapSource; - } - let objectAllocator: ObjectAllocator; - function formatStringFromArgs(text: string, args: ArrayLike, baseIndex?: number): string; - let localizedDiagnosticMessages: MapLike | undefined; - function getLocaleSpecificMessage(message: DiagnosticMessage): string; - function createFileDiagnostic(file: SourceFile, start: number, length: number, message: DiagnosticMessage, ...args: (string | number | undefined)[]): DiagnosticWithLocation; - function formatMessage(_dummy: any, message: DiagnosticMessage): string; - function createCompilerDiagnostic(message: DiagnosticMessage, ...args: (string | number | undefined)[]): Diagnostic; - function createCompilerDiagnosticFromMessageChain(chain: DiagnosticMessageChain): Diagnostic; - function chainDiagnosticMessages(details: DiagnosticMessageChain | undefined, message: DiagnosticMessage, ...args: (string | undefined)[]): DiagnosticMessageChain; - function concatenateDiagnosticMessageChains(headChain: DiagnosticMessageChain, tailChain: DiagnosticMessageChain): DiagnosticMessageChain; - function compareDiagnostics(d1: Diagnostic, d2: Diagnostic): Comparison; - function compareDiagnosticsSkipRelatedInformation(d1: Diagnostic, d2: Diagnostic): Comparison; - function getEmitScriptTarget(compilerOptions: CompilerOptions): ScriptTarget; - function getEmitModuleKind(compilerOptions: { - module?: CompilerOptions["module"]; - target?: CompilerOptions["target"]; - }): ModuleKind; - function getEmitModuleResolutionKind(compilerOptions: CompilerOptions): ModuleResolutionKind; - function unreachableCodeIsError(options: CompilerOptions): boolean; - function unusedLabelIsError(options: CompilerOptions): boolean; - function getAreDeclarationMapsEnabled(options: CompilerOptions): boolean; - function getAllowSyntheticDefaultImports(compilerOptions: CompilerOptions): boolean; - function getEmitDeclarations(compilerOptions: CompilerOptions): boolean; - type StrictOptionName = "noImplicitAny" | "noImplicitThis" | "strictNullChecks" | "strictFunctionTypes" | "strictPropertyInitialization" | "alwaysStrict"; - function getStrictOptionValue(compilerOptions: CompilerOptions, flag: StrictOptionName): boolean; - function hasZeroOrOneAsteriskCharacter(str: string): boolean; - /** - * Internally, we represent paths as strings with '/' as the directory separator. - * When we make system calls (eg: LanguageServiceHost.getDirectory()), - * we expect the host to correctly handle paths in our specified format. - */ - const directorySeparator = "/"; - /** - * Normalize path separators. - */ - function normalizeSlashes(path: string): string; - /** - * Returns length of the root part of a path or URL (i.e. length of "/", "x:/", "//server/share/, file:///user/files"). - * - * For example: - * ```ts - * getRootLength("a") === 0 // "" - * getRootLength("/") === 1 // "/" - * getRootLength("c:") === 2 // "c:" - * getRootLength("c:d") === 0 // "" - * getRootLength("c:/") === 3 // "c:/" - * getRootLength("c:\\") === 3 // "c:\\" - * getRootLength("//server") === 7 // "//server" - * getRootLength("//server/share") === 8 // "//server/" - * getRootLength("\\\\server") === 7 // "\\\\server" - * getRootLength("\\\\server\\share") === 8 // "\\\\server\\" - * getRootLength("file:///path") === 8 // "file:///" - * getRootLength("file:///c:") === 10 // "file:///c:" - * getRootLength("file:///c:d") === 8 // "file:///" - * getRootLength("file:///c:/path") === 11 // "file:///c:/" - * getRootLength("file://server") === 13 // "file://server" - * getRootLength("file://server/path") === 14 // "file://server/" - * getRootLength("http://server") === 13 // "http://server" - * getRootLength("http://server/path") === 14 // "http://server/" - * ``` - */ - function getRootLength(path: string): number; - function normalizePath(path: string): string; - function normalizePathAndParts(path: string): { - path: string; - parts: string[]; - }; - /** - * Returns the path except for its basename. Semantics align with NodeJS's `path.dirname` - * except that we support URL's as well. - * - * ```ts - * getDirectoryPath("/path/to/file.ext") === "/path/to" - * getDirectoryPath("/path/to/") === "/path" - * getDirectoryPath("/") === "/" - * ``` - */ - function getDirectoryPath(path: Path): Path; - /** - * Returns the path except for its basename. Semantics align with NodeJS's `path.dirname` - * except that we support URL's as well. - * - * ```ts - * getDirectoryPath("/path/to/file.ext") === "/path/to" - * getDirectoryPath("/path/to/") === "/path" - * getDirectoryPath("/") === "/" - * ``` - */ - function getDirectoryPath(path: string): string; - function isUrl(path: string): boolean; - function pathIsRelative(path: string): boolean; - /** - * Determines whether a path is an absolute path (e.g. starts with `/`, or a dos path - * like `c:`, `c:\` or `c:/`). - */ - function isRootedDiskPath(path: string): boolean; - /** - * Determines whether a path consists only of a path root. - */ - function isDiskPathRoot(path: string): boolean; - function convertToRelativePath(absoluteOrRelativePath: string, basePath: string, getCanonicalFileName: (path: string) => string): string; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is not normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - */ - function getPathComponents(path: string, currentDirectory?: string): string[]; - /** - * Reduce an array of path components to a more simplified path by navigating any - * `"."` or `".."` entries in the path. - */ - function reducePathComponents(components: ReadonlyArray): string[]; - /** - * Parse a path into an array containing a root component (at index 0) and zero or more path - * components (at indices > 0). The result is normalized. - * If the path is relative, the root component is `""`. - * If the path is absolute, the root component includes the first path separator (`/`). - */ - function getNormalizedPathComponents(path: string, currentDirectory: string | undefined): string[]; - function getNormalizedAbsolutePath(fileName: string, currentDirectory: string | undefined): string; - /** - * Formats a parsed path consisting of a root component (at index 0) and zero or more path - * segments (at indices > 0). - */ - function getPathFromPathComponents(pathComponents: ReadonlyArray): string; -} -declare namespace ts { - function getPathComponentsRelativeTo(from: string, to: string, stringEqualityComparer: (a: string, b: string) => boolean, getCanonicalFileName: GetCanonicalFileName): string[]; - function getRelativePathFromFile(from: string, to: string, getCanonicalFileName: GetCanonicalFileName): string; - /** - * Gets a relative path that can be used to traverse between `from` and `to`. - */ - function getRelativePathFromDirectory(from: string, to: string, ignoreCase: boolean): string; - /** - * Gets a relative path that can be used to traverse between `from` and `to`. - */ - function getRelativePathFromDirectory(fromDirectory: string, to: string, getCanonicalFileName: GetCanonicalFileName): string; - function getRelativePathToDirectoryOrUrl(directoryPathOrUrl: string, relativeOrAbsolutePath: string, currentDirectory: string, getCanonicalFileName: GetCanonicalFileName, isAbsolutePathAnUrl: boolean): string; - /** - * Ensures a path is either absolute (prefixed with `/` or `c:`) or dot-relative (prefixed - * with `./` or `../`) so as not to be confused with an unprefixed module name. - */ - function ensurePathIsNonModuleName(path: string): string; - /** - * Returns the path except for its containing directory name. - * Semantics align with NodeJS's `path.basename` except that we support URL's as well. - * - * ```ts - * getBaseFileName("/path/to/file.ext") === "file.ext" - * getBaseFileName("/path/to/") === "to" - * getBaseFileName("/") === "" - * ``` - */ - function getBaseFileName(path: string): string; - /** - * Gets the portion of a path following the last (non-terminal) separator (`/`). - * Semantics align with NodeJS's `path.basename` except that we support URL's as well. - * If the base name has any one of the provided extensions, it is removed. - * - * ```ts - * getBaseFileName("/path/to/file.ext", ".ext", true) === "file" - * getBaseFileName("/path/to/file.js", ".ext", true) === "file.js" - * ``` - */ - function getBaseFileName(path: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; - /** - * Combines paths. If a path is absolute, it replaces any previous path. - */ - function combinePaths(path: string, ...paths: (string | undefined)[]): string; - /** - * Combines and resolves paths. If a path is absolute, it replaces any previous path. Any - * `.` and `..` path components are resolved. - */ - function resolvePath(path: string, ...paths: (string | undefined)[]): string; - /** - * Determines whether a path has a trailing separator (`/` or `\\`). - */ - function hasTrailingDirectorySeparator(path: string): boolean; - /** - * Removes a trailing directory separator from a path. - * @param path The path. - */ - function removeTrailingDirectorySeparator(path: Path): Path; - function removeTrailingDirectorySeparator(path: string): string; - /** - * Adds a trailing directory separator to a path, if it does not already have one. - * @param path The path. - */ - function ensureTrailingDirectorySeparator(path: Path): Path; - function ensureTrailingDirectorySeparator(path: string): string; - /** - * Performs a case-sensitive comparison of two paths. - */ - function comparePathsCaseSensitive(a: string, b: string): Comparison; - /** - * Performs a case-insensitive comparison of two paths. - */ - function comparePathsCaseInsensitive(a: string, b: string): Comparison; - function comparePaths(a: string, b: string, ignoreCase?: boolean): Comparison; - function comparePaths(a: string, b: string, currentDirectory: string, ignoreCase?: boolean): Comparison; - function containsPath(parent: string, child: string, ignoreCase?: boolean): boolean; - function containsPath(parent: string, child: string, currentDirectory: string, ignoreCase?: boolean): boolean; - function tryRemoveDirectoryPrefix(path: string, dirPath: string, getCanonicalFileName: GetCanonicalFileName): string | undefined; - function hasExtension(fileName: string): boolean; - const commonPackageFolders: ReadonlyArray; - function getRegularExpressionForWildcard(specs: ReadonlyArray | undefined, basePath: string, usage: "files" | "directories" | "exclude"): string | undefined; - /** - * An "includes" path "foo" is implicitly a glob "foo/** /*" (without the space) if its last component has no extension, - * and does not contain any glob characters itself. - */ - function isImplicitGlob(lastPathComponent: string): boolean; - interface FileSystemEntries { - readonly files: ReadonlyArray; - readonly directories: ReadonlyArray; - } - interface FileMatcherPatterns { - /** One pattern for each "include" spec. */ - includeFilePatterns: ReadonlyArray | undefined; - /** One pattern matching one of any of the "include" specs. */ - includeFilePattern: string | undefined; - includeDirectoryPattern: string | undefined; - excludePattern: string | undefined; - basePaths: ReadonlyArray; - } - /** @param path directory of the tsconfig.json */ - function getFileMatcherPatterns(path: string, excludes: ReadonlyArray | undefined, includes: ReadonlyArray | undefined, useCaseSensitiveFileNames: boolean, currentDirectory: string): FileMatcherPatterns; - function getRegexFromPattern(pattern: string, useCaseSensitiveFileNames: boolean): RegExp; - /** @param path directory of the tsconfig.json */ - function matchFiles(path: string, extensions: ReadonlyArray | undefined, excludes: ReadonlyArray | undefined, includes: ReadonlyArray | undefined, useCaseSensitiveFileNames: boolean, currentDirectory: string, depth: number | undefined, getFileSystemEntries: (path: string) => FileSystemEntries): string[]; - function ensureScriptKind(fileName: string, scriptKind: ScriptKind | undefined): ScriptKind; - function getScriptKindFromFileName(fileName: string): ScriptKind; - /** - * List of supported extensions in order of file resolution precedence. - */ - const supportedTypeScriptExtensions: ReadonlyArray; - /** Must have ".d.ts" first because if ".ts" goes first, that will be detected as the extension instead of ".d.ts". */ - const supportedTypescriptExtensionsForExtractExtension: ReadonlyArray; - const supportedJavascriptExtensions: ReadonlyArray; - function getSupportedExtensions(options?: CompilerOptions, extraFileExtensions?: ReadonlyArray): ReadonlyArray; - function hasJavaScriptFileExtension(fileName: string): boolean; - function hasTypeScriptFileExtension(fileName: string): boolean; - function isSupportedSourceFileName(fileName: string, compilerOptions?: CompilerOptions, extraFileExtensions?: ReadonlyArray): boolean; - /** - * Extension boundaries by priority. Lower numbers indicate higher priorities, and are - * aligned to the offset of the highest priority extension in the - * allSupportedExtensions array. - */ - enum ExtensionPriority { - TypeScriptFiles = 0, - DeclarationAndJavaScriptFiles = 2, - Highest = 0, - Lowest = 2 - } - function getExtensionPriority(path: string, supportedExtensions: ReadonlyArray): ExtensionPriority; - /** - * Adjusts an extension priority to be the highest priority within the same range. - */ - function adjustExtensionPriority(extensionPriority: ExtensionPriority, supportedExtensions: ReadonlyArray): ExtensionPriority; - /** - * Gets the next lowest extension priority for a given priority. - */ - function getNextLowestExtensionPriority(extensionPriority: ExtensionPriority, supportedExtensions: ReadonlyArray): ExtensionPriority; - function removeFileExtension(path: string): string; - function tryRemoveExtension(path: string, extension: string): string | undefined; - function removeExtension(path: string, extension: string): string; - function changeExtension(path: T, newExtension: string): T; - function changeAnyExtension(path: string, ext: string): string; - function changeAnyExtension(path: string, ext: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; - namespace Debug { - function showSymbol(symbol: Symbol): string; - function showSyntaxKind(node: Node): string; - } - function tryParsePattern(pattern: string): Pattern | undefined; - function positionIsSynthesized(pos: number): boolean; - /** True if an extension is one of the supported TypeScript extensions. */ - function extensionIsTypeScript(ext: Extension): boolean; - function resolutionExtensionIsTypeScriptOrJson(ext: Extension): boolean; - /** - * Gets the extension from a path. - * Path must have a valid extension. - */ - function extensionFromPath(path: string): Extension; - function isAnySupportedFileExtension(path: string): boolean; - function tryGetExtensionFromPath(path: string): Extension | undefined; - /** - * Gets the file extension for a path. - */ - function getAnyExtensionFromPath(path: string): string; - /** - * Gets the file extension for a path, provided it is one of the provided extensions. - */ - function getAnyExtensionFromPath(path: string, extensions: string | ReadonlyArray, ignoreCase: boolean): string; - function isCheckJsEnabledForFile(sourceFile: SourceFile, compilerOptions: CompilerOptions): boolean | undefined; - const emptyFileSystemEntries: FileSystemEntries; - /** - * patternStrings contains both pattern strings (containing "*") and regular strings. - * Return an exact match if possible, or a pattern match, or undefined. - * (These are verified by verifyCompilerOptions to have 0 or 1 "*" characters.) - */ - function matchPatternOrExact(patternStrings: ReadonlyArray, candidate: string): string | Pattern | undefined; - type Mutable = { - -readonly [K in keyof T]: T[K]; - }; -} declare namespace ts { function createNode(kind: SyntaxKind, pos?: number, end?: number): Node; - function isJSDocLikeText(text: string, start: number): boolean; /** * Invokes a callback for each child of the given node. The 'cbNode' callback is invoked for all child nodes * stored in properties. If a 'cbNodes' callback is specified, it is invoked for embedded arrays; otherwise, @@ -7427,62 +3494,9 @@ declare namespace ts { function parseJsonText(fileName: string, sourceText: string): JsonSourceFile; function isExternalModule(file: SourceFile): boolean; function updateSourceFile(sourceFile: SourceFile, newText: string, textChangeRange: TextChangeRange, aggressiveChecks?: boolean): SourceFile; - function parseIsolatedJSDocComment(content: string, start?: number, length?: number): { - jsDoc: JSDoc; - diagnostics: Diagnostic[]; - } | undefined; - function parseJSDocTypeExpressionForTests(content: string, start?: number, length?: number): { - jsDocTypeExpression: JSDocTypeExpression; - diagnostics: Diagnostic[]; - } | undefined; - /** @internal */ - function isDeclarationFileName(fileName: string): boolean; - interface PragmaContext { - languageVersion: ScriptTarget; - pragmas?: PragmaMap; - checkJsDirective?: CheckJsDirective; - referencedFiles: FileReference[]; - typeReferenceDirectives: FileReference[]; - libReferenceDirectives: FileReference[]; - amdDependencies: AmdDependency[]; - hasNoDefaultLib?: boolean; - moduleName?: string; - } - function processCommentPragmas(context: PragmaContext, sourceText: string): void; - type PragmaDiagnosticReporter = (pos: number, length: number, message: DiagnosticMessage) => void; - function processPragmasIntoFields(context: PragmaContext, reportDiagnostic: PragmaDiagnosticReporter): void; - /** @internal */ - function tagNamesAreEquivalent(lhs: JsxTagNameExpression, rhs: JsxTagNameExpression): boolean; } declare namespace ts { - const compileOnSaveCommandLineOption: CommandLineOption; - /** - * An array of supported "lib" reference file names used to determine the order for inclusion - * when referenced, as well as for spelling suggestions. This ensures the correct ordering for - * overload resolution when a type declared in one lib is extended by another. - */ - const libs: string[]; - /** - * A map of lib names to lib files. This map is used both for parsing the "lib" command line - * option as well as for resolving lib reference directives. - */ - const libMap: Map; - const optionDeclarations: CommandLineOption[]; - const typeAcquisitionDeclarations: CommandLineOption[]; - interface OptionNameMap { - optionNameMap: Map; - shortOptionNames: Map; - } - const defaultInitCompilerOptions: CompilerOptions; - function convertEnableAutoDiscoveryToEnable(typeAcquisition: TypeAcquisition): TypeAcquisition; - function createCompilerDiagnosticForInvalidCustomType(opt: CommandLineOptionOfCustomType): Diagnostic; - function parseCustomTypeOption(opt: CommandLineOptionOfCustomType, value: string, errors: Push): string | number | undefined; - function parseListTypeOption(opt: CommandLineOptionOfListType, value: string | undefined, errors: Push): (string | number)[] | undefined; function parseCommandLine(commandLine: ReadonlyArray, readFile?: (path: string) => string | undefined): ParsedCommandLine; - /** @internal */ - function getOptionFromName(optionName: string, allowShort?: boolean): CommandLineOption | undefined; - function printVersion(): void; - function printHelp(optionsList: CommandLineOption[], syntaxPrefix?: string): void; type DiagnosticReporter = (diagnostic: Diagnostic) => void; /** * Reports config file diagnostics @@ -7525,49 +3539,10 @@ declare namespace ts { * @param fileName The path to the config file */ function readJsonConfigFile(fileName: string, readFile: (path: string) => string | undefined): TsConfigSourceFile; - interface JsonConversionNotifier { - /** - * Notifies parent option object is being set with the optionKey and a valid optionValue - * Currently it notifies only if there is element with type object (parentOption) and - * has element's option declarations map associated with it - * @param parentOption parent option name in which the option and value are being set - * @param option option declaration which is being set with the value - * @param value value of the option - */ - onSetValidOptionKeyValueInParent(parentOption: string, option: CommandLineOption, value: CompilerOptionsValue): void; - /** - * Notify when valid root key value option is being set - * @param key option key - * @param keyNode node corresponding to node in the source file - * @param value computed value of the key - * @param ValueNode node corresponding to value in the source file - */ - onSetValidOptionKeyValueInRoot(key: string, keyNode: PropertyName, value: CompilerOptionsValue, valueNode: Expression): void; - /** - * Notify when unknown root key value option is being set - * @param key option key - * @param keyNode node corresponding to node in the source file - * @param value computed value of the key - * @param ValueNode node corresponding to value in the source file - */ - onSetUnknownOptionKeyValueInRoot(key: string, keyNode: PropertyName, value: CompilerOptionsValue, valueNode: Expression): void; - } /** * Convert the json syntax tree into the json value */ function convertToObject(sourceFile: JsonSourceFile, errors: Push): any; - /** - * Convert the json syntax tree into the json value and report errors - * This returns the json value (apart from checking errors) only if returnValue provided is true. - * Otherwise it just checks the errors and returns undefined - */ - function convertToObjectWorker(sourceFile: JsonSourceFile, errors: Push, returnValue: boolean, knownRootOptions: CommandLineOption | undefined, jsonConversionNotifier: JsonConversionNotifier | undefined): any; - /** - * Generate tsconfig configuration when running command line "--init" - * @param options commandlineOptions to be generated into tsconfig.json - * @param fileNames array of filenames to be generated into tsconfig.json - */ - function generateTSConfig(options: CompilerOptions, fileNames: ReadonlyArray, newLine: string): string; /** * Parse the contents of a config file (tsconfig.json). * @param json The contents of the config file to parse @@ -7584,9 +3559,6 @@ declare namespace ts { * file to. e.g. outDir */ function parseJsonSourceFileConfigFileContent(sourceFile: TsConfigSourceFile, host: ParseConfigHost, basePath: string, existingOptions?: CompilerOptions, configFileName?: string, resolutionStack?: Path[], extraFileExtensions?: ReadonlyArray): ParsedCommandLine; - function setConfigFileInOptions(options: CompilerOptions, configFile: TsConfigSourceFile | undefined): void; - function isErrorNoInputFiles(error: Diagnostic): boolean; - function getErrorForNoInputFiles({ includeSpecs, excludeSpecs }: ConfigFileSpecs, configFileName: string | undefined): Diagnostic; function convertCompilerOptionsFromJson(jsonOptions: any, basePath: string, configFileName?: string): { options: CompilerOptions; errors: Diagnostic[]; @@ -7595,32 +3567,8 @@ declare namespace ts { options: TypeAcquisition; errors: Diagnostic[]; }; - /** - * Gets the file names from the provided config file specs that contain, files, include, exclude and - * other properties needed to resolve the file names - * @param spec The config file specs extracted with file names to include, wildcards to include/exclude and other details - * @param basePath The base path for any relative file specifications. - * @param options Compiler options. - * @param host The host used to resolve files and directories. - * @param extraFileExtensions optionaly file extra file extension information from host - */ - function getFileNamesFromConfigSpecs(spec: ConfigFileSpecs, basePath: string, options: CompilerOptions, host: ParseConfigHost, extraFileExtensions?: ReadonlyArray): ExpandResult; - /** - * Produces a cleaned version of compiler options with personally identifiying info (aka, paths) removed. - * Also converts enum values back to strings. - */ - function convertCompilerOptionsForTelemetry(opts: CompilerOptions): CompilerOptions; } declare namespace ts { - function trace(host: ModuleResolutionHost, message: DiagnosticMessage, ...args: any[]): void; - function isTraceEnabled(compilerOptions: CompilerOptions, host: ModuleResolutionHost): boolean; - /** Array that is only intended to be pushed to, never read. */ - interface Push { - push(value: T): void; - } - function readJson(path: string, host: { - readFile(fileName: string): string | undefined; - }): object; function getEffectiveTypeRoots(options: CompilerOptions, host: GetEffectiveTypeRootsHost): string[] | undefined; /** * @param {string | undefined} containingFile - file that contains type reference directive, can be undefined if containing file is unknown. @@ -7656,78 +3604,13 @@ declare namespace ts { set(directory: string, result: ResolvedModuleWithFailedLookupLocations): void; } function createModuleResolutionCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): ModuleResolutionCache; - function createModuleResolutionCacheWithMaps(directoryToModuleNameMap: Map>, moduleNameToDirectoryMap: Map, currentDirectory: string, getCanonicalFileName: GetCanonicalFileName): ModuleResolutionCache; function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations | undefined; function resolveModuleName(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; function nodeModuleNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: ModuleResolutionCache): ResolvedModuleWithFailedLookupLocations; - /** - * Expose resolution logic to allow us to use Node module resolution logic from arbitrary locations. - * No way to do this with `require()`: https://github.com/nodejs/node/issues/5963 - * Throws an error if the module can't be resolved. - */ - function resolveJavaScriptModule(moduleName: string, initialDir: string, host: ModuleResolutionHost): string; - function directoryProbablyExists(directoryName: string, host: { - directoryExists?: (directoryName: string) => boolean; - }): boolean; - function getPackageName(moduleName: string): { - packageName: string; - rest: string; - }; - function getTypesPackageName(packageName: string): string; - function getMangledNameForScopedPackage(packageName: string): string; - function getPackageNameFromAtTypesDirectory(mangledName: string): string; - function getUnmangledNameForScopedPackage(typesPackageName: string): string; function classicNameResolver(moduleName: string, containingFile: string, compilerOptions: CompilerOptions, host: ModuleResolutionHost, cache?: NonRelativeModuleNameResolutionCache): ResolvedModuleWithFailedLookupLocations; - /** - * LSHost may load a module from a global cache of typings. - * This is the minumum code needed to expose that functionality; the rest is in LSHost. - */ - function loadModuleFromGlobalCache(moduleName: string, projectName: string | undefined, compilerOptions: CompilerOptions, host: ModuleResolutionHost, globalCache: string): ResolvedModuleWithFailedLookupLocations; -} -declare namespace ts { - enum ModuleInstanceState { - NonInstantiated = 0, - Instantiated = 1, - ConstEnumOnly = 2 - } - function getModuleInstanceState(node: ModuleDeclaration): ModuleInstanceState; - function bindSourceFile(file: SourceFile, options: CompilerOptions): void; - function isExportsOrModuleExportsOrAlias(sourceFile: SourceFile, node: Expression): boolean; - /** - * Computes the transform flags for a node, given the transform flags of its subtree - * - * @param node The node to analyze - * @param subtreeFlags Transform flags computed for this node's subtree - */ - function computeTransformFlagsForNode(node: Node, subtreeFlags: TransformFlags): TransformFlags; - /** - * Gets the transform flags to exclude when unioning the transform flags of a subtree. - * - * NOTE: This needs to be kept up-to-date with the exclusions used in `computeTransformFlagsForNode`. - * For performance reasons, `computeTransformFlagsForNode` uses local constant values rather - * than calling this function. - */ - function getTransformFlagsSubtreeExclusions(kind: SyntaxKind): TransformFlags; -} -/** @internal */ -declare namespace ts { - function createGetSymbolWalker(getRestTypeOfSignature: (sig: Signature) => Type, getTypePredicateOfSignature: (sig: Signature) => TypePredicate | undefined, getReturnTypeOfSignature: (sig: Signature) => Type, getBaseTypes: (type: Type) => Type[], resolveStructuredTypeMembers: (type: ObjectType) => ResolvedType, getTypeOfSymbol: (sym: Symbol) => Type, getResolvedSymbol: (node: Node) => Symbol, getIndexTypeOfStructuredType: (type: Type, kind: IndexKind) => Type | undefined, getConstraintFromTypeParameter: (typeParameter: TypeParameter) => Type | undefined, getFirstIdentifier: (node: EntityNameOrEntityNameExpression) => Identifier): (accept?: (symbol: Symbol) => boolean) => SymbolWalker; -} -declare namespace ts { - function getNodeId(node: Node): number; - function getSymbolId(symbol: Symbol): number; - function isInstantiatedModule(node: ModuleDeclaration, preserveConstEnums: boolean): boolean; - function createTypeChecker(host: TypeCheckerHost, produceDiagnostics: boolean): TypeChecker; } declare namespace ts { - function updateNode(updated: T, original: T): T; - function createNodeArray(elements?: T[], hasTrailingComma?: boolean): MutableNodeArray; function createNodeArray(elements?: ReadonlyArray, hasTrailingComma?: boolean): NodeArray; - /** - * Creates a shallow, memberwise clone of a node with no source map location. - */ - function getSynthesizedClone(node: T): T; - function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier, isSingleQuote: boolean): StringLiteral; /** If a node is passed, creates a string literal whose source text is read from a source node during emit. */ function createLiteral(value: string | StringLiteral | NoSubstitutionTemplateLiteral | NumericLiteral | Identifier): StringLiteral; function createLiteral(value: number): NumericLiteral; @@ -7737,24 +3620,19 @@ declare namespace ts { function createStringLiteral(text: string): StringLiteral; function createRegularExpressionLiteral(text: string): RegularExpressionLiteral; function createIdentifier(text: string): Identifier; - function createIdentifier(text: string, typeArguments: ReadonlyArray | undefined): Identifier; function updateIdentifier(node: Identifier): Identifier; - function updateIdentifier(node: Identifier, typeArguments: NodeArray | undefined): Identifier; /** Create a unique temporary variable. */ function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined): Identifier; - function createTempVariable(recordTempVariable: ((node: Identifier) => void) | undefined, reservedInNestedScopes: boolean): GeneratedIdentifier; /** Create a unique temporary variable for use in a loop. */ function createLoopVariable(): Identifier; /** Create a unique name based on the supplied text. */ function createUniqueName(text: string): Identifier; - function createOptimisticUniqueName(text: string): GeneratedIdentifier; /** Create a unique name based on the supplied text. */ function createOptimisticUniqueName(text: string): Identifier; /** Create a unique name based on the supplied text. This does not consider names injected by the transformer. */ function createFileLevelUniqueName(text: string): Identifier; /** Create a unique name generated for a node. */ function getGeneratedNameForNode(node: Node | undefined): Identifier; - function getGeneratedNameForNode(node: Node | undefined, flags: GeneratedIdentifierFlags): Identifier; function createToken(token: TKind): Token; function createSuper(): SuperExpression; function createThis(): ThisExpression & Token; @@ -7793,7 +3671,6 @@ declare namespace ts { function updateConstructSignature(node: ConstructSignatureDeclaration, typeParameters: NodeArray | undefined, parameters: NodeArray, type: TypeNode | undefined): ConstructSignatureDeclaration; function createIndexSignature(decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode): IndexSignatureDeclaration; function updateIndexSignature(node: IndexSignatureDeclaration, decorators: ReadonlyArray | undefined, modifiers: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode): IndexSignatureDeclaration; - function createSignatureDeclaration(kind: SyntaxKind, typeParameters: ReadonlyArray | undefined, parameters: ReadonlyArray, type: TypeNode | undefined, typeArguments?: ReadonlyArray | undefined): SignatureDeclaration; function createKeywordTypeNode(kind: KeywordTypeNode["kind"]): KeywordTypeNode; function createTypePredicateNode(parameterName: Identifier | ThisTypeNode | string, type: TypeNode): TypePredicateNode; function updateTypePredicateNode(node: TypePredicateNode, parameterName: Identifier | ThisTypeNode, type: TypeNode): TypePredicateNode; @@ -7858,8 +3735,6 @@ declare namespace ts { function updateNew(node: NewExpression, expression: Expression, typeArguments: ReadonlyArray | undefined, argumentsArray: ReadonlyArray | undefined): NewExpression; function createTaggedTemplate(tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function createTaggedTemplate(tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; - /** @internal */ - function createTaggedTemplate(tag: Expression, typeArgumentsOrTemplate: ReadonlyArray | TemplateLiteral | undefined, template?: TemplateLiteral): TaggedTemplateExpression; function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, template: TemplateLiteral): TaggedTemplateExpression; function updateTaggedTemplate(node: TaggedTemplateExpression, tag: Expression, typeArguments: ReadonlyArray | undefined, template: TemplateLiteral): TaggedTemplateExpression; function createTypeAssertion(type: TypeNode, expression: Expression): TypeAssertion; @@ -8044,16 +3919,6 @@ declare namespace ts { * @param original The original statement. */ function createNotEmittedStatement(original: Node): NotEmittedStatement; - /** - * Creates a synthetic element to act as a placeholder for the end of an emitted declaration in - * order to properly emit exports. - */ - function createEndOfDeclarationMarker(original: Node): EndOfDeclarationMarker; - /** - * Creates a synthetic element to act as a placeholder for the beginning of a merged declaration in - * order to properly emit exports. - */ - function createMergeDeclarationMarker(original: Node): MergeDeclarationMarker; /** * Creates a synthetic expression to act as a placeholder for a not-emitted expression in * order to preserve comments or sourcemap positions. @@ -8096,20 +3961,11 @@ declare namespace ts { * @param sourceFile A source file. */ function disposeEmitNodes(sourceFile: SourceFile): void; - /** - * Associates a node with the current transformation, initializing - * various transient transformation properties. - */ - function getOrCreateEmitNode(node: Node): EmitNode; function setTextRange(range: T, location: TextRange | undefined): T; /** * Sets flags that control emit behavior of a node. */ function setEmitFlags(node: T, emitFlags: EmitFlags): T; - /** - * Sets flags that control emit behavior of a node. - */ - function addEmitFlags(node: T, emitFlags: EmitFlags): T; /** * Gets a custom text range to use when emitting source maps. */ @@ -8130,14 +3986,6 @@ declare namespace ts { * Sets the TextRange to use for source maps for a token of a node. */ function setTokenSourceMapRange(node: T, token: SyntaxKind, range: SourceMapRange | undefined): T; - /** - * Gets a custom text range to use when emitting comments. - */ - function getStartsOnNewLine(node: Node): boolean | undefined; - /** - * Sets a custom text range to use when emitting comments. - */ - function setStartsOnNewLine(node: T, newLine: boolean): T; /** * Gets a custom text range to use when emitting comments. */ @@ -8181,265 +4029,8 @@ declare namespace ts { * Moves matching emit helpers from a source node to a target node. */ function moveEmitHelpers(source: Node, target: Node, predicate: (helper: EmitHelper) => boolean): void; - function compareEmitHelpers(x: EmitHelper, y: EmitHelper): Comparison; function setOriginalNode(node: T, original: Node | undefined): T; } -declare namespace ts { - const nullTransformationContext: TransformationContext; - type TypeOfTag = "undefined" | "number" | "boolean" | "string" | "symbol" | "object" | "function"; - function createTypeCheck(value: Expression, tag: TypeOfTag): BinaryExpression; - function createMemberAccessForPropertyName(target: Expression, memberName: PropertyName, location?: TextRange): MemberExpression; - function createFunctionCall(func: Expression, thisArg: Expression, argumentsList: ReadonlyArray, location?: TextRange): CallExpression; - function createFunctionApply(func: Expression, thisArg: Expression, argumentsExpression: Expression, location?: TextRange): CallExpression; - function createArraySlice(array: Expression, start?: number | Expression): CallExpression; - function createArrayConcat(array: Expression, values: ReadonlyArray): CallExpression; - function createMathPow(left: Expression, right: Expression, location?: TextRange): CallExpression; - function createExpressionForJsxElement(jsxFactoryEntity: EntityName | undefined, reactNamespace: string, tagName: Expression, props: Expression, children: ReadonlyArray, parentElement: JsxOpeningLikeElement, location: TextRange): LeftHandSideExpression; - function createExpressionForJsxFragment(jsxFactoryEntity: EntityName | undefined, reactNamespace: string, children: ReadonlyArray, parentElement: JsxOpeningFragment, location: TextRange): LeftHandSideExpression; - function getHelperName(name: string): Identifier; - function createValuesHelper(context: TransformationContext, expression: Expression, location?: TextRange): CallExpression; - function createReadHelper(context: TransformationContext, iteratorRecord: Expression, count: number | undefined, location?: TextRange): CallExpression; - function createSpreadHelper(context: TransformationContext, argumentList: ReadonlyArray, location?: TextRange): CallExpression; - function createForOfBindingStatement(node: ForInitializer, boundValue: Expression): Statement; - function insertLeadingStatement(dest: Statement, source: Statement): Block; - function restoreEnclosingLabel(node: Statement, outermostLabeledStatement: LabeledStatement | undefined, afterRestoreLabelCallback?: (node: LabeledStatement) => void): Statement; - interface CallBinding { - target: LeftHandSideExpression; - thisArg: Expression; - } - function createCallBinding(expression: Expression, recordTempVariable: (temp: Identifier) => void, languageVersion?: ScriptTarget, cacheIdentifiers?: boolean): CallBinding; - function inlineExpressions(expressions: ReadonlyArray): Expression; - function createExpressionFromEntityName(node: EntityName | Expression): Expression; - function createExpressionForPropertyName(memberName: PropertyName): Expression; - function createExpressionForObjectLiteralElementLike(node: ObjectLiteralExpression, property: ObjectLiteralElementLike, receiver: Expression): Expression | undefined; - /** - * Gets the internal name of a declaration. This is primarily used for declarations that can be - * referred to by name in the body of an ES5 class function body. An internal name will *never* - * be prefixed with an module or namespace export modifier like "exports." when emitted as an - * expression. An internal name will also *never* be renamed due to a collision with a block - * scoped variable. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getInternalName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - /** - * Gets whether an identifier should only be referred to by its internal name. - */ - function isInternalName(node: Identifier): boolean; - /** - * Gets the local name of a declaration. This is primarily used for declarations that can be - * referred to by name in the declaration's immediate scope (classes, enums, namespaces). A - * local name will *never* be prefixed with an module or namespace export modifier like - * "exports." when emitted as an expression. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getLocalName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - /** - * Gets whether an identifier should only be referred to by its local name. - */ - function isLocalName(node: Identifier): boolean; - /** - * Gets the export name of a declaration. This is primarily used for declarations that can be - * referred to by name in the declaration's immediate scope (classes, enums, namespaces). An - * export name will *always* be prefixed with an module or namespace export modifier like - * `"exports."` when emitted as an expression if the name points to an exported symbol. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getExportName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - /** - * Gets whether an identifier should only be referred to by its export representation if the - * name points to an exported symbol. - */ - function isExportName(node: Identifier): boolean; - /** - * Gets the name of a declaration for use in declarations. - * - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getDeclarationName(node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier; - /** - * Gets the exported name of a declaration for use in expressions. - * - * An exported name will *always* be prefixed with an module or namespace export modifier like - * "exports." if the name points to an exported symbol. - * - * @param ns The namespace identifier. - * @param node The declaration. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getExternalModuleOrNamespaceExportName(ns: Identifier | undefined, node: Declaration, allowComments?: boolean, allowSourceMaps?: boolean): Identifier | PropertyAccessExpression; - /** - * Gets a namespace-qualified name for use in expressions. - * - * @param ns The namespace identifier. - * @param name The name. - * @param allowComments A value indicating whether comments may be emitted for the name. - * @param allowSourceMaps A value indicating whether source maps may be emitted for the name. - */ - function getNamespaceMemberName(ns: Identifier, name: Identifier, allowComments?: boolean, allowSourceMaps?: boolean): PropertyAccessExpression; - function convertToFunctionBody(node: ConciseBody, multiLine?: boolean): Block; - function convertFunctionDeclarationToExpression(node: FunctionDeclaration): FunctionExpression; - /** - * Add any necessary prologue-directives into target statement-array. - * The function needs to be called during each transformation step. - * This function needs to be called whenever we transform the statement - * list of a source file, namespace, or function-like body. - * - * @param target: result statements array - * @param source: origin statements array - * @param ensureUseStrict: boolean determining whether the function need to add prologue-directives - * @param visitor: Optional callback used to visit any custom prologue directives. - */ - function addPrologue(target: Statement[], source: ReadonlyArray, ensureUseStrict?: boolean, visitor?: (node: Node) => VisitResult): number; - /** - * Add just the standard (string-expression) prologue-directives into target statement-array. - * The function needs to be called during each transformation step. - * This function needs to be called whenever we transform the statement - * list of a source file, namespace, or function-like body. - */ - function addStandardPrologue(target: Statement[], source: ReadonlyArray, ensureUseStrict?: boolean): number; - /** - * Add just the custom prologue-directives into target statement-array. - * The function needs to be called during each transformation step. - * This function needs to be called whenever we transform the statement - * list of a source file, namespace, or function-like body. - */ - function addCustomPrologue(target: Statement[], source: ReadonlyArray, statementOffset: number, visitor?: (node: Node) => VisitResult): number; - function addCustomPrologue(target: Statement[], source: ReadonlyArray, statementOffset: number | undefined, visitor?: (node: Node) => VisitResult): number | undefined; - function startsWithUseStrict(statements: ReadonlyArray): boolean; - /** - * Ensures "use strict" directive is added - * - * @param statements An array of statements - */ - function ensureUseStrict(statements: NodeArray): NodeArray; - /** - * Wraps the operand to a BinaryExpression in parentheses if they are needed to preserve the intended - * order of operations. - * - * @param binaryOperator The operator for the BinaryExpression. - * @param operand The operand for the BinaryExpression. - * @param isLeftSideOfBinary A value indicating whether the operand is the left side of the - * BinaryExpression. - */ - function parenthesizeBinaryOperand(binaryOperator: SyntaxKind, operand: Expression, isLeftSideOfBinary: boolean, leftOperand?: Expression): Expression; - function parenthesizeForConditionalHead(condition: Expression): Expression; - function parenthesizeSubexpressionOfConditionalExpression(e: Expression): Expression; - /** - * [Per the spec](https://tc39.github.io/ecma262/#prod-ExportDeclaration), `export default` accepts _AssigmentExpression_ but - * has a lookahead restriction for `function`, `async function`, and `class`. - * - * Basically, that means we need to parenthesize in the following cases: - * - * - BinaryExpression of CommaToken - * - CommaList (synthetic list of multiple comma expressions) - * - FunctionExpression - * - ClassExpression - */ - function parenthesizeDefaultExpression(e: Expression): Expression; - /** - * Wraps an expression in parentheses if it is needed in order to use the expression - * as the expression of a NewExpression node. - * - * @param expression The Expression node. - */ - function parenthesizeForNew(expression: Expression): LeftHandSideExpression; - /** - * Wraps an expression in parentheses if it is needed in order to use the expression for - * property or element access. - * - * @param expr The expression node. - */ - function parenthesizeForAccess(expression: Expression): LeftHandSideExpression; - function parenthesizePostfixOperand(operand: Expression): LeftHandSideExpression; - function parenthesizePrefixOperand(operand: Expression): UnaryExpression; - function parenthesizeListElements(elements: NodeArray): NodeArray; - function parenthesizeExpressionForList(expression: Expression): Expression; - function parenthesizeExpressionForExpressionStatement(expression: Expression): Expression; - function parenthesizeConditionalTypeMember(member: TypeNode): TypeNode; - function parenthesizeElementTypeMember(member: TypeNode): TypeNode; - function parenthesizeArrayTypeMember(member: TypeNode): TypeNode; - function parenthesizeElementTypeMembers(members: ReadonlyArray): NodeArray; - function parenthesizeTypeParameters(typeParameters: ReadonlyArray | undefined): MutableNodeArray | undefined; - function parenthesizeConciseBody(body: ConciseBody): ConciseBody; - function isCommaSequence(node: Expression): node is (BinaryExpression & { - operatorToken: Token; - }) | CommaListExpression; - enum OuterExpressionKinds { - Parentheses = 1, - Assertions = 2, - PartiallyEmittedExpressions = 4, - All = 7 - } - type OuterExpression = ParenthesizedExpression | TypeAssertion | AsExpression | NonNullExpression | PartiallyEmittedExpression; - function isOuterExpression(node: Node, kinds?: OuterExpressionKinds): node is OuterExpression; - function skipOuterExpressions(node: Expression, kinds?: OuterExpressionKinds): Expression; - function skipOuterExpressions(node: Node, kinds?: OuterExpressionKinds): Node; - function skipAssertions(node: Expression): Expression; - function skipAssertions(node: Node): Node; - function recreateOuterExpressions(outerExpression: Expression | undefined, innerExpression: Expression, kinds?: OuterExpressionKinds): Expression; - function startOnNewLine(node: T): T; - function getExternalHelpersModuleName(node: SourceFile): Identifier | undefined; - function getOrCreateExternalHelpersModuleNameIfNeeded(node: SourceFile, compilerOptions: CompilerOptions, hasExportStarsToExportValues?: boolean, hasImportStarOrImportDefault?: boolean): Identifier | undefined; - /** - * Get the name of that target module from an import or export declaration - */ - function getLocalNameForExternalImport(node: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile): Identifier | undefined; - /** - * Get the name of a target module from an import/export declaration as should be written in the emitted output. - * The emitted output name can be different from the input if: - * 1. The module has a /// - * 2. --out or --outFile is used, making the name relative to the rootDir - * 3- The containing SourceFile has an entry in renamedDependencies for the import as requested by some module loaders (e.g. System). - * Otherwise, a new StringLiteral node representing the module name will be returned. - */ - function getExternalModuleNameLiteral(importNode: ImportDeclaration | ExportDeclaration | ImportEqualsDeclaration, sourceFile: SourceFile, host: EmitHost, resolver: EmitResolver, compilerOptions: CompilerOptions): StringLiteral | undefined; - /** - * Get the name of a module as should be written in the emitted output. - * The emitted output name can be different from the input if: - * 1. The module has a /// - * 2. --out or --outFile is used, making the name relative to the rootDir - * Otherwise, a new StringLiteral node representing the module name will be returned. - */ - function tryGetModuleNameFromFile(file: SourceFile | undefined, host: EmitHost, options: CompilerOptions): StringLiteral | undefined; - /** - * Gets the initializer of an BindingOrAssignmentElement. - */ - function getInitializerOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): Expression | undefined; - /** - * Gets the name of an BindingOrAssignmentElement. - */ - function getTargetOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementTarget | undefined; - /** - * Determines whether an BindingOrAssignmentElement is a rest element. - */ - function getRestIndicatorOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): BindingOrAssignmentElementRestIndicator | undefined; - /** - * Gets the property name of a BindingOrAssignmentElement - */ - function getPropertyNameOfBindingOrAssignmentElement(bindingElement: BindingOrAssignmentElement): Identifier | StringLiteral | NumericLiteral | ComputedPropertyName | undefined; - /** - * Gets the elements of a BindingOrAssignmentPattern - */ - function getElementsOfBindingOrAssignmentPattern(name: BindingOrAssignmentPattern): ReadonlyArray; - function convertToArrayAssignmentElement(element: BindingOrAssignmentElement): Expression; - function convertToObjectAssignmentElement(element: BindingOrAssignmentElement): ObjectLiteralElementLike; - function convertToAssignmentPattern(node: BindingOrAssignmentPattern): AssignmentPattern; - function convertToObjectAssignmentPattern(node: ObjectBindingOrAssignmentPattern): ObjectLiteralExpression; - function convertToArrayAssignmentPattern(node: ArrayBindingOrAssignmentPattern): ArrayLiteralExpression; - function convertToAssignmentElementTarget(node: BindingOrAssignmentElementTarget): Expression; -} declare namespace ts { /** * Visits a Node using the supplied visitor, possibly returning a new Node in its place. @@ -8522,412 +4113,11 @@ declare namespace ts { function visitEachChild(node: T | undefined, visitor: Visitor, context: TransformationContext, nodesVisitor?: typeof visitNodes, tokenVisitor?: Visitor): T | undefined; } declare namespace ts { - /** - * Similar to `reduceLeft`, performs a reduction against each child of a node. - * NOTE: Unlike `forEachChild`, this does *not* visit every node. - * - * @param node The node containing the children to reduce. - * @param initial The initial value to supply to the reduction. - * @param f The callback function - */ - function reduceEachChild(node: Node | undefined, initial: T, cbNode: (memo: T, node: Node) => T, cbNodeArray?: (memo: T, nodes: NodeArray) => T): T; - /** - * Merges generated lexical declarations into a new statement list. - */ - function mergeLexicalEnvironment(statements: NodeArray, declarations: ReadonlyArray | undefined): NodeArray; - /** - * Appends generated lexical declarations to an array of statements. - */ - function mergeLexicalEnvironment(statements: Statement[], declarations: ReadonlyArray | undefined): Statement[]; - /** - * Lifts a NodeArray containing only Statement nodes to a block. - * - * @param nodes The NodeArray. - */ - function liftToBlock(nodes: ReadonlyArray): Statement; - /** - * Aggregates the TransformFlags for a Node and its subtree. - */ - function aggregateTransformFlags(node: T): T; - namespace Debug { - function failBadSyntaxKind(node: Node, message?: string): never; - const assertEachNode: (nodes: Node[], test: (node: Node) => boolean, message?: string | undefined) => void; - const assertNode: (node: Node | undefined, test: ((node: Node | undefined) => boolean) | undefined, message?: string | undefined) => void; - const assertOptionalNode: (node: Node, test: (node: Node) => boolean, message?: string | undefined) => void; - const assertOptionalToken: (node: Node, kind: SyntaxKind, message?: string | undefined) => void; - const assertMissingNode: typeof noop; - /** - * Injects debug information into frequently used types. - */ - function enableDebugInfo(): void; - } -} -declare namespace ts { - interface SourceFileLikeCache { - get(path: Path): SourceFileLike | undefined; - } - function createSourceFileLikeCache(host: { - readFile?: (path: string) => string | undefined; - fileExists?: (path: string) => boolean; - }): SourceFileLikeCache; -} -declare namespace ts.sourcemaps { - interface SourceMapData { - version?: number; - file?: string; - sourceRoot?: string; - sources: string[]; - sourcesContent?: (string | null)[]; - names?: string[]; - mappings: string; - } - interface SourceMappableLocation { - fileName: string; - position: number; - } - interface SourceMapper { - getOriginalPosition(input: SourceMappableLocation): SourceMappableLocation; - getGeneratedPosition(input: SourceMappableLocation): SourceMappableLocation; - } - const identitySourceMapper: { - getOriginalPosition: typeof identity; - getGeneratedPosition: typeof identity; - }; - interface SourceMapDecodeHost { - readFile(path: string): string | undefined; - fileExists(path: string): boolean; - getCanonicalFileName(path: string): string; - log(text: string): void; - } - function decode(host: SourceMapDecodeHost, mapPath: string, map: SourceMapData, program?: Program, fallbackCache?: SourceFileLikeCache): SourceMapper; - interface MappingsDecoder extends Iterator { - readonly decodingIndex: number; - readonly error: string | undefined; - readonly lastSpan: SourceMapSpan; - } - function decodeMappings(map: SourceMapData): MappingsDecoder; -} -declare namespace ts { - function getOriginalNodeId(node: Node): number; - interface ExternalModuleInfo { - externalImports: (ImportDeclaration | ImportEqualsDeclaration | ExportDeclaration)[]; - externalHelpersImportDeclaration: ImportDeclaration | undefined; - exportSpecifiers: Map; - exportedBindings: Identifier[][]; - exportedNames: Identifier[] | undefined; - exportEquals: ExportAssignment | undefined; - hasExportStarsToExportValues: boolean; - } - function chainBundle(transformSourceFile: (x: SourceFile) => SourceFile): (x: SourceFile | Bundle) => SourceFile | Bundle; - function getImportNeedsImportStarHelper(node: ImportDeclaration): boolean; - function getImportNeedsImportDefaultHelper(node: ImportDeclaration): boolean; - function collectExternalModuleInfo(sourceFile: SourceFile, resolver: EmitResolver, compilerOptions: CompilerOptions): ExternalModuleInfo; - /** - * Used in the module transformer to check if an expression is reasonably without sideeffect, - * and thus better to copy into multiple places rather than to cache in a temporary variable - * - this is mostly subjective beyond the requirement that the expression not be sideeffecting - */ - function isSimpleCopiableExpression(expression: Expression): boolean; - /** - * @param input Template string input strings - * @param args Names which need to be made file-level unique - */ - function helperString(input: TemplateStringsArray, ...args: string[]): (uniqueName: EmitHelperUniqueNameCallback) => string; -} -declare namespace ts { - enum FlattenLevel { - All = 0, - ObjectRest = 1 - } - /** - * Flattens a DestructuringAssignment or a VariableDeclaration to an expression. - * - * @param node The node to flatten. - * @param visitor An optional visitor used to visit initializers. - * @param context The transformation context. - * @param level Indicates the extent to which flattening should occur. - * @param needsValue An optional value indicating whether the value from the right-hand-side of - * the destructuring assignment is needed as part of a larger expression. - * @param createAssignmentCallback An optional callback used to create the assignment expression. - */ - function flattenDestructuringAssignment(node: VariableDeclaration | DestructuringAssignment, visitor: ((node: Node) => VisitResult) | undefined, context: TransformationContext, level: FlattenLevel, needsValue?: boolean, createAssignmentCallback?: (name: Identifier, value: Expression, location?: TextRange) => Expression): Expression; - /** - * Flattens a VariableDeclaration or ParameterDeclaration to one or more variable declarations. - * - * @param node The node to flatten. - * @param visitor An optional visitor used to visit initializers. - * @param context The transformation context. - * @param boundValue The value bound to the declaration. - * @param skipInitializer A value indicating whether to ignore the initializer of `node`. - * @param hoistTempVariables Indicates whether temporary variables should not be recorded in-line. - * @param level Indicates the extent to which flattening should occur. - */ - function flattenDestructuringBinding(node: VariableDeclaration | ParameterDeclaration, visitor: (node: Node) => VisitResult, context: TransformationContext, level: FlattenLevel, rval?: Expression, hoistTempVariables?: boolean, skipInitializer?: boolean): VariableDeclaration[]; -} -declare namespace ts { - function transformTypeScript(context: TransformationContext): (node: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformES2017(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; - const asyncSuperHelper: EmitHelper; - const advancedAsyncSuperHelper: EmitHelper; -} -declare namespace ts { - function transformESNext(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; - function createAssignHelper(context: TransformationContext, attributesSegments: Expression[]): CallExpression; -} -declare namespace ts { - function transformJsx(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformES2016(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformES2015(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - /** - * Transforms ES5 syntax into ES3 syntax. - * - * @param context Context and state information for the transformation. - */ - function transformES5(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformGenerators(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformModule(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformSystemModule(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - function transformES2015Module(context: TransformationContext): (x: SourceFile | Bundle) => SourceFile | Bundle; -} -declare namespace ts { - type GetSymbolAccessibilityDiagnostic = (symbolAccessibilityResult: SymbolAccessibilityResult) => (SymbolAccessibilityDiagnostic | undefined); - interface SymbolAccessibilityDiagnostic { - errorNode: Node; - diagnosticMessage: DiagnosticMessage; - typeName?: DeclarationName | QualifiedName; - } - type DeclarationDiagnosticProducing = VariableDeclaration | PropertyDeclaration | PropertySignature | BindingElement | SetAccessorDeclaration | GetAccessorDeclaration | ConstructSignatureDeclaration | CallSignatureDeclaration | MethodDeclaration | MethodSignature | FunctionDeclaration | ParameterDeclaration | TypeParameterDeclaration | ExpressionWithTypeArguments | ImportEqualsDeclaration | TypeAliasDeclaration | ConstructorDeclaration | IndexSignatureDeclaration; - function canProduceDiagnostics(node: Node): node is DeclarationDiagnosticProducing; - function createGetSymbolAccessibilityDiagnosticForNodeName(node: DeclarationDiagnosticProducing): (symbolAccessibilityResult: SymbolAccessibilityResult) => SymbolAccessibilityDiagnostic | undefined; - function createGetSymbolAccessibilityDiagnosticForNode(node: DeclarationDiagnosticProducing): (symbolAccessibilityResult: SymbolAccessibilityResult) => SymbolAccessibilityDiagnostic | undefined; -} -declare namespace ts { - function getDeclarationDiagnostics(host: EmitHost, resolver: EmitResolver, file: SourceFile | undefined): DiagnosticWithLocation[] | undefined; - /** - * Transforms a ts file into a .d.ts file - * This process requires type information, which is retrieved through the emit resolver. Because of this, - * in many places this transformer assumes it will be operating on parse tree nodes directly. - * This means that _no transforms should be allowed to occur before this one_. - */ - function transformDeclarations(context: TransformationContext): { - (node: Bundle): Bundle; - (node: SourceFile): SourceFile; - (node: SourceFile | Bundle): SourceFile | Bundle; - }; -} -declare namespace ts { - function getTransformers(compilerOptions: CompilerOptions, customTransformers?: CustomTransformers): TransformerFactory[]; - /** - * Transforms an array of SourceFiles by passing them through each transformer. - * - * @param resolver The emit resolver provided by the checker. - * @param host The emit host object used to interact with the file system. - * @param options Compiler options to surface in the `TransformationContext`. - * @param nodes An array of nodes to transform. - * @param transforms An array of `TransformerFactory` callbacks. - * @param allowDtsFiles A value indicating whether to allow the transformation of .d.ts files. - */ - function transformNodes(resolver: EmitResolver | undefined, host: EmitHost | undefined, options: CompilerOptions, nodes: ReadonlyArray, transformers: ReadonlyArray>, allowDtsFiles: boolean): TransformationResult; -} -declare namespace ts { - interface SourceMapWriter { - /** - * Initialize the SourceMapWriter for a new output file. - * - * @param filePath The path to the generated output file. - * @param sourceMapFilePath The path to the output source map file. - * @param sourceFileOrBundle The input source file or bundle for the program. - */ - initialize(filePath: string, sourceMapFilePath: string | undefined, sourceFileOrBundle: SourceFile | Bundle, sourceMapOutput?: SourceMapData[]): void; - /** - * Reset the SourceMapWriter to an empty state. - */ - reset(): void; - /** - * Set the current source file. - * - * @param sourceFile The source file. - */ - setSourceFile(sourceFile: SourceMapSource): void; - /** - * Emits a mapping. - * - * If the position is synthetic (undefined or a negative value), no mapping will be - * created. - * - * @param pos The position. - */ - emitPos(pos: number): void; - /** - * Emits a node with possible leading and trailing source maps. - * - * @param hint The current emit context - * @param node The node to emit. - * @param emitCallback The callback used to emit the node. - */ - emitNodeWithSourceMap(hint: EmitHint, node: Node, emitCallback: (hint: EmitHint, node: Node) => void): void; - /** - * Emits a token of a node node with possible leading and trailing source maps. - * - * @param node The node containing the token. - * @param token The token to emit. - * @param tokenStartPos The start pos of the token. - * @param emitCallback The callback used to emit the token. - */ - emitTokenWithSourceMap(node: Node, token: SyntaxKind, writer: (s: string) => void, tokenStartPos: number, emitCallback: (token: SyntaxKind, writer: (s: string) => void, tokenStartPos: number) => number): number; - /** - * Gets the text for the source map. - */ - getText(): string; - /** - * Gets the SourceMappingURL for the source map. - */ - getSourceMappingURL(): string; - } - interface SourceMapOptions { - sourceMap?: boolean; - inlineSourceMap?: boolean; - inlineSources?: boolean; - sourceRoot?: string; - mapRoot?: string; - extendedDiagnostics?: boolean; - } - function createSourceMapWriter(host: EmitHost, writer: EmitTextWriter, compilerOptions?: SourceMapOptions): SourceMapWriter; - interface SourceMapSection { - version: 3; - file: string; - sourceRoot?: string; - sources: string[]; - names?: string[]; - mappings: string; - sourcesContent?: (string | null)[]; - sections?: undefined; - } -} -declare namespace ts { - interface CommentWriter { - reset(): void; - setSourceFile(sourceFile: SourceFile): void; - setWriter(writer: EmitTextWriter | undefined): void; - emitNodeWithComments(hint: EmitHint, node: Node | undefined, emitCallback: (hint: EmitHint, node: Node) => void): void; - emitBodyWithDetachedComments(node: Node, detachedRange: TextRange, emitCallback: (node: Node) => void): void; - emitTrailingCommentsOfPosition(pos: number, prefixSpace?: boolean): void; - emitLeadingCommentsOfPosition(pos: number): void; - } - function createCommentWriter(printerOptions: PrinterOptions, emitPos: ((pos: number) => void) | undefined): CommentWriter; -} -declare namespace ts { - /** - * Iterates over the source files that are expected to have an emit output. - * - * @param host An EmitHost. - * @param action The action to execute. - * @param sourceFilesOrTargetSourceFile - * If an array, the full list of source files to emit. - * Else, calls `getSourceFilesToEmit` with the (optional) target source file to determine the list of source files to emit. - */ - function forEachEmittedFile(host: EmitHost, action: (emitFileNames: EmitFileNames, sourceFileOrBundle: SourceFile | Bundle) => T, sourceFilesOrTargetSourceFile?: ReadonlyArray | SourceFile, emitOnlyDtsFiles?: boolean): T | undefined; - function getOutputPathsFor(sourceFile: SourceFile | Bundle, host: EmitHost, forceDtsPaths: boolean): EmitFileNames; - function getOutputExtension(sourceFile: SourceFile, options: CompilerOptions): Extension; - function emitFiles(resolver: EmitResolver, host: EmitHost, targetSourceFile: SourceFile, emitOnlyDtsFiles?: boolean, transformers?: TransformerFactory[], declarationTransformers?: TransformerFactory[]): EmitResult; function createPrinter(printerOptions?: PrinterOptions, handlers?: PrintHandlers): Printer; } -declare namespace ts { - /** - * Partial interface of the System thats needed to support the caching of directory structure - */ - interface DirectoryStructureHost { - fileExists(path: string): boolean; - readFile(path: string, encoding?: string): string | undefined; - directoryExists?(path: string): boolean; - getDirectories?(path: string): string[]; - readDirectory?(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; - createDirectory?(path: string): void; - writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; - } - interface FileAndDirectoryExistence { - fileExists: boolean; - directoryExists: boolean; - } - interface CachedDirectoryStructureHost extends DirectoryStructureHost { - useCaseSensitiveFileNames: boolean; - getDirectories(path: string): string[]; - readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; - /** Returns the queried result for the file exists and directory exists if at all it was done */ - addOrDeleteFileOrDirectory(fileOrDirectory: string, fileOrDirectoryPath: Path): FileAndDirectoryExistence | undefined; - addOrDeleteFile(fileName: string, filePath: Path, eventKind: FileWatcherEventKind): void; - clearCache(): void; - } - function createCachedDirectoryStructureHost(host: DirectoryStructureHost, currentDirectory: string, useCaseSensitiveFileNames: boolean): CachedDirectoryStructureHost | undefined; - enum ConfigFileProgramReloadLevel { - None = 0, - /** Update the file name list from the disk */ - Partial = 1, - /** Reload completely by re-reading contents of config file from disk and updating program */ - Full = 2 - } - /** - * Updates the existing missing file watches with the new set of missing files after new program is created - */ - function updateMissingFilePathsWatch(program: Program, missingFileWatches: Map, createMissingFileWatch: (missingFilePath: Path) => FileWatcher): void; - interface WildcardDirectoryWatcher { - watcher: FileWatcher; - flags: WatchDirectoryFlags; - } - /** - * Updates the existing wild card directory watches with the new set of wild card directories from the config file - * after new program is created because the config file was reloaded or program was created first time from the config file - * Note that there is no need to call this function when the program is updated with additional files without reloading config files, - * as wildcard directories wont change unless reloading config file - */ - function updateWatchingWildcardDirectories(existingWatchedForWildcards: Map, wildcardDirectories: Map, watchDirectory: (directory: string, flags: WatchDirectoryFlags) => FileWatcher): void; - function isEmittedFileOfProgram(program: Program | undefined, file: string): boolean; - enum WatchLogLevel { - None = 0, - TriggerOnly = 1, - Verbose = 2 - } - interface WatchFileHost { - watchFile(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; - } - interface WatchDirectoryHost { - watchDirectory(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; - } - type WatchFile = (host: WatchFileHost, file: string, callback: FileWatcherCallback, pollingInterval: PollingInterval, detailInfo1?: X, detailInfo2?: Y) => FileWatcher; - type FilePathWatcherCallback = (fileName: string, eventKind: FileWatcherEventKind, filePath: Path) => void; - type WatchFilePath = (host: WatchFileHost, file: string, callback: FilePathWatcherCallback, pollingInterval: PollingInterval, path: Path, detailInfo1?: X, detailInfo2?: Y) => FileWatcher; - type WatchDirectory = (host: WatchDirectoryHost, directory: string, callback: DirectoryWatcherCallback, flags: WatchDirectoryFlags, detailInfo1?: X, detailInfo2?: Y) => FileWatcher; - interface WatchFactory { - watchFile: WatchFile; - watchFilePath: WatchFilePath; - watchDirectory: WatchDirectory; - } - function getWatchFactory(watchLogLevel: WatchLogLevel, log: (s: string) => void, getDetailWatchInfo?: GetDetailWatchInfo): WatchFactory; - type GetDetailWatchInfo = (detailInfo1: X, detailInfo2: Y | undefined) => string; - function closeFileWatcherOf(objWithWatcher: T): void; -} declare namespace ts { function findConfigFile(searchPath: string, fileExists: (fileName: string) => boolean, configName?: string): string | undefined; function resolveTripleslashReference(moduleName: string, containingFile: string): string; - function computeCommonSourceDirectoryOfFilenames(fileNames: string[], currentDirectory: string, getCanonicalFileName: GetCanonicalFileName): string; function createCompilerHost(options: CompilerOptions, setParentNodes?: boolean): CompilerHost; function getPreEmitDiagnostics(program: Program, sourceFile?: SourceFile, cancellationToken?: CancellationToken): Diagnostic[]; interface FormatDiagnosticsHost { @@ -8937,23 +4127,8 @@ declare namespace ts { } function formatDiagnostics(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function formatDiagnostic(diagnostic: Diagnostic, host: FormatDiagnosticsHost): string; - /** @internal */ - enum ForegroundColorEscapeSequences { - Grey = "\u001B[90m", - Red = "\u001B[91m", - Yellow = "\u001B[93m", - Blue = "\u001B[94m", - Cyan = "\u001B[96m" - } - /** @internal */ - function formatColorAndReset(text: string, formatStyle: string): string; - function formatLocation(file: SourceFile, start: number, host: FormatDiagnosticsHost, color?: typeof formatColorAndReset): string; function formatDiagnosticsWithColorAndContext(diagnostics: ReadonlyArray, host: FormatDiagnosticsHost): string; function flattenDiagnosticMessageText(messageText: string | DiagnosticMessageChain | undefined, newLine: string): string; - /** - * Determines if program structure is upto date or needs to be recreated - */ - function isProgramUptoDate(program: Program | undefined, rootFileNames: string[], newOptions: CompilerOptions, getSourceVersion: (path: Path) => string | undefined, fileExists: (fileName: string) => boolean, hasInvalidatedResolution: HasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames: boolean): boolean; function getConfigFileParsingDiagnostics(configFileParseResult: ParsedCommandLine): ReadonlyArray; /** * Create a new 'Program' instance. A Program is an immutable collection of 'SourceFile's and a 'CompilerOptions' @@ -8981,7 +4156,6 @@ declare namespace ts { * @returns A 'Program' object. */ function createProgram(rootNames: ReadonlyArray, options: CompilerOptions, host?: CompilerHost, oldProgram?: Program, configFileParsingDiagnostics?: ReadonlyArray): Program; - function parseConfigHostFromCompilerHost(host: CompilerHost): ParseConfigFileHost; interface ResolveProjectReferencePathHost { fileExists(fileName: string): boolean; } @@ -8990,12 +4164,6 @@ declare namespace ts { * Note: The file might not exist. */ function resolveProjectReferencePath(host: ResolveProjectReferencePathHost, ref: ProjectReference): ResolvedConfigFileName; - /** - * Returns a DiagnosticMessage if we won't include a resolved module due to its extension. - * The DiagnosticMessage's parameters are the imported module name, and the filename it resolved to. - * This returns a diagnostic even if the module will be an untyped module. - */ - function getResolutionDiagnostic(options: CompilerOptions, { extension }: ResolvedModuleFull): DiagnosticMessage | undefined; } declare namespace ts { interface EmitOutput { @@ -9008,126 +4176,6 @@ declare namespace ts { text: string; } } -declare namespace ts { - function getFileEmitOutput(program: Program, sourceFile: SourceFile, emitOnlyDtsFiles: boolean, cancellationToken?: CancellationToken, customTransformers?: CustomTransformers): EmitOutput; - interface BuilderState { - /** - * Information of the file eg. its version, signature etc - */ - fileInfos: Map; - /** - * Contains the map of ReferencedSet=Referenced files of the file if module emit is enabled - * Otherwise undefined - * Thus non undefined value indicates, module emit - */ - readonly referencedMap: ReadonlyMap | undefined; - /** - * Map of files that have already called update signature. - * That means hence forth these files are assumed to have - * no change in their signature for this version of the program - */ - hasCalledUpdateShapeSignature: Map; - /** - * Cache of all files excluding default library file for the current program - */ - allFilesExcludingDefaultLibraryFile: ReadonlyArray | undefined; - /** - * Cache of all the file names - */ - allFileNames: ReadonlyArray | undefined; - } -} -declare namespace ts.BuilderState { - /** - * Information about the source file: Its version and optional signature from last emit - */ - interface FileInfo { - readonly version: string; - signature: string | undefined; - } - /** - * Referenced files with values for the keys as referenced file's path to be true - */ - type ReferencedSet = ReadonlyMap; - /** - * Compute the hash to store the shape of the file - */ - type ComputeHash = (data: string) => string; - /** - * Returns true if oldState is reusable, that is the emitKind = module/non module has not changed - */ - function canReuseOldState(newReferencedMap: ReadonlyMap | undefined, oldState: Readonly | undefined): boolean | undefined; - /** - * Creates the state of file references and signature for the new program from oldState if it is safe - */ - function create(newProgram: Program, getCanonicalFileName: GetCanonicalFileName, oldState?: Readonly): BuilderState; - /** - * Gets the files affected by the path from the program - */ - function getFilesAffectedBy(state: BuilderState, programOfThisState: Program, path: Path, cancellationToken: CancellationToken | undefined, computeHash: ComputeHash, cacheToUpdateSignature?: Map): ReadonlyArray; - /** - * Updates the signatures from the cache into state's fileinfo signatures - * This should be called whenever it is safe to commit the state of the builder - */ - function updateSignaturesFromCache(state: BuilderState, signatureCache: Map): void; - /** - * Get all the dependencies of the sourceFile - */ - function getAllDependencies(state: BuilderState, programOfThisState: Program, sourceFile: SourceFile): ReadonlyArray; -} -declare namespace ts { - /** - * State to store the changed files, affected files and cache semantic diagnostics - */ - interface BuilderProgramState extends BuilderState { - /** - * Cache of semantic diagnostics for files with their Path being the key - */ - semanticDiagnosticsPerFile: Map> | undefined; - /** - * The map has key by source file's path that has been changed - */ - changedFilesSet: Map; - /** - * Set of affected files being iterated - */ - affectedFiles: ReadonlyArray | undefined; - /** - * Current index to retrieve affected file from - */ - affectedFilesIndex: number | undefined; - /** - * Current changed file for iterating over affected files - */ - currentChangedFilePath: Path | undefined; - /** - * Map of file signatures, with key being file path, calculated while getting current changed file's affected files - * These will be commited whenever the iteration through affected files of current changed file is complete - */ - currentAffectedFilesSignatures: Map | undefined; - /** - * Already seen affected files - */ - seenAffectedFiles: Map | undefined; - /** - * program corresponding to this state - */ - program: Program; - } - enum BuilderProgramKind { - SemanticDiagnosticsBuilderProgram = 0, - EmitAndSemanticDiagnosticsBuilderProgram = 1 - } - interface BuilderCreationParameters { - newProgram: Program; - host: BuilderProgramHost; - oldProgram: BuilderProgram | undefined; - configFileParsingDiagnostics: ReadonlyArray; - } - function getBuilderCreationParameters(newProgramOrRootNames: Program | ReadonlyArray | undefined, hostOrOptions: BuilderProgramHost | CompilerOptions | undefined, oldProgramOrHost?: BuilderProgram | CompilerHost, configFileParsingDiagnosticsOrOldProgram?: ReadonlyArray | BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray): BuilderCreationParameters; - function createBuilderProgram(kind: BuilderProgramKind.SemanticDiagnosticsBuilderProgram, builderCreationParameters: BuilderCreationParameters): SemanticDiagnosticsBuilderProgram; - function createBuilderProgram(kind: BuilderProgramKind.EmitAndSemanticDiagnosticsBuilderProgram, builderCreationParameters: BuilderCreationParameters): EmitAndSemanticDiagnosticsBuilderProgram; -} declare namespace ts { type AffectedFileResult = { result: T; @@ -9152,7 +4200,6 @@ declare namespace ts { * Builder to manage the program state changes */ interface BuilderProgram { - getState(): BuilderProgramState; /** * Returns current program */ @@ -9254,99 +4301,6 @@ declare namespace ts { function createAbstractBuilder(newProgram: Program, host: BuilderProgramHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray): BuilderProgram; function createAbstractBuilder(rootNames: ReadonlyArray | undefined, options: CompilerOptions | undefined, host?: CompilerHost, oldProgram?: BuilderProgram, configFileParsingDiagnostics?: ReadonlyArray): BuilderProgram; } -declare namespace ts { - /** This is the cache of module/typedirectives resolution that can be retained across program */ - interface ResolutionCache { - startRecordingFilesWithChangedResolutions(): void; - finishRecordingFilesWithChangedResolutions(): Path[] | undefined; - resolveModuleNames(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined): ResolvedModuleFull[]; - getResolvedModuleWithFailedLookupLocationsFromCache(moduleName: string, containingFile: string): CachedResolvedModuleWithFailedLookupLocations | undefined; - resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; - invalidateResolutionOfFile(filePath: Path): void; - removeResolutionsOfFile(filePath: Path): void; - setFilesWithInvalidatedNonRelativeUnresolvedImports(filesWithUnresolvedImports: Map>): void; - createHasInvalidatedResolution(forceAllFilesAsInvalidated?: boolean): HasInvalidatedResolution; - startCachingPerDirectoryResolution(): void; - finishCachingPerDirectoryResolution(): void; - updateTypeRootsWatch(): void; - closeTypeRootsWatch(): void; - clear(): void; - } - interface ResolutionWithFailedLookupLocations { - readonly failedLookupLocations: ReadonlyArray; - isInvalidated?: boolean; - refCount?: number; - } - interface CachedResolvedModuleWithFailedLookupLocations extends ResolvedModuleWithFailedLookupLocations, ResolutionWithFailedLookupLocations { - } - interface ResolutionCacheHost extends ModuleResolutionHost { - toPath(fileName: string): Path; - getCanonicalFileName: GetCanonicalFileName; - getCompilationSettings(): CompilerOptions; - watchDirectoryOfFailedLookupLocation(directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher; - onInvalidatedResolution(): void; - watchTypeRootsDirectory(directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher; - onChangedAutomaticTypeDirectiveNames(): void; - getCachedDirectoryStructureHost(): CachedDirectoryStructureHost | undefined; - projectName?: string; - getGlobalCache?(): string | undefined; - writeLog(s: string): void; - maxNumberOfFilesToIterateForInvalidation?: number; - getCurrentProgram(): Program; - } - const maxNumberOfFilesToIterateForInvalidation = 256; - function createResolutionCache(resolutionHost: ResolutionCacheHost, rootDirForResolution: string | undefined, logChangesWhenResolvingModule: boolean): ResolutionCache; -} -declare namespace ts.moduleSpecifiers { - interface ModuleSpecifierPreferences { - readonly importModuleSpecifierPreference?: "relative" | "non-relative"; - } - function getModuleSpecifier(compilerOptions: CompilerOptions, importingSourceFile: SourceFile, importingSourceFileName: Path, toFileName: string, host: ModuleSpecifierResolutionHost, files: ReadonlyArray, preferences?: ModuleSpecifierPreferences): string; - function getModuleSpecifiers(moduleSymbol: Symbol, compilerOptions: CompilerOptions, importingSourceFile: SourceFile, host: ModuleSpecifierResolutionHost, files: ReadonlyArray, preferences: ModuleSpecifierPreferences): ReadonlyArray>; -} -declare namespace ts { - /** - * Create a function that reports error by writing to the system and handles the formating of the diagnostic - */ - function createDiagnosticReporter(system: System, pretty?: boolean): DiagnosticReporter; - /** @internal */ - const nonClearingMessageCodes: number[]; - /** @internal */ - const screenStartingMessageCodes: number[]; - /** - * Create a function that reports watch status by writing to the system and handles the formating of the diagnostic - */ - function createWatchStatusReporter(system: System, pretty?: boolean): WatchStatusReporter; - /** Parses config file using System interface */ - function parseConfigFileWithSystem(configFileName: string, optionsToExtend: CompilerOptions, system: System, reportDiagnostic: DiagnosticReporter): ParsedCommandLine | undefined; - /** - * Program structure needed to emit the files and report diagnostics - */ - interface ProgramToEmitFilesAndReportErrors { - getCurrentDirectory(): string; - getCompilerOptions(): CompilerOptions; - getSourceFiles(): ReadonlyArray; - getSyntacticDiagnostics(): ReadonlyArray; - getOptionsDiagnostics(): ReadonlyArray; - getGlobalDiagnostics(): ReadonlyArray; - getSemanticDiagnostics(): ReadonlyArray; - getConfigFileParsingDiagnostics(): ReadonlyArray; - emit(): EmitResult; - } - type ReportEmitErrorSummary = (errorCount: number) => void; - /** - * Helper that emit files, report diagnostics and lists emitted and/or source files depending on compiler options - */ - function emitFilesAndReportErrors(program: ProgramToEmitFilesAndReportErrors, reportDiagnostic: DiagnosticReporter, writeFileName?: (s: string) => void, reportSummary?: ReportEmitErrorSummary): ExitStatus; - /** - * Creates the watch compiler host from system for config file in watch mode - */ - function createWatchCompilerHostOfConfigFile(configFileName: string, optionsToExtend: CompilerOptions | undefined, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfConfigFile; - /** - * Creates the watch compiler host from system for compiling root files and options in watch mode - */ - function createWatchCompilerHostOfFilesAndCompilerOptions(rootFiles: string[], options: CompilerOptions, system: System, createProgram?: CreateProgram, reportDiagnostic?: DiagnosticReporter, reportWatchStatus?: WatchStatusReporter): WatchCompilerHostOfFilesAndCompilerOptions; -} declare namespace ts { type WatchStatusReporter = (diagnostic: Diagnostic, newLine: string, options: CompilerOptions) => void; /** Create the program with rootNames and options, if they are undefined, oldProgram and new configFile diagnostics create new program */ @@ -9360,7 +4314,6 @@ declare namespace ts { afterProgramCreate?(program: T): void; /** If provided, called with Diagnostic message that informs about change in watch status */ onWatchStatusChange?(diagnostic: Diagnostic, newLine: string, options: CompilerOptions): void; - maxNumberOfFilesToIterateForInvalidation?: number; useCaseSensitiveFileNames(): boolean; getNewLine(): string; getCurrentDirectory(): string; @@ -9402,12 +4355,6 @@ declare namespace ts { /** If provided, will be used to reset existing delayed compilation */ clearTimeout?(timeoutId: any): void; } - /** Internal interface used to wire emit through same host */ - interface WatchCompilerHost { - createDirectory?(path: string): void; - writeFile?(path: string, data: string, writeByteOrderMark?: boolean): void; - onCachedDirectoryStructureHostCreate?(host: CachedDirectoryStructureHost): void; - } /** * Host to create watch with root files and options */ @@ -9431,18 +4378,9 @@ declare namespace ts { */ readDirectory(path: string, extensions?: ReadonlyArray, exclude?: ReadonlyArray, include?: ReadonlyArray, depth?: number): string[]; } - /** - * Host to create watch with config file that is already parsed (from tsc) - */ - interface WatchCompilerHostOfConfigFile extends WatchCompilerHost { - optionsToExtend?: CompilerOptions; - configFileParsingResult?: ParsedCommandLine; - } interface Watch { /** Synchronize with host and get updated program */ getProgram(): T; - /** Gets the existing program without synchronizing with changes on host */ - getCurrentProgram(): T; } /** * Creates the watch what generates program using the config file @@ -9644,31 +4582,6 @@ declare namespace ts { function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray; function formatUpToDateStatus(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined; } -//# sourceMappingURL=compiler.d.ts.map -declare namespace ts.server { - const ActionSet: ActionSet; - const ActionInvalidate: ActionInvalidate; - const ActionPackageInstalled: ActionPackageInstalled; - const EventTypesRegistry: EventTypesRegistry; - const EventBeginInstallTypes: EventBeginInstallTypes; - const EventEndInstallTypes: EventEndInstallTypes; - const EventInitializationFailed: EventInitializationFailed; - namespace Arguments { - const GlobalCacheLocation = "--globalTypingsCacheLocation"; - const LogFile = "--logFile"; - const EnableTelemetry = "--enableTelemetry"; - const TypingSafeListLocation = "--typingSafeListLocation"; - const TypesMapLocation = "--typesMapLocation"; - /** - * This argument specifies the location of the NPM executable. - * typingsInstaller will run the command with `${npmLocation} install ...`. - */ - const NpmLocation = "--npmLocation"; - } - function hasArgument(argumentName: string): boolean; - function findArgument(argumentName: string): string | undefined; - function nowString(): string; -} declare namespace ts.server { type ActionSet = "action::set"; type ActionInvalidate = "action::invalidate"; @@ -9686,7 +4599,6 @@ declare namespace ts.server { interface TypingInstallerRequestWithProjectName { readonly projectName: string; } - type TypingInstallerRequestUnion = DiscoverTypings | CloseProject | TypesRegistryRequest | InstallPackageRequest; interface DiscoverTypings extends TypingInstallerRequestWithProjectName { readonly fileNames: string[]; readonly projectRootPath: Path; @@ -9708,10 +4620,6 @@ declare namespace ts.server { readonly packageName: string; readonly projectRootPath: Path; } - interface TypesRegistryResponse extends TypingInstallerResponse { - readonly kind: EventTypesRegistry; - readonly typesRegistry: MapLike>; - } interface PackageInstalledResponse extends ProjectResponse { readonly kind: ActionPackageInstalled; readonly success: boolean; @@ -9740,13 +4648,6 @@ declare namespace ts.server { readonly kind: EventEndInstallTypes; readonly installSuccess: boolean; } - interface InstallTypingHost extends JsTyping.TypingResolutionHost { - useCaseSensitiveFileNames: boolean; - writeFile(path: string, content: string): void; - createDirectory(path: string): void; - watchFile?(path: string, callback: FileWatcherCallback, pollingInterval?: number): FileWatcher; - watchDirectory?(path: string, callback: DirectoryWatcherCallback, recursive?: boolean): FileWatcher; - } interface SetTypings extends ProjectResponse { readonly typeAcquisition: TypeAcquisition; readonly compilerOptions: CompilerOptions; @@ -9754,86 +4655,14 @@ declare namespace ts.server { readonly unresolvedImports: SortedReadonlyArray; readonly kind: ActionSet; } - type TypingInstallerResponseUnion = SetTypings | InvalidateCachedTypings | TypesRegistryResponse | PackageInstalledResponse | InstallTypes | InitializationFailedResponse; -} -declare namespace ts.JsTyping { - interface TypingResolutionHost { - directoryExists(path: string): boolean; - fileExists(fileName: string): boolean; - readFile(path: string, encoding?: string): string | undefined; - readDirectory(rootDir: string, extensions: ReadonlyArray, excludes: ReadonlyArray | undefined, includes: ReadonlyArray | undefined, depth?: number): string[]; - } - interface CachedTyping { - typingLocation: string; - version: Semver; - } - function isTypingUpToDate(cachedTyping: CachedTyping, availableTypingVersions: MapLike): boolean; - const nodeCoreModuleList: ReadonlyArray; - const nodeCoreModules: Map; - /** - * A map of loose file names to library names that we are confident require typings - */ - type SafeList = ReadonlyMap; - function loadSafeList(host: TypingResolutionHost, safeListPath: Path): SafeList; - function loadTypesMap(host: TypingResolutionHost, typesMapPath: Path): SafeList | undefined; - /** - * @param host is the object providing I/O related operations. - * @param fileNames are the file names that belong to the same project - * @param projectRootPath is the path to the project root directory - * @param safeListPath is the path used to retrieve the safe list - * @param packageNameToTypingLocation is the map of package names to their cached typing locations and installed versions - * @param typeAcquisition is used to customize the typing acquisition process - * @param compilerOptions are used as a source for typing inference - */ - function discoverTypings(host: TypingResolutionHost, log: ((message: string) => void) | undefined, fileNames: string[], projectRootPath: Path, safeList: SafeList, packageNameToTypingLocation: ReadonlyMap, typeAcquisition: TypeAcquisition, unresolvedImports: ReadonlyArray, typesRegistry: ReadonlyMap>): { - cachedTypingPaths: string[]; - newTypingNames: string[]; - filesToWatch: string[]; - }; - enum PackageNameValidationResult { - Ok = 0, - ScopedPackagesNotSupported = 1, - EmptyName = 2, - NameTooLong = 3, - NameStartsWithDot = 4, - NameStartsWithUnderscore = 5, - NameContainsNonURISafeCharacters = 6 - } - /** - * Validates package name using rules defined at https://docs.npmjs.com/files/package.json - */ - function validatePackageName(packageName: string): PackageNameValidationResult; - function renderPackageNameValidationFailure(result: PackageNameValidationResult, typing: string): string; -} -declare namespace ts { - class Semver { - readonly major: number; - readonly minor: number; - readonly patch: number; - /** - * If true, this is `major.minor.0-next.patch`. - * If false, this is `major.minor.patch`. - */ - readonly isPrerelease: boolean; - static parse(semver: string): Semver; - static fromRaw({ major, minor, patch, isPrerelease }: Semver): Semver; - private static tryParse; - private constructor(); - readonly versionString: string; - equals(sem: Semver): boolean; - greaterThan(sem: Semver): boolean; - } } -//# sourceMappingURL=jsTyping.d.ts.map declare namespace ts { interface Node { getSourceFile(): SourceFile; getChildCount(sourceFile?: SourceFile): number; getChildAt(index: number, sourceFile?: SourceFile): Node; getChildren(sourceFile?: SourceFile): Node[]; - getChildren(sourceFile?: SourceFileLike): Node[]; getStart(sourceFile?: SourceFile, includeJsDocComment?: boolean): number; - getStart(sourceFile?: SourceFileLike, includeJsDocComment?: boolean): number; getFullStart(): number; getEnd(): number; getWidth(sourceFile?: SourceFileLike): number; @@ -9890,20 +4719,14 @@ declare namespace ts { getJsDocTags(): JSDocTagInfo[]; } interface SourceFile { - version: string; - scriptSnapshot: IScriptSnapshot | undefined; - nameTable: UnderscoreEscapedMap | undefined; - getNamedDeclarations(): Map>; getLineAndCharacterOfPosition(pos: number): LineAndCharacter; getLineEndOfPosition(pos: number): number; getLineStarts(): ReadonlyArray; getPositionOfLineAndCharacter(line: number, character: number): number; update(newText: string, textChangeRange: TextChangeRange): SourceFile; - sourceMapper?: sourcemaps.SourceMapper; } interface SourceFileLike { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; - sourceMapper?: sourcemaps.SourceMapper; } interface SourceMapSource { getLineAndCharacterOfPosition(pos: number): LineAndCharacter; @@ -9972,8 +4795,6 @@ declare namespace ts { resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames?: string[]): ResolvedModule[]; getResolvedModuleWithFailedLookupLocationsFromCache?(modulename: string, containingFile: string): ResolvedModuleWithFailedLookupLocations | undefined; resolveTypeReferenceDirectives?(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; - hasInvalidatedResolution?: HasInvalidatedResolution; - hasChangedAutomaticTypeDirectiveNames?: boolean; getDirectories?(directoryName: string): string[]; /** * Gets a set of custom transformers to use during emit. @@ -9990,7 +4811,6 @@ declare namespace ts { readonly importModuleSpecifierPreference?: "relative" | "non-relative"; readonly allowTextChangesInNewFiles?: boolean; } - const emptyOptions: {}; interface LanguageService { cleanupSemanticCache(): void; getSyntacticDiagnostics(fileName: string): DiagnosticWithLocation[]; @@ -10045,8 +4865,6 @@ declare namespace ts { getJsxClosingTagAtPosition(fileName: string, position: number): JsxClosingTagInfo | undefined; getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): TextSpan | undefined; toLineColumnOffset?(fileName: string, position: number): LineAndCharacter; - /** @internal */ - getSourceMapper(): SourceMapper; getCodeFixesAtPosition(fileName: string, start: number, end: number, errorCodes: ReadonlyArray, formatOptions: FormatCodeSettings, preferences: UserPreferences): ReadonlyArray; getCombinedCodeFix(scope: CombinedCodeFixScope, fixId: {}, formatOptions: FormatCodeSettings, preferences: UserPreferences): CombinedCodeActions; applyCodeActionCommand(action: CodeActionCommand): Promise; @@ -10064,7 +4882,6 @@ declare namespace ts { getEditsForFileRename(oldFilePath: string, newFilePath: string, formatOptions: FormatCodeSettings, preferences: UserPreferences | undefined): ReadonlyArray; getEmitOutput(fileName: string, emitOnlyDtsFiles?: boolean): EmitOutput; getProgram(): Program | undefined; - getNonBoundSourceFile(fileName: string): SourceFile; dispose(): void; } interface JsxClosingTagInfo { @@ -10216,9 +5033,6 @@ declare namespace ts { } type CodeActionCommand = InstallPackageAction; interface InstallPackageAction { - file: string; - type: "install package"; - packageName: string; } /** * A set of one or more available refactoring actions, grouped under a parent refactoring. @@ -10730,287 +5544,8 @@ declare namespace ts { jsxAttributeStringLiteralValue = 24 } } -interface PromiseConstructor { - new (executor: (resolve: (value?: T | PromiseLike) => void, reject: (reason?: any) => void) => void): Promise; - reject(reason: any): Promise; - all(values: (T | PromiseLike)[]): Promise; -} -declare var Promise: PromiseConstructor; -declare namespace ts { - const scanner: Scanner; - enum SemanticMeaning { - None = 0, - Value = 1, - Type = 2, - Namespace = 4, - All = 7 - } - function getMeaningFromDeclaration(node: Node): SemanticMeaning; - function getMeaningFromLocation(node: Node): SemanticMeaning; - function isInRightSideOfInternalImportEqualsDeclaration(node: Node): boolean; - function isCallExpressionTarget(node: Node): boolean; - function isNewExpressionTarget(node: Node): boolean; - function climbPastPropertyAccess(node: Node): Node; - function getTargetLabel(referenceNode: Node, labelName: string): Identifier | undefined; - function isJumpStatementTarget(node: Node): node is Identifier & { - parent: BreakOrContinueStatement; - }; - function isLabelOfLabeledStatement(node: Node): node is Identifier; - function isLabelName(node: Node): boolean; - function isRightSideOfQualifiedName(node: Node): boolean; - function isRightSideOfPropertyAccess(node: Node): boolean; - function isNameOfModuleDeclaration(node: Node): boolean; - function isNameOfFunctionDeclaration(node: Node): boolean; - function isLiteralNameOfPropertyDeclarationOrIndexAccess(node: StringLiteral | NumericLiteral): boolean; - function isExpressionOfExternalModuleImportEqualsDeclaration(node: Node): boolean; - function getContainerNode(node: Node): Declaration | undefined; - function getNodeKind(node: Node): ScriptElementKind; - function isThis(node: Node): boolean; - interface ListItemInfo { - listItemIndex: number; - list: Node; - } - function getLineStartPositionForPosition(position: number, sourceFile: SourceFileLike): number; - function rangeContainsRange(r1: TextRange, r2: TextRange): boolean; - function rangeContainsRangeExclusive(r1: TextRange, r2: TextRange): boolean; - function rangeContainsPosition(r: TextRange, pos: number): boolean; - function rangeContainsPositionExclusive(r: TextRange, pos: number): boolean; - function startEndContainsRange(start: number, end: number, range: TextRange): boolean; - function rangeContainsStartEnd(range: TextRange, start: number, end: number): boolean; - function rangeOverlapsWithStartEnd(r1: TextRange, start: number, end: number): boolean; - function nodeOverlapsWithStartEnd(node: Node, sourceFile: SourceFile, start: number, end: number): boolean; - function startEndOverlapsWithStartEnd(start1: number, end1: number, start2: number, end2: number): boolean; - /** - * Assumes `candidate.start <= position` holds. - */ - function positionBelongsToNode(candidate: Node, position: number, sourceFile: SourceFile): boolean; - function findListItemInfo(node: Node): ListItemInfo | undefined; - function hasChildOfKind(n: Node, kind: SyntaxKind, sourceFile: SourceFile): boolean; - function findChildOfKind(n: Node, kind: T["kind"], sourceFile: SourceFileLike): T | undefined; - function findContainingList(node: Node): SyntaxList | undefined; - /** - * Gets the token whose text has range [start, end) and - * position >= start and (position < end or (position === end && token is literal or keyword or identifier)) - */ - function getTouchingPropertyName(sourceFile: SourceFile, position: number): Node; - /** - * Returns the token if position is in [start, end). - * If position === end, returns the preceding token if includeItemAtEndPosition(previousToken) === true - */ - function getTouchingToken(sourceFile: SourceFile, position: number, includePrecedingTokenAtEndPosition?: (n: Node) => boolean): Node; - /** Returns a token if position is in [start-of-leading-trivia, end) */ - function getTokenAtPosition(sourceFile: SourceFile, position: number): Node; - /** - * The token on the left of the position is the token that strictly includes the position - * or sits to the left of the cursor if it is on a boundary. For example - * - * fo|o -> will return foo - * foo |bar -> will return foo - * - */ - function findTokenOnLeftOfPosition(file: SourceFile, position: number): Node | undefined; - function findNextToken(previousToken: Node, parent: Node, sourceFile: SourceFile): Node | undefined; - /** - * Finds the rightmost token satisfying `token.end <= position`, - * excluding `JsxText` tokens containing only whitespace. - */ - function findPrecedingToken(position: number, sourceFile: SourceFile, startNode?: Node, excludeJsdoc?: boolean): Node | undefined; - function isInString(sourceFile: SourceFile, position: number, previousToken?: Node | undefined): boolean; - /** - * returns true if the position is in between the open and close elements of an JSX expression. - */ - function isInsideJsxElementOrAttribute(sourceFile: SourceFile, position: number): boolean; - function isInTemplateString(sourceFile: SourceFile, position: number): boolean; - function findPrecedingMatchingToken(token: Node, matchingTokenKind: SyntaxKind, sourceFile: SourceFile): Node | undefined; - interface PossibleTypeArgumentInfo { - readonly called: Identifier; - readonly nTypeArguments: number; - } - function isPossiblyTypeArgumentPosition(tokenIn: Node, sourceFile: SourceFile): PossibleTypeArgumentInfo | undefined; - /** - * Returns true if the cursor at position in sourceFile is within a comment. - * - * @param tokenAtPosition Must equal `getTokenAtPosition(sourceFile, position) - * @param predicate Additional predicate to test on the comment range. - */ - function isInComment(sourceFile: SourceFile, position: number, tokenAtPosition?: Node): CommentRange | undefined; - function hasDocComment(sourceFile: SourceFile, position: number): boolean; - function getNodeModifiers(node: Node): string; - function getTypeArgumentOrTypeParameterList(node: Node): NodeArray | undefined; - function isComment(kind: SyntaxKind): boolean; - function isStringOrRegularExpressionOrTemplateLiteral(kind: SyntaxKind): boolean; - function isPunctuation(kind: SyntaxKind): boolean; - function isInsideTemplateLiteral(node: TemplateLiteralToken, position: number, sourceFile: SourceFile): boolean; - function isAccessibilityModifier(kind: SyntaxKind): boolean; - function cloneCompilerOptions(options: CompilerOptions): CompilerOptions; - function isArrayLiteralOrObjectLiteralDestructuringPattern(node: Node): boolean; - function isInReferenceComment(sourceFile: SourceFile, position: number): boolean; - function isInNonReferenceComment(sourceFile: SourceFile, position: number): boolean; - function createTextSpanFromNode(node: Node, sourceFile?: SourceFile): TextSpan; - function createTextSpanFromRange(range: TextRange): TextSpan; - function createTextRangeFromSpan(span: TextSpan): TextRange; - function createTextChangeFromStartLength(start: number, length: number, newText: string): TextChange; - function createTextChange(span: TextSpan, newText: string): TextChange; - const typeKeywords: ReadonlyArray; - function isTypeKeyword(kind: SyntaxKind): boolean; - /** True if the symbol is for an external module, as opposed to a namespace. */ - function isExternalModuleSymbol(moduleSymbol: Symbol): boolean; - /** Returns `true` the first time it encounters a node and `false` afterwards. */ - type NodeSeenTracker = (node: T) => boolean; - function nodeSeenTracker(): NodeSeenTracker; - function getSnapshotText(snap: IScriptSnapshot): string; - function repeatString(str: string, count: number): string; - function skipConstraint(type: Type): Type; - function getNameFromPropertyName(name: PropertyName): string | undefined; - function programContainsEs6Modules(program: Program): boolean; - function compilerOptionsIndicateEs6Modules(compilerOptions: CompilerOptions): boolean; - function hostUsesCaseSensitiveFileNames(host: LanguageServiceHost): boolean; - function hostGetCanonicalFileName(host: LanguageServiceHost): GetCanonicalFileName; - function makeImportIfNecessary(defaultImport: Identifier | undefined, namedImports: ReadonlyArray | undefined, moduleSpecifier: string, quotePreference: QuotePreference): ImportDeclaration | undefined; - function makeImport(defaultImport: Identifier | undefined, namedImports: ReadonlyArray | undefined, moduleSpecifier: string | Expression, quotePreference: QuotePreference): ImportDeclaration; - function makeStringLiteral(text: string, quotePreference: QuotePreference): StringLiteral; - enum QuotePreference { - Single = 0, - Double = 1 - } - function quotePreferenceFromString(str: StringLiteral, sourceFile: SourceFile): QuotePreference; - function getQuotePreference(sourceFile: SourceFile, preferences: UserPreferences): QuotePreference; - function symbolNameNoDefault(symbol: Symbol): string | undefined; - function symbolEscapedNameNoDefault(symbol: Symbol): __String | undefined; - function getPropertySymbolFromBindingElement(checker: TypeChecker, bindingElement: BindingElement & { - name: Identifier; - }): Symbol | undefined; - /** - * Find symbol of the given property-name and add the symbol to the given result array - * @param symbol a symbol to start searching for the given propertyName - * @param propertyName a name of property to search for - * @param result an array of symbol of found property symbols - * @param previousIterationSymbolsCache a cache of symbol from previous iterations of calling this function to prevent infinite revisiting of the same symbol. - * The value of previousIterationSymbol is undefined when the function is first called. - */ - function getPropertySymbolsFromBaseTypes(symbol: Symbol, propertyName: string, checker: TypeChecker, cb: (symbol: Symbol) => T | undefined): T | undefined; - function isMemberSymbolInBaseType(memberSymbol: Symbol, checker: TypeChecker): boolean; - interface ReadonlyNodeSet { - has(node: Node): boolean; - forEach(cb: (node: Node) => void): void; - some(pred: (node: Node) => boolean): boolean; - } - class NodeSet implements ReadonlyNodeSet { - private map; - add(node: Node): void; - has(node: Node): boolean; - forEach(cb: (node: Node) => void): void; - some(pred: (node: Node) => boolean): boolean; - } - interface ReadonlyNodeMap { - get(node: TNode): TValue | undefined; - has(node: TNode): boolean; - } - class NodeMap implements ReadonlyNodeMap { - private map; - get(node: TNode): TValue | undefined; - getOrUpdate(node: TNode, setValue: () => TValue): TValue; - set(node: TNode, value: TValue): void; - has(node: TNode): boolean; - forEach(cb: (value: TValue, node: TNode) => void): void; - } - function getParentNodeInSpan(node: Node | undefined, file: SourceFile, span: TextSpan): Node | undefined; - function findModifier(node: Node, kind: Modifier["kind"]): Modifier | undefined; - function insertImport(changes: textChanges.ChangeTracker, sourceFile: SourceFile, importDecl: Statement): void; - function textSpansEqual(a: TextSpan | undefined, b: TextSpan | undefined): boolean; - function documentSpansEqual(a: DocumentSpan, b: DocumentSpan): boolean; -} -declare namespace ts { - function isFirstDeclarationOfSymbolParameter(symbol: Symbol): boolean; - function symbolPart(text: string, symbol: Symbol): SymbolDisplayPart; - function displayPart(text: string, kind: SymbolDisplayPartKind): SymbolDisplayPart; - function spacePart(): SymbolDisplayPart; - function keywordPart(kind: SyntaxKind): SymbolDisplayPart; - function punctuationPart(kind: SyntaxKind): SymbolDisplayPart; - function operatorPart(kind: SyntaxKind): SymbolDisplayPart; - function textOrKeywordPart(text: string): SymbolDisplayPart; - function textPart(text: string): SymbolDisplayPart; - /** - * The default is CRLF. - */ - function getNewLineOrDefaultFromHost(host: LanguageServiceHost | LanguageServiceShimHost, formatSettings?: FormatCodeSettings): string; - function lineBreakPart(): SymbolDisplayPart; - function mapToDisplayParts(writeDisplayParts: (writer: DisplayPartsSymbolWriter) => void): SymbolDisplayPart[]; - function typeToDisplayParts(typechecker: TypeChecker, type: Type, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function symbolToDisplayParts(typeChecker: TypeChecker, symbol: Symbol, enclosingDeclaration?: Node, meaning?: SymbolFlags, flags?: SymbolFormatFlags): SymbolDisplayPart[]; - function signatureToDisplayParts(typechecker: TypeChecker, signature: Signature, enclosingDeclaration?: Node, flags?: TypeFormatFlags): SymbolDisplayPart[]; - function isImportOrExportSpecifierName(location: Node): location is Identifier; - /** - * Strip off existed single quotes or double quotes from a given string - * - * @return non-quoted string - */ - function stripQuotes(name: string): string; - function startsWithQuote(name: string): boolean; - function scriptKindIs(fileName: string, host: LanguageServiceHost, ...scriptKinds: ScriptKind[]): boolean; - function getScriptKind(fileName: string, host?: LanguageServiceHost): ScriptKind; - function getUniqueSymbolId(symbol: Symbol, checker: TypeChecker): number; - function getFirstNonSpaceCharacterPosition(text: string, position: number): number; - /** - * Creates a deep, memberwise clone of a node with no source map location. - * - * WARNING: This is an expensive operation and is only intended to be used in refactorings - * and code fixes (because those are triggered by explicit user actions). - */ - function getSynthesizedDeepClone(node: T, includeTrivia?: boolean): T; - function getSynthesizedDeepClones(nodes: NodeArray, includeTrivia?: boolean): NodeArray; - function getSynthesizedDeepClones(nodes: NodeArray | undefined, includeTrivia?: boolean): NodeArray | undefined; - /** - * Sets EmitFlags to suppress leading and trailing trivia on the node. - */ - function suppressLeadingAndTrailingTrivia(node: Node): void; - /** - * Sets EmitFlags to suppress leading trivia on the node. - */ - function suppressLeadingTrivia(node: Node): void; - /** - * Sets EmitFlags to suppress trailing trivia on the node. - */ - function suppressTrailingTrivia(node: Node): void; - function getUniqueName(baseName: string, sourceFile: SourceFile): string; - /** - * @return The index of the (only) reference to the extracted symbol. We want the cursor - * to be on the reference, rather than the declaration, because it's closer to where the - * user was before extracting it. - */ - function getRenameLocation(edits: ReadonlyArray, renameFilename: string, name: string, preferLastLocation: boolean): number; - function copyComments(sourceNode: Node, targetNode: Node, sourceFile: SourceFile, commentKind?: CommentKind, hasTrailingNewLine?: boolean): void; -} -declare namespace ts { - function createClassifier(): Classifier; - function getSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: UnderscoreEscapedMap, span: TextSpan): ClassifiedSpan[]; - function getEncodedSemanticClassifications(typeChecker: TypeChecker, cancellationToken: CancellationToken, sourceFile: SourceFile, classifiableNames: UnderscoreEscapedMap, span: TextSpan): Classifications; - function getSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): ClassifiedSpan[]; - function getEncodedSyntacticClassifications(cancellationToken: CancellationToken, sourceFile: SourceFile, span: TextSpan): Classifications; -} -declare namespace ts.Completions.PathCompletions { - interface NameAndKind { - readonly name: string; - readonly kind: ScriptElementKind.scriptElement | ScriptElementKind.directory | ScriptElementKind.externalModuleName; - } - interface PathCompletion extends NameAndKind { - readonly span: TextSpan | undefined; - } - function getStringLiteralCompletionsFromModuleNames(sourceFile: SourceFile, node: LiteralExpression, compilerOptions: CompilerOptions, host: LanguageServiceHost, typeChecker: TypeChecker): ReadonlyArray; - function getTripleSlashReferenceCompletion(sourceFile: SourceFile, position: number, compilerOptions: CompilerOptions, host: LanguageServiceHost): ReadonlyArray | undefined; -} -declare namespace ts.Completions { - type Log = (message: string) => void; - function getCompletionsAtPosition(host: LanguageServiceHost, program: Program, log: Log, sourceFile: SourceFile, position: number, preferences: UserPreferences, triggerCharacter: CompletionsTriggerCharacter | undefined): CompletionInfo | undefined; - interface CompletionEntryIdentifier { - name: string; - source?: string; - } - function getCompletionEntryDetails(program: Program, log: Log, sourceFile: SourceFile, position: number, entryId: CompletionEntryIdentifier, host: LanguageServiceHost, formatContext: formatting.FormatContext, preferences: UserPreferences, cancellationToken: CancellationToken): CompletionEntryDetails | undefined; - function getCompletionEntrySymbol(program: Program, log: Log, sourceFile: SourceFile, position: number, entryId: CompletionEntryIdentifier): Symbol | undefined; -} -declare namespace ts.DocumentHighlights { - function getDocumentHighlights(program: Program, cancellationToken: CancellationToken, sourceFile: SourceFile, position: number, sourceFilesToSearch: ReadonlyArray): DocumentHighlights[] | undefined; +declare namespace ts { + function createClassifier(): Classifier; } declare namespace ts { /** @@ -11071,284 +5606,16 @@ declare namespace ts { */ releaseDocument(fileName: string, compilationSettings: CompilerOptions): void; releaseDocumentWithKey(path: Path, key: DocumentRegistryBucketKey): void; - getLanguageServiceRefCounts(path: Path): [string, number | undefined][]; reportStats(): string; } - interface ExternalDocumentCache { - setDocument(key: DocumentRegistryBucketKey, path: Path, sourceFile: SourceFile): void; - getDocument(key: DocumentRegistryBucketKey, path: Path): SourceFile | undefined; - } type DocumentRegistryBucketKey = string & { __bucketKey: any; }; function createDocumentRegistry(useCaseSensitiveFileNames?: boolean, currentDirectory?: string): DocumentRegistry; - function createDocumentRegistryInternal(useCaseSensitiveFileNames?: boolean, currentDirectory?: string, externalCache?: ExternalDocumentCache): DocumentRegistry; -} -declare namespace ts.FindAllReferences { - interface ImportsResult { - /** For every import of the symbol, the location and local symbol for the import. */ - importSearches: ReadonlyArray<[Identifier, Symbol]>; - /** For rename imports/exports `{ foo as bar }`, `foo` is not a local, so it may be added as a reference immediately without further searching. */ - singleReferences: ReadonlyArray; - /** List of source files that may (or may not) use the symbol via a namespace. (For UMD modules this is every file.) */ - indirectUsers: ReadonlyArray; - } - type ImportTracker = (exportSymbol: Symbol, exportInfo: ExportInfo, isForRename: boolean) => ImportsResult; - /** Creates the imports map and returns an ImportTracker that uses it. Call this lazily to avoid calling `getDirectImportsMap` unnecessarily. */ - function createImportTracker(sourceFiles: ReadonlyArray, sourceFilesSet: ReadonlyMap, checker: TypeChecker, cancellationToken: CancellationToken | undefined): ImportTracker; - /** Info about an exported symbol to perform recursive search on. */ - interface ExportInfo { - exportingModuleSymbol: Symbol; - exportKind: ExportKind; - } - enum ExportKind { - Named = 0, - Default = 1, - ExportEquals = 2 - } - enum ImportExport { - Import = 0, - Export = 1 - } - type ModuleReference = { - kind: "import"; - literal: StringLiteralLike; - } - /** or */ - | { - kind: "reference"; - referencingFile: SourceFile; - ref: FileReference; - }; - function findModuleReferences(program: Program, sourceFiles: ReadonlyArray, searchModuleSymbol: Symbol): ModuleReference[]; - interface ImportedSymbol { - kind: ImportExport.Import; - symbol: Symbol; - isNamedImport: boolean; - } - interface ExportedSymbol { - kind: ImportExport.Export; - symbol: Symbol; - exportInfo: ExportInfo; - } - /** - * Given a local reference, we might notice that it's an import/export and recursively search for references of that. - * If at an import, look locally for the symbol it imports. - * If an an export, look for all imports of it. - * This doesn't handle export specifiers; that is done in `getReferencesAtExportSpecifier`. - * @param comingFromExport If we are doing a search for all exports, don't bother looking backwards for the imported symbol, since that's the reason we're here. - */ - function getImportOrExportSymbol(node: Node, symbol: Symbol, checker: TypeChecker, comingFromExport: boolean): ImportedSymbol | ExportedSymbol | undefined; - function getExportInfo(exportSymbol: Symbol, exportKind: ExportKind, checker: TypeChecker): ExportInfo | undefined; -} -declare namespace ts.FindAllReferences { - interface SymbolAndEntries { - definition: Definition | undefined; - references: Entry[]; - } - type Definition = { - type: "symbol"; - symbol: Symbol; - } | { - type: "label"; - node: Identifier; - } | { - type: "keyword"; - node: Node; - } | { - type: "this"; - node: Node; - } | { - type: "string"; - node: StringLiteral; - }; - type Entry = NodeEntry | SpanEntry; - interface NodeEntry { - type: "node"; - node: Node; - isInString?: true; - } - interface SpanEntry { - type: "span"; - fileName: string; - textSpan: TextSpan; - } - function nodeEntry(node: Node, isInString?: true): NodeEntry; - interface Options { - readonly findInStrings?: boolean; - readonly findInComments?: boolean; - /** - * True if we are renaming the symbol. - * If so, we will find fewer references -- if it is referenced by several different names, we sill only find references for the original name. - */ - readonly isForRename?: boolean; - /** True if we are searching for implementations. We will have a different method of adding references if so. */ - readonly implementations?: boolean; - } - function findReferencedSymbols(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ReferencedSymbol[] | undefined; - function getImplementationsAtPosition(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, sourceFile: SourceFile, position: number): ImplementationLocation[] | undefined; - function findReferencedEntries(program: Program, cancellationToken: CancellationToken, sourceFiles: ReadonlyArray, node: Node, position: number, options: Options | undefined): ReferenceEntry[] | undefined; - function getReferenceEntriesForNode(position: number, node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options?: Options, sourceFilesSet?: ReadonlyMap): Entry[] | undefined; - function toHighlightSpan(entry: Entry): { - fileName: string; - span: HighlightSpan; - }; -} -/** Encapsulates the core find-all-references algorithm. */ -declare namespace ts.FindAllReferences.Core { - /** Core find-all-references algorithm. Handles special cases before delegating to `getReferencedSymbolsForSymbol`. */ - function getReferencedSymbolsForNode(position: number, node: Node, program: Program, sourceFiles: ReadonlyArray, cancellationToken: CancellationToken, options?: Options, sourceFilesSet?: ReadonlyMap): SymbolAndEntries[] | undefined; - function eachExportReference(sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken | undefined, exportSymbol: Symbol, exportingModuleSymbol: Symbol, exportName: string, isDefaultExport: boolean, cb: (ref: Identifier) => void): void; - /** Used as a quick check for whether a symbol is used at all in a file (besides its definition). */ - function isSymbolReferencedInFile(definition: Identifier, checker: TypeChecker, sourceFile: SourceFile): boolean; - function eachSymbolReferenceInFile(definition: Identifier, checker: TypeChecker, sourceFile: SourceFile, cb: (token: Identifier) => T): T | undefined; - function eachSignatureCall(signature: SignatureDeclaration, sourceFiles: ReadonlyArray, checker: TypeChecker, cb: (call: CallExpression) => void): void; - /** - * Given an initial searchMeaning, extracted from a location, widen the search scope based on the declarations - * of the corresponding symbol. e.g. if we are searching for "Foo" in value position, but "Foo" references a class - * then we need to widen the search to include type positions as well. - * On the contrary, if we are searching for "Bar" in type position and we trace bar to an interface, and an uninstantiated - * module, we want to keep the search limited to only types, as the two declarations (interface and uninstantiated module) - * do not intersect in any of the three spaces. - */ - function getIntersectingMeaningFromDeclarations(node: Node, symbol: Symbol): SemanticMeaning; - function getReferenceEntriesForShorthandPropertyAssignment(node: Node, checker: TypeChecker, addReference: (node: Node) => void): void; -} -declare namespace ts { - function getEditsForFileRename(program: Program, oldFileOrDirPath: string, newFileOrDirPath: string, host: LanguageServiceHost, formatContext: formatting.FormatContext, preferences: UserPreferences): ReadonlyArray; - /** If 'path' refers to an old directory, returns path in the new directory. */ - type PathUpdater = (path: string) => string | undefined; - function getPathUpdater(oldFileOrDirPath: string, newFileOrDirPath: string, getCanonicalFileName: GetCanonicalFileName): PathUpdater; -} -declare namespace ts.GoToDefinition { - function getDefinitionAtPosition(program: Program, sourceFile: SourceFile, position: number): DefinitionInfo[] | undefined; - function getReferenceAtPosition(sourceFile: SourceFile, position: number, program: Program): { - fileName: string; - file: SourceFile; - } | undefined; - function getTypeDefinitionAtPosition(typeChecker: TypeChecker, sourceFile: SourceFile, position: number): DefinitionInfo[] | undefined; - function getDefinitionAndBoundSpan(program: Program, sourceFile: SourceFile, position: number): DefinitionInfoAndBoundSpan | undefined; - function findReferenceInPosition(refs: ReadonlyArray, pos: number): FileReference | undefined; -} -declare namespace ts.JsDoc { - function getJsDocCommentsFromDeclarations(declarations: ReadonlyArray): SymbolDisplayPart[]; - function getJsDocTagsFromDeclarations(declarations?: Declaration[]): JSDocTagInfo[]; - function getJSDocTagNameCompletions(): CompletionEntry[]; - const getJSDocTagNameCompletionDetails: typeof getJSDocTagCompletionDetails; - function getJSDocTagCompletions(): CompletionEntry[]; - function getJSDocTagCompletionDetails(name: string): CompletionEntryDetails; - function getJSDocParameterNameCompletions(tag: JSDocParameterTag): CompletionEntry[]; - function getJSDocParameterNameCompletionDetails(name: string): CompletionEntryDetails; - /** - * Checks if position points to a valid position to add JSDoc comments, and if so, - * returns the appropriate template. Otherwise returns an empty string. - * Valid positions are - * - outside of comments, statements, and expressions, and - * - preceding a: - * - function/constructor/method declaration - * - class declarations - * - variable statements - * - namespace declarations - * - interface declarations - * - method signatures - * - type alias declarations - * - * Hosts should ideally check that: - * - The line is all whitespace up to 'position' before performing the insertion. - * - If the keystroke sequence "/\*\*" induced the call, we also check that the next - * non-whitespace character is '*', which (approximately) indicates whether we added - * the second '*' to complete an existing (JSDoc) comment. - * @param fileName The file in which to perform the check. - * @param position The (character-indexed) position in the file where the check should - * be performed. - */ - function getDocCommentTemplateAtPosition(newLine: string, sourceFile: SourceFile, position: number): TextInsertion | undefined; -} -declare namespace ts.NavigateTo { - function getNavigateToItems(sourceFiles: ReadonlyArray, checker: TypeChecker, cancellationToken: CancellationToken, searchValue: string, maxResultCount: number | undefined, excludeDtsFiles: boolean): NavigateToItem[]; -} -declare namespace ts.NavigationBar { - function getNavigationBarItems(sourceFile: SourceFile, cancellationToken: CancellationToken): NavigationBarItem[]; - function getNavigationTree(sourceFile: SourceFile, cancellationToken: CancellationToken): NavigationTree; -} -declare namespace ts.OrganizeImports { - /** - * Organize imports by: - * 1) Removing unused imports - * 2) Coalescing imports from the same module - * 3) Sorting imports - */ - function organizeImports(sourceFile: SourceFile, formatContext: formatting.FormatContext, host: LanguageServiceHost, program: Program, _preferences: UserPreferences): FileTextChanges[]; - /** - * @param importGroup a list of ImportDeclarations, all with the same module name. - */ - function coalesceImports(importGroup: ReadonlyArray): ReadonlyArray; - /** - * @param exportGroup a list of ExportDeclarations, all with the same module name. - */ - function coalesceExports(exportGroup: ReadonlyArray): ReadonlyArray; - function compareModuleSpecifiers(m1: Expression, m2: Expression): Comparison; -} -declare namespace ts.OutliningElementsCollector { - function collectElements(sourceFile: SourceFile, cancellationToken: CancellationToken): OutliningSpan[]; -} -declare namespace ts { - enum PatternMatchKind { - exact = 0, - prefix = 1, - substring = 2, - camelCase = 3 - } - interface PatternMatch { - kind: PatternMatchKind; - isCaseSensitive: boolean; - } - interface PatternMatcher { - getMatchForLastSegmentOfPattern(candidate: string): PatternMatch | undefined; - getFullMatch(candidateContainers: ReadonlyArray, candidate: string): PatternMatch | undefined; - patternContainsDots: boolean; - } - function createPatternMatcher(pattern: string): PatternMatcher | undefined; - function breakIntoCharacterSpans(identifier: string): TextSpan[]; - function breakIntoWordSpans(identifier: string): TextSpan[]; } declare namespace ts { function preProcessFile(sourceText: string, readImportFiles?: boolean, detectJavaScriptImports?: boolean): PreProcessedFileInfo; } -declare namespace ts.Rename { - function getRenameInfo(program: Program, sourceFile: SourceFile, position: number): RenameInfo; -} -declare namespace ts.SignatureHelp { - function getSignatureHelpItems(program: Program, sourceFile: SourceFile, position: number, triggerReason: SignatureHelpTriggerReason | undefined, cancellationToken: CancellationToken): SignatureHelpItems | undefined; - interface ArgumentInfoForCompletions { - readonly invocation: CallLikeExpression; - readonly argumentIndex: number; - readonly argumentCount: number; - } - function getArgumentInfoForCompletions(node: Node, position: number, sourceFile: SourceFile): ArgumentInfoForCompletions | undefined; -} -declare namespace ts { - interface SourceMapper { - toLineColumnOffset(fileName: string, position: number): LineAndCharacter; - tryGetOriginalLocation(info: sourcemaps.SourceMappableLocation): sourcemaps.SourceMappableLocation | undefined; - clearCache(): void; - } - function getSourceMapper(getCanonicalFileName: GetCanonicalFileName, currentDirectory: string, log: (message: string) => void, host: LanguageServiceHost, getProgram: () => Program): SourceMapper; -} -declare namespace ts { - function computeSuggestionDiagnostics(sourceFile: SourceFile, program: Program, cancellationToken: CancellationToken): DiagnosticWithLocation[]; -} -declare namespace ts.SymbolDisplay { - function getSymbolKind(typeChecker: TypeChecker, symbol: Symbol, location: Node): ScriptElementKind; - function getSymbolModifiers(symbol: Symbol): string; - interface SymbolDisplayPartsDocumentationAndSymbolKind { - displayParts: SymbolDisplayPart[]; - documentation: SymbolDisplayPart[]; - symbolKind: ScriptElementKind; - tags: JSDocTagInfo[] | undefined; - } - function getSymbolDisplayPartsDocumentationAndSymbolKind(typeChecker: TypeChecker, symbol: Symbol, sourceFile: SourceFile, enclosingDeclaration: Node | undefined, location: Node, semanticMeaning?: SemanticMeaning, alias?: Symbol): SymbolDisplayPartsDocumentationAndSymbolKind; -} declare namespace ts { interface TranspileOptions { compilerOptions?: CompilerOptions; @@ -11365,519 +5632,10 @@ declare namespace ts { } function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput; function transpile(input: string, compilerOptions?: CompilerOptions, fileName?: string, diagnostics?: Diagnostic[], moduleName?: string): string; - /** JS users may pass in string values for enum compiler options (such as ModuleKind), so convert. */ - function fixupCompilerOptions(options: CompilerOptions, diagnostics: Diagnostic[]): CompilerOptions; -} -declare namespace ts.formatting { - enum FormattingRequestKind { - FormatDocument = 0, - FormatSelection = 1, - FormatOnEnter = 2, - FormatOnSemicolon = 3, - FormatOnOpeningCurlyBrace = 4, - FormatOnClosingCurlyBrace = 5 - } - class FormattingContext { - readonly sourceFile: SourceFileLike; - formattingRequestKind: FormattingRequestKind; - options: FormatCodeSettings; - currentTokenSpan: TextRangeWithKind; - nextTokenSpan: TextRangeWithKind; - contextNode: Node; - currentTokenParent: Node; - nextTokenParent: Node; - private contextNodeAllOnSameLine; - private nextNodeAllOnSameLine; - private tokensAreOnSameLine; - private contextNodeBlockIsOnOneLine; - private nextNodeBlockIsOnOneLine; - constructor(sourceFile: SourceFileLike, formattingRequestKind: FormattingRequestKind, options: FormatCodeSettings); - updateContext(currentRange: TextRangeWithKind, currentTokenParent: Node, nextRange: TextRangeWithKind, nextTokenParent: Node, commonParent: Node): void; - ContextNodeAllOnSameLine(): boolean; - NextNodeAllOnSameLine(): boolean; - TokensAreOnSameLine(): boolean; - ContextNodeBlockIsOnOneLine(): boolean; - NextNodeBlockIsOnOneLine(): boolean; - private NodeIsOnOneLine; - private BlockIsOnOneLine; - } -} -declare namespace ts.formatting { - interface FormattingScanner { - advance(): void; - isOnToken(): boolean; - readTokenInfo(n: Node): TokenInfo; - getCurrentLeadingTrivia(): TextRangeWithKind[] | undefined; - lastTrailingTriviaWasNewLine(): boolean; - skipToEndOf(node: Node): void; - } - function getFormattingScanner(text: string, languageVariant: LanguageVariant, startPos: number, endPos: number, cb: (scanner: FormattingScanner) => T): T; -} -declare namespace ts.formatting { - interface Rule { - readonly debugName: string; - readonly context: ReadonlyArray; - readonly action: RuleAction; - readonly flags: RuleFlags; - } - type ContextPredicate = (context: FormattingContext) => boolean; - const anyContext: ReadonlyArray; - enum RuleAction { - Ignore = 1, - Space = 2, - NewLine = 4, - Delete = 8 - } - enum RuleFlags { - None = 0, - CanDeleteNewLines = 1 - } - interface TokenRange { - readonly tokens: ReadonlyArray; - readonly isSpecific: boolean; - } -} -declare namespace ts.formatting { - interface RuleSpec { - readonly leftTokenRange: TokenRange; - readonly rightTokenRange: TokenRange; - readonly rule: Rule; - } - function getAllRules(): RuleSpec[]; -} -declare namespace ts.formatting { - function getFormatContext(options: FormatCodeSettings): FormatContext; - type RulesMap = (context: FormattingContext) => Rule | undefined; -} -declare namespace ts.formatting { - interface FormatContext { - readonly options: FormatCodeSettings; - readonly getRule: RulesMap; - } - interface TextRangeWithKind extends TextRange { - kind: SyntaxKind; - } - interface TextRangeWithTriviaKind extends TextRange { - kind: TriviaKind; - } - interface TokenInfo { - leadingTrivia: TextRangeWithTriviaKind[] | undefined; - token: TextRangeWithKind; - trailingTrivia: TextRangeWithTriviaKind[] | undefined; - } - function formatOnEnter(position: number, sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatOnSemicolon(position: number, sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatOnOpeningCurly(position: number, sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatOnClosingCurly(position: number, sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatDocument(sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatSelection(start: number, end: number, sourceFile: SourceFile, formatContext: FormatContext): TextChange[]; - function formatNodeGivenIndentation(node: Node, sourceFileLike: SourceFileLike, languageVariant: LanguageVariant, initialIndentation: number, delta: number, formatContext: FormatContext): TextChange[]; - /** - * @param precedingToken pass `null` if preceding token was already computed and result was `undefined`. - */ - function getRangeOfEnclosingComment(sourceFile: SourceFile, position: number, precedingToken?: Node | null, // tslint:disable-line:no-null-keyword - tokenAtPosition?: Node): CommentRange | undefined; - function getIndentationString(indentation: number, options: EditorSettings): string; -} -declare namespace ts.formatting { - namespace SmartIndenter { - /** - * @param assumeNewLineBeforeCloseBrace - * `false` when called on text from a real source file. - * `true` when we need to assume `position` is on a newline. - * - * This is useful for codefixes. Consider - * ``` - * function f() { - * |} - * ``` - * with `position` at `|`. - * - * When inserting some text after an open brace, we would like to get indentation as if a newline was already there. - * By default indentation at `position` will be 0 so 'assumeNewLineBeforeCloseBrace' overrides this behavior. - */ - function getIndentation(position: number, sourceFile: SourceFile, options: EditorSettings, assumeNewLineBeforeCloseBrace?: boolean): number; - function getIndentationForNode(n: Node, ignoreActualIndentationRange: TextRange, sourceFile: SourceFile, options: EditorSettings): number; - function getBaseIndentation(options: EditorSettings): number; - function isArgumentAndStartLineOverlapsExpressionBeingCalled(parent: Node, child: Node, childStartLine: number, sourceFile: SourceFileLike): boolean; - function childStartsOnTheSameLineWithElseInIfStatement(parent: Node, child: TextRangeWithKind, childStartLine: number, sourceFile: SourceFileLike): boolean; - function getContainingList(node: Node, sourceFile: SourceFile): NodeArray | undefined; - /** - * Character is the actual index of the character since the beginning of the line. - * Column - position of the character after expanding tabs to spaces. - * "0\t2$" - * value of 'character' for '$' is 3 - * value of 'column' for '$' is 6 (assuming that tab size is 4) - */ - function findFirstNonWhitespaceCharacterAndColumn(startPos: number, endPos: number, sourceFile: SourceFileLike, options: EditorSettings): { - column: number; - character: number; - }; - function findFirstNonWhitespaceColumn(startPos: number, endPos: number, sourceFile: SourceFileLike, options: EditorSettings): number; - function nodeWillIndentChild(settings: FormatCodeSettings, parent: TextRangeWithKind, child: TextRangeWithKind | undefined, sourceFile: SourceFileLike | undefined, indentByDefault: boolean): boolean; - /** - * True when the parent node should indent the given child by an explicit rule. - * @param isNextChild If true, we are judging indent of a hypothetical child *after* this one, not the current child. - */ - function shouldIndentChildNode(settings: FormatCodeSettings, parent: TextRangeWithKind, child?: Node, sourceFile?: SourceFileLike, isNextChild?: boolean): boolean; - } -} -declare namespace ts.textChanges { - interface ConfigurableStart { - /** True to use getStart() (NB, not getFullStart()) without adjustment. */ - useNonAdjustedStartPosition?: boolean; - } - interface ConfigurableEnd { - /** True to use getEnd() without adjustment. */ - useNonAdjustedEndPosition?: boolean; - } - enum Position { - FullStart = 0, - Start = 1 - } - /** - * Usually node.pos points to a position immediately after the previous token. - * If this position is used as a beginning of the span to remove - it might lead to removing the trailing trivia of the previous node, i.e: - * const x; // this is x - * ^ - pos for the next variable declaration will point here - * const y; // this is y - * ^ - end for previous variable declaration - * Usually leading trivia of the variable declaration 'y' should not include trailing trivia (whitespace, comment 'this is x' and newline) from the preceding - * variable declaration and trailing trivia for 'y' should include (whitespace, comment 'this is y', newline). - * By default when removing nodes we adjust start and end positions to respect specification of the trivia above. - * If pos\end should be interpreted literally 'useNonAdjustedStartPosition' or 'useNonAdjustedEndPosition' should be set to true - */ - interface ConfigurableStartEnd extends ConfigurableStart, ConfigurableEnd { - } - const useNonAdjustedPositions: ConfigurableStartEnd; - interface InsertNodeOptions { - /** - * Text to be inserted before the new node - */ - prefix?: string; - /** - * Text to be inserted after the new node - */ - suffix?: string; - /** - * Text of inserted node will be formatted with this indentation, otherwise indentation will be inferred from the old node - */ - indentation?: number; - /** - * Text of inserted node will be formatted with this delta, otherwise delta will be inferred from the new node kind - */ - delta?: number; - /** - * Do not trim leading white spaces in the edit range - */ - preserveLeadingWhitespace?: boolean; - } - interface ReplaceWithMultipleNodesOptions extends InsertNodeOptions { - readonly joiner?: string; - } - interface ChangeNodeOptions extends ConfigurableStartEnd, InsertNodeOptions { - } - interface TextChangesContext { - host: LanguageServiceHost; - formatContext: formatting.FormatContext; - } - type TypeAnnotatable = SignatureDeclaration | VariableDeclaration | ParameterDeclaration | PropertyDeclaration | PropertySignature; - class ChangeTracker { - private readonly newLineCharacter; - private readonly formatContext; - private readonly changes; - private readonly newFiles; - private readonly classesWithNodesInsertedAtStart; - private readonly deletedNodes; - static fromContext(context: TextChangesContext): ChangeTracker; - static with(context: TextChangesContext, cb: (tracker: ChangeTracker) => void): FileTextChanges[]; - /** Public for tests only. Other callers should use `ChangeTracker.with`. */ - constructor(newLineCharacter: string, formatContext: formatting.FormatContext); - deleteRange(sourceFile: SourceFile, range: TextRange): this; - delete(sourceFile: SourceFile, node: Node): void; - deleteModifier(sourceFile: SourceFile, modifier: Modifier): void; - deleteNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, options?: ConfigurableStartEnd): this; - deleteNodeRangeExcludingEnd(sourceFile: SourceFile, startNode: Node, afterEndNode: Node | undefined, options?: ConfigurableStartEnd): void; - replaceRange(sourceFile: SourceFile, range: TextRange, newNode: Node, options?: InsertNodeOptions): this; - replaceNode(sourceFile: SourceFile, oldNode: Node, newNode: Node, options?: ChangeNodeOptions): this; - replaceNodeRange(sourceFile: SourceFile, startNode: Node, endNode: Node, newNode: Node, options?: ChangeNodeOptions): void; - private replaceRangeWithNodes; - replaceNodeWithNodes(sourceFile: SourceFile, oldNode: Node, newNodes: ReadonlyArray, options?: ChangeNodeOptions): this; - replaceNodeRangeWithNodes(sourceFile: SourceFile, startNode: Node, endNode: Node, newNodes: ReadonlyArray, options?: ReplaceWithMultipleNodesOptions & ConfigurableStartEnd): this; - private nextCommaToken; - replacePropertyAssignment(sourceFile: SourceFile, oldNode: PropertyAssignment, newNode: PropertyAssignment): this; - insertNodeAt(sourceFile: SourceFile, pos: number, newNode: Node, options?: InsertNodeOptions): void; - private insertNodesAt; - insertNodeAtTopOfFile(sourceFile: SourceFile, newNode: Statement, blankLineBetween: boolean): void; - insertNodeBefore(sourceFile: SourceFile, before: Node, newNode: Node, blankLineBetween?: boolean): void; - insertModifierBefore(sourceFile: SourceFile, modifier: SyntaxKind, before: Node): void; - insertCommentBeforeLine(sourceFile: SourceFile, lineNumber: number, position: number, commentText: string): void; - replaceRangeWithText(sourceFile: SourceFile, range: TextRange, text: string): void; - private insertText; - /** Prefer this over replacing a node with another that has a type annotation, as it avoids reformatting the other parts of the node. */ - tryInsertTypeAnnotation(sourceFile: SourceFile, node: TypeAnnotatable, type: TypeNode): void; - insertTypeParameters(sourceFile: SourceFile, node: SignatureDeclaration, typeParameters: ReadonlyArray): void; - private getOptionsForInsertNodeBefore; - insertNodeAtConstructorStart(sourceFile: SourceFile, ctr: ConstructorDeclaration, newStatement: Statement): void; - insertNodeAtConstructorEnd(sourceFile: SourceFile, ctr: ConstructorDeclaration, newStatement: Statement): void; - private replaceConstructorBody; - insertNodeAtEndOfScope(sourceFile: SourceFile, scope: Node, newNode: Node): void; - insertNodeAtClassStart(sourceFile: SourceFile, cls: ClassLikeDeclaration, newElement: ClassElement): void; - private getInsertNodeAtClassStartPrefixSuffix; - insertNodeAfterComma(sourceFile: SourceFile, after: Node, newNode: Node): void; - insertNodeAfter(sourceFile: SourceFile, after: Node, newNode: Node): void; - insertNodeAtEndOfList(sourceFile: SourceFile, list: NodeArray, newNode: Node): void; - insertNodesAfter(sourceFile: SourceFile, after: Node, newNodes: ReadonlyArray): void; - private insertNodeAfterWorker; - private getInsertNodeAfterOptions; - private getInsertNodeAfterOptionsWorker; - insertName(sourceFile: SourceFile, node: FunctionExpression | ClassExpression | ArrowFunction, name: string): void; - insertExportModifier(sourceFile: SourceFile, node: DeclarationStatement | VariableStatement): void; - /** - * This function should be used to insert nodes in lists when nodes don't carry separators as the part of the node range, - * i.e. arguments in arguments lists, parameters in parameter lists etc. - * Note that separators are part of the node in statements and class elements. - */ - insertNodeInListAfter(sourceFile: SourceFile, after: Node, newNode: Node, containingList?: NodeArray | undefined): this; - private finishClassesWithNodesInsertedAtStart; - private finishDeleteDeclarations; - /** - * Note: after calling this, the TextChanges object must be discarded! - * @param validate only for tests - * The reason we must validate as part of this method is that `getNonFormattedText` changes the node's positions, - * so we can only call this once and can't get the non-formatted text separately. - */ - getChanges(validate?: ValidateNonFormattedText): FileTextChanges[]; - createNewFile(oldFile: SourceFile, fileName: string, statements: ReadonlyArray): void; - } - type ValidateNonFormattedText = (node: Node, text: string) => void; - function applyChanges(text: string, changes: ReadonlyArray): string; - function isValidLocationToAddComment(sourceFile: SourceFile, position: number): boolean; - /** Warning: This deletes comments too. See `copyComments` in `convertFunctionToEs6Class`. */ - function deleteNode(changes: ChangeTracker, sourceFile: SourceFile, node: Node, options?: ConfigurableStartEnd): void; -} -declare namespace ts { - interface CodeFixRegistration { - errorCodes: ReadonlyArray; - getCodeActions(context: CodeFixContext): CodeFixAction[] | undefined; - fixIds?: ReadonlyArray; - getAllCodeActions?(context: CodeFixAllContext): CombinedCodeActions; - } - interface CodeFixContextBase extends textChanges.TextChangesContext { - sourceFile: SourceFile; - program: Program; - cancellationToken: CancellationToken; - preferences: UserPreferences; - } - interface CodeFixAllContext extends CodeFixContextBase { - fixId: {}; - } - interface CodeFixContext extends CodeFixContextBase { - errorCode: number; - span: TextSpan; - } - namespace codefix { - type DiagnosticAndArguments = DiagnosticMessage | [DiagnosticMessage, string] | [DiagnosticMessage, string, string]; - function createCodeFixActionNoFixId(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments): CodeFixAction; - function createCodeFixAction(fixName: string, changes: FileTextChanges[], description: DiagnosticAndArguments, fixId: {}, fixAllDescription: DiagnosticAndArguments, command?: CodeActionCommand): CodeFixAction; - function registerCodeFix(reg: CodeFixRegistration): void; - function getSupportedErrorCodes(): string[]; - function getFixes(context: CodeFixContext): CodeFixAction[]; - function getAllFixes(context: CodeFixAllContext): CombinedCodeActions; - function createCombinedCodeActions(changes: FileTextChanges[], commands?: CodeActionCommand[]): CombinedCodeActions; - function createFileTextChanges(fileName: string, textChanges: TextChange[]): FileTextChanges; - function codeFixAll(context: CodeFixAllContext, errorCodes: number[], use: (changes: textChanges.ChangeTracker, error: DiagnosticWithLocation, commands: Push) => void): CombinedCodeActions; - function eachDiagnostic({ program, sourceFile, cancellationToken }: CodeFixAllContext, errorCodes: ReadonlyArray, cb: (diag: DiagnosticWithLocation) => void): void; - } -} -declare namespace ts { - interface Refactor { - /** Compute the associated code actions */ - getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined; - /** Compute (quickly) which actions are available here */ - getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined; - } - interface RefactorContext extends textChanges.TextChangesContext { - file: SourceFile; - startPosition: number; - endPosition?: number; - program: Program; - cancellationToken?: CancellationToken; - preferences: UserPreferences; - } - namespace refactor { - /** @param name An unique code associated with each refactor. Does not have to be human-readable. */ - function registerRefactor(name: string, refactor: Refactor): void; - function getApplicableRefactors(context: RefactorContext): ApplicableRefactorInfo[]; - function getEditsForRefactor(context: RefactorContext, refactorName: string, actionName: string): RefactorEditInfo | undefined; - } - function getRefactorContextSpan({ startPosition, endPosition }: RefactorContext): TextSpan; -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { - type DeclarationWithType = FunctionLikeDeclaration | VariableDeclaration | PropertySignature | PropertyDeclaration; - function parameterShouldGetTypeFromJSDoc(node: Node): node is DeclarationWithType; -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { - const importFixId = "fixMissingImport"; - function getImportCompletionAction(exportedSymbol: Symbol, moduleSymbol: Symbol, sourceFile: SourceFile, symbolName: string, host: LanguageServiceHost, program: Program, checker: TypeChecker, allSourceFiles: ReadonlyArray, formatContext: formatting.FormatContext, symbolToken: Node | undefined, preferences: UserPreferences): { - readonly moduleSpecifier: string; - readonly codeAction: CodeAction; - }; - function forEachExternalModuleToImportFrom(checker: TypeChecker, from: SourceFile, allSourceFiles: ReadonlyArray, cb: (module: Symbol) => void): void; - function moduleSymbolToValidIdentifier(moduleSymbol: Symbol, target: ScriptTarget): string; - function moduleSpecifierToValidIdentifier(moduleSpecifier: string, target: ScriptTarget): string; -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { - /** - * Finds members of the resolved type that are missing in the class pointed to by class decl - * and generates source code for the missing members. - * @param possiblyMissingSymbols The collection of symbols to filter and then get insertions for. - * @returns Empty string iff there are no member insertions. - */ - function createMissingMemberNodes(classDeclaration: ClassLikeDeclaration, possiblyMissingSymbols: ReadonlyArray, checker: TypeChecker, preferences: UserPreferences, out: (node: ClassElement) => void): void; - function createMethodFromCallExpression(context: CodeFixContextBase, { typeArguments, arguments: args, parent: parent }: CallExpression, methodName: string, inJs: boolean, makeStatic: boolean, preferences: UserPreferences): MethodDeclaration; -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.codefix { -} -declare namespace ts.refactor { -} -declare namespace ts.refactor { -} -declare namespace ts.refactor.extractSymbol { - /** - * Compute the associated code actions - * Exported for tests. - */ - function getAvailableActions(context: RefactorContext): ApplicableRefactorInfo[] | undefined; - function getEditsForAction(context: RefactorContext, actionName: string): RefactorEditInfo | undefined; - namespace Messages { - const cannotExtractRange: DiagnosticMessage; - const cannotExtractImport: DiagnosticMessage; - const cannotExtractSuper: DiagnosticMessage; - const cannotExtractEmpty: DiagnosticMessage; - const expressionExpected: DiagnosticMessage; - const uselessConstantType: DiagnosticMessage; - const statementOrExpressionExpected: DiagnosticMessage; - const cannotExtractRangeContainingConditionalBreakOrContinueStatements: DiagnosticMessage; - const cannotExtractRangeContainingConditionalReturnStatement: DiagnosticMessage; - const cannotExtractRangeContainingLabeledBreakOrContinueStatementWithTargetOutsideOfTheRange: DiagnosticMessage; - const cannotExtractRangeThatContainsWritesToReferencesLocatedOutsideOfTheTargetRangeInGenerators: DiagnosticMessage; - const typeWillNotBeVisibleInTheNewScope: DiagnosticMessage; - const functionWillNotBeVisibleInTheNewScope: DiagnosticMessage; - const cannotExtractIdentifier: DiagnosticMessage; - const cannotExtractExportedEntity: DiagnosticMessage; - const cannotWriteInExpression: DiagnosticMessage; - const cannotExtractReadonlyPropertyInitializerOutsideConstructor: DiagnosticMessage; - const cannotExtractAmbientBlock: DiagnosticMessage; - const cannotAccessVariablesFromNestedScopes: DiagnosticMessage; - const cannotExtractToOtherFunctionLike: DiagnosticMessage; - const cannotExtractToJSClass: DiagnosticMessage; - const cannotExtractToExpressionArrowFunction: DiagnosticMessage; - } - enum RangeFacts { - None = 0, - HasReturn = 1, - IsGenerator = 2, - IsAsyncFunction = 4, - UsesThis = 8, - /** - * The range is in a function which needs the 'static' modifier in a class - */ - InStaticRegion = 16 - } - /** - * Represents an expression or a list of statements that should be extracted with some extra information - */ - interface TargetRange { - readonly range: Expression | Statement[]; - readonly facts: RangeFacts; - /** - * A list of symbols that are declared in the selected range which are visible in the containing lexical scope - * Used to ensure we don't turn something used outside the range free (or worse, resolve to a different entity). - */ - readonly declarations: Symbol[]; - } - /** - * Result of 'getRangeToExtract' operation: contains either a range or a list of errors - */ - type RangeToExtract = { - readonly targetRange?: never; - readonly errors: ReadonlyArray; - } | { - readonly targetRange: TargetRange; - readonly errors?: never; - }; - /** - * getRangeToExtract takes a span inside a text file and returns either an expression or an array - * of statements representing the minimum set of nodes needed to extract the entire span. This - * process may fail, in which case a set of errors is returned instead (these are currently - * not shown to the user, but can be used by us diagnostically) - */ - function getRangeToExtract(sourceFile: SourceFile, span: TextSpan): RangeToExtract; -} -declare namespace ts.refactor.generateGetAccessorAndSetAccessor { -} -declare namespace ts.refactor { -} -declare namespace ts.refactor.addOrRemoveBracesToArrowFunction { } declare namespace ts { /** The version of the language service API */ const servicesVersion = "0.8"; - interface DisplayPartsSymbolWriter extends EmitTextWriter { - displayParts(): SymbolDisplayPart[]; - } - function toEditorSettings(options: FormatCodeOptions | FormatCodeSettings): FormatCodeSettings; function toEditorSettings(options: EditorOptions | EditorSettings): EditorSettings; function displayPartsToString(displayParts: SymbolDisplayPart[] | undefined): string; function getDefaultCompilerOptions(): CompilerOptions; @@ -11885,24 +5643,7 @@ declare namespace ts { function createLanguageServiceSourceFile(fileName: string, scriptSnapshot: IScriptSnapshot, scriptTarget: ScriptTarget, version: string, setNodeParents: boolean, scriptKind?: ScriptKind): SourceFile; let disableIncrementalParsing: boolean; function updateLanguageServiceSourceFile(sourceFile: SourceFile, scriptSnapshot: IScriptSnapshot, version: string, textChangeRange: TextChangeRange | undefined, aggressiveChecks?: boolean): SourceFile; - /** A cancellation that throttles calls to the host */ - class ThrottledCancellationToken implements CancellationToken { - private hostCancellationToken; - private readonly throttleWaitMilliseconds; - private lastCancellationCheckTime; - constructor(hostCancellationToken: HostCancellationToken, throttleWaitMilliseconds?: number); - isCancellationRequested(): boolean; - throwIfCancellationRequested(): void; - } function createLanguageService(host: LanguageServiceHost, documentRegistry?: DocumentRegistry, syntaxOnly?: boolean): LanguageService; - /** Names in the name table are escaped, so an identifier `__foo` will have a name table entry `___foo`. */ - function getNameTable(sourceFile: SourceFile): UnderscoreEscapedMap; - /** - * Returns the containing object literal property declaration given a possible name node, e.g. "a" in x = { "a": 1 } - */ - function getContainingObjectLiteralElement(node: Node): ObjectLiteralElement | undefined; - function getPropertySymbolsFromContextualType(typeChecker: TypeChecker, node: ObjectLiteralElement): Symbol[]; - function getPropertySymbolsFromType(type: Type, propName: PropertyName): Symbol[] | undefined; /** * Get the path of the default library files (lib.d.ts) as distributed with the typescript * node package. @@ -11910,12 +5651,6 @@ declare namespace ts { */ function getDefaultLibFilePath(options: CompilerOptions): string; } -declare namespace ts.BreakpointResolver { - /** - * Get the breakpoint span in given sourceFile - */ - function spanInSourceFileAtLocation(sourceFile: SourceFile, position: number): TextSpan | undefined; -} declare namespace ts { /** * Transform one or more nodes using the supplied transformers. @@ -11925,278 +5660,6 @@ declare namespace ts { */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; } -declare let debugObjectHost: { - CollectGarbage(): void; -}; -declare namespace ts { - interface ScriptSnapshotShim { - /** Gets a portion of the script snapshot specified by [start, end). */ - getText(start: number, end: number): string; - /** Gets the length of this script snapshot. */ - getLength(): number; - /** - * Returns a JSON-encoded value of the type: - * { span: { start: number; length: number }; newLength: number } - * - * Or undefined value if there was no change. - */ - getChangeRange(oldSnapshot: ScriptSnapshotShim): string | undefined; - /** Releases all resources held by this script snapshot */ - dispose?(): void; - } - interface Logger { - log(s: string): void; - trace(s: string): void; - error(s: string): void; - } - /** Public interface of the host of a language service shim instance. */ - interface LanguageServiceShimHost extends Logger { - getCompilationSettings(): string; - /** Returns a JSON-encoded value of the type: string[] */ - getScriptFileNames(): string; - getScriptKind?(fileName: string): ScriptKind; - getScriptVersion(fileName: string): string; - getScriptSnapshot(fileName: string): ScriptSnapshotShim; - getLocalizedDiagnosticMessages(): string; - getCancellationToken(): HostCancellationToken; - getCurrentDirectory(): string; - getDirectories(path: string): string; - getDefaultLibFileName(options: string): string; - getNewLine?(): string; - getProjectVersion?(): string; - useCaseSensitiveFileNames?(): boolean; - getTypeRootsVersion?(): number; - readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string; - readFile(path: string, encoding?: string): string | undefined; - fileExists(path: string): boolean; - getModuleResolutionsForFile?(fileName: string): string; - getTypeReferenceDirectiveResolutionsForFile?(fileName: string): string; - directoryExists(directoryName: string): boolean; - } - /** Public interface of the core-services host instance used in managed side */ - interface CoreServicesShimHost extends Logger { - directoryExists(directoryName: string): boolean; - fileExists(fileName: string): boolean; - getCurrentDirectory(): string; - getDirectories(path: string): string; - /** - * Returns a JSON-encoded value of the type: string[] - * - * @param exclude A JSON encoded string[] containing the paths to exclude - * when enumerating the directory. - */ - readDirectory(rootDir: string, extension: string, basePaths?: string, excludeEx?: string, includeFileEx?: string, includeDirEx?: string, depth?: number): string; - /** - * Read arbitrary text files on disk, i.e. when resolution procedure needs the content of 'package.json' to determine location of bundled typings for node modules - */ - readFile(fileName: string): string | undefined; - realpath?(path: string): string; - trace(s: string): void; - useCaseSensitiveFileNames?(): boolean; - } - interface ShimsFileReference { - path: string; - position: number; - length: number; - } - /** Public interface of a language service instance shim. */ - interface ShimFactory { - registerShim(shim: Shim): void; - unregisterShim(shim: Shim): void; - } - interface Shim { - dispose(_dummy: {}): void; - } - interface LanguageServiceShim extends Shim { - languageService: LanguageService; - dispose(_dummy: {}): void; - refresh(throwOnError: boolean): void; - cleanupSemanticCache(): void; - getSyntacticDiagnostics(fileName: string): string; - getSemanticDiagnostics(fileName: string): string; - getSuggestionDiagnostics(fileName: string): string; - getCompilerOptionsDiagnostics(): string; - getSyntacticClassifications(fileName: string, start: number, length: number): string; - getSemanticClassifications(fileName: string, start: number, length: number): string; - getEncodedSyntacticClassifications(fileName: string, start: number, length: number): string; - getEncodedSemanticClassifications(fileName: string, start: number, length: number): string; - getCompletionsAtPosition(fileName: string, position: number, preferences: UserPreferences | undefined): string; - getCompletionEntryDetails(fileName: string, position: number, entryName: string, formatOptions: string | undefined, source: string | undefined, preferences: UserPreferences | undefined): string; - getQuickInfoAtPosition(fileName: string, position: number): string; - getNameOrDottedNameSpan(fileName: string, startPos: number, endPos: number): string; - getBreakpointStatementAtPosition(fileName: string, position: number): string; - getSignatureHelpItems(fileName: string, position: number, options: SignatureHelpItemsOptions | undefined): string; - /** - * Returns a JSON-encoded value of the type: - * { canRename: boolean, localizedErrorMessage: string, displayName: string, fullDisplayName: string, kind: string, kindModifiers: string, triggerSpan: { start; length } } - */ - getRenameInfo(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string, textSpan: { start: number, length: number } }[] - */ - findRenameLocations(fileName: string, position: number, findInStrings: boolean, findInComments: boolean): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string } - * - * Or undefined value if no definition can be found. - */ - getDefinitionAtPosition(fileName: string, position: number): string; - getDefinitionAndBoundSpan(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; kind: string; name: string; containerKind: string; containerName: string } - * - * Or undefined value if no definition can be found. - */ - getTypeDefinitionAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; }[] - */ - getImplementationAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean, isDefinition?: boolean }[] - */ - getReferencesAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { definition: ; references: [] }[] - */ - findReferences(fileName: string, position: number): string; - /** - * @deprecated - * Returns a JSON-encoded value of the type: - * { fileName: string; textSpan: { start: number; length: number}; isWriteAccess: boolean }[] - */ - getOccurrencesAtPosition(fileName: string, position: number): string; - /** - * Returns a JSON-encoded value of the type: - * { fileName: string; highlights: { start: number; length: number, isDefinition: boolean }[] }[] - * - * @param fileToSearch A JSON encoded string[] containing the file names that should be - * considered when searching. - */ - getDocumentHighlights(fileName: string, position: number, filesToSearch: string): string; - /** - * Returns a JSON-encoded value of the type: - * { name: string; kind: string; kindModifiers: string; containerName: string; containerKind: string; matchKind: string; fileName: string; textSpan: { start: number; length: number}; } [] = []; - */ - getNavigateToItems(searchValue: string, maxResultCount?: number, fileName?: string): string; - /** - * Returns a JSON-encoded value of the type: - * { text: string; kind: string; kindModifiers: string; bolded: boolean; grayed: boolean; indent: number; spans: { start: number; length: number; }[]; childItems: [] } [] = []; - */ - getNavigationBarItems(fileName: string): string; - /** Returns a JSON-encoded value of the type ts.NavigationTree. */ - getNavigationTree(fileName: string): string; - /** - * Returns a JSON-encoded value of the type: - * { textSpan: { start: number, length: number }; hintSpan: { start: number, length: number }; bannerText: string; autoCollapse: boolean } [] = []; - */ - getOutliningSpans(fileName: string): string; - getTodoComments(fileName: string, todoCommentDescriptors: string): string; - getBraceMatchingAtPosition(fileName: string, position: number): string; - getIndentationAtPosition(fileName: string, position: number, options: string): string; - getFormattingEditsForRange(fileName: string, start: number, end: number, options: string): string; - getFormattingEditsForDocument(fileName: string, options: string): string; - getFormattingEditsAfterKeystroke(fileName: string, position: number, key: string, options: string): string; - /** - * Returns JSON-encoded value of the type TextInsertion. - */ - getDocCommentTemplateAtPosition(fileName: string, position: number): string; - /** - * Returns JSON-encoded boolean to indicate whether we should support brace location - * at the current position. - * E.g. we don't want brace completion inside string-literals, comments, etc. - */ - isValidBraceCompletionAtPosition(fileName: string, position: number, openingBrace: number): string; - /** - * Returns a JSON-encoded TextSpan | undefined indicating the range of the enclosing comment, if it exists. - */ - getSpanOfEnclosingComment(fileName: string, position: number, onlyMultiLine: boolean): string; - getEmitOutput(fileName: string): string; - getEmitOutputObject(fileName: string): EmitOutput; - } - interface ClassifierShim extends Shim { - getEncodedLexicalClassifications(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string; - getClassificationsForLine(text: string, lexState: EndOfLineState, syntacticClassifierAbsent?: boolean): string; - } - interface CoreServicesShim extends Shim { - getAutomaticTypeDirectiveNames(compilerOptionsJson: string): string; - getPreProcessedFileInfo(fileName: string, sourceText: IScriptSnapshot): string; - getTSConfigFileInfo(fileName: string, sourceText: IScriptSnapshot): string; - getDefaultCompilationSettings(): string; - discoverTypings(discoverTypingsJson: string): string; - } - class LanguageServiceShimHostAdapter implements LanguageServiceHost { - private shimHost; - private files; - private loggingEnabled; - private tracingEnabled; - resolveModuleNames: (moduleName: string[], containingFile: string) => ResolvedModuleFull[]; - resolveTypeReferenceDirectives: (typeDirectiveNames: string[], containingFile: string) => ResolvedTypeReferenceDirective[]; - directoryExists: (directoryName: string) => boolean; - constructor(shimHost: LanguageServiceShimHost); - log(s: string): void; - trace(s: string): void; - error(s: string): void; - getProjectVersion(): string; - getTypeRootsVersion(): number; - useCaseSensitiveFileNames(): boolean; - getCompilationSettings(): CompilerOptions; - getScriptFileNames(): string[]; - getScriptSnapshot(fileName: string): IScriptSnapshot | undefined; - getScriptKind(fileName: string): ScriptKind; - getScriptVersion(fileName: string): string; - getLocalizedDiagnosticMessages(): any; - getCancellationToken(): HostCancellationToken; - getCurrentDirectory(): string; - getDirectories(path: string): string[]; - getDefaultLibFileName(options: CompilerOptions): string; - readDirectory(path: string, extensions?: ReadonlyArray, exclude?: string[], include?: string[], depth?: number): string[]; - readFile(path: string, encoding?: string): string | undefined; - fileExists(path: string): boolean; - } - class CoreServicesShimHostAdapter implements ParseConfigHost, ModuleResolutionHost, JsTyping.TypingResolutionHost { - private shimHost; - directoryExists: (directoryName: string) => boolean; - realpath: (path: string) => string; - useCaseSensitiveFileNames: boolean; - constructor(shimHost: CoreServicesShimHost); - readDirectory(rootDir: string, extensions: ReadonlyArray, exclude: ReadonlyArray, include: ReadonlyArray, depth?: number): string[]; - fileExists(fileName: string): boolean; - readFile(fileName: string): string | undefined; - getDirectories(path: string): string[]; - } - interface RealizedDiagnostic { - message: string; - start: number; - length: number; - category: string; - code: number; - reportsUnnecessary?: {}; - } - function realizeDiagnostics(diagnostics: ReadonlyArray, newLine: string): RealizedDiagnostic[]; - class TypeScriptServicesFactory implements ShimFactory { - private _shims; - private documentRegistry; - getServicesVersion(): string; - createLanguageServiceShim(host: LanguageServiceShimHost): LanguageServiceShim; - createClassifierShim(logger: Logger): ClassifierShim; - createCoreServicesShim(host: CoreServicesShimHost): CoreServicesShim; - close(): void; - registerShim(shim: Shim): void; - unregisterShim(shim: Shim): void; - } -} -declare namespace TypeScript.Services { - const TypeScriptServicesFactory: typeof ts.TypeScriptServicesFactory; -} -declare const toolsVersion = "3.0"; -//# sourceMappingURL=services.d.ts.map declare namespace ts.server { interface CompressedData { length: number; @@ -12250,6 +5713,7 @@ declare namespace ts.server { Perf = "Perf" } namespace Msg { + /** @deprecated Only here for backwards-compatibility. Prefer just `Msg`. */ type Types = Msg; } function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, cachePath?: string): DiscoverTypings; @@ -12274,10 +5738,16 @@ declare namespace ts.server { function createNormalizedPathMap(): NormalizedPathMap; interface ProjectOptions { configHasExtendsProperty: boolean; + /** + * true if config file explicitly listed files + */ configHasFilesProperty: boolean; configHasIncludeProperty: boolean; configHasExcludeProperty: boolean; projectReferences: ReadonlyArray | undefined; + /** + * these fields can be present in the project file + */ files?: string[]; wildcardDirectories?: Map; compilerOptions?: CompilerOptions; @@ -12288,88 +5758,49 @@ declare namespace ts.server { function makeInferredProjectName(counter: number): string; function createSortedArray(): SortedArray; } -declare namespace ts.server { - class ThrottledOperations { - private readonly host; - private readonly pendingTimeouts; - private readonly logger?; - constructor(host: ServerHost, logger: Logger); - schedule(operationId: string, delay: number, cb: () => void): void; - private static run; - } - class GcTimer { - private readonly host; - private readonly delay; - private readonly logger; - private timerId; - constructor(host: ServerHost, delay: number, logger: Logger); - scheduleCollect(): void; - private static run; - } - function getBaseConfigFileName(configFilePath: NormalizedPath): "tsconfig.json" | "jsconfig.json" | undefined; - function removeSorted(array: SortedArray, remove: T, compare: Comparer): void; - function toSortedArray(arr: string[]): SortedArray; - function toSortedArray(arr: T[], comparer: Comparer): SortedArray; - function toDeduplicatedSortedArray(arr: string[]): SortedArray; - function indent(str: string): string; - function stringifyIndented(json: {}): string; -} +/** + * Declaration module describing the TypeScript Server protocol + */ declare namespace ts.server.protocol { enum CommandTypes { JsxClosingTag = "jsxClosingTag", Brace = "brace", - BraceFull = "brace-full", BraceCompletion = "braceCompletion", GetSpanOfEnclosingComment = "getSpanOfEnclosingComment", Change = "change", Close = "close", + /** @deprecated Prefer CompletionInfo -- see comment on CompletionsResponse */ Completions = "completions", CompletionInfo = "completionInfo", - CompletionsFull = "completions-full", CompletionDetails = "completionEntryDetails", - CompletionDetailsFull = "completionEntryDetails-full", CompileOnSaveAffectedFileList = "compileOnSaveAffectedFileList", CompileOnSaveEmitFile = "compileOnSaveEmitFile", Configure = "configure", Definition = "definition", - DefinitionFull = "definition-full", DefinitionAndBoundSpan = "definitionAndBoundSpan", - DefinitionAndBoundSpanFull = "definitionAndBoundSpan-full", Implementation = "implementation", - ImplementationFull = "implementation-full", - EmitOutput = "emit-output", Exit = "exit", Format = "format", Formatonkey = "formatonkey", - FormatFull = "format-full", - FormatonkeyFull = "formatonkey-full", - FormatRangeFull = "formatRange-full", Geterr = "geterr", GeterrForProject = "geterrForProject", SemanticDiagnosticsSync = "semanticDiagnosticsSync", SyntacticDiagnosticsSync = "syntacticDiagnosticsSync", SuggestionDiagnosticsSync = "suggestionDiagnosticsSync", NavBar = "navbar", - NavBarFull = "navbar-full", Navto = "navto", - NavtoFull = "navto-full", NavTree = "navtree", NavTreeFull = "navtree-full", + /** @deprecated */ Occurrences = "occurrences", DocumentHighlights = "documentHighlights", - DocumentHighlightsFull = "documentHighlights-full", Open = "open", Quickinfo = "quickinfo", - QuickinfoFull = "quickinfo-full", References = "references", - ReferencesFull = "references-full", Reload = "reload", Rename = "rename", - RenameInfoFull = "rename-full", - RenameLocationsFull = "renameLocations-full", Saveto = "saveto", SignatureHelp = "signatureHelp", - SignatureHelpFull = "signatureHelp-full", Status = "status", TypeDefinition = "typeDefinition", ProjectInfo = "projectInfo", @@ -12378,59 +5809,101 @@ declare namespace ts.server.protocol { OpenExternalProject = "openExternalProject", OpenExternalProjects = "openExternalProjects", CloseExternalProject = "closeExternalProject", - SynchronizeProjectList = "synchronizeProjectList", - ApplyChangedToOpenFiles = "applyChangedToOpenFiles", - EncodedSemanticClassificationsFull = "encodedSemanticClassifications-full", - Cleanup = "cleanup", GetOutliningSpans = "getOutliningSpans", - GetOutliningSpansFull = "outliningSpans", TodoComments = "todoComments", Indentation = "indentation", DocCommentTemplate = "docCommentTemplate", - CompilerOptionsDiagnosticsFull = "compilerOptionsDiagnostics-full", - NameOrDottedNameSpan = "nameOrDottedNameSpan", - BreakpointStatement = "breakpointStatement", CompilerOptionsForInferredProjects = "compilerOptionsForInferredProjects", GetCodeFixes = "getCodeFixes", - GetCodeFixesFull = "getCodeFixes-full", GetCombinedCodeFix = "getCombinedCodeFix", - GetCombinedCodeFixFull = "getCombinedCodeFix-full", ApplyCodeActionCommand = "applyCodeActionCommand", GetSupportedCodeFixes = "getSupportedCodeFixes", GetApplicableRefactors = "getApplicableRefactors", GetEditsForRefactor = "getEditsForRefactor", - GetEditsForRefactorFull = "getEditsForRefactor-full", OrganizeImports = "organizeImports", - OrganizeImportsFull = "organizeImports-full", - GetEditsForFileRename = "getEditsForFileRename", - GetEditsForFileRenameFull = "getEditsForFileRename-full" + GetEditsForFileRename = "getEditsForFileRename" } + /** + * A TypeScript Server message + */ interface Message { + /** + * Sequence number of the message + */ seq: number; + /** + * One of "request", "response", or "event" + */ type: "request" | "response" | "event"; } + /** + * Client-initiated request message + */ interface Request extends Message { type: "request"; + /** + * The command to execute + */ command: string; + /** + * Object containing arguments for the command + */ arguments?: any; } + /** + * Request to reload the project structure for all the opened files + */ interface ReloadProjectsRequest extends Message { command: CommandTypes.ReloadProjects; } + /** + * Server-initiated event message + */ interface Event extends Message { type: "event"; + /** + * Name of event + */ event: string; + /** + * Event-specific information + */ body?: any; } + /** + * Response by server to client request message. + */ interface Response extends Message { type: "response"; + /** + * Sequence number of the request message. + */ request_seq: number; + /** + * Outcome of the request. + */ success: boolean; + /** + * The command requested. + */ command: string; + /** + * If success === false, this should always be provided. + * Otherwise, may (or may not) contain a success message. + */ message?: string; + /** + * Contains message body if success === true. + */ body?: any; } + /** + * Arguments for FileRequest messages. + */ interface FileRequestArgs { + /** + * The file for the request (absolute pathname required). + */ file: string; projectFileName?: string; } @@ -12438,85 +5911,183 @@ declare namespace ts.server.protocol { command: CommandTypes.Status; } interface StatusResponseBody { + /** + * The TypeScript version (`ts.version`). + */ version: string; } + /** + * Response to StatusRequest + */ interface StatusResponse extends Response { body: StatusResponseBody; } + /** + * Requests a JS Doc comment template for a given position + */ interface DocCommentTemplateRequest extends FileLocationRequest { command: CommandTypes.DocCommentTemplate; } + /** + * Response to DocCommentTemplateRequest + */ interface DocCommandTemplateResponse extends Response { body?: TextInsertion; } + /** + * A request to get TODO comments from the file + */ interface TodoCommentRequest extends FileRequest { command: CommandTypes.TodoComments; arguments: TodoCommentRequestArgs; } + /** + * Arguments for TodoCommentRequest request. + */ interface TodoCommentRequestArgs extends FileRequestArgs { + /** + * Array of target TodoCommentDescriptors that describes TODO comments to be found + */ descriptors: TodoCommentDescriptor[]; } + /** + * Response for TodoCommentRequest request. + */ interface TodoCommentsResponse extends Response { body?: TodoComment[]; } + /** + * A request to determine if the caret is inside a comment. + */ interface SpanOfEnclosingCommentRequest extends FileLocationRequest { command: CommandTypes.GetSpanOfEnclosingComment; arguments: SpanOfEnclosingCommentRequestArgs; } interface SpanOfEnclosingCommentRequestArgs extends FileLocationRequestArgs { + /** + * Requires that the enclosing span be a multi-line comment, or else the request returns undefined. + */ onlyMultiLine: boolean; } + /** + * Request to obtain outlining spans in file. + */ interface OutliningSpansRequest extends FileRequest { command: CommandTypes.GetOutliningSpans; } interface OutliningSpan { + /** The span of the document to actually collapse. */ textSpan: TextSpan; + /** The span of the document to display when the user hovers over the collapsed span. */ hintSpan: TextSpan; + /** The text to display in the editor for the collapsed region. */ bannerText: string; + /** + * Whether or not this region should be automatically collapsed when + * the 'Collapse to Definitions' command is invoked. + */ autoCollapse: boolean; + /** + * Classification of the contents of the span + */ kind: OutliningSpanKind; } + /** + * Response to OutliningSpansRequest request. + */ interface OutliningSpansResponse extends Response { body?: OutliningSpan[]; } - interface OutliningSpansRequestFull extends FileRequest { - command: CommandTypes.GetOutliningSpansFull; - } - interface OutliningSpansResponseFull extends Response { - body?: ts.OutliningSpan[]; - } + /** + * A request to get indentation for a location in file + */ interface IndentationRequest extends FileLocationRequest { command: CommandTypes.Indentation; arguments: IndentationRequestArgs; } + /** + * Response for IndentationRequest request. + */ interface IndentationResponse extends Response { body?: IndentationResult; } + /** + * Indentation result representing where indentation should be placed + */ interface IndentationResult { + /** + * The base position in the document that the indent should be relative to + */ position: number; + /** + * The number of columns the indent should be at relative to the position's column. + */ indentation: number; } + /** + * Arguments for IndentationRequest request. + */ interface IndentationRequestArgs extends FileLocationRequestArgs { + /** + * An optional set of settings to be used when computing indentation. + * If argument is omitted - then it will use settings for file that were previously set via 'configure' request or global settings. + */ options?: EditorSettings; } + /** + * Arguments for ProjectInfoRequest request. + */ interface ProjectInfoRequestArgs extends FileRequestArgs { + /** + * Indicate if the file name list of the project is needed + */ needFileNameList: boolean; } + /** + * A request to get the project information of the current file. + */ interface ProjectInfoRequest extends Request { command: CommandTypes.ProjectInfo; arguments: ProjectInfoRequestArgs; } + /** + * A request to retrieve compiler options diagnostics for a project + */ interface CompilerOptionsDiagnosticsRequest extends Request { arguments: CompilerOptionsDiagnosticsRequestArgs; } + /** + * Arguments for CompilerOptionsDiagnosticsRequest request. + */ interface CompilerOptionsDiagnosticsRequestArgs { + /** + * Name of the project to retrieve compiler options diagnostics. + */ projectFileName: string; } + /** + * Response message body for "projectInfo" request + */ interface ProjectInfo { + /** + * For configured project, this is the normalized path of the 'tsconfig.json' file + * For inferred project, this is undefined + */ configFileName: string; + /** + * The list of normalized file name in the project, including 'lib.d.ts' + */ fileNames?: string[]; + /** + * Indicates if the project has a active language service instance + */ languageServiceDisabled?: boolean; } + /** + * Represents diagnostic info that includes location of diagnostic in two forms + * - start position and length of the error span + * - startLocation and endLocation - a pair of Location objects that store start/end line and offset of the error span. + */ interface DiagnosticWithLinePosition { message: string; start: number; @@ -12525,43 +6096,99 @@ declare namespace ts.server.protocol { endLocation: Location; category: string; code: number; + /** May store more in future. For now, this will simply be `true` to indicate when a diagnostic is an unused-identifier diagnostic. */ reportsUnnecessary?: {}; relatedInformation?: DiagnosticRelatedInformation[]; } + /** + * Response message for "projectInfo" request + */ interface ProjectInfoResponse extends Response { body?: ProjectInfo; } + /** + * Request whose sole parameter is a file name. + */ interface FileRequest extends Request { arguments: FileRequestArgs; } + /** + * Instances of this interface specify a location in a source file: + * (file, line, character offset), where line and character offset are 1-based. + */ interface FileLocationRequestArgs extends FileRequestArgs { + /** + * The line number for the request (1-based). + */ line: number; + /** + * The character offset (on the line) for the request (1-based). + */ offset: number; - position?: number; } type FileLocationOrRangeRequestArgs = FileLocationRequestArgs | FileRangeRequestArgs; + /** + * Request refactorings at a given position or selection area. + */ interface GetApplicableRefactorsRequest extends Request { command: CommandTypes.GetApplicableRefactors; arguments: GetApplicableRefactorsRequestArgs; } type GetApplicableRefactorsRequestArgs = FileLocationOrRangeRequestArgs; + /** + * Response is a list of available refactorings. + * Each refactoring exposes one or more "Actions"; a user selects one action to invoke a refactoring + */ interface GetApplicableRefactorsResponse extends Response { body?: ApplicableRefactorInfo[]; } + /** + * A set of one or more available refactoring actions, grouped under a parent refactoring. + */ interface ApplicableRefactorInfo { + /** + * The programmatic name of the refactoring + */ name: string; + /** + * A description of this refactoring category to show to the user. + * If the refactoring gets inlined (see below), this text will not be visible. + */ description: string; + /** + * Inlineable refactorings can have their actions hoisted out to the top level + * of a context menu. Non-inlineanable refactorings should always be shown inside + * their parent grouping. + * + * If not specified, this value is assumed to be 'true' + */ inlineable?: boolean; actions: RefactorActionInfo[]; } + /** + * Represents a single refactoring action - for example, the "Extract Method..." refactor might + * offer several actions, each corresponding to a surround class or closure to extract into. + */ interface RefactorActionInfo { + /** + * The programmatic name of the refactoring action + */ name: string; + /** + * A description of this refactoring action to show to the user. + * If the parent refactoring is inlined away, this will be the only text shown, + * so this description should make sense by itself if the parent is inlineable=true + */ description: string; } interface GetEditsForRefactorRequest extends Request { command: CommandTypes.GetEditsForRefactor; arguments: GetEditsForRefactorRequestArgs; } + /** + * Request the edits that a particular refactoring action produces. + * Callers must specify the name of the refactor and the name of the action. + */ type GetEditsForRefactorRequestArgs = FileLocationOrRangeRequestArgs & { refactor: string; action: string; @@ -12571,9 +6198,19 @@ declare namespace ts.server.protocol { } interface RefactorEditInfo { edits: FileCodeEdits[]; + /** + * An optional location where the editor should start a rename operation once + * the refactoring edits have been applied + */ renameLocation?: Location; renameFilename?: string; } + /** + * Organize imports by: + * 1) Removing unused imports + * 2) Coalescing imports from the same module + * 3) Sorting imports + */ interface OrganizeImportsRequest extends Request { command: CommandTypes.OrganizeImports; arguments: OrganizeImportsRequestArgs; @@ -12589,6 +6226,7 @@ declare namespace ts.server.protocol { command: CommandTypes.GetEditsForFileRename; arguments: GetEditsForFileRenameRequestArgs; } + /** Note: Paths may also be directories. */ interface GetEditsForFileRenameRequestArgs { readonly oldFilePath: string; readonly newFilePath: string; @@ -12596,6 +6234,9 @@ declare namespace ts.server.protocol { interface GetEditsForFileRenameResponse extends Response { body: ReadonlyArray; } + /** + * Request for the available codefixes at a specific position. + */ interface CodeFixRequest extends Request { command: CommandTypes.GetCodeFixes; arguments: CodeFixRequestArgs; @@ -12614,14 +6255,30 @@ declare namespace ts.server.protocol { interface ApplyCodeActionCommandResponse extends Response { } interface FileRangeRequestArgs extends FileRequestArgs { + /** + * The line number for the request (1-based). + */ startLine: number; + /** + * The character offset (on the line) for the request (1-based). + */ startOffset: number; - startPosition?: number; + /** + * The line number for the request (1-based). + */ endLine: number; + /** + * The character offset (on the line) for the request (1-based). + */ endOffset: number; - endPosition?: number; } + /** + * Instances of this interface specify errorcodes on a specific location in a sourcefile. + */ interface CodeFixRequestArgs extends FileRangeRequestArgs { + /** + * Errorcodes we want to get the fixes for. + */ errorCodes?: ReadonlyArray; } interface GetCombinedCodeFixRequestArgs { @@ -12633,30 +6290,64 @@ declare namespace ts.server.protocol { args: FileRequestArgs; } interface ApplyCodeActionCommandRequestArgs { + /** May also be an array of commands. */ command: {}; } + /** + * Response for GetCodeFixes request. + */ interface GetCodeFixesResponse extends Response { body?: CodeAction[]; } + /** + * A request whose arguments specify a file location (file, line, col). + */ interface FileLocationRequest extends FileRequest { arguments: FileLocationRequestArgs; } + /** + * A request to get codes of supported code fixes. + */ interface GetSupportedCodeFixesRequest extends Request { command: CommandTypes.GetSupportedCodeFixes; } + /** + * A response for GetSupportedCodeFixesRequest request. + */ interface GetSupportedCodeFixesResponse extends Response { + /** + * List of error codes supported by the server. + */ body?: string[]; } - interface EncodedSemanticClassificationsRequest extends FileRequest { - arguments: EncodedSemanticClassificationsRequestArgs; - } + /** + * Arguments for EncodedSemanticClassificationsRequest request. + */ interface EncodedSemanticClassificationsRequestArgs extends FileRequestArgs { + /** + * Start position of the span. + */ start: number; + /** + * Length of the span. + */ length: number; } + /** + * Arguments in document highlight request; include: filesToSearch, file, + * line, offset. + */ interface DocumentHighlightsRequestArgs extends FileLocationRequestArgs { + /** + * List of files to search for document highlights. + */ filesToSearch: string[]; } + /** + * Go to definition request; value of command field is + * "definition". Return response giving the file locations that + * define the symbol found in file at location line, col. + */ interface DefinitionRequest extends FileLocationRequest { command: CommandTypes.Definition; } @@ -12666,49 +6357,90 @@ declare namespace ts.server.protocol { interface DefinitionAndBoundSpanResponse extends Response { readonly body: DefinitionInfoAndBoundSpan; } - interface EmitOutputRequest extends FileRequest { - } - interface EmitOutputResponse extends Response { - readonly body: EmitOutput; - } + /** + * Go to type request; value of command field is + * "typeDefinition". Return response giving the file locations that + * define the type for the symbol found in file at location line, col. + */ interface TypeDefinitionRequest extends FileLocationRequest { command: CommandTypes.TypeDefinition; } + /** + * Go to implementation request; value of command field is + * "implementation". Return response giving the file locations that + * implement the symbol found in file at location line, col. + */ interface ImplementationRequest extends FileLocationRequest { command: CommandTypes.Implementation; } + /** + * Location in source code expressed as (one-based) line and (one-based) column offset. + */ interface Location { line: number; offset: number; } + /** + * Object found in response messages defining a span of text in source code. + */ interface TextSpan { + /** + * First character of the definition. + */ start: Location; + /** + * One character past last character of the definition. + */ end: Location; } + /** + * Object found in response messages defining a span of text in a specific source file. + */ interface FileSpan extends TextSpan { + /** + * File containing text span. + */ file: string; } interface DefinitionInfoAndBoundSpan { definitions: ReadonlyArray; textSpan: TextSpan; } + /** + * Definition response message. Gives text range for definition. + */ interface DefinitionResponse extends Response { body?: FileSpan[]; } interface DefinitionInfoAndBoundSpanReponse extends Response { body?: DefinitionInfoAndBoundSpan; } + /** + * Definition response message. Gives text range for definition. + */ interface TypeDefinitionResponse extends Response { body?: FileSpan[]; } + /** + * Implementation response message. Gives text range for implementations. + */ interface ImplementationResponse extends Response { body?: FileSpan[]; } + /** + * Request to get brace completion for a location in the file. + */ interface BraceCompletionRequest extends FileLocationRequest { command: CommandTypes.BraceCompletion; arguments: BraceCompletionRequestArgs; } + /** + * Argument for BraceCompletionRequest request. + */ interface BraceCompletionRequestArgs extends FileLocationRequestArgs { + /** + * Kind of opening brace + */ openingBrace: string; } interface JsxClosingTagRequest extends FileLocationRequest { @@ -12720,247 +6452,596 @@ declare namespace ts.server.protocol { interface JsxClosingTagResponse extends Response { readonly body: TextInsertion; } + /** + * @deprecated + * Get occurrences request; value of command field is + * "occurrences". Return response giving spans that are relevant + * in the file at a given line and column. + */ interface OccurrencesRequest extends FileLocationRequest { command: CommandTypes.Occurrences; } + /** @deprecated */ interface OccurrencesResponseItem extends FileSpan { + /** + * True if the occurrence is a write location, false otherwise. + */ isWriteAccess: boolean; + /** + * True if the occurrence is in a string, undefined otherwise; + */ isInString?: true; } + /** @deprecated */ interface OccurrencesResponse extends Response { body?: OccurrencesResponseItem[]; } + /** + * Get document highlights request; value of command field is + * "documentHighlights". Return response giving spans that are relevant + * in the file at a given line and column. + */ interface DocumentHighlightsRequest extends FileLocationRequest { command: CommandTypes.DocumentHighlights; arguments: DocumentHighlightsRequestArgs; } + /** + * Span augmented with extra information that denotes the kind of the highlighting to be used for span. + */ interface HighlightSpan extends TextSpan { kind: HighlightSpanKind; } + /** + * Represents a set of highligh spans for a give name + */ interface DocumentHighlightsItem { + /** + * File containing highlight spans. + */ file: string; + /** + * Spans to highlight in file. + */ highlightSpans: HighlightSpan[]; } + /** + * Response for a DocumentHighlightsRequest request. + */ interface DocumentHighlightsResponse extends Response { body?: DocumentHighlightsItem[]; } + /** + * Find references request; value of command field is + * "references". Return response giving the file locations that + * reference the symbol found in file at location line, col. + */ interface ReferencesRequest extends FileLocationRequest { command: CommandTypes.References; } interface ReferencesResponseItem extends FileSpan { + /** Text of line containing the reference. Including this + * with the response avoids latency of editor loading files + * to show text of reference line (the server already has + * loaded the referencing files). + */ lineText: string; + /** + * True if reference is a write location, false otherwise. + */ isWriteAccess: boolean; + /** + * True if reference is a definition, false otherwise. + */ isDefinition: boolean; } + /** + * The body of a "references" response message. + */ interface ReferencesResponseBody { + /** + * The file locations referencing the symbol. + */ refs: ReferencesResponseItem[]; + /** + * The name of the symbol. + */ symbolName: string; + /** + * The start character offset of the symbol (on the line provided by the references request). + */ symbolStartOffset: number; + /** + * The full display name of the symbol. + */ symbolDisplayString: string; } + /** + * Response to "references" request. + */ interface ReferencesResponse extends Response { body?: ReferencesResponseBody; } + /** + * Argument for RenameRequest request. + */ interface RenameRequestArgs extends FileLocationRequestArgs { + /** + * Should text at specified location be found/changed in comments? + */ findInComments?: boolean; + /** + * Should text at specified location be found/changed in strings? + */ findInStrings?: boolean; } + /** + * Rename request; value of command field is "rename". Return + * response giving the file locations that reference the symbol + * found in file at location line, col. Also return full display + * name of the symbol so that client can print it unambiguously. + */ interface RenameRequest extends FileLocationRequest { command: CommandTypes.Rename; arguments: RenameRequestArgs; } - interface RenameFullRequest extends FileLocationRequest { - readonly command: CommandTypes.RenameLocationsFull; - readonly arguments: RenameRequestArgs; - } - interface RenameFullResponse extends Response { - readonly body: ReadonlyArray; - } + /** + * Information about the item to be renamed. + */ interface RenameInfo { + /** + * True if item can be renamed. + */ canRename: boolean; + /** + * Error message if item can not be renamed. + */ localizedErrorMessage?: string; + /** + * Display name of the item to be renamed. + */ displayName: string; + /** + * Full display name of item to be renamed. + */ fullDisplayName: string; + /** + * The items's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: ScriptElementKind; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; } + /** + * A group of text spans, all in 'file'. + */ interface SpanGroup { + /** The file to which the spans apply */ file: string; + /** The text spans in this group */ locs: TextSpan[]; } interface RenameResponseBody { + /** + * Information about the item to be renamed. + */ info: RenameInfo; + /** + * An array of span groups (one per file) that refer to the item to be renamed. + */ locs: ReadonlyArray; } + /** + * Rename response message. + */ interface RenameResponse extends Response { body?: RenameResponseBody; } + /** + * Represents a file in external project. + * External project is project whose set of files, compilation options and open\close state + * is maintained by the client (i.e. if all this data come from .csproj file in Visual Studio). + * External project will exist even if all files in it are closed and should be closed explicitly. + * If external project includes one or more tsconfig.json/jsconfig.json files then tsserver will + * create configured project for every config file but will maintain a link that these projects were created + * as a result of opening external project so they should be removed once external project is closed. + */ interface ExternalFile { + /** + * Name of file file + */ fileName: string; + /** + * Script kind of the file + */ scriptKind?: ScriptKindName | ts.ScriptKind; + /** + * Whether file has mixed content (i.e. .cshtml file that combines html markup with C#/JavaScript) + */ hasMixedContent?: boolean; + /** + * Content of the file + */ content?: string; } + /** + * Represent an external project + */ interface ExternalProject { + /** + * Project name + */ projectFileName: string; + /** + * List of root files in project + */ rootFiles: ExternalFile[]; + /** + * Compiler options for the project + */ options: ExternalProjectCompilerOptions; + /** + * @deprecated typingOptions. Use typeAcquisition instead + */ typingOptions?: TypeAcquisition; + /** + * Explicitly specified type acquisition for the project + */ typeAcquisition?: TypeAcquisition; } interface CompileOnSaveMixin { + /** + * If compile on save is enabled for the project + */ compileOnSave?: boolean; } + /** + * For external projects, some of the project settings are sent together with + * compiler settings. + */ type ExternalProjectCompilerOptions = CompilerOptions & CompileOnSaveMixin; - interface ProjectVersionInfo { - projectName: string; - isInferred: boolean; - version: number; - options: ts.CompilerOptions; - languageServiceDisabled: boolean; - lastFileExceededProgramSize?: string; - } + /** + * Represents a set of changes that happen in project + */ interface ProjectChanges { + /** + * List of added files + */ added: string[]; + /** + * List of removed files + */ removed: string[]; + /** + * List of updated files + */ updated: string[]; } - interface ProjectFiles { - info?: ProjectVersionInfo; - files?: string[]; - changes?: ProjectChanges; - } - interface ProjectFilesWithDiagnostics extends ProjectFiles { - projectErrors: DiagnosticWithLinePosition[]; - } - interface ChangedOpenFile { - fileName: string; - changes: ts.TextChange[]; - } + /** + * Information found in a configure request. + */ interface ConfigureRequestArguments { + /** + * Information about the host, for example 'Emacs 24.4' or + * 'Sublime Text version 3075' + */ hostInfo?: string; + /** + * If present, tab settings apply only to this file. + */ file?: string; + /** + * The format options to use during formatting and other code editing features. + */ formatOptions?: FormatCodeSettings; preferences?: UserPreferences; + /** + * The host's additional supported .js file extensions + */ extraFileExtensions?: FileExtensionInfo[]; } + /** + * Configure request; value of command field is "configure". Specifies + * host information, such as host type, tab size, and indent size. + */ interface ConfigureRequest extends Request { command: CommandTypes.Configure; arguments: ConfigureRequestArguments; } + /** + * Response to "configure" request. This is just an acknowledgement, so + * no body field is required. + */ interface ConfigureResponse extends Response { } + /** + * Information found in an "open" request. + */ interface OpenRequestArgs extends FileRequestArgs { + /** + * Used when a version of the file content is known to be more up to date than the one on disk. + * Then the known content will be used upon opening instead of the disk copy + */ fileContent?: string; + /** + * Used to specify the script kind of the file explicitly. It could be one of the following: + * "TS", "JS", "TSX", "JSX" + */ scriptKindName?: ScriptKindName; + /** + * Used to limit the searching for project config file. If given the searching will stop at this + * root path; otherwise it will go all the way up to the dist root path. + */ projectRootPath?: string; } type ScriptKindName = "TS" | "JS" | "TSX" | "JSX"; + /** + * Open request; value of command field is "open". Notify the + * server that the client has file open. The server will not + * monitor the filesystem for changes in this file and will assume + * that the client is updating the server (using the change and/or + * reload messages) when the file changes. Server does not currently + * send a response to an open request. + */ interface OpenRequest extends Request { command: CommandTypes.Open; arguments: OpenRequestArgs; } + /** + * Request to open or update external project + */ interface OpenExternalProjectRequest extends Request { command: CommandTypes.OpenExternalProject; arguments: OpenExternalProjectArgs; } + /** + * Arguments to OpenExternalProjectRequest request + */ type OpenExternalProjectArgs = ExternalProject; + /** + * Request to open multiple external projects + */ interface OpenExternalProjectsRequest extends Request { command: CommandTypes.OpenExternalProjects; arguments: OpenExternalProjectsArgs; } + /** + * Arguments to OpenExternalProjectsRequest + */ interface OpenExternalProjectsArgs { + /** + * List of external projects to open or update + */ projects: ExternalProject[]; } + /** + * Response to OpenExternalProjectRequest request. This is just an acknowledgement, so + * no body field is required. + */ interface OpenExternalProjectResponse extends Response { } + /** + * Response to OpenExternalProjectsRequest request. This is just an acknowledgement, so + * no body field is required. + */ interface OpenExternalProjectsResponse extends Response { } + /** + * Request to close external project. + */ interface CloseExternalProjectRequest extends Request { command: CommandTypes.CloseExternalProject; arguments: CloseExternalProjectRequestArgs; } + /** + * Arguments to CloseExternalProjectRequest request + */ interface CloseExternalProjectRequestArgs { + /** + * Name of the project to close + */ projectFileName: string; } + /** + * Response to CloseExternalProjectRequest request. This is just an acknowledgement, so + * no body field is required. + */ interface CloseExternalProjectResponse extends Response { } - interface SynchronizeProjectListRequest extends Request { - arguments: SynchronizeProjectListRequestArgs; - } - interface SynchronizeProjectListRequestArgs { - knownProjects: protocol.ProjectVersionInfo[]; - } - interface ApplyChangedToOpenFilesRequest extends Request { - arguments: ApplyChangedToOpenFilesRequestArgs; - } - interface ApplyChangedToOpenFilesRequestArgs { - openFiles?: ExternalFile[]; - changedFiles?: ChangedOpenFile[]; - closedFiles?: string[]; - } + /** + * Request to set compiler options for inferred projects. + * External projects are opened / closed explicitly. + * Configured projects are opened when user opens loose file that has 'tsconfig.json' or 'jsconfig.json' anywhere in one of containing folders. + * This configuration file will be used to obtain a list of files and configuration settings for the project. + * Inferred projects are created when user opens a loose file that is not the part of external project + * or configured project and will contain only open file and transitive closure of referenced files if 'useOneInferredProject' is false, + * or all open loose files and its transitive closure of referenced files if 'useOneInferredProject' is true. + */ interface SetCompilerOptionsForInferredProjectsRequest extends Request { command: CommandTypes.CompilerOptionsForInferredProjects; arguments: SetCompilerOptionsForInferredProjectsArgs; } + /** + * Argument for SetCompilerOptionsForInferredProjectsRequest request. + */ interface SetCompilerOptionsForInferredProjectsArgs { + /** + * Compiler options to be used with inferred projects. + */ options: ExternalProjectCompilerOptions; + /** + * Specifies the project root path used to scope compiler options. + * It is an error to provide this property if the server has not been started with + * `useInferredProjectPerProjectRoot` enabled. + */ projectRootPath?: string; } + /** + * Response to SetCompilerOptionsForInferredProjectsResponse request. This is just an acknowledgement, so + * no body field is required. + */ interface SetCompilerOptionsForInferredProjectsResponse extends Response { } + /** + * Exit request; value of command field is "exit". Ask the server process + * to exit. + */ interface ExitRequest extends Request { command: CommandTypes.Exit; } + /** + * Close request; value of command field is "close". Notify the + * server that the client has closed a previously open file. If + * file is still referenced by open files, the server will resume + * monitoring the filesystem for changes to file. Server does not + * currently send a response to a close request. + */ interface CloseRequest extends FileRequest { command: CommandTypes.Close; } + /** + * Request to obtain the list of files that should be regenerated if target file is recompiled. + * NOTE: this us query-only operation and does not generate any output on disk. + */ interface CompileOnSaveAffectedFileListRequest extends FileRequest { command: CommandTypes.CompileOnSaveAffectedFileList; } + /** + * Contains a list of files that should be regenerated in a project + */ interface CompileOnSaveAffectedFileListSingleProject { + /** + * Project name + */ projectFileName: string; + /** + * List of files names that should be recompiled + */ fileNames: string[]; + /** + * true if project uses outFile or out compiler option + */ projectUsesOutFile: boolean; } + /** + * Response for CompileOnSaveAffectedFileListRequest request; + */ interface CompileOnSaveAffectedFileListResponse extends Response { body: CompileOnSaveAffectedFileListSingleProject[]; } + /** + * Request to recompile the file. All generated outputs (.js, .d.ts or .js.map files) is written on disk. + */ interface CompileOnSaveEmitFileRequest extends FileRequest { command: CommandTypes.CompileOnSaveEmitFile; arguments: CompileOnSaveEmitFileRequestArgs; } + /** + * Arguments for CompileOnSaveEmitFileRequest + */ interface CompileOnSaveEmitFileRequestArgs extends FileRequestArgs { + /** + * if true - then file should be recompiled even if it does not have any changes. + */ forced?: boolean; } + /** + * Quickinfo request; value of command field is + * "quickinfo". Return response giving a quick type and + * documentation string for the symbol found in file at location + * line, col. + */ interface QuickInfoRequest extends FileLocationRequest { command: CommandTypes.Quickinfo; } + /** + * Body of QuickInfoResponse. + */ interface QuickInfoResponseBody { + /** + * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: ScriptElementKind; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; + /** + * Starting file location of symbol. + */ start: Location; + /** + * One past last character of symbol. + */ end: Location; + /** + * Type and kind of symbol. + */ displayString: string; + /** + * Documentation associated with symbol. + */ documentation: string; + /** + * JSDoc tags associated with symbol. + */ tags: JSDocTagInfo[]; } + /** + * Quickinfo response message. + */ interface QuickInfoResponse extends Response { body?: QuickInfoResponseBody; } + /** + * Arguments for format messages. + */ interface FormatRequestArgs extends FileLocationRequestArgs { + /** + * Last line of range for which to format text in file. + */ endLine: number; + /** + * Character offset on last line of range for which to format text in file. + */ endOffset: number; - endPosition?: number; + /** + * Format options to be used. + */ options?: FormatCodeSettings; } + /** + * Format request; value of command field is "format". Return + * response giving zero or more edit instructions. The edit + * instructions will be sorted in file order. Applying the edit + * instructions in reverse to file will result in correctly + * reformatted text. + */ interface FormatRequest extends FileLocationRequest { command: CommandTypes.Format; arguments: FormatRequestArgs; } + /** + * Object found in response messages defining an editing + * instruction for a span of text in source code. The effect of + * this instruction is to replace the text starting at start and + * ending one character before end with newText. For an insertion, + * the text span is empty. For a deletion, newText is empty. + */ interface CodeEdit { + /** + * First character of the text span to edit. + */ start: Location; + /** + * One character past last character of the text span to edit. + */ end: Location; + /** + * Replace the span defined above with this string (may be + * the empty string). + */ newText: string; } interface FileCodeEdits { @@ -12968,11 +7049,15 @@ declare namespace ts.server.protocol { textChanges: CodeEdit[]; } interface CodeFixResponse extends Response { + /** The code actions that are available */ body?: CodeFixAction[]; } interface CodeAction { + /** Description of the code action to display in the UI of the editor */ description: string; + /** Text changes to apply to each file as part of the code action */ changes: FileCodeEdits[]; + /** A command is an opaque object that should be passed to `ApplyCodeActionCommandRequestArgs` without modification. */ commands?: {}[]; } interface CombinedCodeActions { @@ -12980,68 +7065,200 @@ declare namespace ts.server.protocol { commands?: ReadonlyArray<{}>; } interface CodeFixAction extends CodeAction { + /** Short name to identify the fix, for use by telemetry. */ fixName: string; + /** + * If present, one may call 'getCombinedCodeFix' with this fixId. + * This may be omitted to indicate that the code fix can't be applied in a group. + */ fixId?: {}; + /** Should be present if and only if 'fixId' is. */ fixAllDescription?: string; } + /** + * Format and format on key response message. + */ interface FormatResponse extends Response { body?: CodeEdit[]; } + /** + * Arguments for format on key messages. + */ interface FormatOnKeyRequestArgs extends FileLocationRequestArgs { + /** + * Key pressed (';', '\n', or '}'). + */ key: string; options?: FormatCodeSettings; } + /** + * Format on key request; value of command field is + * "formatonkey". Given file location and key typed (as string), + * return response giving zero or more edit instructions. The + * edit instructions will be sorted in file order. Applying the + * edit instructions in reverse to file will result in correctly + * reformatted text. + */ interface FormatOnKeyRequest extends FileLocationRequest { command: CommandTypes.Formatonkey; arguments: FormatOnKeyRequestArgs; } type CompletionsTriggerCharacter = "." | '"' | "'" | "`" | "/" | "@" | "<"; + /** + * Arguments for completions messages. + */ interface CompletionsRequestArgs extends FileLocationRequestArgs { + /** + * Optional prefix to apply to possible completions. + */ prefix?: string; + /** + * Character that was responsible for triggering completion. + * Should be `undefined` if a user manually requested completion. + */ triggerCharacter?: CompletionsTriggerCharacter; + /** + * @deprecated Use UserPreferences.includeCompletionsForModuleExports + */ includeExternalModuleExports?: boolean; + /** + * @deprecated Use UserPreferences.includeCompletionsWithInsertText + */ includeInsertTextCompletions?: boolean; } + /** + * Completions request; value of command field is "completions". + * Given a file location (file, line, col) and a prefix (which may + * be the empty string), return the possible completions that + * begin with prefix. + */ interface CompletionsRequest extends FileLocationRequest { command: CommandTypes.Completions; arguments: CompletionsRequestArgs; } + /** + * Arguments for completion details request. + */ interface CompletionDetailsRequestArgs extends FileLocationRequestArgs { + /** + * Names of one or more entries for which to obtain details. + */ entryNames: (string | CompletionEntryIdentifier)[]; } interface CompletionEntryIdentifier { name: string; source?: string; } + /** + * Completion entry details request; value of command field is + * "completionEntryDetails". Given a file location (file, line, + * col) and an array of completion entry names return more + * detailed information for each completion entry. + */ interface CompletionDetailsRequest extends FileLocationRequest { command: CommandTypes.CompletionDetails; arguments: CompletionDetailsRequestArgs; } + /** + * Part of a symbol description. + */ interface SymbolDisplayPart { + /** + * Text of an item describing the symbol. + */ text: string; + /** + * The symbol's kind (such as 'className' or 'parameterName' or plain 'text'). + */ kind: string; } + /** + * An item found in a completion response. + */ interface CompletionEntry { + /** + * The symbol's name. + */ name: string; + /** + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: ScriptElementKind; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers?: string; + /** + * A string that is used for comparing completion items so that they can be ordered. This + * is often the same as the name but may be different in certain circumstances. + */ sortText: string; + /** + * Text to insert instead of `name`. + * This is used to support bracketed completions; If `name` might be "a-b" but `insertText` would be `["a-b"]`, + * coupled with `replacementSpan` to replace a dotted access with a bracket access. + */ insertText?: string; + /** + * An optional span that indicates the text to be replaced by this completion item. + * If present, this span should be used instead of the default one. + * It will be set if the required span differs from the one generated by the default replacement behavior. + */ replacementSpan?: TextSpan; + /** + * Indicates whether commiting this completion entry will require additional code actions to be + * made to avoid errors. The CompletionEntryDetails will have these actions. + */ hasAction?: true; + /** + * Identifier (not necessarily human-readable) identifying where this completion came from. + */ source?: string; + /** + * If true, this completion should be highlighted as recommended. There will only be one of these. + * This will be set when we know the user should write an expression with a certain type and that type is an enum or constructable class. + * Then either that enum/class or a namespace containing it will be the recommended symbol. + */ isRecommended?: true; } + /** + * Additional completion entry details, available on demand + */ interface CompletionEntryDetails { + /** + * The symbol's name. + */ name: string; + /** + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: ScriptElementKind; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers: string; + /** + * Display parts of the symbol (similar to quick info). + */ displayParts: SymbolDisplayPart[]; + /** + * Documentation strings for the symbol. + */ documentation?: SymbolDisplayPart[]; + /** + * JSDoc tags for the symbol. + */ tags?: JSDocTagInfo[]; + /** + * The associated code actions for this entry + */ codeActions?: CodeAction[]; + /** + * Human-readable description of the `source` from the CompletionEntry. + */ source?: SymbolDisplayPart[]; } + /** @deprecated Prefer CompletionInfoResponse, which supports several top-level fields in addition to the array of entries. */ interface CompletionsResponse extends Response { body?: CompletionEntry[]; } @@ -13057,53 +7274,148 @@ declare namespace ts.server.protocol { interface CompletionDetailsResponse extends Response { body?: CompletionEntryDetails[]; } + /** + * Signature help information for a single parameter + */ interface SignatureHelpParameter { + /** + * The parameter's name + */ name: string; + /** + * Documentation of the parameter. + */ documentation: SymbolDisplayPart[]; + /** + * Display parts of the parameter. + */ displayParts: SymbolDisplayPart[]; + /** + * Whether the parameter is optional or not. + */ isOptional: boolean; } + /** + * Represents a single signature to show in signature help. + */ interface SignatureHelpItem { + /** + * Whether the signature accepts a variable number of arguments. + */ isVariadic: boolean; + /** + * The prefix display parts. + */ prefixDisplayParts: SymbolDisplayPart[]; + /** + * The suffix display parts. + */ suffixDisplayParts: SymbolDisplayPart[]; + /** + * The separator display parts. + */ separatorDisplayParts: SymbolDisplayPart[]; + /** + * The signature helps items for the parameters. + */ parameters: SignatureHelpParameter[]; + /** + * The signature's documentation + */ documentation: SymbolDisplayPart[]; + /** + * The signature's JSDoc tags + */ tags: JSDocTagInfo[]; } + /** + * Signature help items found in the response of a signature help request. + */ interface SignatureHelpItems { + /** + * The signature help items. + */ items: SignatureHelpItem[]; + /** + * The span for which signature help should appear on a signature + */ applicableSpan: TextSpan; + /** + * The item selected in the set of available help items. + */ selectedItemIndex: number; + /** + * The argument selected in the set of parameters. + */ argumentIndex: number; + /** + * The argument count + */ argumentCount: number; } type SignatureHelpTriggerCharacter = "," | "(" | "<"; type SignatureHelpRetriggerCharacter = SignatureHelpTriggerCharacter | ")"; + /** + * Arguments of a signature help request. + */ interface SignatureHelpRequestArgs extends FileLocationRequestArgs { + /** + * Reason why signature help was invoked. + * See each individual possible + */ triggerReason?: SignatureHelpTriggerReason; } type SignatureHelpTriggerReason = SignatureHelpInvokedReason | SignatureHelpCharacterTypedReason | SignatureHelpRetriggeredReason; + /** + * Signals that the user manually requested signature help. + * The language service will unconditionally attempt to provide a result. + */ interface SignatureHelpInvokedReason { kind: "invoked"; triggerCharacter?: undefined; } + /** + * Signals that the signature help request came from a user typing a character. + * Depending on the character and the syntactic context, the request may or may not be served a result. + */ interface SignatureHelpCharacterTypedReason { kind: "characterTyped"; + /** + * Character that was responsible for triggering signature help. + */ triggerCharacter: SignatureHelpTriggerCharacter; } + /** + * Signals that this signature help request came from typing a character or moving the cursor. + * This should only occur if a signature help session was already active and the editor needs to see if it should adjust. + * The language service will unconditionally attempt to provide a result. + * `triggerCharacter` can be `undefined` for a retrigger caused by a cursor move. + */ interface SignatureHelpRetriggeredReason { kind: "retrigger"; + /** + * Character that was responsible for triggering signature help. + */ triggerCharacter?: SignatureHelpRetriggerCharacter; } + /** + * Signature help request; value of command field is "signatureHelp". + * Given a file location (file, line, col), return the signature + * help. + */ interface SignatureHelpRequest extends FileLocationRequest { command: CommandTypes.SignatureHelp; arguments: SignatureHelpRequestArgs; } + /** + * Response object for a SignatureHelpRequest. + */ interface SignatureHelpResponse extends Response { body?: SignatureHelpItems; } + /** + * Synchronous request for semantic diagnostics of one file. + */ interface SemanticDiagnosticsSyncRequest extends FileRequest { command: CommandTypes.SemanticDiagnosticsSync; arguments: SemanticDiagnosticsSyncRequestArgs; @@ -13111,6 +7423,9 @@ declare namespace ts.server.protocol { interface SemanticDiagnosticsSyncRequestArgs extends FileRequestArgs { includeLinePosition?: boolean; } + /** + * Response object for synchronous sematic diagnostics request. + */ interface SemanticDiagnosticsSyncResponse extends Response { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } @@ -13120,6 +7435,9 @@ declare namespace ts.server.protocol { } type SuggestionDiagnosticsSyncRequestArgs = SemanticDiagnosticsSyncRequestArgs; type SuggestionDiagnosticsSyncResponse = SemanticDiagnosticsSyncResponse; + /** + * Synchronous request for syntactic diagnostics of one file. + */ interface SyntacticDiagnosticsSyncRequest extends FileRequest { command: CommandTypes.SyntacticDiagnosticsSync; arguments: SyntacticDiagnosticsSyncRequestArgs; @@ -13127,26 +7445,68 @@ declare namespace ts.server.protocol { interface SyntacticDiagnosticsSyncRequestArgs extends FileRequestArgs { includeLinePosition?: boolean; } + /** + * Response object for synchronous syntactic diagnostics request. + */ interface SyntacticDiagnosticsSyncResponse extends Response { body?: Diagnostic[] | DiagnosticWithLinePosition[]; } + /** + * Arguments for GeterrForProject request. + */ interface GeterrForProjectRequestArgs { + /** + * the file requesting project error list + */ file: string; + /** + * Delay in milliseconds to wait before starting to compute + * errors for the files in the file list + */ delay: number; } + /** + * GeterrForProjectRequest request; value of command field is + * "geterrForProject". It works similarly with 'Geterr', only + * it request for every file in this project. + */ interface GeterrForProjectRequest extends Request { command: CommandTypes.GeterrForProject; arguments: GeterrForProjectRequestArgs; } + /** + * Arguments for geterr messages. + */ interface GeterrRequestArgs { + /** + * List of file names for which to compute compiler errors. + * The files will be checked in list order. + */ files: string[]; + /** + * Delay in milliseconds to wait before starting to compute + * errors for the files in the file list + */ delay: number; } + /** + * Geterr request; value of command field is "geterr". Wait for + * delay milliseconds and then, if during the wait no change or + * reload messages have arrived for the first file in the files + * list, get the syntactic errors for the file, field requests, + * and then get the semantic errors for the file. Repeat with a + * smaller delay for each subsequent file on the files list. Best + * practice for an editor is to send a file list containing each + * file that is currently visible, in most-recently-used order. + */ interface GeterrRequest extends Request { command: CommandTypes.Geterr; arguments: GeterrRequestArgs; } type RequestCompletedEventName = "requestCompleted"; + /** + * Event that is sent when server have finished processing request with specified id. + */ interface RequestCompletedEvent extends Event { event: RequestCompletedEventName; body: RequestCompletedEventBody; @@ -13154,38 +7514,103 @@ declare namespace ts.server.protocol { interface RequestCompletedEventBody { request_seq: number; } + /** + * Item of diagnostic information found in a DiagnosticEvent message. + */ interface Diagnostic { + /** + * Starting file location at which text applies. + */ start: Location; + /** + * The last file location at which the text applies. + */ end: Location; + /** + * Text of diagnostic message. + */ text: string; + /** + * The category of the diagnostic message, e.g. "error", "warning", or "suggestion". + */ category: string; reportsUnnecessary?: {}; + /** + * Any related spans the diagnostic may have, such as other locations relevant to an error, such as declarartion sites + */ relatedInformation?: DiagnosticRelatedInformation[]; + /** + * The error code of the diagnostic message. + */ code?: number; + /** + * The name of the plugin reporting the message. + */ source?: string; } interface DiagnosticWithFileName extends Diagnostic { + /** + * Name of the file the diagnostic is in + */ fileName: string; } + /** + * Represents additional spans returned with a diagnostic which are relevant to it + */ interface DiagnosticRelatedInformation { + /** + * The category of the related information message, e.g. "error", "warning", or "suggestion". + */ category: string; + /** + * The code used ot identify the related information + */ code: number; + /** + * Text of related or additional information. + */ message: string; + /** + * Associated location + */ span?: FileSpan; } interface DiagnosticEventBody { + /** + * The file for which diagnostic information is reported. + */ file: string; + /** + * An array of diagnostic information items. + */ diagnostics: Diagnostic[]; } type DiagnosticEventKind = "semanticDiag" | "syntaxDiag" | "suggestionDiag"; + /** + * Event message for DiagnosticEventKind event types. + * These events provide syntactic and semantic errors for a file. + */ interface DiagnosticEvent extends Event { body?: DiagnosticEventBody; } interface ConfigFileDiagnosticEventBody { + /** + * The file which trigged the searching and error-checking of the config file + */ triggerFile: string; + /** + * The name of the found config file. + */ configFile: string; + /** + * An arry of diagnostic information items for the found config file. + */ diagnostics: DiagnosticWithFileName[]; } + /** + * Event message for "configFileDiag" event type. + * This event provides errors for a found config file. + */ interface ConfigFileDiagnosticEvent extends Event { body?: ConfigFileDiagnosticEventBody; event: "configFileDiag"; @@ -13196,7 +7621,17 @@ declare namespace ts.server.protocol { body?: ProjectLanguageServiceStateEventBody; } interface ProjectLanguageServiceStateEventBody { + /** + * Project name that has changes in the state of language service. + * For configured projects this will be the config file path. + * For external projects this will be the name of the projects specified when project was open. + * For inferred projects this event is not raised. + */ projectName: string; + /** + * True if language service state switched from disabled to enabled + * and false otherwise. + */ languageServiceEnabled: boolean; } type ProjectsUpdatedInBackgroundEventName = "projectsUpdatedInBackground"; @@ -13205,73 +7640,203 @@ declare namespace ts.server.protocol { body: ProjectsUpdatedInBackgroundEventBody; } interface ProjectsUpdatedInBackgroundEventBody { + /** + * Current set of open files + */ openFiles: string[]; } + /** + * Arguments for reload request. + */ interface ReloadRequestArgs extends FileRequestArgs { + /** + * Name of temporary file from which to reload file + * contents. May be same as file. + */ tmpfile: string; } + /** + * Reload request message; value of command field is "reload". + * Reload contents of file with name given by the 'file' argument + * from temporary file with name given by the 'tmpfile' argument. + * The two names can be identical. + */ interface ReloadRequest extends FileRequest { command: CommandTypes.Reload; arguments: ReloadRequestArgs; } + /** + * Response to "reload" request. This is just an acknowledgement, so + * no body field is required. + */ interface ReloadResponse extends Response { } + /** + * Arguments for saveto request. + */ interface SavetoRequestArgs extends FileRequestArgs { + /** + * Name of temporary file into which to save server's view of + * file contents. + */ tmpfile: string; } + /** + * Saveto request message; value of command field is "saveto". + * For debugging purposes, save to a temporaryfile (named by + * argument 'tmpfile') the contents of file named by argument + * 'file'. The server does not currently send a response to a + * "saveto" request. + */ interface SavetoRequest extends FileRequest { command: CommandTypes.Saveto; arguments: SavetoRequestArgs; } + /** + * Arguments for navto request message. + */ interface NavtoRequestArgs extends FileRequestArgs { + /** + * Search term to navigate to from current location; term can + * be '.*' or an identifier prefix. + */ searchValue: string; + /** + * Optional limit on the number of items to return. + */ maxResultCount?: number; + /** + * Optional flag to indicate we want results for just the current file + * or the entire project. + */ currentFileOnly?: boolean; projectFileName?: string; } + /** + * Navto request message; value of command field is "navto". + * Return list of objects giving file locations and symbols that + * match the search term given in argument 'searchTerm'. The + * context for the search is given by the named file. + */ interface NavtoRequest extends FileRequest { command: CommandTypes.Navto; arguments: NavtoRequestArgs; } + /** + * An item found in a navto response. + */ interface NavtoItem extends FileSpan { + /** + * The symbol's name. + */ name: string; + /** + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: ScriptElementKind; + /** + * exact, substring, or prefix. + */ matchKind: string; + /** + * If this was a case sensitive or insensitive match. + */ isCaseSensitive: boolean; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers?: string; + /** + * Name of symbol's container symbol (if any); for example, + * the class name if symbol is a class member. + */ containerName?: string; + /** + * Kind of symbol's container symbol (if any). + */ containerKind?: ScriptElementKind; } + /** + * Navto response message. Body is an array of navto items. Each + * item gives a symbol that matched the search term. + */ interface NavtoResponse extends Response { body?: NavtoItem[]; } + /** + * Arguments for change request message. + */ interface ChangeRequestArgs extends FormatRequestArgs { + /** + * Optional string to insert at location (file, line, offset). + */ insertString?: string; } + /** + * Change request message; value of command field is "change". + * Update the server's view of the file named by argument 'file'. + * Server does not currently send a response to a change request. + */ interface ChangeRequest extends FileLocationRequest { command: CommandTypes.Change; arguments: ChangeRequestArgs; } + /** + * Response to "brace" request. + */ interface BraceResponse extends Response { body?: TextSpan[]; } + /** + * Brace matching request; value of command field is "brace". + * Return response giving the file locations of matching braces + * found in file at location line, offset. + */ interface BraceRequest extends FileLocationRequest { command: CommandTypes.Brace; } + /** + * NavBar items request; value of command field is "navbar". + * Return response giving the list of navigation bar entries + * extracted from the requested file. + */ interface NavBarRequest extends FileRequest { command: CommandTypes.NavBar; } + /** + * NavTree request; value of command field is "navtree". + * Return response giving the navigation tree of the requested file. + */ interface NavTreeRequest extends FileRequest { command: CommandTypes.NavTree; } interface NavigationBarItem { + /** + * The item's display text. + */ text: string; + /** + * The symbol's kind (such as 'className' or 'parameterName'). + */ kind: ScriptElementKind; + /** + * Optional modifiers for the kind (such as 'public'). + */ kindModifiers?: string; + /** + * The definition locations of the item. + */ spans: TextSpan[]; + /** + * Optional children. + */ childItems?: NavigationBarItem[]; + /** + * Number of levels deep this item should appear. + */ indent: number; } + /** protocol.NavigationTree is identical to ts.NavigationTree, except using protocol.TextSpan instead of ts.TextSpan */ interface NavigationTree { text: string; kind: ScriptElementKind; @@ -13303,8 +7868,17 @@ declare namespace ts.server.protocol { payload: TypingsInstalledTelemetryEventPayload; } interface TypingsInstalledTelemetryEventPayload { + /** + * Comma separated list of installed typing packages + */ installedPackages: string; + /** + * true if install request succeeded, otherwise - false + */ installSuccess: boolean; + /** + * version of typings installer + */ typingsInstallerVersion: string; } type BeginInstallTypesEventName = "beginInstallTypes"; @@ -13318,12 +7892,21 @@ declare namespace ts.server.protocol { body: EndInstallTypesEventBody; } interface InstallTypesEventBody { + /** + * correlation id to match begin and end events + */ eventId: number; + /** + * list of packages to install + */ packages: ReadonlyArray; } interface BeginInstallTypesEventBody extends InstallTypesEventBody { } interface EndInstallTypesEventBody extends InstallTypesEventBody { + /** + * true if installation succeeded, otherwise false + */ success: boolean; } interface NavBarResponse extends Response { @@ -13366,7 +7949,15 @@ declare namespace ts.server.protocol { interface UserPreferences { readonly disableSuggestions?: boolean; readonly quotePreference?: "double" | "single"; + /** + * If enabled, TypeScript will search through all external modules' exports and add them to the completions list. + * This affects lone identifier completions but not completions on the right hand side of `obj.`. + */ readonly includeCompletionsForModuleExports?: boolean; + /** + * If enabled, the completion list will include completions with invalid identifier names. + * For those entries, The `insertText` and `replacementSpan` properties will be set to change from `.x` property access to `["x"]`. + */ readonly includeCompletionsWithInsertText?: boolean; readonly importModuleSpecifierPreference?: "relative" | "non-relative"; readonly allowTextChangesInNewFiles?: boolean; @@ -13438,6 +8029,7 @@ declare namespace ts.server.protocol { traceResolution?: boolean; resolveJsonModule?: boolean; types?: string[]; + /** Paths used to used to compute primary types search locations */ typeRoots?: string[]; [option: string]: CompilerOptionsValue | undefined; } @@ -13480,65 +8072,25 @@ declare namespace ts.server { svc: number; text: number; } - class TextStorage { - private readonly host; - private readonly fileName; - version: ScriptInfoVersion; - private svc; - private text; - private lineMap; - isOpen: boolean; - private ownFileText; - private pendingReloadFromDisk; - constructor(host: ServerHost, fileName: NormalizedPath, initialVersion?: ScriptInfoVersion); - getVersion(): string; - hasScriptVersionCache_TestOnly(): boolean; - useScriptVersionCache_TestOnly(): void; - useText(newText?: string): void; - edit(start: number, end: number, newText: string): void; - reload(newText: string): true | undefined; - reloadWithFileText(tempFileName?: string): true | undefined; - reloadFromDisk(): boolean | undefined; - delayReloadFromFileIntoText(): void; - getSnapshot(): IScriptSnapshot; - getLineInfo(line: number): AbsolutePositionAndLineText; - lineToTextSpan(line: number): TextSpan; - lineOffsetToPosition(line: number, offset: number): number; - positionToLineOffset(position: number): protocol.Location; - private getFileText; - private switchToScriptVersionCache; - private useScriptVersionCacheIfValidOrOpen; - private getOrLoadText; - private getLineMap; - } - function isDynamicFileName(fileName: NormalizedPath): boolean; - interface DocumentRegistrySourceFileCache { - key: DocumentRegistryBucketKey; - sourceFile: SourceFile; - } class ScriptInfo { private readonly host; readonly fileName: NormalizedPath; readonly scriptKind: ScriptKind; readonly hasMixedContent: boolean; readonly path: Path; + /** + * All projects that include this file + */ readonly containingProjects: Project[]; private formatSettings; private preferences; - fileWatcher: FileWatcher | undefined; private textStorage; - readonly isDynamic: boolean; - private realpath; - cacheSourceFile: DocumentRegistrySourceFileCache; constructor(host: ServerHost, fileName: NormalizedPath, scriptKind: ScriptKind, hasMixedContent: boolean, path: Path, initialVersion?: ScriptInfoVersion); - getVersion(): ScriptInfoVersion; - isDynamicOrHasMixedContent(): boolean; isScriptOpen(): boolean; open(newText: string): void; close(fileExists?: boolean): void; getSnapshot(): IScriptSnapshot; private ensureRealPath; - getRealpathIfDifferent(): Path | undefined; getFormatCodeSettings(): FormatCodeSettings | undefined; getPreferences(): UserPreferences | undefined; attachToProject(project: Project): boolean; @@ -13550,13 +8102,18 @@ declare namespace ts.server { setOptions(formatSettings: FormatCodeSettings, preferences: UserPreferences | undefined): void; getLatestVersion(): string; saveTo(fileName: string): void; - delayReloadNonMixedContentFile(): void; reloadFromFile(tempFileName?: NormalizedPath): void; - getLineInfo(line: number): AbsolutePositionAndLineText; editContent(start: number, end: number, newText: string): void; markContainingProjectsAsDirty(): void; isOrphan(): boolean; + /** + * @param line 1 based index + */ lineToTextSpan(line: number): TextSpan; + /** + * @param line 1 based index + * @param offset 1 based index + */ lineOffsetToPosition(line: number, offset: number): number; positionToLineOffset(position: number): protocol.Location; isJavaScript(): boolean; @@ -13576,16 +8133,6 @@ declare namespace ts.server { readonly globalTypingsCacheLocation: string | undefined; } const nullTypingsInstaller: ITypingsInstaller; - class TypingsCache { - private readonly installer; - private readonly perProjectCache; - constructor(installer: ITypingsInstaller); - isKnownTypesPackageName(name: string): boolean; - installPackage(options: InstallPackageOptionsWithProject): Promise; - enqueueInstallTypingsForProject(project: Project, unresolvedImports: SortedReadonlyArray | undefined, forceRefresh: boolean): void; - updateTypingsForProject(projectName: string, compilerOptions: CompilerOptions, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray, newTypings: string[]): SortedReadonlyArray | SortedArray; - onProjectClosed(project: Project): void; - } } declare namespace ts.server { enum ProjectKind { @@ -13593,16 +8140,8 @@ declare namespace ts.server { Configured = 1, External = 2 } - type Mutable = { - -readonly [K in keyof T]: T[K]; - }; - function countEachFileTypes(infos: ScriptInfo[]): FileStats; function allRootFilesAreJsOrDts(project: Project): boolean; function allFilesAreJsOrDts(project: Project): boolean; - function hasNoTypeScriptSource(fileNames: string[]): boolean; - interface ProjectFilesWithTSDiagnostics extends protocol.ProjectFiles { - projectErrors: ReadonlyArray; - } interface PluginCreateInfo { project: Project; languageService: LanguageService; @@ -13617,8 +8156,11 @@ declare namespace ts.server { type PluginModuleFactory = (mod: { typescript: typeof ts; }) => PluginModule; + /** + * The project root can be script info - if root is present, + * or it could be just normalized path if root wasnt present on the host(only for non inferred project) + */ type ProjectRoot = ScriptInfo | NormalizedPath; - function isScriptInfo(value: ProjectRoot): value is ScriptInfo; abstract class Project implements LanguageServiceHost, ModuleResolutionHost { readonly projectName: string; readonly projectKind: ProjectKind; @@ -13632,33 +8174,40 @@ declare namespace ts.server { private externalFiles; private missingFilesMap; private plugins; - cachedUnresolvedImportsPerFile: Map>; - lastCachedUnresolvedImportsList: SortedReadonlyArray | undefined; - private hasAddedorRemovedFiles; private lastFileExceededProgramSize; protected languageService: LanguageService; languageServiceEnabled: boolean; readonly trace?: (s: string) => void; readonly realpath?: (path: string) => string; - hasInvalidatedResolution: HasInvalidatedResolution; - resolutionCache: ResolutionCache; private builderState; + /** + * Set of files names that were updated since the last call to getChangesSinceVersion. + */ private updatedFileNames; + /** + * Set of files that was returned from the last call to getChangesSinceVersion. + */ private lastReportedFileNames; + /** + * Last version that was reported. + */ private lastReportedVersion; + /** + * Current project's program version. (incremented everytime new program is created that is not complete reuse from the old one) + * This property is changed in 'updateGraph' based on the set of files in program + */ private projectProgramVersion; + /** + * Current version of the project state. It is changed when: + * - new root file was added/removed + * - edit happen in some file that is currently included in the project. + * This property is different from projectStructureVersion since in most cases edits don't affect set of files in the project + */ private projectStateVersion; - dirty: boolean; - hasChangedAutomaticTypeDirectiveNames: boolean; - typingFiles: SortedReadonlyArray; private readonly cancellationToken; isNonTsProject(): boolean; isJsOnlyProject(): boolean; static resolveModule(moduleName: string, initialDir: string, host: ServerHost, log: (message: string) => void): {} | undefined; - readonly currentDirectory: string; - directoryStructureHost: DirectoryStructureHost; - readonly getCanonicalFileName: GetCanonicalFileName; - constructor(projectName: string, projectKind: ProjectKind, projectService: ProjectService, documentRegistry: DocumentRegistry, hasExplicitListOfFiles: boolean, lastFileExceededProgramSize: string | undefined, compilerOptions: CompilerOptions, compileOnSaveEnabled: boolean, directoryStructureHost: DirectoryStructureHost, currentDirectory: string | undefined); isKnownTypesPackageName(name: string): boolean; installPackage(options: InstallPackageOptions): Promise; private readonly typingsCache; @@ -13684,23 +8233,20 @@ declare namespace ts.server { resolveTypeReferenceDirectives(typeDirectiveNames: string[], containingFile: string): ResolvedTypeReferenceDirective[]; directoryExists(path: string): boolean; getDirectories(path: string): string[]; - getCachedDirectoryStructureHost(): CachedDirectoryStructureHost; - toPath(fileName: string): Path; - watchDirectoryOfFailedLookupLocation(directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher; - onInvalidatedResolution(): void; - watchTypeRootsDirectory(directory: string, cb: DirectoryWatcherCallback, flags: WatchDirectoryFlags): FileWatcher; - onChangedAutomaticTypeDirectiveNames(): void; - getGlobalCache(): string | undefined; - writeLog(s: string): void; log(s: string): void; error(s: string): void; private setInternalCompilerOptionsForEmittingJsFiles; + /** + * Get the errors that dont have any file name associated + */ getGlobalProjectErrors(): ReadonlyArray; getAllProjectErrors(): ReadonlyArray; getLanguageService(ensureSynchronized?: boolean): LanguageService; - getSourceMapper(): SourceMapper; private shouldEmitFile; getCompileOnSaveAffectedFileList(scriptInfo: ScriptInfo): string[]; + /** + * Returns true if emit was conducted + */ emitFile(scriptInfo: ScriptInfo, writeFile: (path: string, data: string, writeByteOrderMark?: boolean) => void): boolean; enableLanguageService(): void; disableLanguageService(lastFileExceededProgramSize?: string): void; @@ -13709,14 +8255,11 @@ declare namespace ts.server { protected removeLocalTypingsFromTypeAcquisition(newTypeAcquisition: TypeAcquisition): TypeAcquisition; getExternalFiles(): SortedReadonlyArray; getSourceFile(path: Path): SourceFile | undefined; - getSourceFileOrConfigFile(path: Path): SourceFile | undefined; close(): void; private detachScriptInfoIfNotRoot; isClosed(): boolean; hasRoots(): boolean; - isOrphan(): boolean; getRootFiles(): NormalizedPath[]; - getRootFilesMap(): Map; getRootScriptInfos(): ScriptInfo[]; getScriptInfos(): ScriptInfo[]; getExcludedFiles(): ReadonlyArray; @@ -13730,11 +8273,11 @@ declare namespace ts.server { removeFile(info: ScriptInfo, fileExists: boolean, detachFromProject: boolean): void; registerFileUpdate(fileName: string): void; markAsDirty(): void; - private extractUnresolvedImportsFromSourceFile; - onFileAddedOrRemoved(): void; + /** + * Updates set of files that contribute to this project + * @returns: true if set of files in the project stays the same and false - otherwise. + */ updateGraph(): boolean; - updateTypingFiles(typingFiles: SortedReadonlyArray): void; - getCurrentProgram(): Program; protected removeExistingTypings(include: string[]): string[]; private updateGraphWorker; private detachScriptInfoFromProject; @@ -13744,66 +8287,76 @@ declare namespace ts.server { getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; filesToString(writeProjectFileNames: boolean): string; setCompilerOptions(compilerOptions: CompilerOptions): void; - getChangesSinceVersion(lastKnownVersion?: number): ProjectFilesWithTSDiagnostics; protected removeRoot(info: ScriptInfo): void; protected enableGlobalPlugins(): void; protected enablePlugin(pluginConfigEntry: PluginImport, searchPaths: string[]): void; + /** Starts a new check for diagnostics. Call this if some file has updated that would cause diagnostics to be changed. */ refreshDiagnostics(): void; private enableProxy; } + /** + * If a file is opened and no tsconfig (or jsconfig) is found, + * the file and its imports/references are put into an InferredProject. + */ class InferredProject extends Project { private static readonly newName; private _isJsInferredProject; toggleJsInferredProject(isJsInferredProject: boolean): void; setCompilerOptions(options?: CompilerOptions): void; + /** this is canonical project root path */ readonly projectRootPath: string | undefined; - readonly canonicalCurrentDirectory: string | undefined; - constructor(projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, projectRootPath: NormalizedPath | undefined, currentDirectory: string | undefined); addRoot(info: ScriptInfo): void; removeRoot(info: ScriptInfo): void; - isOrphan(): boolean; isProjectWithSingleRoot(): boolean; close(): void; getTypeAcquisition(): TypeAcquisition; } + /** + * If a file is opened, the server will look for a tsconfig (or jsconfig) + * and if successfull create a ConfiguredProject for it. + * Otherwise it will create an InferredProject. + */ class ConfiguredProject extends Project { compileOnSaveEnabled: boolean; private projectReferences; private typeAcquisition; - configFileWatcher: FileWatcher | undefined; private directoriesWatchedForWildcards; readonly canonicalConfigFilePath: NormalizedPath; - pendingReload: ConfigFileProgramReloadLevel; - configFileSpecs: ConfigFileSpecs | undefined; + /** Ref count to the project when opened from external project */ private externalProjectRefCount; private projectErrors; - constructor(configFileName: NormalizedPath, projectService: ProjectService, documentRegistry: DocumentRegistry, hasExplicitListOfFiles: boolean, compilerOptions: CompilerOptions, lastFileExceededProgramSize: string | undefined, compileOnSaveEnabled: boolean, cachedDirectoryStructureHost: CachedDirectoryStructureHost, projectReferences: ReadonlyArray | undefined); + /** + * If the project has reload from disk pending, it reloads (and then updates graph as part of that) instead of just updating the graph + * @returns: true if set of files in the project stays the same and false - otherwise. + */ updateGraph(): boolean; - getCachedDirectoryStructureHost(): CachedDirectoryStructureHost; getConfigFilePath(): NormalizedPath; getProjectReferences(): ReadonlyArray; updateReferences(refs: ReadonlyArray | undefined): void; enablePlugins(): void; + /** + * Get the errors that dont have any file name associated + */ getGlobalProjectErrors(): ReadonlyArray; + /** + * Get all the project errors + */ getAllProjectErrors(): ReadonlyArray; setProjectErrors(projectErrors: Diagnostic[]): void; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; getTypeAcquisition(): TypeAcquisition; - watchWildcards(wildcardDirectories: Map): void; - stopWatchingWildCards(): void; close(): void; - addExternalProjectReference(): void; - deleteExternalProjectReference(): void; - hasOpenRef(): boolean; getEffectiveTypeRoots(): string[]; - updateErrorOnNoInputFiles(hasFileNames: boolean): void; } + /** + * Project whose configuration is handled externally, such as in a '.csproj'. + * These are created only if a host explicitly calls `openExternalProject`. + */ class ExternalProject extends Project { externalProjectName: string; compileOnSaveEnabled: boolean; excludedFiles: ReadonlyArray; private typeAcquisition; - constructor(externalProjectName: string, projectService: ProjectService, documentRegistry: DocumentRegistry, compilerOptions: CompilerOptions, lastFileExceededProgramSize: string | undefined, compileOnSaveEnabled: boolean, projectFilePath?: string); getExcludedFiles(): ReadonlyArray; getTypeAcquisition(): TypeAcquisition; setTypeAcquisition(newTypeAcquisition: TypeAcquisition): void; @@ -13837,13 +8390,20 @@ declare namespace ts.server { languageServiceEnabled: boolean; }; } + /** This will be converted to the payload of a protocol.TelemetryEvent in session.defaultEventHandler. */ interface ProjectInfoTelemetryEvent { readonly eventName: typeof ProjectInfoTelemetryEvent; readonly data: ProjectInfoTelemetryEventData; } interface ProjectInfoTelemetryEventData { + /** Cryptographically secure hash of project file location. */ readonly projectId: string; + /** Count of file extensions seen in the project. */ readonly fileStats: FileStats; + /** + * Any compiler options that might contain paths will be taken out. + * Enum compiler options will be converted to strings. + */ readonly compilerOptions: CompilerOptions; readonly extends: boolean | undefined; readonly files: boolean | undefined; @@ -13854,8 +8414,14 @@ declare namespace ts.server { readonly configFileName: "tsconfig.json" | "jsconfig.json" | "other"; readonly projectType: "external" | "configured"; readonly languageServiceEnabled: boolean; + /** TypeScript version used by the server. */ readonly version: string; } + /** + * Info that we may send about a file that was just opened. + * Info about a file will only be sent once per session, even if the file changes in ways that might affect the info. + * Currently this is only sent for '.js' files. + */ interface OpenFileInfoTelemetryEvent { readonly eventName: typeof OpenFileInfoTelemetryEvent; readonly data: OpenFileInfoTelemetryEventData; @@ -13908,20 +8474,6 @@ declare namespace ts.server { configFileName?: NormalizedPath; configFileErrors?: ReadonlyArray; } - enum WatchType { - ConfigFilePath = "Config file for the program", - MissingFilePath = "Missing file from program", - WildcardDirectories = "Wild card directory", - ClosedScriptInfo = "Closed Script info", - ConfigFileForInferredRoot = "Config file for the inferred project root", - FailedLookupLocation = "Directory of Failed lookup locations in module resolution", - TypeRoots = "Type root directory" - } - interface ConfigFileExistenceInfo { - exists: boolean; - openFilesImpactedByConfigFile: Map; - configFileWatcherForRootOfInferredProject?: FileWatcher; - } interface ProjectServiceOptions { host: ServerHost; logger: Logger; @@ -13939,28 +8491,60 @@ declare namespace ts.server { syntaxOnly?: boolean; } class ProjectService { - readonly typingsCache: TypingsCache; - readonly documentRegistry: DocumentRegistry; + /** + * Container of all known scripts + */ private readonly filenameToScriptInfo; + /** + * Contains all the deleted script info's version information so that + * it does not reset when creating script info again + * (and could have potentially collided with version where contents mismatch) + */ private readonly filenameToScriptInfoVersion; private readonly allJsFilesForOpenFileTelemetry; - readonly realpathToScriptInfos: MultiMap | undefined; + /** + * maps external project file name to list of config files that were the part of this project + */ private readonly externalProjectToConfiguredProjectMap; + /** + * external projects (configuration and list of root files is not controlled by tsserver) + */ readonly externalProjects: ExternalProject[]; + /** + * projects built from openFileRoots + */ readonly inferredProjects: InferredProject[]; + /** + * projects specified by a tsconfig.json file + */ readonly configuredProjects: Map; + /** + * Open files: with value being project root path, and key being Path of the file that is open + */ readonly openFiles: Map; + /** + * Map of open files that are opened without complete path but have projectRoot as current directory + */ private readonly openFilesWithNonRootedDiskPath; private compilerOptionsForInferredProjects; private compilerOptionsForInferredProjectsPerProjectRoot; + /** + * Project size for configured or external projects + */ private readonly projectToSizeMap; + /** + * This is a map of config file paths existance that doesnt need query to disk + * - The entry can be present because there is inferred project that needs to watch addition of config file to directory + * In this case the exists could be true/false based on config file is present or not + * - Or it is present if we have configured project open with config file at that location + * In this case the exists property is always true + */ private readonly configFileExistenceInfoCache; private readonly throttledOperations; private readonly hostConfiguration; private safelist; private legacySafelist; private pendingProjectUpdates; - pendingEnsureProjectForOpenFiles: boolean; readonly currentDirectory: NormalizedPath; readonly toCanonicalFileName: (f: string) => string; readonly host: ServerHost; @@ -13978,34 +8562,27 @@ declare namespace ts.server { readonly allowLocalPluginLoads: boolean; readonly typesMapLocation: string | undefined; readonly syntaxOnly?: boolean; + /** Tracks projects that we have already sent telemetry for. */ private readonly seenProjects; - readonly watchFactory: WatchFactory; constructor(opts: ProjectServiceOptions); toPath(fileName: string): Path; - getExecutingFilePath(): string; - getNormalizedAbsolutePath(fileName: string): string; - setDocument(key: DocumentRegistryBucketKey, path: Path, sourceFile: SourceFile): void; - getDocument(key: DocumentRegistryBucketKey, path: Path): SourceFile | undefined; - ensureInferredProjectsUpToDate_TestOnly(): void; - getCompilerOptionsForInferredProjects(): CompilerOptions; - onUpdateLanguageServiceStateForProject(project: Project, languageServiceEnabled: boolean): void; private loadTypesMap; updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse): void; - updateTypingsForProject(response: SetTypings | InvalidateCachedTypings | PackageInstalledResponse | BeginInstallTypes | EndInstallTypes): void; private delayEnsureProjectForOpenFiles; private delayUpdateProjectGraph; - hasPendingProjectUpdate(project: Project): boolean; - sendProjectsUpdatedInBackgroundEvent(): void; - delayUpdateProjectGraphAndEnsureProjectStructureForOpenFiles(project: Project): void; private delayUpdateProjectGraphs; setCompilerOptionsForInferredProjects(projectCompilerOptions: protocol.ExternalProjectCompilerOptions, projectRootPath?: string): void; findProject(projectName: string): Project | undefined; - forEachProject(cb: (project: Project) => void): void; getDefaultProjectForFile(fileName: NormalizedPath, ensureProject: boolean): Project | undefined; - tryGetDefaultProjectForFile(fileName: NormalizedPath): Project | undefined; - ensureDefaultProjectForFile(fileName: NormalizedPath): Project; private doEnsureDefaultProjectForFile; getScriptInfoEnsuringProjectsUptoDate(uncheckedFileName: string): ScriptInfo | undefined; + /** + * Ensures the project structures are upto date + * This means, + * - we go through all the projects and update them if they are dirty + * - if updates reflect some change in structure or there was pending request to ensure projects for open files + * ensure that each open script info has project + */ private ensureProjectStructuresUptoDate; getFormatCodeOptions(file: NormalizedPath): FormatCodeSettings; getPreferences(file: NormalizedPath): UserPreferences; @@ -14013,31 +8590,65 @@ declare namespace ts.server { getHostPreferences(): UserPreferences; private onSourceFileChanged; private handleDeletedFile; - watchWildcardDirectory(directory: Path, flags: WatchDirectoryFlags, project: ConfiguredProject): FileWatcher; - getConfigFileExistenceInfo(project: ConfiguredProject): ConfigFileExistenceInfo; private onConfigChangedForConfiguredProject; + /** + * This is the callback function for the config file add/remove/change at any location + * that matters to open script info but doesnt have configured project open + * for the config file + */ private onConfigFileChangeForOpenScriptInfo; private removeProject; - assignOrphanScriptInfoToInferredProject(info: ScriptInfo, projectRootPath: NormalizedPath | undefined): InferredProject; + /** + * Remove this file from the set of open, non-configured files. + * @param info The file that has been closed or newly configured + */ private closeOpenFile; private deleteScriptInfo; private configFileExists; private setConfigFileExistenceByNewConfiguredProject; + /** + * Returns true if the configFileExistenceInfo is needed/impacted by open files that are root of inferred project + */ private configFileExistenceImpactsRootOfInferredProject; private setConfigFileExistenceInfoByClosedConfiguredProject; private logConfigFileWatchUpdate; + /** + * Create the watcher for the configFileExistenceInfo + */ private createConfigFileWatcherOfConfigFileExistence; + /** + * Close the config file watcher in the cached ConfigFileExistenceInfo + * if there arent any open files that are root of inferred project + */ private closeConfigFileWatcherOfConfigFileExistenceInfo; + /** + * This is called on file close, so that we stop watching the config file for this script info + */ private stopWatchingConfigFilesForClosedScriptInfo; - startWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo): void; - stopWatchingConfigFilesForInferredProjectRoot(info: ScriptInfo): void; + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + */ private forEachConfigFileLocation; + /** + * This function tries to search for a tsconfig.json for the given file. + * This is different from the method the compiler uses because + * the compiler can assume it will always start searching in the + * current directory (the directory in which tsc was invoked). + * The server must start searching from the directory containing + * the newly opened file. + */ private getConfigFileNameForFile; private printProjects; private findConfiguredProjectByProjectName; private getConfiguredProjectByCanonicalConfigFilePath; private findExternalProjectByProjectName; private convertConfigFileContentToProjectOptions; + /** Get a filename if the language service exceeds the maximum allowed program size; otherwise returns undefined. */ private getFilenameForExceededTotalSizeLimitForNonTsFiles; private createExternalProject; private sendProjectTelemetry; @@ -14045,16 +8656,12 @@ declare namespace ts.server { private createConfiguredProject; private updateNonInferredProjectFiles; private updateNonInferredProject; - reloadFileNamesOfConfiguredProject(project: ConfiguredProject): boolean; - reloadConfiguredProject(project: ConfiguredProject): void; private sendConfigFileDiagEvent; private getOrCreateInferredProjectForProjectRootPathIfEnabled; private getOrCreateSingleInferredProjectIfEnabled; private getOrCreateSingleInferredWithoutProjectRoot; private createInferredProject; - getOrCreateScriptInfoNotOpenedByClient(uncheckedFileName: string, currentDirectory: string, hostToQueryFileExistsOn: DirectoryStructureHost): ScriptInfo | undefined; getScriptInfo(uncheckedFileName: string): ScriptInfo | undefined; - getSymlinkedProjects(info: ScriptInfo): MultiMap | undefined; private watchClosedScriptInfo; private stopWatchingScriptInfo; private getOrCreateScriptInfoNotOpenedByClientForNormalizedPath; @@ -14063,32 +8670,58 @@ declare namespace ts.server { fileExists(path: string): boolean; }): ScriptInfo | undefined; private getOrCreateScriptInfoWorker; + /** + * This gets the script info for the normalized path. If the path is not rooted disk path then the open script info with project root context is preferred + */ getScriptInfoForNormalizedPath(fileName: NormalizedPath): ScriptInfo | undefined; getScriptInfoForPath(fileName: Path): ScriptInfo | undefined; setHostConfiguration(args: protocol.ConfigureRequestArguments): void; closeLog(): void; + /** + * This function rebuilds the project for every file opened by the client + * This does not reload contents of open files from disk. But we could do that if needed + */ reloadProjects(): void; private delayReloadConfiguredProjectForFiles; + /** + * This function goes through all the openFiles and tries to file the config file for them. + * If the config file is found and it refers to existing project, it reloads it either immediately + * or schedules it for reload depending on delayReload option + * If the there is no existing project it just opens the configured project for the config file + * reloadForInfo provides a way to filter out files to reload configured project for + */ private reloadConfiguredProjectForFiles; + /** + * Remove the root of inferred project if script info is part of another project + */ private removeRootOfInferredProjectIfNowPartOfOtherProject; + /** + * This function is to update the project structure for every inferred project. + * It is called on the premise that all the configured projects are + * up to date. + * This will go through open files and assign them to inferred project if open file is not part of any other project + * After that all the inferred project graphs are updated + */ private ensureProjectForOpenFiles; + /** + * Open file whose contents is managed by the client + * @param filename is absolute pathname + * @param fileContent is a known version of the file content that is more up to date than the one on disk + */ openClientFile(fileName: string, fileContent?: string, scriptKind?: ScriptKind, projectRootPath?: string): OpenConfiguredProjectResult; - getProjectForFileWithoutOpening(fileName: NormalizedPath): { - readonly scriptInfo: ScriptInfo; - readonly projects: ReadonlyArray; - } | undefined; - fileExists(fileName: NormalizedPath): boolean; private findExternalProjectContainingOpenScriptInfo; openClientFileWithNormalizedPath(fileName: NormalizedPath, fileContent?: string, scriptKind?: ScriptKind, hasMixedContent?: boolean, projectRootPath?: NormalizedPath): OpenConfiguredProjectResult; private telemetryOnOpenFile; + /** + * Close file whose contents is managed by the client + * @param filename is absolute pathname + */ closeClientFile(uncheckedFileName: string): void; private collectChanges; - synchronizeProjectList(knownProjects: protocol.ProjectVersionInfo[]): ProjectFilesWithTSDiagnostics[]; - applyChangesInOpenFiles(openFiles: protocol.ExternalFile[] | undefined, changedFiles: protocol.ChangedOpenFile[] | undefined, closedFiles: string[] | undefined): void; - applyChangesToFile(scriptInfo: ScriptInfo, changes: TextChange[]): void; private closeConfiguredProjectReferencedFromExternalProject; closeExternalProject(uncheckedFileName: string): void; openExternalProjects(projects: protocol.ExternalProject[]): void; + /** Makes a filename safe to insert in a RegExp */ private static readonly filenameEscapeRegexp; private static escapeFilenameForRegex; resetSafeList(): void; @@ -14114,7 +8747,6 @@ declare namespace ts.server { interface EventSender { event: Event; } - function toEvent(eventName: string, body: object): protocol.Event; interface SessionOptions { host: ServerHost; cancellationToken: ServerCancellationToken; @@ -14124,8 +8756,12 @@ declare namespace ts.server { byteLength: (buf: string, encoding?: string) => number; hrtime: (start?: number[]) => number[]; logger: Logger; + /** + * If falsy, all events are suppressed. + */ canUseEvents: boolean; eventHandler?: ProjectServiceEventHandler; + /** Has no effect if eventHandler is also specified. */ suppressDiagnosticEvents?: boolean; syntaxOnly?: boolean; throttleWaitMilliseconds?: number; @@ -14157,12 +8793,14 @@ declare namespace ts.server { logError(err: Error, cmd: string): void; send(msg: protocol.Message): void; event(body: T, eventName: string): void; + /** @deprecated */ output(info: any, cmdName: string, reqSeq?: number, errorMsg?: string): void; private doOutput; private semanticCheck; private syntacticCheck; private suggestionCheck; private sendDiagnosticsEvent; + /** It is the caller's responsibility to verify that `!this.suppressDiagnosticEvents`. */ private updateErrorCheck; private cleanProjects; private cleanup; @@ -14200,6 +8838,10 @@ declare namespace ts.server { private static mapRenameInfo; private toSpanGroups; private getReferences; + /** + * @param fileName is the name of the file to be opened + * @param fileContent is a version of the file content that is known to be more up to date than the one on disk + */ private openClientFile; private getPosition; private getPositionInFile; @@ -14253,6 +8895,8 @@ declare namespace ts.server { private mapCodeFixAction; private mapTextChangesToCodeEdits; private mapTextChangeToCodeEdit; + private mapTextChangeToCodeEditUsingScriptInfo; + private normalizePath; private convertTextChangeToCodeEdit; private getBraceMatching; private getDiagnosticsForProject; @@ -14276,110 +8920,7 @@ declare namespace ts.server { response?: {}; responseRequired?: boolean; } - function getLocationInNewDocument(oldText: string, renameFilename: string, renameLocation: number, edits: ReadonlyArray): protocol.Location; -} -declare namespace ts.server { - interface LineCollection { - charCount(): number; - lineCount(): number; - isLeaf(): this is LineLeaf; - walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void; - } - interface AbsolutePositionAndLineText { - absolutePosition: number; - lineText: string | undefined; - } - enum CharRangeSection { - PreStart = 0, - Start = 1, - Entire = 2, - Mid = 3, - End = 4, - PostEnd = 5 - } - interface LineIndexWalker { - goSubtree: boolean; - done: boolean; - leaf(relativeStart: number, relativeLength: number, lineCollection: LineLeaf): void; - pre?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void; - post?(relativeStart: number, relativeLength: number, lineCollection: LineCollection, parent: LineNode, nodeType: CharRangeSection): void; - } - class ScriptVersionCache { - private changes; - private readonly versions; - private minVersion; - private currentVersion; - private static readonly changeNumberThreshold; - private static readonly changeLengthThreshold; - private static readonly maxVersions; - private versionToIndex; - private currentVersionToIndex; - edit(pos: number, deleteLen: number, insertedText?: string): void; - getSnapshot(): IScriptSnapshot; - private _getSnapshot; - getSnapshotVersion(): number; - getLineInfo(line: number): AbsolutePositionAndLineText; - lineOffsetToPosition(line: number, column: number): number; - positionToLineOffset(position: number): protocol.Location; - lineToTextSpan(line: number): TextSpan; - getTextChangesBetweenVersions(oldVersion: number, newVersion: number): TextChangeRange | undefined; - static fromString(script: string): ScriptVersionCache; - } - class LineIndex { - root: LineNode; - checkEdits: boolean; - absolutePositionOfStartOfLine(oneBasedLine: number): number; - positionToLineOffset(position: number): protocol.Location; - private positionToColumnAndLineText; - lineNumberToInfo(oneBasedLine: number): AbsolutePositionAndLineText; - load(lines: string[]): void; - walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void; - getText(rangeStart: number, rangeLength: number): string; - getLength(): number; - every(f: (ll: LineLeaf, s: number, len: number) => boolean, rangeStart: number, rangeEnd?: number): boolean; - edit(pos: number, deleteLength: number, newText?: string): LineIndex; - private static buildTreeFromBottom; - static linesFromText(text: string): { - lines: string[]; - lineMap: number[]; - }; - } - class LineNode implements LineCollection { - private readonly children; - totalChars: number; - totalLines: number; - constructor(children?: LineCollection[]); - isLeaf(): boolean; - updateCounts(): void; - private execWalk; - private skipChild; - walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void; - charOffsetToLineInfo(lineNumberAccumulator: number, relativePosition: number): { - oneBasedLine: number; - zeroBasedColumn: number; - lineText: string | undefined; - }; - lineNumberToInfo(relativeOneBasedLine: number, positionAccumulator: number): { - position: number; - leaf: LineLeaf | undefined; - }; - private splitAfter; - remove(child: LineCollection): void; - private findChildIndex; - insertAt(child: LineCollection, nodes: LineCollection[]): LineNode[]; - add(collection: LineCollection): void; - charCount(): number; - lineCount(): number; - } - class LineLeaf implements LineCollection { - text: string; - constructor(text: string); - isLeaf(): boolean; - walk(rangeStart: number, rangeLength: number, walkFns: LineIndexWalker): void; - charCount(): number; - lineCount(): number; - } } -//# sourceMappingURL=server.d.ts.map + export = ts; export as namespace ts; \ No newline at end of file diff --git a/tests/baselines/reference/api/typescript.d.ts b/tests/baselines/reference/api/typescript.d.ts index f20c70e009586..7258bfe5c9b7b 100644 --- a/tests/baselines/reference/api/typescript.d.ts +++ b/tests/baselines/reference/api/typescript.d.ts @@ -1,3 +1,18 @@ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ + declare namespace ts { const versionMajorMinor = "3.0"; /** The version of the TypeScript compiler release */ @@ -1918,9 +1933,6 @@ declare namespace ts { getAmbientModules(): Symbol[]; tryGetMemberInModuleExports(memberName: string, moduleSymbol: Symbol): Symbol | undefined; getApparentType(type: Type): Type; - getSuggestionForNonexistentProperty(name: Identifier | string, containingType: Type): string | undefined; - getSuggestionForNonexistentSymbol(location: Node, name: string, meaning: SymbolFlags): string | undefined; - getSuggestionForNonexistentModule(node: Identifier, target: Symbol): string | undefined; getBaseConstraintOfType(type: Type): Type | undefined; getDefaultFromTypeParameter(type: Type): Type | undefined; /** @@ -3227,16 +3239,21 @@ declare namespace ts { */ function getJSDocType(node: Node): TypeNode | undefined; /** - * Gets the return type node for the node if provided via JSDoc's return tag. + * Gets the return type node for the node if provided via JSDoc return tag or type tag. * * @remarks `getJSDocReturnTag` just gets the whole JSDoc tag. This function - * gets the type from inside the braces. + * gets the type from inside the braces, after the fat arrow, etc. */ function getJSDocReturnType(node: Node): TypeNode | undefined; /** Get all JSDoc tags related to a node, including those on parent nodes. */ function getJSDocTags(node: Node): ReadonlyArray; /** Gets all JSDoc tags of a specified kind, or undefined if not present. */ function getAllJSDocTagsOfKind(node: Node, kind: SyntaxKind): ReadonlyArray; + /** + * Gets the effective type parameters. If the node was parsed in a + * JavaScript file, gets the type parameters from the `@template` tag from JSDoc. + */ + function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): ReadonlyArray; } declare namespace ts { function isNumericLiteral(node: Node): node is NumericLiteral; @@ -4565,6 +4582,80 @@ declare namespace ts { function getAllProjectOutputs(project: ParsedCommandLine): ReadonlyArray; function formatUpToDateStatus(configFileName: string, status: UpToDateStatus, relName: (fileName: string) => string, formatMessage: (message: DiagnosticMessage, ...args: string[]) => T): T | undefined; } +declare namespace ts.server { + type ActionSet = "action::set"; + type ActionInvalidate = "action::invalidate"; + type ActionPackageInstalled = "action::packageInstalled"; + type EventTypesRegistry = "event::typesRegistry"; + type EventBeginInstallTypes = "event::beginInstallTypes"; + type EventEndInstallTypes = "event::endInstallTypes"; + type EventInitializationFailed = "event::initializationFailed"; + interface SortedReadonlyArray extends ReadonlyArray { + " __sortedArrayBrand": any; + } + interface TypingInstallerResponse { + readonly kind: ActionSet | ActionInvalidate | EventTypesRegistry | ActionPackageInstalled | EventBeginInstallTypes | EventEndInstallTypes | EventInitializationFailed; + } + interface TypingInstallerRequestWithProjectName { + readonly projectName: string; + } + interface DiscoverTypings extends TypingInstallerRequestWithProjectName { + readonly fileNames: string[]; + readonly projectRootPath: Path; + readonly compilerOptions: CompilerOptions; + readonly typeAcquisition: TypeAcquisition; + readonly unresolvedImports: SortedReadonlyArray; + readonly cachePath?: string; + readonly kind: "discover"; + } + interface CloseProject extends TypingInstallerRequestWithProjectName { + readonly kind: "closeProject"; + } + interface TypesRegistryRequest { + readonly kind: "typesRegistry"; + } + interface InstallPackageRequest extends TypingInstallerRequestWithProjectName { + readonly kind: "installPackage"; + readonly fileName: Path; + readonly packageName: string; + readonly projectRootPath: Path; + } + interface PackageInstalledResponse extends ProjectResponse { + readonly kind: ActionPackageInstalled; + readonly success: boolean; + readonly message: string; + } + interface InitializationFailedResponse extends TypingInstallerResponse { + readonly kind: EventInitializationFailed; + readonly message: string; + } + interface ProjectResponse extends TypingInstallerResponse { + readonly projectName: string; + } + interface InvalidateCachedTypings extends ProjectResponse { + readonly kind: ActionInvalidate; + } + interface InstallTypes extends ProjectResponse { + readonly kind: EventBeginInstallTypes | EventEndInstallTypes; + readonly eventId: number; + readonly typingsInstallerVersion: string; + readonly packagesToInstall: ReadonlyArray; + } + interface BeginInstallTypes extends InstallTypes { + readonly kind: EventBeginInstallTypes; + } + interface EndInstallTypes extends InstallTypes { + readonly kind: EventEndInstallTypes; + readonly installSuccess: boolean; + } + interface SetTypings extends ProjectResponse { + readonly typeAcquisition: TypeAcquisition; + readonly compilerOptions: CompilerOptions; + readonly typings: string[]; + readonly unresolvedImports: SortedReadonlyArray; + readonly kind: ActionSet; + } +} declare namespace ts { interface Node { getSourceFile(): SourceFile; @@ -5569,5 +5660,5 @@ declare namespace ts { */ function transform(source: T | T[], transformers: TransformerFactory[], compilerOptions?: CompilerOptions): TransformationResult; } -//# sourceMappingURL=typescriptServices.d.ts.map -export = ts \ No newline at end of file + +export = ts; \ No newline at end of file diff --git a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt index ff79716cab832..1c100d66d9a68 100644 --- a/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt +++ b/tests/baselines/reference/assignmentRestElementWithErrorSourceType.errors.txt @@ -8,4 +8,5 @@ tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts(2,10): error TS ~ !!! error TS2304: Cannot find name 'c'. ~~~~~ -!!! error TS2552: Cannot find name 'tupel'. Did you mean 'tuple'? \ No newline at end of file +!!! error TS2552: Cannot find name 'tupel'. Did you mean 'tuple'? +!!! related TS2728 tests/cases/compiler/assignmentRestElementWithErrorSourceType.ts:1:5: 'tuple' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/baseCheck.errors.txt b/tests/baselines/reference/baseCheck.errors.txt index 0ae410d4e3485..ca99ca426fcca 100644 --- a/tests/baselines/reference/baseCheck.errors.txt +++ b/tests/baselines/reference/baseCheck.errors.txt @@ -21,6 +21,7 @@ tests/cases/compiler/baseCheck.ts(26,9): error TS2304: Cannot find name 'x'. super(0, loc); ~~~ !!! error TS2552: Cannot find name 'loc'. Did you mean 'ELoc'? +!!! related TS2728 tests/cases/compiler/baseCheck.ts:2:7: 'ELoc' is declared here. } m() { diff --git a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.errors.txt b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.errors.txt index 3179710b21b86..042f5e6de4fc7 100644 --- a/tests/baselines/reference/blockScopedBindingUsedBeforeDef.errors.txt +++ b/tests/baselines/reference/blockScopedBindingUsedBeforeDef.errors.txt @@ -8,16 +8,16 @@ tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts(8,7): error TS2448: Bloc for (let {[a]: a} of [{ }]) continue; ~ !!! error TS2448: Block-scoped variable 'a' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:2:16: 'a' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:2:16: 'a' is declared here. // 2: for (let {[a]: a} = { }; false; ) continue; ~ !!! error TS2448: Block-scoped variable 'a' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:5:16: 'a' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:5:16: 'a' is declared here. // 3: let {[b]: b} = { }; ~ !!! error TS2448: Block-scoped variable 'b' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:8:11: 'b' was declared here. \ No newline at end of file +!!! related TS2728 tests/cases/compiler/blockScopedBindingUsedBeforeDef.ts:8:11: 'b' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/blockScopedVariablesUseBeforeDef.errors.txt b/tests/baselines/reference/blockScopedVariablesUseBeforeDef.errors.txt index cc526c2c2f2a5..4de97fa02a420 100644 --- a/tests/baselines/reference/blockScopedVariablesUseBeforeDef.errors.txt +++ b/tests/baselines/reference/blockScopedVariablesUseBeforeDef.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(100,12): error TS2448: let a = x; ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:3:9: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:3:9: 'x' is declared here. let x; } @@ -68,7 +68,7 @@ tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(100,12): error TS2448: static a = x; ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:60:9: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:60:9: 'x' is declared here. } let x; } @@ -78,7 +78,7 @@ tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(100,12): error TS2448: static a = x; ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:67:9: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:67:9: 'x' is declared here. } let x; } @@ -116,7 +116,7 @@ tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts(100,12): error TS2448: a: x ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:102:9: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/blockScopedVariablesUseBeforeDef.ts:102:9: 'x' is declared here. } let x } \ No newline at end of file diff --git a/tests/baselines/reference/cf.errors.txt b/tests/baselines/reference/cf.errors.txt index 8f5f82f816962..910ffe5d88d37 100644 --- a/tests/baselines/reference/cf.errors.txt +++ b/tests/baselines/reference/cf.errors.txt @@ -14,7 +14,7 @@ tests/cases/compiler/cf.ts(36,13): error TS7027: Unreachable code detected. if (y==7) { continue L1; x=11; - ~ + ~~~~~ !!! error TS7027: Unreachable code detected. } if (y==3) { @@ -28,7 +28,7 @@ tests/cases/compiler/cf.ts(36,13): error TS7027: Unreachable code detected. if (y==20) { break; x=12; - ~ + ~~~~~ !!! error TS7027: Unreachable code detected. } } while (y<41); @@ -41,13 +41,13 @@ tests/cases/compiler/cf.ts(36,13): error TS7027: Unreachable code detected. L3: if (xTest : Symbol(Test, Decl(bug25434.js, 0, 0)) +>b : Symbol(b, Decl(bug25434.js, 1, 15)) + +Test(({ b = '5' } = {})); +>Test : Symbol(Test, Decl(bug25434.js, 0, 0)) +>b : Symbol(b, Decl(bug25434.js, 3, 7)) + diff --git a/tests/baselines/reference/checkDestructuringShorthandAssigment.types b/tests/baselines/reference/checkDestructuringShorthandAssigment.types new file mode 100644 index 0000000000000..9eccb886051f3 --- /dev/null +++ b/tests/baselines/reference/checkDestructuringShorthandAssigment.types @@ -0,0 +1,17 @@ +=== tests/cases/compiler/bug25434.js === +// should not crash while checking +function Test({ b = '' } = {}) {} +>Test : ({ b }?: { [x: string]: any; }) => void +>b : string +>'' : "" +>{} : { b?: string; } + +Test(({ b = '5' } = {})); +>Test(({ b = '5' } = {})) : void +>Test : ({ b }?: { [x: string]: any; }) => void +>({ b = '5' } = {}) : { b?: any; } +>{ b = '5' } = {} : { b?: any; } +>{ b = '5' } : { [x: string]: any; b?: any; } +>b : any +>{} : { b?: any; } + diff --git a/tests/baselines/reference/checkJsdocTypeTag5.errors.txt b/tests/baselines/reference/checkJsdocTypeTag5.errors.txt new file mode 100644 index 0000000000000..98510f63815be --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag5.errors.txt @@ -0,0 +1,36 @@ +tests/cases/conformance/jsdoc/test.js(3,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/test.js(5,14): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/test.js(7,24): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/test.js(10,17): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/test.js(12,14): error TS2322: Type 'number' is not assignable to type 'string'. +tests/cases/conformance/jsdoc/test.js(14,24): error TS2322: Type 'number' is not assignable to type 'string'. + + +==== tests/cases/conformance/jsdoc/test.js (6 errors) ==== + // all 6 should error on return statement/expression + /** @type {(x: number) => string} */ + function h(x) { return x } + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + /** @type {(x: number) => string} */ + var f = x => x + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + /** @type {(x: number) => string} */ + var g = function (x) { return x } + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + + /** @type {{ (x: number): string }} */ + function i(x) { return x } + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + /** @type {{ (x: number): string }} */ + var j = x => x + ~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + /** @type {{ (x: number): string }} */ + var k = function (x) { return x } + ~~~~~~~~ +!!! error TS2322: Type 'number' is not assignable to type 'string'. + \ No newline at end of file diff --git a/tests/baselines/reference/checkJsdocTypeTag5.symbols b/tests/baselines/reference/checkJsdocTypeTag5.symbols new file mode 100644 index 0000000000000..839fba179ac1f --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag5.symbols @@ -0,0 +1,38 @@ +=== tests/cases/conformance/jsdoc/test.js === +// all 6 should error on return statement/expression +/** @type {(x: number) => string} */ +function h(x) { return x } +>h : Symbol(h, Decl(test.js, 0, 0)) +>x : Symbol(x, Decl(test.js, 2, 11)) +>x : Symbol(x, Decl(test.js, 2, 11)) + +/** @type {(x: number) => string} */ +var f = x => x +>f : Symbol(f, Decl(test.js, 4, 3)) +>x : Symbol(x, Decl(test.js, 4, 7)) +>x : Symbol(x, Decl(test.js, 4, 7)) + +/** @type {(x: number) => string} */ +var g = function (x) { return x } +>g : Symbol(g, Decl(test.js, 6, 3)) +>x : Symbol(x, Decl(test.js, 6, 18)) +>x : Symbol(x, Decl(test.js, 6, 18)) + +/** @type {{ (x: number): string }} */ +function i(x) { return x } +>i : Symbol(i, Decl(test.js, 6, 33)) +>x : Symbol(x, Decl(test.js, 9, 11)) +>x : Symbol(x, Decl(test.js, 9, 11)) + +/** @type {{ (x: number): string }} */ +var j = x => x +>j : Symbol(j, Decl(test.js, 11, 3)) +>x : Symbol(x, Decl(test.js, 11, 7)) +>x : Symbol(x, Decl(test.js, 11, 7)) + +/** @type {{ (x: number): string }} */ +var k = function (x) { return x } +>k : Symbol(k, Decl(test.js, 13, 3)) +>x : Symbol(x, Decl(test.js, 13, 18)) +>x : Symbol(x, Decl(test.js, 13, 18)) + diff --git a/tests/baselines/reference/checkJsdocTypeTag5.types b/tests/baselines/reference/checkJsdocTypeTag5.types new file mode 100644 index 0000000000000..1038fe0ff3c74 --- /dev/null +++ b/tests/baselines/reference/checkJsdocTypeTag5.types @@ -0,0 +1,42 @@ +=== tests/cases/conformance/jsdoc/test.js === +// all 6 should error on return statement/expression +/** @type {(x: number) => string} */ +function h(x) { return x } +>h : (x: number) => string +>x : number +>x : number + +/** @type {(x: number) => string} */ +var f = x => x +>f : (x: number) => string +>x => x : (x: number) => string +>x : number +>x : number + +/** @type {(x: number) => string} */ +var g = function (x) { return x } +>g : (x: number) => string +>function (x) { return x } : (x: number) => string +>x : number +>x : number + +/** @type {{ (x: number): string }} */ +function i(x) { return x } +>i : (x: number) => string +>x : number +>x : number + +/** @type {{ (x: number): string }} */ +var j = x => x +>j : (x: number) => string +>x => x : (x: number) => string +>x : number +>x : number + +/** @type {{ (x: number): string }} */ +var k = function (x) { return x } +>k : (x: number) => string +>function (x) { return x } : (x: number) => string +>x : number +>x : number + diff --git a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt index 986df05ceb686..4851bc3b4669e 100644 --- a/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt +++ b/tests/baselines/reference/checkJsxChildrenProperty4.errors.txt @@ -32,6 +32,7 @@ tests/cases/conformance/jsx/file.tsx(32,10): error TS2322: Type '{ children: ((u

{ user.NAme }

~~~~ !!! error TS2551: Property 'NAme' does not exist on type 'IUser'. Did you mean 'Name'? +!!! related TS2728 tests/cases/conformance/jsx/file.tsx:4:5: 'Name' is declared here. ) } ); diff --git a/tests/baselines/reference/circularImportAlias.errors.txt b/tests/baselines/reference/circularImportAlias.errors.txt index 5ebf9405e56e4..a2488839b86ac 100644 --- a/tests/baselines/reference/circularImportAlias.errors.txt +++ b/tests/baselines/reference/circularImportAlias.errors.txt @@ -9,7 +9,7 @@ tests/cases/conformance/internalModules/importDeclarations/circularImportAlias.t export class D extends a.C { ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/conformance/internalModules/importDeclarations/circularImportAlias.ts:11:18: 'C' was declared here. +!!! related TS2728 tests/cases/conformance/internalModules/importDeclarations/circularImportAlias.ts:11:18: 'C' is declared here. id: number; } } diff --git a/tests/baselines/reference/classAbstractInstantiations2.errors.txt b/tests/baselines/reference/classAbstractInstantiations2.errors.txt index 5349382940ea4..3d1cb33d483f7 100644 --- a/tests/baselines/reference/classAbstractInstantiations2.errors.txt +++ b/tests/baselines/reference/classAbstractInstantiations2.errors.txt @@ -45,7 +45,7 @@ tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbst var x : any = C; ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts:26:7: 'C' was declared here. +!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classAbstractKeyword/classAbstractInstantiations2.ts:26:7: 'C' is declared here. new x; // okay -- undefined behavior at runtime class C extends B { } // error -- not declared abstract diff --git a/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.errors.txt b/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.errors.txt index 3c3f0ad3fb314..a14d755b6ad28 100644 --- a/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.errors.txt +++ b/tests/baselines/reference/classDeclarationShouldBeOutOfScopeInComputedNames.errors.txt @@ -12,18 +12,18 @@ tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts(8,6): static readonly [A.p1] = 0; ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' is declared here. static [A.p2]() { return 0 }; ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' is declared here. [A.p1]() { } ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' is declared here. [A.p2] = 0 ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classDeclarationShouldBeOutOfScopeInComputedNames.ts:1:7: 'A' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt index 908b8feffc3be..0f4def9826ced 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly.errors.txt @@ -14,7 +14,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'E' used before its declaration. -!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts:5:7: 'E' was declared here. +!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts:5:7: 'E' is declared here. class D extends C { bar: string; } ~ @@ -29,7 +29,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression. ~~ !!! error TS2449: Class 'E2' used before its declaration. -!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts:11:7: 'E2' was declared here. +!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly.ts:11:7: 'E2' is declared here. class D2 extends C2 { bar: T; } ~~ diff --git a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt index 8fabd5364b74f..3b5d16fa64fcf 100644 --- a/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt +++ b/tests/baselines/reference/classExtendsItselfIndirectly2.errors.txt @@ -14,7 +14,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'E' used before its declaration. -!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts:9:18: 'E' was declared here. +!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts:9:18: 'E' is declared here. module M { export class D extends C { bar: string; } @@ -35,7 +35,7 @@ tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/cla !!! error TS2506: 'C2' is referenced directly or indirectly in its own base expression. ~~ !!! error TS2449: Class 'E2' used before its declaration. -!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts:20:22: 'E2' was declared here. +!!! related TS2728 tests/cases/conformance/classes/classDeclarations/classHeritageSpecification/classExtendsItselfIndirectly2.ts:20:22: 'E2' is declared here. module P { export class D2 extends C2 { bar: T; } diff --git a/tests/baselines/reference/classInheritence.errors.txt b/tests/baselines/reference/classInheritence.errors.txt index b5231b768a930..338fcd16393b5 100644 --- a/tests/baselines/reference/classInheritence.errors.txt +++ b/tests/baselines/reference/classInheritence.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/classInheritence.ts(2,7): error TS2506: 'A' is referenced d class B extends A { } ~ !!! error TS2449: Class 'A' used before its declaration. -!!! related TS2728 tests/cases/compiler/classInheritence.ts:2:7: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classInheritence.ts:2:7: 'A' is declared here. class A extends A { } ~ !!! error TS2506: 'A' is referenced directly or indirectly in its own base expression. \ No newline at end of file diff --git a/tests/baselines/reference/classMergedWithInterfaceMultipleBasesNoError.errors.txt b/tests/baselines/reference/classMergedWithInterfaceMultipleBasesNoError.errors.txt index 95cc59c69f6c8..ce7dfcd7aa7de 100644 --- a/tests/baselines/reference/classMergedWithInterfaceMultipleBasesNoError.errors.txt +++ b/tests/baselines/reference/classMergedWithInterfaceMultipleBasesNoError.errors.txt @@ -12,6 +12,6 @@ tests/cases/compiler/classMergedWithInterfaceMultipleBasesNoError.ts(8,30): erro readonly observer = this.handleIntersection; ~~~~~~~~~~~~~~~~~~ !!! error TS2729: Property 'handleIntersection' is used before its initialization. -!!! related TS2728 tests/cases/compiler/classMergedWithInterfaceMultipleBasesNoError.ts:9:14: 'handleIntersection' was declared here. +!!! related TS2728 tests/cases/compiler/classMergedWithInterfaceMultipleBasesNoError.ts:9:14: 'handleIntersection' is declared here. readonly handleIntersection = () => { } } \ No newline at end of file diff --git a/tests/baselines/reference/classOrder2.errors.txt b/tests/baselines/reference/classOrder2.errors.txt index 09b8fb47c18f4..229a7e283db94 100644 --- a/tests/baselines/reference/classOrder2.errors.txt +++ b/tests/baselines/reference/classOrder2.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/classOrder2.ts(1,17): error TS2449: Class 'B' used before i class A extends B { ~ !!! error TS2449: Class 'B' used before its declaration. -!!! related TS2728 tests/cases/compiler/classOrder2.ts:7:7: 'B' was declared here. +!!! related TS2728 tests/cases/compiler/classOrder2.ts:7:7: 'B' is declared here. foo() { this.bar(); } diff --git a/tests/baselines/reference/classSideInheritance2.errors.txt b/tests/baselines/reference/classSideInheritance2.errors.txt index 88ad429e2eccd..2ec59a360a9ba 100644 --- a/tests/baselines/reference/classSideInheritance2.errors.txt +++ b/tests/baselines/reference/classSideInheritance2.errors.txt @@ -11,7 +11,7 @@ tests/cases/compiler/classSideInheritance2.ts(7,23): error TS2449: Class 'TextBa class SubText extends TextBase { ~~~~~~~~ !!! error TS2449: Class 'TextBase' used before its declaration. -!!! related TS2728 tests/cases/compiler/classSideInheritance2.ts:14:7: 'TextBase' was declared here. +!!! related TS2728 tests/cases/compiler/classSideInheritance2.ts:14:7: 'TextBase' is declared here. constructor(text: IText, span: TextSpan) { super(); diff --git a/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.errors.txt b/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.errors.txt index 6769f633d3018..2a67cec6f87b3 100644 --- a/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.errors.txt +++ b/tests/baselines/reference/classStaticInitializersUsePropertiesBeforeDeclaration.errors.txt @@ -10,21 +10,21 @@ tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts(4, static enumMember = Enum.A; ~~~~ !!! error TS2450: Enum 'Enum' used before its declaration. -!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:7:6: 'Enum' was declared here. +!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:7:6: 'Enum' is declared here. ~ !!! error TS2729: Property 'A' is used before its initialization. -!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:8:5: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:8:5: 'A' is declared here. static objLiteralMember = ObjLiteral.A; ~~~~~~~~~~ !!! error TS2448: Block-scoped variable 'ObjLiteral' used before its declaration. -!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:11:7: 'ObjLiteral' was declared here. +!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:11:7: 'ObjLiteral' is declared here. ~ !!! error TS2729: Property 'A' is used before its initialization. -!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:12:5: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:12:5: 'A' is declared here. static namespaceMember = Namespace.A; ~ !!! error TS2729: Property 'A' is used before its initialization. -!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:16:16: 'A' was declared here. +!!! related TS2728 tests/cases/compiler/classStaticInitializersUsePropertiesBeforeDeclaration.ts:16:16: 'A' is declared here. } enum Enum { diff --git a/tests/baselines/reference/complexClassRelationships.errors.txt b/tests/baselines/reference/complexClassRelationships.errors.txt index 90a6ae0a8beca..e7de3a0859008 100644 --- a/tests/baselines/reference/complexClassRelationships.errors.txt +++ b/tests/baselines/reference/complexClassRelationships.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/complexClassRelationships.ts(2,23): error TS2449: Class 'Ba class Derived extends Base { ~~~~ !!! error TS2449: Class 'Base' used before its declaration. -!!! related TS2728 tests/cases/compiler/complexClassRelationships.ts:13:7: 'Base' was declared here. +!!! related TS2728 tests/cases/compiler/complexClassRelationships.ts:13:7: 'Base' is declared here. public static createEmpty(): Derived { var item = new Derived(); return item; diff --git a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.errors.txt b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.errors.txt index 93edb2d90c04c..34eee4d30b524 100644 --- a/tests/baselines/reference/computedPropertyNamesWithStaticProperty.errors.txt +++ b/tests/baselines/reference/computedPropertyNamesWithStaticProperty.errors.txt @@ -9,17 +9,17 @@ tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticPr get [C.staticProp]() { ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' was declared here. +!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' is declared here. return "hello"; } set [C.staticProp](x: string) { ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' was declared here. +!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' is declared here. var y = x; } [C.staticProp]() { } ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' was declared here. +!!! related TS2728 tests/cases/conformance/es6/computedProperties/computedPropertyNamesWithStaticProperty.ts:1:7: 'C' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt b/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt index 670ef38c91dac..242bb75f503ab 100644 --- a/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/constDeclarations-useBeforeDefinition.ts(8,5): error TS2448 c1; ~~ !!! error TS2448: Block-scoped variable 'c1' used before its declaration. -!!! related TS2728 tests/cases/compiler/constDeclarations-useBeforeDefinition.ts:3:11: 'c1' was declared here. +!!! related TS2728 tests/cases/compiler/constDeclarations-useBeforeDefinition.ts:3:11: 'c1' is declared here. const c1 = 0; } @@ -16,7 +16,7 @@ tests/cases/compiler/constDeclarations-useBeforeDefinition.ts(8,5): error TS2448 v1; ~~ !!! error TS2448: Block-scoped variable 'v1' used before its declaration. -!!! related TS2728 tests/cases/compiler/constDeclarations-useBeforeDefinition.ts:9:11: 'v1' was declared here. +!!! related TS2728 tests/cases/compiler/constDeclarations-useBeforeDefinition.ts:9:11: 'v1' is declared here. const v1 = 0; } \ No newline at end of file diff --git a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt index df5f88319fd80..930cf63358ead 100644 --- a/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt +++ b/tests/baselines/reference/constDeclarations-useBeforeDefinition2.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/file1.ts(1,1): error TS2448: Block-scoped variable 'c' used c; ~ !!! error TS2448: Block-scoped variable 'c' used before its declaration. -!!! related TS2728 tests/cases/compiler/file2.ts:1:7: 'c' was declared here. +!!! related TS2728 tests/cases/compiler/file2.ts:1:7: 'c' is declared here. ==== tests/cases/compiler/file2.ts (0 errors) ==== const c = 0; \ No newline at end of file diff --git a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt index a55c3af655549..46eaa413c2e8f 100644 --- a/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt +++ b/tests/baselines/reference/constructorWithIncompleteTypeAnnotation.errors.txt @@ -466,6 +466,7 @@ tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts(261,1): error TS return this.method1(2); ~~~~~~~ !!! error TS2551: Property 'method1' does not exist on type 'B'. Did you mean 'method2'? +!!! related TS2728 tests/cases/compiler/constructorWithIncompleteTypeAnnotation.ts:245:16: 'method2' is declared here. } } diff --git a/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.js b/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.js index d3c8f42066610..00d0a831c932b 100644 --- a/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.js +++ b/tests/baselines/reference/decoratorMetadataNoLibIsolatedModulesTypes.js @@ -23,7 +23,7 @@ var B = /** @class */ (function () { var _a; __decorate([ Decorate, - __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" && _a || Object) + __metadata("design:type", typeof (_a = typeof Map !== "undefined" && Map) === "function" ? _a : Object) ], B.prototype, "member"); return B; }()); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js index a20ff821148d5..7d2bf07862d9f 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision4.js @@ -49,7 +49,7 @@ var MyClass = /** @class */ (function () { var _a; MyClass = __decorate([ someDecorator, - __metadata("design:paramtypes", [typeof (_a = (typeof db_1.default !== "undefined" && db_1.default).db) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof db_1.default !== "undefined" && db_1.default.db) === "function" ? _a : Object]) ], MyClass); return MyClass; }()); diff --git a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js index 7acbff2beb7e7..b58f48d03416f 100644 --- a/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js +++ b/tests/baselines/reference/decoratorMetadataWithImportDeclarationNameCollision7.js @@ -49,7 +49,7 @@ var MyClass = /** @class */ (function () { var _a; MyClass = __decorate([ someDecorator, - __metadata("design:paramtypes", [typeof (_a = (typeof db_1.default !== "undefined" && db_1.default).db) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof db_1.default !== "undefined" && db_1.default.db) === "function" ? _a : Object]) ], MyClass); return MyClass; }()); diff --git a/tests/baselines/reference/derivedClasses.errors.txt b/tests/baselines/reference/derivedClasses.errors.txt index 24223a374e2f0..f7bee106d7324 100644 --- a/tests/baselines/reference/derivedClasses.errors.txt +++ b/tests/baselines/reference/derivedClasses.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/derivedClasses.ts(1,19): error TS2449: Class 'Color' used b class Red extends Color { ~~~~~ !!! error TS2449: Class 'Color' used before its declaration. -!!! related TS2728 tests/cases/compiler/derivedClasses.ts:8:7: 'Color' was declared here. +!!! related TS2728 tests/cases/compiler/derivedClasses.ts:8:7: 'Color' is declared here. public shade() { var getHue = () => { return this.hue(); }; return getHue() + " red"; diff --git a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.errors.txt b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.errors.txt index 34fa5c1f72a98..eff1e1a65938b 100644 --- a/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.errors.txt +++ b/tests/baselines/reference/destructuringArrayBindingPatternAndAssignment3.errors.txt @@ -9,11 +9,11 @@ tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAss const [c, d = c, e = e] = [1]; // error for e = e ~ !!! error TS2448: Block-scoped variable 'e' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts:2:18: 'e' was declared here. +!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts:2:18: 'e' is declared here. const [f, g = f, h = i, i = f] = [1]; // error for h = i ~ !!! error TS2448: Block-scoped variable 'i' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts:3:25: 'i' was declared here. +!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringArrayBindingPatternAndAssignment3.ts:3:25: 'i' is declared here. (function ([a, b = a]) { // ok })([1]); diff --git a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.errors.txt b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.errors.txt index db8b13c378611..54930648be93a 100644 --- a/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.errors.txt +++ b/tests/baselines/reference/destructuringObjectBindingPatternAndAssignment4.errors.txt @@ -11,10 +11,10 @@ tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAs e = f, // error ~ !!! error TS2448: Block-scoped variable 'f' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts:7:5: 'f' was declared here. +!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts:7:5: 'f' is declared here. f = f // error ~ !!! error TS2448: Block-scoped variable 'f' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts:7:5: 'f' was declared here. +!!! related TS2728 tests/cases/conformance/es6/destructuring/destructuringObjectBindingPatternAndAssignment4.ts:7:5: 'f' is declared here. } = { } as any; \ No newline at end of file diff --git a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt index 6cd6c92ca62d6..d5a0d34e1a1b4 100644 --- a/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt +++ b/tests/baselines/reference/destructuringParameterDeclaration4.errors.txt @@ -48,6 +48,7 @@ tests/cases/conformance/es6/destructuring/destructuringParameterDeclaration4.ts( a1(...array2); // Error parameter type is (number|string)[] ~~~~~~ !!! error TS2552: Cannot find name 'array2'. Did you mean 'Array'? +!!! related TS2728 /.ts/lib.es5.d.ts:1298:15: 'Array' is declared here. a5([1, 2, "string", false, true]); // Error, parameter type is [any, any, [[any]]] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2345: Argument of type '[number, number, string, boolean, boolean]' is not assignable to parameter of type '[any, any, [[any]]]'. diff --git a/tests/baselines/reference/enumUsedBeforeDeclaration.errors.txt b/tests/baselines/reference/enumUsedBeforeDeclaration.errors.txt index 0eec10329e7b1..599774f05c0de 100644 --- a/tests/baselines/reference/enumUsedBeforeDeclaration.errors.txt +++ b/tests/baselines/reference/enumUsedBeforeDeclaration.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/enumUsedBeforeDeclaration.ts(1,18): error TS2450: Enum 'Col const v: Color = Color.Green; ~~~~~ !!! error TS2450: Enum 'Color' used before its declaration. -!!! related TS2728 tests/cases/compiler/enumUsedBeforeDeclaration.ts:3:6: 'Color' was declared here. +!!! related TS2728 tests/cases/compiler/enumUsedBeforeDeclaration.ts:3:6: 'Color' is declared here. const v2: ConstColor = ConstColor.Green; enum Color { Red, Green, Blue } const enum ConstColor { Red, Green, Blue } diff --git a/tests/baselines/reference/errorElaboration.errors.txt b/tests/baselines/reference/errorElaboration.errors.txt index 94742d7d98bc4..57971cad26912 100644 --- a/tests/baselines/reference/errorElaboration.errors.txt +++ b/tests/baselines/reference/errorElaboration.errors.txt @@ -2,9 +2,10 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type ' Type 'Container>' is not assignable to type 'Container>'. Type 'Ref' is not assignable to type 'Ref'. Type 'string' is not assignable to type 'number'. +tests/cases/compiler/errorElaboration.ts(17,11): error TS2322: Type '"bar"' is not assignable to type '"foo"'. -==== tests/cases/compiler/errorElaboration.ts (1 errors) ==== +==== tests/cases/compiler/errorElaboration.ts (2 errors) ==== // Repro for #5712 interface Ref { @@ -22,4 +23,13 @@ tests/cases/compiler/errorElaboration.ts(12,5): error TS2345: Argument of type ' !!! error TS2345: Type 'Container>' is not assignable to type 'Container>'. !!! error TS2345: Type 'Ref' is not assignable to type 'Ref'. !!! error TS2345: Type 'string' is not assignable to type 'number'. + + // Repro for #25498 + + function test(): {[A in "foo"]: A} { + return {foo: "bar"}; + ~~~ +!!! error TS2322: Type '"bar"' is not assignable to type '"foo"'. +!!! related TS6500 tests/cases/compiler/errorElaboration.ts:16:18: The expected type comes from property 'foo' which is declared here on type '{ foo: "foo"; }' + } \ No newline at end of file diff --git a/tests/baselines/reference/errorElaboration.js b/tests/baselines/reference/errorElaboration.js index eed8bbd7c6b89..c1dd0a470d383 100644 --- a/tests/baselines/reference/errorElaboration.js +++ b/tests/baselines/reference/errorElaboration.js @@ -11,9 +11,19 @@ interface Container { declare function foo(x: () => Container>): void; let a: () => Container>; foo(a); + +// Repro for #25498 + +function test(): {[A in "foo"]: A} { + return {foo: "bar"}; +} //// [errorElaboration.js] // Repro for #5712 var a; foo(a); +// Repro for #25498 +function test() { + return { foo: "bar" }; +} diff --git a/tests/baselines/reference/errorElaboration.symbols b/tests/baselines/reference/errorElaboration.symbols index 72206e3caefe7..839b19c05993e 100644 --- a/tests/baselines/reference/errorElaboration.symbols +++ b/tests/baselines/reference/errorElaboration.symbols @@ -38,3 +38,14 @@ foo(a); >foo : Symbol(foo, Decl(errorElaboration.ts, 8, 1)) >a : Symbol(a, Decl(errorElaboration.ts, 10, 3)) +// Repro for #25498 + +function test(): {[A in "foo"]: A} { +>test : Symbol(test, Decl(errorElaboration.ts, 11, 7)) +>A : Symbol(A, Decl(errorElaboration.ts, 15, 19)) +>A : Symbol(A, Decl(errorElaboration.ts, 15, 19)) + + return {foo: "bar"}; +>foo : Symbol(foo, Decl(errorElaboration.ts, 16, 10)) +} + diff --git a/tests/baselines/reference/errorElaboration.types b/tests/baselines/reference/errorElaboration.types index 96aaba6ce3095..385ab481bb2fb 100644 --- a/tests/baselines/reference/errorElaboration.types +++ b/tests/baselines/reference/errorElaboration.types @@ -39,3 +39,16 @@ foo(a); >foo : (x: () => Container>) => void >a : () => Container> +// Repro for #25498 + +function test(): {[A in "foo"]: A} { +>test : () => { foo: "foo"; } +>A : A +>A : A + + return {foo: "bar"}; +>{foo: "bar"} : { foo: "bar"; } +>foo : "bar" +>"bar" : "bar" +} + diff --git a/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt index 7dffc9053e3cb..fc6b1e8aa18cc 100644 --- a/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt +++ b/tests/baselines/reference/errorMessageOnObjectLiteralType.errors.txt @@ -12,4 +12,5 @@ tests/cases/compiler/errorMessageOnObjectLiteralType.ts(6,8): error TS2551: Prop !!! error TS2339: Property 'getOwnPropertyNamess' does not exist on type '{ a: string; b: number; }'. Object.getOwnPropertyNamess(null); ~~~~~~~~~~~~~~~~~~~~ -!!! error TS2551: Property 'getOwnPropertyNamess' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyNames'? \ No newline at end of file +!!! error TS2551: Property 'getOwnPropertyNamess' does not exist on type 'ObjectConstructor'. Did you mean 'getOwnPropertyNames'? +!!! related TS2728 /.ts/lib.es5.d.ts:179:5: 'getOwnPropertyNames' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/errorWithTruncatedType.errors.txt b/tests/baselines/reference/errorWithTruncatedType.errors.txt index 33714b8626280..2f6e095a042ae 100644 --- a/tests/baselines/reference/errorWithTruncatedType.errors.txt +++ b/tests/baselines/reference/errorWithTruncatedType.errors.txt @@ -1,4 +1,4 @@ -tests/cases/compiler/errorWithTruncatedType.ts(10,5): error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +tests/cases/compiler/errorWithTruncatedType.ts(10,5): error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'. ==== tests/cases/compiler/errorWithTruncatedType.ts (1 errors) ==== @@ -13,5 +13,5 @@ tests/cases/compiler/errorWithTruncatedType.ts(10,5): error TS2322: Type '{ prop // String representation of type of 'x' should be truncated in error message var s: string = x; ~ -!!! error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propert...' is not assignable to type 'string'. +!!! error TS2322: Type '{ propertyWithAnExceedinglyLongName1: string; propertyWithAnExceedinglyLongName2: string; propertyWithAnExceedinglyLongName3: string; propertyWithAnExceedinglyLongName4: string; propertyWithAnExceedinglyLongName5: string; }' is not assignable to type 'string'. \ No newline at end of file diff --git a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.errors.txt b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.errors.txt index ff7872b14b17d..3a8b56fc7e676 100644 --- a/tests/baselines/reference/es5ExportDefaultClassDeclaration3.errors.txt +++ b/tests/baselines/reference/es5ExportDefaultClassDeclaration3.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts(1,21): error TS2449: C var before: C = new C(); ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts:3:22: 'C' was declared here. +!!! related TS2728 tests/cases/compiler/es5ExportDefaultClassDeclaration3.ts:3:22: 'C' is declared here. export default class C { method(): C { diff --git a/tests/baselines/reference/exactSpellingSuggestion.errors.txt b/tests/baselines/reference/exactSpellingSuggestion.errors.txt index dbe611590d4bc..0a36f11f01000 100644 --- a/tests/baselines/reference/exactSpellingSuggestion.errors.txt +++ b/tests/baselines/reference/exactSpellingSuggestion.errors.txt @@ -13,4 +13,5 @@ tests/cases/compiler/exactSpellingSuggestion.ts(9,4): error TS2551: Property 'bi U8.bit_2 ~~~~~ !!! error TS2551: Property 'bit_2' does not exist on type 'typeof U8'. Did you mean 'BIT_2'? +!!! related TS2728 tests/cases/compiler/exactSpellingSuggestion.ts:6:5: 'BIT_2' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.errors.txt b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.errors.txt new file mode 100644 index 0000000000000..556885b52a36a --- /dev/null +++ b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.errors.txt @@ -0,0 +1,22 @@ +tests/cases/compiler/usage.ts(2,8): error TS2304: Cannot find name 'decorate'. +tests/cases/compiler/usage.ts(2,31): error TS2694: Namespace 'A.B.C.D' has no exported member 'E'. + + +==== tests/cases/compiler/types.d.ts (0 errors) ==== + declare namespace A { + export namespace B { + export namespace C { + export namespace D { + } + } + } + } +==== tests/cases/compiler/usage.ts (2 errors) ==== + class Foo { + f(@decorate user: A.B.C.D.E): void {} + ~~~~~~~~ +!!! error TS2304: Cannot find name 'decorate'. + ~ +!!! error TS2694: Namespace 'A.B.C.D' has no exported member 'E'. + } + \ No newline at end of file diff --git a/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.js b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.js new file mode 100644 index 0000000000000..062cc48357008 --- /dev/null +++ b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.js @@ -0,0 +1,43 @@ +//// [tests/cases/compiler/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.ts] //// + +//// [types.d.ts] +declare namespace A { + export namespace B { + export namespace C { + export namespace D { + } + } + } +} +//// [usage.ts] +class Foo { + f(@decorate user: A.B.C.D.E): void {} +} + + +//// [usage.js] +var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { + var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; + if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); + else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; + return c > 3 && r && Object.defineProperty(target, key, r), r; +}; +var __metadata = (this && this.__metadata) || function (k, v) { + if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); +}; +var __param = (this && this.__param) || function (paramIndex, decorator) { + return function (target, key) { decorator(target, key, paramIndex); } +}; +var Foo = /** @class */ (function () { + function Foo() { + } + Foo.prototype.f = function (user) { }; + var _a, _b, _c, _d; + __decorate([ + __param(0, decorate), + __metadata("design:type", Function), + __metadata("design:paramtypes", [typeof (_d = typeof A !== "undefined" && (_a = A.B) !== void 0 && (_b = _a.C) !== void 0 && (_c = _b.D) !== void 0 && _c.E) === "function" ? _d : Object]), + __metadata("design:returntype", void 0) + ], Foo.prototype, "f"); + return Foo; +}()); diff --git a/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.symbols b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.symbols new file mode 100644 index 0000000000000..0076ba5871c25 --- /dev/null +++ b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.symbols @@ -0,0 +1,29 @@ +=== tests/cases/compiler/types.d.ts === +declare namespace A { +>A : Symbol(A, Decl(types.d.ts, 0, 0)) + + export namespace B { +>B : Symbol(B, Decl(types.d.ts, 0, 21)) + + export namespace C { +>C : Symbol(C, Decl(types.d.ts, 1, 24)) + + export namespace D { +>D : Symbol(D, Decl(types.d.ts, 2, 28)) + } + } + } +} +=== tests/cases/compiler/usage.ts === +class Foo { +>Foo : Symbol(Foo, Decl(usage.ts, 0, 0)) + + f(@decorate user: A.B.C.D.E): void {} +>f : Symbol(Foo.f, Decl(usage.ts, 0, 11)) +>user : Symbol(user, Decl(usage.ts, 1, 6)) +>A : Symbol(A, Decl(types.d.ts, 0, 0)) +>B : Symbol(A.B, Decl(types.d.ts, 0, 21)) +>C : Symbol(A.B.C, Decl(types.d.ts, 1, 24)) +>D : Symbol(A.B.C.D, Decl(types.d.ts, 2, 28)) +} + diff --git a/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.types b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.types new file mode 100644 index 0000000000000..22be4d18018e5 --- /dev/null +++ b/tests/baselines/reference/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.types @@ -0,0 +1,31 @@ +=== tests/cases/compiler/types.d.ts === +declare namespace A { +>A : any + + export namespace B { +>B : any + + export namespace C { +>C : any + + export namespace D { +>D : any + } + } + } +} +=== tests/cases/compiler/usage.ts === +class Foo { +>Foo : Foo + + f(@decorate user: A.B.C.D.E): void {} +>f : (user: any) => void +>decorate : any +>user : any +>A : any +>B : any +>C : any +>D : any +>E : No type information available! +} + diff --git a/tests/baselines/reference/exportAssignmentImportMergeNoCrash.errors.txt b/tests/baselines/reference/exportAssignmentImportMergeNoCrash.errors.txt index 9da5aea324e8e..222d52679653b 100644 --- a/tests/baselines/reference/exportAssignmentImportMergeNoCrash.errors.txt +++ b/tests/baselines/reference/exportAssignmentImportMergeNoCrash.errors.txt @@ -21,5 +21,5 @@ tests/cases/compiler/user.ts(3,25): error TS2448: Block-scoped variable 'Obj' us !!! error TS2395: Individual declarations in merged declaration 'Obj' must be all exported or all local. ~~~ !!! error TS2448: Block-scoped variable 'Obj' used before its declaration. -!!! related TS2728 tests/cases/compiler/user.ts:3:14: 'Obj' was declared here. +!!! related TS2728 tests/cases/compiler/user.ts:3:14: 'Obj' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/exportBinding.errors.txt b/tests/baselines/reference/exportBinding.errors.txt index a0942f183d4c7..1225ef3aa1338 100644 --- a/tests/baselines/reference/exportBinding.errors.txt +++ b/tests/baselines/reference/exportBinding.errors.txt @@ -9,7 +9,7 @@ tests/cases/conformance/es6/modules/exportVars.ts(3,16): error TS2454: Variable export default x; ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/modules/exportConsts.ts:5:7: 'x' was declared here. +!!! related TS2728 tests/cases/conformance/es6/modules/exportConsts.ts:5:7: 'x' is declared here. ~ !!! error TS2454: Variable 'x' is used before being assigned. diff --git a/tests/baselines/reference/exportSpellingSuggestion.errors.txt b/tests/baselines/reference/exportSpellingSuggestion.errors.txt index fefae723515a6..cf8011fec458e 100644 --- a/tests/baselines/reference/exportSpellingSuggestion.errors.txt +++ b/tests/baselines/reference/exportSpellingSuggestion.errors.txt @@ -10,4 +10,5 @@ tests/cases/conformance/es6/modules/b.ts(1,10): error TS2724: Module '"tests/cas import { assertNevar } from "./a"; ~~~~~~~~~~~ !!! error TS2724: Module '"tests/cases/conformance/es6/modules/a"' has no exported member 'assertNevar'. Did you mean 'assertNever'? +!!! related TS2728 tests/cases/conformance/es6/modules/a.ts:1:17: 'assertNever' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/exportedBlockScopedDeclarations.errors.txt b/tests/baselines/reference/exportedBlockScopedDeclarations.errors.txt index 3ff26a942efc8..8cdcdd8cc6663 100644 --- a/tests/baselines/reference/exportedBlockScopedDeclarations.errors.txt +++ b/tests/baselines/reference/exportedBlockScopedDeclarations.errors.txt @@ -12,41 +12,41 @@ tests/cases/compiler/exportedBlockScopedDeclarations.ts(16,21): error TS2448: Bl const foo = foo; // compile error ~~~ !!! error TS2448: Block-scoped variable 'foo' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:1:7: 'foo' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:1:7: 'foo' is declared here. export const bar = bar; // should be compile error ~~~ !!! error TS2448: Block-scoped variable 'bar' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:2:14: 'bar' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:2:14: 'bar' is declared here. function f() { const bar = bar; // compile error ~~~ !!! error TS2448: Block-scoped variable 'bar' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:4:9: 'bar' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:4:9: 'bar' is declared here. } namespace NS { export const bar = bar; // should be compile error ~~~ !!! error TS2448: Block-scoped variable 'bar' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:7:16: 'bar' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:7:16: 'bar' is declared here. } let foo1 = foo1; // compile error ~~~~ !!! error TS2448: Block-scoped variable 'foo1' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:10:5: 'foo1' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:10:5: 'foo1' is declared here. export let bar1 = bar1; // should be compile error ~~~~ !!! error TS2448: Block-scoped variable 'bar1' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:11:12: 'bar1' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:11:12: 'bar1' is declared here. function f1() { let bar1 = bar1; // compile error ~~~~ !!! error TS2448: Block-scoped variable 'bar1' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:13:7: 'bar1' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:13:7: 'bar1' is declared here. } namespace NS1 { export let bar1 = bar1; // should be compile error ~~~~ !!! error TS2448: Block-scoped variable 'bar1' used before its declaration. -!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:16:14: 'bar1' was declared here. +!!! related TS2728 tests/cases/compiler/exportedBlockScopedDeclarations.ts:16:14: 'bar1' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.errors.txt b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.errors.txt index a045cfd7d57d8..c4de998333adc 100644 --- a/tests/baselines/reference/extendBaseClassBeforeItsDeclared.errors.txt +++ b/tests/baselines/reference/extendBaseClassBeforeItsDeclared.errors.txt @@ -5,6 +5,6 @@ tests/cases/compiler/extendBaseClassBeforeItsDeclared.ts(1,23): error TS2449: Cl class derived extends base { } ~~~~ !!! error TS2449: Class 'base' used before its declaration. -!!! related TS2728 tests/cases/compiler/extendBaseClassBeforeItsDeclared.ts:3:7: 'base' was declared here. +!!! related TS2728 tests/cases/compiler/extendBaseClassBeforeItsDeclared.ts:3:7: 'base' is declared here. class base { constructor (public n: number) { } } \ No newline at end of file diff --git a/tests/baselines/reference/externModule.errors.txt b/tests/baselines/reference/externModule.errors.txt index d6659c1d548ca..329ef0a8862dc 100644 --- a/tests/baselines/reference/externModule.errors.txt +++ b/tests/baselines/reference/externModule.errors.txt @@ -69,16 +69,20 @@ tests/cases/compiler/externModule.ts(37,3): error TS2552: Cannot find name 'XDat var d=new XDate(); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? +!!! related TS2728 /.ts/lib.es5.d.ts:837:15: 'Date' is declared here. d.getDay(); d=new XDate(1978,2); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? +!!! related TS2728 /.ts/lib.es5.d.ts:837:15: 'Date' is declared here. d.getXDate(); var n=XDate.parse("3/2/2004"); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? +!!! related TS2728 /.ts/lib.es5.d.ts:837:15: 'Date' is declared here. n=XDate.UTC(1964,2,1); ~~~~~ !!! error TS2552: Cannot find name 'XDate'. Did you mean 'Date'? +!!! related TS2728 /.ts/lib.es5.d.ts:837:15: 'Date' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/for-of55.errors.txt b/tests/baselines/reference/for-of55.errors.txt index 8740816cf721a..74d55636bfe8c 100644 --- a/tests/baselines/reference/for-of55.errors.txt +++ b/tests/baselines/reference/for-of55.errors.txt @@ -6,6 +6,6 @@ tests/cases/conformance/es6/for-ofStatements/for-of55.ts(2,15): error TS2448: Bl for (let v of v) { ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/for-ofStatements/for-of55.ts:2:10: 'v' was declared here. +!!! related TS2728 tests/cases/conformance/es6/for-ofStatements/for-of55.ts:2:10: 'v' is declared here. v; } \ No newline at end of file diff --git a/tests/baselines/reference/forwardRefInClassProperties.errors.txt b/tests/baselines/reference/forwardRefInClassProperties.errors.txt index 36dfec764691a..1958791804eba 100644 --- a/tests/baselines/reference/forwardRefInClassProperties.errors.txt +++ b/tests/baselines/reference/forwardRefInClassProperties.errors.txt @@ -9,13 +9,13 @@ tests/cases/compiler/forwardRefInClassProperties.ts(11,17): error TS2448: Block- _b = this._a; // undefined, no error/warning ~~ !!! error TS2729: Property '_a' is used before its initialization. -!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:4:5: '_a' was declared here. +!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:4:5: '_a' is declared here. _a = 3; static _B = Test._A; // undefined, no error/warning ~~ !!! error TS2729: Property '_A' is used before its initialization. -!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:7:12: '_A' was declared here. +!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:7:12: '_A' is declared here. static _A = 3; method() @@ -23,7 +23,7 @@ tests/cases/compiler/forwardRefInClassProperties.ts(11,17): error TS2448: Block- let a = b; // Property 'b' is used before its initialization. ~ !!! error TS2448: Block-scoped variable 'b' used before its declaration. -!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:12:13: 'b' was declared here. +!!! related TS2728 tests/cases/compiler/forwardRefInClassProperties.ts:12:13: 'b' is declared here. let b = 3; } } diff --git a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.errors.txt b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.errors.txt index fe52ced70f287..d11f49bbec9e2 100644 --- a/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.errors.txt +++ b/tests/baselines/reference/genericClassInheritsConstructorFromNonGenericClass.errors.txt @@ -6,11 +6,11 @@ tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts(2,20) class A extends B { } ~ !!! error TS2449: Class 'B' used before its declaration. -!!! related TS2728 tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts:2:7: 'B' was declared here. +!!! related TS2728 tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts:2:7: 'B' is declared here. class B extends C { } ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts:3:7: 'C' was declared here. +!!! related TS2728 tests/cases/compiler/genericClassInheritsConstructorFromNonGenericClass.ts:3:7: 'C' is declared here. class C { constructor(p: string) { } } \ No newline at end of file diff --git a/tests/baselines/reference/indexedAccessImplicitlyAny.errors.txt b/tests/baselines/reference/indexedAccessImplicitlyAny.errors.txt index ae950b5e69c35..70901726b6732 100644 --- a/tests/baselines/reference/indexedAccessImplicitlyAny.errors.txt +++ b/tests/baselines/reference/indexedAccessImplicitlyAny.errors.txt @@ -8,6 +8,7 @@ tests/cases/compiler/indexedAccessImplicitlyAny.ts(4,3): error TS2551: Property i.foo; ~~~ !!! error TS2551: Property 'foo' does not exist on type 'I'. Did you mean 'foof'? +!!! related TS2728 tests/cases/compiler/indexedAccessImplicitlyAny.ts:1:15: 'foof' is declared here. i["foo"]; ~~~~~ !!! error TS2551: Property 'foo' does not exist on type 'I'. Did you mean 'foof'? \ No newline at end of file diff --git a/tests/baselines/reference/indirectSelfReference.errors.txt b/tests/baselines/reference/indirectSelfReference.errors.txt index 5d07a19d8498c..45ed557244a84 100644 --- a/tests/baselines/reference/indirectSelfReference.errors.txt +++ b/tests/baselines/reference/indirectSelfReference.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/indirectSelfReference.ts(2,7): error TS2506: 'b' is referen !!! error TS2506: 'a' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'b' used before its declaration. -!!! related TS2728 tests/cases/compiler/indirectSelfReference.ts:2:7: 'b' was declared here. +!!! related TS2728 tests/cases/compiler/indirectSelfReference.ts:2:7: 'b' is declared here. class b extends a{ } ~ !!! error TS2506: 'b' is referenced directly or indirectly in its own base expression. \ No newline at end of file diff --git a/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt index 5faf3dd83ccc1..db0c5d8c97587 100644 --- a/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt +++ b/tests/baselines/reference/indirectSelfReferenceGeneric.errors.txt @@ -9,7 +9,7 @@ tests/cases/compiler/indirectSelfReferenceGeneric.ts(2,7): error TS2506: 'b' is !!! error TS2506: 'a' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'b' used before its declaration. -!!! related TS2728 tests/cases/compiler/indirectSelfReferenceGeneric.ts:2:7: 'b' was declared here. +!!! related TS2728 tests/cases/compiler/indirectSelfReferenceGeneric.ts:2:7: 'b' is declared here. class b extends a { } ~ !!! error TS2506: 'b' is referenced directly or indirectly in its own base expression. \ No newline at end of file diff --git a/tests/baselines/reference/invalidTypeOfTarget.errors.txt b/tests/baselines/reference/invalidTypeOfTarget.errors.txt index 04bf724e4b968..b6da9a1eb7767 100644 --- a/tests/baselines/reference/invalidTypeOfTarget.errors.txt +++ b/tests/baselines/reference/invalidTypeOfTarget.errors.txt @@ -36,6 +36,7 @@ tests/cases/conformance/types/specifyingTypes/typeQueries/invalidTypeOfTarget.ts var x7: typeof function f() { }; ~~~~~~~~ !!! error TS2552: Cannot find name 'function'. Did you mean 'Function'? +!!! related TS2728 /.ts/lib.es5.d.ts:316:15: 'Function' is declared here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/iterableArrayPattern16.errors.txt b/tests/baselines/reference/iterableArrayPattern16.errors.txt index 35b1be637d51e..b07d8c976a506 100644 --- a/tests/baselines/reference/iterableArrayPattern16.errors.txt +++ b/tests/baselines/reference/iterableArrayPattern16.errors.txt @@ -14,7 +14,7 @@ tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts(2,12): error !!! error TS2345: Property '0' is missing in type 'FooIterator'. ~~~~~~~~~~~~~~~~~~~ !!! error TS2449: Class 'FooIteratorIterator' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts:18:7: 'FooIteratorIterator' was declared here. +!!! related TS2728 tests/cases/conformance/es6/destructuring/iterableArrayPattern16.ts:18:7: 'FooIteratorIterator' is declared here. class Bar { x } class Foo extends Bar { y } class FooIterator { diff --git a/tests/baselines/reference/jsFileCompilationBindErrors.errors.txt b/tests/baselines/reference/jsFileCompilationBindErrors.errors.txt index eeae7053333ed..64bd79d7fd970 100644 --- a/tests/baselines/reference/jsFileCompilationBindErrors.errors.txt +++ b/tests/baselines/reference/jsFileCompilationBindErrors.errors.txt @@ -15,7 +15,7 @@ tests/cases/compiler/a.js(11,9): error TS1100: Invalid use of 'arguments' in str function f() { return; return; // Error: Unreachable code detected. - ~~~~~~ + ~~~~~~~ !!! error TS7027: Unreachable code detected. } diff --git a/tests/baselines/reference/jsFileCompilationBindReachabilityErrors.errors.txt b/tests/baselines/reference/jsFileCompilationBindReachabilityErrors.errors.txt index a883e66e6072f..c2c572aa3042b 100644 --- a/tests/baselines/reference/jsFileCompilationBindReachabilityErrors.errors.txt +++ b/tests/baselines/reference/jsFileCompilationBindReachabilityErrors.errors.txt @@ -22,7 +22,7 @@ tests/cases/compiler/a.js(19,1): error TS7028: Unused label. function bar2() { } var x = 10; // error - ~~~ + ~~~~~~~~~~~ !!! error TS7027: Unreachable code detected. } diff --git a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt index d1a6361986d29..6fc8df185006c 100644 --- a/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt +++ b/tests/baselines/reference/jsFileCompilationLetDeclarationOrder2.errors.txt @@ -8,7 +8,7 @@ tests/cases/compiler/a.ts(2,1): error TS2448: Block-scoped variable 'a' used bef a = 10; ~ !!! error TS2448: Block-scoped variable 'a' used before its declaration. -!!! related TS2728 tests/cases/compiler/b.js:1:5: 'a' was declared here. +!!! related TS2728 tests/cases/compiler/b.js:1:5: 'a' is declared here. ==== tests/cases/compiler/b.js (0 errors) ==== let a = 10; b = 30; diff --git a/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.symbols b/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.symbols new file mode 100644 index 0000000000000..798c892f5206c --- /dev/null +++ b/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.symbols @@ -0,0 +1,9 @@ +=== tests/cases/conformance/jsdoc/bug25097.js === +/** @type {C | null} */ +const c = null +>c : Symbol(c, Decl(bug25097.js, 1, 5)) + +class C { +>C : Symbol(C, Decl(bug25097.js, 1, 14)) +} + diff --git a/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.types b/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.types new file mode 100644 index 0000000000000..0a79a140c7d4b --- /dev/null +++ b/tests/baselines/reference/jsdocTypeReferenceUseBeforeDef.types @@ -0,0 +1,10 @@ +=== tests/cases/conformance/jsdoc/bug25097.js === +/** @type {C | null} */ +const c = null +>c : C +>null : null + +class C { +>C : C +} + diff --git a/tests/baselines/reference/letDeclarations-scopes2.errors.txt b/tests/baselines/reference/letDeclarations-scopes2.errors.txt index 5da8d99d397c1..b987e6a5e53b9 100644 --- a/tests/baselines/reference/letDeclarations-scopes2.errors.txt +++ b/tests/baselines/reference/letDeclarations-scopes2.errors.txt @@ -15,6 +15,7 @@ tests/cases/compiler/letDeclarations-scopes2.ts(25,1): error TS2304: Cannot find local2; // Error ~~~~~~ !!! error TS2552: Cannot find name 'local2'. Did you mean 'local'? +!!! related TS2728 tests/cases/compiler/letDeclarations-scopes2.ts:4:9: 'local' is declared here. { let local2 = 0; @@ -29,6 +30,7 @@ tests/cases/compiler/letDeclarations-scopes2.ts(25,1): error TS2304: Cannot find local2; // Error ~~~~~~ !!! error TS2552: Cannot find name 'local2'. Did you mean 'local'? +!!! related TS2728 tests/cases/compiler/letDeclarations-scopes2.ts:4:9: 'local' is declared here. } local; // Error diff --git a/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt b/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt index 7be07585a76fc..f8b0ed9fbd42d 100644 --- a/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt +++ b/tests/baselines/reference/letDeclarations-useBeforeDefinition.errors.txt @@ -7,7 +7,7 @@ tests/cases/compiler/letDeclarations-useBeforeDefinition.ts(8,5): error TS2448: l1; ~~ !!! error TS2448: Block-scoped variable 'l1' used before its declaration. -!!! related TS2728 tests/cases/compiler/letDeclarations-useBeforeDefinition.ts:3:9: 'l1' was declared here. +!!! related TS2728 tests/cases/compiler/letDeclarations-useBeforeDefinition.ts:3:9: 'l1' is declared here. let l1; } @@ -16,7 +16,7 @@ tests/cases/compiler/letDeclarations-useBeforeDefinition.ts(8,5): error TS2448: v1; ~~ !!! error TS2448: Block-scoped variable 'v1' used before its declaration. -!!! related TS2728 tests/cases/compiler/letDeclarations-useBeforeDefinition.ts:9:9: 'v1' was declared here. +!!! related TS2728 tests/cases/compiler/letDeclarations-useBeforeDefinition.ts:9:9: 'v1' is declared here. let v1 = 0; } \ No newline at end of file diff --git a/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt b/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt index 8259305a92268..6c5bfd04bc687 100644 --- a/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt +++ b/tests/baselines/reference/letDeclarations-useBeforeDefinition2.errors.txt @@ -5,7 +5,7 @@ tests/cases/compiler/file1.ts(1,1): error TS2448: Block-scoped variable 'l' used l; ~ !!! error TS2448: Block-scoped variable 'l' used before its declaration. -!!! related TS2728 tests/cases/compiler/file2.ts:1:7: 'l' was declared here. +!!! related TS2728 tests/cases/compiler/file2.ts:1:7: 'l' is declared here. ==== tests/cases/compiler/file2.ts (0 errors) ==== const l = 0; \ No newline at end of file diff --git a/tests/baselines/reference/maximum10SpellingSuggestions.errors.txt b/tests/baselines/reference/maximum10SpellingSuggestions.errors.txt index 8069d7bd1f5c7..9528ccec6fbdc 100644 --- a/tests/baselines/reference/maximum10SpellingSuggestions.errors.txt +++ b/tests/baselines/reference/maximum10SpellingSuggestions.errors.txt @@ -19,24 +19,34 @@ tests/cases/compiler/maximum10SpellingSuggestions.ts(5,6): error TS2304: Cannot bob; bob; bob; bob; bob; bob; bob; bob; bob; bob; ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. ~~~ !!! error TS2552: Cannot find name 'bob'. Did you mean 'blob'? +!!! related TS2728 tests/cases/compiler/maximum10SpellingSuggestions.ts:3:5: 'blob' is declared here. bob; bob; ~~~ !!! error TS2304: Cannot find name 'bob'. diff --git a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt index f5eda1fcf4a59..a77030bd5de3b 100644 --- a/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt +++ b/tests/baselines/reference/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.errors.txt @@ -41,6 +41,7 @@ tests/cases/compiler/modularizeLibrary_ErrorFromUsingES6FeaturesWithOnlyES5Lib.t Math.sign(1); ~~~~ !!! error TS2551: Property 'sign' does not exist on type 'Math'. Did you mean 'sin'? +!!! related TS2728 /.ts/lib.es5.d.ts:643:5: 'sin' is declared here. // Using ES6 object var o = { diff --git a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt index 248d4c3547370..699b65a4f6437 100644 --- a/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt +++ b/tests/baselines/reference/narrowExceptionVariableInCatchClause.errors.txt @@ -16,6 +16,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17) err.doPanic(); // ERROR: Property 'doPanic' does not exist on type '{...}' ~~~~~~~ !!! error TS2551: Property 'doPanic' does not exist on type '{ type: "foo"; dontPanic(): any; }'. Did you mean 'dontPanic'? +!!! related TS2728 tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts:1:58: 'dontPanic' is declared here. } else if (err instanceof Error) { @@ -23,6 +24,7 @@ tests/cases/conformance/types/any/narrowExceptionVariableInCatchClause.ts(16,17) err.massage; // ERROR: Property 'massage' does not exist on type 'Error' ~~~~~~~ !!! error TS2551: Property 'massage' does not exist on type 'Error'. Did you mean 'message'? +!!! related TS2728 /.ts/lib.es5.d.ts:904:5: 'message' is declared here. } else { diff --git a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt index f846565190138..216211b2fa28a 100644 --- a/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithInstanceof.errors.txt @@ -22,6 +22,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? +!!! related TS2728 /.ts/lib.es5.d.ts:904:5: 'message' is declared here. } if (x instanceof Date) { @@ -29,5 +30,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithInstanceof.ts(22,7): error TS x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? +!!! related TS2728 /.ts/lib.es5.d.ts:693:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt index 4865748f3325c..c35d3263b8fb2 100644 --- a/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt +++ b/tests/baselines/reference/narrowFromAnyWithTypePredicate.errors.txt @@ -39,6 +39,7 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.mesage; ~~~~~~ !!! error TS2551: Property 'mesage' does not exist on type 'Error'. Did you mean 'message'? +!!! related TS2728 /.ts/lib.es5.d.ts:904:5: 'message' is declared here. } if (isDate(x)) { @@ -46,5 +47,6 @@ tests/cases/conformance/types/any/narrowFromAnyWithTypePredicate.ts(33,7): error x.getHuors(); ~~~~~~~~ !!! error TS2551: Property 'getHuors' does not exist on type 'Date'. Did you mean 'getHours'? +!!! related TS2728 /.ts/lib.es5.d.ts:693:5: 'getHours' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/noCrashOnMixin.errors.txt b/tests/baselines/reference/noCrashOnMixin.errors.txt new file mode 100644 index 0000000000000..01baff8841703 --- /dev/null +++ b/tests/baselines/reference/noCrashOnMixin.errors.txt @@ -0,0 +1,29 @@ +tests/cases/compiler/noCrashOnMixin.ts(21,9): error TS2674: Constructor of class 'Abstract' is protected and only accessible within the class declaration. + + +==== tests/cases/compiler/noCrashOnMixin.ts (1 errors) ==== + class Abstract { + protected constructor() { + } + } + + class Concrete extends Abstract { + } + + type Constructor = new (...args: any[]) => T; + + function Mixin(Base: TBase) { + return class extends Base { + }; + } + + class Empty { + } + + class CrashTrigger extends Mixin(Empty) { + public trigger() { + new Concrete(); + ~~~~~~~~~~~~~~ +!!! error TS2674: Constructor of class 'Abstract' is protected and only accessible within the class declaration. + } + } \ No newline at end of file diff --git a/tests/baselines/reference/noCrashOnMixin.js b/tests/baselines/reference/noCrashOnMixin.js new file mode 100644 index 0000000000000..049b61e8a1ce0 --- /dev/null +++ b/tests/baselines/reference/noCrashOnMixin.js @@ -0,0 +1,75 @@ +//// [noCrashOnMixin.ts] +class Abstract { + protected constructor() { + } +} + +class Concrete extends Abstract { +} + +type Constructor = new (...args: any[]) => T; + +function Mixin(Base: TBase) { + return class extends Base { + }; +} + +class Empty { +} + +class CrashTrigger extends Mixin(Empty) { + public trigger() { + new Concrete(); + } +} + +//// [noCrashOnMixin.js] +var __extends = (this && this.__extends) || (function () { + var extendStatics = function (d, b) { + extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return extendStatics(d, b); + } + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +var Abstract = /** @class */ (function () { + function Abstract() { + } + return Abstract; +}()); +var Concrete = /** @class */ (function (_super) { + __extends(Concrete, _super); + function Concrete() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Concrete; +}(Abstract)); +function Mixin(Base) { + return /** @class */ (function (_super) { + __extends(class_1, _super); + function class_1() { + return _super !== null && _super.apply(this, arguments) || this; + } + return class_1; + }(Base)); +} +var Empty = /** @class */ (function () { + function Empty() { + } + return Empty; +}()); +var CrashTrigger = /** @class */ (function (_super) { + __extends(CrashTrigger, _super); + function CrashTrigger() { + return _super !== null && _super.apply(this, arguments) || this; + } + CrashTrigger.prototype.trigger = function () { + new Concrete(); + }; + return CrashTrigger; +}(Mixin(Empty))); diff --git a/tests/baselines/reference/noCrashOnMixin.symbols b/tests/baselines/reference/noCrashOnMixin.symbols new file mode 100644 index 0000000000000..3f99f99aa49d6 --- /dev/null +++ b/tests/baselines/reference/noCrashOnMixin.symbols @@ -0,0 +1,48 @@ +=== tests/cases/compiler/noCrashOnMixin.ts === +class Abstract { +>Abstract : Symbol(Abstract, Decl(noCrashOnMixin.ts, 0, 0)) + + protected constructor() { + } +} + +class Concrete extends Abstract { +>Concrete : Symbol(Concrete, Decl(noCrashOnMixin.ts, 3, 1)) +>Abstract : Symbol(Abstract, Decl(noCrashOnMixin.ts, 0, 0)) +} + +type Constructor = new (...args: any[]) => T; +>Constructor : Symbol(Constructor, Decl(noCrashOnMixin.ts, 6, 1)) +>T : Symbol(T, Decl(noCrashOnMixin.ts, 8, 17)) +>args : Symbol(args, Decl(noCrashOnMixin.ts, 8, 32)) +>T : Symbol(T, Decl(noCrashOnMixin.ts, 8, 17)) + +function Mixin(Base: TBase) { +>Mixin : Symbol(Mixin, Decl(noCrashOnMixin.ts, 8, 53)) +>TBase : Symbol(TBase, Decl(noCrashOnMixin.ts, 10, 15)) +>Constructor : Symbol(Constructor, Decl(noCrashOnMixin.ts, 6, 1)) +>Base : Symbol(Base, Decl(noCrashOnMixin.ts, 10, 42)) +>TBase : Symbol(TBase, Decl(noCrashOnMixin.ts, 10, 15)) + + return class extends Base { +>Base : Symbol(Base, Decl(noCrashOnMixin.ts, 10, 42)) + + }; +} + +class Empty { +>Empty : Symbol(Empty, Decl(noCrashOnMixin.ts, 13, 1)) +} + +class CrashTrigger extends Mixin(Empty) { +>CrashTrigger : Symbol(CrashTrigger, Decl(noCrashOnMixin.ts, 16, 1)) +>Mixin : Symbol(Mixin, Decl(noCrashOnMixin.ts, 8, 53)) +>Empty : Symbol(Empty, Decl(noCrashOnMixin.ts, 13, 1)) + + public trigger() { +>trigger : Symbol(CrashTrigger.trigger, Decl(noCrashOnMixin.ts, 18, 41)) + + new Concrete(); +>Concrete : Symbol(Concrete, Decl(noCrashOnMixin.ts, 3, 1)) + } +} diff --git a/tests/baselines/reference/noCrashOnMixin.types b/tests/baselines/reference/noCrashOnMixin.types new file mode 100644 index 0000000000000..4d31e483b9071 --- /dev/null +++ b/tests/baselines/reference/noCrashOnMixin.types @@ -0,0 +1,51 @@ +=== tests/cases/compiler/noCrashOnMixin.ts === +class Abstract { +>Abstract : Abstract + + protected constructor() { + } +} + +class Concrete extends Abstract { +>Concrete : Concrete +>Abstract : Abstract +} + +type Constructor = new (...args: any[]) => T; +>Constructor : Constructor +>T : T +>args : any[] +>T : T + +function Mixin(Base: TBase) { +>Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase +>TBase : TBase +>Constructor : Constructor +>Base : TBase +>TBase : TBase + + return class extends Base { +>class extends Base { } : { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase +>Base : {} + + }; +} + +class Empty { +>Empty : Empty +} + +class CrashTrigger extends Mixin(Empty) { +>CrashTrigger : CrashTrigger +>Mixin(Empty) : Mixin.(Anonymous class) & Empty +>Mixin : >(Base: TBase) => { new (...args: any[]): (Anonymous class); prototype: Mixin.(Anonymous class); } & TBase +>Empty : typeof Empty + + public trigger() { +>trigger : () => void + + new Concrete(); +>new Concrete() : any +>Concrete : typeof Concrete + } +} diff --git a/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt b/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt index c4e29ca62f9d6..59a76c58830f6 100644 --- a/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt +++ b/tests/baselines/reference/parameterNamesInTypeParameterList.errors.txt @@ -10,18 +10,21 @@ tests/cases/compiler/parameterNamesInTypeParameterList.ts(20,22): error TS2552: function f0(a: T) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b; } function f1({a}: {a:T}) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b; } function f2([a]: T[]) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b; } @@ -29,16 +32,19 @@ tests/cases/compiler/parameterNamesInTypeParameterList.ts(20,22): error TS2552: m0(a: T) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b } m1({a}: {a:T}) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b } m2([a]: T[]) { ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/parameterNamesInTypeParameterList.ts:13:7: 'A' is declared here. a.b } } \ No newline at end of file diff --git a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt index 6c2a0562a7c67..d0db15976075a 100644 --- a/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt +++ b/tests/baselines/reference/parserMemberAccessAfterPostfixExpression1.errors.txt @@ -10,4 +10,5 @@ tests/cases/conformance/parser/ecmascript5/Expressions/parserMemberAccessAfterPo ~ !!! error TS1005: ';' expected. ~~~~~~~~ -!!! error TS2552: Cannot find name 'toString'. Did you mean 'String'? \ No newline at end of file +!!! error TS2552: Cannot find name 'toString'. Did you mean 'String'? +!!! related TS2728 /.ts/lib.es5.d.ts:457:15: 'String' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/parserRealSource10.errors.txt b/tests/baselines/reference/parserRealSource10.errors.txt index c7fb3b62f29b1..a860467f1a71a 100644 --- a/tests/baselines/reference/parserRealSource10.errors.txt +++ b/tests/baselines/reference/parserRealSource10.errors.txt @@ -475,7 +475,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts(449,41): error export var tokenTable = new TokenInfo[]; ~~~~~~~~~ !!! error TS2449: Class 'TokenInfo' used before its declaration. -!!! related TS2728 tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts:175:18: 'TokenInfo' was declared here. +!!! related TS2728 tests/cases/conformance/parser/ecmascript5/parserRealSource10.ts:175:18: 'TokenInfo' is declared here. !!! error TS1011: An element access expression should take an argument. export var nodeTypeTable = new string[]; diff --git a/tests/baselines/reference/parserRealSource7.errors.txt b/tests/baselines/reference/parserRealSource7.errors.txt index a838b0a95940a..250b589873b37 100644 --- a/tests/baselines/reference/parserRealSource7.errors.txt +++ b/tests/baselines/reference/parserRealSource7.errors.txt @@ -328,6 +328,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T baseTypeLinks = new TypeLink[]; ~~~~~~~~ !!! error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? +!!! related TS2728 tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts:21:21: 'typeLink' is declared here. !!! error TS1011: An element access expression should take an argument. } @@ -337,6 +338,7 @@ tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts(828,13): error T var typeLink = new TypeLink(); ~~~~~~~~ !!! error TS2552: Cannot find name 'TypeLink'. Did you mean 'typeLink'? +!!! related TS2728 tests/cases/conformance/parser/ecmascript5/parserRealSource7.ts:21:21: 'typeLink' is declared here. typeLink.ast = name; baseTypeLinks[baseTypeLinks.length] = typeLink; } diff --git a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt index 3d35062bfc21a..16a1a9c5ff299 100644 --- a/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/parserS7.2_A1.5_T2.errors.txt @@ -19,6 +19,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } //CHECK#2 @@ -27,6 +28,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.2_A1.5_T2.ts(20,3): error TS $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } diff --git a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt index d4131cc799d69..a644e1b6f0dd0 100644 --- a/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/parserS7.3_A1.1_T2.errors.txt @@ -21,6 +21,7 @@ tests/cases/conformance/parser/ecmascript5/parserS7.3_A1.1_T2.ts(17,3): error TS $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt index 53865fd69abc1..f29839f43c121 100644 --- a/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/parserS7.6_A4.2_T1.errors.txt @@ -50,60 +50,70 @@ tests/cases/conformance/parser/ecmascript5/parserS7.6_A4.2_T1.ts(142,3): error T $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/parserSkippedTokens16.errors.txt b/tests/baselines/reference/parserSkippedTokens16.errors.txt index 3f0321ed00ca6..c35e013a22852 100644 --- a/tests/baselines/reference/parserSkippedTokens16.errors.txt +++ b/tests/baselines/reference/parserSkippedTokens16.errors.txt @@ -12,6 +12,7 @@ tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.t foo(): Bar { } ~~~ !!! error TS2552: Cannot find name 'foo'. Did you mean 'Foo'? +!!! related TS2728 tests/cases/conformance/parser/ecmascript5/SkippedTokens/parserSkippedTokens16.ts:2:10: 'Foo' is declared here. ~ !!! error TS1005: ';' expected. ~~~ diff --git a/tests/baselines/reference/parserSymbolIndexer5.errors.txt b/tests/baselines/reference/parserSymbolIndexer5.errors.txt index 7906d08912c60..4206fb5a75659 100644 --- a/tests/baselines/reference/parserSymbolIndexer5.errors.txt +++ b/tests/baselines/reference/parserSymbolIndexer5.errors.txt @@ -15,6 +15,7 @@ tests/cases/conformance/parser/ecmascript6/Symbols/parserSymbolIndexer5.ts(3,1): !!! error TS1005: ']' expected. ~~~~~~ !!! error TS2552: Cannot find name 'symbol'. Did you mean 'Symbol'? +!!! related TS2728 /.ts/lib.es2015.symbol.d.ts:48:13: 'Symbol' is declared here. ~ !!! error TS1005: ',' expected. ~ diff --git a/tests/baselines/reference/parserUnicode1.errors.txt b/tests/baselines/reference/parserUnicode1.errors.txt index d04e136a53401..803119cc3e761 100644 --- a/tests/baselines/reference/parserUnicode1.errors.txt +++ b/tests/baselines/reference/parserUnicode1.errors.txt @@ -11,11 +11,13 @@ tests/cases/conformance/parser/ecmascript5/parserUnicode1.ts(10,5): error TS2552 $ERROR('#6.1: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } } catch (e) { $ERROR('#6.2: var \\u0078x = 1; xx === 6. Actual: ' + (xx)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt index ac888dc2fb1df..90193b9f62fff 100644 --- a/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt +++ b/tests/baselines/reference/privacyClassExtendsClauseDeclFile.errors.txt @@ -24,12 +24,12 @@ tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts(21,83): class privateClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2449: Class 'publicClassInPrivateModule' used before its declaration. -!!! related TS2728 tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts:26:18: 'publicClassInPrivateModule' was declared here. +!!! related TS2728 tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts:26:18: 'publicClassInPrivateModule' is declared here. } export class publicClassExtendingFromPrivateModuleClass extends privateModule.publicClassInPrivateModule { // Should error ~~~~~~~~~~~~~~~~~~~~~~~~~~ !!! error TS2449: Class 'publicClassInPrivateModule' used before its declaration. -!!! related TS2728 tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts:26:18: 'publicClassInPrivateModule' was declared here. +!!! related TS2728 tests/cases/compiler/privacyClassExtendsClauseDeclFile_externalModule.ts:26:18: 'publicClassInPrivateModule' is declared here. } } diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js index 74c4caf097d36..f6fd3b354c407 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/amd/main.js @@ -17,7 +17,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng) var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js index 53af24a916f71..3ca4c09edf826 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModules/node/main.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js index 74c4caf097d36..f6fd3b354c407 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/amd/main.js @@ -17,7 +17,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng) var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js index 53af24a916f71..3ca4c09edf826 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataCommonJSISolatedModulesNoResolve/node/main.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js index 74c4caf097d36..f6fd3b354c407 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/amd/main.js @@ -17,7 +17,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng) var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js index 53af24a916f71..3ca4c09edf826 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJS/node/main.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js index 74c4caf097d36..f6fd3b354c407 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/amd/main.js @@ -17,7 +17,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng) var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js index 53af24a916f71..3ca4c09edf826 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModules/node/main.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js index 74c4caf097d36..f6fd3b354c407 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/amd/main.js @@ -17,7 +17,7 @@ define(["require", "exports", "angular2/core"], function (require, exports, ng) var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js index 53af24a916f71..3ca4c09edf826 100644 --- a/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js +++ b/tests/baselines/reference/project/emitDecoratorMetadataSystemJSISolatedModulesNoResolve/node/main.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ foo, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/propertyOrdering.errors.txt b/tests/baselines/reference/propertyOrdering.errors.txt index f9f638f592dcb..90db75f8f15eb 100644 --- a/tests/baselines/reference/propertyOrdering.errors.txt +++ b/tests/baselines/reference/propertyOrdering.errors.txt @@ -18,6 +18,7 @@ tests/cases/compiler/propertyOrdering.ts(20,14): error TS2339: Property '_store' public bar() { return this.store; } // should be an error ~~~~~ !!! error TS2551: Property 'store' does not exist on type 'Foo'. Did you mean '_store'? +!!! related TS2728 tests/cases/compiler/propertyOrdering.ts:6:14: '_store' is declared here. } diff --git a/tests/baselines/reference/propertySignatures.errors.txt b/tests/baselines/reference/propertySignatures.errors.txt index 60a393aef4de5..b99378c6f869d 100644 --- a/tests/baselines/reference/propertySignatures.errors.txt +++ b/tests/baselines/reference/propertySignatures.errors.txt @@ -24,6 +24,7 @@ tests/cases/compiler/propertySignatures.ts(14,12): error TS2552: Cannot find nam var test = foo(); ~~~ !!! error TS2552: Cannot find name 'foo'. Did you mean 'foo1'? +!!! related TS2728 tests/cases/compiler/propertySignatures.ts:2:5: 'foo1' is declared here. // Should be OK var foo5: {();}; diff --git a/tests/baselines/reference/reachabilityChecks1.errors.txt b/tests/baselines/reference/reachabilityChecks1.errors.txt index 0f1a9b7bb1eeb..041d10bfecd5b 100644 --- a/tests/baselines/reference/reachabilityChecks1.errors.txt +++ b/tests/baselines/reference/reachabilityChecks1.errors.txt @@ -10,13 +10,13 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod ==== tests/cases/compiler/reachabilityChecks1.ts (7 errors) ==== while (true); var x = 1; - ~~~ + ~~~~~~~~~~ !!! error TS7027: Unreachable code detected. module A { while (true); let x; - ~~~ + ~~~~~~ !!! error TS7027: Unreachable code detected. } @@ -30,10 +30,12 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod module A2 { while (true); module A { - ~~~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~~~ var x = 1; + ~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS7027: Unreachable code detected. } module A3 { @@ -44,10 +46,12 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod module A4 { while (true); module A { - ~~~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~~~ const enum E { X } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS7027: Unreachable code detected. } function f1(x) { @@ -63,9 +67,10 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod function f2() { return; class A { - ~~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~~ } + ~~~~~ +!!! error TS7027: Unreachable code detected. } module B { @@ -78,10 +83,12 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod do { } while (true); enum E { - ~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~ X = 1 + ~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS7027: Unreachable code detected. } function f4() { @@ -89,10 +96,12 @@ tests/cases/compiler/reachabilityChecks1.ts(69,5): error TS7027: Unreachable cod throw new Error(); } const enum E { - ~~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~~~~~~~ X = 1 + ~~~~~~~~~~~~~ } + ~~~~~ +!!! error TS7027: Unreachable code detected. } \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks2.errors.txt b/tests/baselines/reference/reachabilityChecks2.errors.txt index 9061effeb667f..922f888fad374 100644 --- a/tests/baselines/reference/reachabilityChecks2.errors.txt +++ b/tests/baselines/reference/reachabilityChecks2.errors.txt @@ -6,12 +6,17 @@ tests/cases/compiler/reachabilityChecks2.ts(4,1): error TS7027: Unreachable code const enum E { X } module A4 { - ~~~~~~ -!!! error TS7027: Unreachable code detected. + ~~~~~~~~~~~ while (true); + ~~~~~~~~~~~~~~~~~ module A { + ~~~~~~~~~~~~~~ const enum E { X } + ~~~~~~~~~~~~~~~~~~~~~~~~~~ } + ~~~~~ } + ~ +!!! error TS7027: Unreachable code detected. \ No newline at end of file diff --git a/tests/baselines/reference/reachabilityChecks5.errors.txt b/tests/baselines/reference/reachabilityChecks5.errors.txt index 4dc7c1705f1c8..f8c7e6f4dbc1a 100644 --- a/tests/baselines/reference/reachabilityChecks5.errors.txt +++ b/tests/baselines/reference/reachabilityChecks5.errors.txt @@ -109,7 +109,7 @@ tests/cases/compiler/reachabilityChecks5.ts(122,13): error TS7027: Unreachable c } else { return 1; - ~~~~~~ + ~~~~~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -124,7 +124,7 @@ tests/cases/compiler/reachabilityChecks5.ts(122,13): error TS7027: Unreachable c try { while (false) { return 1; - ~~~~~~ + ~~~~~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -154,7 +154,7 @@ tests/cases/compiler/reachabilityChecks5.ts(122,13): error TS7027: Unreachable c break test; } while (true); x++; - ~ + ~~~~ !!! error TS7027: Unreachable code detected. } while (true); } diff --git a/tests/baselines/reference/reachabilityChecks6.errors.txt b/tests/baselines/reference/reachabilityChecks6.errors.txt index 9dadf3b2d6f51..66744af3e033b 100644 --- a/tests/baselines/reference/reachabilityChecks6.errors.txt +++ b/tests/baselines/reference/reachabilityChecks6.errors.txt @@ -106,7 +106,7 @@ tests/cases/compiler/reachabilityChecks6.ts(122,13): error TS7027: Unreachable c } else { return 1; - ~~~~~~ + ~~~~~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -121,7 +121,7 @@ tests/cases/compiler/reachabilityChecks6.ts(122,13): error TS7027: Unreachable c try { while (false) { return 1; - ~~~~~~ + ~~~~~~~~~ !!! error TS7027: Unreachable code detected. } } @@ -151,7 +151,7 @@ tests/cases/compiler/reachabilityChecks6.ts(122,13): error TS7027: Unreachable c break test; } while (true); x++; - ~ + ~~~~ !!! error TS7027: Unreachable code detected. } while (true); } diff --git a/tests/baselines/reference/recursiveBaseCheck3.errors.txt b/tests/baselines/reference/recursiveBaseCheck3.errors.txt index 12091f9c0e609..2c08a3c44d277 100644 --- a/tests/baselines/reference/recursiveBaseCheck3.errors.txt +++ b/tests/baselines/reference/recursiveBaseCheck3.errors.txt @@ -10,7 +10,7 @@ tests/cases/compiler/recursiveBaseCheck3.ts(4,9): error TS2339: Property 'blah' !!! error TS2506: 'A' is referenced directly or indirectly in its own base expression. ~ !!! error TS2449: Class 'C' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveBaseCheck3.ts:2:7: 'C' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveBaseCheck3.ts:2:7: 'C' is declared here. class C extends A { } ~ !!! error TS2506: 'C' is referenced directly or indirectly in its own base expression. diff --git a/tests/baselines/reference/recursiveLetConst.errors.txt b/tests/baselines/reference/recursiveLetConst.errors.txt index df3fc5fdeb897..9a85394567403 100644 --- a/tests/baselines/reference/recursiveLetConst.errors.txt +++ b/tests/baselines/reference/recursiveLetConst.errors.txt @@ -15,43 +15,43 @@ tests/cases/compiler/recursiveLetConst.ts(11,11): error TS2448: Block-scoped var let x = x + 1; ~ !!! error TS2448: Block-scoped variable 'x' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:2:5: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:2:5: 'x' is declared here. let [x1] = x1 + 1; ~~ !!! error TS2448: Block-scoped variable 'x1' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:3:6: 'x1' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:3:6: 'x1' is declared here. const y = y + 2; ~ !!! error TS2448: Block-scoped variable 'y' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:4:7: 'y' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:4:7: 'y' is declared here. const [y1] = y1 + 1; ~~ !!! error TS2448: Block-scoped variable 'y1' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:5:8: 'y1' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:5:8: 'y1' is declared here. for (let v = v; ; ) { } ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:6:10: 'v' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:6:10: 'v' is declared here. for (let [v] = v; ;) { } ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:7:11: 'v' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:7:11: 'v' is declared here. for (let v in v) { } ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:8:10: 'v' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:8:10: 'v' is declared here. for (let v of v) { } ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:9:10: 'v' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:9:10: 'v' is declared here. for (let [v] of v) { } ~ !!! error TS2448: Block-scoped variable 'v' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:10:11: 'v' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:10:11: 'v' is declared here. let [x2 = x2] = [] ~~ !!! error TS2448: Block-scoped variable 'x2' used before its declaration. -!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:11:6: 'x2' was declared here. +!!! related TS2728 tests/cases/compiler/recursiveLetConst.ts:11:6: 'x2' is declared here. let z0 = () => z0; let z1 = function () { return z1; } let z2 = { f() { return z2;}} \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.errors.txt new file mode 100644 index 0000000000000..1a92da0939559 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.errors.txt @@ -0,0 +1,18 @@ +error TS5070: Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy. +tests/cases/compiler/file1.ts(1,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'. +tests/cases/compiler/file1.ts(1,20): error TS2307: Cannot find module './b.json'. + + +!!! error TS5070: Option '--resolveJsonModule' cannot be specified without 'node' module resolution strategy. +==== tests/cases/compiler/file1.ts (2 errors) ==== + import * as b from './b.json'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'. + ~~~~~~~~~~ +!!! error TS2307: Cannot find module './b.json'. + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.js b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.js new file mode 100644 index 0000000000000..a94bdd896dddd --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.js @@ -0,0 +1,14 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleEmitNone.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/file1.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.symbols new file mode 100644 index 0000000000000..27f9d9d811796 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.symbols @@ -0,0 +1,4 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.types b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.types new file mode 100644 index 0000000000000..999e912a291e7 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitNone.types @@ -0,0 +1,4 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : any + diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.js b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.js new file mode 100644 index 0000000000000..84b0acc7733cb --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleEmitUndefined.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.types b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleEmitUndefined.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.errors.txt new file mode 100644 index 0000000000000..eab6745285b55 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.errors.txt @@ -0,0 +1,12 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + import * as b from './b.json'; + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.js new file mode 100644 index 0000000000000..53abd96568028 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.js @@ -0,0 +1,21 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmd.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +define(["require", "exports"], function (require, exports) { + "use strict"; + exports.__esModule = true; +}); diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitAmd.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.errors.txt new file mode 100644 index 0000000000000..eab6745285b55 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.errors.txt @@ -0,0 +1,12 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + import * as b from './b.json'; + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.js new file mode 100644 index 0000000000000..12d02801bb242 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.errors.txt new file mode 100644 index 0000000000000..b9c37651205cd --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.errors.txt @@ -0,0 +1,12 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + import * as b from './b.json'; + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.js new file mode 100644 index 0000000000000..f3bcbc546fee1 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.js @@ -0,0 +1,17 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.symbols new file mode 100644 index 0000000000000..9853ac89f51cd --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.types new file mode 100644 index 0000000000000..f10a2fda11f47 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt new file mode 100644 index 0000000000000..8a40ac52e9034 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.errors.txt @@ -0,0 +1,15 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +tests/cases/compiler/file1.ts(1,1): error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (1 errors) ==== + import * as b from './b.json'; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +!!! error TS1148: Cannot use imports, exports, or module augmentations when '--module' is 'none'. + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.js new file mode 100644 index 0000000000000..06d357e708983 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitNone.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.errors.txt new file mode 100644 index 0000000000000..eab6745285b55 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.errors.txt @@ -0,0 +1,12 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + import * as b from './b.json'; + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.js new file mode 100644 index 0000000000000..5174a101848c7 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.js @@ -0,0 +1,26 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitSystem.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +System.register([], function (exports_1, context_1) { + "use strict"; + var __moduleName = context_1 && context_1.id; + return { + setters: [], + execute: function () { + } + }; +}); diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitSystem.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.errors.txt b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.errors.txt new file mode 100644 index 0000000000000..eab6745285b55 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.errors.txt @@ -0,0 +1,12 @@ +error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. + + +!!! error TS5071: Option '--resolveJsonModule' can only be specified when module code generation is 'commonjs'. +==== tests/cases/compiler/file1.ts (0 errors) ==== + import * as b from './b.json'; + +==== tests/cases/compiler/b.json (0 errors) ==== + { + "a": true, + "b": "hello" + } \ No newline at end of file diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.js new file mode 100644 index 0000000000000..9aaecbdbef46b --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.js @@ -0,0 +1,29 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUmd.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +(function (factory) { + if (typeof module === "object" && typeof module.exports === "object") { + var v = factory(require, exports); + if (v !== undefined) module.exports = v; + } + else if (typeof define === "function" && define.amd) { + define(["require", "exports"], factory); + } +})(function (require, exports) { + "use strict"; + exports.__esModule = true; +}); diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUmd.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.js b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.js new file mode 100644 index 0000000000000..ce1abb0d4d635 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.js @@ -0,0 +1,19 @@ +//// [tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.ts] //// + +//// [file1.ts] +import * as b from './b.json'; + +//// [b.json] +{ + "a": true, + "b": "hello" +} + +//// [out/b.json] +{ + "a": true, + "b": "hello" +} +//// [out/file1.js] +"use strict"; +exports.__esModule = true; diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.symbols b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.symbols new file mode 100644 index 0000000000000..827f2e674e630 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.symbols @@ -0,0 +1,12 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : Symbol(b, Decl(file1.ts, 0, 6)) + +=== tests/cases/compiler/b.json === +{ + "a": true, +>"a" : Symbol("a", Decl(b.json, 0, 1)) + + "b": "hello" +>"b" : Symbol("b", Decl(b.json, 1, 14)) +} diff --git a/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.types b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.types new file mode 100644 index 0000000000000..9e5cc29d34207 --- /dev/null +++ b/tests/baselines/reference/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.types @@ -0,0 +1,16 @@ +=== tests/cases/compiler/file1.ts === +import * as b from './b.json'; +>b : { "a": boolean; "b": string; } + +=== tests/cases/compiler/b.json === +{ +>{ "a": true, "b": "hello"} : { "a": boolean; "b": string; } + + "a": true, +>"a" : boolean +>true : true + + "b": "hello" +>"b" : string +>"hello" : "hello" +} diff --git a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt index 5e347bff0c3fd..6d5605e96fbf6 100644 --- a/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt +++ b/tests/baselines/reference/resolvingClassDeclarationWhenInBaseTypeResolution.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class caniventer extends Lanthanum.nitidus { ~~~~~~~ !!! error TS2449: Class 'nitidus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:114:16: 'nitidus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:114:16: 'nitidus' is declared here. salomonseni() : caniventer { var x : caniventer; () => { var y = this; }; return x; } uchidai() : lavali.xanthognathus { var x : lavali.xanthognathus; () => { var y = this; }; return x; } raffrayana() : lavali.otion { var x : lavali.otion; () => { var y = this; }; return x; } @@ -39,7 +39,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class veraecrucis extends trivirgatus.mixtus { ~~~~~~ !!! error TS2449: Class 'mixtus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:199:16: 'mixtus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:199:16: 'mixtus' is declared here. naso() : panamensis.setulosus> { var x : panamensis.setulosus>; () => { var y = this; }; return x; } vancouverensis() : imperfecta.ciliolabrum { var x : imperfecta.ciliolabrum; () => { var y = this; }; return x; } africana() : argurus.gilbertii, sagitta.cinereus> { var x : argurus.gilbertii, sagitta.cinereus>; () => { var y = this; }; return x; } @@ -78,7 +78,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class oralis extends caurinus.psilurus { ~~~~~~~~ !!! error TS2449: Class 'psilurus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:1010:18: 'psilurus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:1010:18: 'psilurus' is declared here. cepapi() : caurinus.psilurus { var x : caurinus.psilurus; () => { var y = this; }; return x; } porteri() : lavali.thaeleri { var x : lavali.thaeleri; () => { var y = this; }; return x; } bindi() : caurinus.mahaganus> { var x : caurinus.mahaganus>; () => { var y = this; }; return x; } @@ -96,7 +96,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class sumatrana extends Lanthanum.jugularis { ~~~~~~~~~ !!! error TS2449: Class 'jugularis' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:136:16: 'jugularis' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:136:16: 'jugularis' is declared here. wolffsohni() : Lanthanum.suillus { var x : Lanthanum.suillus; () => { var y = this; }; return x; } geata() : ruatanica.hector { var x : ruatanica.hector; () => { var y = this; }; return x; } awashensis() : petrophilus.minutilla { var x : petrophilus.minutilla; () => { var y = this; }; return x; } @@ -135,7 +135,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class durangae extends dogramacii.aurata { ~~~~~~ !!! error TS2449: Class 'aurata' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:346:16: 'aurata' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:346:16: 'aurata' is declared here. Californium() : panamensis.setulosus { var x : panamensis.setulosus; () => { var y = this; }; return x; } Flerovium() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } phrudus() : sagitta.stolzmanni { var x : sagitta.stolzmanni; () => { var y = this; }; return x; } @@ -156,7 +156,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class nitidus extends argurus.gilbertii { ~~~~~~~~~ !!! error TS2449: Class 'gilbertii' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:702:18: 'gilbertii' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:702:18: 'gilbertii' is declared here. granatensis() : quasiater.bobrinskoi { var x : quasiater.bobrinskoi; () => { var y = this; }; return x; } negligens() : minutus.inez { var x : minutus.inez; () => { var y = this; }; return x; } lewisi() : julianae.oralis { var x : julianae.oralis; () => { var y = this; }; return x; } @@ -171,7 +171,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class megalonyx extends caurinus.johorensis { ~~~~~~~~~~ !!! error TS2449: Class 'johorensis' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' is declared here. phillipsii() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } melanogaster() : rionegrensis.veraecrucis { var x : rionegrensis.veraecrucis; () => { var y = this; }; return x; } elaphus() : nitidus { var x : nitidus; () => { var y = this; }; return x; } @@ -230,7 +230,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class crenulata extends trivirgatus.falconeri { ~~~~~~~~~ !!! error TS2449: Class 'falconeri' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:212:16: 'falconeri' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:212:16: 'falconeri' is declared here. salvanius() : howi.coludo { var x : howi.coludo; () => { var y = this; }; return x; } maritimus() : ruatanica.americanus { var x : ruatanica.americanus; () => { var y = this; }; return x; } edax() : lutreolus.cor>, rionegrensis.caniventer> { var x : lutreolus.cor>, rionegrensis.caniventer>; () => { var y = this; }; return x; } @@ -250,7 +250,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class mixtus extends argurus.pygmaea> { ~~~~~~~ !!! error TS2449: Class 'pygmaea' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:598:18: 'pygmaea' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:598:18: 'pygmaea' is declared here. ochrogaster() : dogramacii.aurata { var x : dogramacii.aurata; () => { var y = this; }; return x; } bryophilus() : macrorhinos.marmosurus>> { var x : macrorhinos.marmosurus>>; () => { var y = this; }; return x; } liechtensteini() : rendalli.zuluensis { var x : rendalli.zuluensis; () => { var y = this; }; return x; } @@ -301,7 +301,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class americanus extends imperfecta.ciliolabrum { ~~~~~~~~~~~ !!! error TS2449: Class 'ciliolabrum' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:809:18: 'ciliolabrum' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:809:18: 'ciliolabrum' is declared here. nasoloi() : macrorhinos.konganensis { var x : macrorhinos.konganensis; () => { var y = this; }; return x; } mystacalis() : howi.angulatus { var x : howi.angulatus; () => { var y = this; }; return x; } fardoulisi() : trivirgatus.oconnelli { var x : trivirgatus.oconnelli; () => { var y = this; }; return x; } @@ -329,7 +329,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class otion extends howi.coludo { ~~~~~~ !!! error TS2449: Class 'coludo' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:889:18: 'coludo' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:889:18: 'coludo' is declared here. bonaerensis() : provocax.melanoleuca { var x : provocax.melanoleuca; () => { var y = this; }; return x; } dussumieri() : nigra.gracilis { var x : nigra.gracilis; () => { var y = this; }; return x; } osvaldoreigi() : julianae.albidens { var x : julianae.albidens; () => { var y = this; }; return x; } @@ -361,7 +361,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class thaeleri extends argurus.oreas { ~~~~~ !!! error TS2449: Class 'oreas' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:627:18: 'oreas' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:627:18: 'oreas' is declared here. coromandra() : julianae.galapagoensis { var x : julianae.galapagoensis; () => { var y = this; }; return x; } parvipes() : nigra.dolichurus { var x : nigra.dolichurus; () => { var y = this; }; return x; } sponsorius() : rionegrensis.veraecrucis, julianae.steerii> { var x : rionegrensis.veraecrucis, julianae.steerii>; () => { var y = this; }; return x; } @@ -466,7 +466,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class amphibius extends caurinus.johorensis, Lanthanum.jugularis> { ~~~~~~~~~~ !!! error TS2449: Class 'johorensis' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' is declared here. bottegi(): macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni> { var x: macrorhinos.marmosurus, gabriellae.echinatus>, sagitta.stolzmanni>; () => { var y = this; }; return x; } jerdoni(): macrorhinos.daphaenodon { var x: macrorhinos.daphaenodon; () => { var y = this; }; return x; } camtschatica(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } @@ -502,7 +502,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class himalayana extends lutreolus.punicus { ~~~~~~~ !!! error TS2449: Class 'punicus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:722:18: 'punicus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:722:18: 'punicus' is declared here. simoni(): argurus.netscheri> { var x: argurus.netscheri>; () => { var y = this; }; return x; } lobata(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } rusticus(): dogramacii.aurata { var x: dogramacii.aurata; () => { var y = this; }; return x; } @@ -538,7 +538,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class angulatus extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' is declared here. pennatus(): howi.marcanoi { var x: howi.marcanoi; () => { var y = this; }; return x; } } } @@ -562,7 +562,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class walkeri extends minutus.portoricensis { ~~~~~~~~~~~~~ !!! error TS2449: Class 'portoricensis' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:851:18: 'portoricensis' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:851:18: 'portoricensis' is declared here. maracajuensis(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } } } @@ -570,7 +570,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class inez extends samarensis.pelurus { ~~~~~~~ !!! error TS2449: Class 'pelurus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:534:18: 'pelurus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:534:18: 'pelurus' is declared here. vexillaris(): samarensis.cahirinus { var x: samarensis.cahirinus; () => { var y = this; }; return x; } } } @@ -578,7 +578,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class konganensis extends imperfecta.lasiurus { ~~~~~~~~ !!! error TS2449: Class 'lasiurus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:788:18: 'lasiurus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:788:18: 'lasiurus' is declared here. } } module panamensis { @@ -615,7 +615,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class pelurus extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' is declared here. Palladium(): panamensis.linulus { var x: panamensis.linulus; () => { var y = this; }; return x; } castanea(): argurus.netscheri, julianae.oralis> { var x: argurus.netscheri, julianae.oralis>; () => { var y = this; }; return x; } chamek(): argurus.pygmaea { var x: argurus.pygmaea; () => { var y = this; }; return x; } @@ -633,7 +633,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class fuscus extends macrorhinos.daphaenodon { ~~~~~~~~~~~ !!! error TS2449: Class 'daphaenodon' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:739:18: 'daphaenodon' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:739:18: 'daphaenodon' is declared here. planifrons(): nigra.gracilis { var x: nigra.gracilis; () => { var y = this; }; return x; } badia(): julianae.sumatrana { var x: julianae.sumatrana; () => { var y = this; }; return x; } prymnolopha(): sagitta.walkeri { var x: sagitta.walkeri; () => { var y = this; }; return x; } @@ -667,7 +667,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class leptoceros extends caurinus.johorensis> { ~~~~~~~~~~ !!! error TS2449: Class 'johorensis' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:979:18: 'johorensis' is declared here. victus(): rionegrensis.caniventer { var x: rionegrensis.caniventer; () => { var y = this; }; return x; } hoplomyoides(): panglima.fundatus, nigra.gracilis> { var x: panglima.fundatus, nigra.gracilis>; () => { var y = this; }; return x; } gratiosus(): lavali.lepturus { var x: lavali.lepturus; () => { var y = this; }; return x; } @@ -679,7 +679,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class nigricans extends sagitta.stolzmanni { ~~~~~~~~~~ !!! error TS2449: Class 'stolzmanni' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:901:18: 'stolzmanni' is declared here. woosnami(): dogramacii.robustulus { var x: dogramacii.robustulus; () => { var y = this; }; return x; } } } @@ -698,7 +698,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class sarasinorum extends caurinus.psilurus { ~~~~~~~~ !!! error TS2449: Class 'psilurus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:1010:18: 'psilurus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:1010:18: 'psilurus' is declared here. belzebul(): samarensis.pallidus { var x: samarensis.pallidus; () => { var y = this; }; return x; } hinpoon(): nigra.caucasica { var x: nigra.caucasica; () => { var y = this; }; return x; } kandti(): quasiater.wattsi { var x: quasiater.wattsi; () => { var y = this; }; return x; } @@ -865,7 +865,7 @@ tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts(769,53 export class klossii extends imperfecta.lasiurus { ~~~~~~~~ !!! error TS2449: Class 'lasiurus' used before its declaration. -!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:788:18: 'lasiurus' was declared here. +!!! related TS2728 tests/cases/compiler/resolvingClassDeclarationWhenInBaseTypeResolution.ts:788:18: 'lasiurus' is declared here. } export class amicus { pirrensis(): argurus.luctuosa { var x: argurus.luctuosa; () => { var y = this; }; return x; } diff --git a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt index 97d580c9b4b0c..da25f2199cf84 100644 --- a/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.2_A1.5_T2.errors.txt @@ -19,6 +19,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#1: eval("\\u00A0var x\\u00A0= 1\\u00A0"); x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } //CHECK#2 @@ -27,6 +28,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.2_A1.5_T2.ts(20,3): error $ERROR('#2:  var x = 1 ; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } diff --git a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt index 186427f5de957..4bfaf868f6d7b 100644 --- a/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt +++ b/tests/baselines/reference/scannerS7.3_A1.1_T2.errors.txt @@ -21,6 +21,7 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.3_A1.1_T2.ts(17,3): error $ERROR('#1: var\\nx\\n=\\n1\\n; x === 1. Actual: ' + (x)); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } \ No newline at end of file diff --git a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt index 0213122e54f1d..1ff3ea8567622 100644 --- a/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt +++ b/tests/baselines/reference/scannerS7.6_A4.2_T1.errors.txt @@ -50,60 +50,70 @@ tests/cases/conformance/scanner/ecmascript5/scannerS7.6_A4.2_T1.ts(142,3): error $ERROR('#А'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0411 = 1; if (Б !== 1) { $ERROR('#Б'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0412 = 1; if (В !== 1) { $ERROR('#В'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0413 = 1; if (Г !== 1) { $ERROR('#Г'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0414 = 1; if (Д !== 1) { $ERROR('#Д'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0415 = 1; if (Е !== 1) { $ERROR('#Е'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0416 = 1; if (Ж !== 1) { $ERROR('#Ж'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0417 = 1; if (З !== 1) { $ERROR('#З'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0418 = 1; if (И !== 1) { $ERROR('#И'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u0419 = 1; if (Й !== 1) { $ERROR('#Й'); ~~~~~~ !!! error TS2552: Cannot find name '$ERROR'. Did you mean 'Error'? +!!! related TS2728 /.ts/lib.es5.d.ts:914:15: 'Error' is declared here. } var \u041A = 1; if (К !== 1) { diff --git a/tests/baselines/reference/scopeCheckStaticInitializer.errors.txt b/tests/baselines/reference/scopeCheckStaticInitializer.errors.txt index bcc49651720ff..416fe203b8933 100644 --- a/tests/baselines/reference/scopeCheckStaticInitializer.errors.txt +++ b/tests/baselines/reference/scopeCheckStaticInitializer.errors.txt @@ -9,20 +9,20 @@ tests/cases/compiler/scopeCheckStaticInitializer.ts(6,23): error TS2449: Class ' static illegalBeforeProperty = X.data; ~~~~ !!! error TS2729: Property 'data' is used before its initialization. -!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:7:12: 'data' was declared here. +!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:7:12: 'data' is declared here. static okBeforeMethod = X.method; static illegal2 = After.data; ~~~~~ !!! error TS2449: Class 'After' used before its declaration. -!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:10:7: 'After' was declared here. +!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:10:7: 'After' is declared here. ~~~~ !!! error TS2729: Property 'data' is used before its initialization. -!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:11:12: 'data' was declared here. +!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:11:12: 'data' is declared here. static illegal3 = After.method; ~~~~~ !!! error TS2449: Class 'After' used before its declaration. -!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:10:7: 'After' was declared here. +!!! related TS2728 tests/cases/compiler/scopeCheckStaticInitializer.ts:10:7: 'After' is declared here. static data = 13; static method() { } } diff --git a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt index 39a4901da98b8..b138f3dbe0d3d 100644 --- a/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt +++ b/tests/baselines/reference/spellingSuggestionLeadingUnderscores01.errors.txt @@ -12,6 +12,7 @@ tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts(14,5): error TS23 a.___foo ~~~~~~ !!! error TS2551: Property '___foo' does not exist on type '{ __foo: 10; }'. Did you mean '__foo'? +!!! related TS2728 tests/cases/compiler/spellingSuggestionLeadingUnderscores01.ts:3:5: '__foo' is declared here. // @filename def.ts export let b: { diff --git a/tests/baselines/reference/spellingSuggestionModule.errors.txt b/tests/baselines/reference/spellingSuggestionModule.errors.txt index 5333bcc4cc4a2..13a84599cb10c 100644 --- a/tests/baselines/reference/spellingSuggestionModule.errors.txt +++ b/tests/baselines/reference/spellingSuggestionModule.errors.txt @@ -18,4 +18,5 @@ tests/cases/compiler/spellingSuggestionModule.ts(8,1): error TS2552: Cannot find faroo; ~~~~~ !!! error TS2552: Cannot find name 'faroo'. Did you mean 'farboo'? +!!! related TS2728 tests/cases/compiler/spellingSuggestionModule.ts:7:16: 'farboo' is declared here. \ No newline at end of file diff --git a/tests/baselines/reference/strictModeReservedWord.errors.txt b/tests/baselines/reference/strictModeReservedWord.errors.txt index 87f73c5780acc..6ddfbe328746a 100644 --- a/tests/baselines/reference/strictModeReservedWord.errors.txt +++ b/tests/baselines/reference/strictModeReservedWord.errors.txt @@ -134,6 +134,7 @@ tests/cases/compiler/strictModeReservedWord.ts(24,5): error TS2349: Cannot invok ublic(); ~~~~~ !!! error TS2552: Cannot find name 'ublic'. Did you mean 'public'? +!!! related TS2728 tests/cases/compiler/strictModeReservedWord.ts:5:9: 'public' is declared here. static(); ~~~~~~ !!! error TS1212: Identifier expected. 'static' is a reserved word in strict mode. diff --git a/tests/baselines/reference/symbolProperty33.errors.txt b/tests/baselines/reference/symbolProperty33.errors.txt index 0b6672903f508..5c23a80f8ca7f 100644 --- a/tests/baselines/reference/symbolProperty33.errors.txt +++ b/tests/baselines/reference/symbolProperty33.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty33.ts(7,6): error TS1023: An i class C1 extends C2 { ~~ !!! error TS2449: Class 'C2' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/Symbols/symbolProperty33.ts:6:7: 'C2' was declared here. +!!! related TS2728 tests/cases/conformance/es6/Symbols/symbolProperty33.ts:6:7: 'C2' is declared here. [Symbol.toStringTag]() { return { x: "" }; } diff --git a/tests/baselines/reference/symbolProperty34.errors.txt b/tests/baselines/reference/symbolProperty34.errors.txt index b7aae39174b3f..bd909ae3b68c5 100644 --- a/tests/baselines/reference/symbolProperty34.errors.txt +++ b/tests/baselines/reference/symbolProperty34.errors.txt @@ -6,7 +6,7 @@ tests/cases/conformance/es6/Symbols/symbolProperty34.ts(7,6): error TS1023: An i class C1 extends C2 { ~~ !!! error TS2449: Class 'C2' used before its declaration. -!!! related TS2728 tests/cases/conformance/es6/Symbols/symbolProperty34.ts:6:7: 'C2' was declared here. +!!! related TS2728 tests/cases/conformance/es6/Symbols/symbolProperty34.ts:6:7: 'C2' is declared here. [Symbol.toStringTag]() { return { x: "" }; } diff --git a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt index 24be0fa24f457..76a6186cdda64 100644 --- a/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt +++ b/tests/baselines/reference/taggedTemplateStringsWithOverloadResolution3_ES6.errors.txt @@ -88,6 +88,7 @@ tests/cases/conformance/es6/templates/taggedTemplateStringsWithOverloadResolutio fn5 `${ (n) => n.toFixed() }`; // will error; 'n' should have type 'string'. ~~~~~~~ !!! error TS2551: Property 'toFixed' does not exist on type 'string'. Did you mean 'fixed'? +!!! related TS2728 /.ts/lib.es2015.core.d.ts:466:5: 'fixed' is declared here. fn5 `${ (n) => n.substr(0) }`; \ No newline at end of file diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js index 140ee34db4f27..cbdee94b59fe1 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ fooexport, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.oldTranspile.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.oldTranspile.js index 140ee34db4f27..cbdee94b59fe1 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.oldTranspile.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with CommonJS option.oldTranspile.js @@ -17,7 +17,7 @@ var MyClass1 = /** @class */ (function () { var _a; MyClass1 = __decorate([ fooexport, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js index ff5c79971ca94..bfe85714bf69c 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.js @@ -25,7 +25,7 @@ System.register(["angular2/core"], function (exports_1, context_1) { var _a; MyClass1 = __decorate([ fooexport, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.oldTranspile.js b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.oldTranspile.js index ff5c79971ca94..bfe85714bf69c 100644 --- a/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.oldTranspile.js +++ b/tests/baselines/reference/transpile/Correctly serialize metadata when transpile with System option.oldTranspile.js @@ -25,7 +25,7 @@ System.register(["angular2/core"], function (exports_1, context_1) { var _a; MyClass1 = __decorate([ fooexport, - __metadata("design:paramtypes", [typeof (_a = (typeof ng !== "undefined" && ng).ElementRef) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof ng !== "undefined" && ng.ElementRef) === "function" ? _a : Object]) ], MyClass1); return MyClass1; }()); diff --git a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js index 388bdf1a66c4f..1d12cb158a5fe 100644 --- a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js +++ b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.js @@ -12,7 +12,7 @@ var MyClass = /** @class */ (function () { var _a; MyClass = __decorate([ someDecorator, - __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object]) ], MyClass); return MyClass; }()); diff --git a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.oldTranspile.js b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.oldTranspile.js index 388bdf1a66c4f..1d12cb158a5fe 100644 --- a/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.oldTranspile.js +++ b/tests/baselines/reference/transpile/Transpile with emit decorators and emit metadata.oldTranspile.js @@ -12,7 +12,7 @@ var MyClass = /** @class */ (function () { var _a; MyClass = __decorate([ someDecorator, - __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" && _a || Object]) + __metadata("design:paramtypes", [typeof (_a = typeof db_1.db !== "undefined" && db_1.db) === "function" ? _a : Object]) ], MyClass); return MyClass; }()); diff --git a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt index 0bdb19c5db9ff..c8175f280d582 100644 --- a/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt +++ b/tests/baselines/reference/tsxStatelessFunctionComponents2.errors.txt @@ -34,6 +34,7 @@ tests/cases/conformance/jsx/file.tsx(35,26): error TS2339: Property 'propertyNot let e = x.greeting.subtr(10)} />; ~~~~~ !!! error TS2551: Property 'subtr' does not exist on type 'string'. Did you mean 'substr'? +!!! related TS2728 /.lib/lib.d.ts:438:5: 'substr' is declared here. // Error (ref callback is contextually typed) let f = x.notARealProperty} />; ~~~~~~~~~~~~~~~~ diff --git a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt index 4be44cc799a1a..13374b71236ce 100644 --- a/tests/baselines/reference/typeGuardFunctionErrors.errors.txt +++ b/tests/baselines/reference/typeGuardFunctionErrors.errors.txt @@ -166,6 +166,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 a.propB; ~~~~~ !!! error TS2551: Property 'propB' does not exist on type 'A'. Did you mean 'propA'? +!!! related TS2728 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts:2:5: 'propA' is declared here. } // Parameter index and argument index for the type guard target is not matching. @@ -173,6 +174,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 a.propB; // Error ~~~~~ !!! error TS2551: Property 'propB' does not exist on type 'A'. Did you mean 'propA'? +!!! related TS2728 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts:2:5: 'propA' is declared here. } // No type guard in if statement @@ -180,6 +182,7 @@ tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts(166,54 a.propB; ~~~~~ !!! error TS2551: Property 'propB' does not exist on type 'A'. Did you mean 'propA'? +!!! related TS2728 tests/cases/conformance/expressions/typeGuards/typeGuardFunctionErrors.ts:2:5: 'propA' is declared here. } // Type predicate type is not assignable diff --git a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt index b93be614f745c..a15eed1a8683e 100644 --- a/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt +++ b/tests/baselines/reference/typeGuardsWithInstanceOfByConstructorSignature.errors.txt @@ -258,9 +258,11 @@ tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstru obj16.foo1; ~~~~ !!! error TS2551: Property 'foo1' does not exist on type 'H'. Did you mean 'foo'? +!!! related TS2728 tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts:175:5: 'foo' is declared here. obj16.foo2; ~~~~ !!! error TS2551: Property 'foo2' does not exist on type 'H'. Did you mean 'foo'? +!!! related TS2728 tests/cases/conformance/expressions/typeGuards/typeGuardsWithInstanceOfByConstructorSignature.ts:175:5: 'foo' is declared here. } var obj17: any; diff --git a/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt b/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt index f01f7520cbad5..36dfa00cf534d 100644 --- a/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt +++ b/tests/baselines/reference/typeParametersAndParametersInComputedNames.errors.txt @@ -13,5 +13,6 @@ tests/cases/compiler/typeParametersAndParametersInComputedNames.ts(6,13): error !!! error TS2304: Cannot find name 'T'. ~ !!! error TS2552: Cannot find name 'a'. Did you mean 'A'? +!!! related TS2728 tests/cases/compiler/typeParametersAndParametersInComputedNames.ts:5:7: 'A' is declared here. } } \ No newline at end of file diff --git a/tests/baselines/reference/typedefCrossModule2.symbols b/tests/baselines/reference/typedefCrossModule2.symbols index 79fbb1ab509a2..b2143e14aa4fb 100644 --- a/tests/baselines/reference/typedefCrossModule2.symbols +++ b/tests/baselines/reference/typedefCrossModule2.symbols @@ -14,7 +14,9 @@ var bb; var bbb = new mod.Baz(); >bbb : Symbol(bbb, Decl(use.js, 5, 3)) +>mod.Baz : Symbol(Baz) >mod : Symbol(mod, Decl(use.js, 0, 3)) +>Baz : Symbol(Baz) === tests/cases/conformance/jsdoc/mod1.js === // error diff --git a/tests/baselines/reference/typeofStripsFreshness.js b/tests/baselines/reference/typeofStripsFreshness.js new file mode 100644 index 0000000000000..827021be944ce --- /dev/null +++ b/tests/baselines/reference/typeofStripsFreshness.js @@ -0,0 +1,27 @@ +//// [typeofStripsFreshness.ts] +interface Collection { + elems: T[]; +} +interface CollectionStatic { + new (): Collection; +} +declare const Collection: CollectionStatic; + +const ALL = "all"; +type All = typeof ALL; + +const result: Collection = new Collection(); + +const ANOTHER = "another"; +type Another = typeof ANOTHER; + +type Both = Another | All; + +const result2: Collection = new Collection(); + + +//// [typeofStripsFreshness.js] +var ALL = "all"; +var result = new Collection(); +var ANOTHER = "another"; +var result2 = new Collection(); diff --git a/tests/baselines/reference/typeofStripsFreshness.symbols b/tests/baselines/reference/typeofStripsFreshness.symbols new file mode 100644 index 0000000000000..2d3a2e67ad3ef --- /dev/null +++ b/tests/baselines/reference/typeofStripsFreshness.symbols @@ -0,0 +1,52 @@ +=== tests/cases/compiler/typeofStripsFreshness.ts === +interface Collection { +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) +>T : Symbol(T, Decl(typeofStripsFreshness.ts, 0, 21)) + + elems: T[]; +>elems : Symbol(Collection.elems, Decl(typeofStripsFreshness.ts, 0, 25)) +>T : Symbol(T, Decl(typeofStripsFreshness.ts, 0, 21)) +} +interface CollectionStatic { +>CollectionStatic : Symbol(CollectionStatic, Decl(typeofStripsFreshness.ts, 2, 1)) + + new (): Collection; +>T : Symbol(T, Decl(typeofStripsFreshness.ts, 4, 9)) +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) +>T : Symbol(T, Decl(typeofStripsFreshness.ts, 4, 9)) +} +declare const Collection: CollectionStatic; +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) +>CollectionStatic : Symbol(CollectionStatic, Decl(typeofStripsFreshness.ts, 2, 1)) + +const ALL = "all"; +>ALL : Symbol(ALL, Decl(typeofStripsFreshness.ts, 8, 5)) + +type All = typeof ALL; +>All : Symbol(All, Decl(typeofStripsFreshness.ts, 8, 18)) +>ALL : Symbol(ALL, Decl(typeofStripsFreshness.ts, 8, 5)) + +const result: Collection = new Collection(); +>result : Symbol(result, Decl(typeofStripsFreshness.ts, 11, 5)) +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) +>All : Symbol(All, Decl(typeofStripsFreshness.ts, 8, 18)) +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) + +const ANOTHER = "another"; +>ANOTHER : Symbol(ANOTHER, Decl(typeofStripsFreshness.ts, 13, 5)) + +type Another = typeof ANOTHER; +>Another : Symbol(Another, Decl(typeofStripsFreshness.ts, 13, 26)) +>ANOTHER : Symbol(ANOTHER, Decl(typeofStripsFreshness.ts, 13, 5)) + +type Both = Another | All; +>Both : Symbol(Both, Decl(typeofStripsFreshness.ts, 14, 30)) +>Another : Symbol(Another, Decl(typeofStripsFreshness.ts, 13, 26)) +>All : Symbol(All, Decl(typeofStripsFreshness.ts, 8, 18)) + +const result2: Collection = new Collection(); +>result2 : Symbol(result2, Decl(typeofStripsFreshness.ts, 18, 5)) +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) +>Both : Symbol(Both, Decl(typeofStripsFreshness.ts, 14, 30)) +>Collection : Symbol(Collection, Decl(typeofStripsFreshness.ts, 0, 0), Decl(typeofStripsFreshness.ts, 6, 13)) + diff --git a/tests/baselines/reference/typeofStripsFreshness.types b/tests/baselines/reference/typeofStripsFreshness.types new file mode 100644 index 0000000000000..e99d91dcfd080 --- /dev/null +++ b/tests/baselines/reference/typeofStripsFreshness.types @@ -0,0 +1,56 @@ +=== tests/cases/compiler/typeofStripsFreshness.ts === +interface Collection { +>Collection : Collection +>T : T + + elems: T[]; +>elems : T[] +>T : T +} +interface CollectionStatic { +>CollectionStatic : CollectionStatic + + new (): Collection; +>T : T +>Collection : Collection +>T : T +} +declare const Collection: CollectionStatic; +>Collection : CollectionStatic +>CollectionStatic : CollectionStatic + +const ALL = "all"; +>ALL : "all" +>"all" : "all" + +type All = typeof ALL; +>All : "all" +>ALL : "all" + +const result: Collection = new Collection(); +>result : Collection<"all"> +>Collection : Collection +>All : "all" +>new Collection() : Collection<"all"> +>Collection : CollectionStatic + +const ANOTHER = "another"; +>ANOTHER : "another" +>"another" : "another" + +type Another = typeof ANOTHER; +>Another : "another" +>ANOTHER : "another" + +type Both = Another | All; +>Both : Both +>Another : "another" +>All : "all" + +const result2: Collection = new Collection(); +>result2 : Collection +>Collection : Collection +>Both : Both +>new Collection() : Collection +>Collection : CollectionStatic + diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt new file mode 100644 index 0000000000000..e95a184d15a5b --- /dev/null +++ b/tests/baselines/reference/unionTypeWithIndexSignature.errors.txt @@ -0,0 +1,47 @@ +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(11,3): error TS2339: Property 'bar' does not exist on type 'Missing'. + Property 'bar' does not exist on type '{ [s: string]: string; }'. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(14,4): error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(24,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(25,1): error TS2322: Type '"not ok"' is not assignable to type 'number'. +tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts(26,1): error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. + + +==== tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts (5 errors) ==== + type Two = { foo: { bar: true }, baz: true } | { [s: string]: string }; + declare var u: Two + u.foo = 'bye' + u.baz = 'hi' + type Three = { foo: number } | { [s: string]: string } | { [s: string]: boolean }; + declare var v: Three + v.foo = false + type Missing = { foo: number, bar: true } | { [s: string]: string } | { foo: boolean } + declare var m: Missing + m.foo = 'hi' + m.bar + ~~~ +!!! error TS2339: Property 'bar' does not exist on type 'Missing'. +!!! error TS2339: Property 'bar' does not exist on type '{ [s: string]: string; }'. + type RO = { foo: number } | { readonly [s: string]: string } + declare var ro: RO + ro.foo = 'not allowed' + ~~~ +!!! error TS2540: Cannot assign to 'foo' because it is a constant or a read-only property. + type Num = { '0': string } | { [n: number]: number } + declare var num: Num + num[0] = 1 + num['0'] = 'ok' + const sym = Symbol() + type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number } + declare var both: Both + both['s'] = 'ok' + both[0] = 1 + both[1] = 0 // not ok + ~~~~~~~ +!!! error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. + both[0] = 'not ok' + ~~~~~~~ +!!! error TS2322: Type '"not ok"' is not assignable to type 'number'. + both[sym] = 'not ok' + ~~~~~~~~~ +!!! error TS7017: Element implicitly has an 'any' type because type 'Both' has no index signature. + \ No newline at end of file diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.js b/tests/baselines/reference/unionTypeWithIndexSignature.js new file mode 100644 index 0000000000000..53cf98c612000 --- /dev/null +++ b/tests/baselines/reference/unionTypeWithIndexSignature.js @@ -0,0 +1,45 @@ +//// [unionTypeWithIndexSignature.ts] +type Two = { foo: { bar: true }, baz: true } | { [s: string]: string }; +declare var u: Two +u.foo = 'bye' +u.baz = 'hi' +type Three = { foo: number } | { [s: string]: string } | { [s: string]: boolean }; +declare var v: Three +v.foo = false +type Missing = { foo: number, bar: true } | { [s: string]: string } | { foo: boolean } +declare var m: Missing +m.foo = 'hi' +m.bar +type RO = { foo: number } | { readonly [s: string]: string } +declare var ro: RO +ro.foo = 'not allowed' +type Num = { '0': string } | { [n: number]: number } +declare var num: Num +num[0] = 1 +num['0'] = 'ok' +const sym = Symbol() +type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number } +declare var both: Both +both['s'] = 'ok' +both[0] = 1 +both[1] = 0 // not ok +both[0] = 'not ok' +both[sym] = 'not ok' + + +//// [unionTypeWithIndexSignature.js] +"use strict"; +u.foo = 'bye'; +u.baz = 'hi'; +v.foo = false; +m.foo = 'hi'; +m.bar; +ro.foo = 'not allowed'; +num[0] = 1; +num['0'] = 'ok'; +const sym = Symbol(); +both['s'] = 'ok'; +both[0] = 1; +both[1] = 0; // not ok +both[0] = 'not ok'; +both[sym] = 'not ok'; diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.symbols b/tests/baselines/reference/unionTypeWithIndexSignature.symbols new file mode 100644 index 0000000000000..b207423057b8b --- /dev/null +++ b/tests/baselines/reference/unionTypeWithIndexSignature.symbols @@ -0,0 +1,123 @@ +=== tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts === +type Two = { foo: { bar: true }, baz: true } | { [s: string]: string }; +>Two : Symbol(Two, Decl(unionTypeWithIndexSignature.ts, 0, 0)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 0, 12)) +>bar : Symbol(bar, Decl(unionTypeWithIndexSignature.ts, 0, 19)) +>baz : Symbol(baz, Decl(unionTypeWithIndexSignature.ts, 0, 32)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 0, 50)) + +declare var u: Two +>u : Symbol(u, Decl(unionTypeWithIndexSignature.ts, 1, 11)) +>Two : Symbol(Two, Decl(unionTypeWithIndexSignature.ts, 0, 0)) + +u.foo = 'bye' +>u.foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 0, 12)) +>u : Symbol(u, Decl(unionTypeWithIndexSignature.ts, 1, 11)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 0, 12)) + +u.baz = 'hi' +>u.baz : Symbol(baz, Decl(unionTypeWithIndexSignature.ts, 0, 32)) +>u : Symbol(u, Decl(unionTypeWithIndexSignature.ts, 1, 11)) +>baz : Symbol(baz, Decl(unionTypeWithIndexSignature.ts, 0, 32)) + +type Three = { foo: number } | { [s: string]: string } | { [s: string]: boolean }; +>Three : Symbol(Three, Decl(unionTypeWithIndexSignature.ts, 3, 12)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 4, 14)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 4, 34)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 4, 60)) + +declare var v: Three +>v : Symbol(v, Decl(unionTypeWithIndexSignature.ts, 5, 11)) +>Three : Symbol(Three, Decl(unionTypeWithIndexSignature.ts, 3, 12)) + +v.foo = false +>v.foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 4, 14)) +>v : Symbol(v, Decl(unionTypeWithIndexSignature.ts, 5, 11)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 4, 14)) + +type Missing = { foo: number, bar: true } | { [s: string]: string } | { foo: boolean } +>Missing : Symbol(Missing, Decl(unionTypeWithIndexSignature.ts, 6, 13)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 7, 16)) +>bar : Symbol(bar, Decl(unionTypeWithIndexSignature.ts, 7, 29)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 7, 47)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 7, 71)) + +declare var m: Missing +>m : Symbol(m, Decl(unionTypeWithIndexSignature.ts, 8, 11)) +>Missing : Symbol(Missing, Decl(unionTypeWithIndexSignature.ts, 6, 13)) + +m.foo = 'hi' +>m.foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 7, 16), Decl(unionTypeWithIndexSignature.ts, 7, 71)) +>m : Symbol(m, Decl(unionTypeWithIndexSignature.ts, 8, 11)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 7, 16), Decl(unionTypeWithIndexSignature.ts, 7, 71)) + +m.bar +>m : Symbol(m, Decl(unionTypeWithIndexSignature.ts, 8, 11)) + +type RO = { foo: number } | { readonly [s: string]: string } +>RO : Symbol(RO, Decl(unionTypeWithIndexSignature.ts, 10, 5)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 11, 11)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 11, 40)) + +declare var ro: RO +>ro : Symbol(ro, Decl(unionTypeWithIndexSignature.ts, 12, 11)) +>RO : Symbol(RO, Decl(unionTypeWithIndexSignature.ts, 10, 5)) + +ro.foo = 'not allowed' +>ro.foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 11, 11)) +>ro : Symbol(ro, Decl(unionTypeWithIndexSignature.ts, 12, 11)) +>foo : Symbol(foo, Decl(unionTypeWithIndexSignature.ts, 11, 11)) + +type Num = { '0': string } | { [n: number]: number } +>Num : Symbol(Num, Decl(unionTypeWithIndexSignature.ts, 13, 22)) +>'0' : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 14, 12)) +>n : Symbol(n, Decl(unionTypeWithIndexSignature.ts, 14, 32)) + +declare var num: Num +>num : Symbol(num, Decl(unionTypeWithIndexSignature.ts, 15, 11)) +>Num : Symbol(Num, Decl(unionTypeWithIndexSignature.ts, 13, 22)) + +num[0] = 1 +>num : Symbol(num, Decl(unionTypeWithIndexSignature.ts, 15, 11)) +>0 : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 14, 12)) + +num['0'] = 'ok' +>num : Symbol(num, Decl(unionTypeWithIndexSignature.ts, 15, 11)) +>'0' : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 14, 12)) + +const sym = Symbol() +>sym : Symbol(sym, Decl(unionTypeWithIndexSignature.ts, 18, 5)) +>Symbol : Symbol(Symbol, Decl(lib.es5.d.ts, --, --), Decl(lib.es2015.symbol.d.ts, --, --), Decl(lib.es2015.symbol.wellknown.d.ts, --, --), Decl(lib.esnext.symbol.d.ts, --, --)) + +type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number } +>Both : Symbol(Both, Decl(unionTypeWithIndexSignature.ts, 18, 20)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 19, 13)) +>'0' : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 19, 24)) +>[sym] : Symbol([sym], Decl(unionTypeWithIndexSignature.ts, 19, 37)) +>sym : Symbol(sym, Decl(unionTypeWithIndexSignature.ts, 18, 5)) +>n : Symbol(n, Decl(unionTypeWithIndexSignature.ts, 19, 60)) +>s : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 19, 81)) + +declare var both: Both +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) +>Both : Symbol(Both, Decl(unionTypeWithIndexSignature.ts, 18, 20)) + +both['s'] = 'ok' +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) +>'s' : Symbol(s, Decl(unionTypeWithIndexSignature.ts, 19, 13)) + +both[0] = 1 +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) +>0 : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 19, 24)) + +both[1] = 0 // not ok +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) + +both[0] = 'not ok' +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) +>0 : Symbol('0', Decl(unionTypeWithIndexSignature.ts, 19, 24)) + +both[sym] = 'not ok' +>both : Symbol(both, Decl(unionTypeWithIndexSignature.ts, 20, 11)) +>sym : Symbol(sym, Decl(unionTypeWithIndexSignature.ts, 18, 5)) + diff --git a/tests/baselines/reference/unionTypeWithIndexSignature.types b/tests/baselines/reference/unionTypeWithIndexSignature.types new file mode 100644 index 0000000000000..b8d12eb63d90c --- /dev/null +++ b/tests/baselines/reference/unionTypeWithIndexSignature.types @@ -0,0 +1,161 @@ +=== tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts === +type Two = { foo: { bar: true }, baz: true } | { [s: string]: string }; +>Two : Two +>foo : { bar: true; } +>bar : true +>true : true +>baz : true +>true : true +>s : string + +declare var u: Two +>u : Two +>Two : Two + +u.foo = 'bye' +>u.foo = 'bye' : "bye" +>u.foo : string | { bar: true; } +>u : Two +>foo : string | { bar: true; } +>'bye' : "bye" + +u.baz = 'hi' +>u.baz = 'hi' : "hi" +>u.baz : string | true +>u : Two +>baz : string | true +>'hi' : "hi" + +type Three = { foo: number } | { [s: string]: string } | { [s: string]: boolean }; +>Three : Three +>foo : number +>s : string +>s : string + +declare var v: Three +>v : Three +>Three : Three + +v.foo = false +>v.foo = false : false +>v.foo : string | number | boolean +>v : Three +>foo : string | number | boolean +>false : false + +type Missing = { foo: number, bar: true } | { [s: string]: string } | { foo: boolean } +>Missing : Missing +>foo : number +>bar : true +>true : true +>s : string +>foo : boolean + +declare var m: Missing +>m : Missing +>Missing : Missing + +m.foo = 'hi' +>m.foo = 'hi' : "hi" +>m.foo : string | number | boolean +>m : Missing +>foo : string | number | boolean +>'hi' : "hi" + +m.bar +>m.bar : any +>m : Missing +>bar : any + +type RO = { foo: number } | { readonly [s: string]: string } +>RO : RO +>foo : number +>s : string + +declare var ro: RO +>ro : RO +>RO : RO + +ro.foo = 'not allowed' +>ro.foo = 'not allowed' : "not allowed" +>ro.foo : any +>ro : RO +>foo : any +>'not allowed' : "not allowed" + +type Num = { '0': string } | { [n: number]: number } +>Num : Num +>'0' : string +>n : number + +declare var num: Num +>num : Num +>Num : Num + +num[0] = 1 +>num[0] = 1 : 1 +>num[0] : string | number +>num : Num +>0 : 0 +>1 : 1 + +num['0'] = 'ok' +>num['0'] = 'ok' : "ok" +>num['0'] : string | number +>num : Num +>'0' : "0" +>'ok' : "ok" + +const sym = Symbol() +>sym : unique symbol +>Symbol() : unique symbol +>Symbol : SymbolConstructor + +type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number } +>Both : Both +>s : number +>'0' : number +>[sym] : boolean +>sym : unique symbol +>n : number +>s : string + +declare var both: Both +>both : Both +>Both : Both + +both['s'] = 'ok' +>both['s'] = 'ok' : "ok" +>both['s'] : string | number +>both : Both +>'s' : "s" +>'ok' : "ok" + +both[0] = 1 +>both[0] = 1 : 1 +>both[0] : number +>both : Both +>0 : 0 +>1 : 1 + +both[1] = 0 // not ok +>both[1] = 0 : 0 +>both[1] : any +>both : Both +>1 : 1 +>0 : 0 + +both[0] = 'not ok' +>both[0] = 'not ok' : "not ok" +>both[0] : number +>both : Both +>0 : 0 +>'not ok' : "not ok" + +both[sym] = 'not ok' +>both[sym] = 'not ok' : "not ok" +>both[sym] : any +>both : Both +>sym : unique symbol +>'not ok' : "not ok" + diff --git a/tests/baselines/reference/unreachableJavascriptChecked.errors.txt b/tests/baselines/reference/unreachableJavascriptChecked.errors.txt index c66b342177fcd..a4aee3b7805dd 100644 --- a/tests/baselines/reference/unreachableJavascriptChecked.errors.txt +++ b/tests/baselines/reference/unreachableJavascriptChecked.errors.txt @@ -1,10 +1,18 @@ tests/cases/compiler/unreachable.js(3,5): error TS7027: Unreachable code detected. +tests/cases/compiler/unreachable.js(6,5): error TS7027: Unreachable code detected. -==== tests/cases/compiler/unreachable.js (1 errors) ==== +==== tests/cases/compiler/unreachable.js (2 errors) ==== function unreachable() { - return 1; + return f(); return 2; - ~~~~~~ + ~~~~~~~~~ + return 3; + ~~~~~~~~~~~~~ !!! error TS7027: Unreachable code detected. - } \ No newline at end of file + function f() {} + return 4; + ~~~~~~~~~ +!!! error TS7027: Unreachable code detected. + } + \ No newline at end of file diff --git a/tests/baselines/reference/unreachableJavascriptChecked.js b/tests/baselines/reference/unreachableJavascriptChecked.js index 6bf264bf3d22c..d12d4af675348 100644 --- a/tests/baselines/reference/unreachableJavascriptChecked.js +++ b/tests/baselines/reference/unreachableJavascriptChecked.js @@ -1,11 +1,18 @@ //// [unreachable.js] function unreachable() { - return 1; + return f(); return 2; -} + return 3; + function f() {} + return 4; +} + //// [unreachable.js] function unreachable() { - return 1; + return f(); return 2; + return 3; + function f() { } + return 4; } diff --git a/tests/baselines/reference/unreachableJavascriptChecked.symbols b/tests/baselines/reference/unreachableJavascriptChecked.symbols index f2db6a6a3477f..11610239f5939 100644 --- a/tests/baselines/reference/unreachableJavascriptChecked.symbols +++ b/tests/baselines/reference/unreachableJavascriptChecked.symbols @@ -2,6 +2,14 @@ function unreachable() { >unreachable : Symbol(unreachable, Decl(unreachable.js, 0, 0)) - return 1; + return f(); +>f : Symbol(f, Decl(unreachable.js, 3, 13)) + return 2; + return 3; + function f() {} +>f : Symbol(f, Decl(unreachable.js, 3, 13)) + + return 4; } + diff --git a/tests/baselines/reference/unreachableJavascriptChecked.types b/tests/baselines/reference/unreachableJavascriptChecked.types index 266a9038875cb..d27af1d33d88d 100644 --- a/tests/baselines/reference/unreachableJavascriptChecked.types +++ b/tests/baselines/reference/unreachableJavascriptChecked.types @@ -1,10 +1,21 @@ === tests/cases/compiler/unreachable.js === function unreachable() { ->unreachable : () => 1 | 2 +>unreachable : () => void | 2 | 3 | 4 - return 1; ->1 : 1 + return f(); +>f() : void +>f : () => void return 2; >2 : 2 + + return 3; +>3 : 3 + + function f() {} +>f : () => void + + return 4; +>4 : 4 } + diff --git a/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.errors.txt b/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.errors.txt index cf5699de3742e..e58e7fa02e9f8 100644 --- a/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.errors.txt +++ b/tests/baselines/reference/useBeforeDeclaration_propertyAssignment.errors.txt @@ -6,7 +6,7 @@ tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts(2,27): error TS2 public a = { b: this.b }; ~ !!! error TS2729: Property 'b' is used before its initialization. -!!! related TS2728 tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts:3:13: 'b' was declared here. +!!! related TS2728 tests/cases/compiler/useBeforeDeclaration_propertyAssignment.ts:3:13: 'b' is declared here. private b = 0; } \ No newline at end of file diff --git a/tests/baselines/reference/useBeforeDeclaration_superClass.errors.txt b/tests/baselines/reference/useBeforeDeclaration_superClass.errors.txt index 869812bc0e543..50ccb0afa7772 100644 --- a/tests/baselines/reference/useBeforeDeclaration_superClass.errors.txt +++ b/tests/baselines/reference/useBeforeDeclaration_superClass.errors.txt @@ -29,7 +29,7 @@ tests/cases/compiler/useBeforeDeclaration_superClass.ts(25,18): error TS2729: Pr old_x = this.x; ~ !!! error TS2729: Property 'x' is used before its initialization. -!!! related TS2728 tests/cases/compiler/useBeforeDeclaration_superClass.ts:26:5: 'x' was declared here. +!!! related TS2728 tests/cases/compiler/useBeforeDeclaration_superClass.ts:26:5: 'x' is declared here. x = 1; } \ No newline at end of file diff --git a/tests/cases/compiler/checkDestructuringShorthandAssigment.ts b/tests/cases/compiler/checkDestructuringShorthandAssigment.ts new file mode 100644 index 0000000000000..e3422aae753f9 --- /dev/null +++ b/tests/cases/compiler/checkDestructuringShorthandAssigment.ts @@ -0,0 +1,8 @@ +// @allowjs: true +// @checkjs: true +// @noEmit: true +// @Filename: bug25434.js +// should not crash while checking +function Test({ b = '' } = {}) {} + +Test(({ b = '5' } = {})); diff --git a/tests/cases/compiler/errorElaboration.ts b/tests/cases/compiler/errorElaboration.ts index 97ec0dde61cd5..87575f1df1195 100644 --- a/tests/cases/compiler/errorElaboration.ts +++ b/tests/cases/compiler/errorElaboration.ts @@ -10,3 +10,9 @@ interface Container { declare function foo(x: () => Container>): void; let a: () => Container>; foo(a); + +// Repro for #25498 + +function test(): {[A in "foo"]: A} { + return {foo: "bar"}; +} diff --git a/tests/cases/compiler/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.ts b/tests/cases/compiler/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.ts new file mode 100644 index 0000000000000..8133a3b3ab102 --- /dev/null +++ b/tests/cases/compiler/experimentalDecoratorMetadataUnresolvedTypeObjectInEmit.ts @@ -0,0 +1,15 @@ +// @experimentalDecorators: true +// @emitDecoratorMetadata: true +// @filename: types.d.ts +declare namespace A { + export namespace B { + export namespace C { + export namespace D { + } + } + } +} +// @filename: usage.ts +class Foo { + f(@decorate user: A.B.C.D.E): void {} +} diff --git a/tests/cases/compiler/noCrashOnMixin.ts b/tests/cases/compiler/noCrashOnMixin.ts new file mode 100644 index 0000000000000..900e827fa46cd --- /dev/null +++ b/tests/cases/compiler/noCrashOnMixin.ts @@ -0,0 +1,23 @@ +class Abstract { + protected constructor() { + } +} + +class Concrete extends Abstract { +} + +type Constructor = new (...args: any[]) => T; + +function Mixin(Base: TBase) { + return class extends Base { + }; +} + +class Empty { +} + +class CrashTrigger extends Mixin(Empty) { + public trigger() { + new Concrete(); + } +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleEmitNone.ts b/tests/cases/compiler/requireOfJsonFileWithModuleEmitNone.ts new file mode 100644 index 0000000000000..d7834a175f4d2 --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleEmitNone.ts @@ -0,0 +1,13 @@ +// @module: none +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleEmitUndefined.ts b/tests/cases/compiler/requireOfJsonFileWithModuleEmitUndefined.ts new file mode 100644 index 0000000000000..c8f71d03e674c --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleEmitUndefined.ts @@ -0,0 +1,12 @@ +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmd.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmd.ts new file mode 100644 index 0000000000000..2f56f43a75305 --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitAmd.ts @@ -0,0 +1,14 @@ +// @module: amd +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.ts new file mode 100644 index 0000000000000..fc6746a05705a --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEs2015.ts @@ -0,0 +1,14 @@ +// @module: es2015 +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.ts new file mode 100644 index 0000000000000..a42dff430062b --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitEsNext.ts @@ -0,0 +1,14 @@ +// @module: esnext +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.ts new file mode 100644 index 0000000000000..efb05bf693e64 --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitNone.ts @@ -0,0 +1,14 @@ +// @module: none +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitSystem.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitSystem.ts new file mode 100644 index 0000000000000..c1aa7182bf6cc --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitSystem.ts @@ -0,0 +1,14 @@ +// @module: system +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUmd.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUmd.ts new file mode 100644 index 0000000000000..dcb91f70897fa --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUmd.ts @@ -0,0 +1,14 @@ +// @module: umd +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.ts b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.ts new file mode 100644 index 0000000000000..901728cd0645f --- /dev/null +++ b/tests/cases/compiler/requireOfJsonFileWithModuleNodeResolutionEmitUndefined.ts @@ -0,0 +1,13 @@ +// @moduleResolution: node +// @outdir: out/ +// @fullEmitPaths: true +// @resolveJsonModule: true + +// @Filename: file1.ts +import * as b from './b.json'; + +// @Filename: b.json +{ + "a": true, + "b": "hello" +} \ No newline at end of file diff --git a/tests/cases/compiler/typeofStripsFreshness.ts b/tests/cases/compiler/typeofStripsFreshness.ts new file mode 100644 index 0000000000000..93ef939a2242a --- /dev/null +++ b/tests/cases/compiler/typeofStripsFreshness.ts @@ -0,0 +1,19 @@ +interface Collection { + elems: T[]; +} +interface CollectionStatic { + new (): Collection; +} +declare const Collection: CollectionStatic; + +const ALL = "all"; +type All = typeof ALL; + +const result: Collection = new Collection(); + +const ANOTHER = "another"; +type Another = typeof ANOTHER; + +type Both = Another | All; + +const result2: Collection = new Collection(); diff --git a/tests/cases/compiler/unreachableJavascriptChecked.ts b/tests/cases/compiler/unreachableJavascriptChecked.ts index afddcba6a23b1..3d9c906dc05e2 100644 --- a/tests/cases/compiler/unreachableJavascriptChecked.ts +++ b/tests/cases/compiler/unreachableJavascriptChecked.ts @@ -4,6 +4,9 @@ // @outDir: out // @allowUnreachableCode: false function unreachable() { - return 1; + return f(); return 2; -} \ No newline at end of file + return 3; + function f() {} + return 4; +} diff --git a/tests/cases/conformance/jsdoc/checkJsdocTypeTag5.ts b/tests/cases/conformance/jsdoc/checkJsdocTypeTag5.ts new file mode 100644 index 0000000000000..f56b99b9e99e9 --- /dev/null +++ b/tests/cases/conformance/jsdoc/checkJsdocTypeTag5.ts @@ -0,0 +1,18 @@ +// @checkJs: true +// @allowJs: true +// @noEmit: true +// @Filename: test.js +// all 6 should error on return statement/expression +/** @type {(x: number) => string} */ +function h(x) { return x } +/** @type {(x: number) => string} */ +var f = x => x +/** @type {(x: number) => string} */ +var g = function (x) { return x } + +/** @type {{ (x: number): string }} */ +function i(x) { return x } +/** @type {{ (x: number): string }} */ +var j = x => x +/** @type {{ (x: number): string }} */ +var k = function (x) { return x } diff --git a/tests/cases/conformance/jsdoc/jsdocTypeReferenceUseBeforeDef.ts b/tests/cases/conformance/jsdoc/jsdocTypeReferenceUseBeforeDef.ts new file mode 100644 index 0000000000000..93e735e1fa68f --- /dev/null +++ b/tests/cases/conformance/jsdoc/jsdocTypeReferenceUseBeforeDef.ts @@ -0,0 +1,8 @@ +// @noEmit: true +// @allowJs: true +// @checkJs: true +// @Filename: bug25097.js +/** @type {C | null} */ +const c = null +class C { +} diff --git a/tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts b/tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts new file mode 100644 index 0000000000000..cda563811d7aa --- /dev/null +++ b/tests/cases/conformance/types/union/unionTypeWithIndexSignature.ts @@ -0,0 +1,28 @@ +// @target: esnext +// @strict: true +type Two = { foo: { bar: true }, baz: true } | { [s: string]: string }; +declare var u: Two +u.foo = 'bye' +u.baz = 'hi' +type Three = { foo: number } | { [s: string]: string } | { [s: string]: boolean }; +declare var v: Three +v.foo = false +type Missing = { foo: number, bar: true } | { [s: string]: string } | { foo: boolean } +declare var m: Missing +m.foo = 'hi' +m.bar +type RO = { foo: number } | { readonly [s: string]: string } +declare var ro: RO +ro.foo = 'not allowed' +type Num = { '0': string } | { [n: number]: number } +declare var num: Num +num[0] = 1 +num['0'] = 'ok' +const sym = Symbol() +type Both = { s: number, '0': number, [sym]: boolean } | { [n: number]: number, [s: string]: string | number } +declare var both: Both +both['s'] = 'ok' +both[0] = 1 +both[1] = 0 // not ok +both[0] = 'not ok' +both[sym] = 'not ok' diff --git a/tests/cases/fourslash/autoCloseTag.ts b/tests/cases/fourslash/autoCloseTag.ts index ba828f207a24d..6ba0b0f209f25 100644 --- a/tests/cases/fourslash/autoCloseTag.ts +++ b/tests/cases/fourslash/autoCloseTag.ts @@ -1,20 +1,51 @@ /// -// @Filename: /a.tsx +// Using separate files for each example to avoid unclosed JSX tags affecting other tests. + +// @Filename: /0.tsx ////const x =
/*0*/; + +// @Filename: /1.tsx ////const x =
foo/*1*/
; + +// @Filename: /2.tsx ////const x =
/*2*/; + +// @Filename: /3.tsx ////const x =
/*3*/; + +// @Filename: /4.tsx ////const x =
////

/*4*/ ////

////

; + +// @Filename: /5.tsx ////const x =
text /*5*/; +// @Filename: /6.tsx +////const x =
+////
/*6*/ +////
; + +// @Filename: /7.tsx +////const x =
+////

/*7*/ +////

; + +// @Filename: /8.tsx +////const x =
+////
/*8*/
+////
; + verify.jsxClosingTag({ 0: { newText: "
" }, 1: undefined, 2: undefined, 3: undefined, 4: { newText: "

" }, + 5: { newText: "
" }, + 6: { newText: "
" }, + 7: { newText: "

" }, + 8: undefined, }); diff --git a/tests/cases/fourslash/codeFixUnreachableCode.ts b/tests/cases/fourslash/codeFixUnreachableCode.ts index 5f70d51c1ee10..9c9eea6dae40c 100644 --- a/tests/cases/fourslash/codeFixUnreachableCode.ts +++ b/tests/cases/fourslash/codeFixUnreachableCode.ts @@ -2,29 +2,30 @@ ////function f() { //// return f(); -//// [|return|] 1; +//// [|return 1;|] //// function f() {} -//// return 2; +//// [|return 2;|] //// type T = number; //// interface I {} //// const enum E {} -//// enum E {} +//// [|enum E {}|] //// namespace N { export type T = number; } -//// namespace N { export const x: T = 0; } +//// [|namespace N { export const x: T = 0; }|] //// var x: I; -//// var y: T = 0; -//// E; N; x; y; +//// [|var y: T = 0; +//// E; N; x; y;|] ////} -verify.getSuggestionDiagnostics([{ +verify.getSuggestionDiagnostics(test.ranges().map((range): FourSlashInterface.Diagnostic => ({ message: "Unreachable code detected.", code: 7027, reportsUnnecessary: true, -}]); + range, +}))); -verify.codeFix({ - description: "Remove unreachable code", - index: 0, +verify.codeFixAll({ + fixId: "fixUnreachableCode", + fixAllDescription: "Remove all unreachable code", newFileContent: `function f() { return f(); diff --git a/tests/cases/fourslash/completionsTriggerCharacter.ts b/tests/cases/fourslash/completionsTriggerCharacter.ts index 959785a68c1c0..e4709ab48f7ae 100644 --- a/tests/cases/fourslash/completionsTriggerCharacter.ts +++ b/tests/cases/fourslash/completionsTriggerCharacter.ts @@ -42,7 +42,7 @@ verify.completions( { marker: "openTag", includes: "div", triggerCharacter: "<" }, { marker: "lessThan", exact: undefined, triggerCharacter: "<" }, - { marker: "closeTag", exact: "div", triggerCharacter: "/" }, + { marker: "closeTag", exact: "div>", triggerCharacter: "/" }, { marker: "path", exact: "importMe", triggerCharacter: "/", isNewIdentifierLocation: true }, { marker: "divide", exact: undefined, triggerCharacter: "/" }, ); diff --git a/tests/cases/fourslash/completionsUniqueSymbol_import.ts b/tests/cases/fourslash/completionsUniqueSymbol_import.ts index f15bc59abff85..df3034e56fe9e 100644 --- a/tests/cases/fourslash/completionsUniqueSymbol_import.ts +++ b/tests/cases/fourslash/completionsUniqueSymbol_import.ts @@ -1,12 +1,17 @@ /// -// @Filename: /a.ts +// @noLib: true + +// @Filename: /globals.d.ts ////declare const Symbol: () => symbol; + +// @Filename: /a.ts ////const privateSym = Symbol(); ////export const publicSym = Symbol(); ////export interface I { //// [privateSym]: number; //// [publicSym]: number; +//// [defaultPublicSym]: number; //// n: number; ////} ////export const i: I; @@ -17,10 +22,21 @@ verify.completions({ marker: "", - // TODO: GH#25095 Should include `publicSym` - exact: "n", + exact: [ + "n", + { name: "publicSym", insertText: "[publicSym]", replacementSpan: test.ranges()[0], hasAction: true }, + ], preferences: { includeInsertTextCompletions: true, includeCompletionsForModuleExports: true, }, }); + +verify.applyCodeActionFromCompletion("", { + name: "publicSym", + source: "/a", + description: `Add 'publicSym' to existing import declaration from "./a"`, + newFileContent: +`import { i, publicSym } from "./a"; +i.;` +}); diff --git a/tests/cases/fourslash/fourslash.ts b/tests/cases/fourslash/fourslash.ts index 81cb387b73d96..ddad4ca52a6b9 100644 --- a/tests/cases/fourslash/fourslash.ts +++ b/tests/cases/fourslash/fourslash.ts @@ -554,7 +554,6 @@ declare namespace FourSlashInterface { overloadsCount?: number; docComment?: string; text?: string; - name?: string; parameterName?: string; parameterSpan?: string; parameterDocComment?: string; diff --git a/tests/cases/fourslash/getJSXOutliningSpans.tsx b/tests/cases/fourslash/getJSXOutliningSpans.tsx new file mode 100644 index 0000000000000..fa4f541b1939b --- /dev/null +++ b/tests/cases/fourslash/getJSXOutliningSpans.tsx @@ -0,0 +1,33 @@ +////import React, { Component } from 'react'; +//// +////export class Home extends Component[| { +//// render()[| { +//// return ( +//// [|
+//// [|

Hello, world!

|] +//// [||] +////
+//// +////
|] +//// ); +//// }|] +////}|] + +verify.outliningSpansInCurrentFile(test.ranges(), "code"); diff --git a/tests/cases/fourslash/jsxQualifiedTagCompletion.ts b/tests/cases/fourslash/jsxQualifiedTagCompletion.ts index 3d799324e7edf..826a4e9d4d2a1 100644 --- a/tests/cases/fourslash/jsxQualifiedTagCompletion.ts +++ b/tests/cases/fourslash/jsxQualifiedTagCompletion.ts @@ -6,10 +6,8 @@ //// export var Foo: any = null; //// } //// const j = Hello!/**/ -//// +//// goTo.marker(); edit.insert("" }); diff --git a/tests/cases/fourslash/quickInfoCanBeTruncated.ts b/tests/cases/fourslash/quickInfoCanBeTruncated.ts new file mode 100644 index 0000000000000..9c8965641d9d4 --- /dev/null +++ b/tests/cases/fourslash/quickInfoCanBeTruncated.ts @@ -0,0 +1,580 @@ +/// + +// @noLib: true +//// interface Foo { +//// _0: 0; +//// _1: 1; +//// _2: 2; +//// _3: 3; +//// _4: 4; +//// _5: 5; +//// _6: 6; +//// _7: 7; +//// _8: 8; +//// _9: 9; +//// _10: 10; +//// _11: 11; +//// _12: 12; +//// _13: 13; +//// _14: 14; +//// _15: 15; +//// _16: 16; +//// _17: 17; +//// _18: 18; +//// _19: 19; +//// _20: 20; +//// _21: 21; +//// _22: 22; +//// _23: 23; +//// _24: 24; +//// _25: 25; +//// _26: 26; +//// _27: 27; +//// _28: 28; +//// _29: 29; +//// _30: 30; +//// _31: 31; +//// _32: 32; +//// _33: 33; +//// _34: 34; +//// _35: 35; +//// _36: 36; +//// _37: 37; +//// _38: 38; +//// _39: 39; +//// _40: 40; +//// _41: 41; +//// _42: 42; +//// _43: 43; +//// _44: 44; +//// _45: 45; +//// _46: 46; +//// _47: 47; +//// _48: 48; +//// _49: 49; +//// _50: 50; +//// _51: 51; +//// _52: 52; +//// _53: 53; +//// _54: 54; +//// _55: 55; +//// _56: 56; +//// _57: 57; +//// _58: 58; +//// _59: 59; +//// _60: 60; +//// _61: 61; +//// _62: 62; +//// _63: 63; +//// _64: 64; +//// _65: 65; +//// _66: 66; +//// _67: 67; +//// _68: 68; +//// _69: 69; +//// _70: 70; +//// _71: 71; +//// _72: 72; +//// _73: 73; +//// _74: 74; +//// _75: 75; +//// _76: 76; +//// _77: 77; +//// _78: 78; +//// _79: 79; +//// _80: 80; +//// _81: 81; +//// _82: 82; +//// _83: 83; +//// _84: 84; +//// _85: 85; +//// _86: 86; +//// _87: 87; +//// _88: 88; +//// _89: 89; +//// _90: 90; +//// _91: 91; +//// _92: 92; +//// _93: 93; +//// _94: 94; +//// _95: 95; +//// _96: 96; +//// _97: 97; +//// _98: 98; +//// _99: 99; +//// _100: 100; +//// _101: 101; +//// _102: 102; +//// _103: 103; +//// _104: 104; +//// _105: 105; +//// _106: 106; +//// _107: 107; +//// _108: 108; +//// _109: 109; +//// _110: 110; +//// _111: 111; +//// _112: 112; +//// _113: 113; +//// _114: 114; +//// _115: 115; +//// _116: 116; +//// _117: 117; +//// _118: 118; +//// _119: 119; +//// _120: 120; +//// _121: 121; +//// _122: 122; +//// _123: 123; +//// _124: 124; +//// _125: 125; +//// _126: 126; +//// _127: 127; +//// _128: 128; +//// _129: 129; +//// _130: 130; +//// _131: 131; +//// _132: 132; +//// _133: 133; +//// _134: 134; +//// _135: 135; +//// _136: 136; +//// _137: 137; +//// _138: 138; +//// _139: 139; +//// _140: 140; +//// _141: 141; +//// _142: 142; +//// _143: 143; +//// _144: 144; +//// _145: 145; +//// _146: 146; +//// _147: 147; +//// _148: 148; +//// _149: 149; +//// _150: 150; +//// _151: 151; +//// _152: 152; +//// _153: 153; +//// _154: 154; +//// _155: 155; +//// _156: 156; +//// _157: 157; +//// _158: 158; +//// _159: 159; +//// _160: 160; +//// _161: 161; +//// _162: 162; +//// _163: 163; +//// _164: 164; +//// _165: 165; +//// _166: 166; +//// _167: 167; +//// _168: 168; +//// _169: 169; +//// _170: 170; +//// _171: 171; +//// _172: 172; +//// _173: 173; +//// _174: 174; +//// _175: 175; +//// _176: 176; +//// _177: 177; +//// _178: 178; +//// _179: 179; +//// _180: 180; +//// _181: 181; +//// _182: 182; +//// _183: 183; +//// _184: 184; +//// _185: 185; +//// _186: 186; +//// _187: 187; +//// _188: 188; +//// _189: 189; +//// _190: 190; +//// _191: 191; +//// _192: 192; +//// _193: 193; +//// _194: 194; +//// _195: 195; +//// _196: 196; +//// _197: 197; +//// _198: 198; +//// _199: 199; +//// _200: 200; +//// _201: 201; +//// _202: 202; +//// _203: 203; +//// _204: 204; +//// _205: 205; +//// _206: 206; +//// _207: 207; +//// _208: 208; +//// _209: 209; +//// _210: 210; +//// _211: 211; +//// _212: 212; +//// _213: 213; +//// _214: 214; +//// _215: 215; +//// _216: 216; +//// _217: 217; +//// _218: 218; +//// _219: 219; +//// _220: 220; +//// _221: 221; +//// _222: 222; +//// _223: 223; +//// _224: 224; +//// _225: 225; +//// _226: 226; +//// _227: 227; +//// _228: 228; +//// _229: 229; +//// _230: 230; +//// _231: 231; +//// _232: 232; +//// _233: 233; +//// _234: 234; +//// _235: 235; +//// _236: 236; +//// _237: 237; +//// _238: 238; +//// _239: 239; +//// _240: 240; +//// _241: 241; +//// _242: 242; +//// _243: 243; +//// _244: 244; +//// _245: 245; +//// _246: 246; +//// _247: 247; +//// _248: 248; +//// _249: 249; +//// _250: 250; +//// _251: 251; +//// _252: 252; +//// _253: 253; +//// _254: 254; +//// _255: 255; +//// _256: 256; +//// _257: 257; +//// _258: 258; +//// _259: 259; +//// _260: 260; +//// _261: 261; +//// _262: 262; +//// _263: 263; +//// _264: 264; +//// _265: 265; +//// _266: 266; +//// _267: 267; +//// _268: 268; +//// _269: 269; +//// _270: 270; +//// _271: 271; +//// _272: 272; +//// _273: 273; +//// _274: 274; +//// _275: 275; +//// _276: 276; +//// _277: 277; +//// _278: 278; +//// _279: 279; +//// _280: 280; +//// _281: 281; +//// _282: 282; +//// _283: 283; +//// _284: 284; +//// _285: 285; +//// _286: 286; +//// _287: 287; +//// _288: 288; +//// _289: 289; +//// _290: 290; +//// _291: 291; +//// _292: 292; +//// _293: 293; +//// _294: 294; +//// _295: 295; +//// _296: 296; +//// _297: 297; +//// _298: 298; +//// _299: 299; +//// _300: 300; +//// _301: 301; +//// _302: 302; +//// _303: 303; +//// _304: 304; +//// _305: 305; +//// _306: 306; +//// _307: 307; +//// _308: 308; +//// _309: 309; +//// _310: 310; +//// _311: 311; +//// _312: 312; +//// _313: 313; +//// _314: 314; +//// _315: 315; +//// _316: 316; +//// _317: 317; +//// _318: 318; +//// _319: 319; +//// _320: 320; +//// _321: 321; +//// _322: 322; +//// _323: 323; +//// _324: 324; +//// _325: 325; +//// _326: 326; +//// _327: 327; +//// _328: 328; +//// _329: 329; +//// _330: 330; +//// _331: 331; +//// _332: 332; +//// _333: 333; +//// _334: 334; +//// _335: 335; +//// _336: 336; +//// _337: 337; +//// _338: 338; +//// _339: 339; +//// _340: 340; +//// _341: 341; +//// _342: 342; +//// _343: 343; +//// _344: 344; +//// _345: 345; +//// _346: 346; +//// _347: 347; +//// _348: 348; +//// _349: 349; +//// _350: 350; +//// _351: 351; +//// _352: 352; +//// _353: 353; +//// _354: 354; +//// _355: 355; +//// _356: 356; +//// _357: 357; +//// _358: 358; +//// _359: 359; +//// _360: 360; +//// _361: 361; +//// _362: 362; +//// _363: 363; +//// _364: 364; +//// _365: 365; +//// _366: 366; +//// _367: 367; +//// _368: 368; +//// _369: 369; +//// _370: 370; +//// _371: 371; +//// _372: 372; +//// _373: 373; +//// _374: 374; +//// _375: 375; +//// _376: 376; +//// _377: 377; +//// _378: 378; +//// _379: 379; +//// _380: 380; +//// _381: 381; +//// _382: 382; +//// _383: 383; +//// _384: 384; +//// _385: 385; +//// _386: 386; +//// _387: 387; +//// _388: 388; +//// _389: 389; +//// _390: 390; +//// _391: 391; +//// _392: 392; +//// _393: 393; +//// _394: 394; +//// _395: 395; +//// _396: 396; +//// _397: 397; +//// _398: 398; +//// _399: 399; +//// _400: 400; +//// _401: 401; +//// _402: 402; +//// _403: 403; +//// _404: 404; +//// _405: 405; +//// _406: 406; +//// _407: 407; +//// _408: 408; +//// _409: 409; +//// _410: 410; +//// _411: 411; +//// _412: 412; +//// _413: 413; +//// _414: 414; +//// _415: 415; +//// _416: 416; +//// _417: 417; +//// _418: 418; +//// _419: 419; +//// _420: 420; +//// _421: 421; +//// _422: 422; +//// _423: 423; +//// _424: 424; +//// _425: 425; +//// _426: 426; +//// _427: 427; +//// _428: 428; +//// _429: 429; +//// _430: 430; +//// _431: 431; +//// _432: 432; +//// _433: 433; +//// _434: 434; +//// _435: 435; +//// _436: 436; +//// _437: 437; +//// _438: 438; +//// _439: 439; +//// _440: 440; +//// _441: 441; +//// _442: 442; +//// _443: 443; +//// _444: 444; +//// _445: 445; +//// _446: 446; +//// _447: 447; +//// _448: 448; +//// _449: 449; +//// _450: 450; +//// _451: 451; +//// _452: 452; +//// _453: 453; +//// _454: 454; +//// _455: 455; +//// _456: 456; +//// _457: 457; +//// _458: 458; +//// _459: 459; +//// _460: 460; +//// _461: 461; +//// _462: 462; +//// _463: 463; +//// _464: 464; +//// _465: 465; +//// _466: 466; +//// _467: 467; +//// _468: 468; +//// _469: 469; +//// _470: 470; +//// _471: 471; +//// _472: 472; +//// _473: 473; +//// _474: 474; +//// _475: 475; +//// _476: 476; +//// _477: 477; +//// _478: 478; +//// _479: 479; +//// _480: 480; +//// _481: 481; +//// _482: 482; +//// _483: 483; +//// _484: 484; +//// _485: 485; +//// _486: 486; +//// _487: 487; +//// _488: 488; +//// _489: 489; +//// _490: 490; +//// _491: 491; +//// _492: 492; +//// _493: 493; +//// _494: 494; +//// _495: 495; +//// _496: 496; +//// _497: 497; +//// _498: 498; +//// _499: 499; +//// } +//// type A/*1*/ = keyof Foo; +//// type Exclude = T extends U ? never : T; +//// type Less/*2*/ = Exclude; +//// function f(s: T, x: Exclude, y: string) {} +//// f("_499", /*3*/); +//// type Decomposed/*4*/ = {[K in A]: Foo[K]} +//// type LongTuple/*5*/ = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17.18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70]; +//// type DeeplyMapped/*6*/ = {[K in keyof Foo]: {[K2 in keyof Foo]: [K, K2, Foo[K], Foo[K2]]}} + +goTo.marker("1"); +verify.quickInfoIs(`type A = "_0" | "_1" | "_2" | "_3" | "_4" | "_5" | "_6" | "_7" | "_8" | "_9" | "_10" | "_11" | "_12" | "_13" | "_14" | "_15" | "_16" | "_17" | "_18" | "_19" | "_20" | "_21" | "_22" | "_23" | "_24" | ... 474 more ... | "_499"`); +goTo.marker("2"); +verify.quickInfoIs(`type Less = "_1" | "_2" | "_3" | "_4" | "_5" | "_6" | "_7" | "_8" | "_9" | "_10" | "_11" | "_12" | "_13" | "_14" | "_15" | "_16" | "_17" | "_18" | "_19" | "_20" | "_21" | "_22" | "_23" | "_24" | "_25" | ... 473 more ... | "_499"`); +goTo.marker("3"); +verify.signatureHelp({ + marker: "3", + text: `f(s: T, x: Exclude<"_0", T> | Exclude<"_1", T> | Exclude<"_2", T> | Exclude<"_3", T> | Exclude<"_4", T> | Exclude<"_5", T> | Exclude<"_6", T> | Exclude<"_7", T> | Exclude<...> | ... 490 more ... | Exclude<...>, y: string): void` +}); +goTo.marker("4"); +verify.quickInfoIs(`type Decomposed = { + _0: 0; + _1: 1; + _2: 2; + _3: 3; + _4: 4; + _5: 5; + _6: 6; + _7: 7; + _8: 8; + _9: 9; + _10: 10; + _11: 11; + _12: 12; + _13: 13; + _14: 14; + _15: 15; + _16: 16; + _17: 17; + _18: 18; + _19: 19; + _20: 20; + _21: 21; + _22: 22; + _23: 23; + _24: 24; + _25: 25; + _26: 26; + _27: 27; + _28: 28; + _29: 29; + _30: 30; + ... 468 more ...; + _499: 499; +}`); +goTo.marker("5"); +verify.quickInfoIs(`type LongTuple = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17.18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, ... 27 more ..., 70]`); +goTo.marker("6"); +verify.quickInfoIs(`type DeeplyMapped = { + _0: { + _0: ["_0", "_0", 0, 0]; + _1: ["_0", "_1", 0, 1]; + _2: ["_0", "_2", 0, 2]; + _3: ["_0", "_3", 0, 3]; + _4: ["_0", "_4", 0, 4]; + _5: ["_0", "_5", 0, 5]; + _6: ["_0", "_6", 0, 6]; + _7: ["_0", "_7", 0, 7]; + ... 491 more ...; + _499: [...]; + }; + ... 498 more ...; + _499: { + ...; + }; +}`); diff --git a/tests/cases/fourslash/signatureHelpFilteredTriggerCharacters01.ts b/tests/cases/fourslash/signatureHelpFilteredTriggerCharacters01.ts deleted file mode 100644 index ed97ef020d07e..0000000000000 --- a/tests/cases/fourslash/signatureHelpFilteredTriggerCharacters01.ts +++ /dev/null @@ -1,23 +0,0 @@ -/// - -////function foo(x: T): T { -//// throw null; -////} -//// -////foo("/**/") - -goTo.marker(); -for (const triggerCharacter of ["<", "(", ","]) { - edit.insert(triggerCharacter); - verify.noSignatureHelpForTriggerReason({ - kind: "characterTyped", - triggerCharacter, - }); - verify.signatureHelpPresentForTriggerReason({ - kind: "retrigger", - triggerCharacter, - }); - edit.backspace(); -} -verify.signatureHelpPresentForTriggerReason(/*triggerReason*/ undefined); -verify.signatureHelpPresentForTriggerReason({ kind: "invoked" }); \ No newline at end of file diff --git a/tests/cases/fourslash/signatureHelpFilteredTriggers01.ts b/tests/cases/fourslash/signatureHelpFilteredTriggers01.ts new file mode 100644 index 0000000000000..ebf5ba10f2d58 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpFilteredTriggers01.ts @@ -0,0 +1,31 @@ +/// + +////function foo(x: T): T { +//// throw null; +////} +//// +////foo("/*1*/"); +////foo('/*2*/'); +////foo(` ${100}/*3*/`); +////foo(/* /*4*/ */); +////foo( +//// ///*5*/ +////); + +for (const marker of test.markers()) { + goTo.marker(marker); + for (const triggerCharacter of ["<", "(", ","]) { + edit.insert(triggerCharacter); + verify.noSignatureHelpForTriggerReason({ + kind: "characterTyped", + triggerCharacter, + }); + verify.signatureHelpPresentForTriggerReason({ + kind: "retrigger", + triggerCharacter, + }); + edit.backspace(); + } + verify.signatureHelpPresentForTriggerReason(/*triggerReason*/ undefined); + verify.signatureHelpPresentForTriggerReason({ kind: "invoked" }); +} diff --git a/tests/cases/fourslash/signatureHelpFilteredTriggers02.ts b/tests/cases/fourslash/signatureHelpFilteredTriggers02.ts new file mode 100644 index 0000000000000..e193f919e05b5 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpFilteredTriggers02.ts @@ -0,0 +1,36 @@ +/// + +////function foo(x: T): T { +//// throw null; +////} +//// +////foo(/*1*/""); +////foo(` ${100/*2*/}`); +////foo(/*3*/); +////foo(100 /*4*/) +////foo([/*5*/]) +////foo({ hello: "hello"/*6*/}) + +const charMap = { + 1: "(", + 2: ",", + 3: "(", + 4: "<", + 5: ",", + 6: ",", +} + +for (const markerName of Object.keys(charMap)) { + const triggerCharacter = charMap[markerName]; + goTo.marker(markerName); + edit.insert(triggerCharacter); + verify.noSignatureHelpForTriggerReason({ + kind: "characterTyped", + triggerCharacter, + }); + verify.signatureHelpPresentForTriggerReason({ + kind: "retrigger", + triggerCharacter, + }); + edit.backspace(triggerCharacter.length); +} diff --git a/tests/cases/fourslash/signatureHelpFilteredTriggers03.ts b/tests/cases/fourslash/signatureHelpFilteredTriggers03.ts new file mode 100644 index 0000000000000..7b17082361075 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpFilteredTriggers03.ts @@ -0,0 +1,23 @@ +/// + +////declare class ViewJayEss { +//// constructor(obj: object); +////} +////new ViewJayEss({ +//// methods: { +//// sayHello/**/ +//// } +////}); + +goTo.marker(); +edit.insert("("); +verify.noSignatureHelpForTriggerReason({ + kind: "characterTyped", + triggerCharacter: "(", +}); + +edit.insert(") {},"); +verify.noSignatureHelpForTriggerReason({ + kind: "characterTyped", + triggerCharacter: ",", +}); diff --git a/tests/cases/fourslash/signatureHelpWithTriggers01.ts b/tests/cases/fourslash/signatureHelpWithTriggers01.ts new file mode 100644 index 0000000000000..ae73b5fe00041 --- /dev/null +++ b/tests/cases/fourslash/signatureHelpWithTriggers01.ts @@ -0,0 +1,31 @@ +/// + +////declare function foo(x: T, y: T): T; +//// +////foo/*1*//*2*/; +////foo(/*3*/100/*4*/); +////foo/*5*//*6*/(); + +const charMap = { + 1: "(", + 2: "<", + 3: ",", + 4: ",", + 5: "(", + 6: "<", +} + +for (const markerName of Object.keys(charMap)) { + const triggerCharacter = charMap[markerName]; + goTo.marker(markerName); + edit.insert(triggerCharacter); + verify.signatureHelpPresentForTriggerReason({ + kind: "characterTyped", + triggerCharacter, + }); + verify.signatureHelpPresentForTriggerReason({ + kind: "retrigger", + triggerCharacter, + }); + edit.backspace(triggerCharacter.length); +} diff --git a/tests/cases/fourslash/signatureHelpWithTriggers02.ts b/tests/cases/fourslash/signatureHelpWithTriggers02.ts new file mode 100644 index 0000000000000..cb73237f8fd2d --- /dev/null +++ b/tests/cases/fourslash/signatureHelpWithTriggers02.ts @@ -0,0 +1,38 @@ +/// + +////declare function foo(x: T, y: T): T; +////declare function bar(x: U, y: U): U; +//// +////foo(bar/*1*/) + +goTo.marker("1"); + +edit.insert("("); +verify.signatureHelp({ + text: "bar(x: U, y: U): U", + triggerReason: { + kind: "characterTyped", + triggerCharacter: "(", + } +}); +edit.backspace(); + +edit.insert("<"); +verify.signatureHelp({ + text: "bar(x: U, y: U): U", + triggerReason: { + kind: "characterTyped", + triggerCharacter: "(", + } +}); +edit.backspace(); + +edit.insert(","); +verify.signatureHelp({ + text: "foo(x: (x: U, y: U) => U, y: (x: U, y: U) => U): (x: U, y: U) => U", + triggerReason: { + kind: "characterTyped", + triggerCharacter: "(", + } +}); +edit.backspace(); \ No newline at end of file diff --git a/tests/cases/fourslash/tsxCompletion10.ts b/tests/cases/fourslash/tsxCompletion10.ts index d36b236921879..747b4a802d66b 100644 --- a/tests/cases/fourslash/tsxCompletion10.ts +++ b/tests/cases/fourslash/tsxCompletion10.ts @@ -9,6 +9,4 @@ //// } //// var x1 =
" }); diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts index 554dd23bcbc90..c7b494e59a184 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTag1.ts @@ -9,6 +9,4 @@ //// } //// var x1 =
" }); diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts index 7719e04a9ef6f..e4fefcfe5d389 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX1.ts @@ -3,6 +3,4 @@ //@Filename: file.tsx //// var x1 =
" }); diff --git a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX2.ts b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX2.ts index 97bfc7da781ea..ec66e3eb2c76f 100644 --- a/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX2.ts +++ b/tests/cases/fourslash/tsxCompletionOnClosingTagWithoutJSX2.ts @@ -5,4 +5,4 @@ ////

Hello world //// -verify.completions({ marker: "1", exact: ["div"] }, { marker: "2", exact: ["h1"] }); +verify.completions({ marker: "1", exact: "div" }, { marker: "2", exact: "h1" }); diff --git a/tests/projects/outfile-concat/first/tsconfig.json b/tests/projects/outfile-concat/first/tsconfig.json index f71a818258537..8d63a0c4a0626 100644 --- a/tests/projects/outfile-concat/first/tsconfig.json +++ b/tests/projects/outfile-concat/first/tsconfig.json @@ -6,7 +6,6 @@ "strict": false, "sourceMap": true, "declarationMap": true, - "declaration": true, "outFile": "./bin/first-output.js" }, "files": [