mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Merge main into branch
This commit is contained in:
@@ -1,4 +1,9 @@
|
||||
**/node_modules/**
|
||||
/built/local/**
|
||||
/tests/**
|
||||
/lib/**
|
||||
/src/lib/*.generated.d.ts
|
||||
/scripts/*.js
|
||||
/scripts/eslint/built/**
|
||||
/internal/**
|
||||
/coverage/**
|
||||
|
||||
@@ -13,6 +13,17 @@
|
||||
"plugins": [
|
||||
"@typescript-eslint", "jsdoc", "no-null", "import"
|
||||
],
|
||||
"overrides": [
|
||||
// By default, the ESLint CLI only looks at .js files. But, it will also look at
|
||||
// any files which are referenced in an override config. Most users of typescript-eslint
|
||||
// get this behavior by default by extending a recommended typescript-eslint config, which
|
||||
// just so happens to override some core ESLint rules. We don't extend from any config, so
|
||||
// explicitly reference TS files here so the CLI picks them up.
|
||||
//
|
||||
// ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so
|
||||
// that will work regardless of the below.
|
||||
{ "files": ["*.ts"] }
|
||||
],
|
||||
"rules": {
|
||||
"@typescript-eslint/adjacent-overload-signatures": "error",
|
||||
"@typescript-eslint/array-type": "error",
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
sandersn
|
||||
elibarzilay
|
||||
weswigham
|
||||
andrewbranch
|
||||
RyanCavanaugh
|
||||
sheetalkamat
|
||||
orta
|
||||
rbuckton
|
||||
ahejlsberg
|
||||
amcasey
|
||||
jessetrinity
|
||||
minestarks
|
||||
armanio123
|
||||
gabritto
|
||||
jakebailey
|
||||
DanielRosenwasser
|
||||
navya9singh
|
||||
|
||||
@@ -31,10 +31,6 @@ jobs:
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
check-latest: true
|
||||
- name: Remove existing TypeScript
|
||||
run: |
|
||||
npm uninstall typescript --no-save
|
||||
npm uninstall tslint --no-save
|
||||
- run: npm ci
|
||||
|
||||
# Re: https://github.com/actions/setup-node/pull/125
|
||||
|
||||
@@ -12,10 +12,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
- name: Remove existing TypeScript
|
||||
run: |
|
||||
npm uninstall typescript --no-save
|
||||
npm uninstall tslint --no-save
|
||||
- name: npm install and test
|
||||
run: |
|
||||
npm ci
|
||||
|
||||
@@ -16,13 +16,14 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 14
|
||||
node-version: 16
|
||||
|
||||
- name: Configure git and update package-lock.json
|
||||
run: |
|
||||
git config user.email "typescriptbot@microsoft.com"
|
||||
git config user.name "TypeScript Bot"
|
||||
npm install --package-lock-only --ignore-scripts
|
||||
rm package-lock.json
|
||||
npm install --package-lock-only --ignore-scripts # This is a no-op if package-lock.json is present.
|
||||
git add -f package-lock.json
|
||||
if git commit -m "Update package-lock.json"; then
|
||||
git push
|
||||
|
||||
@@ -54,6 +54,7 @@ scripts/produceLKG.js
|
||||
scripts/importDefinitelyTypedTests/importDefinitelyTypedTests.js
|
||||
scripts/generateLocalizedDiagnosticMessages.js
|
||||
scripts/request-pr-review.js
|
||||
scripts/errorCheck.js
|
||||
scripts/*.js.map
|
||||
scripts/typings/
|
||||
coverage/
|
||||
|
||||
Vendored
-1
@@ -6,7 +6,6 @@
|
||||
],
|
||||
"eslint.options": {
|
||||
"rulePaths": ["./scripts/eslint/built/rules/"],
|
||||
"extensions": [".ts"]
|
||||
},
|
||||
// To use the last-known-good (LKG) compiler version:
|
||||
// "typescript.tsdk": "lib"
|
||||
|
||||
+6
-24
@@ -92,18 +92,12 @@ const localize = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
const buildShims = () => buildProject("src/shims");
|
||||
const cleanShims = () => cleanProject("src/shims");
|
||||
cleanTasks.push(cleanShims);
|
||||
|
||||
const buildDebugTools = () => buildProject("src/debug");
|
||||
const cleanDebugTools = () => cleanProject("src/debug");
|
||||
cleanTasks.push(cleanDebugTools);
|
||||
|
||||
const buildShimsAndTools = parallel(buildShims, buildDebugTools);
|
||||
|
||||
// Pre-build steps when targeting the LKG compiler
|
||||
const lkgPreBuild = parallel(generateLibs, series(buildScripts, generateDiagnostics, buildShimsAndTools));
|
||||
const lkgPreBuild = parallel(generateLibs, series(buildScripts, generateDiagnostics, buildDebugTools));
|
||||
|
||||
const buildTsc = () => buildProject("src/tsc");
|
||||
task("tsc", series(lkgPreBuild, buildTsc));
|
||||
@@ -119,7 +113,7 @@ task("watch-tsc", series(lkgPreBuild, parallel(watchLib, watchDiagnostics, watch
|
||||
task("watch-tsc").description = "Watch for changes and rebuild the command-line compiler only.";
|
||||
|
||||
// Pre-build steps when targeting the built/local compiler.
|
||||
const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagnostics, buildShimsAndTools, buildTsc));
|
||||
const localPreBuild = parallel(generateLibs, series(buildScripts, generateDiagnostics, buildDebugTools, buildTsc));
|
||||
|
||||
// Pre-build steps to use based on supplied options.
|
||||
const preBuild = cmdLineOptions.lkg ? lkgPreBuild : localPreBuild;
|
||||
@@ -356,7 +350,6 @@ task("run-eslint-rules-tests").description = "Runs the eslint rule tests";
|
||||
|
||||
/** @type { (folder: string) => { (): Promise<any>; displayName?: string } } */
|
||||
const eslint = (folder) => async () => {
|
||||
|
||||
const formatter = cmdLineOptions.ci ? "stylish" : "autolinkable-stylish";
|
||||
const args = [
|
||||
"node_modules/eslint/bin/eslint",
|
||||
@@ -364,7 +357,6 @@ const eslint = (folder) => async () => {
|
||||
"--cache-location", `${folder}/.eslintcache`,
|
||||
"--format", formatter,
|
||||
"--rulesdir", "scripts/eslint/built/rules",
|
||||
"--ext", ".ts",
|
||||
];
|
||||
|
||||
if (cmdLineOptions.fix) {
|
||||
@@ -377,22 +369,12 @@ const eslint = (folder) => async () => {
|
||||
return exec(process.execPath, args);
|
||||
};
|
||||
|
||||
const lintScripts = eslint("scripts");
|
||||
lintScripts.displayName = "lint-scripts";
|
||||
task("lint-scripts", series([buildEslintRules, lintScripts]));
|
||||
task("lint-scripts").description = "Runs eslint on the scripts sources.";
|
||||
const lintRoot = eslint(".");
|
||||
lintRoot.displayName = "lint";
|
||||
|
||||
const lintCompiler = eslint("src");
|
||||
lintCompiler.displayName = "lint-compiler";
|
||||
task("lint-compiler", series([buildEslintRules, lintCompiler]));
|
||||
task("lint-compiler").description = "Runs eslint on the compiler sources.";
|
||||
task("lint-compiler").flags = {
|
||||
" --ci": "Runs eslint additional rules",
|
||||
};
|
||||
|
||||
const lint = series([buildEslintRules, lintScripts, lintCompiler]);
|
||||
const lint = series([buildEslintRules, lintRoot]);
|
||||
lint.displayName = "lint";
|
||||
task("lint", series([buildEslintRules, lint]));
|
||||
task("lint", lint);
|
||||
task("lint").description = "Runs eslint on the compiler and scripts sources.";
|
||||
task("lint").flags = {
|
||||
" --ci": "Runs eslint additional rules",
|
||||
|
||||
Generated
+9446
-588
File diff suppressed because it is too large
Load Diff
+9
-5
@@ -2,7 +2,7 @@
|
||||
"name": "typescript",
|
||||
"author": "Microsoft Corp.",
|
||||
"homepage": "https://www.typescriptlang.org/",
|
||||
"version": "4.8.0",
|
||||
"version": "4.9.0",
|
||||
"license": "Apache-2.0",
|
||||
"description": "TypeScript is a language for application scale JavaScript development",
|
||||
"keywords": [
|
||||
@@ -28,9 +28,9 @@
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
},
|
||||
"packageManager": "npm@6.14.15",
|
||||
"devDependencies": {
|
||||
"@octokit/rest": "latest",
|
||||
"@types/async": "latest",
|
||||
"@types/chai": "latest",
|
||||
"@types/convert-source-map": "latest",
|
||||
"@types/fs-extra": "^9.0.13",
|
||||
@@ -89,8 +89,12 @@
|
||||
"typescript": "^4.5.5",
|
||||
"vinyl": "latest",
|
||||
"vinyl-sourcemaps-apply": "latest",
|
||||
"which": "^2.0.2",
|
||||
"xml2js": "^0.4.23"
|
||||
},
|
||||
"overrides": {
|
||||
"es5-ext": "0.10.53"
|
||||
},
|
||||
"scripts": {
|
||||
"prepare": "gulp build-eslint-rules",
|
||||
"pretest": "gulp tests",
|
||||
@@ -104,8 +108,6 @@
|
||||
"gulp": "gulp",
|
||||
"lint": "gulp lint",
|
||||
"lint:ci": "gulp lint --ci",
|
||||
"lint:compiler": "gulp lint-compiler",
|
||||
"lint:scripts": "gulp lint-scripts",
|
||||
"setup-hooks": "node scripts/link-hooks.js"
|
||||
},
|
||||
"browser": {
|
||||
@@ -118,7 +120,9 @@
|
||||
"source-map-support": false,
|
||||
"inspector": false
|
||||
},
|
||||
"packageManager": "npm@8.15.0",
|
||||
"volta": {
|
||||
"node": "14.15.5"
|
||||
"node": "14.20.0",
|
||||
"npm": "8.15.0"
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -1,6 +1,6 @@
|
||||
import fs = require("fs");
|
||||
import path = require("path");
|
||||
import childProcess = require("child_process");
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
import * as childProcess from "child_process";
|
||||
|
||||
interface Author {
|
||||
displayNames: string[];
|
||||
@@ -120,10 +120,10 @@ namespace Commands {
|
||||
const authors: { name: string, email: string, knownAuthor?: Author }[] = [];
|
||||
const {output: [error, stdout, stderr]} = childProcess.spawnSync(`git`, ["shortlog", "-se", ...specs], { cwd: path.resolve(__dirname, "../") });
|
||||
if (error) {
|
||||
console.log(stderr.toString());
|
||||
console.log(stderr!.toString());
|
||||
}
|
||||
else {
|
||||
const output = stdout.toString();
|
||||
const output = stdout!.toString();
|
||||
const lines = output.split("\n");
|
||||
lines.forEach(line => {
|
||||
if (line) {
|
||||
|
||||
@@ -7,6 +7,7 @@ module.exports = minimist(process.argv.slice(2), {
|
||||
boolean: ["dirty", "light", "colors", "lint", "lkg", "soft", "fix", "failed", "keepFailed", "force", "built"],
|
||||
string: ["browser", "tests", "break", "host", "reporter", "stackTraceLimit", "timeout", "shards", "shardId"],
|
||||
alias: {
|
||||
/* eslint-disable quote-props */
|
||||
"b": "browser",
|
||||
"i": ["inspect", "inspect-brk", "break", "debug", "debug-brk"],
|
||||
"t": ["tests", "test"],
|
||||
@@ -16,6 +17,7 @@ module.exports = minimist(process.argv.slice(2), {
|
||||
"skippercent": "skipPercent",
|
||||
"w": "workers",
|
||||
"f": "fix"
|
||||
/* eslint-enable quote-props */
|
||||
},
|
||||
default: {
|
||||
soft: false,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
// @ts-check
|
||||
const stream = require("stream");
|
||||
const Vinyl = require("vinyl");
|
||||
const ts = require("../../lib/typescript");
|
||||
const fs = require("fs");
|
||||
const { base64VLQFormatEncode } = require("./sourcemaps");
|
||||
@@ -43,13 +42,14 @@ function prepend(data) {
|
||||
sourcesContent: input.sourcesContent
|
||||
};
|
||||
}
|
||||
// eslint-disable-next-line boolean-trivia, no-null/no-null
|
||||
return cb(null, output);
|
||||
}
|
||||
catch (e) {
|
||||
return cb(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
}
|
||||
exports.prepend = prepend;
|
||||
|
||||
@@ -59,6 +59,6 @@ exports.prepend = prepend;
|
||||
function prependFile(file) {
|
||||
const data = typeof file === "string" ? fs.readFileSync(file, "utf8") :
|
||||
vinyl => fs.readFileSync(file(vinyl), "utf8");
|
||||
return prepend(data)
|
||||
return prepend(data);
|
||||
}
|
||||
exports.prependFile = prependFile;
|
||||
exports.prependFile = prependFile;
|
||||
|
||||
@@ -35,7 +35,7 @@ class ProjectQueue {
|
||||
}
|
||||
}
|
||||
|
||||
const execTsc = (lkg, ...args) =>
|
||||
const execTsc = (/** @type {boolean} */ lkg, /** @type {string[]} */ ...args) =>
|
||||
exec(process.execPath,
|
||||
[resolve(findUpRoot(), lkg ? "./lib/tsc" : "./built/local/tsc"),
|
||||
"-b", ...args],
|
||||
@@ -45,7 +45,7 @@ const projectBuilder = new ProjectQueue((projects, lkg, force) => execTsc(lkg, .
|
||||
|
||||
/**
|
||||
* @param {string} project
|
||||
* @param {object} [options]
|
||||
* @param {object} options
|
||||
* @param {boolean} [options.lkg=true]
|
||||
* @param {boolean} [options.force=false]
|
||||
*/
|
||||
@@ -58,11 +58,11 @@ const projectCleaner = new ProjectQueue((projects, lkg) => execTsc(lkg, "--clean
|
||||
*/
|
||||
exports.cleanProject = (project) => projectCleaner.enqueue(project);
|
||||
|
||||
const projectWatcher = new ProjectQueue((projects) => execTsc(true, "--watch", ...projects));
|
||||
const projectWatcher = new ProjectQueue((projects) => execTsc(/*lkg*/ true, "--watch", ...projects));
|
||||
|
||||
/**
|
||||
* @param {string} project
|
||||
* @param {object} [options]
|
||||
* @param {object} options
|
||||
* @param {boolean} [options.lkg=true]
|
||||
*/
|
||||
exports.watchProject = (project, { lkg } = {}) => projectWatcher.enqueue(project, { lkg });
|
||||
|
||||
@@ -45,4 +45,6 @@ function base64VLQFormatEncode(value) {
|
||||
|
||||
return result;
|
||||
}
|
||||
exports.base64VLQFormatEncode = base64VLQFormatEncode;
|
||||
exports.base64VLQFormatEncode = base64VLQFormatEncode;
|
||||
|
||||
/** @typedef {object} RawSourceMap */
|
||||
|
||||
@@ -27,7 +27,7 @@ exports.localTest262Baseline = "internal/baselines/test262/local";
|
||||
*/
|
||||
async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode, cancelToken = CancellationToken.none) {
|
||||
let testTimeout = cmdLineOptions.timeout;
|
||||
let tests = cmdLineOptions.tests;
|
||||
const tests = cmdLineOptions.tests;
|
||||
const inspect = cmdLineOptions.break || cmdLineOptions.inspect;
|
||||
const runners = cmdLineOptions.runners;
|
||||
const light = cmdLineOptions.light;
|
||||
@@ -72,7 +72,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
|
||||
const reporter = cmdLineOptions.reporter || defaultReporter;
|
||||
|
||||
/** @type {string[]} */
|
||||
let args = [];
|
||||
const 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
|
||||
@@ -101,7 +101,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
|
||||
args.push("--no-colors");
|
||||
}
|
||||
if (inspect !== undefined) {
|
||||
args.unshift((inspect == "" || inspect === true) ? "--inspect-brk" : "--inspect-brk="+inspect);
|
||||
args.unshift((inspect === "" || inspect === true) ? "--inspect-brk" : "--inspect-brk="+inspect);
|
||||
args.push("-t", "0");
|
||||
}
|
||||
else {
|
||||
@@ -160,7 +160,7 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
|
||||
exports.runConsoleTests = runConsoleTests;
|
||||
|
||||
async function cleanTestDirs() {
|
||||
await del([exports.localBaseline, exports.localRwcBaseline])
|
||||
await del([exports.localBaseline, exports.localRwcBaseline]);
|
||||
mkdirP.sync(exports.localRwcBaseline);
|
||||
mkdirP.sync(exports.localBaseline);
|
||||
}
|
||||
@@ -214,5 +214,5 @@ function deleteTemporaryProjectOutput() {
|
||||
}
|
||||
|
||||
function regExpEscape(text) {
|
||||
return text.replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
|
||||
return text.replace(/[.*+?^${}()|\[\]\\]/g, "\\$&");
|
||||
}
|
||||
|
||||
+11
-3
@@ -1,4 +1,7 @@
|
||||
// @ts-check
|
||||
|
||||
/* eslint-disable no-restricted-globals */
|
||||
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
||||
/// <reference path="../types/ambient.d.ts" />
|
||||
|
||||
const fs = require("fs");
|
||||
@@ -128,6 +131,7 @@ function streamFromBuffer(buffer) {
|
||||
return new Readable({
|
||||
read() {
|
||||
this.push(buffer);
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
this.push(null);
|
||||
}
|
||||
});
|
||||
@@ -249,7 +253,7 @@ function flatten(projectSpec, flattenedProjectSpec, options = {}) {
|
||||
const files = [];
|
||||
const resolvedOutputSpec = path.resolve(cwd, flattenedProjectSpec);
|
||||
const resolvedOutputDirectory = path.dirname(resolvedOutputSpec);
|
||||
const resolvedProjectSpec = resolveProjectSpec(projectSpec, cwd, undefined);
|
||||
const resolvedProjectSpec = resolveProjectSpec(projectSpec, cwd, /*referrer*/ undefined);
|
||||
const project = readJson(resolvedProjectSpec);
|
||||
const skipProjects = /**@type {Set<string>}*/(new Set());
|
||||
const skipFiles = new Set(options && options.exclude && options.exclude.map(file => normalizeSlashes(path.resolve(cwd, file))));
|
||||
@@ -310,7 +314,7 @@ function normalizeSlashes(file) {
|
||||
* @returns {string}
|
||||
*/
|
||||
function resolveProjectSpec(projectSpec, cwd, referrer) {
|
||||
let projectPath = normalizeSlashes(path.resolve(cwd, referrer ? path.dirname(referrer) : "", projectSpec));
|
||||
const projectPath = normalizeSlashes(path.resolve(cwd, referrer ? path.dirname(referrer) : "", projectSpec));
|
||||
const stats = fs.statSync(projectPath);
|
||||
if (stats.isFile()) return normalizeSlashes(projectPath);
|
||||
return normalizeSlashes(path.resolve(cwd, projectPath, "tsconfig.json"));
|
||||
@@ -321,7 +325,10 @@ function resolveProjectSpec(projectSpec, cwd, referrer) {
|
||||
* @param {{ cwd?: string }} [opts]
|
||||
*/
|
||||
function rm(dest, opts) {
|
||||
if (dest && typeof dest === "object") opts = dest, dest = undefined;
|
||||
if (dest && typeof dest === "object") {
|
||||
opts = dest;
|
||||
dest = undefined;
|
||||
}
|
||||
let failed = false;
|
||||
|
||||
const cwd = path.resolve(opts && opts.cwd || process.cwd());
|
||||
@@ -369,6 +376,7 @@ function rm(dest, opts) {
|
||||
pending.push(entry);
|
||||
},
|
||||
final(cb) {
|
||||
// eslint-disable-next-line no-null/no-null
|
||||
const endThenCb = () => (duplex.push(null), cb()); // signal end of read queue
|
||||
processDeleted();
|
||||
if (pending.length) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/// <reference types="node"/>
|
||||
import { normalize, dirname, join } from "path";
|
||||
import { readFileSync, writeFileSync, unlinkSync, existsSync } from "fs";
|
||||
import assert = require("assert");
|
||||
import * as assert from "assert";
|
||||
import { execSync } from "child_process";
|
||||
const args = process.argv.slice(2);
|
||||
|
||||
@@ -10,11 +10,11 @@ const args = process.argv.slice(2);
|
||||
*/
|
||||
interface PackageJson {
|
||||
name: string;
|
||||
bin: {};
|
||||
bin?: {};
|
||||
main: string;
|
||||
scripts: {
|
||||
prepare: string
|
||||
postpublish: string
|
||||
prepare?: string
|
||||
postpublish?: string
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/// <reference types="node"/>
|
||||
import { normalize, relative } from "path";
|
||||
import assert = require("assert");
|
||||
import * as assert from "assert";
|
||||
import { readFileSync, writeFileSync } from "fs";
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const fs = require("fs");
|
||||
const async = require("async");
|
||||
const glob = require("glob");
|
||||
import * as fs from "fs";
|
||||
import * as async from "async";
|
||||
import * as glob from "glob";
|
||||
|
||||
fs.readFile("src/compiler/diagnosticMessages.json", "utf-8", (err, data) => {
|
||||
if (err) {
|
||||
@@ -25,7 +25,7 @@ fs.readFile("src/compiler/diagnosticMessages.json", "utf-8", (err, data) => {
|
||||
fs.readFile(baseDir + f, "utf-8", (err, baseline) => {
|
||||
if (err) throw err;
|
||||
|
||||
let g: string[];
|
||||
let g: RegExpExecArray | null;
|
||||
while (g = errRegex.exec(baseline)) {
|
||||
const errCode = +g[1];
|
||||
const msg = keys.filter(k => messages[k].code === errCode)[0];
|
||||
@@ -53,7 +53,7 @@ fs.readFile("src/compiler/diagnosticMessages.json", "utf-8", (err, data) => {
|
||||
fs.readFile("src/compiler/diagnosticInformationMap.generated.ts", "utf-8", (err, data) => {
|
||||
const errorRegexp = /\s(\w+): \{ code/g;
|
||||
const errorNames: string[] = [];
|
||||
let errMatch: string[];
|
||||
let errMatch: RegExpExecArray | null;
|
||||
while (errMatch = errorRegexp.exec(data)) {
|
||||
errorNames.push(errMatch[1]);
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import Mocha = require("mocha");
|
||||
import * as Mocha from "mocha";
|
||||
|
||||
export = FailedTestsReporter;
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ function copyFileSync(source: string, destination: string) {
|
||||
fs.writeFileSync(destination, text);
|
||||
}
|
||||
|
||||
function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCaseName: string, testFiles: string[], responseFile: string) {
|
||||
function importDefinitelyTypedTest(tscPath: string, rwcTestPath: string, testCaseName: string, testFiles: string[], responseFile: string | undefined) {
|
||||
let cmd = "node " + tscPath + " --module commonjs " + testFiles.join(" ");
|
||||
if (responseFile) {
|
||||
cmd += " @" + responseFile;
|
||||
@@ -122,7 +122,7 @@ function importDefinitelyTypedTests(tscPath: string, rwcTestPath: string, defini
|
||||
|
||||
const tsFiles: string[] = [];
|
||||
const testFiles: string[] = [];
|
||||
let paramFile: string;
|
||||
let paramFile: string | undefined;
|
||||
|
||||
for (const filePath of files.map(f => path.join(directoryPath, f))) {
|
||||
if (filePathEndsWith(filePath, ".ts")) {
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { Octokit } from "@octokit/rest";
|
||||
const {runSequence} = require("./run-sequence");
|
||||
import fs = require("fs");
|
||||
import path = require("path");
|
||||
import { runSequence } from "./run-sequence";
|
||||
import * as fs from "fs";
|
||||
import * as path from "path";
|
||||
|
||||
const userName = process.env.GH_USERNAME;
|
||||
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "RyanCavanaugh"];
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/// <reference lib="es2015.promise" />
|
||||
// Must reference esnext.asynciterable lib, since octokit uses AsyncIterable internally
|
||||
import { Octokit } from "@octokit/rest";
|
||||
const {runSequence} = require("./run-sequence");
|
||||
import { runSequence } from "./run-sequence";
|
||||
|
||||
const userName = process.env.GH_USERNAME || "typescript-bot";
|
||||
const reviewers = process.env.REQUESTING_USER ? [process.env.REQUESTING_USER] : ["weswigham", "sandersn", "RyanCavanaugh"];
|
||||
@@ -22,7 +22,7 @@ runSequence([
|
||||
["node", ["./node_modules/gulp/bin/gulp.js", "baseline-accept"]], // accept baselines
|
||||
["git", ["checkout", "-b", branchName]], // create a branch
|
||||
["git", ["add", "."]], // Add all changes
|
||||
["git", ["commit", "-m", `"Update user baselines${+process.env.SOURCE_ISSUE === 33716 ? " +cc @sandersn" : ""}"`]], // Commit all changes (ping nathan if we would post to CI thread)
|
||||
["git", ["commit", "-m", `"Update user baselines${+process.env.SOURCE_ISSUE! === 33716 ? " +cc @sandersn" : ""}"`]], // Commit all changes (ping nathan if we would post to CI thread)
|
||||
["git", ["push", "--set-upstream", "fork", branchName, "-f"]] // push the branch
|
||||
]);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import path = require("path");
|
||||
import fs = require("fs");
|
||||
import * as path from "path";
|
||||
import * as fs from "fs";
|
||||
|
||||
interface DiagnosticDetails {
|
||||
category: string;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import childProcess = require("child_process");
|
||||
import fs = require("fs-extra");
|
||||
import path = require("path");
|
||||
import glob = require("glob");
|
||||
import * as childProcess from "child_process";
|
||||
import * as fs from "fs-extra";
|
||||
import * as path from "path";
|
||||
import * as glob from "glob";
|
||||
|
||||
const root = path.join(__dirname, "..");
|
||||
const source = path.join(root, "built/local");
|
||||
@@ -90,7 +90,7 @@ async function copyFromBuiltLocal(fileName: string) {
|
||||
}
|
||||
|
||||
async function copyFilesWithGlob(pattern: string) {
|
||||
const files = glob.sync(path.join(source, pattern)).map(f => path.basename(f));
|
||||
const files = glob.sync(pattern, { cwd: source }).map(f => path.basename(f));
|
||||
for (const f of files) {
|
||||
await copyFromBuiltLocal(f);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="es2015.promise" />
|
||||
import octokit = require("@octokit/rest");
|
||||
import Octokit = octokit.Octokit;
|
||||
import minimist = require("minimist");
|
||||
import { Octokit } from "@octokit/rest";
|
||||
import * as minimist from "minimist";
|
||||
|
||||
const options = minimist(process.argv.slice(2), {
|
||||
boolean: ["help"],
|
||||
@@ -70,4 +69,4 @@ options:
|
||||
-h --help Prints this help message.
|
||||
`);
|
||||
return process.exit(exitCode);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
import { SpawnSyncOptions } from "child_process";
|
||||
|
||||
export function runSequence(tasks: [string, string[]][], opts?: SpawnSyncOptions): string;
|
||||
@@ -11,13 +11,5 @@
|
||||
"lib": ["es6", "scripthost"],
|
||||
},
|
||||
|
||||
"include": [
|
||||
"generateLocalizedDiagnosticMessages.ts",
|
||||
"processDiagnosticMessages.ts",
|
||||
"configurePrerelease.ts",
|
||||
"buildProtocol.ts",
|
||||
"produceLKG.ts",
|
||||
"word2md.ts",
|
||||
"request-pr-review.ts"
|
||||
]
|
||||
"include": ["*.ts"]
|
||||
}
|
||||
|
||||
+35
-47
@@ -850,6 +850,9 @@ namespace ts {
|
||||
case SyntaxKind.BindingElement:
|
||||
bindBindingElementFlow(node as BindingElement);
|
||||
break;
|
||||
case SyntaxKind.Parameter:
|
||||
bindParameterFlow(node as ParameterDeclaration);
|
||||
break;
|
||||
case SyntaxKind.ObjectLiteralExpression:
|
||||
case SyntaxKind.ArrayLiteralExpression:
|
||||
case SyntaxKind.PropertyAssignment:
|
||||
@@ -1655,20 +1658,40 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindBindingElementFlow(node: BindingElement) {
|
||||
if (isBindingPattern(node.name)) {
|
||||
// When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:
|
||||
// - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
// - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
bind(node.dotDotDotToken);
|
||||
bind(node.propertyName);
|
||||
bind(node.initializer);
|
||||
bind(node.name);
|
||||
// When evaluating a binding pattern, the initializer is evaluated before the binding pattern, per:
|
||||
// - https://tc39.es/ecma262/#sec-destructuring-binding-patterns-runtime-semantics-iteratorbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
// - https://tc39.es/ecma262/#sec-runtime-semantics-keyedbindinginitialization
|
||||
// - `BindingElement: BindingPattern Initializer?`
|
||||
bind(node.dotDotDotToken);
|
||||
bind(node.propertyName);
|
||||
bindInitializer(node.initializer);
|
||||
bind(node.name);
|
||||
}
|
||||
|
||||
function bindParameterFlow(node: ParameterDeclaration) {
|
||||
bindEach(node.modifiers);
|
||||
bind(node.dotDotDotToken);
|
||||
bind(node.questionToken);
|
||||
bind(node.type);
|
||||
bindInitializer(node.initializer);
|
||||
bind(node.name);
|
||||
}
|
||||
|
||||
// a BindingElement/Parameter does not have side effects if initializers are not evaluated and used. (see GH#49759)
|
||||
function bindInitializer(node: Expression | undefined) {
|
||||
if (!node) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
bindEachChild(node);
|
||||
const entryFlow = currentFlow;
|
||||
bind(node);
|
||||
if (entryFlow === unreachableFlow || entryFlow === currentFlow) {
|
||||
return;
|
||||
}
|
||||
const exitFlow = createBranchLabel();
|
||||
addAntecedent(exitFlow, entryFlow);
|
||||
addAntecedent(exitFlow, currentFlow);
|
||||
currentFlow = finishFlowLabel(exitFlow);
|
||||
}
|
||||
|
||||
function bindJSDocTypeAlias(node: JSDocTypedefTag | JSDocCallbackTag | JSDocEnumTag) {
|
||||
@@ -2040,41 +2063,6 @@ namespace ts {
|
||||
}
|
||||
|
||||
function bindObjectLiteralExpression(node: ObjectLiteralExpression) {
|
||||
const enum ElementKind {
|
||||
Property = 1,
|
||||
Accessor = 2
|
||||
}
|
||||
|
||||
if (inStrictMode && !isAssignmentTarget(node)) {
|
||||
const seen = new Map<__String, ElementKind>();
|
||||
|
||||
for (const prop of node.properties) {
|
||||
if (prop.kind === SyntaxKind.SpreadAssignment || prop.name.kind !== SyntaxKind.Identifier) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const identifier = prop.name;
|
||||
|
||||
// ECMA-262 11.1.5 Object Initializer
|
||||
// If previous is not undefined then throw a SyntaxError exception if any of the following conditions are true
|
||||
// a.This production is contained in strict code and IsDataDescriptor(previous) is true and
|
||||
// IsDataDescriptor(propId.descriptor) is true.
|
||||
// b.IsDataDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true.
|
||||
// c.IsAccessorDescriptor(previous) is true and IsDataDescriptor(propId.descriptor) is true.
|
||||
// d.IsAccessorDescriptor(previous) is true and IsAccessorDescriptor(propId.descriptor) is true
|
||||
// and either both previous and propId.descriptor have[[Get]] fields or both previous and propId.descriptor have[[Set]] fields
|
||||
const currentKind = prop.kind === SyntaxKind.PropertyAssignment || prop.kind === SyntaxKind.ShorthandPropertyAssignment || prop.kind === SyntaxKind.MethodDeclaration
|
||||
? ElementKind.Property
|
||||
: ElementKind.Accessor;
|
||||
|
||||
const existingKind = seen.get(identifier.escapedText);
|
||||
if (!existingKind) {
|
||||
seen.set(identifier.escapedText, currentKind);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return bindAnonymousDeclaration(node, SymbolFlags.ObjectLiteral, InternalSymbolName.Object);
|
||||
}
|
||||
|
||||
|
||||
+31
-25
@@ -62,9 +62,9 @@ namespace ts {
|
||||
*/
|
||||
outSignature?: string;
|
||||
/**
|
||||
* Time when d.ts was modified
|
||||
* Name of the file whose dts was the latest to change
|
||||
*/
|
||||
dtsChangeTime: number | undefined;
|
||||
latestChangedDtsFile: string | undefined;
|
||||
}
|
||||
|
||||
export const enum BuilderFileEmit {
|
||||
@@ -112,7 +112,7 @@ namespace ts {
|
||||
/**
|
||||
* Records if change in dts emit was detected
|
||||
*/
|
||||
hasChangedEmitSignature?: boolean;
|
||||
hasChangedEmitSignature?: boolean;
|
||||
/**
|
||||
* Files pending to be emitted
|
||||
*/
|
||||
@@ -141,7 +141,7 @@ namespace ts {
|
||||
"programEmitComplete" |
|
||||
"emitSignatures" |
|
||||
"outSignature" |
|
||||
"dtsChangeTime" |
|
||||
"latestChangedDtsFile" |
|
||||
"hasChangedEmitSignature"
|
||||
> & { changedFilesSet: BuilderProgramState["changedFilesSet"] | undefined };
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace ts {
|
||||
state.outSignature = oldState?.outSignature;
|
||||
}
|
||||
state.changedFilesSet = new Set();
|
||||
state.dtsChangeTime = compilerOptions.composite ? oldState?.dtsChangeTime : undefined;
|
||||
state.latestChangedDtsFile = compilerOptions.composite ? oldState?.latestChangedDtsFile : undefined;
|
||||
|
||||
const useOldState = BuilderState.canReuseOldState(state.referencedMap, oldState);
|
||||
const oldCompilerOptions = useOldState ? oldState!.compilerOptions : undefined;
|
||||
@@ -301,7 +301,7 @@ namespace ts {
|
||||
programEmitComplete: state.programEmitComplete,
|
||||
emitSignatures: state.emitSignatures && new Map(state.emitSignatures),
|
||||
outSignature: state.outSignature,
|
||||
dtsChangeTime: state.dtsChangeTime,
|
||||
latestChangedDtsFile: state.latestChangedDtsFile,
|
||||
hasChangedEmitSignature: state.hasChangedEmitSignature,
|
||||
changedFilesSet: outFilePath ? new Set(state.changedFilesSet) : undefined,
|
||||
};
|
||||
@@ -315,7 +315,7 @@ namespace ts {
|
||||
state.programEmitComplete = savedEmitState.programEmitComplete;
|
||||
state.emitSignatures = savedEmitState.emitSignatures;
|
||||
state.outSignature = savedEmitState.outSignature;
|
||||
state.dtsChangeTime = savedEmitState.dtsChangeTime;
|
||||
state.latestChangedDtsFile = savedEmitState.latestChangedDtsFile;
|
||||
state.hasChangedEmitSignature = savedEmitState.hasChangedEmitSignature;
|
||||
if (savedEmitState.changedFilesSet) state.changedFilesSet = savedEmitState.changedFilesSet;
|
||||
}
|
||||
@@ -795,7 +795,8 @@ namespace ts {
|
||||
affectedFilesPendingEmit?: ProgramBuilderInfoFilePendingEmit[];
|
||||
changeFileSet?: readonly ProgramBuildInfoFileId[];
|
||||
emitSignatures?: readonly ProgramBuildInfoEmitSignature[];
|
||||
dtsChangeTime?: number;
|
||||
// Because this is only output file in the program, we dont need fileId to deduplicate name
|
||||
latestChangedDtsFile?: string;
|
||||
}
|
||||
|
||||
export interface ProgramBundleEmitBuildInfo {
|
||||
@@ -803,7 +804,7 @@ namespace ts {
|
||||
fileInfos: readonly string[];
|
||||
options: CompilerOptions | undefined;
|
||||
outSignature?: string;
|
||||
dtsChangeTime?: number;
|
||||
latestChangedDtsFile?: string;
|
||||
}
|
||||
|
||||
export type ProgramBuildInfo = ProgramMultiFileEmitBuildInfo | ProgramBundleEmitBuildInfo;
|
||||
@@ -815,13 +816,13 @@ namespace ts {
|
||||
/**
|
||||
* Gets the program information to be emitted in buildInfo so that we can use it to create new program
|
||||
*/
|
||||
function getProgramBuildInfo(state: BuilderProgramState, getCanonicalFileName: GetCanonicalFileName, host: BuilderProgramHost): ProgramBuildInfo | undefined {
|
||||
function getProgramBuildInfo(state: BuilderProgramState, getCanonicalFileName: GetCanonicalFileName): ProgramBuildInfo | undefined {
|
||||
const outFilePath = outFile(state.compilerOptions);
|
||||
if (outFilePath && !state.compilerOptions.composite) return;
|
||||
const currentDirectory = Debug.checkDefined(state.program).getCurrentDirectory();
|
||||
const buildInfoDirectory = getDirectoryPath(getNormalizedAbsolutePath(getTsBuildInfoEmitOutputFilePath(state.compilerOptions)!, currentDirectory));
|
||||
// Update the dtsChange time in buildInfo
|
||||
state.dtsChangeTime = state.hasChangedEmitSignature ? getCurrentTime(host).getTime() : state.dtsChangeTime;
|
||||
// Convert the file name to Path here if we set the fileName instead to optimize multiple d.ts file emits and having to compute Canonical path
|
||||
const latestChangedDtsFile = state.latestChangedDtsFile ? relativeToBuildInfoEnsuringAbsolutePath(state.latestChangedDtsFile) : undefined;
|
||||
if (outFilePath) {
|
||||
const fileNames: string[] = [];
|
||||
const fileInfos: string[] = [];
|
||||
@@ -836,7 +837,7 @@ namespace ts {
|
||||
fileInfos,
|
||||
options: convertToProgramBuildInfoCompilerOptions(state.compilerOptions, "affectsBundleEmitBuildInfo"),
|
||||
outSignature: state.outSignature,
|
||||
dtsChangeTime: state.dtsChangeTime,
|
||||
latestChangedDtsFile,
|
||||
};
|
||||
return result;
|
||||
}
|
||||
@@ -939,7 +940,7 @@ namespace ts {
|
||||
affectedFilesPendingEmit,
|
||||
changeFileSet,
|
||||
emitSignatures,
|
||||
dtsChangeTime: state.dtsChangeTime,
|
||||
latestChangedDtsFile,
|
||||
};
|
||||
return result;
|
||||
|
||||
@@ -1137,7 +1138,7 @@ namespace ts {
|
||||
*/
|
||||
const computeHash = maybeBind(host, host.createHash);
|
||||
const state = createBuilderProgramState(newProgram, getCanonicalFileName, oldState, host.disableUseFileVersionAsSignature);
|
||||
newProgram.getProgramBuildInfo = () => getProgramBuildInfo(state, getCanonicalFileName, host);
|
||||
newProgram.getProgramBuildInfo = () => getProgramBuildInfo(state, getCanonicalFileName);
|
||||
|
||||
// To ensure that we arent storing any references to old program or new program without state
|
||||
newProgram = undefined!; // TODO: GH#18217
|
||||
@@ -1149,6 +1150,7 @@ namespace ts {
|
||||
builderProgram.getState = getState;
|
||||
builderProgram.saveEmitState = () => backupBuilderProgramEmitState(state);
|
||||
builderProgram.restoreEmitState = (saved) => restoreBuilderProgramEmitState(state, saved);
|
||||
builderProgram.hasChangedEmitSignature = () => !!state.hasChangedEmitSignature;
|
||||
builderProgram.getAllDependencies = sourceFile => BuilderState.getAllDependencies(state, Debug.checkDefined(state.program), sourceFile);
|
||||
builderProgram.getSemanticDiagnostics = getSemanticDiagnostics;
|
||||
builderProgram.emit = emit;
|
||||
@@ -1279,18 +1281,20 @@ namespace ts {
|
||||
const filePath = sourceFiles[0].resolvedPath;
|
||||
const oldSignature = state.emitSignatures?.get(filePath);
|
||||
emitSignature ??= computeSignature(text, computeHash, data);
|
||||
if (emitSignature !== oldSignature) {
|
||||
(state.emitSignatures ??= new Map()).set(filePath, emitSignature);
|
||||
state.hasChangedEmitSignature = true;
|
||||
}
|
||||
// Dont write dts files if they didn't change
|
||||
if (emitSignature === oldSignature) return;
|
||||
(state.emitSignatures ??= new Map()).set(filePath, emitSignature);
|
||||
state.hasChangedEmitSignature = true;
|
||||
state.latestChangedDtsFile = fileName;
|
||||
}
|
||||
}
|
||||
else if (state.compilerOptions.composite) {
|
||||
const newSignature = computeSignature(text, computeHash, data);
|
||||
if (newSignature !== state.outSignature) {
|
||||
state.outSignature = newSignature;
|
||||
state.hasChangedEmitSignature = true;
|
||||
}
|
||||
// Dont write dts files if they didn't change
|
||||
if (newSignature === state.outSignature) return;
|
||||
state.outSignature = newSignature;
|
||||
state.hasChangedEmitSignature = true;
|
||||
state.latestChangedDtsFile = fileName;
|
||||
}
|
||||
}
|
||||
if (writeFile) writeFile(fileName, text, writeByteOrderMark, onError, sourceFiles, data);
|
||||
@@ -1472,11 +1476,12 @@ namespace ts {
|
||||
let state: ReusableBuilderProgramState;
|
||||
let filePaths: Path[] | undefined;
|
||||
let filePathsSetList: Set<Path>[] | undefined;
|
||||
const latestChangedDtsFile = program.latestChangedDtsFile ? toAbsolutePath(program.latestChangedDtsFile) : undefined;
|
||||
if (isProgramBundleEmitBuildInfo(program)) {
|
||||
state = {
|
||||
fileInfos: new Map(),
|
||||
compilerOptions: program.options ? convertToOptionsWithAbsolutePaths(program.options, toAbsolutePath) : {},
|
||||
dtsChangeTime: program.dtsChangeTime,
|
||||
latestChangedDtsFile,
|
||||
outSignature: program.outSignature,
|
||||
};
|
||||
}
|
||||
@@ -1506,7 +1511,7 @@ namespace ts {
|
||||
affectedFilesPendingEmitKind: program.affectedFilesPendingEmit && arrayToMap(program.affectedFilesPendingEmit, value => toFilePath(value[0]), value => value[1]),
|
||||
affectedFilesPendingEmitIndex: program.affectedFilesPendingEmit && 0,
|
||||
changedFilesSet: new Set(map(program.changeFileSet, toFilePath)),
|
||||
dtsChangeTime: program.dtsChangeTime,
|
||||
latestChangedDtsFile,
|
||||
emitSignatures: emitSignatures?.size ? emitSignatures : undefined,
|
||||
};
|
||||
}
|
||||
@@ -1534,6 +1539,7 @@ namespace ts {
|
||||
getSemanticDiagnosticsOfNextAffectedFile: notImplemented,
|
||||
emitBuildInfo: notImplemented,
|
||||
close: noop,
|
||||
hasChangedEmitSignature: returnFalse,
|
||||
};
|
||||
|
||||
function toPath(path: string) {
|
||||
|
||||
@@ -42,6 +42,8 @@ namespace ts {
|
||||
saveEmitState(): SavedBuildProgramEmitState;
|
||||
/*@internal*/
|
||||
restoreEmitState(saved: SavedBuildProgramEmitState): void;
|
||||
/*@internal*/
|
||||
hasChangedEmitSignature?(): boolean;
|
||||
/**
|
||||
* Returns current program
|
||||
*/
|
||||
|
||||
+802
-488
File diff suppressed because it is too large
Load Diff
+21
-4
@@ -778,19 +778,24 @@ namespace ts {
|
||||
return [] as any as SortedArray<T>; // TODO: GH#19873
|
||||
}
|
||||
|
||||
export function insertSorted<T>(array: SortedArray<T>, insert: T, compare: Comparer<T>, allowDuplicates?: boolean): void {
|
||||
export function insertSorted<T>(array: SortedArray<T>, insert: T, compare: Comparer<T>, allowDuplicates?: boolean): boolean {
|
||||
if (array.length === 0) {
|
||||
array.push(insert);
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
const insertIndex = binarySearch(array, insert, identity, compare);
|
||||
if (insertIndex < 0) {
|
||||
array.splice(~insertIndex, 0, insert);
|
||||
return true;
|
||||
}
|
||||
else if (allowDuplicates) {
|
||||
|
||||
if (allowDuplicates) {
|
||||
array.splice(insertIndex, 0, insert);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
export function sortAndDeduplicate<T>(array: readonly string[]): SortedReadonlyArray<string>;
|
||||
@@ -1113,6 +1118,13 @@ namespace ts {
|
||||
: undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the only element of an array if it contains only one element; throws otherwise.
|
||||
*/
|
||||
export function single<T>(array: readonly T[]): T {
|
||||
return Debug.checkDefined(singleOrUndefined(array));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the only element of an array if it contains only one element; otherwise, returns the
|
||||
* array.
|
||||
@@ -1724,6 +1736,11 @@ namespace ts {
|
||||
/** Does nothing. */
|
||||
export function noop(_?: unknown): void { }
|
||||
|
||||
export const noopPush: Push<any> = {
|
||||
push: noop,
|
||||
length: 0
|
||||
};
|
||||
|
||||
/** Do nothing and return false */
|
||||
export function returnFalse(): false {
|
||||
return false;
|
||||
@@ -2105,7 +2122,7 @@ namespace ts {
|
||||
* and 1 insertion/deletion at 3 characters)
|
||||
*/
|
||||
export function getSpellingSuggestion<T>(name: string, candidates: T[], getName: (candidate: T) => string | undefined): T | undefined {
|
||||
const maximumLengthDifference = Math.min(2, Math.floor(name.length * 0.34));
|
||||
const maximumLengthDifference = Math.max(2, Math.floor(name.length * 0.34));
|
||||
let bestDistance = Math.floor(name.length * 0.4) + 1; // If the best result is worse than this, don't bother.
|
||||
let bestCandidate: T | undefined;
|
||||
for (const candidate of candidates) {
|
||||
|
||||
+15
-26
@@ -1,7 +1,7 @@
|
||||
namespace ts {
|
||||
// WARNING: The script `configurePrerelease.ts` uses a regexp to parse out these values.
|
||||
// If changing the text in this section, be sure to test `configurePrerelease` too.
|
||||
export const versionMajorMinor = "4.8";
|
||||
export const versionMajorMinor = "4.9";
|
||||
// The following is baselined as a literal template type without intervention
|
||||
/** The version of the TypeScript compiler release */
|
||||
// eslint-disable-next-line @typescript-eslint/no-inferrable-types
|
||||
@@ -124,45 +124,34 @@ namespace ts {
|
||||
/**
|
||||
* Returns the native Map implementation if it is available and compatible (i.e. supports iteration).
|
||||
*/
|
||||
export function tryGetNativeMap(): MapConstructor | undefined {
|
||||
export function tryGetNativeMap(): MapConstructor {
|
||||
// Internet Explorer's Map doesn't support iteration, so don't use it.
|
||||
const gMap = globals?.Map;
|
||||
// eslint-disable-next-line no-in-operator
|
||||
return typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
||||
const constructor = typeof gMap !== "undefined" && "entries" in gMap.prototype && new gMap([[0, 0]]).size === 1 ? gMap : undefined;
|
||||
if (!constructor) {
|
||||
throw new Error("No compatible Map implementation found.");
|
||||
}
|
||||
return constructor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the native Set implementation if it is available and compatible (i.e. supports iteration).
|
||||
*/
|
||||
export function tryGetNativeSet(): SetConstructor | undefined {
|
||||
export function tryGetNativeSet(): SetConstructor {
|
||||
// Internet Explorer's Set doesn't support iteration, so don't use it.
|
||||
const gSet = globals?.Set;
|
||||
// eslint-disable-next-line no-in-operator
|
||||
return typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
||||
const constructor = typeof gSet !== "undefined" && "entries" in gSet.prototype && new gSet([0]).size === 1 ? gSet : undefined;
|
||||
if (!constructor) {
|
||||
throw new Error("No compatible Set implementation found.");
|
||||
}
|
||||
return constructor;
|
||||
}
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export const Map = getCollectionImplementation("Map", "tryGetNativeMap", "createMapShim");
|
||||
export const Map = NativeCollections.tryGetNativeMap();
|
||||
/* @internal */
|
||||
export const Set = getCollectionImplementation("Set", "tryGetNativeSet", "createSetShim");
|
||||
|
||||
/* @internal */
|
||||
type GetIteratorCallback = <I extends readonly any[] | ReadonlySet<any> | ReadonlyESMap<any, any> | undefined>(iterable: I) => Iterator<
|
||||
I extends ReadonlyESMap<infer K, infer V> ? [K, V] :
|
||||
I extends ReadonlySet<infer T> ? T :
|
||||
I extends readonly (infer T)[] ? T :
|
||||
I extends undefined ? undefined :
|
||||
never>;
|
||||
|
||||
/* @internal */
|
||||
function getCollectionImplementation<
|
||||
K1 extends MatchingKeys<typeof NativeCollections, () => any>,
|
||||
K2 extends MatchingKeys<typeof ShimCollections, (getIterator?: GetIteratorCallback) => ReturnType<(typeof NativeCollections)[K1]>>
|
||||
>(name: string, nativeFactory: K1, shimFactory: K2): NonNullable<ReturnType<(typeof NativeCollections)[K1]>> {
|
||||
// NOTE: ts.ShimCollections will be defined for typescriptServices.js but not for tsc.js, so we must test for it.
|
||||
const constructor = NativeCollections[nativeFactory]() ?? ShimCollections?.[shimFactory](getIterator);
|
||||
if (constructor) return constructor as NonNullable<ReturnType<(typeof NativeCollections)[K1]>>;
|
||||
throw new Error(`TypeScript requires an environment that provides a compatible native ${name} implementation.`);
|
||||
}
|
||||
export const Set = NativeCollections.tryGetNativeSet();
|
||||
}
|
||||
|
||||
@@ -394,6 +394,22 @@ namespace ts {
|
||||
return formatEnum(flags, (ts as any).FlowFlags, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatRelationComparisonResult(result: RelationComparisonResult | undefined): string {
|
||||
return formatEnum(result, (ts as any).RelationComparisonResult, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatCheckMode(mode: CheckMode | undefined): string {
|
||||
return formatEnum(mode, (ts as any).CheckMode, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatSignatureCheckMode(mode: SignatureCheckMode | undefined): string {
|
||||
return formatEnum(mode, (ts as any).SignatureCheckMode, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
export function formatTypeFacts(facts: TypeFacts | undefined): string {
|
||||
return formatEnum(facts, (ts as any).TypeFacts, /*isFlags*/ true);
|
||||
}
|
||||
|
||||
let isDebugInfoEnabled = false;
|
||||
|
||||
interface ExtendedDebugModule {
|
||||
@@ -748,5 +764,53 @@ namespace ts {
|
||||
const deprecation = createDeprecation(options?.name ?? getFunctionName(func), options);
|
||||
return wrapFunction(deprecation, func);
|
||||
}
|
||||
|
||||
export function formatVariance(varianceFlags: VarianceFlags) {
|
||||
const variance = varianceFlags & VarianceFlags.VarianceMask;
|
||||
let result =
|
||||
variance === VarianceFlags.Invariant ? "in out" :
|
||||
variance === VarianceFlags.Bivariant ? "[bivariant]" :
|
||||
variance === VarianceFlags.Contravariant ? "in" :
|
||||
variance === VarianceFlags.Covariant ? "out" :
|
||||
variance === VarianceFlags.Independent ? "[independent]" : "";
|
||||
if (varianceFlags & VarianceFlags.Unmeasurable) {
|
||||
result += " (unmeasurable)";
|
||||
}
|
||||
else if (varianceFlags & VarianceFlags.Unreliable) {
|
||||
result += " (unreliable)";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
export type DebugType = Type & { __debugTypeToString(): string }; // eslint-disable-line @typescript-eslint/naming-convention
|
||||
export class DebugTypeMapper {
|
||||
declare kind: TypeMapKind;
|
||||
__debugToString(): string { // eslint-disable-line @typescript-eslint/naming-convention
|
||||
type<TypeMapper>(this);
|
||||
switch (this.kind) {
|
||||
case TypeMapKind.Function: return this.debugInfo?.() || "(function mapper)";
|
||||
case TypeMapKind.Simple: return `${(this.source as DebugType).__debugTypeToString()} -> ${(this.target as DebugType).__debugTypeToString()}`;
|
||||
case TypeMapKind.Array: return zipWith<DebugType, DebugType | string, unknown>(
|
||||
this.sources as readonly DebugType[],
|
||||
this.targets as readonly DebugType[] || map(this.sources, () => "any"),
|
||||
(s, t) => `${s.__debugTypeToString()} -> ${typeof t === "string" ? t : t.__debugTypeToString()}`).join(", ");
|
||||
case TypeMapKind.Deferred: return zipWith(
|
||||
this.sources,
|
||||
this.targets,
|
||||
(s, t) => `${(s as DebugType).__debugTypeToString()} -> ${(t() as DebugType).__debugTypeToString()}`).join(", ");
|
||||
case TypeMapKind.Merged:
|
||||
case TypeMapKind.Composite: return `m1: ${(this.mapper1 as unknown as DebugTypeMapper).__debugToString().split("\n").join("\n ")}
|
||||
m2: ${(this.mapper2 as unknown as DebugTypeMapper).__debugToString().split("\n").join("\n ")}`;
|
||||
default: return assertNever(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function attachDebugPrototypeIfDebug(mapper: TypeMapper): TypeMapper {
|
||||
if (isDebugging) {
|
||||
return Object.setPrototypeOf(mapper, DebugTypeMapper.prototype);
|
||||
}
|
||||
return mapper;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1464,12 +1464,28 @@
|
||||
"category": "Message",
|
||||
"code": 1457
|
||||
},
|
||||
"File is ECMAScript module because '{0}' has field \"type\" with value \"module\"": {
|
||||
"category": "Message",
|
||||
"code": 1458
|
||||
},
|
||||
"File is CommonJS module because '{0}' has field \"type\" whose value is not \"module\"": {
|
||||
"category": "Message",
|
||||
"code": 1459
|
||||
},
|
||||
"File is CommonJS module because '{0}' does not have field \"type\"": {
|
||||
"category": "Message",
|
||||
"code": 1460
|
||||
},
|
||||
"File is CommonJS module because 'package.json' was not found": {
|
||||
"category": "Message",
|
||||
"code": 1461
|
||||
},
|
||||
|
||||
"The 'import.meta' meta-property is not allowed in files which will build into CommonJS output.": {
|
||||
"category": "Error",
|
||||
"code": 1470
|
||||
},
|
||||
"Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.": {
|
||||
"Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.": {
|
||||
"category": "Error",
|
||||
"code": 1471
|
||||
},
|
||||
@@ -1497,6 +1513,30 @@
|
||||
"category": "Error",
|
||||
"code": 1477
|
||||
},
|
||||
"Identifier or string literal expected.": {
|
||||
"category": "Error",
|
||||
"code": 1478
|
||||
},
|
||||
"The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import(\"{0}\")' call instead.": {
|
||||
"category": "Error",
|
||||
"code": 1479
|
||||
},
|
||||
"To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ \"type\": \"module\" }`.": {
|
||||
"category": "Message",
|
||||
"code": 1480
|
||||
},
|
||||
"To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `\"type\": \"module\"` to '{1}'.": {
|
||||
"category": "Message",
|
||||
"code": 1481
|
||||
},
|
||||
"To convert this file to an ECMAScript module, add the field `\"type\": \"module\"` to '{0}'.": {
|
||||
"category": "Message",
|
||||
"code": 1482
|
||||
},
|
||||
"To convert this file to an ECMAScript module, create a local package.json file with `{ \"type\": \"module\" }`.": {
|
||||
"category": "Message",
|
||||
"code": 1483
|
||||
},
|
||||
|
||||
"The types of '{0}' are incompatible between these types.": {
|
||||
"category": "Error",
|
||||
@@ -2356,6 +2396,10 @@
|
||||
"category": "Error",
|
||||
"code": 2513
|
||||
},
|
||||
"A tuple type cannot be indexed with a negative value.": {
|
||||
"category": "Error",
|
||||
"code": 2514
|
||||
},
|
||||
"Non-abstract class '{0}' does not implement inherited abstract member '{1}' from class '{2}'.": {
|
||||
"category": "Error",
|
||||
"code": 2515
|
||||
@@ -2633,7 +2677,7 @@
|
||||
"category": "Error",
|
||||
"code": 2593
|
||||
},
|
||||
"This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.": {
|
||||
"This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.": {
|
||||
"category": "Error",
|
||||
"code": 2594
|
||||
},
|
||||
@@ -3507,6 +3551,10 @@
|
||||
"category": "Error",
|
||||
"code": 2843
|
||||
},
|
||||
"Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.": {
|
||||
"category": "Error",
|
||||
"code": 2844
|
||||
},
|
||||
|
||||
"Import declaration '{0}' is using private name '{1}'.": {
|
||||
"category": "Error",
|
||||
@@ -5350,6 +5398,10 @@
|
||||
"category": "Message",
|
||||
"code": 6400
|
||||
},
|
||||
"Project '{0}' is out of date because there was error reading file '{1}'": {
|
||||
"category": "Message",
|
||||
"code": 6401
|
||||
},
|
||||
|
||||
"The expected type comes from property '{0}' which is declared here on type '{1}'": {
|
||||
"category": "Message",
|
||||
|
||||
+10
-13
@@ -379,7 +379,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
// Make sure not to write js file and source map file if any of them cannot be written
|
||||
if ((jsFilePath && host.isEmitBlocked(jsFilePath)) || compilerOptions.noEmit) {
|
||||
if (host.isEmitBlocked(jsFilePath) || compilerOptions.noEmit) {
|
||||
emitSkipped = true;
|
||||
return;
|
||||
}
|
||||
@@ -652,8 +652,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function getBuildInfo(buildInfoText: string) {
|
||||
return JSON.parse(buildInfoText) as BuildInfo;
|
||||
export function getBuildInfo(buildInfoFile: string, buildInfoText: string) {
|
||||
return readJsonOrUndefined(buildInfoFile, buildInfoText) as BuildInfo | undefined;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
@@ -712,7 +712,6 @@ namespace ts {
|
||||
useCaseSensitiveFileNames(): boolean;
|
||||
getNewLine(): string;
|
||||
createHash?(data: string): string;
|
||||
now?(): Date;
|
||||
getBuildInfo?(fileName: string, configFilePath: string | undefined): BuildInfo | undefined;
|
||||
}
|
||||
|
||||
@@ -752,18 +751,17 @@ namespace ts {
|
||||
): EmitUsingBuildInfoResult {
|
||||
const createHash = maybeBind(host, host.createHash);
|
||||
const { buildInfoPath, jsFilePath, sourceMapFilePath, declarationFilePath, declarationMapPath } = getOutputPathsForBundle(config.options, /*forceDtsPaths*/ false);
|
||||
let buildInfo: BuildInfo;
|
||||
let buildInfo: BuildInfo | undefined;
|
||||
if (host.getBuildInfo) {
|
||||
// If host directly provides buildinfo we can get it directly. This allows host to cache the buildinfo
|
||||
const hostBuildInfo = host.getBuildInfo(buildInfoPath!, config.options.configFilePath);
|
||||
if (!hostBuildInfo) return buildInfoPath!;
|
||||
buildInfo = hostBuildInfo;
|
||||
buildInfo = host.getBuildInfo(buildInfoPath!, config.options.configFilePath);
|
||||
}
|
||||
else {
|
||||
const buildInfoText = host.readFile(buildInfoPath!);
|
||||
if (!buildInfoText) return buildInfoPath!;
|
||||
buildInfo = getBuildInfo(buildInfoText);
|
||||
buildInfo = getBuildInfo(buildInfoPath!, buildInfoText);
|
||||
}
|
||||
if (!buildInfo) return buildInfoPath!;
|
||||
if (!buildInfo.bundle || !buildInfo.bundle.js || (declarationFilePath && !buildInfo.bundle.dts)) return buildInfoPath!;
|
||||
|
||||
const jsFileText = host.readFile(Debug.checkDefined(jsFilePath));
|
||||
@@ -806,7 +804,7 @@ namespace ts {
|
||||
const emitHost: EmitHost = {
|
||||
getPrependNodes: memoize(() => [...prependNodes, ownPrependInput]),
|
||||
getCanonicalFileName: host.getCanonicalFileName,
|
||||
getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo.bundle!.commonSourceDirectory, buildInfoDirectory),
|
||||
getCommonSourceDirectory: () => getNormalizedAbsolutePath(buildInfo!.bundle!.commonSourceDirectory, buildInfoDirectory),
|
||||
getCompilerOptions: () => config.options,
|
||||
getCurrentDirectory: () => host.getCurrentDirectory(),
|
||||
getNewLine: () => host.getNewLine(),
|
||||
@@ -828,14 +826,13 @@ namespace ts {
|
||||
break;
|
||||
case buildInfoPath:
|
||||
const newBuildInfo = data!.buildInfo!;
|
||||
newBuildInfo.program = buildInfo.program;
|
||||
newBuildInfo.program = buildInfo!.program;
|
||||
if (newBuildInfo.program && changedDtsText !== undefined && config.options.composite) {
|
||||
// Update the output signature
|
||||
(newBuildInfo.program as ProgramBundleEmitBuildInfo).outSignature = computeSignature(changedDtsText, createHash, changedDtsData);
|
||||
newBuildInfo.program.dtsChangeTime = getCurrentTime(host).getTime();
|
||||
}
|
||||
// Update sourceFileInfo
|
||||
const { js, dts, sourceFiles } = buildInfo.bundle!;
|
||||
const { js, dts, sourceFiles } = buildInfo!.bundle!;
|
||||
newBuildInfo.bundle!.js!.sources = js!.sources;
|
||||
if (dts) {
|
||||
newBuildInfo.bundle!.dts!.sources = dts.sources;
|
||||
|
||||
@@ -1188,7 +1188,7 @@ namespace ts {
|
||||
// @api
|
||||
function createDecorator(expression: Expression) {
|
||||
const node = createBaseNode<Decorator>(SyntaxKind.Decorator);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.transformFlags |=
|
||||
propagateChildFlags(node.expression) |
|
||||
TransformFlags.ContainsTypeScript |
|
||||
@@ -2325,13 +2325,13 @@ namespace ts {
|
||||
// @api
|
||||
function createPropertyAccessExpression(expression: Expression, name: string | Identifier | PrivateIdentifier) {
|
||||
const node = createBaseExpression<PropertyAccessExpression>(SyntaxKind.PropertyAccessExpression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.name = asName(name);
|
||||
node.transformFlags =
|
||||
propagateChildFlags(node.expression) |
|
||||
(isIdentifier(node.name) ?
|
||||
propagateIdentifierNameFlags(node.name) :
|
||||
propagateChildFlags(node.name));
|
||||
propagateChildFlags(node.name) | TransformFlags.ContainsPrivateIdentifierInExpression);
|
||||
if (isSuperKeyword(expression)) {
|
||||
// super method calls require a lexical 'this'
|
||||
// super method calls require 'super' hoisting in ES2017 and ES2018 async functions and async generators
|
||||
@@ -2357,7 +2357,7 @@ namespace ts {
|
||||
function createPropertyAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, name: string | Identifier | PrivateIdentifier) {
|
||||
const node = createBaseExpression<PropertyAccessChain>(SyntaxKind.PropertyAccessExpression);
|
||||
node.flags |= NodeFlags.OptionalChain;
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ true);
|
||||
node.questionDotToken = questionDotToken;
|
||||
node.name = asName(name);
|
||||
node.transformFlags |=
|
||||
@@ -2366,7 +2366,7 @@ namespace ts {
|
||||
propagateChildFlags(node.questionDotToken) |
|
||||
(isIdentifier(node.name) ?
|
||||
propagateIdentifierNameFlags(node.name) :
|
||||
propagateChildFlags(node.name));
|
||||
propagateChildFlags(node.name) | TransformFlags.ContainsPrivateIdentifierInExpression);
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -2385,7 +2385,7 @@ namespace ts {
|
||||
// @api
|
||||
function createElementAccessExpression(expression: Expression, index: number | Expression) {
|
||||
const node = createBaseExpression<ElementAccessExpression>(SyntaxKind.ElementAccessExpression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.argumentExpression = asExpression(index);
|
||||
node.transformFlags |=
|
||||
propagateChildFlags(node.expression) |
|
||||
@@ -2415,7 +2415,7 @@ namespace ts {
|
||||
function createElementAccessChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, index: number | Expression) {
|
||||
const node = createBaseExpression<ElementAccessChain>(SyntaxKind.ElementAccessExpression);
|
||||
node.flags |= NodeFlags.OptionalChain;
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ true);
|
||||
node.questionDotToken = questionDotToken;
|
||||
node.argumentExpression = asExpression(index);
|
||||
node.transformFlags |=
|
||||
@@ -2441,7 +2441,7 @@ namespace ts {
|
||||
// @api
|
||||
function createCallExpression(expression: Expression, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) {
|
||||
const node = createBaseExpression<CallExpression>(SyntaxKind.CallExpression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.typeArguments = asNodeArray(typeArguments);
|
||||
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
||||
node.transformFlags |=
|
||||
@@ -2476,7 +2476,7 @@ namespace ts {
|
||||
function createCallChain(expression: Expression, questionDotToken: QuestionDotToken | undefined, typeArguments: readonly TypeNode[] | undefined, argumentsArray: readonly Expression[] | undefined) {
|
||||
const node = createBaseExpression<CallChain>(SyntaxKind.CallExpression);
|
||||
node.flags |= NodeFlags.OptionalChain;
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ true);
|
||||
node.questionDotToken = questionDotToken;
|
||||
node.typeArguments = asNodeArray(typeArguments);
|
||||
node.arguments = parenthesizerRules().parenthesizeExpressionsOfCommaDelimitedList(createNodeArray(argumentsArray));
|
||||
@@ -2535,7 +2535,7 @@ namespace ts {
|
||||
// @api
|
||||
function createTaggedTemplateExpression(tag: Expression, typeArguments: readonly TypeNode[] | undefined, template: TemplateLiteral) {
|
||||
const node = createBaseExpression<TaggedTemplateExpression>(SyntaxKind.TaggedTemplateExpression);
|
||||
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag);
|
||||
node.tag = parenthesizerRules().parenthesizeLeftSideOfAccess(tag, /*optionalChain*/ false);
|
||||
node.typeArguments = asNodeArray(typeArguments);
|
||||
node.template = template;
|
||||
node.transformFlags |=
|
||||
@@ -2851,6 +2851,9 @@ namespace ts {
|
||||
else if (isLogicalOrCoalescingAssignmentOperator(operatorKind)) {
|
||||
node.transformFlags |= TransformFlags.ContainsES2021;
|
||||
}
|
||||
if (operatorKind === SyntaxKind.InKeyword && isPrivateIdentifier(node.left)) {
|
||||
node.transformFlags |= TransformFlags.ContainsPrivateIdentifierInExpression;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
@@ -3082,7 +3085,7 @@ namespace ts {
|
||||
// @api
|
||||
function createExpressionWithTypeArguments(expression: Expression, typeArguments: readonly TypeNode[] | undefined) {
|
||||
const node = createBaseNode<ExpressionWithTypeArguments>(SyntaxKind.ExpressionWithTypeArguments);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.typeArguments = typeArguments && parenthesizerRules().parenthesizeTypeArguments(typeArguments);
|
||||
node.transformFlags |=
|
||||
propagateChildFlags(node.expression) |
|
||||
@@ -3122,7 +3125,7 @@ namespace ts {
|
||||
// @api
|
||||
function createNonNullExpression(expression: Expression) {
|
||||
const node = createBaseExpression<NonNullExpression>(SyntaxKind.NonNullExpression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
node.transformFlags |=
|
||||
propagateChildFlags(node.expression) |
|
||||
TransformFlags.ContainsTypeScript;
|
||||
@@ -3143,7 +3146,7 @@ namespace ts {
|
||||
function createNonNullChain(expression: Expression) {
|
||||
const node = createBaseExpression<NonNullChain>(SyntaxKind.NonNullExpression);
|
||||
node.flags |= NodeFlags.OptionalChain;
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
node.expression = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ true);
|
||||
node.transformFlags |=
|
||||
propagateChildFlags(node.expression) |
|
||||
TransformFlags.ContainsTypeScript;
|
||||
@@ -5821,7 +5824,7 @@ namespace ts {
|
||||
}
|
||||
else if (getEmitFlags(callee) & EmitFlags.HelperName) {
|
||||
thisArg = createVoidZero();
|
||||
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee);
|
||||
target = parenthesizerRules().parenthesizeLeftSideOfAccess(callee, /*optionalChain*/ false);
|
||||
}
|
||||
else if (isPropertyAccessExpression(callee)) {
|
||||
if (shouldBeCapturedInTempVariable(callee.expression, cacheIdentifiers)) {
|
||||
@@ -5868,7 +5871,7 @@ namespace ts {
|
||||
else {
|
||||
// for `a()` target is `a` and thisArg is `void 0`
|
||||
thisArg = createVoidZero();
|
||||
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression);
|
||||
target = parenthesizerRules().parenthesizeLeftSideOfAccess(expression, /*optionalChain*/ false);
|
||||
}
|
||||
|
||||
return { target, thisArg };
|
||||
@@ -6731,7 +6734,7 @@ namespace ts {
|
||||
const getAndCacheBuildInfo = (getText: () => string | undefined) => {
|
||||
if (buildInfo === undefined) {
|
||||
const result = getText();
|
||||
buildInfo = result !== undefined ? getBuildInfo(result) : false;
|
||||
buildInfo = result !== undefined ? getBuildInfo(node.buildInfoPath!, result) ?? false : false;
|
||||
}
|
||||
return buildInfo || undefined;
|
||||
};
|
||||
|
||||
@@ -319,7 +319,7 @@ namespace ts {
|
||||
* Wraps an expression in parentheses if it is needed in order to use the expression for
|
||||
* property or element access.
|
||||
*/
|
||||
function parenthesizeLeftSideOfAccess(expression: Expression): LeftHandSideExpression {
|
||||
function parenthesizeLeftSideOfAccess(expression: Expression, optionalChain?: boolean): LeftHandSideExpression {
|
||||
// isLeftHandSideExpression is almost the correct criterion for when it is not necessary
|
||||
// to parenthesize the expression before a dot. The known exception is:
|
||||
//
|
||||
@@ -328,7 +328,8 @@ namespace ts {
|
||||
//
|
||||
const emittedExpression = skipPartiallyEmittedExpressions(expression);
|
||||
if (isLeftHandSideExpression(emittedExpression)
|
||||
&& (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression as NewExpression).arguments)) {
|
||||
&& (emittedExpression.kind !== SyntaxKind.NewExpression || (emittedExpression as NewExpression).arguments)
|
||||
&& (optionalChain || !isOptionalChain(emittedExpression))) {
|
||||
// TODO(rbuckton): Verify whether this assertion holds.
|
||||
return expression as LeftHandSideExpression;
|
||||
}
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace ts {
|
||||
resultFromCache?: ResolvedModuleWithFailedLookupLocations;
|
||||
packageJsonInfoCache: PackageJsonInfoCache | undefined;
|
||||
features: NodeResolutionFeatures;
|
||||
conditions: string[];
|
||||
conditions: readonly string[];
|
||||
requestContainingDirectory: string | undefined;
|
||||
reportDiagnostic: DiagnosticReporter;
|
||||
}
|
||||
@@ -486,18 +486,7 @@ namespace ts {
|
||||
host: ModuleResolutionHost,
|
||||
cache: ModuleResolutionCache | undefined,
|
||||
): PackageJsonInfo | undefined {
|
||||
const moduleResolutionState: ModuleResolutionState = {
|
||||
compilerOptions: options,
|
||||
host,
|
||||
traceEnabled: isTraceEnabled(options, host),
|
||||
failedLookupLocations: [],
|
||||
affectingLocations: [],
|
||||
packageJsonInfoCache: cache?.getPackageJsonInfoCache(),
|
||||
conditions: emptyArray,
|
||||
features: NodeResolutionFeatures.None,
|
||||
requestContainingDirectory: containingDirectory,
|
||||
reportDiagnostic: noop
|
||||
};
|
||||
const moduleResolutionState = getTemporaryModuleResolutionState(cache?.getPackageJsonInfoCache(), host, options);
|
||||
|
||||
return forEachAncestorDirectory(containingDirectory, ancestorDirectory => {
|
||||
if (getBaseFileName(ancestorDirectory) !== "node_modules") {
|
||||
@@ -554,6 +543,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
export interface TypeReferenceDirectiveResolutionCache extends PerDirectoryResolutionCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>, PackageJsonInfoCache {
|
||||
/*@internal*/ clearAllExceptPackageJsonInfoCache(): void;
|
||||
}
|
||||
|
||||
export interface ModeAwareCache<T> {
|
||||
@@ -581,6 +571,7 @@ namespace ts {
|
||||
|
||||
export interface ModuleResolutionCache extends PerDirectoryResolutionCache<ResolvedModuleWithFailedLookupLocations>, NonRelativeModuleNameResolutionCache, PackageJsonInfoCache {
|
||||
getPackageJsonInfoCache(): PackageJsonInfoCache;
|
||||
/*@internal*/ clearAllExceptPackageJsonInfoCache(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -595,6 +586,7 @@ namespace ts {
|
||||
/*@internal*/ getPackageJsonInfo(packageJsonPath: string): PackageJsonInfo | boolean | undefined;
|
||||
/*@internal*/ setPackageJsonInfo(packageJsonPath: string, info: PackageJsonInfo | boolean): void;
|
||||
/*@internal*/ entries(): [Path, PackageJsonInfo | boolean][];
|
||||
/*@internal*/ getInternalMap(): ESMap<Path, PackageJsonInfo | boolean> | undefined;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
@@ -660,7 +652,7 @@ namespace ts {
|
||||
|
||||
function createPackageJsonInfoCache(currentDirectory: string, getCanonicalFileName: (s: string) => string): PackageJsonInfoCache {
|
||||
let cache: ESMap<Path, PackageJsonInfo | boolean> | undefined;
|
||||
return { getPackageJsonInfo, setPackageJsonInfo, clear, entries };
|
||||
return { getPackageJsonInfo, setPackageJsonInfo, clear, entries, getInternalMap };
|
||||
function getPackageJsonInfo(packageJsonPath: string) {
|
||||
return cache?.get(toPath(packageJsonPath, currentDirectory, getCanonicalFileName));
|
||||
}
|
||||
@@ -674,6 +666,9 @@ namespace ts {
|
||||
const iter = cache?.entries();
|
||||
return iter ? arrayFrom(iter) : [];
|
||||
}
|
||||
function getInternalMap() {
|
||||
return cache;
|
||||
}
|
||||
}
|
||||
|
||||
function getOrCreateCache<T>(cacheWithRedirects: CacheWithRedirects<T>, redirectedReference: ResolvedProjectReference | undefined, key: string, create: () => T): T {
|
||||
@@ -808,25 +803,30 @@ namespace ts {
|
||||
directoryToModuleNameMap?: CacheWithRedirects<ModeAwareCache<ResolvedModuleWithFailedLookupLocations>>,
|
||||
moduleNameToDirectoryMap?: CacheWithRedirects<PerModuleNameCache>,
|
||||
): ModuleResolutionCache {
|
||||
const preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
moduleNameToDirectoryMap ||= createCacheWithRedirects(options);
|
||||
const packageJsonInfoCache = createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
||||
|
||||
return {
|
||||
...packageJsonInfoCache,
|
||||
...preDirectoryResolutionCache,
|
||||
...perDirectoryResolutionCache,
|
||||
getOrCreateCacheForModuleName,
|
||||
clear,
|
||||
update,
|
||||
getPackageJsonInfoCache: () => packageJsonInfoCache,
|
||||
clearAllExceptPackageJsonInfoCache,
|
||||
};
|
||||
|
||||
function clear() {
|
||||
preDirectoryResolutionCache.clear();
|
||||
moduleNameToDirectoryMap!.clear();
|
||||
clearAllExceptPackageJsonInfoCache();
|
||||
packageJsonInfoCache.clear();
|
||||
}
|
||||
|
||||
function clearAllExceptPackageJsonInfoCache() {
|
||||
perDirectoryResolutionCache.clear();
|
||||
moduleNameToDirectoryMap!.clear();
|
||||
}
|
||||
|
||||
function update(options: CompilerOptions) {
|
||||
updateRedirectsMap(options, directoryToModuleNameMap!, moduleNameToDirectoryMap);
|
||||
}
|
||||
@@ -930,19 +930,24 @@ namespace ts {
|
||||
packageJsonInfoCache?: PackageJsonInfoCache | undefined,
|
||||
directoryToModuleNameMap?: CacheWithRedirects<ModeAwareCache<ResolvedTypeReferenceDirectiveWithFailedLookupLocations>>,
|
||||
): TypeReferenceDirectiveResolutionCache {
|
||||
const preDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
const perDirectoryResolutionCache = createPerDirectoryResolutionCache(currentDirectory, getCanonicalFileName, directoryToModuleNameMap ||= createCacheWithRedirects(options));
|
||||
packageJsonInfoCache ||= createPackageJsonInfoCache(currentDirectory, getCanonicalFileName);
|
||||
|
||||
return {
|
||||
...packageJsonInfoCache,
|
||||
...preDirectoryResolutionCache,
|
||||
...perDirectoryResolutionCache,
|
||||
clear,
|
||||
clearAllExceptPackageJsonInfoCache,
|
||||
};
|
||||
|
||||
function clear() {
|
||||
preDirectoryResolutionCache.clear();
|
||||
clearAllExceptPackageJsonInfoCache();
|
||||
packageJsonInfoCache!.clear();
|
||||
}
|
||||
|
||||
function clearAllExceptPackageJsonInfoCache() {
|
||||
perDirectoryResolutionCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
export function resolveModuleNameFromCache(moduleName: string, containingFile: string, cache: ModuleResolutionCache, mode?: ModuleKind.CommonJS | ModuleKind.ESNext): ResolvedModuleWithFailedLookupLocations | undefined {
|
||||
@@ -1692,18 +1697,9 @@ namespace ts {
|
||||
let entrypoints: string[] | undefined;
|
||||
const extensions = resolveJs ? Extensions.JavaScript : Extensions.TypeScript;
|
||||
const features = getDefaultNodeResolutionFeatures(options);
|
||||
const requireState: ModuleResolutionState = {
|
||||
compilerOptions: options,
|
||||
host,
|
||||
traceEnabled: isTraceEnabled(options, host),
|
||||
failedLookupLocations: [],
|
||||
affectingLocations: [],
|
||||
packageJsonInfoCache: cache?.getPackageJsonInfoCache(),
|
||||
conditions: ["node", "require", "types"],
|
||||
features,
|
||||
requestContainingDirectory: packageJsonInfo.packageDirectory,
|
||||
reportDiagnostic: noop
|
||||
};
|
||||
const requireState = getTemporaryModuleResolutionState(cache?.getPackageJsonInfoCache(), host, options);
|
||||
requireState.conditions = ["node", "require", "types"];
|
||||
requireState.requestContainingDirectory = packageJsonInfo.packageDirectory;
|
||||
const requireResolution = loadNodeModuleFromDirectoryWorker(
|
||||
extensions,
|
||||
packageJsonInfo.packageDirectory,
|
||||
@@ -1790,7 +1786,23 @@ namespace ts {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
interface PackageJsonInfo {
|
||||
export function getTemporaryModuleResolutionState(packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleResolutionState {
|
||||
return {
|
||||
host,
|
||||
compilerOptions: options,
|
||||
traceEnabled: isTraceEnabled(options, host),
|
||||
failedLookupLocations: noopPush,
|
||||
affectingLocations: noopPush,
|
||||
packageJsonInfoCache,
|
||||
features: NodeResolutionFeatures.None,
|
||||
conditions: emptyArray,
|
||||
requestContainingDirectory: undefined,
|
||||
reportDiagnostic: noop
|
||||
};
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export interface PackageJsonInfo {
|
||||
packageDirectory: string;
|
||||
packageJsonContent: PackageJsonPathFields;
|
||||
versionPaths: VersionPaths | undefined;
|
||||
@@ -1802,31 +1814,7 @@ namespace ts {
|
||||
* A function for locating the package.json scope for a given path
|
||||
*/
|
||||
/*@internal*/
|
||||
export function getPackageScopeForPath(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): PackageJsonInfo | undefined {
|
||||
const state: {
|
||||
host: ModuleResolutionHost;
|
||||
compilerOptions: CompilerOptions;
|
||||
traceEnabled: boolean;
|
||||
failedLookupLocations: Push<string>;
|
||||
affectingLocations: Push<string>;
|
||||
resultFromCache?: ResolvedModuleWithFailedLookupLocations;
|
||||
packageJsonInfoCache: PackageJsonInfoCache | undefined;
|
||||
features: number;
|
||||
conditions: never[];
|
||||
requestContainingDirectory: string | undefined;
|
||||
reportDiagnostic: DiagnosticReporter
|
||||
} = {
|
||||
host,
|
||||
compilerOptions: options,
|
||||
traceEnabled: isTraceEnabled(options, host),
|
||||
failedLookupLocations: [],
|
||||
affectingLocations: [],
|
||||
packageJsonInfoCache,
|
||||
features: 0,
|
||||
conditions: [],
|
||||
requestContainingDirectory: undefined,
|
||||
reportDiagnostic: noop
|
||||
};
|
||||
export function getPackageScopeForPath(fileName: Path, state: ModuleResolutionState): PackageJsonInfo | undefined {
|
||||
const parts = getPathComponents(fileName);
|
||||
parts.pop();
|
||||
while (parts.length > 0) {
|
||||
@@ -2004,7 +1992,7 @@ namespace ts {
|
||||
function loadModuleFromSelfNameReference(extensions: Extensions, moduleName: string, directory: string, state: ModuleResolutionState, cache: ModuleResolutionCache | undefined, redirectedReference: ResolvedProjectReference | undefined): SearchResult<Resolved> {
|
||||
const useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
|
||||
const directoryPath = toPath(combinePaths(directory, "dummy"), state.host.getCurrentDirectory?.(), createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
||||
const scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
|
||||
const scope = getPackageScopeForPath(directoryPath, state);
|
||||
if (!scope || !scope.packageJsonContent.exports) {
|
||||
return undefined;
|
||||
}
|
||||
@@ -2066,7 +2054,7 @@ namespace ts {
|
||||
}
|
||||
const useCaseSensitiveFileNames = typeof state.host.useCaseSensitiveFileNames === "function" ? state.host.useCaseSensitiveFileNames() : state.host.useCaseSensitiveFileNames;
|
||||
const directoryPath = toPath(combinePaths(directory, "dummy"), state.host.getCurrentDirectory?.(), createGetCanonicalFileName(useCaseSensitiveFileNames === undefined ? true : useCaseSensitiveFileNames));
|
||||
const scope = getPackageScopeForPath(directoryPath, state.packageJsonInfoCache, state.host, state.compilerOptions);
|
||||
const scope = getPackageScopeForPath(directoryPath, state);
|
||||
if (!scope) {
|
||||
if (state.traceEnabled) {
|
||||
trace(state.host, Diagnostics.Directory_0_has_no_containing_package_json_scope_Imports_will_not_resolve, directoryPath);
|
||||
@@ -2092,10 +2080,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
/**
|
||||
* @internal
|
||||
* From https://github.com/nodejs/node/blob/8f39f51cbbd3b2de14b9ee896e26421cc5b20121/lib/internal/modules/esm/resolve.js#L722 -
|
||||
* "longest" has some nuance as to what "longest" means in the presence of pattern trailers
|
||||
*/
|
||||
function comparePatternKeys(a: string, b: string) {
|
||||
export function comparePatternKeys(a: string, b: string) {
|
||||
const aPatternIndex = a.indexOf("*");
|
||||
const bPatternIndex = b.indexOf("*");
|
||||
const baseLenA = aPatternIndex === -1 ? a.length : aPatternIndex + 1;
|
||||
@@ -2361,7 +2350,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export function isApplicableVersionedTypesKey(conditions: string[], key: string) {
|
||||
export function isApplicableVersionedTypesKey(conditions: readonly string[], key: string) {
|
||||
if (conditions.indexOf("types") === -1) return false; // only apply versioned types conditions if the types condition is applied
|
||||
if (!startsWith(key, "types@")) return false;
|
||||
const range = VersionRange.tryParse(key.substring("types@".length));
|
||||
|
||||
@@ -121,7 +121,7 @@ namespace ts.moduleSpecifiers {
|
||||
const info = getInfo(importingSourceFileName, host);
|
||||
const modulePaths = getAllModulePaths(importingSourceFileName, toFileName, host, userPreferences, options);
|
||||
return firstDefined(modulePaths, modulePath => tryGetModuleNameAsNodeModule(modulePath, info, importingSourceFile, host, compilerOptions, userPreferences, /*packageNameOnly*/ undefined, options.overrideImportMode)) ||
|
||||
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, preferences);
|
||||
getLocalModuleSpecifier(toFileName, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
||||
}
|
||||
|
||||
export function tryGetModuleSpecifiersFromCache(
|
||||
@@ -257,7 +257,7 @@ namespace ts.moduleSpecifiers {
|
||||
}
|
||||
|
||||
if (!specifier && !modulePath.isRedirect) {
|
||||
const local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, preferences);
|
||||
const local = getLocalModuleSpecifier(modulePath.path, info, compilerOptions, host, options.overrideImportMode || importingSourceFile.impliedNodeFormat, preferences);
|
||||
if (pathIsBareSpecifier(local)) {
|
||||
pathsSpecifiers = append(pathsSpecifiers, local);
|
||||
}
|
||||
@@ -293,7 +293,7 @@ namespace ts.moduleSpecifiers {
|
||||
return { getCanonicalFileName, importingSourceFileName, sourceDirectory };
|
||||
}
|
||||
|
||||
function getLocalModuleSpecifier(moduleFileName: string, info: Info, compilerOptions: CompilerOptions, host: ModuleSpecifierResolutionHost, { ending, relativePreference }: Preferences): string {
|
||||
function getLocalModuleSpecifier(moduleFileName: string, info: Info, compilerOptions: CompilerOptions, host: ModuleSpecifierResolutionHost, importMode: SourceFile["impliedNodeFormat"], { ending, relativePreference }: Preferences): string {
|
||||
const { baseUrl, paths, rootDirs } = compilerOptions;
|
||||
const { sourceDirectory, getCanonicalFileName } = info;
|
||||
const relativePath = rootDirs && tryGetModuleNameFromRootDirs(rootDirs, moduleFileName, sourceDirectory, getCanonicalFileName, ending, compilerOptions) ||
|
||||
@@ -308,9 +308,8 @@ namespace ts.moduleSpecifiers {
|
||||
return relativePath;
|
||||
}
|
||||
|
||||
const importRelativeToBaseUrl = removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions);
|
||||
const fromPaths = paths && tryGetModuleNameFromPaths(removeFileExtension(relativeToBaseUrl), importRelativeToBaseUrl, paths);
|
||||
const nonRelative = fromPaths === undefined && baseUrl !== undefined ? importRelativeToBaseUrl : fromPaths;
|
||||
const fromPaths = paths && tryGetModuleNameFromPaths(relativeToBaseUrl, paths, getAllowedEndings(ending, compilerOptions, importMode), host, compilerOptions);
|
||||
const nonRelative = fromPaths === undefined && baseUrl !== undefined ? removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions) : fromPaths;
|
||||
if (!nonRelative) {
|
||||
return relativePath;
|
||||
}
|
||||
@@ -559,27 +558,100 @@ namespace ts.moduleSpecifiers {
|
||||
}
|
||||
}
|
||||
|
||||
function tryGetModuleNameFromPaths(relativeToBaseUrlWithIndex: string, relativeToBaseUrl: string, paths: MapLike<readonly string[]>): string | undefined {
|
||||
function getAllowedEndings(preferredEnding: Ending, compilerOptions: CompilerOptions, importMode: SourceFile["impliedNodeFormat"]) {
|
||||
if (getEmitModuleResolutionKind(compilerOptions) >= ModuleResolutionKind.Node16 && importMode === ModuleKind.ESNext) {
|
||||
return [Ending.JsExtension];
|
||||
}
|
||||
switch (preferredEnding) {
|
||||
case Ending.JsExtension: return [Ending.JsExtension, Ending.Minimal, Ending.Index];
|
||||
case Ending.Index: return [Ending.Index, Ending.Minimal, Ending.JsExtension];
|
||||
case Ending.Minimal: return [Ending.Minimal, Ending.Index, Ending.JsExtension];
|
||||
default: Debug.assertNever(preferredEnding);
|
||||
}
|
||||
}
|
||||
|
||||
function tryGetModuleNameFromPaths(relativeToBaseUrl: string, paths: MapLike<readonly string[]>, allowedEndings: Ending[], host: ModuleSpecifierResolutionHost, compilerOptions: CompilerOptions): string | undefined {
|
||||
for (const key in paths) {
|
||||
for (const patternText of paths[key]) {
|
||||
const pattern = removeFileExtension(normalizePath(patternText));
|
||||
const pattern = normalizePath(patternText);
|
||||
const indexOfStar = pattern.indexOf("*");
|
||||
// In module resolution, if `pattern` itself has an extension, a file with that extension is looked up directly,
|
||||
// meaning a '.ts' or '.d.ts' extension is allowed to resolve. This is distinct from the case where a '*' substitution
|
||||
// causes a module specifier to have an extension, i.e. the extension comes from the module specifier in a JS/TS file
|
||||
// and matches the '*'. For example:
|
||||
//
|
||||
// Module Specifier | Path Mapping (key: [pattern]) | Interpolation | Resolution Action
|
||||
// ---------------------->------------------------------->--------------------->---------------------------------------------------------------
|
||||
// import "@app/foo" -> "@app/*": ["./src/app/*.ts"] -> "./src/app/foo.ts" -> tryFile("./src/app/foo.ts") || [continue resolution algorithm]
|
||||
// import "@app/foo.ts" -> "@app/*": ["./src/app/*"] -> "./src/app/foo.ts" -> [continue resolution algorithm]
|
||||
//
|
||||
// (https://github.com/microsoft/TypeScript/blob/ad4ded80e1d58f0bf36ac16bea71bc10d9f09895/src/compiler/moduleNameResolver.ts#L2509-L2516)
|
||||
//
|
||||
// The interpolation produced by both scenarios is identical, but only in the former, where the extension is encoded in
|
||||
// the path mapping rather than in the module specifier, will we prioritize a file lookup on the interpolation result.
|
||||
// (In fact, currently, the latter scenario will necessarily fail since no resolution mode recognizes '.ts' as a valid
|
||||
// extension for a module specifier.)
|
||||
//
|
||||
// Here, this means we need to be careful about whether we generate a match from the target filename (typically with a
|
||||
// .ts extension) or the possible relative module specifiers representing that file:
|
||||
//
|
||||
// Filename | Relative Module Specifier Candidates | Path Mapping | Filename Result | Module Specifier Results
|
||||
// --------------------<----------------------------------------------<------------------------------<-------------------||----------------------------
|
||||
// dist/haha.d.ts <- dist/haha, dist/haha.js <- "@app/*": ["./dist/*.d.ts"] <- @app/haha || (none)
|
||||
// dist/haha.d.ts <- dist/haha, dist/haha.js <- "@app/*": ["./dist/*"] <- (none) || @app/haha, @app/haha.js
|
||||
// dist/foo/index.d.ts <- dist/foo, dist/foo/index, dist/foo/index.js <- "@app/*": ["./dist/*.d.ts"] <- @app/foo/index || (none)
|
||||
// dist/foo/index.d.ts <- dist/foo, dist/foo/index, dist/foo/index.js <- "@app/*": ["./dist/*"] <- (none) || @app/foo, @app/foo/index, @app/foo/index.js
|
||||
// dist/wow.js.js <- dist/wow.js, dist/wow.js.js <- "@app/*": ["./dist/*.js"] <- @app/wow.js || @app/wow, @app/wow.js
|
||||
//
|
||||
// The "Filename Result" can be generated only if `pattern` has an extension. Care must be taken that the list of
|
||||
// relative module specifiers to run the interpolation (a) is actually valid for the module resolution mode, (b) takes
|
||||
// into account the existence of other files (e.g. 'dist/wow.js' cannot refer to 'dist/wow.js.js' if 'dist/wow.js'
|
||||
// exists) and (c) that they are ordered by preference. The last row shows that the filename result and module
|
||||
// specifier results are not mutually exclusive. Note that the filename result is a higher priority in module
|
||||
// resolution, but as long criteria (b) above is met, I don't think its result needs to be the highest priority result
|
||||
// in module specifier generation. I have included it last, as it's difficult to tell exactly where it should be
|
||||
// sorted among the others for a particular value of `importModuleSpecifierEnding`.
|
||||
const candidates: { ending: Ending | undefined, value: string }[] = allowedEndings.map(ending => ({
|
||||
ending,
|
||||
value: removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions)
|
||||
}));
|
||||
if (tryGetExtensionFromPath(pattern)) {
|
||||
candidates.push({ ending: undefined, value: relativeToBaseUrl });
|
||||
}
|
||||
|
||||
if (indexOfStar !== -1) {
|
||||
const prefix = pattern.substr(0, indexOfStar);
|
||||
const suffix = pattern.substr(indexOfStar + 1);
|
||||
if (relativeToBaseUrl.length >= prefix.length + suffix.length &&
|
||||
startsWith(relativeToBaseUrl, prefix) &&
|
||||
endsWith(relativeToBaseUrl, suffix) ||
|
||||
!suffix && relativeToBaseUrl === removeTrailingDirectorySeparator(prefix)) {
|
||||
const matchedStar = relativeToBaseUrl.substr(prefix.length, relativeToBaseUrl.length - suffix.length - prefix.length);
|
||||
return key.replace("*", matchedStar);
|
||||
const prefix = pattern.substring(0, indexOfStar);
|
||||
const suffix = pattern.substring(indexOfStar + 1);
|
||||
for (const { ending, value } of candidates) {
|
||||
if (value.length >= prefix.length + suffix.length &&
|
||||
startsWith(value, prefix) &&
|
||||
endsWith(value, suffix) &&
|
||||
validateEnding({ ending, value })
|
||||
) {
|
||||
const matchedStar = value.substring(prefix.length, value.length - suffix.length);
|
||||
return key.replace("*", matchedStar);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (pattern === relativeToBaseUrl || pattern === relativeToBaseUrlWithIndex) {
|
||||
else if (
|
||||
some(candidates, c => c.ending !== Ending.Minimal && pattern === c.value) ||
|
||||
some(candidates, c => c.ending === Ending.Minimal && pattern === c.value && validateEnding(c))
|
||||
) {
|
||||
return key;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function validateEnding({ ending, value }: { ending: Ending | undefined, value: string }) {
|
||||
// Optimization: `removeExtensionAndIndexPostFix` can query the file system (a good bit) if `ending` is `Minimal`, the basename
|
||||
// is 'index', and a `host` is provided. To avoid that until it's unavoidable, we ran the function with no `host` above. Only
|
||||
// here, after we've checked that the minimal ending is indeed a match (via the length and prefix/suffix checks / `some` calls),
|
||||
// do we check that the host-validated result is consistent with the answer we got before. If it's not, it falls back to the
|
||||
// `Ending.Index` result, which should already be in the list of candidates if `Minimal` was. (Note: the assumption here is
|
||||
// that every module resolution mode that supports dropping extensions also supports dropping `/index`. Like literally
|
||||
// everything else in this file, this logic needs to be updated if that's not true in some future module resolution mode.)
|
||||
return ending !== Ending.Minimal || value === removeExtensionAndIndexPostFix(relativeToBaseUrl, ending, compilerOptions, host);
|
||||
}
|
||||
}
|
||||
|
||||
const enum MatchingMode {
|
||||
@@ -677,10 +749,10 @@ namespace ts.moduleSpecifiers {
|
||||
|
||||
// Simplify the full file path to something that can be resolved by Node.
|
||||
|
||||
const preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
||||
let moduleSpecifier = path;
|
||||
let isPackageRootPath = false;
|
||||
if (!packageNameOnly) {
|
||||
const preferences = getPreferences(host, userPreferences, options, importingSourceFile);
|
||||
let packageRootIndex = parts.packageRootIndex;
|
||||
let moduleFileName: string | undefined;
|
||||
while (true) {
|
||||
@@ -732,15 +804,13 @@ namespace ts.moduleSpecifiers {
|
||||
const packageRootPath = path.substring(0, packageRootIndex);
|
||||
const packageJsonPath = combinePaths(packageRootPath, "package.json");
|
||||
let moduleFileToTry = path;
|
||||
let maybeBlockedByTypesVersions = false;
|
||||
const cachedPackageJson = host.getPackageJsonInfoCache?.()?.getPackageJsonInfo(packageJsonPath);
|
||||
if (typeof cachedPackageJson === "object" || cachedPackageJson === undefined && host.fileExists(packageJsonPath)) {
|
||||
const packageJsonContent = cachedPackageJson?.packageJsonContent || JSON.parse(host.readFile!(packageJsonPath)!);
|
||||
const importMode = overrideMode || importingSourceFile.impliedNodeFormat;
|
||||
if (getEmitModuleResolutionKind(options) === ModuleResolutionKind.Node16 || getEmitModuleResolutionKind(options) === ModuleResolutionKind.NodeNext) {
|
||||
// `conditions` *could* be made to go against `importingSourceFile.impliedNodeFormat` if something wanted to generate
|
||||
// an ImportEqualsDeclaration in an ESM-implied file or an ImportCall in a CJS-implied file. But since this function is
|
||||
// usually called to conjure an import out of thin air, we don't have an existing usage to call `getModeForUsageAtIndex`
|
||||
// with, so for now we just stick with the mode of the file.
|
||||
const conditions = ["node", overrideMode || importingSourceFile.impliedNodeFormat === ModuleKind.ESNext ? "import" : "require", "types"];
|
||||
const conditions = ["node", importMode === ModuleKind.ESNext ? "import" : "require", "types"];
|
||||
const fromExports = packageJsonContent.exports && typeof packageJsonContent.name === "string"
|
||||
? tryGetModuleNameFromExports(options, path, packageRootPath, getPackageNameFromTypesPackageName(packageJsonContent.name), packageJsonContent.exports, conditions)
|
||||
: undefined;
|
||||
@@ -760,19 +830,31 @@ namespace ts.moduleSpecifiers {
|
||||
if (versionPaths) {
|
||||
const subModuleName = path.slice(packageRootPath.length + 1);
|
||||
const fromPaths = tryGetModuleNameFromPaths(
|
||||
removeFileExtension(subModuleName),
|
||||
removeExtensionAndIndexPostFix(subModuleName, Ending.Minimal, options),
|
||||
versionPaths.paths
|
||||
subModuleName,
|
||||
versionPaths.paths,
|
||||
getAllowedEndings(preferences.ending, options, importMode),
|
||||
host,
|
||||
options
|
||||
);
|
||||
if (fromPaths !== undefined) {
|
||||
if (fromPaths === undefined) {
|
||||
maybeBlockedByTypesVersions = true;
|
||||
}
|
||||
else {
|
||||
moduleFileToTry = combinePaths(packageRootPath, fromPaths);
|
||||
}
|
||||
}
|
||||
// If the file is the main module, it can be imported by the package name
|
||||
const mainFileRelative = packageJsonContent.typings || packageJsonContent.types || packageJsonContent.main || "index.js";
|
||||
if (isString(mainFileRelative)) {
|
||||
if (isString(mainFileRelative) && !(maybeBlockedByTypesVersions && matchPatternOrExact(tryParsePatterns(versionPaths!.paths), mainFileRelative))) {
|
||||
// The 'main' file is also subject to mapping through typesVersions, and we couldn't come up with a path
|
||||
// explicitly through typesVersions, so if it matches a key in typesVersions now, it's not reachable.
|
||||
// (The only way this can happen is if some file in a package that's not resolvable from outside the
|
||||
// package got pulled into the program anyway, e.g. transitively through a file that *is* reachable. It
|
||||
// happens very easily in fourslash tests though, since every test file listed gets included. See
|
||||
// importNameCodeFix_typesVersions.ts for an example.)
|
||||
const mainExportFile = toPath(mainFileRelative, packageRootPath, getCanonicalFileName);
|
||||
if (removeFileExtension(mainExportFile) === removeFileExtension(getCanonicalFileName(moduleFileToTry))) {
|
||||
// ^ An arbitrary removal of file extension for this comparison is almost certainly wrong
|
||||
return { packageRootPath, moduleFileToTry };
|
||||
}
|
||||
}
|
||||
|
||||
+27
-15
@@ -746,6 +746,8 @@ namespace ts {
|
||||
* check specified by `isFileProbablyExternalModule` will be used to set the field.
|
||||
*/
|
||||
setExternalModuleIndicator?: (file: SourceFile) => void;
|
||||
/*@internal*/ packageJsonLocations?: readonly string[];
|
||||
/*@internal*/ packageJsonScope?: PackageJsonInfo;
|
||||
}
|
||||
|
||||
function setExternalModuleIndicator(sourceFile: SourceFile) {
|
||||
@@ -2780,7 +2782,9 @@ namespace ts {
|
||||
case ParsingContext.ImportOrExportSpecifiers: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
||||
case ParsingContext.JsxAttributes: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
||||
case ParsingContext.JsxChildren: return parseErrorAtCurrentToken(Diagnostics.Identifier_expected);
|
||||
default: return [undefined!]; // TODO: GH#18217 `default: Debug.assertNever(context);`
|
||||
case ParsingContext.AssertEntries: return parseErrorAtCurrentToken(Diagnostics.Identifier_or_string_literal_expected); // AssertionKey.
|
||||
case ParsingContext.Count: return Debug.fail("ParsingContext.Count used as a context"); // Not a real context, only a marker.
|
||||
default: Debug.assertNever(context);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3337,7 +3341,7 @@ namespace ts {
|
||||
// BindingElement[?Yield,?Await]
|
||||
|
||||
// Decorators are parsed in the outer [Await] context, the rest of the parameter is parsed in the function's [Await] context.
|
||||
const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : parseDecorators();
|
||||
const decorators = inOuterAwaitContext ? doInAwaitContext(parseDecorators) : doOutsideOfAwaitContext(parseDecorators);
|
||||
|
||||
if (token() === SyntaxKind.ThisKeyword) {
|
||||
const node = factory.createParameterDeclaration(
|
||||
@@ -3631,11 +3635,11 @@ namespace ts {
|
||||
const hasJSDoc = hasPrecedingJSDocComment();
|
||||
const modifiers = parseModifiers();
|
||||
if (parseContextualModifier(SyntaxKind.GetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, SyntaxKind.GetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, SyntaxKind.GetAccessor, SignatureFlags.Type);
|
||||
}
|
||||
|
||||
if (parseContextualModifier(SyntaxKind.SetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, SyntaxKind.SetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, /*decorators*/ undefined, modifiers, SyntaxKind.SetAccessor, SignatureFlags.Type);
|
||||
}
|
||||
|
||||
if (isIndexSignature()) {
|
||||
@@ -5285,12 +5289,15 @@ namespace ts {
|
||||
|
||||
function parseSuperExpression(): MemberExpression {
|
||||
const pos = getNodePos();
|
||||
const expression = parseTokenNode<PrimaryExpression>();
|
||||
let expression = parseTokenNode<MemberExpression>();
|
||||
if (token() === SyntaxKind.LessThanToken) {
|
||||
const startPos = getNodePos();
|
||||
const typeArguments = tryParse(parseTypeArgumentsInExpression);
|
||||
if (typeArguments !== undefined) {
|
||||
parseErrorAt(startPos, getNodePos(), Diagnostics.super_may_not_use_type_arguments);
|
||||
if (!isTemplateStartOfTaggedTemplate()) {
|
||||
expression = factory.createExpressionWithTypeArguments(expression, typeArguments);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5928,10 +5935,10 @@ namespace ts {
|
||||
const modifiers = parseModifiers();
|
||||
|
||||
if (parseContextualModifier(SyntaxKind.GetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.GetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.GetAccessor, SignatureFlags.None);
|
||||
}
|
||||
if (parseContextualModifier(SyntaxKind.SetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.SetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.SetAccessor, SignatureFlags.None);
|
||||
}
|
||||
|
||||
const asteriskToken = parseOptionalToken(SyntaxKind.AsteriskToken);
|
||||
@@ -6701,11 +6708,16 @@ namespace ts {
|
||||
}
|
||||
|
||||
function parseFunctionBlockOrSemicolon(flags: SignatureFlags, diagnosticMessage?: DiagnosticMessage): Block | undefined {
|
||||
if (token() !== SyntaxKind.OpenBraceToken && canParseSemicolon()) {
|
||||
parseSemicolon();
|
||||
return;
|
||||
if (token() !== SyntaxKind.OpenBraceToken) {
|
||||
if (flags & SignatureFlags.Type) {
|
||||
parseTypeMemberSemicolon();
|
||||
return;
|
||||
}
|
||||
if (canParseSemicolon()) {
|
||||
parseSemicolon();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return parseFunctionBlock(flags, diagnosticMessage);
|
||||
}
|
||||
|
||||
@@ -6972,12 +6984,12 @@ namespace ts {
|
||||
return parsePropertyDeclaration(pos, hasJSDoc, decorators, modifiers, name, questionToken);
|
||||
}
|
||||
|
||||
function parseAccessorDeclaration(pos: number, hasJSDoc: boolean, decorators: NodeArray<Decorator> | undefined, modifiers: NodeArray<Modifier> | undefined, kind: AccessorDeclaration["kind"]): AccessorDeclaration {
|
||||
function parseAccessorDeclaration(pos: number, hasJSDoc: boolean, decorators: NodeArray<Decorator> | undefined, modifiers: NodeArray<Modifier> | undefined, kind: AccessorDeclaration["kind"], flags: SignatureFlags): AccessorDeclaration {
|
||||
const name = parsePropertyName();
|
||||
const typeParameters = parseTypeParameters();
|
||||
const parameters = parseParameters(SignatureFlags.None);
|
||||
const type = parseReturnType(SyntaxKind.ColonToken, /*isType*/ false);
|
||||
const body = parseFunctionBlockOrSemicolon(SignatureFlags.None);
|
||||
const body = parseFunctionBlockOrSemicolon(flags);
|
||||
const node = kind === SyntaxKind.GetAccessor
|
||||
? factory.createGetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, type, body)
|
||||
: factory.createSetAccessorDeclaration(combineDecoratorsAndModifiers(decorators, modifiers), name, parameters, body);
|
||||
@@ -7188,11 +7200,11 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (parseContextualModifier(SyntaxKind.GetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.GetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.GetAccessor, SignatureFlags.None);
|
||||
}
|
||||
|
||||
if (parseContextualModifier(SyntaxKind.SetKeyword)) {
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.SetAccessor);
|
||||
return parseAccessorDeclaration(pos, hasJSDoc, decorators, modifiers, SyntaxKind.SetAccessor, SignatureFlags.None);
|
||||
}
|
||||
|
||||
if (token() === SyntaxKind.ConstructorKeyword || token() === SyntaxKind.StringLiteral) {
|
||||
|
||||
@@ -452,12 +452,9 @@ namespace ts {
|
||||
* Normalize path separators, converting `\` into `/`.
|
||||
*/
|
||||
export function normalizeSlashes(path: string): string {
|
||||
const index = path.indexOf("\\");
|
||||
if (index === -1) {
|
||||
return path;
|
||||
}
|
||||
backslashRegExp.lastIndex = index; // prime regex with known position
|
||||
return path.replace(backslashRegExp, directorySeparator);
|
||||
return path.indexOf("\\") !== -1
|
||||
? path.replace(backslashRegExp, directorySeparator)
|
||||
: path;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -107,6 +107,28 @@ namespace ts.performance {
|
||||
durations.forEach((duration, measureName) => cb(measureName, duration));
|
||||
}
|
||||
|
||||
export function forEachMark(cb: (markName: string) => void) {
|
||||
marks.forEach((_time, markName) => cb(markName));
|
||||
}
|
||||
|
||||
export function clearMeasures(name?: string) {
|
||||
if (name !== undefined) durations.delete(name);
|
||||
else durations.clear();
|
||||
performanceImpl?.clearMeasures(name);
|
||||
}
|
||||
|
||||
export function clearMarks(name?: string) {
|
||||
if (name !== undefined) {
|
||||
counts.delete(name);
|
||||
marks.delete(name);
|
||||
}
|
||||
else {
|
||||
counts.clear();
|
||||
marks.clear();
|
||||
}
|
||||
performanceImpl?.clearMarks(name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Indicates whether the performance API is enabled.
|
||||
*/
|
||||
|
||||
@@ -13,6 +13,8 @@ namespace ts {
|
||||
export interface Performance {
|
||||
mark(name: string): void;
|
||||
measure(name: string, startMark?: string, endMark?: string): void;
|
||||
clearMeasures(name?: string): void;
|
||||
clearMarks(name?: string): void;
|
||||
now(): number;
|
||||
timeOrigin: number;
|
||||
}
|
||||
@@ -50,6 +52,8 @@ namespace ts {
|
||||
typeof performance.mark === "function" &&
|
||||
typeof performance.measure === "function" &&
|
||||
typeof performance.now === "function" &&
|
||||
typeof performance.clearMarks === "function" &&
|
||||
typeof performance.clearMeasures === "function" &&
|
||||
typeof PerformanceObserver === "function";
|
||||
}
|
||||
|
||||
@@ -73,8 +77,8 @@ namespace ts {
|
||||
try {
|
||||
let performance: Performance;
|
||||
const { performance: nodePerformance, PerformanceObserver } = require("perf_hooks") as typeof import("perf_hooks");
|
||||
if (hasRequiredAPI(nodePerformance, PerformanceObserver)) {
|
||||
performance = nodePerformance;
|
||||
if (hasRequiredAPI(nodePerformance as unknown as Performance, PerformanceObserver)) {
|
||||
performance = nodePerformance as unknown as Performance;
|
||||
// There is a bug in Node's performance.measure prior to 12.16.3/13.13.0 that does not
|
||||
// match the Web Performance API specification. Node's implementation did not allow
|
||||
// optional `start` and `end` arguments for `performance.measure`.
|
||||
@@ -95,7 +99,9 @@ namespace ts {
|
||||
if (end === "__performance.measure-fix__") {
|
||||
nodePerformance.clearMarks("__performance.measure-fix__");
|
||||
}
|
||||
}
|
||||
},
|
||||
clearMarks(name) { return nodePerformance.clearMarks(name); },
|
||||
clearMeasures(name) { return (nodePerformance as unknown as Performance).clearMeasures(name); },
|
||||
};
|
||||
}
|
||||
return {
|
||||
|
||||
+72
-49
@@ -843,6 +843,17 @@ namespace ts {
|
||||
* @returns `undefined` if the path has no relevant implied format, `ModuleKind.ESNext` for esm format, and `ModuleKind.CommonJS` for cjs format
|
||||
*/
|
||||
export function getImpliedNodeFormatForFile(fileName: Path, packageJsonInfoCache: PackageJsonInfoCache | undefined, host: ModuleResolutionHost, options: CompilerOptions): ModuleKind.ESNext | ModuleKind.CommonJS | undefined {
|
||||
const result = getImpliedNodeFormatForFileWorker(fileName, packageJsonInfoCache, host, options);
|
||||
return typeof result === "object" ? result.impliedNodeFormat : result;
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
export function getImpliedNodeFormatForFileWorker(
|
||||
fileName: Path,
|
||||
packageJsonInfoCache: PackageJsonInfoCache | undefined,
|
||||
host: ModuleResolutionHost,
|
||||
options: CompilerOptions,
|
||||
) {
|
||||
switch (getEmitModuleResolutionKind(options)) {
|
||||
case ModuleResolutionKind.Node16:
|
||||
case ModuleResolutionKind.NodeNext:
|
||||
@@ -853,10 +864,14 @@ namespace ts {
|
||||
default:
|
||||
return undefined;
|
||||
}
|
||||
function lookupFromPackageJson(): ModuleKind.ESNext | ModuleKind.CommonJS {
|
||||
const scope = getPackageScopeForPath(fileName, packageJsonInfoCache, host, options);
|
||||
return scope?.packageJsonContent.type === "module" ? ModuleKind.ESNext : ModuleKind.CommonJS;
|
||||
|
||||
function lookupFromPackageJson(): Partial<CreateSourceFileOptions> {
|
||||
const state = getTemporaryModuleResolutionState(packageJsonInfoCache, host, options);
|
||||
const packageJsonLocations: string[] = [];
|
||||
state.failedLookupLocations = packageJsonLocations;
|
||||
state.affectingLocations = packageJsonLocations;
|
||||
const packageJsonScope = getPackageScopeForPath(fileName, state);
|
||||
const impliedNodeFormat = packageJsonScope?.packageJsonContent.type === "module" ? ModuleKind.ESNext : ModuleKind.CommonJS;
|
||||
return { impliedNodeFormat, packageJsonLocations, packageJsonScope };
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1236,7 +1251,7 @@ namespace ts {
|
||||
const oldSourceFiles = oldProgram.getSourceFiles();
|
||||
for (const oldSourceFile of oldSourceFiles) {
|
||||
const newFile = getSourceFileByPath(oldSourceFile.resolvedPath);
|
||||
if (shouldCreateNewSourceFile || !newFile ||
|
||||
if (shouldCreateNewSourceFile || !newFile || newFile.impliedNodeFormat !== oldSourceFile.impliedNodeFormat ||
|
||||
// old file wasn't redirect but new file is
|
||||
(oldSourceFile.resolvedPath === oldSourceFile.path && newFile.resolvedPath !== oldSourceFile.path)) {
|
||||
host.onReleaseOldSourceFile(oldSourceFile, oldProgram.getCompilerOptions(), !!getSourceFileByPath(oldSourceFile.path));
|
||||
@@ -1492,7 +1507,7 @@ namespace ts {
|
||||
return classifiableNames;
|
||||
}
|
||||
|
||||
function resolveModuleNamesReusingOldState(moduleNames: string[], file: SourceFile): readonly ResolvedModuleFull[] {
|
||||
function resolveModuleNamesReusingOldState(moduleNames: string[], file: SourceFile): readonly (ResolvedModuleFull | undefined)[] {
|
||||
if (structureIsReused === StructureIsReused.Not && !file.ambientModuleNames.length) {
|
||||
// If the old program state does not permit reusing resolutions and `file` does not contain locally defined ambient modules,
|
||||
// the best we can do is fallback to the default logic.
|
||||
@@ -1509,10 +1524,10 @@ namespace ts {
|
||||
// which per above occurred during the current program creation.
|
||||
// Since we assume the filesystem does not change during program creation,
|
||||
// it is safe to reuse resolutions from the earlier call.
|
||||
const result: ResolvedModuleFull[] = [];
|
||||
const result: (ResolvedModuleFull | undefined)[] = [];
|
||||
let i = 0;
|
||||
for (const moduleName of moduleNames) {
|
||||
const resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i))!;
|
||||
const resolvedModule = file.resolvedModules.get(moduleName, getModeForResolutionAtIndex(file, i));
|
||||
i++;
|
||||
result.push(resolvedModule);
|
||||
}
|
||||
@@ -1534,7 +1549,7 @@ namespace ts {
|
||||
* Needs to be reset to undefined before returning,
|
||||
* * ResolvedModuleFull instance: can be reused.
|
||||
*/
|
||||
let result: ResolvedModuleFull[] | undefined;
|
||||
let result: (ResolvedModuleFull | undefined)[] | undefined;
|
||||
let reusedNames: string[] | undefined;
|
||||
/** A transient placeholder used to mark predicted resolution in the result list. */
|
||||
const predictedToResolveToAmbientModuleMarker: ResolvedModuleFull = {} as any;
|
||||
@@ -1602,7 +1617,7 @@ namespace ts {
|
||||
// `result[i]` is either a `ResolvedModuleFull` or a marker.
|
||||
// If it is the former, we can leave it as is.
|
||||
if (result[i] === predictedToResolveToAmbientModuleMarker) {
|
||||
result[i] = undefined!; // TODO: GH#18217
|
||||
result[i] = undefined;
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -1711,13 +1726,16 @@ namespace ts {
|
||||
const seenPackageNames = new Map<string, SeenPackageName>();
|
||||
|
||||
for (const oldSourceFile of oldSourceFiles) {
|
||||
const sourceFileOptions = getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options);
|
||||
let newSourceFile = host.getSourceFileByPath
|
||||
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile)
|
||||
: host.getSourceFile(oldSourceFile.fileName, getCreateSourceFileOptions(oldSourceFile.fileName, moduleResolutionCache, host, options), /*onError*/ undefined, shouldCreateNewSourceFile); // TODO: GH#18217
|
||||
? host.getSourceFileByPath(oldSourceFile.fileName, oldSourceFile.resolvedPath, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat)
|
||||
: host.getSourceFile(oldSourceFile.fileName, sourceFileOptions, /*onError*/ undefined, shouldCreateNewSourceFile || sourceFileOptions.impliedNodeFormat !== oldSourceFile.impliedNodeFormat); // TODO: GH#18217
|
||||
|
||||
if (!newSourceFile) {
|
||||
return StructureIsReused.Not;
|
||||
}
|
||||
newSourceFile.packageJsonLocations = sourceFileOptions.packageJsonLocations?.length ? sourceFileOptions.packageJsonLocations : undefined;
|
||||
newSourceFile.packageJsonScope = sourceFileOptions.packageJsonScope;
|
||||
|
||||
Debug.assert(!newSourceFile.redirectInfo, "Host should not return a redirect source file from `getSourceFile`");
|
||||
|
||||
@@ -1762,43 +1780,43 @@ namespace ts {
|
||||
}
|
||||
|
||||
if (fileChanged) {
|
||||
if (oldSourceFile.impliedNodeFormat !== newSourceFile.impliedNodeFormat) {
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
// The `newSourceFile` object was created for the new program.
|
||||
|
||||
if (!arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
else if (!arrayIsEqualTo(oldSourceFile.libReferenceDirectives, newSourceFile.libReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
// 'lib' references has changed. Matches behavior in changesAffectModuleResolution
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
|
||||
else if (oldSourceFile.hasNoDefaultLib !== newSourceFile.hasNoDefaultLib) {
|
||||
// value of no-default-lib has changed
|
||||
// this will affect if default library is injected into the list of files
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
// check tripleslash references
|
||||
if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
|
||||
else if (!arrayIsEqualTo(oldSourceFile.referencedFiles, newSourceFile.referencedFiles, fileReferenceIsEqualTo)) {
|
||||
// tripleslash references has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
// check imports and module augmentations
|
||||
collectExternalModuleReferences(newSourceFile);
|
||||
if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
|
||||
// imports has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
|
||||
// moduleAugmentations has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
if ((oldSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags) !== (newSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags)) {
|
||||
// dynamicImport has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
|
||||
if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
// 'types' references has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
else {
|
||||
// check imports and module augmentations
|
||||
collectExternalModuleReferences(newSourceFile);
|
||||
if (!arrayIsEqualTo(oldSourceFile.imports, newSourceFile.imports, moduleNameIsEqualTo)) {
|
||||
// imports has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
else if (!arrayIsEqualTo(oldSourceFile.moduleAugmentations, newSourceFile.moduleAugmentations, moduleNameIsEqualTo)) {
|
||||
// moduleAugmentations has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
else if ((oldSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags) !== (newSourceFile.flags & NodeFlags.PermanentlySetIncrementalFlags)) {
|
||||
// dynamicImport has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
else if (!arrayIsEqualTo(oldSourceFile.typeReferenceDirectives, newSourceFile.typeReferenceDirectives, fileReferenceIsEqualTo)) {
|
||||
// 'types' references has changed
|
||||
structureIsReused = StructureIsReused.SafeModules;
|
||||
}
|
||||
}
|
||||
|
||||
// tentatively approve the file
|
||||
@@ -2771,13 +2789,15 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function createRedirectSourceFile(redirectTarget: SourceFile, unredirected: SourceFile, fileName: string, path: Path, resolvedPath: Path, originalFileName: string): SourceFile {
|
||||
function createRedirectSourceFile(redirectTarget: SourceFile, unredirected: SourceFile, fileName: string, path: Path, resolvedPath: Path, originalFileName: string, sourceFileOptions: CreateSourceFileOptions): SourceFile {
|
||||
const redirect: SourceFile = Object.create(redirectTarget);
|
||||
redirect.fileName = fileName;
|
||||
redirect.path = path;
|
||||
redirect.resolvedPath = resolvedPath;
|
||||
redirect.originalFileName = originalFileName;
|
||||
redirect.redirectInfo = { redirectTarget, unredirected };
|
||||
redirect.packageJsonLocations = sourceFileOptions.packageJsonLocations?.length ? sourceFileOptions.packageJsonLocations : undefined;
|
||||
redirect.packageJsonScope = sourceFileOptions.packageJsonScope;
|
||||
sourceFilesFoundSearchingNodeModules.set(path, currentNodeModulesDepth > 0);
|
||||
Object.defineProperties(redirect, {
|
||||
id: {
|
||||
@@ -2804,16 +2824,16 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
function getCreateSourceFileOptions(fileName: string, moduleResolutionCache: ModuleResolutionCache | undefined, host: CompilerHost, options: CompilerOptions) {
|
||||
function getCreateSourceFileOptions(fileName: string, moduleResolutionCache: ModuleResolutionCache | undefined, host: CompilerHost, options: CompilerOptions): CreateSourceFileOptions {
|
||||
// It's a _little odd_ that we can't set `impliedNodeFormat` until the program step - but it's the first and only time we have a resolution cache
|
||||
// and a freshly made source file node on hand at the same time, and we need both to set the field. Persisting the resolution cache all the way
|
||||
// to the check and emit steps would be bad - so we much prefer detecting and storing the format information on the source file node upfront.
|
||||
const impliedNodeFormat = getImpliedNodeFormatForFile(toPath(fileName), moduleResolutionCache?.getPackageJsonInfoCache(), host, options);
|
||||
return {
|
||||
languageVersion: getEmitScriptTarget(options),
|
||||
impliedNodeFormat,
|
||||
setExternalModuleIndicator: getSetExternalModuleIndicator(options)
|
||||
};
|
||||
const result = getImpliedNodeFormatForFileWorker(toPath(fileName), moduleResolutionCache?.getPackageJsonInfoCache(), host, options);
|
||||
const languageVersion = getEmitScriptTarget(options);
|
||||
const setExternalModuleIndicator = getSetExternalModuleIndicator(options);
|
||||
return typeof result === "object" ?
|
||||
{ ...result, languageVersion, setExternalModuleIndicator } :
|
||||
{ languageVersion, impliedNodeFormat: result, setExternalModuleIndicator };
|
||||
}
|
||||
|
||||
function findSourceFileWorker(fileName: string, isDefaultLib: boolean, ignoreNoDefaultLib: boolean, reason: FileIncludeReason, packageId: PackageId | undefined): SourceFile | undefined {
|
||||
@@ -2906,11 +2926,12 @@ namespace ts {
|
||||
}
|
||||
|
||||
// We haven't looked for this file, do so now and cache result
|
||||
const sourceFileOptions = getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options);
|
||||
const file = host.getSourceFile(
|
||||
fileName,
|
||||
getCreateSourceFileOptions(fileName, moduleResolutionCache, host, options),
|
||||
sourceFileOptions,
|
||||
hostErrorMessage => addFilePreprocessingFileExplainingDiagnostic(/*file*/ undefined, reason, Diagnostics.Cannot_read_file_0_Colon_1, [fileName, hostErrorMessage]),
|
||||
shouldCreateNewSourceFile
|
||||
shouldCreateNewSourceFile || (oldProgram?.getSourceFileByPath(toPath(fileName))?.impliedNodeFormat !== sourceFileOptions.impliedNodeFormat)
|
||||
);
|
||||
|
||||
if (packageId) {
|
||||
@@ -2919,7 +2940,7 @@ namespace ts {
|
||||
if (fileFromPackageId) {
|
||||
// Some other SourceFile already exists with this package name and version.
|
||||
// Instead of creating a duplicate, just redirect to the existing one.
|
||||
const dupFile = createRedirectSourceFile(fileFromPackageId, file!, fileName, path, toPath(fileName), originalFileName); // TODO: GH#18217
|
||||
const dupFile = createRedirectSourceFile(fileFromPackageId, file!, fileName, path, toPath(fileName), originalFileName, sourceFileOptions);
|
||||
redirectTargetsMap.add(fileFromPackageId.path, fileName);
|
||||
addFileToFilesByName(dupFile, path, redirectedPath);
|
||||
addFileIncludeReason(dupFile, reason);
|
||||
@@ -2941,6 +2962,8 @@ namespace ts {
|
||||
file.path = path;
|
||||
file.resolvedPath = toPath(fileName);
|
||||
file.originalFileName = originalFileName;
|
||||
file.packageJsonLocations = sourceFileOptions.packageJsonLocations?.length ? sourceFileOptions.packageJsonLocations : undefined;
|
||||
file.packageJsonScope = sourceFileOptions.packageJsonScope;
|
||||
addFileIncludeReason(file, reason);
|
||||
|
||||
if (host.useCaseSensitiveFileNames()) {
|
||||
@@ -3677,7 +3700,7 @@ namespace ts {
|
||||
if (locationReason && fileIncludeReasons?.length === 1) fileIncludeReasons = undefined;
|
||||
const location = locationReason && getReferencedFileLocation(getSourceFileByPath, locationReason);
|
||||
const fileIncludeReasonDetails = fileIncludeReasons && chainDiagnosticMessages(fileIncludeReasons, Diagnostics.The_file_is_in_the_program_because_Colon);
|
||||
const redirectInfo = file && explainIfFileIsRedirect(file);
|
||||
const redirectInfo = file && explainIfFileIsRedirectAndImpliedFormat(file);
|
||||
const chain = chainDiagnosticMessages(redirectInfo ? fileIncludeReasonDetails ? [fileIncludeReasonDetails, ...redirectInfo] : redirectInfo : fileIncludeReasonDetails, diagnostic, ...args || emptyArray);
|
||||
return location && isReferenceFileLocation(location) ?
|
||||
createFileDiagnosticFromMessageChain(location.file, location.pos, location.end - location.pos, chain, relatedInfo) :
|
||||
|
||||
+120
-64
@@ -20,7 +20,7 @@ namespace ts {
|
||||
|
||||
|
||||
startCachingPerDirectoryResolution(): void;
|
||||
finishCachingPerDirectoryResolution(): void;
|
||||
finishCachingPerDirectoryResolution(newProgram: Program | undefined, oldProgram: Program | undefined): void;
|
||||
|
||||
updateTypeRootsWatch(): void;
|
||||
closeTypeRootsWatch(): void;
|
||||
@@ -70,18 +70,19 @@ namespace ts {
|
||||
onDiscoveredSymlink?(): void;
|
||||
}
|
||||
|
||||
interface WatcherWithRefCount {
|
||||
interface FileWatcherOfAffectingLocation {
|
||||
/** watcher for the lookup */
|
||||
watcher: FileWatcher;
|
||||
resolutions: number;
|
||||
files: number;
|
||||
paths: Set<string>;
|
||||
}
|
||||
|
||||
interface DirectoryWatchesOfFailedLookup {
|
||||
/** watcher for the lookup */
|
||||
watcher: FileWatcher;
|
||||
/** ref count keeping this watch alive */
|
||||
refCount: number;
|
||||
}
|
||||
|
||||
interface FileWatcherOfAffectingLocation extends WatcherWithRefCount {
|
||||
paths: Set<Path>;
|
||||
}
|
||||
|
||||
interface DirectoryWatchesOfFailedLookup extends WatcherWithRefCount {
|
||||
/** is the directory watched being non recursive */
|
||||
nonRecursive?: boolean;
|
||||
}
|
||||
@@ -109,7 +110,7 @@ namespace ts {
|
||||
* "c:/", "c:/users", "c:/users/username", "c:/users/username/folderAtRoot", "c:/folderAtRoot"
|
||||
* @param dirPath
|
||||
*/
|
||||
export function canWatchDirectory(dirPath: Path) {
|
||||
export function canWatchDirectoryOrFile(dirPath: Path) {
|
||||
const rootLength = getRootLength(dirPath);
|
||||
if (dirPath.length === rootLength) {
|
||||
// Ignore "/", "c:/"
|
||||
@@ -164,9 +165,11 @@ namespace ts {
|
||||
const resolutionsWithFailedLookups: ResolutionWithFailedLookupLocations[] = [];
|
||||
const resolutionsWithOnlyAffectingLocations: ResolutionWithFailedLookupLocations[] = [];
|
||||
const resolvedFileToResolution = createMultiMap<ResolutionWithFailedLookupLocations>();
|
||||
const impliedFormatPackageJsons = new Map<Path, readonly string[]>();
|
||||
|
||||
let hasChangedAutomaticTypeDirectiveNames = false;
|
||||
let affectingPathChecks: Set<Path> | undefined;
|
||||
let affectingPathChecksForFile: Set<string> | undefined;
|
||||
let affectingPathChecks: Set<string> | undefined;
|
||||
let failedLookupChecks: Set<Path> | undefined;
|
||||
let startsWithPathChecks: Set<Path> | undefined;
|
||||
let isInDirectoryChecks: Set<Path> | undefined;
|
||||
@@ -222,7 +225,7 @@ namespace ts {
|
||||
finishRecordingFilesWithChangedResolutions,
|
||||
// perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
|
||||
// (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)
|
||||
startCachingPerDirectoryResolution: clearPerDirectoryResolutions,
|
||||
startCachingPerDirectoryResolution,
|
||||
finishCachingPerDirectoryResolution,
|
||||
resolveModuleNames,
|
||||
getResolvedModuleWithFailedLookupLocationsFromCache,
|
||||
@@ -270,9 +273,10 @@ namespace ts {
|
||||
startsWithPathChecks = undefined;
|
||||
isInDirectoryChecks = undefined;
|
||||
affectingPathChecks = undefined;
|
||||
// perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
|
||||
// (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)
|
||||
clearPerDirectoryResolutions();
|
||||
affectingPathChecksForFile = undefined;
|
||||
moduleResolutionCache.clear();
|
||||
typeReferenceDirectiveResolutionCache.clear();
|
||||
impliedFormatPackageJsons.clear();
|
||||
hasChangedAutomaticTypeDirectiveNames = false;
|
||||
}
|
||||
|
||||
@@ -310,16 +314,42 @@ namespace ts {
|
||||
isFileWithInvalidatedNonRelativeUnresolvedImports(path);
|
||||
}
|
||||
|
||||
function clearPerDirectoryResolutions() {
|
||||
moduleResolutionCache.clear();
|
||||
typeReferenceDirectiveResolutionCache.clear();
|
||||
function startCachingPerDirectoryResolution() {
|
||||
moduleResolutionCache.clearAllExceptPackageJsonInfoCache();
|
||||
typeReferenceDirectiveResolutionCache.clearAllExceptPackageJsonInfoCache();
|
||||
// perDirectoryResolvedModuleNames and perDirectoryResolvedTypeReferenceDirectives could be non empty if there was exception during program update
|
||||
// (between startCachingPerDirectoryResolution and finishCachingPerDirectoryResolution)
|
||||
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
||||
nonRelativeExternalModuleResolutions.clear();
|
||||
}
|
||||
|
||||
function finishCachingPerDirectoryResolution() {
|
||||
function finishCachingPerDirectoryResolution(newProgram: Program | undefined, oldProgram: Program | undefined) {
|
||||
filesWithInvalidatedNonRelativeUnresolvedImports = undefined;
|
||||
clearPerDirectoryResolutions();
|
||||
nonRelativeExternalModuleResolutions.forEach(watchFailedLookupLocationOfNonRelativeModuleResolutions);
|
||||
nonRelativeExternalModuleResolutions.clear();
|
||||
// Update file watches
|
||||
if (newProgram !== oldProgram) {
|
||||
newProgram?.getSourceFiles().forEach(newFile => {
|
||||
const expected = isExternalOrCommonJsModule(newFile) ? newFile.packageJsonLocations?.length ?? 0 : 0;
|
||||
const existing = impliedFormatPackageJsons.get(newFile.path) ?? emptyArray;
|
||||
for (let i = existing.length; i < expected; i++) {
|
||||
createFileWatcherOfAffectingLocation(newFile.packageJsonLocations![i], /*forResolution*/ false);
|
||||
}
|
||||
if (existing.length > expected) {
|
||||
for (let i = expected; i < existing.length; i++) {
|
||||
fileWatchesOfAffectingLocations.get(existing[i])!.files--;
|
||||
}
|
||||
}
|
||||
if (expected) impliedFormatPackageJsons.set(newFile.path, newFile.packageJsonLocations!);
|
||||
else impliedFormatPackageJsons.delete(newFile.path);
|
||||
});
|
||||
impliedFormatPackageJsons.forEach((existing, path) => {
|
||||
if (!newProgram?.getSourceFileByPath(path)) {
|
||||
existing.forEach(location => fileWatchesOfAffectingLocations.get(location)!.files--);
|
||||
impliedFormatPackageJsons.delete(path);
|
||||
}
|
||||
});
|
||||
}
|
||||
directoryWatchesOfFailedLookups.forEach((watcher, path) => {
|
||||
if (watcher.refCount === 0) {
|
||||
directoryWatchesOfFailedLookups.delete(path);
|
||||
@@ -327,11 +357,9 @@ namespace ts {
|
||||
}
|
||||
});
|
||||
fileWatchesOfAffectingLocations.forEach((watcher, path) => {
|
||||
if (watcher.refCount === 0) {
|
||||
if (watcher.files === 0 && watcher.resolutions === 0) {
|
||||
fileWatchesOfAffectingLocations.delete(path);
|
||||
watcher.watcher.close();
|
||||
// Ensure when watching symlinked package.json, we can close the actual file watcher only once
|
||||
watcher.watcher = noopFileWatcher;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -617,7 +645,7 @@ namespace ts {
|
||||
|
||||
// If the directory is node_modules use it to watch, always watch it recursively
|
||||
if (isNodeModulesDirectory(dirPath)) {
|
||||
return canWatchDirectory(getDirectoryPath(dirPath)) ? { dir, dirPath } : undefined;
|
||||
return canWatchDirectoryOrFile(getDirectoryPath(dirPath)) ? { dir, dirPath } : undefined;
|
||||
}
|
||||
|
||||
let nonRecursive = true;
|
||||
@@ -637,7 +665,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
return canWatchDirectory(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : undefined;
|
||||
return canWatchDirectoryOrFile(dirPath) ? { dir: subDirectory || dir, dirPath: subDirectoryPath || dirPath, nonRecursive } : undefined;
|
||||
}
|
||||
|
||||
function isPathWithDefaultFailedLookupExtension(path: Path) {
|
||||
@@ -714,47 +742,60 @@ namespace ts {
|
||||
if (addToResolutionsWithOnlyAffectingLocations) resolutionsWithOnlyAffectingLocations.push(resolution);
|
||||
// Watch package json
|
||||
for (const affectingLocation of affectingLocations) {
|
||||
createFileWatcherOfAffectingLocation(affectingLocation);
|
||||
createFileWatcherOfAffectingLocation(affectingLocation, /*forResolution*/ true);
|
||||
}
|
||||
}
|
||||
|
||||
function createFileWatcherOfAffectingLocation(affectingLocation: string) {
|
||||
const path = resolutionHost.toPath(affectingLocation);
|
||||
const fileWatcher = fileWatchesOfAffectingLocations.get(path);
|
||||
function createFileWatcherOfAffectingLocation(affectingLocation: string, forResolution: boolean) {
|
||||
const fileWatcher = fileWatchesOfAffectingLocations.get(affectingLocation);
|
||||
if (fileWatcher) {
|
||||
fileWatcher.refCount++;
|
||||
if (forResolution) fileWatcher.resolutions++;
|
||||
else fileWatcher.files++;
|
||||
return;
|
||||
}
|
||||
let locationToWatch = affectingLocation;
|
||||
let locationToWatchPath = path;
|
||||
if (resolutionHost.realpath) {
|
||||
locationToWatch = resolutionHost.realpath(affectingLocation);
|
||||
locationToWatchPath = resolutionHost.toPath(locationToWatch);
|
||||
if (path !== locationToWatchPath) {
|
||||
const fileWatcher = fileWatchesOfAffectingLocations.get(locationToWatchPath);
|
||||
if (affectingLocation !== locationToWatch) {
|
||||
const fileWatcher = fileWatchesOfAffectingLocations.get(locationToWatch);
|
||||
if (fileWatcher) {
|
||||
fileWatcher.refCount++;
|
||||
fileWatcher.paths.add(path);
|
||||
fileWatchesOfAffectingLocations.set(path, fileWatcher);
|
||||
if (forResolution) fileWatcher.resolutions++;
|
||||
else fileWatcher.files++;
|
||||
fileWatcher.paths.add(affectingLocation);
|
||||
fileWatchesOfAffectingLocations.set(affectingLocation, fileWatcher);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
const paths = new Set<Path>();
|
||||
paths.add(locationToWatchPath);
|
||||
const watcher: FileWatcherOfAffectingLocation = {
|
||||
watcher: resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
||||
cachedDirectoryStructureHost?.addOrDeleteFile(fileName, path, eventKind);
|
||||
paths.forEach(path => (affectingPathChecks ||= new Set()).add(path));
|
||||
const paths = new Set<string>();
|
||||
paths.add(locationToWatch);
|
||||
let actualWatcher = canWatchDirectoryOrFile(resolutionHost.toPath(locationToWatch)) ?
|
||||
resolutionHost.watchAffectingFileLocation(locationToWatch, (fileName, eventKind) => {
|
||||
cachedDirectoryStructureHost?.addOrDeleteFile(fileName, resolutionHost.toPath(locationToWatch), eventKind);
|
||||
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
||||
paths.forEach(path => {
|
||||
if (watcher.resolutions) (affectingPathChecks ??= new Set()).add(path);
|
||||
if (watcher.files) (affectingPathChecksForFile ??= new Set()).add(path);
|
||||
packageJsonMap?.delete(resolutionHost.toPath(path));
|
||||
});
|
||||
resolutionHost.scheduleInvalidateResolutionsOfFailedLookupLocations();
|
||||
}),
|
||||
refCount: 1,
|
||||
}) : noopFileWatcher;
|
||||
const watcher: FileWatcherOfAffectingLocation = {
|
||||
watcher: actualWatcher !== noopFileWatcher ? {
|
||||
close: () => {
|
||||
actualWatcher.close();
|
||||
// Ensure when watching symlinked package.json, we can close the actual file watcher only once
|
||||
actualWatcher = noopFileWatcher;
|
||||
}
|
||||
} : actualWatcher,
|
||||
resolutions: forResolution ? 1 : 0,
|
||||
files: forResolution ? 0 : 1,
|
||||
paths,
|
||||
};
|
||||
fileWatchesOfAffectingLocations.set(locationToWatchPath, watcher);
|
||||
if (path !== locationToWatchPath) {
|
||||
fileWatchesOfAffectingLocations.set(path, watcher);
|
||||
paths.add(path);
|
||||
fileWatchesOfAffectingLocations.set(locationToWatch, watcher);
|
||||
if (affectingLocation !== locationToWatch) {
|
||||
fileWatchesOfAffectingLocations.set(affectingLocation, watcher);
|
||||
paths.add(affectingLocation);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -830,8 +871,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
for (const affectingLocation of affectingLocations) {
|
||||
const watcher = fileWatchesOfAffectingLocations.get(resolutionHost.toPath(affectingLocation))!;
|
||||
watcher.refCount--;
|
||||
const watcher = fileWatchesOfAffectingLocations.get(affectingLocation)!;
|
||||
watcher.resolutions--;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -892,7 +933,7 @@ namespace ts {
|
||||
if (resolution.isInvalidated || !canInvalidate(resolution)) continue;
|
||||
resolution.isInvalidated = invalidated = true;
|
||||
for (const containingFilePath of Debug.checkDefined(resolution.files)) {
|
||||
(filesWithInvalidatedResolutions || (filesWithInvalidatedResolutions = new Set())).add(containingFilePath);
|
||||
(filesWithInvalidatedResolutions ??= new Set()).add(containingFilePath);
|
||||
// When its a file with inferred types resolution, invalidate type reference directive resolution
|
||||
hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames || endsWith(containingFilePath, inferredTypesContainingFile);
|
||||
}
|
||||
@@ -964,11 +1005,26 @@ namespace ts {
|
||||
}
|
||||
|
||||
function invalidateResolutionsOfFailedLookupLocations() {
|
||||
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks && !affectingPathChecks) {
|
||||
return false;
|
||||
let invalidated = false;
|
||||
if (affectingPathChecksForFile) {
|
||||
resolutionHost.getCurrentProgram()?.getSourceFiles().forEach(f => {
|
||||
if (some(f.packageJsonLocations, location => affectingPathChecksForFile!.has(location))) {
|
||||
(filesWithInvalidatedResolutions ??= new Set()).add(f.path);
|
||||
invalidated = true;
|
||||
}
|
||||
});
|
||||
affectingPathChecksForFile = undefined;
|
||||
}
|
||||
|
||||
let invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution);
|
||||
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks && !affectingPathChecks) {
|
||||
return invalidated;
|
||||
}
|
||||
|
||||
invalidated = invalidateResolutions(resolutionsWithFailedLookups, canInvalidateFailedLookupResolution) || invalidated;
|
||||
const packageJsonMap = moduleResolutionCache.getPackageJsonInfoCache().getInternalMap();
|
||||
if (packageJsonMap && (failedLookupChecks || startsWithPathChecks || isInDirectoryChecks)) {
|
||||
packageJsonMap.forEach((_value, path) => isInvalidatedFailedLookup(path) ? packageJsonMap.delete(path) : undefined);
|
||||
}
|
||||
failedLookupChecks = undefined;
|
||||
startsWithPathChecks = undefined;
|
||||
isInDirectoryChecks = undefined;
|
||||
@@ -980,17 +1036,17 @@ namespace ts {
|
||||
function canInvalidateFailedLookupResolution(resolution: ResolutionWithFailedLookupLocations) {
|
||||
if (canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution)) return true;
|
||||
if (!failedLookupChecks && !startsWithPathChecks && !isInDirectoryChecks) return false;
|
||||
return resolution.failedLookupLocations.some(location => {
|
||||
const locationPath = resolutionHost.toPath(location);
|
||||
return failedLookupChecks?.has(locationPath) ||
|
||||
firstDefinedIterator(startsWithPathChecks?.keys() || emptyIterator, fileOrDirectoryPath => startsWith(locationPath, fileOrDirectoryPath) ? true : undefined) ||
|
||||
firstDefinedIterator(isInDirectoryChecks?.keys() || emptyIterator, fileOrDirectoryPath => isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : undefined);
|
||||
});
|
||||
return resolution.failedLookupLocations.some(location => isInvalidatedFailedLookup(resolutionHost.toPath(location)));
|
||||
}
|
||||
|
||||
function isInvalidatedFailedLookup(locationPath: Path) {
|
||||
return failedLookupChecks?.has(locationPath) ||
|
||||
firstDefinedIterator(startsWithPathChecks?.keys() || emptyIterator, fileOrDirectoryPath => startsWith(locationPath, fileOrDirectoryPath) ? true : undefined) ||
|
||||
firstDefinedIterator(isInDirectoryChecks?.keys() || emptyIterator, fileOrDirectoryPath => isInDirectoryPath(fileOrDirectoryPath, locationPath) ? true : undefined);
|
||||
}
|
||||
|
||||
function canInvalidatedFailedLookupResolutionWithAffectingLocation(resolution: ResolutionWithFailedLookupLocations) {
|
||||
return !!affectingPathChecks && resolution.affectingLocations.some(location =>
|
||||
affectingPathChecks!.has(resolutionHost.toPath(location)));
|
||||
return !!affectingPathChecks && resolution.affectingLocations.some(location => affectingPathChecks!.has(location));
|
||||
}
|
||||
|
||||
function closeTypeRootsWatch() {
|
||||
@@ -1068,7 +1124,7 @@ namespace ts {
|
||||
function directoryExistsForTypeRootWatch(nodeTypesDirectory: string) {
|
||||
const dir = getDirectoryPath(getDirectoryPath(nodeTypesDirectory));
|
||||
const dirPath = resolutionHost.toPath(dir);
|
||||
return dirPath === rootPath || canWatchDirectory(dirPath);
|
||||
return dirPath === rootPath || canWatchDirectoryOrFile(dirPath);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+11
-5
@@ -1088,14 +1088,16 @@ namespace ts {
|
||||
lastDirectoryPart = lastDirectoryPartWithDirectorySeparator.slice(directorySeparator.length);
|
||||
}
|
||||
/** Watcher for the file system entry depending on whether it is missing or present */
|
||||
let watcher = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
|
||||
let watcher: FileWatcher | undefined = !fileSystemEntryExists(fileOrDirectory, entryKind) ?
|
||||
watchMissingFileSystemEntry() :
|
||||
watchPresentFileSystemEntry();
|
||||
return {
|
||||
close: () => {
|
||||
// Close the watcher (either existing file system entry watcher or missing file system entry watcher)
|
||||
watcher.close();
|
||||
watcher = undefined!;
|
||||
if (watcher) {
|
||||
watcher.close();
|
||||
watcher = undefined;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1438,7 +1440,7 @@ namespace ts {
|
||||
|
||||
const platform: string = _os.platform();
|
||||
const useCaseSensitiveFileNames = isFileSystemCaseSensitive();
|
||||
const realpathSync = _fs.realpathSync.native ?? _fs.realpathSync;
|
||||
const fsRealpath = !!_fs.realpathSync.native ? process.platform === "win32" ? fsRealPathHandlingLongPath : _fs.realpathSync.native : _fs.realpathSync;
|
||||
|
||||
const fsSupportsRecursiveFsWatch = isNode4OrLater && (process.platform === "win32" || process.platform === "darwin");
|
||||
const getCurrentDirectory = memoize(() => process.cwd());
|
||||
@@ -1887,9 +1889,13 @@ namespace ts {
|
||||
return getAccessibleFileSystemEntries(path).directories.slice();
|
||||
}
|
||||
|
||||
function fsRealPathHandlingLongPath(path: string): string {
|
||||
return path.length < 260 ? _fs.realpathSync.native(path) : _fs.realpathSync(path);
|
||||
}
|
||||
|
||||
function realpath(path: string): string {
|
||||
try {
|
||||
return realpathSync(path);
|
||||
return fsRealpath(path);
|
||||
}
|
||||
catch {
|
||||
return path;
|
||||
|
||||
@@ -131,9 +131,9 @@ namespace ts { // eslint-disable-line one-namespace-per-file
|
||||
}
|
||||
eventStack.push({ phase, name, args, time: 1000 * timestamp(), separateBeginAndEnd });
|
||||
}
|
||||
export function pop() {
|
||||
export function pop(results?: Args) {
|
||||
Debug.assert(eventStack.length > 0);
|
||||
writeStackEvent(eventStack.length - 1, 1000 * timestamp());
|
||||
writeStackEvent(eventStack.length - 1, 1000 * timestamp(), results);
|
||||
eventStack.length--;
|
||||
}
|
||||
export function popAll() {
|
||||
@@ -145,14 +145,15 @@ namespace ts { // eslint-disable-line one-namespace-per-file
|
||||
}
|
||||
// sample every 10ms
|
||||
const sampleInterval = 1000 * 10;
|
||||
function writeStackEvent(index: number, endTime: number) {
|
||||
function writeStackEvent(index: number, endTime: number, results?: Args) {
|
||||
const { phase, name, args, time, separateBeginAndEnd } = eventStack[index];
|
||||
if (separateBeginAndEnd) {
|
||||
Debug.assert(!results, "`results` are not supported for events with `separateBeginAndEnd`");
|
||||
writeEvent("E", phase, name, args, /*extras*/ undefined, endTime);
|
||||
}
|
||||
// test if [time,endTime) straddles a sampling point
|
||||
else if (sampleInterval - (time % sampleInterval) <= endTime - time) {
|
||||
writeEvent("X", phase, name, args, `"dur":${endTime - time}`, time);
|
||||
writeEvent("X", phase, name, { ...args, results }, `"dur":${endTime - time}`, time);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -576,10 +576,11 @@ namespace ts {
|
||||
|
||||
function visitPreOrPostfixUnaryExpression(node: PrefixUnaryExpression | PostfixUnaryExpression, valueIsDiscarded: boolean) {
|
||||
if (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken) {
|
||||
if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(node.operand)) {
|
||||
const operand = skipParentheses(node.operand);
|
||||
if (shouldTransformPrivateElementsOrClassStaticBlocks && isPrivateIdentifierPropertyAccessExpression(operand)) {
|
||||
let info: PrivateIdentifierInfo | undefined;
|
||||
if (info = accessPrivateIdentifier(node.operand.name)) {
|
||||
const receiver = visitNode(node.operand.expression, visitor, isExpression);
|
||||
if (info = accessPrivateIdentifier(operand.name)) {
|
||||
const receiver = visitNode(operand.expression, visitor, isExpression);
|
||||
const { readExpression, initializeExpression } = createCopiableReceiverExpr(receiver);
|
||||
|
||||
let expression: Expression = createPrivateIdentifierAccess(info, readExpression);
|
||||
@@ -601,7 +602,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
else if (shouldTransformSuperInStaticInitializers &&
|
||||
isSuperProperty(node.operand) &&
|
||||
isSuperProperty(operand) &&
|
||||
currentStaticPropertyDeclarationOrStaticBlock &&
|
||||
currentClassLexicalEnvironment) {
|
||||
// converts `++super.a` into `(Reflect.set(_baseTemp, "a", (_a = Reflect.get(_baseTemp, "a", _classTemp), _b = ++_a), _classTemp), _b)`
|
||||
@@ -614,31 +615,31 @@ namespace ts {
|
||||
// converts `super[f()]--` into `(Reflect.set(_baseTemp, _a = f(), (_b = Reflect.get(_baseTemp, _a, _classTemp), _c = _b--), _classTemp), _c)`
|
||||
const { classConstructor, superClassReference, facts } = currentClassLexicalEnvironment;
|
||||
if (facts & ClassFacts.ClassWasDecorated) {
|
||||
const operand = visitInvalidSuperProperty(node.operand);
|
||||
const expression = visitInvalidSuperProperty(operand);
|
||||
return isPrefixUnaryExpression(node) ?
|
||||
factory.updatePrefixUnaryExpression(node, operand) :
|
||||
factory.updatePostfixUnaryExpression(node, operand);
|
||||
factory.updatePrefixUnaryExpression(node, expression) :
|
||||
factory.updatePostfixUnaryExpression(node, expression);
|
||||
}
|
||||
if (classConstructor && superClassReference) {
|
||||
let setterName: Expression | undefined;
|
||||
let getterName: Expression | undefined;
|
||||
if (isPropertyAccessExpression(node.operand)) {
|
||||
if (isIdentifier(node.operand.name)) {
|
||||
getterName = setterName = factory.createStringLiteralFromNode(node.operand.name);
|
||||
if (isPropertyAccessExpression(operand)) {
|
||||
if (isIdentifier(operand.name)) {
|
||||
getterName = setterName = factory.createStringLiteralFromNode(operand.name);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (isSimpleInlineableExpression(node.operand.argumentExpression)) {
|
||||
getterName = setterName = node.operand.argumentExpression;
|
||||
if (isSimpleInlineableExpression(operand.argumentExpression)) {
|
||||
getterName = setterName = operand.argumentExpression;
|
||||
}
|
||||
else {
|
||||
getterName = factory.createTempVariable(hoistVariableDeclaration);
|
||||
setterName = factory.createAssignment(getterName, visitNode(node.operand.argumentExpression, visitor, isExpression));
|
||||
setterName = factory.createAssignment(getterName, visitNode(operand.argumentExpression, visitor, isExpression));
|
||||
}
|
||||
}
|
||||
if (setterName && getterName) {
|
||||
let expression: Expression = factory.createReflectGetCall(superClassReference, getterName, classConstructor);
|
||||
setTextRange(expression, node.operand);
|
||||
setTextRange(expression, operand);
|
||||
|
||||
const temp = valueIsDiscarded ? undefined : factory.createTempVariable(hoistVariableDeclaration);
|
||||
expression = expandPreOrPostfixIncrementOrDecrementExpression(factory, node, expression, hoistVariableDeclaration, temp);
|
||||
|
||||
@@ -1217,14 +1217,18 @@ namespace ts {
|
||||
|
||||
const previousNeedsDeclare = needsDeclare;
|
||||
switch (input.kind) {
|
||||
case SyntaxKind.TypeAliasDeclaration: // Type aliases get `declare`d if need be (for legacy support), but that's all
|
||||
return cleanup(factory.updateTypeAliasDeclaration(
|
||||
case SyntaxKind.TypeAliasDeclaration: {
|
||||
needsDeclare = false;
|
||||
const clean = cleanup(factory.updateTypeAliasDeclaration(
|
||||
input,
|
||||
ensureModifiers(input),
|
||||
input.name,
|
||||
visitNodes(input.typeParameters, visitDeclarationSubtree, isTypeParameterDeclaration),
|
||||
visitNode(input.type, visitDeclarationSubtree, isTypeNode)
|
||||
));
|
||||
needsDeclare = previousNeedsDeclare;
|
||||
return clean;
|
||||
}
|
||||
case SyntaxKind.InterfaceDeclaration: {
|
||||
return cleanup(factory.updateInterfaceDeclaration(
|
||||
input,
|
||||
|
||||
@@ -68,52 +68,88 @@ namespace ts {
|
||||
function visitClassDeclaration(node: ClassDeclaration): VisitResult<Statement> {
|
||||
if (!(classOrConstructorParameterIsDecorated(node) || childIsDecorated(node))) return visitEachChild(node, visitor, context);
|
||||
|
||||
const classStatement = hasDecorators(node) ?
|
||||
createClassDeclarationHeadWithDecorators(node, node.name) :
|
||||
createClassDeclarationHeadWithoutDecorators(node, node.name);
|
||||
|
||||
const statements: Statement[] = [classStatement];
|
||||
|
||||
// Write any decorators of the node.
|
||||
addClassElementDecorationStatements(statements, node, /*isStatic*/ false);
|
||||
addClassElementDecorationStatements(statements, node, /*isStatic*/ true);
|
||||
addConstructorDecorationStatement(statements, node);
|
||||
const statements = hasDecorators(node) ?
|
||||
transformClassDeclarationWithClassDecorators(node, node.name) :
|
||||
transformClassDeclarationWithoutClassDecorators(node, node.name);
|
||||
|
||||
if (statements.length > 1) {
|
||||
// Add a DeclarationMarker as a marker for the end of the declaration
|
||||
statements.push(factory.createEndOfDeclarationMarker(node));
|
||||
setEmitFlags(classStatement, getEmitFlags(classStatement) | EmitFlags.HasEndOfDeclarationMarker);
|
||||
setEmitFlags(statements[0], getEmitFlags(statements[0]) | EmitFlags.HasEndOfDeclarationMarker);
|
||||
}
|
||||
|
||||
return singleOrMany(statements);
|
||||
}
|
||||
|
||||
function decoratorContainsPrivateIdentifierInExpression(decorator: Decorator) {
|
||||
return !!(decorator.transformFlags & TransformFlags.ContainsPrivateIdentifierInExpression);
|
||||
}
|
||||
|
||||
function parameterDecoratorsContainPrivateIdentifierInExpression(parameterDecorators: readonly Decorator[] | undefined) {
|
||||
return some(parameterDecorators, decoratorContainsPrivateIdentifierInExpression);
|
||||
}
|
||||
|
||||
function hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node: ClassDeclaration) {
|
||||
for (const member of node.members) {
|
||||
if (!canHaveDecorators(member)) continue;
|
||||
const allDecorators = getAllDecoratorsOfClassElement(member, node);
|
||||
if (some(allDecorators?.decorators, decoratorContainsPrivateIdentifierInExpression)) return true;
|
||||
if (some(allDecorators?.parameters, parameterDecoratorsContainPrivateIdentifierInExpression)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
function transformDecoratorsOfClassElements(node: ClassDeclaration, members: NodeArray<ClassElement>) {
|
||||
let decorationStatements: Statement[] | undefined = [];
|
||||
addClassElementDecorationStatements(decorationStatements, node, /*isStatic*/ false);
|
||||
addClassElementDecorationStatements(decorationStatements, node, /*isStatic*/ true);
|
||||
if (hasClassElementWithDecoratorContainingPrivateIdentifierInExpression(node)) {
|
||||
members = setTextRange(factory.createNodeArray([
|
||||
...members,
|
||||
factory.createClassStaticBlockDeclaration(
|
||||
factory.createBlock(decorationStatements, /*multiLine*/ true)
|
||||
)
|
||||
]), members);
|
||||
decorationStatements = undefined;
|
||||
}
|
||||
return { decorationStatements, members };
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a non-decorated class declaration.
|
||||
*
|
||||
* @param node A ClassDeclaration node.
|
||||
* @param name The name of the class.
|
||||
*/
|
||||
function createClassDeclarationHeadWithoutDecorators(node: ClassDeclaration, name: Identifier | undefined) {
|
||||
function transformClassDeclarationWithoutClassDecorators(node: ClassDeclaration, name: Identifier | undefined) {
|
||||
// ${modifiers} class ${name} ${heritageClauses} {
|
||||
// ${members}
|
||||
// }
|
||||
|
||||
return factory.updateClassDeclaration(
|
||||
const modifiers = visitNodes(node.modifiers, modifierVisitor, isModifier);
|
||||
const heritageClauses = visitNodes(node.heritageClauses, visitor, isHeritageClause);
|
||||
let members = visitNodes(node.members, visitor, isClassElement);
|
||||
|
||||
let decorationStatements: Statement[] | undefined = [];
|
||||
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
||||
|
||||
const updated = factory.updateClassDeclaration(
|
||||
node,
|
||||
visitNodes(node.modifiers, modifierVisitor, isModifier),
|
||||
modifiers,
|
||||
name,
|
||||
/*typeParameters*/ undefined,
|
||||
visitNodes(node.heritageClauses, visitor, isHeritageClause),
|
||||
visitNodes(node.members, visitor, isClassElement)
|
||||
heritageClauses,
|
||||
members
|
||||
);
|
||||
|
||||
return addRange([updated], decorationStatements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Transforms a decorated class declaration and appends the resulting statements. If
|
||||
* the class requires an alias to avoid issues with double-binding, the alias is returned.
|
||||
*/
|
||||
function createClassDeclarationHeadWithDecorators(node: ClassDeclaration, name: Identifier | undefined) {
|
||||
function transformClassDeclarationWithClassDecorators(node: ClassDeclaration, name: Identifier | undefined) {
|
||||
// When we emit an ES6 class that has a class decorator, we must tailor the
|
||||
// emit to certain specific cases.
|
||||
//
|
||||
@@ -213,8 +249,18 @@ namespace ts {
|
||||
// ${members}
|
||||
// }
|
||||
const heritageClauses = visitNodes(node.heritageClauses, visitor, isHeritageClause);
|
||||
const members = visitNodes(node.members, visitor, isClassElement);
|
||||
const classExpression = factory.createClassExpression(/*modifiers*/ undefined, name, /*typeParameters*/ undefined, heritageClauses, members);
|
||||
let members = visitNodes(node.members, visitor, isClassElement);
|
||||
|
||||
let decorationStatements: Statement[] | undefined = [];
|
||||
({ members, decorationStatements } = transformDecoratorsOfClassElements(node, members));
|
||||
|
||||
const classExpression = factory.createClassExpression(
|
||||
/*modifiers*/ undefined,
|
||||
name,
|
||||
/*typeParameters*/ undefined,
|
||||
heritageClauses,
|
||||
members);
|
||||
|
||||
setOriginalNode(classExpression, node);
|
||||
setTextRange(classExpression, location);
|
||||
|
||||
@@ -234,7 +280,11 @@ namespace ts {
|
||||
setOriginalNode(statement, node);
|
||||
setTextRange(statement, location);
|
||||
setCommentRange(statement, node);
|
||||
return statement;
|
||||
|
||||
const statements: Statement[] = [statement];
|
||||
addRange(statements, decorationStatements);
|
||||
addConstructorDecorationStatement(statements, node);
|
||||
return statements;
|
||||
}
|
||||
|
||||
function visitClassExpression(node: ClassExpression) {
|
||||
|
||||
@@ -466,6 +466,20 @@ namespace ts {
|
||||
factory.createAssignment(importVariableName, parameterName)
|
||||
)
|
||||
);
|
||||
if (hasSyntacticModifier(entry, ModifierFlags.Export)) {
|
||||
statements.push(
|
||||
factory.createExpressionStatement(
|
||||
factory.createCallExpression(
|
||||
exportFunction,
|
||||
/*typeArguments*/ undefined,
|
||||
[
|
||||
factory.createStringLiteral(idText(importVariableName)),
|
||||
parameterName,
|
||||
]
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
break;
|
||||
|
||||
case SyntaxKind.ExportDeclaration:
|
||||
|
||||
@@ -1113,7 +1113,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
// Add remaining statements from the body, skipping the super() call if it was found and any (already added) prologue statements
|
||||
addRange(statements, visitNodes(body.statements, visitor, isStatement, superStatementIndex + 1 + prologueStatementCount));
|
||||
const start = superStatementIndex >= 0 ? superStatementIndex + 1 : prologueStatementCount;
|
||||
addRange(statements, visitNodes(body.statements, visitor, isStatement, start));
|
||||
|
||||
// End the lexical environment.
|
||||
statements = factory.mergeLexicalEnvironment(statements, endLexicalEnvironment());
|
||||
|
||||
@@ -16,6 +16,7 @@ namespace ts {
|
||||
*/
|
||||
OutOfDateWithPrepend,
|
||||
OutputMissing,
|
||||
ErrorReadingFile,
|
||||
OutOfDateWithSelf,
|
||||
OutOfDateWithUpstream,
|
||||
OutOfDateBuildInfo,
|
||||
@@ -37,6 +38,7 @@ namespace ts {
|
||||
| Status.UpToDate
|
||||
| Status.OutOfDateWithPrepend
|
||||
| Status.OutputMissing
|
||||
| Status.ErrorReadingFile
|
||||
| Status.OutOfDateWithSelf
|
||||
| Status.OutOfDateWithUpstream
|
||||
| Status.OutOfDateBuildInfo
|
||||
@@ -72,7 +74,6 @@ namespace ts {
|
||||
type: UpToDateStatusType.UpToDate | UpToDateStatusType.UpToDateWithUpstreamTypes | UpToDateStatusType.UpToDateWithInputFileText;
|
||||
newestInputFileTime?: Date;
|
||||
newestInputFileName?: string;
|
||||
newestDeclarationFileContentChangedTime: Date | undefined;
|
||||
oldestOutputFileName: string;
|
||||
}
|
||||
|
||||
@@ -96,6 +97,12 @@ namespace ts {
|
||||
missingOutputFileName: string;
|
||||
}
|
||||
|
||||
/** Error reading file */
|
||||
export interface ErrorReadingFile {
|
||||
type: UpToDateStatusType.ErrorReadingFile;
|
||||
fileName: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* One or more of the project's outputs is older than its newest input.
|
||||
*/
|
||||
|
||||
@@ -224,6 +224,7 @@ namespace ts {
|
||||
path: Path;
|
||||
buildInfo: BuildInfo | false;
|
||||
modifiedTime: Date;
|
||||
latestChangedDtsTime?: Date | false;
|
||||
}
|
||||
|
||||
interface SolutionBuilderState<T extends BuilderProgram = BuilderProgram> extends WatchFactory<WatchType, ResolvedConfigFileName> {
|
||||
@@ -295,6 +296,7 @@ namespace ts {
|
||||
compilerHost.getParsedCommandLine = fileName => parseConfigFile(state, fileName as ResolvedConfigFileName, toResolvedConfigFilePath(state, fileName as ResolvedConfigFileName));
|
||||
compilerHost.resolveModuleNames = maybeBind(host, host.resolveModuleNames);
|
||||
compilerHost.resolveTypeReferenceDirectives = maybeBind(host, host.resolveTypeReferenceDirectives);
|
||||
compilerHost.getModuleResolutionCache = maybeBind(host, host.getModuleResolutionCache);
|
||||
const moduleResolutionCache = !compilerHost.resolveModuleNames ? createModuleResolutionCache(currentDirectory, getCanonicalFileName) : undefined;
|
||||
const typeReferenceDirectiveResolutionCache = !compilerHost.resolveTypeReferenceDirectives ? createTypeReferenceDirectiveResolutionCache(currentDirectory, getCanonicalFileName, /*options*/ undefined, moduleResolutionCache?.getPackageJsonInfoCache()) : undefined;
|
||||
if (!compilerHost.resolveModuleNames) {
|
||||
@@ -402,6 +404,7 @@ namespace ts {
|
||||
return isParsedCommandLine(value) ? value : undefined;
|
||||
}
|
||||
|
||||
performance.mark("SolutionBuilder::beforeConfigFileParsing");
|
||||
let diagnostic: Diagnostic | undefined;
|
||||
const { parseConfigFileHost, baseCompilerOptions, baseWatchOptions, extendedConfigCache, host } = state;
|
||||
let parsed: ParsedCommandLine | undefined;
|
||||
@@ -415,6 +418,8 @@ namespace ts {
|
||||
parseConfigFileHost.onUnRecoverableConfigFileDiagnostic = noop;
|
||||
}
|
||||
configFileCache.set(configFilePath, parsed || diagnostic!);
|
||||
performance.mark("SolutionBuilder::afterConfigFileParsing");
|
||||
performance.measure("SolutionBuilder::Config file parsing", "SolutionBuilder::beforeConfigFileParsing", "SolutionBuilder::afterConfigFileParsing");
|
||||
return parsed;
|
||||
}
|
||||
|
||||
@@ -732,6 +737,7 @@ namespace ts {
|
||||
if (updateOutputFileStampsPending) {
|
||||
updateOutputTimestamps(state, config, projectPath);
|
||||
}
|
||||
performance.mark("SolutionBuilder::Timestamps only updates");
|
||||
return doneInvalidatedProject(state, projectPath);
|
||||
}
|
||||
};
|
||||
@@ -845,6 +851,8 @@ namespace ts {
|
||||
|
||||
function done(cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, customTransformers?: CustomTransformers) {
|
||||
executeSteps(BuildStep.Done, cancellationToken, writeFile, customTransformers);
|
||||
if (kind === InvalidatedProjectKind.Build) performance.mark("SolutionBuilder::Projects built");
|
||||
else performance.mark("SolutionBuilder::Bundles updated");
|
||||
return doneInvalidatedProject(state, projectPath);
|
||||
}
|
||||
|
||||
@@ -980,8 +988,7 @@ namespace ts {
|
||||
|
||||
// Actual Emit
|
||||
const { host, compilerHost } = state;
|
||||
let resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
|
||||
const existingBuildInfo = state.buildInfoCache.get(projectPath)?.buildInfo || undefined;
|
||||
const resultFlags = program.hasChangedEmitSignature?.() ? BuildResultFlags.None : BuildResultFlags.DeclarationOutputUnchanged;
|
||||
const emitterDiagnostics = createDiagnosticCollection();
|
||||
const emittedOutputs = new Map<Path, string>();
|
||||
const options = program.getCompilerOptions();
|
||||
@@ -991,13 +998,7 @@ namespace ts {
|
||||
outputFiles.forEach(({ name, text, writeByteOrderMark, buildInfo }) => {
|
||||
const path = toPath(state, name);
|
||||
emittedOutputs.set(toPath(state, name), name);
|
||||
if (buildInfo) {
|
||||
setBuildInfo(state, buildInfo, projectPath, options);
|
||||
// Buildinfo has information on when last dts change time
|
||||
if (buildInfo.program?.dtsChangeTime !== existingBuildInfo?.program?.dtsChangeTime) {
|
||||
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
||||
}
|
||||
}
|
||||
if (buildInfo) setBuildInfo(state, buildInfo, projectPath, options, resultFlags);
|
||||
writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
||||
if (!isIncremental && state.watch) {
|
||||
(outputTimeStampMap ||= getOutputTimeStampMap(state, projectPath)!).set(path, now ||= getCurrentTime(state.host));
|
||||
@@ -1017,7 +1018,7 @@ namespace ts {
|
||||
Debug.assertIsDefined(program);
|
||||
Debug.assert(step === BuildStep.EmitBuildInfo);
|
||||
const emitResult = program.emitBuildInfo((name, text, writeByteOrderMark, onError, sourceFiles, data) => {
|
||||
if (data?.buildInfo) setBuildInfo(state, data.buildInfo, projectPath, program!.getCompilerOptions());
|
||||
if (data?.buildInfo) setBuildInfo(state, data.buildInfo, projectPath, program!.getCompilerOptions(), BuildResultFlags.DeclarationOutputUnchanged);
|
||||
if (writeFileCallback) writeFileCallback(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
||||
else state.compilerHost.writeFile(name, text, writeByteOrderMark, onError, sourceFiles, data);
|
||||
}, cancellationToken);
|
||||
@@ -1064,7 +1065,6 @@ namespace ts {
|
||||
state.diagnostics.delete(projectPath);
|
||||
state.projectStatus.set(projectPath, {
|
||||
type: UpToDateStatusType.UpToDate,
|
||||
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, config.options, projectPath)!,
|
||||
oldestOutputFileName
|
||||
});
|
||||
afterProgramDone(state, program, config);
|
||||
@@ -1116,14 +1116,14 @@ namespace ts {
|
||||
const emitterDiagnostics = createDiagnosticCollection();
|
||||
const emittedOutputs = new Map<Path, string>();
|
||||
let resultFlags = BuildResultFlags.DeclarationOutputUnchanged;
|
||||
const existingBuildInfo = state.buildInfoCache.get(projectPath)!.buildInfo as BuildInfo;
|
||||
const existingBuildInfo = state.buildInfoCache.get(projectPath)!.buildInfo || undefined;
|
||||
outputFiles.forEach(({ name, text, writeByteOrderMark, buildInfo }) => {
|
||||
emittedOutputs.set(toPath(state, name), name);
|
||||
if (buildInfo) {
|
||||
setBuildInfo(state, buildInfo, projectPath, config.options);
|
||||
if (buildInfo.program?.dtsChangeTime !== existingBuildInfo.program?.dtsChangeTime) {
|
||||
if ((buildInfo.program as ProgramBundleEmitBuildInfo)?.outSignature !== (existingBuildInfo?.program as ProgramBundleEmitBuildInfo)?.outSignature) {
|
||||
resultFlags &= ~BuildResultFlags.DeclarationOutputUnchanged;
|
||||
}
|
||||
setBuildInfo(state, buildInfo, projectPath, config.options, resultFlags);
|
||||
}
|
||||
writeFile(writeFileCallback ? { writeFile: writeFileCallback } : compilerHost, emitterDiagnostics, name, text, writeByteOrderMark);
|
||||
});
|
||||
@@ -1365,7 +1365,7 @@ namespace ts {
|
||||
config: ParsedCommandLine
|
||||
) {
|
||||
if (program) {
|
||||
if (program && state.write) listFiles(program, state.write);
|
||||
if (state.write) listFiles(program, state.write);
|
||||
if (state.host.afterProgramEmitAndDiagnostics) {
|
||||
state.host.afterProgramEmitAndDiagnostics(program);
|
||||
}
|
||||
@@ -1464,15 +1464,28 @@ namespace ts {
|
||||
return result;
|
||||
}
|
||||
|
||||
function setBuildInfo(state: SolutionBuilderState, buildInfo: BuildInfo, resolvedConfigPath: ResolvedConfigFilePath, options: CompilerOptions) {
|
||||
function setBuildInfo(
|
||||
state: SolutionBuilderState,
|
||||
buildInfo: BuildInfo,
|
||||
resolvedConfigPath: ResolvedConfigFilePath,
|
||||
options: CompilerOptions,
|
||||
resultFlags: BuildResultFlags,
|
||||
) {
|
||||
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options)!;
|
||||
const existing = getBuildInfoCacheEntry(state, buildInfoPath, resolvedConfigPath);
|
||||
const modifiedTime = getCurrentTime(state.host);
|
||||
if (existing) {
|
||||
existing.buildInfo = buildInfo;
|
||||
existing.modifiedTime = getCurrentTime(state.host);
|
||||
existing.modifiedTime = modifiedTime;
|
||||
if (!(resultFlags & BuildResultFlags.DeclarationOutputUnchanged)) existing.latestChangedDtsTime = modifiedTime;
|
||||
}
|
||||
else {
|
||||
state.buildInfoCache.set(resolvedConfigPath, { path: toPath(state, buildInfoPath), buildInfo, modifiedTime: getCurrentTime(state.host) });
|
||||
state.buildInfoCache.set(resolvedConfigPath, {
|
||||
path: toPath(state, buildInfoPath),
|
||||
buildInfo,
|
||||
modifiedTime,
|
||||
latestChangedDtsTime: resultFlags & BuildResultFlags.DeclarationOutputUnchanged ? undefined : modifiedTime,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1489,8 +1502,7 @@ namespace ts {
|
||||
return existing.buildInfo || undefined;
|
||||
}
|
||||
const value = state.readFileWithCache(buildInfoPath);
|
||||
const buildInfo = value ? ts.getBuildInfo(value) : undefined;
|
||||
Debug.assert(modifiedTime || !buildInfo);
|
||||
const buildInfo = value ? ts.getBuildInfo(buildInfoPath, value) : undefined;
|
||||
state.buildInfoCache.set(resolvedConfigPath, { path, buildInfo: buildInfo || false, modifiedTime: modifiedTime || missingFileModifiedTime });
|
||||
return buildInfo;
|
||||
}
|
||||
@@ -1563,7 +1575,6 @@ namespace ts {
|
||||
let buildInfoTime: Date | undefined;
|
||||
let buildInfoProgram: ProgramBuildInfo | undefined;
|
||||
let buildInfoVersionMap: ESMap<Path, string> | undefined;
|
||||
let newestDeclarationFileContentChangedTime;
|
||||
if (buildInfoPath) {
|
||||
const buildInfoCacheEntry = getBuildInfoCacheEntry(state, buildInfoPath, resolvedPath);
|
||||
buildInfoTime = buildInfoCacheEntry?.modifiedTime || ts.getModifiedTime(host, buildInfoPath);
|
||||
@@ -1581,7 +1592,14 @@ namespace ts {
|
||||
};
|
||||
}
|
||||
|
||||
const buildInfo = Debug.checkDefined(getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime));
|
||||
const buildInfo = getBuildInfo(state, buildInfoPath, resolvedPath, buildInfoTime);
|
||||
if (!buildInfo) {
|
||||
// Error reading buildInfo
|
||||
return {
|
||||
type: UpToDateStatusType.ErrorReadingFile,
|
||||
fileName: buildInfoPath
|
||||
};
|
||||
}
|
||||
if ((buildInfo.bundle || buildInfo.program) && buildInfo.version !== version) {
|
||||
return {
|
||||
type: UpToDateStatusType.TsVersionOutputOfDate,
|
||||
@@ -1603,8 +1621,6 @@ namespace ts {
|
||||
|
||||
oldestOutputFileTime = buildInfoTime;
|
||||
oldestOutputFileName = buildInfoPath;
|
||||
// Get the last dtsChange time from build info
|
||||
newestDeclarationFileContentChangedTime = buildInfo.program?.dtsChangeTime ? new Date(buildInfo.program.dtsChangeTime) : undefined;
|
||||
}
|
||||
|
||||
// Check input files
|
||||
@@ -1718,7 +1734,8 @@ namespace ts {
|
||||
|
||||
// If the upstream project has only change .d.ts files, and we've built
|
||||
// *after* those files, then we're "psuedo up to date" and eligible for a fast rebuild
|
||||
if (refStatus.newestDeclarationFileContentChangedTime && refStatus.newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
||||
const newestDeclarationFileContentChangedTime = getLatestChangedDtsTime(state, resolvedConfig.options, resolvedRefPath);
|
||||
if (newestDeclarationFileContentChangedTime && newestDeclarationFileContentChangedTime <= oldestOutputFileTime) {
|
||||
pseudoUpToDate = true;
|
||||
upstreamChangedProject = ref.path;
|
||||
continue;
|
||||
@@ -1764,7 +1781,6 @@ namespace ts {
|
||||
pseudoInputUpToDate ?
|
||||
UpToDateStatusType.UpToDateWithInputFileText :
|
||||
UpToDateStatusType.UpToDate,
|
||||
newestDeclarationFileContentChangedTime,
|
||||
newestInputFileTime,
|
||||
newestInputFileName,
|
||||
oldestOutputFileName: oldestOutputFileName!
|
||||
@@ -1799,7 +1815,10 @@ namespace ts {
|
||||
return prior;
|
||||
}
|
||||
|
||||
performance.mark("SolutionBuilder::beforeUpToDateCheck");
|
||||
const actual = getUpToDateStatusWorker(state, project, resolvedPath);
|
||||
performance.mark("SolutionBuilder::afterUpToDateCheck");
|
||||
performance.measure("SolutionBuilder::Up-to-date check", "SolutionBuilder::beforeUpToDateCheck", "SolutionBuilder::afterUpToDateCheck");
|
||||
state.projectStatus.set(resolvedPath, actual);
|
||||
return actual;
|
||||
}
|
||||
@@ -1854,11 +1873,15 @@ namespace ts {
|
||||
});
|
||||
}
|
||||
|
||||
function getDtsChangeTime(state: SolutionBuilderState, options: CompilerOptions, resolvedConfigPath: ResolvedConfigFilePath) {
|
||||
function getLatestChangedDtsTime(state: SolutionBuilderState, options: CompilerOptions, resolvedConfigPath: ResolvedConfigFilePath) {
|
||||
if (!options.composite) return undefined;
|
||||
const buildInfoPath = getTsBuildInfoEmitOutputFilePath(options)!;
|
||||
const buildInfo = getBuildInfo(state, buildInfoPath, resolvedConfigPath, /*modifiedTime*/ undefined);
|
||||
return buildInfo?.program?.dtsChangeTime ? new Date(buildInfo.program.dtsChangeTime) : undefined;
|
||||
const entry = Debug.checkDefined(state.buildInfoCache.get(resolvedConfigPath));
|
||||
if (entry.latestChangedDtsTime !== undefined) return entry.latestChangedDtsTime || undefined;
|
||||
const latestChangedDtsTime = entry.buildInfo && entry.buildInfo.program && entry.buildInfo.program.latestChangedDtsFile ?
|
||||
state.host.getModifiedTime(getNormalizedAbsolutePath(entry.buildInfo.program.latestChangedDtsFile, getDirectoryPath(entry.path))) :
|
||||
undefined;
|
||||
entry.latestChangedDtsTime = latestChangedDtsTime || false;
|
||||
return latestChangedDtsTime;
|
||||
}
|
||||
|
||||
function updateOutputTimestamps(state: SolutionBuilderState, proj: ParsedCommandLine, resolvedPath: ResolvedConfigFilePath) {
|
||||
@@ -1868,7 +1891,6 @@ namespace ts {
|
||||
updateOutputTimestampsWorker(state, proj, resolvedPath, Diagnostics.Updating_output_timestamps_of_project_0);
|
||||
state.projectStatus.set(resolvedPath, {
|
||||
type: UpToDateStatusType.UpToDate,
|
||||
newestDeclarationFileContentChangedTime: getDtsChangeTime(state, proj.options, resolvedPath),
|
||||
oldestOutputFileName: getFirstProjectOutput(proj, !state.host.useCaseSensitiveFileNames())
|
||||
});
|
||||
}
|
||||
@@ -1945,6 +1967,14 @@ namespace ts {
|
||||
}
|
||||
|
||||
function build(state: SolutionBuilderState, project?: string, cancellationToken?: CancellationToken, writeFile?: WriteFileCallback, getCustomTransformers?: (project: string) => CustomTransformers, onlyReferences?: boolean): ExitStatus {
|
||||
performance.mark("SolutionBuilder::beforeBuild");
|
||||
const result = buildWorker(state, project, cancellationToken, writeFile, getCustomTransformers, onlyReferences);
|
||||
performance.mark("SolutionBuilder::afterBuild");
|
||||
performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
|
||||
return result;
|
||||
}
|
||||
|
||||
function buildWorker(state: SolutionBuilderState, project: string | undefined, cancellationToken: CancellationToken | undefined, writeFile: WriteFileCallback | undefined, getCustomTransformers: ((project: string) => CustomTransformers) | undefined, onlyReferences: boolean | undefined): ExitStatus {
|
||||
const buildOrder = getBuildOrderFor(state, project, onlyReferences);
|
||||
if (!buildOrder) return ExitStatus.InvalidProject_OutputsSkipped;
|
||||
|
||||
@@ -1973,7 +2003,15 @@ namespace ts {
|
||||
: ExitStatus.DiagnosticsPresent_OutputsSkipped;
|
||||
}
|
||||
|
||||
function clean(state: SolutionBuilderState, project?: string, onlyReferences?: boolean) {
|
||||
function clean(state: SolutionBuilderState, project?: string, onlyReferences?: boolean): ExitStatus {
|
||||
performance.mark("SolutionBuilder::beforeClean");
|
||||
const result = cleanWorker(state, project, onlyReferences);
|
||||
performance.mark("SolutionBuilder::afterClean");
|
||||
performance.measure("SolutionBuilder::Clean", "SolutionBuilder::beforeClean", "SolutionBuilder::afterClean");
|
||||
return result;
|
||||
}
|
||||
|
||||
function cleanWorker(state: SolutionBuilderState, project: string | undefined, onlyReferences: boolean | undefined) {
|
||||
const buildOrder = getBuildOrderFor(state, project, onlyReferences);
|
||||
if (!buildOrder) return ExitStatus.InvalidProject_OutputsSkipped;
|
||||
|
||||
@@ -2050,6 +2088,14 @@ namespace ts {
|
||||
}
|
||||
|
||||
function buildNextInvalidatedProject(state: SolutionBuilderState, changeDetected: boolean) {
|
||||
performance.mark("SolutionBuilder::beforeBuild");
|
||||
const buildOrder = buildNextInvalidatedProjectWorker(state, changeDetected);
|
||||
performance.mark("SolutionBuilder::afterBuild");
|
||||
performance.measure("SolutionBuilder::Build", "SolutionBuilder::beforeBuild", "SolutionBuilder::afterBuild");
|
||||
if (buildOrder) reportErrorSummary(state, buildOrder);
|
||||
}
|
||||
|
||||
function buildNextInvalidatedProjectWorker(state: SolutionBuilderState, changeDetected: boolean) {
|
||||
state.timerToBuildInvalidatedProject = undefined;
|
||||
if (state.reportFileChangeDetected) {
|
||||
state.reportFileChangeDetected = false;
|
||||
@@ -2079,7 +2125,7 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
disableCache(state);
|
||||
reportErrorSummary(state, buildOrder);
|
||||
return buildOrder;
|
||||
}
|
||||
|
||||
function watchConfigFile(state: SolutionBuilderState, resolved: ResolvedConfigFileName, resolvedPath: ResolvedConfigFilePath, parsed: ParsedCommandLine | undefined) {
|
||||
@@ -2186,6 +2232,7 @@ namespace ts {
|
||||
|
||||
function startWatching(state: SolutionBuilderState, buildOrder: AnyBuildOrder) {
|
||||
if (!state.watchAllProjectsPending) return;
|
||||
performance.mark("SolutionBuilder::beforeWatcherCreation");
|
||||
state.watchAllProjectsPending = false;
|
||||
for (const resolved of getBuildOrderFromAnyBuildOrder(buildOrder)) {
|
||||
const resolvedPath = toResolvedConfigFilePath(state, resolved);
|
||||
@@ -2204,6 +2251,8 @@ namespace ts {
|
||||
watchPackageJsonFiles(state, resolved, resolvedPath, cfg);
|
||||
}
|
||||
}
|
||||
performance.mark("SolutionBuilder::afterWatcherCreation");
|
||||
performance.measure("SolutionBuilder::Watcher creation", "SolutionBuilder::beforeWatcherCreation", "SolutionBuilder::afterWatcherCreation");
|
||||
}
|
||||
|
||||
function stopWatching(state: SolutionBuilderState) {
|
||||
@@ -2337,6 +2386,13 @@ namespace ts {
|
||||
relName(state, configFileName),
|
||||
relName(state, status.missingOutputFileName)
|
||||
);
|
||||
case UpToDateStatusType.ErrorReadingFile:
|
||||
return reportStatus(
|
||||
state,
|
||||
Diagnostics.Project_0_is_out_of_date_because_there_was_error_reading_file_1,
|
||||
relName(state, configFileName),
|
||||
relName(state, status.fileName)
|
||||
);
|
||||
case UpToDateStatusType.OutOfDateBuildInfo:
|
||||
return reportStatus(
|
||||
state,
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
},
|
||||
|
||||
"references": [
|
||||
{ "path": "../shims" }
|
||||
],
|
||||
|
||||
"files": [
|
||||
|
||||
@@ -6,6 +6,5 @@
|
||||
"preserveConstEnums": false
|
||||
},
|
||||
"references": [
|
||||
{ "path": "../shims" }
|
||||
]
|
||||
}
|
||||
|
||||
+157
-9
@@ -885,6 +885,144 @@ namespace ts {
|
||||
/* @internal */ jsDocCache?: readonly JSDocTag[]; // Cache for getJSDocTags
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export type HasChildren =
|
||||
| Identifier
|
||||
| QualifiedName
|
||||
| ComputedPropertyName
|
||||
| TypeParameterDeclaration
|
||||
| ParameterDeclaration
|
||||
| Decorator
|
||||
| PropertySignature
|
||||
| PropertyDeclaration
|
||||
| MethodSignature
|
||||
| MethodDeclaration
|
||||
| ConstructorDeclaration
|
||||
| GetAccessorDeclaration
|
||||
| SetAccessorDeclaration
|
||||
| ClassStaticBlockDeclaration
|
||||
| CallSignatureDeclaration
|
||||
| ConstructSignatureDeclaration
|
||||
| IndexSignatureDeclaration
|
||||
| TypePredicateNode
|
||||
| TypeReferenceNode
|
||||
| FunctionTypeNode
|
||||
| ConstructorTypeNode
|
||||
| TypeQueryNode
|
||||
| TypeLiteralNode
|
||||
| ArrayTypeNode
|
||||
| TupleTypeNode
|
||||
| OptionalTypeNode
|
||||
| RestTypeNode
|
||||
| UnionTypeNode
|
||||
| IntersectionTypeNode
|
||||
| ConditionalTypeNode
|
||||
| InferTypeNode
|
||||
| ImportTypeNode
|
||||
| ImportTypeAssertionContainer
|
||||
| NamedTupleMember
|
||||
| ParenthesizedTypeNode
|
||||
| TypeOperatorNode
|
||||
| IndexedAccessTypeNode
|
||||
| MappedTypeNode
|
||||
| LiteralTypeNode
|
||||
| TemplateLiteralTypeNode
|
||||
| TemplateLiteralTypeSpan
|
||||
| ObjectBindingPattern
|
||||
| ArrayBindingPattern
|
||||
| BindingElement
|
||||
| ArrayLiteralExpression
|
||||
| ObjectLiteralExpression
|
||||
| PropertyAccessExpression
|
||||
| ElementAccessExpression
|
||||
| CallExpression
|
||||
| NewExpression
|
||||
| TaggedTemplateExpression
|
||||
| TypeAssertion
|
||||
| ParenthesizedExpression
|
||||
| FunctionExpression
|
||||
| ArrowFunction
|
||||
| DeleteExpression
|
||||
| TypeOfExpression
|
||||
| VoidExpression
|
||||
| AwaitExpression
|
||||
| PrefixUnaryExpression
|
||||
| PostfixUnaryExpression
|
||||
| BinaryExpression
|
||||
| ConditionalExpression
|
||||
| TemplateExpression
|
||||
| YieldExpression
|
||||
| SpreadElement
|
||||
| ClassExpression
|
||||
| ExpressionWithTypeArguments
|
||||
| AsExpression
|
||||
| NonNullExpression
|
||||
| MetaProperty
|
||||
| TemplateSpan
|
||||
| Block
|
||||
| VariableStatement
|
||||
| ExpressionStatement
|
||||
| IfStatement
|
||||
| DoStatement
|
||||
| WhileStatement
|
||||
| ForStatement
|
||||
| ForInStatement
|
||||
| ForOfStatement
|
||||
| ContinueStatement
|
||||
| BreakStatement
|
||||
| ReturnStatement
|
||||
| WithStatement
|
||||
| SwitchStatement
|
||||
| LabeledStatement
|
||||
| ThrowStatement
|
||||
| TryStatement
|
||||
| VariableDeclaration
|
||||
| VariableDeclarationList
|
||||
| FunctionDeclaration
|
||||
| ClassDeclaration
|
||||
| InterfaceDeclaration
|
||||
| TypeAliasDeclaration
|
||||
| EnumDeclaration
|
||||
| ModuleDeclaration
|
||||
| ModuleBlock
|
||||
| CaseBlock
|
||||
| NamespaceExportDeclaration
|
||||
| ImportEqualsDeclaration
|
||||
| ImportDeclaration
|
||||
| AssertClause
|
||||
| AssertEntry
|
||||
| ImportClause
|
||||
| NamespaceImport
|
||||
| NamespaceExport
|
||||
| NamedImports
|
||||
| ImportSpecifier
|
||||
| ExportAssignment
|
||||
| ExportDeclaration
|
||||
| NamedExports
|
||||
| ExportSpecifier
|
||||
| ExternalModuleReference
|
||||
| JsxElement
|
||||
| JsxSelfClosingElement
|
||||
| JsxOpeningElement
|
||||
| JsxClosingElement
|
||||
| JsxFragment
|
||||
| JsxAttribute
|
||||
| JsxAttributes
|
||||
| JsxSpreadAttribute
|
||||
| JsxExpression
|
||||
| CaseClause
|
||||
| DefaultClause
|
||||
| HeritageClause
|
||||
| CatchClause
|
||||
| PropertyAssignment
|
||||
| ShorthandPropertyAssignment
|
||||
| SpreadAssignment
|
||||
| EnumMember
|
||||
| SourceFile
|
||||
| PartiallyEmittedExpression
|
||||
| CommaListExpression
|
||||
;
|
||||
|
||||
export type HasJSDoc =
|
||||
| ParameterDeclaration
|
||||
| CallSignatureDeclaration
|
||||
@@ -3791,8 +3929,16 @@ namespace ts {
|
||||
* It is _public_ so that (pre)transformers can set this field,
|
||||
* since it switches the builtin `node` module transform. Generally speaking, if unset,
|
||||
* the field is treated as though it is `ModuleKind.CommonJS`.
|
||||
*
|
||||
* Note that this field is only set by the module resolution process when
|
||||
* `moduleResolution` is `Node16` or `NodeNext`, which is implied by the `module` setting
|
||||
* of `Node16` or `NodeNext`, respectively, but may be overriden (eg, by a `moduleResolution`
|
||||
* of `node`). If so, this field will be unset and source files will be considered to be
|
||||
* CommonJS-output-format by the node module transformer and type checker, regardless of extension or context.
|
||||
*/
|
||||
impliedNodeFormat?: ModuleKind.ESNext | ModuleKind.CommonJS;
|
||||
/*@internal*/ packageJsonLocations?: readonly string[];
|
||||
/*@internal*/ packageJsonScope?: PackageJsonInfo;
|
||||
|
||||
/* @internal */ scriptKind: ScriptKind;
|
||||
|
||||
@@ -4664,10 +4810,11 @@ namespace ts {
|
||||
UseAliasDefinedOutsideCurrentScope = 1 << 14, // Allow non-visible aliases
|
||||
UseSingleQuotesForStringLiteralType = 1 << 28, // Use single quotes for string literal type
|
||||
NoTypeReduction = 1 << 29, // Don't call getReducedType
|
||||
OmitThisParameter = 1 << 25,
|
||||
|
||||
// Error handling
|
||||
AllowThisInObjectLiteral = 1 << 15,
|
||||
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
|
||||
AllowQualifiedNameInPlaceOfIdentifier = 1 << 16,
|
||||
/** @deprecated AllowQualifedNameInPlaceOfIdentifier. Use AllowQualifiedNameInPlaceOfIdentifier instead. */
|
||||
AllowQualifedNameInPlaceOfIdentifier = AllowQualifiedNameInPlaceOfIdentifier,
|
||||
AllowAnonymousIdentifier = 1 << 17,
|
||||
@@ -4709,6 +4856,7 @@ namespace ts {
|
||||
UseAliasDefinedOutsideCurrentScope = 1 << 14, // For a `type T = ... ` defined in a different file, write `T` instead of its value, even though `T` can't be accessed in the current scope.
|
||||
UseSingleQuotesForStringLiteralType = 1 << 28, // Use single quotes for string literal type
|
||||
NoTypeReduction = 1 << 29, // Don't call getReducedType
|
||||
OmitThisParameter = 1 << 25,
|
||||
|
||||
// Error Handling
|
||||
AllowUniqueESSymbolType = 1 << 20, // This is bit 20 to align with the same bit in `NodeBuilderFlags`
|
||||
@@ -4728,7 +4876,7 @@ namespace ts {
|
||||
NodeBuilderFlagsMask = NoTruncation | WriteArrayAsGenericType | UseStructuralFallback | WriteTypeArgumentsOfSignature |
|
||||
UseFullyQualifiedType | SuppressAnyReturnType | MultilineObjectLiterals | WriteClassExpressionAsTypeLiteral |
|
||||
UseTypeOfFunction | OmitParameterModifiers | UseAliasDefinedOutsideCurrentScope | AllowUniqueESSymbolType | InTypeAlias |
|
||||
UseSingleQuotesForStringLiteralType | NoTypeReduction,
|
||||
UseSingleQuotesForStringLiteralType | NoTypeReduction | OmitThisParameter
|
||||
}
|
||||
|
||||
export const enum SymbolFormatFlags {
|
||||
@@ -6025,6 +6173,7 @@ namespace ts {
|
||||
export const enum TypeMapKind {
|
||||
Simple,
|
||||
Array,
|
||||
Deferred,
|
||||
Function,
|
||||
Composite,
|
||||
Merged,
|
||||
@@ -6034,7 +6183,8 @@ namespace ts {
|
||||
export type TypeMapper =
|
||||
| { kind: TypeMapKind.Simple, source: Type, target: Type }
|
||||
| { kind: TypeMapKind.Array, sources: readonly Type[], targets: readonly Type[] | undefined }
|
||||
| { kind: TypeMapKind.Function, func: (t: Type) => Type }
|
||||
| { kind: TypeMapKind.Deferred, sources: readonly Type[], targets: (() => Type)[] }
|
||||
| { kind: TypeMapKind.Function, func: (t: Type) => Type, debugInfo?: () => string }
|
||||
| { kind: TypeMapKind.Composite | TypeMapKind.Merged, mapper1: TypeMapper, mapper2: TypeMapper };
|
||||
|
||||
export const enum InferencePriority {
|
||||
@@ -6981,7 +7131,6 @@ namespace ts {
|
||||
// For testing:
|
||||
/*@internal*/ disableUseFileVersionAsSignature?: boolean;
|
||||
/*@internal*/ storeFilesChangingSignatureDuringEmit?: boolean;
|
||||
/*@internal*/ now?(): Date;
|
||||
}
|
||||
|
||||
/** true if --out otherwise source file name */
|
||||
@@ -7032,10 +7181,9 @@ namespace ts {
|
||||
ContainsPossibleTopLevelAwait = 1 << 26,
|
||||
ContainsLexicalSuper = 1 << 27,
|
||||
ContainsUpdateExpressionForIdentifier = 1 << 28,
|
||||
// Please leave this as 1 << 29.
|
||||
// It is the maximum bit we can set before we outgrow the size of a v8 small integer (SMI) on an x86 system.
|
||||
// It is a good reminder of how much room we have left
|
||||
HasComputedFlags = 1 << 29, // Transform flags have been computed.
|
||||
ContainsPrivateIdentifierInExpression = 1 << 29,
|
||||
|
||||
HasComputedFlags = 1 << 31, // Transform flags have been computed.
|
||||
|
||||
// Assertions
|
||||
// - Bitmasks that are used to assert facts about the syntax of a node and its subtree.
|
||||
@@ -7337,7 +7485,7 @@ namespace ts {
|
||||
parenthesizeBranchOfConditionalExpression(branch: Expression): Expression;
|
||||
parenthesizeExpressionOfExportDefault(expression: Expression): Expression;
|
||||
parenthesizeExpressionOfNew(expression: Expression): LeftHandSideExpression;
|
||||
parenthesizeLeftSideOfAccess(expression: Expression): LeftHandSideExpression;
|
||||
parenthesizeLeftSideOfAccess(expression: Expression, optionalChain?: boolean): LeftHandSideExpression;
|
||||
parenthesizeOperandOfPostfixUnary(operand: Expression): LeftHandSideExpression;
|
||||
parenthesizeOperandOfPrefixUnary(operand: Expression): UnaryExpression;
|
||||
parenthesizeExpressionsOfCommaDelimitedList(elements: readonly Expression[]): NodeArray<Expression>;
|
||||
|
||||
+15
-21
@@ -162,7 +162,7 @@ namespace ts {
|
||||
return sourceFile && sourceFile.resolvedModules && sourceFile.resolvedModules.get(moduleNameText, mode);
|
||||
}
|
||||
|
||||
export function setResolvedModule(sourceFile: SourceFile, moduleNameText: string, resolvedModule: ResolvedModuleFull, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): void {
|
||||
export function setResolvedModule(sourceFile: SourceFile, moduleNameText: string, resolvedModule: ResolvedModuleFull | undefined, mode: ModuleKind.CommonJS | ModuleKind.ESNext | undefined): void {
|
||||
if (!sourceFile.resolvedModules) {
|
||||
sourceFile.resolvedModules = createModeAwareCache();
|
||||
}
|
||||
@@ -3944,7 +3944,7 @@ namespace ts {
|
||||
diagnostics = nonFileDiagnostics;
|
||||
}
|
||||
|
||||
insertSorted(diagnostics, diagnostic, compareDiagnostics);
|
||||
insertSorted(diagnostics, diagnostic, compareDiagnosticsSkipRelatedInformation);
|
||||
}
|
||||
|
||||
function getGlobalDiagnostics(): Diagnostic[] {
|
||||
@@ -5360,20 +5360,16 @@ namespace ts {
|
||||
return getStringFromExpandedCharCodes(expandedCharCodes);
|
||||
}
|
||||
|
||||
export function readJsonOrUndefined(path: string, hostOrText: { readFile(fileName: string): string | undefined } | string): object | undefined {
|
||||
const jsonText = isString(hostOrText) ? hostOrText : hostOrText.readFile(path);
|
||||
if (!jsonText) return undefined;
|
||||
// gracefully handle if readFile fails or returns not JSON
|
||||
const result = parseConfigFileTextToJson(path, jsonText);
|
||||
return !result.error ? result.config : undefined;
|
||||
}
|
||||
|
||||
export function readJson(path: string, host: { readFile(fileName: string): string | undefined }): object {
|
||||
try {
|
||||
const jsonText = host.readFile(path);
|
||||
if (!jsonText) return {};
|
||||
const result = parseConfigFileTextToJson(path, jsonText);
|
||||
if (result.error) {
|
||||
return {};
|
||||
}
|
||||
return result.config;
|
||||
}
|
||||
catch (e) {
|
||||
// gracefully handle if readFile fails or returns not JSON
|
||||
return {};
|
||||
}
|
||||
return readJsonOrUndefined(path, host) || {};
|
||||
}
|
||||
|
||||
export function directoryProbablyExists(directoryName: string, host: { directoryExists?: (directoryName: string) => boolean }): boolean {
|
||||
@@ -5565,7 +5561,8 @@ namespace ts {
|
||||
|
||||
export function getDeclarationModifierFlagsFromSymbol(s: Symbol, isWrite = false): ModifierFlags {
|
||||
if (s.valueDeclaration) {
|
||||
const declaration = (isWrite && s.declarations && find(s.declarations, d => d.kind === SyntaxKind.SetAccessor)) || s.valueDeclaration;
|
||||
const declaration = (isWrite && s.declarations && find(s.declarations, isSetAccessorDeclaration))
|
||||
|| (s.flags & SymbolFlags.GetAccessor && find(s.declarations, isGetAccessorDeclaration)) || s.valueDeclaration;
|
||||
const flags = getCombinedModifierFlags(declaration);
|
||||
return s.parent && s.parent.flags & SymbolFlags.Class ? flags : flags & ~ModifierFlags.AccessibilityModifier;
|
||||
}
|
||||
@@ -6319,7 +6316,7 @@ namespace ts {
|
||||
// Excludes declaration files - they still require an explicit `export {}` or the like
|
||||
// for back compat purposes. The only non-declaration files _not_ forced to be a module are `.js` files
|
||||
// that aren't esm-mode (meaning not in a `type: module` scope).
|
||||
return (file.impliedNodeFormat === ModuleKind.ESNext || (fileExtensionIsOneOf(file.fileName, [Extension.Cjs, Extension.Cts]))) && !file.isDeclarationFile ? true : undefined;
|
||||
return (file.impliedNodeFormat === ModuleKind.ESNext || (fileExtensionIsOneOf(file.fileName, [Extension.Cjs, Extension.Cts, Extension.Mjs, Extension.Mts]))) && !file.isDeclarationFile ? true : undefined;
|
||||
}
|
||||
|
||||
export function getSetExternalModuleIndicator(options: CompilerOptions): (file: SourceFile) => void {
|
||||
@@ -6343,10 +6340,7 @@ namespace ts {
|
||||
if (options.jsx === JsxEmit.ReactJSX || options.jsx === JsxEmit.ReactJSXDev) {
|
||||
checks.push(isFileModuleFromUsingJSXTag);
|
||||
}
|
||||
const moduleKind = getEmitModuleKind(options);
|
||||
if (moduleKind === ModuleKind.Node16 || moduleKind === ModuleKind.NodeNext) {
|
||||
checks.push(isFileForcedToBeModuleByFormat);
|
||||
}
|
||||
checks.push(isFileForcedToBeModuleByFormat);
|
||||
const combined = or(...checks);
|
||||
const callback = (file: SourceFile) => void (file.externalModuleIndicator = combined(file));
|
||||
return callback;
|
||||
|
||||
@@ -932,6 +932,12 @@ namespace ts {
|
||||
/**
|
||||
* Gets the effective type parameters. If the node was parsed in a
|
||||
* JavaScript file, gets the type parameters from the `@template` tag from JSDoc.
|
||||
*
|
||||
* This does *not* return type parameters from a jsdoc reference to a generic type, eg
|
||||
*
|
||||
* type Id = <T>(x: T) => T
|
||||
* /** @type {Id} /
|
||||
* function id(x) { return x }
|
||||
*/
|
||||
export function getEffectiveTypeParameterDeclarations(node: DeclarationWithTypeParameters): readonly TypeParameterDeclaration[] {
|
||||
if (isJSDocSignature(node)) {
|
||||
|
||||
+859
-859
File diff suppressed because it is too large
Load Diff
+39
-5
@@ -224,26 +224,59 @@ namespace ts {
|
||||
for (const file of program.getSourceFiles()) {
|
||||
write(`${toFileName(file, relativeFileName)}`);
|
||||
reasons.get(file.path)?.forEach(reason => write(` ${fileIncludeReasonToDiagnostics(program, reason, relativeFileName).messageText}`));
|
||||
explainIfFileIsRedirect(file, relativeFileName)?.forEach(d => write(` ${d.messageText}`));
|
||||
explainIfFileIsRedirectAndImpliedFormat(file, relativeFileName)?.forEach(d => write(` ${d.messageText}`));
|
||||
}
|
||||
}
|
||||
|
||||
export function explainIfFileIsRedirect(file: SourceFile, fileNameConvertor?: (fileName: string) => string): DiagnosticMessageChain[] | undefined {
|
||||
export function explainIfFileIsRedirectAndImpliedFormat(
|
||||
file: SourceFile,
|
||||
fileNameConvertor?: (fileName: string) => string,
|
||||
): DiagnosticMessageChain[] | undefined {
|
||||
let result: DiagnosticMessageChain[] | undefined;
|
||||
if (file.path !== file.resolvedPath) {
|
||||
(result ||= []).push(chainDiagnosticMessages(
|
||||
(result ??= []).push(chainDiagnosticMessages(
|
||||
/*details*/ undefined,
|
||||
Diagnostics.File_is_output_of_project_reference_source_0,
|
||||
toFileName(file.originalFileName, fileNameConvertor)
|
||||
));
|
||||
}
|
||||
if (file.redirectInfo) {
|
||||
(result ||= []).push(chainDiagnosticMessages(
|
||||
(result ??= []).push(chainDiagnosticMessages(
|
||||
/*details*/ undefined,
|
||||
Diagnostics.File_redirects_to_file_0,
|
||||
toFileName(file.redirectInfo.redirectTarget, fileNameConvertor)
|
||||
));
|
||||
}
|
||||
if (isExternalOrCommonJsModule(file)) {
|
||||
switch (file.impliedNodeFormat) {
|
||||
case ModuleKind.ESNext:
|
||||
if (file.packageJsonScope) {
|
||||
(result ??= []).push(chainDiagnosticMessages(
|
||||
/*details*/ undefined,
|
||||
Diagnostics.File_is_ECMAScript_module_because_0_has_field_type_with_value_module,
|
||||
toFileName(last(file.packageJsonLocations!), fileNameConvertor)
|
||||
));
|
||||
}
|
||||
break;
|
||||
case ModuleKind.CommonJS:
|
||||
if (file.packageJsonScope) {
|
||||
(result ??= []).push(chainDiagnosticMessages(
|
||||
/*details*/ undefined,
|
||||
file.packageJsonScope.packageJsonContent.type ?
|
||||
Diagnostics.File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module :
|
||||
Diagnostics.File_is_CommonJS_module_because_0_does_not_have_field_type,
|
||||
toFileName(last(file.packageJsonLocations!), fileNameConvertor)
|
||||
));
|
||||
}
|
||||
else if (file.packageJsonLocations?.length) {
|
||||
(result ??= []).push(chainDiagnosticMessages(
|
||||
/*details*/ undefined,
|
||||
Diagnostics.File_is_CommonJS_module_because_package_json_was_not_found,
|
||||
));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -508,6 +541,7 @@ namespace ts {
|
||||
MissingFile: "Missing file",
|
||||
WildcardDirectory: "Wild card directory",
|
||||
FailedLookupLocations: "Failed Lookup Locations",
|
||||
AffectingFileLocation: "File location affecting resolution",
|
||||
TypeRoots: "Type roots",
|
||||
ConfigFileOfReferencedProject: "Config file of referened project",
|
||||
ExtendedConfigOfReferencedProject: "Extended config file of referenced project",
|
||||
@@ -529,6 +563,7 @@ namespace ts {
|
||||
MissingFile: "Missing file",
|
||||
WildcardDirectory: "Wild card directory",
|
||||
FailedLookupLocations: "Failed Lookup Locations",
|
||||
AffectingFileLocation: "File location affecting resolution",
|
||||
TypeRoots: "Type roots",
|
||||
ConfigFileOfReferencedProject: "Config file of referened project",
|
||||
ExtendedConfigOfReferencedProject: "Extended config file of referenced project",
|
||||
@@ -596,7 +631,6 @@ namespace ts {
|
||||
readDirectory: maybeBind(host, host.readDirectory),
|
||||
disableUseFileVersionAsSignature: host.disableUseFileVersionAsSignature,
|
||||
storeFilesChangingSignatureDuringEmit: host.storeFilesChangingSignatureDuringEmit,
|
||||
now: maybeBind(host, host.now),
|
||||
};
|
||||
|
||||
function writeFile(fileName: string, text: string, writeByteOrderMark: boolean, onError: (message: string) => void) {
|
||||
|
||||
+25
-16
@@ -13,15 +13,13 @@ namespace ts {
|
||||
if (host.getBuildInfo) {
|
||||
// host provides buildinfo, get it from there. This allows host to cache it
|
||||
buildInfo = host.getBuildInfo(buildInfoPath, compilerOptions.configFilePath);
|
||||
if (!buildInfo) return undefined;
|
||||
}
|
||||
else {
|
||||
const content = host.readFile(buildInfoPath);
|
||||
if (!content) return undefined;
|
||||
buildInfo = getBuildInfo(content);
|
||||
buildInfo = getBuildInfo(buildInfoPath, content);
|
||||
}
|
||||
if (buildInfo.version !== version) return undefined;
|
||||
if (!buildInfo.program) return undefined;
|
||||
if (!buildInfo || buildInfo.version !== version || !buildInfo.program) return undefined;
|
||||
return createBuilderProgramUsingProgramBuildInfo(buildInfo.program, buildInfoPath, host);
|
||||
}
|
||||
|
||||
@@ -30,7 +28,6 @@ namespace ts {
|
||||
host.createHash = maybeBind(system, system.createHash);
|
||||
host.disableUseFileVersionAsSignature = system.disableUseFileVersionAsSignature;
|
||||
host.storeFilesChangingSignatureDuringEmit = system.storeFilesChangingSignatureDuringEmit;
|
||||
host.now = maybeBind(system, system.now);
|
||||
setGetSourceFileAsHashVersioned(host, system);
|
||||
changeCompilerHostLikeToUseCache(host, fileName => toPath(fileName, host.getCurrentDirectory(), host.getCanonicalFileName));
|
||||
return host;
|
||||
@@ -115,6 +112,10 @@ namespace ts {
|
||||
resolveModuleNames?(moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingSourceFile?: SourceFile): (ResolvedModule | undefined)[];
|
||||
/** If provided, used to resolve type reference directives, otherwise typescript's default resolution */
|
||||
resolveTypeReferenceDirectives?(typeReferenceDirectiveNames: string[] | readonly FileReference[], containingFile: string, redirectedReference: ResolvedProjectReference | undefined, options: CompilerOptions, containingFileMode?: SourceFile["impliedNodeFormat"] | undefined): (ResolvedTypeReferenceDirective | undefined)[];
|
||||
/**
|
||||
* Returns the module resolution cache used by a provided `resolveModuleNames` implementation so that any non-name module resolution operations (eg, package.json lookup) can reuse it
|
||||
*/
|
||||
getModuleResolutionCache?(): ModuleResolutionCache | undefined;
|
||||
}
|
||||
/** Internal interface used to wire emit through same host */
|
||||
|
||||
@@ -284,7 +285,6 @@ namespace ts {
|
||||
let parsedConfigs: ESMap<Path, ParsedConfig> | undefined; // Parsed commandline and watching cached for referenced projects
|
||||
let sharedExtendedConfigFileWatchers: ESMap<Path, SharedExtendedConfigFileWatcher<Path>>; // Map of file watchers for extended files, shared between different referenced projects
|
||||
let extendedConfigCache = host.extendedConfigCache; // Cache for extended config evaluation
|
||||
let changesAffectResolution = false; // Flag for indicating non-config changes affect module resolution
|
||||
let reportFileChangeDetectedOnCreateProgram = false; // True if synchronizeProgram should report "File change detected..." when a new program is created
|
||||
|
||||
const sourceFilesCache = new Map<string, HostFileInfo>(); // Cache that stores the source file and version info
|
||||
@@ -342,7 +342,7 @@ namespace ts {
|
||||
compilerHost.getCompilationSettings = () => compilerOptions;
|
||||
compilerHost.useSourceOfProjectReferenceRedirect = maybeBind(host, host.useSourceOfProjectReferenceRedirect);
|
||||
compilerHost.watchDirectoryOfFailedLookupLocation = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.FailedLookupLocations);
|
||||
compilerHost.watchAffectingFileLocation = (file, cb) => watchFile(file, cb, PollingInterval.High, watchOptions, WatchType.PackageJson);
|
||||
compilerHost.watchAffectingFileLocation = (file, cb) => watchFile(file, cb, PollingInterval.High, watchOptions, WatchType.AffectingFileLocation);
|
||||
compilerHost.watchTypeRootsDirectory = (dir, cb, flags) => watchDirectory(dir, cb, flags, watchOptions, WatchType.TypeRoots);
|
||||
compilerHost.getCachedDirectoryStructureHost = () => cachedDirectoryStructureHost;
|
||||
compilerHost.scheduleInvalidateResolutionsOfFailedLookupLocations = scheduleInvalidateResolutionsOfFailedLookupLocations;
|
||||
@@ -367,6 +367,9 @@ namespace ts {
|
||||
compilerHost.resolveTypeReferenceDirectives = host.resolveTypeReferenceDirectives ?
|
||||
((...args) => host.resolveTypeReferenceDirectives!(...args)) :
|
||||
((typeDirectiveNames, containingFile, redirectedReference, _options, containingFileMode) => resolutionCache.resolveTypeReferenceDirectives(typeDirectiveNames, containingFile, redirectedReference, containingFileMode));
|
||||
compilerHost.getModuleResolutionCache = host.resolveModuleNames ?
|
||||
maybeBind(host, host.getModuleResolutionCache) :
|
||||
(() => resolutionCache.getModuleResolutionCache());
|
||||
const userProvidedResolution = !!host.resolveModuleNames || !!host.resolveTypeReferenceDirectives;
|
||||
|
||||
builderProgram = readBuilderProgram(compilerOptions, compilerHost) as any as T;
|
||||
@@ -435,14 +438,18 @@ namespace ts {
|
||||
const program = getCurrentBuilderProgram();
|
||||
if (hasChangedCompilerOptions) {
|
||||
newLine = updateNewLine();
|
||||
if (program && (changesAffectResolution || changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions))) {
|
||||
if (program && changesAffectModuleResolution(program.getCompilerOptions(), compilerOptions)) {
|
||||
resolutionCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
// All resolutions are invalid if user provided resolutions
|
||||
const hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution || changesAffectResolution);
|
||||
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileExists, hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
||||
const hasInvalidatedResolution = resolutionCache.createHasInvalidatedResolution(userProvidedResolution);
|
||||
const {
|
||||
originalReadFile, originalFileExists, originalDirectoryExists,
|
||||
originalCreateDirectory, originalWriteFile,
|
||||
} = changeCompilerHostLikeToUseCache(compilerHost, toPath);
|
||||
if (isProgramUptoDate(getCurrentProgram(), rootFileNames, compilerOptions, getSourceVersion, fileName => compilerHost.fileExists(fileName), hasInvalidatedResolution, hasChangedAutomaticTypeDirectiveNames, getParsedCommandLine, projectReferences)) {
|
||||
if (hasChangedConfigFileParsingErrors) {
|
||||
if (reportFileChangeDetectedOnCreateProgram) {
|
||||
reportWatchDiagnostic(Diagnostics.File_change_detected_Starting_incremental_compilation);
|
||||
@@ -458,13 +465,17 @@ namespace ts {
|
||||
createNewProgram(hasInvalidatedResolution);
|
||||
}
|
||||
|
||||
changesAffectResolution = false; // reset for next sync
|
||||
reportFileChangeDetectedOnCreateProgram = false;
|
||||
|
||||
if (host.afterProgramCreate && program !== builderProgram) {
|
||||
host.afterProgramCreate(builderProgram);
|
||||
}
|
||||
|
||||
compilerHost.readFile = originalReadFile;
|
||||
compilerHost.fileExists = originalFileExists;
|
||||
compilerHost.directoryExists = originalDirectoryExists;
|
||||
compilerHost.createDirectory = originalCreateDirectory;
|
||||
compilerHost.writeFile = originalWriteFile!;
|
||||
|
||||
return builderProgram;
|
||||
}
|
||||
|
||||
@@ -481,8 +492,9 @@ namespace ts {
|
||||
resolutionCache.startCachingPerDirectoryResolution();
|
||||
compilerHost.hasInvalidatedResolution = hasInvalidatedResolution;
|
||||
compilerHost.hasChangedAutomaticTypeDirectiveNames = hasChangedAutomaticTypeDirectiveNames;
|
||||
const oldProgram = getCurrentProgram();
|
||||
builderProgram = createProgram(rootFileNames, compilerOptions, compilerHost, builderProgram, configFileParsingDiagnostics, projectReferences);
|
||||
resolutionCache.finishCachingPerDirectoryResolution();
|
||||
resolutionCache.finishCachingPerDirectoryResolution(builderProgram.getProgram(), oldProgram);
|
||||
|
||||
// Update watches
|
||||
updateMissingFilePathsWatch(builderProgram.getProgram(), missingFilesMap || (missingFilesMap = new Map()), watchMissingFilePath);
|
||||
@@ -574,9 +586,6 @@ namespace ts {
|
||||
sourceFilesCache.set(path, false);
|
||||
}
|
||||
}
|
||||
if (sourceFile) {
|
||||
sourceFile.impliedNodeFormat = getImpliedNodeFormatForFile(path, resolutionCache.getModuleResolutionCache().getPackageJsonInfoCache(), compilerHost, compilerHost.getCompilationSettings());
|
||||
}
|
||||
return sourceFile;
|
||||
}
|
||||
return hostSourceFile.sourceFile;
|
||||
|
||||
@@ -34,9 +34,20 @@ namespace ts {
|
||||
clearCache(): void;
|
||||
}
|
||||
|
||||
type Canonicalized = string & { __canonicalized: void };
|
||||
|
||||
interface MutableFileSystemEntries {
|
||||
readonly files: string[];
|
||||
readonly directories: string[];
|
||||
sortedAndCanonicalizedFiles?: SortedArray<Canonicalized>
|
||||
sortedAndCanonicalizedDirectories?: SortedArray<Canonicalized>
|
||||
}
|
||||
|
||||
interface SortedAndCanonicalizedMutableFileSystemEntries {
|
||||
readonly files: string[];
|
||||
readonly directories: string[];
|
||||
readonly sortedAndCanonicalizedFiles: SortedArray<Canonicalized>
|
||||
readonly sortedAndCanonicalizedDirectories: SortedArray<Canonicalized>
|
||||
}
|
||||
|
||||
export function createCachedDirectoryStructureHost(host: DirectoryStructureHost, currentDirectory: string, useCaseSensitiveFileNames: boolean): CachedDirectoryStructureHost | undefined {
|
||||
@@ -45,7 +56,7 @@ namespace ts {
|
||||
}
|
||||
|
||||
const cachedReadDirectoryResult = new Map<string, MutableFileSystemEntries | false>();
|
||||
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames);
|
||||
const getCanonicalFileName = createGetCanonicalFileName(useCaseSensitiveFileNames) as ((name: string) => Canonicalized);
|
||||
return {
|
||||
useCaseSensitiveFileNames,
|
||||
fileExists,
|
||||
@@ -70,7 +81,17 @@ namespace ts {
|
||||
}
|
||||
|
||||
function getCachedFileSystemEntriesForBaseDir(path: Path) {
|
||||
return getCachedFileSystemEntries(getDirectoryPath(path));
|
||||
const entries = getCachedFileSystemEntries(getDirectoryPath(path));
|
||||
if (!entries) {
|
||||
return entries;
|
||||
}
|
||||
|
||||
// If we're looking for the base directory, we're definitely going to search the entries
|
||||
if (!entries.sortedAndCanonicalizedFiles) {
|
||||
entries.sortedAndCanonicalizedFiles = entries.files.map(getCanonicalFileName).sort() as SortedArray<Canonicalized>;
|
||||
entries.sortedAndCanonicalizedDirectories = entries.directories.map(getCanonicalFileName).sort() as SortedArray<Canonicalized>;
|
||||
}
|
||||
return entries as SortedAndCanonicalizedMutableFileSystemEntries;
|
||||
}
|
||||
|
||||
function getBaseNameOfFileName(fileName: string) {
|
||||
@@ -120,23 +141,10 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function fileNameEqual(name1: string, name2: string) {
|
||||
return getCanonicalFileName(name1) === getCanonicalFileName(name2);
|
||||
}
|
||||
|
||||
function hasEntry(entries: readonly string[], name: string) {
|
||||
return some(entries, file => fileNameEqual(file, name));
|
||||
}
|
||||
|
||||
function updateFileSystemEntry(entries: string[], baseName: string, isValid: boolean) {
|
||||
if (hasEntry(entries, baseName)) {
|
||||
if (!isValid) {
|
||||
return filterMutate(entries, entry => !fileNameEqual(entry, baseName));
|
||||
}
|
||||
}
|
||||
else if (isValid) {
|
||||
return entries.push(baseName);
|
||||
}
|
||||
function hasEntry(entries: SortedReadonlyArray<Canonicalized>, name: Canonicalized) {
|
||||
// Case-sensitive comparison since already canonicalized
|
||||
const index = binarySearch(entries, name, identity, compareStringsCaseSensitive);
|
||||
return index >= 0;
|
||||
}
|
||||
|
||||
function writeFile(fileName: string, data: string, writeByteOrderMark?: boolean): void {
|
||||
@@ -151,7 +159,7 @@ namespace ts {
|
||||
function fileExists(fileName: string): boolean {
|
||||
const path = toPath(fileName);
|
||||
const result = getCachedFileSystemEntriesForBaseDir(path);
|
||||
return result && hasEntry(result.files, getBaseNameOfFileName(fileName)) ||
|
||||
return result && hasEntry(result.sortedAndCanonicalizedFiles, getCanonicalFileName(getBaseNameOfFileName(fileName))) ||
|
||||
host.fileExists(fileName);
|
||||
}
|
||||
|
||||
@@ -163,9 +171,14 @@ namespace ts {
|
||||
function createDirectory(dirPath: string) {
|
||||
const path = toPath(dirPath);
|
||||
const result = getCachedFileSystemEntriesForBaseDir(path);
|
||||
const baseFileName = getBaseNameOfFileName(dirPath);
|
||||
if (result) {
|
||||
updateFileSystemEntry(result.directories, baseFileName, /*isValid*/ true);
|
||||
const baseName = getBaseNameOfFileName(dirPath);
|
||||
const canonicalizedBaseName = getCanonicalFileName(baseName);
|
||||
const canonicalizedDirectories = result.sortedAndCanonicalizedDirectories;
|
||||
// Case-sensitive comparison since already canonicalized
|
||||
if (insertSorted(canonicalizedDirectories, canonicalizedBaseName, compareStringsCaseSensitive)) {
|
||||
result.directories.push(baseName);
|
||||
}
|
||||
}
|
||||
host.createDirectory!(dirPath);
|
||||
}
|
||||
@@ -242,7 +255,7 @@ namespace ts {
|
||||
fileExists: host.fileExists(fileOrDirectoryPath),
|
||||
directoryExists: host.directoryExists(fileOrDirectoryPath)
|
||||
};
|
||||
if (fsQueryResult.directoryExists || hasEntry(parentResult.directories, baseName)) {
|
||||
if (fsQueryResult.directoryExists || hasEntry(parentResult.sortedAndCanonicalizedDirectories, getCanonicalFileName(baseName))) {
|
||||
// Folder added or removed, clear the cache instead of updating the folder and its structure
|
||||
clearCache();
|
||||
}
|
||||
@@ -265,8 +278,24 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function updateFilesOfFileSystemEntry(parentResult: MutableFileSystemEntries, baseName: string, fileExists: boolean) {
|
||||
updateFileSystemEntry(parentResult.files, baseName, fileExists);
|
||||
function updateFilesOfFileSystemEntry(parentResult: SortedAndCanonicalizedMutableFileSystemEntries, baseName: string, fileExists: boolean): void {
|
||||
const canonicalizedFiles = parentResult.sortedAndCanonicalizedFiles;
|
||||
const canonicalizedBaseName = getCanonicalFileName(baseName);
|
||||
if (fileExists) {
|
||||
// Case-sensitive comparison since already canonicalized
|
||||
if (insertSorted(canonicalizedFiles, canonicalizedBaseName, compareStringsCaseSensitive)) {
|
||||
parentResult.files.push(baseName);
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Case-sensitive comparison since already canonicalized
|
||||
const sortedIndex = binarySearch(canonicalizedFiles, canonicalizedBaseName, identity, compareStringsCaseSensitive);
|
||||
if (sortedIndex >= 0) {
|
||||
canonicalizedFiles.splice(sortedIndex, 1);
|
||||
const unsortedIndex = parentResult.files.findIndex(entry => getCanonicalFileName(entry) === canonicalizedBaseName);
|
||||
parentResult.files.splice(unsortedIndex, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function clearCache() {
|
||||
|
||||
@@ -1,7 +1,14 @@
|
||||
namespace ts {
|
||||
interface Statistic {
|
||||
name: string;
|
||||
value: string;
|
||||
value: number;
|
||||
type: StatisticType;
|
||||
}
|
||||
|
||||
export enum StatisticType {
|
||||
time,
|
||||
count,
|
||||
memory,
|
||||
}
|
||||
|
||||
function countLines(program: Program): Map<number> {
|
||||
@@ -14,15 +21,6 @@ namespace ts {
|
||||
return counts;
|
||||
}
|
||||
|
||||
function countNodes(program: Program): Map<number> {
|
||||
const counts = getCountsMap();
|
||||
forEach(program.getSourceFiles(), file => {
|
||||
const key = getCountKey(program, file);
|
||||
counts.set(key, counts.get(key)! + file.nodeCount);
|
||||
});
|
||||
return counts;
|
||||
}
|
||||
|
||||
function getCountsMap() {
|
||||
const counts = new Map<string, number>();
|
||||
counts.set("Library", 0);
|
||||
@@ -751,7 +749,16 @@ namespace ts {
|
||||
createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)),
|
||||
createWatchStatusReporter(sys, buildOptions)
|
||||
);
|
||||
updateSolutionBuilderHost(sys, cb, buildHost);
|
||||
const solutionPerformance = enableSolutionPerformance(sys, buildOptions);
|
||||
updateSolutionBuilderHost(sys, cb, buildHost, solutionPerformance);
|
||||
const onWatchStatusChange = buildHost.onWatchStatusChange;
|
||||
buildHost.onWatchStatusChange = (d, newLine, options, errorCount) => {
|
||||
onWatchStatusChange?.(d, newLine, options, errorCount);
|
||||
if (d.code === Diagnostics.Found_0_errors_Watching_for_file_changes.code ||
|
||||
d.code === Diagnostics.Found_1_error_Watching_for_file_changes.code) {
|
||||
reportSolutionBuilderTimes(builder, solutionPerformance);
|
||||
}
|
||||
};
|
||||
const builder = createSolutionBuilderWithWatch(buildHost, projects, buildOptions, watchOptions);
|
||||
builder.build();
|
||||
return builder;
|
||||
@@ -764,9 +771,11 @@ namespace ts {
|
||||
createBuilderStatusReporter(sys, shouldBePretty(sys, buildOptions)),
|
||||
createReportErrorSummary(sys, buildOptions)
|
||||
);
|
||||
updateSolutionBuilderHost(sys, cb, buildHost);
|
||||
const solutionPerformance = enableSolutionPerformance(sys, buildOptions);
|
||||
updateSolutionBuilderHost(sys, cb, buildHost, solutionPerformance);
|
||||
const builder = createSolutionBuilder(buildHost, projects, buildOptions);
|
||||
const exitStatus = buildOptions.clean ? builder.clean() : builder.build();
|
||||
reportSolutionBuilderTimes(builder, solutionPerformance);
|
||||
dumpTracingLegend(); // Will no-op if there hasn't been any tracing
|
||||
return sys.exit(exitStatus);
|
||||
}
|
||||
@@ -804,7 +813,7 @@ namespace ts {
|
||||
s => sys.write(s + sys.newLine),
|
||||
createReportErrorSummary(sys, options)
|
||||
);
|
||||
reportStatistics(sys, program);
|
||||
reportStatistics(sys, program, /*builder*/ undefined);
|
||||
cb(program);
|
||||
return sys.exit(exitStatus);
|
||||
}
|
||||
@@ -828,7 +837,7 @@ namespace ts {
|
||||
reportDiagnostic,
|
||||
reportErrorSummary: createReportErrorSummary(sys, options),
|
||||
afterProgramEmitAndDiagnostics: builderProgram => {
|
||||
reportStatistics(sys, builderProgram.getProgram());
|
||||
reportStatistics(sys, builderProgram.getProgram(), /*builder*/ undefined);
|
||||
cb(builderProgram);
|
||||
}
|
||||
});
|
||||
@@ -838,22 +847,23 @@ namespace ts {
|
||||
function updateSolutionBuilderHost(
|
||||
sys: System,
|
||||
cb: ExecuteCommandLineCallbacks,
|
||||
buildHost: SolutionBuilderHostBase<EmitAndSemanticDiagnosticsBuilderProgram>
|
||||
buildHost: SolutionBuilderHostBase<EmitAndSemanticDiagnosticsBuilderProgram>,
|
||||
solutionPerformance: SolutionPerformance | undefined,
|
||||
) {
|
||||
updateCreateProgram(sys, buildHost);
|
||||
updateCreateProgram(sys, buildHost, /*isBuildMode*/ true);
|
||||
buildHost.afterProgramEmitAndDiagnostics = program => {
|
||||
reportStatistics(sys, program.getProgram());
|
||||
reportStatistics(sys, program.getProgram(), solutionPerformance);
|
||||
cb(program);
|
||||
};
|
||||
buildHost.afterEmitBundle = cb;
|
||||
}
|
||||
|
||||
function updateCreateProgram<T extends BuilderProgram>(sys: System, host: { createProgram: CreateProgram<T>; }) {
|
||||
function updateCreateProgram<T extends BuilderProgram>(sys: System, host: { createProgram: CreateProgram<T>; }, isBuildMode: boolean) {
|
||||
const compileUsingBuilder = host.createProgram;
|
||||
host.createProgram = (rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences) => {
|
||||
Debug.assert(rootNames !== undefined || (options === undefined && !!oldProgram));
|
||||
if (options !== undefined) {
|
||||
enableStatisticsAndTracing(sys, options, /*isBuildMode*/ true);
|
||||
enableStatisticsAndTracing(sys, options, isBuildMode);
|
||||
}
|
||||
return compileUsingBuilder(rootNames, options, host, oldProgram, configFileParsingDiagnostics, projectReferences);
|
||||
};
|
||||
@@ -864,11 +874,11 @@ namespace ts {
|
||||
cb: ExecuteCommandLineCallbacks,
|
||||
watchCompilerHost: WatchCompilerHost<EmitAndSemanticDiagnosticsBuilderProgram>,
|
||||
) {
|
||||
updateCreateProgram(sys, watchCompilerHost);
|
||||
updateCreateProgram(sys, watchCompilerHost, /*isBuildMode*/ false);
|
||||
const emitFilesUsingBuilder = watchCompilerHost.afterProgramCreate!; // TODO: GH#18217
|
||||
watchCompilerHost.afterProgramCreate = builderProgram => {
|
||||
emitFilesUsingBuilder(builderProgram);
|
||||
reportStatistics(sys, builderProgram.getProgram());
|
||||
reportStatistics(sys, builderProgram.getProgram(), /*builder*/ undefined);
|
||||
cb(builderProgram);
|
||||
};
|
||||
}
|
||||
@@ -920,6 +930,88 @@ namespace ts {
|
||||
return createWatchProgram(watchCompilerHost);
|
||||
}
|
||||
|
||||
interface SolutionPerformance {
|
||||
addAggregateStatistic(s: Statistic): void;
|
||||
forEachAggregateStatistics(cb: (s: Statistic) => void): void;
|
||||
clear(): void;
|
||||
}
|
||||
|
||||
function enableSolutionPerformance(system: System, options: BuildOptions) {
|
||||
if (system === sys && options.extendedDiagnostics) {
|
||||
performance.enable();
|
||||
return createSolutionPerfomrance();
|
||||
}
|
||||
}
|
||||
|
||||
function createSolutionPerfomrance(): SolutionPerformance {
|
||||
let statistics: ESMap<string, Statistic> | undefined;
|
||||
return {
|
||||
addAggregateStatistic,
|
||||
forEachAggregateStatistics: forEachAggreateStatistics,
|
||||
clear,
|
||||
};
|
||||
|
||||
function addAggregateStatistic(s: Statistic) {
|
||||
const existing = statistics?.get(s.name);
|
||||
if (existing) {
|
||||
if (existing.type === StatisticType.memory) existing.value = Math.max(existing.value, s.value);
|
||||
else existing.value += s.value;
|
||||
}
|
||||
else {
|
||||
(statistics ??= new Map()).set(s.name, s);
|
||||
}
|
||||
}
|
||||
|
||||
function forEachAggreateStatistics(cb: (s: Statistic) => void) {
|
||||
statistics?.forEach(cb);
|
||||
}
|
||||
|
||||
function clear() {
|
||||
statistics = undefined;
|
||||
}
|
||||
}
|
||||
|
||||
function reportSolutionBuilderTimes(
|
||||
builder: SolutionBuilder<EmitAndSemanticDiagnosticsBuilderProgram>,
|
||||
solutionPerformance: SolutionPerformance | undefined) {
|
||||
if (!solutionPerformance) return;
|
||||
|
||||
if (!performance.isEnabled()) {
|
||||
sys.write(Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n");
|
||||
return;
|
||||
}
|
||||
|
||||
const statistics: Statistic[] = [];
|
||||
statistics.push(
|
||||
{ name: "Projects in scope", value: getBuildOrderFromAnyBuildOrder(builder.getBuildOrder()).length, type: StatisticType.count },
|
||||
);
|
||||
reportSolutionBuilderCountStatistic("SolutionBuilder::Projects built");
|
||||
reportSolutionBuilderCountStatistic("SolutionBuilder::Timestamps only updates");
|
||||
reportSolutionBuilderCountStatistic("SolutionBuilder::Bundles updated");
|
||||
solutionPerformance.forEachAggregateStatistics(s => {
|
||||
s.name = `Aggregate ${s.name}`;
|
||||
statistics.push(s);
|
||||
});
|
||||
performance.forEachMeasure((name, duration) => {
|
||||
if (isSolutionMarkOrMeasure(name)) statistics.push({ name: `${getNameFromSolutionBuilderMarkOrMeasure(name)} time`, value: duration, type: StatisticType.time });
|
||||
});
|
||||
performance.disable();
|
||||
performance.enable();
|
||||
|
||||
reportAllStatistics(sys, statistics);
|
||||
|
||||
function reportSolutionBuilderCountStatistic(name: string) {
|
||||
const value = performance.getCount(name);
|
||||
if (value) {
|
||||
statistics.push({ name: getNameFromSolutionBuilderMarkOrMeasure(name), value, type: StatisticType.count });
|
||||
}
|
||||
}
|
||||
|
||||
function getNameFromSolutionBuilderMarkOrMeasure(name: string) {
|
||||
return name.replace("SolutionBuilder::", "");
|
||||
}
|
||||
}
|
||||
|
||||
function canReportDiagnostics(system: System, compilerOptions: CompilerOptions) {
|
||||
return system === sys && (compilerOptions.diagnostics || compilerOptions.extendedDiagnostics);
|
||||
}
|
||||
@@ -939,7 +1031,11 @@ namespace ts {
|
||||
}
|
||||
}
|
||||
|
||||
function reportStatistics(sys: System, program: Program) {
|
||||
function isSolutionMarkOrMeasure(name: string) {
|
||||
return startsWith(name, "SolutionBuilder::");
|
||||
}
|
||||
|
||||
function reportStatistics(sys: System, program: Program, solutionPerformance: SolutionPerformance | undefined) {
|
||||
const compilerOptions = program.getCompilerOptions();
|
||||
|
||||
if (canTrace(sys, compilerOptions)) {
|
||||
@@ -953,18 +1049,13 @@ namespace ts {
|
||||
reportCountStatistic("Files", program.getSourceFiles().length);
|
||||
|
||||
const lineCounts = countLines(program);
|
||||
const nodeCounts = countNodes(program);
|
||||
if (compilerOptions.extendedDiagnostics) {
|
||||
for (const key of arrayFrom(lineCounts.keys())) {
|
||||
reportCountStatistic("Lines of " + key, lineCounts.get(key)!);
|
||||
}
|
||||
for (const key of arrayFrom(nodeCounts.keys())) {
|
||||
reportCountStatistic("Nodes of " + key, nodeCounts.get(key)!);
|
||||
}
|
||||
}
|
||||
else {
|
||||
reportCountStatistic("Lines", reduceLeftIterator(lineCounts.values(), (sum, count) => sum + count, 0));
|
||||
reportCountStatistic("Nodes", reduceLeftIterator(nodeCounts.values(), (sum, count) => sum + count, 0));
|
||||
}
|
||||
|
||||
reportCountStatistic("Identifiers", program.getIdentifierCount());
|
||||
@@ -973,7 +1064,7 @@ namespace ts {
|
||||
reportCountStatistic("Instantiations", program.getInstantiationCount());
|
||||
|
||||
if (memoryUsed >= 0) {
|
||||
reportStatisticalValue("Memory used", Math.round(memoryUsed / 1000) + "K");
|
||||
reportStatisticalValue({ name: "Memory used", value: memoryUsed, type: StatisticType.memory }, /*aggregate*/ true);
|
||||
}
|
||||
|
||||
const isPerformanceEnabled = performance.isEnabled();
|
||||
@@ -988,7 +1079,9 @@ namespace ts {
|
||||
reportCountStatistic("Subtype cache size", caches.subtype);
|
||||
reportCountStatistic("Strict subtype cache size", caches.strictSubtype);
|
||||
if (isPerformanceEnabled) {
|
||||
performance.forEachMeasure((name, duration) => reportTimeStatistic(`${name} time`, duration));
|
||||
performance.forEachMeasure((name, duration) => {
|
||||
if (!isSolutionMarkOrMeasure(name)) reportTimeStatistic(`${name} time`, duration, /*aggregate*/ true);
|
||||
});
|
||||
}
|
||||
}
|
||||
else if (isPerformanceEnabled) {
|
||||
@@ -996,53 +1089,79 @@ namespace ts {
|
||||
// Note: To match the behavior of previous versions of the compiler, the reported parse time includes
|
||||
// I/O read time and processing time for triple-slash references and module imports, and the reported
|
||||
// emit time includes I/O write time. We preserve this behavior so we can accurately compare times.
|
||||
reportTimeStatistic("I/O read", performance.getDuration("I/O Read"));
|
||||
reportTimeStatistic("I/O write", performance.getDuration("I/O Write"));
|
||||
reportTimeStatistic("Parse time", programTime);
|
||||
reportTimeStatistic("Bind time", bindTime);
|
||||
reportTimeStatistic("Check time", checkTime);
|
||||
reportTimeStatistic("Emit time", emitTime);
|
||||
reportTimeStatistic("I/O read", performance.getDuration("I/O Read"), /*aggregate*/ true);
|
||||
reportTimeStatistic("I/O write", performance.getDuration("I/O Write"), /*aggregate*/ true);
|
||||
reportTimeStatistic("Parse time", programTime, /*aggregate*/ true);
|
||||
reportTimeStatistic("Bind time", bindTime, /*aggregate*/ true);
|
||||
reportTimeStatistic("Check time", checkTime, /*aggregate*/ true);
|
||||
reportTimeStatistic("Emit time", emitTime, /*aggregate*/ true);
|
||||
}
|
||||
if (isPerformanceEnabled) {
|
||||
reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime);
|
||||
reportTimeStatistic("Total time", programTime + bindTime + checkTime + emitTime, /*aggregate*/ false);
|
||||
}
|
||||
reportStatistics();
|
||||
reportAllStatistics(sys, statistics);
|
||||
if (!isPerformanceEnabled) {
|
||||
sys.write(Diagnostics.Performance_timings_for_diagnostics_or_extendedDiagnostics_are_not_available_in_this_session_A_native_implementation_of_the_Web_Performance_API_could_not_be_found.message + "\n");
|
||||
}
|
||||
else {
|
||||
performance.disable();
|
||||
if (solutionPerformance) {
|
||||
// Clear selected marks and measures
|
||||
performance.forEachMeasure(name => {
|
||||
if (!isSolutionMarkOrMeasure(name)) performance.clearMeasures(name);
|
||||
});
|
||||
performance.forEachMark(name => {
|
||||
if (!isSolutionMarkOrMeasure(name)) performance.clearMarks(name);
|
||||
});
|
||||
}
|
||||
else {
|
||||
performance.disable();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function reportStatistics() {
|
||||
let nameSize = 0;
|
||||
let valueSize = 0;
|
||||
for (const { name, value } of statistics) {
|
||||
if (name.length > nameSize) {
|
||||
nameSize = name.length;
|
||||
}
|
||||
|
||||
if (value.length > valueSize) {
|
||||
valueSize = value.length;
|
||||
}
|
||||
}
|
||||
|
||||
for (const { name, value } of statistics) {
|
||||
sys.write(padRight(name + ":", nameSize + 2) + padLeft(value.toString(), valueSize) + sys.newLine);
|
||||
}
|
||||
}
|
||||
|
||||
function reportStatisticalValue(name: string, value: string) {
|
||||
statistics.push({ name, value });
|
||||
function reportStatisticalValue(s: Statistic, aggregate: boolean) {
|
||||
statistics.push(s);
|
||||
if (aggregate) solutionPerformance?.addAggregateStatistic(s);
|
||||
}
|
||||
|
||||
function reportCountStatistic(name: string, count: number) {
|
||||
reportStatisticalValue(name, "" + count);
|
||||
reportStatisticalValue({ name, value: count, type: StatisticType.count }, /*aggregate*/ true);
|
||||
}
|
||||
|
||||
function reportTimeStatistic(name: string, time: number) {
|
||||
reportStatisticalValue(name, (time / 1000).toFixed(2) + "s");
|
||||
function reportTimeStatistic(name: string, time: number, aggregate: boolean) {
|
||||
reportStatisticalValue({ name, value: time, type: StatisticType.time }, aggregate);
|
||||
}
|
||||
}
|
||||
|
||||
function reportAllStatistics(sys: System, statistics: Statistic[]) {
|
||||
let nameSize = 0;
|
||||
let valueSize = 0;
|
||||
for (const s of statistics) {
|
||||
if (s.name.length > nameSize) {
|
||||
nameSize = s.name.length;
|
||||
}
|
||||
|
||||
const value = statisticValue(s);
|
||||
if (value.length > valueSize) {
|
||||
valueSize = value.length;
|
||||
}
|
||||
}
|
||||
|
||||
for (const s of statistics) {
|
||||
sys.write(padRight(s.name + ":", nameSize + 2) + padLeft(statisticValue(s).toString(), valueSize) + sys.newLine);
|
||||
}
|
||||
}
|
||||
|
||||
function statisticValue(s: Statistic) {
|
||||
switch (s.type) {
|
||||
case StatisticType.count:
|
||||
return "" + s.value;
|
||||
case StatisticType.time:
|
||||
return (s.value / 1000).toFixed(2) + "s";
|
||||
case StatisticType.memory:
|
||||
return Math.round(s.value / 1000) + "K";
|
||||
default:
|
||||
Debug.assertNever(s.type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -876,6 +876,10 @@ namespace ts.server {
|
||||
throw new Error("Program objects are not serializable through the server protocol.");
|
||||
}
|
||||
|
||||
getCurrentProgram(): Program | undefined {
|
||||
throw new Error("Program objects are not serializable through the server protocol.");
|
||||
}
|
||||
|
||||
getAutoImportProvider(): Program | undefined {
|
||||
throw new Error("Program objects are not serializable through the server protocol.");
|
||||
}
|
||||
|
||||
@@ -506,7 +506,8 @@ ${indentText}${text}`;
|
||||
sys.readFile = (path, encoding) => {
|
||||
const value = originalReadFile.call(sys, path, encoding);
|
||||
if (!value || !ts.isBuildInfoFile(path)) return value;
|
||||
const buildInfo = ts.getBuildInfo(value);
|
||||
const buildInfo = ts.getBuildInfo(path, value);
|
||||
if (!buildInfo) return value;
|
||||
ts.Debug.assert(buildInfo.version === version);
|
||||
buildInfo.version = ts.version;
|
||||
return ts.getBuildInfoText(buildInfo);
|
||||
@@ -519,10 +520,14 @@ ${indentText}${text}`;
|
||||
sys.write = msg => originalWrite.call(sys, msg.replace(ts.version, version));
|
||||
const originalWriteFile = sys.writeFile;
|
||||
sys.writeFile = (fileName: string, content: string, writeByteOrderMark: boolean) => {
|
||||
if (!ts.isBuildInfoFile(fileName)) return originalWriteFile.call(sys, fileName, content, writeByteOrderMark);
|
||||
const buildInfo = ts.getBuildInfo(content);
|
||||
buildInfo.version = version;
|
||||
originalWriteFile.call(sys, fileName, ts.getBuildInfoText(buildInfo), writeByteOrderMark);
|
||||
if (ts.isBuildInfoFile(fileName)) {
|
||||
const buildInfo = ts.getBuildInfo(fileName, content);
|
||||
if (buildInfo) {
|
||||
buildInfo.version = version;
|
||||
return originalWriteFile.call(sys, fileName, ts.getBuildInfoText(buildInfo), writeByteOrderMark);
|
||||
}
|
||||
}
|
||||
return originalWriteFile.call(sys, fileName, content, writeByteOrderMark);
|
||||
};
|
||||
return sys;
|
||||
}
|
||||
|
||||
@@ -2256,7 +2256,7 @@ namespace FourSlash {
|
||||
this.languageServiceAdapterHost,
|
||||
this.languageService.getProgram()?.getCompilerOptions() || {}
|
||||
),
|
||||
setExternalModuleIndicator: ts.getSetExternalModuleIndicator(this.languageService.getProgram()?.getCompilerOptions() || {})
|
||||
setExternalModuleIndicator: ts.getSetExternalModuleIndicator(this.languageService.getProgram()?.getCompilerOptions() || {}),
|
||||
};
|
||||
const referenceSourceFile = ts.createLanguageServiceSourceFile(
|
||||
this.activeFile.fileName, createScriptSnapShot(content), options, /*version:*/ "0", /*setNodeParents:*/ false);
|
||||
@@ -2749,6 +2749,13 @@ namespace FourSlash {
|
||||
// fs.writeFileSync(testfilePath, newfile);
|
||||
}
|
||||
|
||||
public verifyEncodedSyntacticClassificationsLength(expected: number) {
|
||||
const actual = this.languageService.getEncodedSyntacticClassifications(this.activeFile.fileName, ts.createTextSpan(0, this.activeFile.content.length));
|
||||
if (actual.spans.length !== expected) {
|
||||
this.raiseError(`encodedSyntacticClassificationsLength failed - expected total spans to be ${expected} got ${actual.spans.length}`);
|
||||
}
|
||||
}
|
||||
|
||||
public verifyEncodedSemanticClassificationsLength(format: ts.SemanticClassificationFormat, expected: number) {
|
||||
const actual = this.languageService.getEncodedSemanticClassifications(this.activeFile.fileName, ts.createTextSpan(0, this.activeFile.content.length), format);
|
||||
if (actual.spans.length !== expected) {
|
||||
|
||||
@@ -541,6 +541,10 @@ namespace FourSlashInterface {
|
||||
this.state.verifySyntacticClassifications(classifications);
|
||||
}
|
||||
|
||||
public encodedSyntacticClassificationsLength(length: number) {
|
||||
this.state.verifyEncodedSyntacticClassificationsLength(length);
|
||||
}
|
||||
|
||||
public encodedSemanticClassificationsLength(format: ts.SemanticClassificationFormat, length: number) {
|
||||
this.state.verifyEncodedSemanticClassificationsLength(format, length);
|
||||
}
|
||||
|
||||
@@ -627,6 +627,9 @@ namespace Harness.LanguageService {
|
||||
getProgram(): ts.Program {
|
||||
throw new Error("Program can not be marshaled across the shim layer.");
|
||||
}
|
||||
getCurrentProgram(): ts.Program | undefined {
|
||||
throw new Error("Program can not be marshaled across the shim layer.");
|
||||
}
|
||||
getAutoImportProvider(): ts.Program | undefined {
|
||||
throw new Error("Program can not be marshaled across the shim layer.");
|
||||
}
|
||||
|
||||
@@ -116,7 +116,14 @@ interface Array<T> { length: number; [n: number]: T; }`
|
||||
|
||||
function createWatcher<T>(map: MultiMap<Path, T>, path: Path, callback: T): FileWatcher {
|
||||
map.add(path, callback);
|
||||
return { close: () => map.remove(path, callback) };
|
||||
let closed = false;
|
||||
return {
|
||||
close: () => {
|
||||
Debug.assert(!closed);
|
||||
map.remove(path, callback);
|
||||
closed = true;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
export function getDiffInKeys<T>(map: ESMap<string, T>, expectedKeys: readonly string[]) {
|
||||
|
||||
Vendored
+2
-2
@@ -13828,11 +13828,11 @@ declare var SubmitEvent: {
|
||||
* Available only in secure contexts.
|
||||
*/
|
||||
interface SubtleCrypto {
|
||||
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
|
||||
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
||||
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
|
||||
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
||||
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
||||
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
|
||||
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
||||
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
||||
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
||||
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
||||
|
||||
Vendored
+62
-1
@@ -1,16 +1,36 @@
|
||||
interface Map<K, V> {
|
||||
|
||||
clear(): void;
|
||||
/**
|
||||
* @returns true if an element in the Map existed and has been removed, or false if the element does not exist.
|
||||
*/
|
||||
delete(key: K): boolean;
|
||||
/**
|
||||
* Executes a provided function once per each key/value pair in the Map, in insertion order.
|
||||
*/
|
||||
forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void;
|
||||
/**
|
||||
* Returns a specified element from the Map object. If the value that is associated to the provided key is an object, then you will get a reference to that object and any change made to that object will effectively modify it inside the Map.
|
||||
* @returns Returns the element associated with the specified key. If no element is associated with the specified key, undefined is returned.
|
||||
*/
|
||||
get(key: K): V | undefined;
|
||||
/**
|
||||
* @returns boolean indicating whether an element with the specified key exists or not.
|
||||
*/
|
||||
has(key: K): boolean;
|
||||
/**
|
||||
* Adds a new element with a specified key and value to the Map. If an element with the same key already exists, the element will be updated.
|
||||
*/
|
||||
set(key: K, value: V): this;
|
||||
/**
|
||||
* @returns the number of elements in the Map.
|
||||
*/
|
||||
readonly size: number;
|
||||
}
|
||||
|
||||
interface MapConstructor {
|
||||
new(): Map<any, any>;
|
||||
new<K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
|
||||
new <K, V>(entries?: readonly (readonly [K, V])[] | null): Map<K, V>;
|
||||
readonly prototype: Map<any, any>;
|
||||
}
|
||||
declare var Map: MapConstructor;
|
||||
@@ -23,9 +43,23 @@ interface ReadonlyMap<K, V> {
|
||||
}
|
||||
|
||||
interface WeakMap<K extends object, V> {
|
||||
/**
|
||||
* Removes the specified element from the WeakMap.
|
||||
* @returns true if the element was successfully removed, or false if it was not present.
|
||||
*/
|
||||
delete(key: K): boolean;
|
||||
/**
|
||||
* @returns a specified element.
|
||||
*/
|
||||
get(key: K): V | undefined;
|
||||
/**
|
||||
* @returns a boolean indicating whether an element with the specified key exists or not.
|
||||
*/
|
||||
has(key: K): boolean;
|
||||
/**
|
||||
* Adds a new element with a specified key and value.
|
||||
* @param key Must be an object.
|
||||
*/
|
||||
set(key: K, value: V): this;
|
||||
}
|
||||
|
||||
@@ -36,11 +70,28 @@ interface WeakMapConstructor {
|
||||
declare var WeakMap: WeakMapConstructor;
|
||||
|
||||
interface Set<T> {
|
||||
/**
|
||||
* Appends a new element with a specified value to the end of the Set.
|
||||
*/
|
||||
add(value: T): this;
|
||||
|
||||
clear(): void;
|
||||
/**
|
||||
* Removes a specified value from the Set.
|
||||
* @returns Returns true if an element in the Set existed and has been removed, or false if the element does not exist.
|
||||
*/
|
||||
delete(value: T): boolean;
|
||||
/**
|
||||
* Executes a provided function once per each value in the Set object, in insertion order.
|
||||
*/
|
||||
forEach(callbackfn: (value: T, value2: T, set: Set<T>) => void, thisArg?: any): void;
|
||||
/**
|
||||
* @returns a boolean indicating whether an element with the specified value exists in the Set or not.
|
||||
*/
|
||||
has(value: T): boolean;
|
||||
/**
|
||||
* @returns the number of (unique) elements in Set.
|
||||
*/
|
||||
readonly size: number;
|
||||
}
|
||||
|
||||
@@ -57,8 +108,18 @@ interface ReadonlySet<T> {
|
||||
}
|
||||
|
||||
interface WeakSet<T extends object> {
|
||||
/**
|
||||
* Appends a new object to the end of the WeakSet.
|
||||
*/
|
||||
add(value: T): this;
|
||||
/**
|
||||
* Removes the specified element from the WeakSet.
|
||||
* @returns Returns true if the element existed and has been removed, or false if the element does not exist.
|
||||
*/
|
||||
delete(value: T): boolean;
|
||||
/**
|
||||
* @returns a boolean indicating whether an object exists in the WeakSet or not.
|
||||
*/
|
||||
has(value: T): boolean;
|
||||
}
|
||||
|
||||
|
||||
Vendored
+9
-4
@@ -21,7 +21,7 @@ interface PromiseConstructor {
|
||||
all<T extends readonly unknown[] | []>(values: T): Promise<{ -readonly [P in keyof T]: Awaited<T[P]> }>;
|
||||
|
||||
// see: lib.es2015.iterable.d.ts
|
||||
// all<T>(values: Iterable<T | PromiseLike<T>>): Promise<T[]>;
|
||||
// all<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>[]>;
|
||||
|
||||
/**
|
||||
* Creates a Promise that is resolved or rejected when any of the provided Promises are resolved
|
||||
@@ -32,7 +32,7 @@ interface PromiseConstructor {
|
||||
race<T extends readonly unknown[] | []>(values: T): Promise<Awaited<T[number]>>;
|
||||
|
||||
// see: lib.es2015.iterable.d.ts
|
||||
// race<T>(values: Iterable<T>): Promise<T extends PromiseLike<infer U> ? U : T>;
|
||||
// race<T>(values: Iterable<T | PromiseLike<T>>): Promise<Awaited<T>>;
|
||||
|
||||
/**
|
||||
* Creates a new rejected promise for the provided reason.
|
||||
@@ -46,13 +46,18 @@ interface PromiseConstructor {
|
||||
* @returns A resolved promise.
|
||||
*/
|
||||
resolve(): Promise<void>;
|
||||
|
||||
/**
|
||||
* Creates a new resolved promise for the provided value.
|
||||
* @param value A promise.
|
||||
* @returns A promise whose internal state matches the provided promise.
|
||||
*/
|
||||
resolve<T>(value: T | PromiseLike<T>): Promise<T>;
|
||||
resolve<T>(value: T): Promise<Awaited<T>>;
|
||||
/**
|
||||
* Creates a new resolved promise for the provided value.
|
||||
* @param value A promise.
|
||||
* @returns A promise whose internal state matches the provided promise.
|
||||
*/
|
||||
resolve<T>(value: T | PromiseLike<T>): Promise<Awaited<T>>;
|
||||
}
|
||||
|
||||
declare var Promise: PromiseConstructor;
|
||||
|
||||
Vendored
+91
-2
@@ -1,21 +1,110 @@
|
||||
interface ProxyHandler<T extends object> {
|
||||
/**
|
||||
* A trap method for a function call.
|
||||
* @param target The original callable object which is being proxied.
|
||||
*/
|
||||
apply?(target: T, thisArg: any, argArray: any[]): any;
|
||||
|
||||
/**
|
||||
* A trap for the `new` operator.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param newTarget The constructor that was originally called.
|
||||
*/
|
||||
construct?(target: T, argArray: any[], newTarget: Function): object;
|
||||
defineProperty?(target: T, p: string | symbol, attributes: PropertyDescriptor): boolean;
|
||||
|
||||
/**
|
||||
* A trap for `Object.defineProperty()`.
|
||||
* @param target The original object which is being proxied.
|
||||
* @returns A `Boolean` indicating whether or not the property has been defined.
|
||||
*/
|
||||
defineProperty?(target: T, property: string | symbol, attributes: PropertyDescriptor): boolean;
|
||||
|
||||
/**
|
||||
* A trap for the `delete` operator.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param p The name or `Symbol` of the property to delete.
|
||||
* @returns A `Boolean` indicating whether or not the property was deleted.
|
||||
*/
|
||||
deleteProperty?(target: T, p: string | symbol): boolean;
|
||||
|
||||
/**
|
||||
* A trap for getting a property value.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param p The name or `Symbol` of the property to get.
|
||||
* @param receiver The proxy or an object that inherits from the proxy.
|
||||
*/
|
||||
get?(target: T, p: string | symbol, receiver: any): any;
|
||||
|
||||
/**
|
||||
* A trap for `Object.getOwnPropertyDescriptor()`.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param p The name of the property whose description should be retrieved.
|
||||
*/
|
||||
getOwnPropertyDescriptor?(target: T, p: string | symbol): PropertyDescriptor | undefined;
|
||||
|
||||
/**
|
||||
* A trap for the `[[GetPrototypeOf]]` internal method.
|
||||
* @param target The original object which is being proxied.
|
||||
*/
|
||||
getPrototypeOf?(target: T): object | null;
|
||||
|
||||
/**
|
||||
* A trap for the `in` operator.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param p The name or `Symbol` of the property to check for existence.
|
||||
*/
|
||||
has?(target: T, p: string | symbol): boolean;
|
||||
|
||||
/**
|
||||
* A trap for `Object.isExtensible()`.
|
||||
* @param target The original object which is being proxied.
|
||||
*/
|
||||
isExtensible?(target: T): boolean;
|
||||
|
||||
/**
|
||||
* A trap for `Reflect.ownKeys()`.
|
||||
* @param target The original object which is being proxied.
|
||||
*/
|
||||
ownKeys?(target: T): ArrayLike<string | symbol>;
|
||||
|
||||
/**
|
||||
* A trap for `Object.preventExtensions()`.
|
||||
* @param target The original object which is being proxied.
|
||||
*/
|
||||
preventExtensions?(target: T): boolean;
|
||||
set?(target: T, p: string | symbol, value: any, receiver: any): boolean;
|
||||
|
||||
/**
|
||||
* A trap for setting a property value.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param p The name or `Symbol` of the property to set.
|
||||
* @param receiver The object to which the assignment was originally directed.
|
||||
* @returns `A `Boolean` indicating whether or not the property was set.
|
||||
*/
|
||||
set?(target: T, p: string | symbol, newValue: any, receiver: any): boolean;
|
||||
|
||||
/**
|
||||
* A trap for `Object.setPrototypeOf()`.
|
||||
* @param target The original object which is being proxied.
|
||||
* @param newPrototype The object's new prototype or `null`.
|
||||
*/
|
||||
setPrototypeOf?(target: T, v: object | null): boolean;
|
||||
}
|
||||
|
||||
interface ProxyConstructor {
|
||||
/**
|
||||
* Creates a revocable Proxy object.
|
||||
* @param target A target object to wrap with Proxy.
|
||||
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
|
||||
*/
|
||||
revocable<T extends object>(target: T, handler: ProxyHandler<T>): { proxy: T; revoke: () => void; };
|
||||
|
||||
/**
|
||||
* Creates a Proxy object. The Proxy object allows you to create an object that can be used in place of the
|
||||
* original object, but which may redefine fundamental Object operations like getting, setting, and defining
|
||||
* properties. Proxy objects are commonly used to log property accesses, validate, format, or sanitize inputs.
|
||||
* @param target A target object to wrap with Proxy.
|
||||
* @param handler An object whose properties define the behavior of Proxy when an operation is attempted on it.
|
||||
*/
|
||||
new <T extends object>(target: T, handler: ProxyHandler<T>): T;
|
||||
}
|
||||
declare var Proxy: ProxyConstructor;
|
||||
|
||||
Vendored
+25
-2
@@ -6,6 +6,11 @@ declare namespace Reflect {
|
||||
* @param thisArgument The object to be used as the this object.
|
||||
* @param argumentsList An array of argument values to be passed to the function.
|
||||
*/
|
||||
function apply<T, A extends readonly any[], R>(
|
||||
target: (this: T, ...args: A) => R,
|
||||
thisArgument: T,
|
||||
argumentsList: Readonly<A>,
|
||||
): R;
|
||||
function apply(target: Function, thisArgument: any, argumentsList: ArrayLike<any>): any;
|
||||
|
||||
/**
|
||||
@@ -15,6 +20,11 @@ declare namespace Reflect {
|
||||
* @param argumentsList An array of argument values to be passed to the constructor.
|
||||
* @param newTarget The constructor to be used as the `new.target` object.
|
||||
*/
|
||||
function construct<A extends readonly any[], R>(
|
||||
target: new (...args: A) => R,
|
||||
argumentsList: Readonly<A>,
|
||||
newTarget?: new (...args: any) => any,
|
||||
): R;
|
||||
function construct(target: Function, argumentsList: ArrayLike<any>, newTarget?: Function): any;
|
||||
|
||||
/**
|
||||
@@ -41,7 +51,11 @@ declare namespace Reflect {
|
||||
* @param receiver The reference to use as the `this` value in the getter function,
|
||||
* if `target[propertyKey]` is an accessor property.
|
||||
*/
|
||||
function get(target: object, propertyKey: PropertyKey, receiver?: any): any;
|
||||
function get<T extends object, P extends PropertyKey>(
|
||||
target: T,
|
||||
propertyKey: P,
|
||||
receiver?: unknown,
|
||||
): P extends keyof T ? T[P] : any;
|
||||
|
||||
/**
|
||||
* Gets the own property descriptor of the specified object.
|
||||
@@ -49,7 +63,10 @@ declare namespace Reflect {
|
||||
* @param target Object that contains the property.
|
||||
* @param propertyKey The property name.
|
||||
*/
|
||||
function getOwnPropertyDescriptor(target: object, propertyKey: PropertyKey): PropertyDescriptor | undefined;
|
||||
function getOwnPropertyDescriptor<T extends object, P extends PropertyKey>(
|
||||
target: T,
|
||||
propertyKey: P,
|
||||
): TypedPropertyDescriptor<P extends keyof T ? T[P] : any> | undefined;
|
||||
|
||||
/**
|
||||
* Returns the prototype of an object.
|
||||
@@ -91,6 +108,12 @@ declare namespace Reflect {
|
||||
* @param receiver The reference to use as the `this` value in the setter function,
|
||||
* if `target[propertyKey]` is an accessor property.
|
||||
*/
|
||||
function set<T extends object, P extends PropertyKey>(
|
||||
target: T,
|
||||
propertyKey: P,
|
||||
value: P extends keyof T ? T[P] : any,
|
||||
receiver?: any,
|
||||
): boolean;
|
||||
function set(target: object, propertyKey: PropertyKey, value: any, receiver?: any): boolean;
|
||||
|
||||
/**
|
||||
|
||||
Vendored
+1
-1
@@ -83,7 +83,7 @@ declare namespace Intl {
|
||||
*
|
||||
* [MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl#locales_argument).
|
||||
*/
|
||||
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
|
||||
type LocalesArgument = UnicodeBCP47LocaleIdentifier | Locale | readonly (UnicodeBCP47LocaleIdentifier | Locale)[] | undefined;
|
||||
|
||||
/**
|
||||
* An object with some or all of properties of `options` parameter
|
||||
|
||||
Vendored
+2
-2
@@ -1,9 +1,9 @@
|
||||
interface ErrorOptions {
|
||||
cause?: Error;
|
||||
cause?: unknown;
|
||||
}
|
||||
|
||||
interface Error {
|
||||
cause?: Error;
|
||||
cause?: unknown;
|
||||
}
|
||||
|
||||
interface ErrorConstructor {
|
||||
|
||||
Vendored
+19
-11
@@ -194,12 +194,6 @@ interface ObjectConstructor {
|
||||
*/
|
||||
seal<T>(o: T): T;
|
||||
|
||||
/**
|
||||
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
|
||||
* @param a Object on which to lock the attributes.
|
||||
*/
|
||||
freeze<T>(a: T[]): readonly T[];
|
||||
|
||||
/**
|
||||
* Prevents the modification of existing property attributes and values, and prevents the addition of new properties.
|
||||
* @param f Object on which to lock the attributes.
|
||||
@@ -888,7 +882,17 @@ interface Date {
|
||||
interface DateConstructor {
|
||||
new(): Date;
|
||||
new(value: number | string): Date;
|
||||
new(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
|
||||
/**
|
||||
* Creates a new Date.
|
||||
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
|
||||
* @param monthIndex The month as a number between 0 and 11 (January to December).
|
||||
* @param date The date as a number between 1 and 31.
|
||||
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
|
||||
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
|
||||
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
|
||||
* @param ms A number from 0 to 999 that specifies the milliseconds.
|
||||
*/
|
||||
new(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): Date;
|
||||
(): string;
|
||||
readonly prototype: Date;
|
||||
/**
|
||||
@@ -899,14 +903,14 @@ interface DateConstructor {
|
||||
/**
|
||||
* Returns the number of milliseconds between midnight, January 1, 1970 Universal Coordinated Time (UTC) (or GMT) and the specified date.
|
||||
* @param year The full year designation is required for cross-century date accuracy. If year is between 0 and 99 is used, then year is assumed to be 1900 + year.
|
||||
* @param month The month as a number between 0 and 11 (January to December).
|
||||
* @param monthIndex The month as a number between 0 and 11 (January to December).
|
||||
* @param date The date as a number between 1 and 31.
|
||||
* @param hours Must be supplied if minutes is supplied. A number from 0 to 23 (midnight to 11pm) that specifies the hour.
|
||||
* @param minutes Must be supplied if seconds is supplied. A number from 0 to 59 that specifies the minutes.
|
||||
* @param seconds Must be supplied if milliseconds is supplied. A number from 0 to 59 that specifies the seconds.
|
||||
* @param ms A number from 0 to 999 that specifies the milliseconds.
|
||||
*/
|
||||
UTC(year: number, month: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
|
||||
UTC(year: number, monthIndex: number, date?: number, hours?: number, minutes?: number, seconds?: number, ms?: number): number;
|
||||
now(): number;
|
||||
}
|
||||
|
||||
@@ -921,6 +925,10 @@ interface RegExpMatchArray extends Array<string> {
|
||||
* A copy of the search string.
|
||||
*/
|
||||
input?: string;
|
||||
/**
|
||||
* The first match. This will always be present because `null` will be returned if there are no matches.
|
||||
*/
|
||||
0: string;
|
||||
}
|
||||
|
||||
interface RegExpExecArray extends Array<string> {
|
||||
@@ -1512,8 +1520,8 @@ interface Promise<T> {
|
||||
*/
|
||||
type Awaited<T> =
|
||||
T extends null | undefined ? T : // special case for `null | undefined` when not in `--strictNullChecks` mode
|
||||
T extends object & { then(onfulfilled: infer F): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
|
||||
F extends ((value: infer V, ...args: any) => any) ? // if the argument to `then` is callable, extracts the first argument
|
||||
T extends object & { then(onfulfilled: infer F, ...args: infer _): any } ? // `await` only unwraps object types with a callable `then`. Non-object types are not unwrapped
|
||||
F extends ((value: infer V, ...args: infer _) => any) ? // if the argument to `then` is callable, extracts the first argument
|
||||
Awaited<V> : // recursively unwrap the value
|
||||
never : // the argument to `then` was not callable
|
||||
T; // non-object or non-thenable
|
||||
|
||||
Vendored
+2
-2
@@ -2988,11 +2988,11 @@ declare var StorageManager: {
|
||||
* Available only in secure contexts.
|
||||
*/
|
||||
interface SubtleCrypto {
|
||||
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
|
||||
decrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
||||
deriveBits(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, length: number): Promise<ArrayBuffer>;
|
||||
deriveKey(algorithm: AlgorithmIdentifier | EcdhKeyDeriveParams | HkdfParams | Pbkdf2Params, baseKey: CryptoKey, derivedKeyType: AlgorithmIdentifier | AesDerivedKeyParams | HmacImportParams | HkdfParams | Pbkdf2Params, extractable: boolean, keyUsages: KeyUsage[]): Promise<CryptoKey>;
|
||||
digest(algorithm: AlgorithmIdentifier, data: BufferSource): Promise<ArrayBuffer>;
|
||||
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<any>;
|
||||
encrypt(algorithm: AlgorithmIdentifier | RsaOaepParams | AesCtrParams | AesCbcParams | AesGcmParams, key: CryptoKey, data: BufferSource): Promise<ArrayBuffer>;
|
||||
exportKey(format: "jwk", key: CryptoKey): Promise<JsonWebKey>;
|
||||
exportKey(format: Exclude<KeyFormat, "jwk">, key: CryptoKey): Promise<ArrayBuffer>;
|
||||
generateKey(algorithm: RsaHashedKeyGenParams | EcKeyGenParams, extractable: boolean, keyUsages: ReadonlyArray<KeyUsage>): Promise<CryptoKeyPair>;
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A bigint literal cannot use exponential notation.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[bigint 文本不能使用指数符号。]]></Val>
|
||||
<Val><![CDATA[BigInt 字面量中不能使用指数符号。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -70,7 +70,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A bigint literal must be an integer.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[bigint 文本必须是整数。]]></Val>
|
||||
<Val><![CDATA[BigInt 字面量必须是整数。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -217,7 +217,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A 'const' assertions can only be applied to references to enum members, or string, number, boolean, array, or object literals.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["const" 断言只能用于引用枚举成员、字符串、数字、布尔值、数组或对象文本。]]></Val>
|
||||
<Val><![CDATA['const' 断言只能作用于枚举成员、字符串、数字、布尔值、数组或对象字面量。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -388,7 +388,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A function that is called with the 'new' keyword cannot have a 'this' type that is 'void'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[使用 "new" 关键字调用的函数不可具有“失效”的 "this" 类型。]]></Val>
|
||||
<Val><![CDATA[使用 'new' 关键字调用的函数的 'this' 类型不能为 'void'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -568,7 +568,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A non-dry build would update output of project '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[非干燥生成将更新项目 "{0}" 的输出]]></Val>
|
||||
<Val><![CDATA[非 dry 生成将更新项目 '{0}' 的输出]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -577,7 +577,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A non-dry build would update timestamps for output of project '{0}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[非干燥生成将更新项目 "{0}" 的输出的时间戳]]></Val>
|
||||
<Val><![CDATA[非 dry 生成将更新项目 '{0}' 的输出的时间戳]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -622,7 +622,7 @@
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A promise must have a 'then' method.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[承诺必须具有 "then" 方法。]]></Val>
|
||||
<Val><![CDATA['Promise' 必须具有 'then' 方法。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -900,6 +900,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[不能使用负值为元组类型编制索引。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2112,6 +2121,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[实例化表达式不能后跟属性访问。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6516,6 +6534,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[文件是 CommonJS 模块,因为“{0}”没有字段 “type”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[文件是 CommonJS 模块,因为“{0}”具有值不是 “module” 的字段 “type”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[文件是 CommonJS 模块,因为找不到 “package.json”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[文件是 ECMAScript 模块,因为“{0}”具有值为 “module” 的字段 “type”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7194,6 +7248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[应为标识符或字符串字面量。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8498,10 +8561,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[无法使用此构造导入模块 '{0}'。说明符仅解析为无法同步导入的 ES 模块。请改用动态导入。]]></Val>
|
||||
<Val><![CDATA[无法使用此构造导入模块“{0}”。说明符仅解析为 ES 模块,后者不能使用“require”进行导入。请改用 ECMAScript 导入。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10173,6 +10239,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[项目“{0}”已过期,因为读取文件“{1}”时出错]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12777,6 +12852,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[当前文件是 CommonJS 模块,其导入将生成“require”调用;但是,引用的文件是 ECMAScript 模块,它不能使用“require”进行导入。请考虑改为编写动态“import("{0}")”调用。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13749,11 +13833,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[此模块是使用 "export =" 声明的,只能在使用 "{0}" 标志时进行默认导入。]]></Val>
|
||||
<Val><![CDATA[此模块是使用 “export =” 声明的,只能在使用“{0}”标志时用于默认导入。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13866,6 +13950,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要将此文件转换为 ECMAScript 模块,请将字段“"type": "module"”添加到“{0}”。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要将此文件转换为 ECMAScript 模块,请将其文件扩展名更改为“{0}”,或将字段“"type": "module"”添加到“{1}”。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要将此文件转换为 ECMAScript 模块,请将其文件扩展名更改为“{0}”,或者使用“{ "type": "module" }”创建本地 package.json 文件。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要将此文件转换为 ECMAScript 模块,请使用“{ "type": "module" }”创建本地 package.json 文件。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14451,6 +14571,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[实例成员变量“{0}”的类型不能引用构造函数中声明的标识符“{1}”。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -900,6 +900,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[元組類型無法以負值編製索引。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2112,6 +2121,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[具現化運算式後面不能接著屬性存取。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6516,6 +6534,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[檔案是 CommonJS 模組,因為 '{0}' 沒有 "type" 欄位]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[檔案是 CommonJS 模組,因為 '{0}' 具有值不是 "module" 的 "type" 欄位]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[檔案是 CommonJS 模組,因為找不到 'package.json']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[檔案是 ECMAScript 模組,因為 '{0}' 具有值不是 "module" 的 "type" 欄位]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7194,6 +7248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[需要識別碼或字串常值。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8498,10 +8561,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[無法使用此構造匯入模組 '{0}'。指定名稱只能解析成無法同步匯入的 ES 模組。請改為使用動態匯入。]]></Val>
|
||||
<Val><![CDATA[無法使用此建構匯入模組 '{0}'。指定名稱只能解析成無法以 'require' 匯入的 ES 模組。請改為使用 ECMAScript 匯入。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10173,6 +10239,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[專案 '{0}' 已過期,因為讀取檔案 '{1}' 時發生錯誤]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12777,6 +12852,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[目前的檔案是 CommonJS 模組,其匯入將會產生 'require' 呼叫;不過,參考的檔案是 ECMAScript 模組,無法以 'require' 匯入。請考慮改為撰寫動態 'import("{0}")' 呼叫。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13749,9 +13833,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[此模組使用 'export =' 宣告,只能在使用 '{0}' 旗標時搭配預設匯入使用。]]></Val>
|
||||
</Tgt>
|
||||
@@ -13866,6 +13950,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要將此檔案轉換為 ECMAScript 模組,請將欄位 `{ "type": "module" }` 新增至 '{0}'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要將此檔案轉換為 ECMAScript 模組,請將其副檔名變更為 '{0}',或將欄位 `"type": "module"` 新增至 '{1}'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要將此檔案轉換為 ECMAScript 模組,請將其副檔名變更為 '{0}',或使用 `{ "type": "module" }` 建立本機 package.json 檔案。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[若要將此檔案轉換為 ECMAScript 模組,請建立具有 `{ "type": "module" }` 的本機 package.json 檔案。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14451,6 +14571,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[執行個體成員變數 '{0}' 的類型不得參考建構函式中所宣告的識別碼 '{1}'。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -909,6 +909,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Typ řazené kolekce členů není možné indexovat zápornou hodnotou.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2121,6 +2130,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Po výrazu vytvoření instance nemůže následovat přístup k vlastnosti.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6525,6 +6543,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Soubor je modul CommonJS, protože {0} nemá pole type]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Soubor je modul CommonJS, protože {0} má pole type, jehož hodnota není module]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Soubor je modul CommonJS, protože se nenašel package.json]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Soubor je modul ECMAScript, protože {0} má pole type s hodnotou module]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7203,6 +7257,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Očekává se identifikátor nebo řetězcový literál.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8507,10 +8570,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Modul {0} nejde importovat pomocí této konstrukce. Specifikátor se převede jenom na modul ES, který se nedá importovat synchronně. Místo toho použijte dynamický import.]]></Val>
|
||||
<Val><![CDATA[Modul {0} nejde importovat pomocí této konstrukce. Specifikátor se převede jenom na modul ES, který se nedá importovat s příkazem require. Místo toho použijte import ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10182,6 +10248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Projekt {0} je zastaralý, protože při čtení souboru {1} došlo k chybě.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12786,6 +12861,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aktuální soubor je modul CommonJS, jehož importy vytvoří volání require. Odkazovaný soubor je však modul ECMAScript a nelze ho importovat pomocí příkazu require. Raději zvažte vytvoření dynamického volání import("{0}").]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13758,11 +13842,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Tento modul se deklaroval pomocí export =, a když se používá příznak {0}, dá se použít jen s výchozím importem.]]></Val>
|
||||
<Val><![CDATA[Tento modul se deklaroval pomocí export =, a dá se použít jenom s výchozím importem při použití příznaku {0}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13875,6 +13959,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pokud chcete tento soubor převést na modul ECMAScript, přidejte pole "type": "module" do {0}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pokud chcete tento soubor převést na modul ECMAScript, změňte jeho příponu na {0}" nebo přidejte pole "type": "module" do {1}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pokud chcete tento soubor převést na modul ECMAScript, změňte jeho příponu na {0} nebo vytvořte místní soubor package.json s {"type": "module"}.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pokud chcete tento soubor převést na modul ECMAScript, vytvořte místní soubor package.json s { "type": "module" }.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14460,6 +14580,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Typ instance členské proměnné {0} nemůže odkazovat na identifikátor {1} deklarovaný v konstruktoru.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -897,6 +897,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ein Tupeltyp kann nicht mit einem negativen Wert indiziert werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2109,6 +2118,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Auf einen Instanziierungsausdruck kann kein Eigenschaftenzugriff folgen.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6513,6 +6531,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Datei ist ein CommonJS-Modul, da '{0}' nicht das Feld „Typ“ aufweist]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Datei ist ein CommonJS-Modul, da '{0}' das Feld „Typ“ aufweist, dessen Wert nicht „Modul“ ist]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Datei ist ein CommonJS-Modul, da „package.json“ nicht gefunden wurde]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die Datei ist ein ECMAScript-Modul, da '{0}' das Feld „Typ“ mit dem Wert „Modul“ aufweist.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7191,6 +7245,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bezeichner oder Zeichenfolgenliteral erwartet.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8495,10 +8558,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Das Modul "{0}" kann nicht mithilfe dieses Konstrukts importiert werden. Der Spezifizierer wird nur in ein ES-Modul aufgelöst, das nicht synchron importiert werden kann. Verwenden Sie stattdessen den dynamischen Import.]]></Val>
|
||||
<Val><![CDATA[Das Modul "{0}" kann nicht mit diesem Konstrukt importiert werden. Der Spezifizierer wird nur in ein ES-Modul aufgelöst, das nicht mit "require" importiert werden kann. Verwenden Sie stattdessen einen ECMAScript-Import.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10167,6 +10233,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Das Projekt "{0}" ist veraltet, weil beim Lesen der Datei "{1}" ein Fehler aufgetreten ist.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12771,6 +12846,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Die aktuelle Datei ist ein CommonJS-Modul, dessen Importe "require"-Aufrufe generieren. Die Datei, auf die verwiesen wird, ist jedoch ein ECMAScript-Modul und kann nicht mit "require" importiert werden. Erwägen Sie stattdessen, einen dynamischen 'import("{0}")'-Aufruf zu schreiben.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13743,11 +13827,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Dieses Modul wird mit "export =" deklariert und kann nur bei Verwendung des Flags "{0}" mit einem Standardimport verwendet werden.]]></Val>
|
||||
<Val><![CDATA[Dieses Modul wird mit „export =“ deklariert und kann nur bei Verwendung des Kennzeichnens „{0}“ mit einem Standardimport verwendet werden.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13860,6 +13944,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Um diese Datei in ein ECMAScript-Modul zu konvertieren, fügen Sie das Feld "type": "module" zu "{0}" hinzu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Um diese Datei in ein ECMAScript-Modul zu konvertieren, ändern Sie die Dateierweiterung in "{0}", oder fügen Sie das Feld ''type': 'module'' zu "{1}" hinzu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Um diese Datei in ein ECMAScript-Modul zu konvertieren, ändern Sie ihre Dateierweiterung in '{0}', oder erstellen Sie eine lokale package.json-Datei mit `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Um diese Datei in ein ECMAScript-Modul zu konvertieren, erstellen Sie eine lokale package.json-Datei mit `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14445,6 +14565,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Der Typ der Instanzmembervariablen „{0}“ darf nicht auf den im Konstruktor deklarierten Bezeichner „{1}“ verweisen.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -909,6 +909,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Un tipo de tupla no se puede indizar con un valor negativo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2124,6 +2133,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Una expresión de creación de una instancia no puede ir seguida de un acceso a una propiedad.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6528,6 +6546,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El archivo es un módulo CommonJS porque “{0}” no tiene el campo “type”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El archivo es el módulo CommonJS porque “{0}” tiene el campo “type” cuyo valor no es “module”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El archivo es un módulo CommonJS porque no se encontró “package.json”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El archivo es un módulo ECMAScript porque “{0}” tiene el campo “type” con el valor “module”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7206,6 +7260,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Se esperaba un literal de cadena o identificador]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8510,10 +8573,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El módulo "{0}" no se puede importar usando esta construcción. El especificador solo se resuelve en un módulo ES, que no se puede importar de forma sincrónica. En su lugar, use la importación dinámica.]]></Val>
|
||||
<Val><![CDATA[El módulo "{0}" no se puede importar con esta construcción. El especificador solo se resuelve en un módulo ES, que no se puede importar con "require". En su lugar, use una importación de ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10185,6 +10251,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El proyecto "{0}" no está actualizado porque se produjo un error al leer el archivo "{1}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12789,6 +12864,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El archivo actual es un módulo CommonJS cuyas importaciones generarán llamadas "require"; sin embargo, el archivo al que se hace referencia es un módulo ECMAScript y no se puede importar con "require". Considere la posibilidad de escribir una llamada dinámica "import("{0}")" en su lugar.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13761,9 +13845,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Este módulo se declara con "export =" y solo se puede usar con una importación predeterminada cuando se usa la marca "{0}".]]></Val>
|
||||
</Tgt>
|
||||
@@ -13878,6 +13962,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para convertir este archivo en un módulo ECMAScript, agregue el campo `"type": "module"` a "{0}"'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para convertir este archivo en un módulo ECMAScript, cambie su extensión de archivo a "{0}" o agregue el campo `"type": "module"` a "{1}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para convertir este archivo en un módulo ECMAScript, cambie su extensión de archivo a "{0}" o cree un archivo package.json local con '{ "type": "module" }'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para convertir este archivo en un módulo ECMAScript, cree un archivo package.json local con `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14463,6 +14583,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[El tipo de variable miembro de instancia "{0}" no puede hacer referencia al identificador "{1}" declarado en el constructor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -909,6 +909,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Un type tuple ne peut pas être indexé avec une valeur négative.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2124,6 +2133,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Une expression d’instanciation ne peut pas être suivie d’un accès à la propriété.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6528,6 +6546,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le fichier est un module CommonJS, car « {0} » n’a pas de champ « type »]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le fichier est un module CommonJS, car « {0} » a un champ « type » dont la valeur n’est pas « module »]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le fichier est un module CommonJS, car « package.json » est introuvable]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le fichier est un module ECMAScript, car « {0} » a un champ « type » avec la valeur « module »]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7206,6 +7260,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Identificateur ou littéral de chaîne attendu]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8510,10 +8573,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Vous ne pouvez pas importer le module « {0} » à l’aide de cette construction. Le spécificateur se résout uniquement en module ES, que vous ne pouvez pas importer de manière synchrone. Utilisez l’importation dynamique à la place.]]></Val>
|
||||
<Val><![CDATA[Le module '{0}' ne peut pas être importé à l'aide de cette construction. Le spécificateur se résout uniquement en un module ES, qui ne peut pas être importé avec 'require'. Utilisez plutôt une importation ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10185,6 +10251,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le projet « {0} » est obsolète car une erreur s'est produite lors de la lecture du fichier « {1} »]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12789,6 +12864,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le fichier actuel est un module CommonJS dont les importations produiront des appels 'require' ; cependant, le fichier référencé est un module ECMAScript et ne peut pas être importé avec 'require'. Envisagez d'écrire un appel dynamique 'import("{0}")' à la place.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13761,11 +13845,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ce module est déclaré à l'aide de 'export =' et peut être utilisé uniquement avec une importation par défaut quand l'indicateur '{0}' est employé.]]></Val>
|
||||
<Val><![CDATA[Ce module est déclaré avec 'export =', et ne peut être utilisé qu’avec une importation par défaut lors de l’utilisation de l’indicateur '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13878,6 +13962,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pour convertir ce fichier en module ECMAScript, ajoutez le champ `"type" : "module"` à '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pour convertir ce fichier en module ECMAScript, changez son extension de fichier en '{0}', ou ajoutez le champ `"type" : "module"` à '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pour convertir ce fichier en module ECMAScript, changez son extension de fichier en '{0}' ou créez un fichier package.json local avec `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Pour convertir ce fichier en module ECMAScript, créez un fichier package.json local avec `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14463,6 +14583,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Le type de variable membre d’instance '{0}' ne peut pas référencer l’identificateur '{1}' déclaré dans le constructeur.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -900,6 +900,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Un tipo di tupla non può essere indicizzato con un valore negativo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2112,6 +2121,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Un'espressione di creazione di un'istanza non può essere seguita da un accesso a proprietà.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6516,6 +6534,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il file è un modulo CommonJS perché '{0}' non contiene il campo "type"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il file è un modulo CommonJS perché '{0}' contiene il campo "type" il cui valore non è "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il file è un modulo CommonJS perché 'package.json' non è stato trovato]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il file è un modulo ECMAScript perché '{0}' contiene il campo "type" con valore "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7194,6 +7248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Previsto identificatore o valore letterale stringa.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8498,10 +8561,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Non è possibile importare il modulo ' {0}' utilizzando questo costrutto. L'identificatore può essere solo risolto in un modulo ES, che non può essere importato in modo sincrono. Utilizzare l'importazione dinamica.]]></Val>
|
||||
<Val><![CDATA[Non è possibile importare il modulo '{0}' utilizzando questo costrutto. L'identificatore può essere solo risolto in un modulo ES, che non può essere importato con 'require'. Usare invece un'importazione ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10173,6 +10239,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il progetto '{0}' non è aggiornato perché si è verificato un errore durante la lettura del file '{1}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12777,6 +12852,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il file corrente è un modulo CommonJS le cui importazioni genereranno chiamate 'require'. Tuttavia, il file a cui si fa riferimento è un modulo ECMAScript e non può essere importato con 'require'. Provare a scrivere una chiamata 'import("{0}")' dinamica.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13749,9 +13833,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il modulo viene dichiarato con 'export =' e può essere usato solo con un'importazione predefinita quando si usa il flag '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
@@ -13866,6 +13950,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Per convertire questo file in un modulo ECMAScript, aggiungere il campo '"type": "module"' a '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Per convertire il file in un modulo ECMAScript, modificarne l'estensione in '{0}' oppure aggiungere il campo '"type": "module"' a '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Per convertire questo file in un modulo ECMAScript, modificarne l'estensione in '{0}' o creare un file package.json locale con '{ "type": "module" }'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Per convertire questo file in un modulo ECMAScript, creare un file package.json locale con '{ "type": "module" }'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14451,6 +14571,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Il tipo di variabile del membro di istanza '{0}' non può fare riferimento all'identificatore '{1}' dichiarato nel costruttore.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -900,6 +900,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[タプル型に負の値のインデックスを指定することはできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2112,6 +2121,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[インスタンス化式の後にプロパティ アクセスを続けることはできません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6516,6 +6534,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' にはフィールド "type" がないため、ファイルは CommonJS モジュールです]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' にフィールド "type" があり、値が "module" ではないため、ファイルは CommonJS モジュールです。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA["package.json" が見つからなかったため、ファイルは CommonJS モジュールです]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' には値 "module" のフィールド "type" があるため、ファイルは ECMAScript モジュールです。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7194,6 +7248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[識別子または文字列リテラルが必要です。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8498,10 +8561,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[モジュール '{0}' はこのコンストラクトではインポートできません。指定子は ES モジュールに対してのみ解決されるため、同期的にインポートすることはできません。代わりに動的インポートを使用します。]]></Val>
|
||||
<Val><![CDATA[モジュール '{0}' はこのコンストラクトではインポートできません。指定子は ES モジュールに解決されるだけであるため、'require' でインポートすることはできません。代わりに ECMAScript インポートを使用してください。]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10173,6 +10239,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[ファイル '{1}' の読み取り中にエラーが発生したため、プロジェクト '{0}' は最新ではありません]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12777,6 +12852,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[現在のファイルは CommonJS モジュールであり、このインポートでは 'require' 呼び出しが生成されますが、参照ファイルは ECMAScript モジュールであるため、'require' ではインポートできません。代わりに動的な 'import("{0}")' 呼び出しを記述することを検討してください。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13749,11 +13833,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このモジュールは 'export =' を使用して宣言されていて、'{0}' フラグを使用する場合は既定のインポートでのみ使用できます。]]></Val>
|
||||
<Val><![CDATA[このモジュールは、'export =' を使用して宣言されており、'{0}' フラグを使用する場合は既定のインポートでのみ使用できます。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13866,6 +13950,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このファイルを ECMAScript モジュールに変換するには、フィールド '"type": "module"' を '{0}' に追加します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このファイルを ECMAScript モジュールに変換するには、ファイル拡張子を '{0}' に変更するか、フィールド '"type": "module"' を '{1}' に追加します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このファイルを ECMAScript モジュールに変換するには、ファイル拡張子を '{0}' に変更するか、'{ "type": "module" }' を含むローカルの package.json ファイルを作成します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[このファイルを ECMAScript モジュールに変換するには、'{ "type": "module" }' を含むローカルの package.json ファイルを作成します。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14451,6 +14571,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[インスタンス メンバー変数 '{0}' の型は、コンストラクターで宣言された識別子 '{1}' を参照できません。]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -900,6 +900,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[튜플 형식은 음수 값으로 인덱싱할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2112,6 +2121,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[인스턴스화 식 뒤에 속성 액세스가 있을 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6516,6 +6534,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}'에 "type" 필드가 없으므로 파일이 CommonJS 모듈입니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}'에 값이 "module"이 아닌 "type" 필드가 있으므로 파일이 CommonJS 모듈입니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['package.json'을 찾을 수 없으므로 파일이 CommonJS 모듈입니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}'에 값이 "module"인 "type" 필드가 있으므로 파일이 ECMAScript 모듈입니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7194,6 +7248,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[식별자 또는 문자열 리터럴이 필요합니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8498,10 +8561,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 구성을 사용하여 모듈 '{0}'을(를) 가져올 수 없습니다. 지정자는 동기적으로 가져올 수 없는 ES 모듈로만 확인됩니다. 대신 동적 가져오기를 사용하세요.]]></Val>
|
||||
<Val><![CDATA[이 구문을 사용하여 '{0}' 모듈을 가져올 수 없습니다. 지정자는 'require'로 가져올 수 없는 ES 모듈로만 확인됩니다. ECMAScript 가져오기를 대신 사용하세요.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10173,6 +10239,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{1}' 파일을 읽는 동안 오류가 발생하여 프로젝트 '{0}'이(가) 만료되었습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12777,6 +12852,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[현재 파일은 가져오기에서 'require' 호출을 생성하는 CommonJS 모듈입니다. 그러나 참조된 파일은 ECMAScript 모듈이며 'require'로 가져올 수 없습니다. 대신 동적 'import("{0}")' 호출을 작성하는 것이 좋습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13749,9 +13833,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 모듈은 'export ='를 사용하여 선언되었으며 '{0}' 플래그를 사용하는 경우에만 기본 가져오기와 함께 사용할 수 있습니다.]]></Val>
|
||||
</Tgt>
|
||||
@@ -13866,6 +13950,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 파일을 ECMAScript 모듈로 변환하려면 `"type": "module"` 필드를 '{0}'에 추가하세요.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 파일을 ECMAScript 모듈로 변환하려면 파일 확장명을 '{0}'(으)로 변경하거나 `"type": "module"` 필드를 '{1}'에 추가하세요.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 파일을 ECMAScript 모듈로 변환하려면 파일 확장명을 '{0}'(으)로 변경하거나 `{ "type": "module" }`을 사용하여 로컬 package.json 파일을 만드세요.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[이 파일을 ECMAScript 모듈로 변환하려면 `{ "type": "module" }`을 사용하여 로컬 package.json 파일을 만드세요.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14451,6 +14571,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[인스턴스 멤버 변수 '{0}'의 형식은 생성자에 선언된 식별자 '{1}'을(를) 참조할 수 없습니다.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -890,6 +890,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można indeksować typu krotki z wartością ujemną.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2102,6 +2111,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Po wyrażeniu tworzenia wystąpienia nie może następować dostęp do właściwości.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6506,6 +6524,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Plik jest modułem CommonJS, ponieważ element „{0}” nie ma pola „type”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Plik jest modułem CommonJS, ponieważ element „{0}” ma pole „type”, którego wartość nie jest „module”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Plik jest modułem CommonJS, ponieważ nie znaleziono pliku „package.json”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Plik jest modułem ECMAScript, ponieważ element „{0}” ma pole „type” z wartością „module”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7184,6 +7238,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Oczekiwano identyfikatora lub literału ciągu.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8488,10 +8551,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Nie można zaimportować modułu „{0}” przy użyciu tej konstrukcji. Specyfikator jest rozpoznawany tylko jako moduł ES, którego nie można zaimportować synchronicznie. Zamiast tego użyj importu dynamicznego.]]></Val>
|
||||
<Val><![CDATA[Nie można zaimportować modułu „{0}” przy użyciu tej konstrukcji. Specyfikator jest rozpoznawany tylko jako moduł ES, którego nie można zaimportować za pomocą wywołania „require”. Zamiast tego użyj importu ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10160,6 +10226,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Projekt „{0}” jest nieaktualny, ponieważ wystąpił błąd podczas odczytywania pliku „{1}”]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12764,6 +12839,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bieżący plik jest modułem CommonJS, którego importy będą generować wywołania „require”; jednak przywoływany plik jest modułem ECMAScript i nie można go zaimportować za pomocą wywołania „require”. Zamiast tego rozważ zapisanie dynamicznego wywołania „import("{0}")”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13736,9 +13820,9 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ten moduł jest zadeklarowany przy użyciu składni „export =” i może być używany tylko z importem domyślnym, gdy jest używana flaga „{0}”.]]></Val>
|
||||
</Tgt>
|
||||
@@ -13853,6 +13937,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aby przekonwertować ten plik na moduł ECMAScript, dodaj pole „"type": "module"” do „{0}”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aby przekonwertować ten plik na moduł ECMAScript, zmień rozszerzenie jego pliku na „{0}” lub dodaj pole „"type": "module"” do „{1}”.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aby przekonwertować ten plik na moduł ECMAScript, zmień rozszerzenie jego pliku na „{0}” lub utwórz lokalny plik package.json z polem „{ "type": "module" }".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Aby przekonwertować ten plik na moduł ECMAScript, utwórz lokalny plik package.json z polem „{ "type": "module" }".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14438,6 +14558,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Typ zmiennej składowej wystąpienia „{0}” nie może odwoływać się do identyfikatora „{1}” zadeklarowanego w konstruktorze.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -890,6 +890,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Um tipo de tupla não pode ser indexado com um valor negativo.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2105,6 +2114,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Uma expressão de instanciação não pode ser seguida por um acesso de propriedade.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6509,6 +6527,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O arquivo é um módulo CommonJS porque '{0}' não tem o campo "type"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O arquivo é o módulo CommonJS porque '{0}' tem o campo "type" cujo valor não é "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O arquivo é um módulo CommonJS porque 'package.json' não foi encontrado]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O arquivo é o módulo ECMAScript porque '{0}' tem o campo "type" com o valor "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7187,6 +7241,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Identificador ou literal de cadeia de caracteres esperado.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8491,10 +8554,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Módulo '{0}' não pode ser importado usando esta constructo. O especificador só resolve para um módulo ES, que não pode ser importado de forma síncrona. Em vez disso, use a importação dinâmica.]]></Val>
|
||||
<Val><![CDATA[O módulo '{0}' não pode ser importado usando esta construção. O especificador resolve apenas para um módulo ES, que não pode ser importado com 'require'. Em vez disso, use uma importação ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10163,6 +10229,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O projeto '{0}' está desatualizado porque ocorreu um erro ao ler o arquivo '{1}']]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12767,6 +12842,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O arquivo atual é um módulo CommonJS cujas importações produzirão chamadas 'require'; no entanto, o arquivo referenciado é um módulo ECMAScript e não pode ser importado com 'require'. Considere escrever uma chamada 'import("{0}")' dinâmica em vez disso.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13739,11 +13823,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Esse módulo é declarado com o uso de 'export =' e só pode ser usado com uma importação padrão ao usar o sinalizador '{0}'.]]></Val>
|
||||
<Val><![CDATA[Este módulo é declarado com 'export =', e só pode ser usado com uma importação padrão ao usar o sinalizador '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13856,6 +13940,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para converter este arquivo em um módulo ECMAScript, adicione o campo `"type": "module"` a '{0}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para converter este arquivo em um módulo ECMAScript, altere sua extensão de arquivo para '{0}' ou adicione o campo `"type": "module"` para '{1}'.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para converter este arquivo em um módulo ECMAScript, altere sua extensão de arquivo para '{0}' ou crie um arquivo package.json local com `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Para converter este arquivo em um módulo ECMAScript, crie um arquivo package.json local com `{ "type": "module" }`.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14441,6 +14561,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[O tipo de variável '{0}' de membro de instância não pode referenciar o identificador '{1}' declarado no construtor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -899,6 +899,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Тип кортежа нельзя индексировать с отрицательным значением.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2111,6 +2120,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[За выражением создания экземпляра не может следовать доступ к свойству.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6515,6 +6533,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Файл является модулем CommonJS, так как "{0}" не содержит поле "type"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Файл является модулем CommonJS, так как "{0}" содержит поле "type", значение которого отличается от "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Файл является модулем CommonJS, так как "package.json" не найден]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Файл является модулем ECMAScript, так как "{0}" содержит поле "type" со значением "module"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7193,6 +7247,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Ожидался идентификатор или строковый литерал.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8497,10 +8560,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Не удается импортировать модуль "{0}" с помощью этой конструкции. Описатель разрешается только в модуль ES, который не может быть импортирован синхронно. Вместо этого используйте динамический импорт.]]></Val>
|
||||
<Val><![CDATA[Не удается импортировать модуль "{0}" с помощью этой конструкции. Описатель разрешается только в модуль ES, который нельзя импортировать с помощью "require". Вместо этого используйте импорт ECMAScript.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10172,6 +10238,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Проект "{0}" устарел из-за ошибки при чтении файла "{1}"]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12776,6 +12851,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Текущий файл является модулем CommonJS, импорт которого приведет к вызовам "require"; однако файл, на который указывает ссылка, является модулем ECMAScript и не может быть импортирован с помощью "require". Вместо этого попробуйте написать динамический вызов "import("{0}")".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13748,11 +13832,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Этот модуль объявлен с помощью "export =" и может использоваться только с импортом по умолчанию при использовании флага "{0}".]]></Val>
|
||||
<Val><![CDATA[Этот модуль объявлен с помощью оператора "export =" и может использоваться только с импортом по умолчанию при использовании флажка "{0}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13865,6 +13949,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Чтобы преобразовать этот файл в модуль ECMAScript, добавьте поле "type": "module" в "{0}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Чтобы преобразовать этот файл в модуль ECMAScript, измените его расширение на "{0}" или добавьте поле "type": "module" в "{1}".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Чтобы преобразовать этот файл в модуль ECMAScript, измените его расширение на "{0}" или создайте локальный файл package.json с "{ "type": "module" }".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Чтобы преобразовать этот файл в модуль ECMAScript, создайте локальный файл package.json с "{ "type": "module" }".]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14450,6 +14570,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Инициализатор переменной-элемента экземпляра "{0}" не может ссылаться на идентификатор "{1}", объявленный в конструкторе.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -893,6 +893,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_tuple_type_cannot_be_indexed_with_a_negative_value_2514" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A tuple type cannot be indexed with a negative value.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bir demet türünün negatif bir değerle dizini oluşturulamaz.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";A_type_assertion_expression_is_not_allowed_in_the_left_hand_side_of_an_exponentiation_expression_Con_17007" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[A type assertion expression is not allowed in the left-hand side of an exponentiation expression. Consider enclosing the expression in parentheses.]]></Val>
|
||||
@@ -2105,6 +2114,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_instantiation_expression_cannot_be_followed_by_a_property_access_1477" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An instantiation expression cannot be followed by a property access.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bir örnek oluşturma ifadesinin ardından özellik erişimi gelemez.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments_2499" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[An interface can only extend an identifier/qualified-name with optional type arguments.]]></Val>
|
||||
@@ -6509,6 +6527,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_does_not_have_field_type_1460" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' does not have field "type"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}', "type" alanına sahip olmadığından dosya CommonJS modülüdür]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_0_has_field_type_whose_value_is_not_module_1459" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because '{0}' has field "type" whose value is not "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}', değeri "module" olmayan "type" alanına sahip olduğundan dosya CommonJS modülüdür]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_CommonJS_module_because_package_json_was_not_found_1461" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is CommonJS module because 'package.json' was not found]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['package.json' bulunamadığından dosya CommonJS modülüdür]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_ECMAScript_module_because_0_has_field_type_with_value_module_1458" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is ECMAScript module because '{0}' has field "type" with value "module"]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}', değeri "module" olan "type" alanına sahip olduğundan dosya ECMAScript modülüdür]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";File_is_a_CommonJS_module_it_may_be_converted_to_an_ES_module_80001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[File is a CommonJS module; it may be converted to an ES module.]]></Val>
|
||||
@@ -7187,6 +7241,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Identifier_or_string_literal_expected_1478" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Identifier or string literal expected.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Tanımlayıcı veya sabit değerli dize bekleniyor.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";If_the_0_package_actually_exposes_this_module_consider_sending_a_pull_request_to_amend_https_Colon_S_7040" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[If the '{0}' package actually exposes this module, consider sending a pull request to amend 'https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/{1}']]></Val>
|
||||
@@ -8491,10 +8554,13 @@
|
||||
</Item>
|
||||
<Item ItemId=";Module_0_cannot_be_imported_using_this_construct_The_specifier_only_resolves_to_an_ES_module_which_c_1471" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported with 'require'. Use an ECMAScript import instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' modülü bu yapı kullanılarak içeri aktarılamaz. Tanımlayıcı yalnızca eşzamanlı olarak içeri aktarılamayan bir ES modülüne çözümleniyor. Bunun yerine dinamik içeri aktarma kullanın.]]></Val>
|
||||
<Val><![CDATA['{0}' modülü bu yapı kullanılarak içe aktarılamaz. Belirtici yalnızca 'require' ile içe aktarılamayan bir ES modülüne çözümlenir. Bunun yerine bir ECMAScript içe aktarma kullanın.]]></Val>
|
||||
</Tgt>
|
||||
<Prev Cat="Text">
|
||||
<Val><![CDATA[Module '{0}' cannot be imported using this construct. The specifier only resolves to an ES module, which cannot be imported synchronously. Use dynamic import instead.]]></Val>
|
||||
</Prev>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
@@ -10166,6 +10232,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_out_of_date_because_there_was_error_reading_file_1_6401" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is out of date because there was error reading file '{1}']]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{1}' dosyası okunurken hata oluştuğu için '{0}' projesi güncel değil]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Project_0_is_up_to_date_6361" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Project '{0}' is up to date]]></Val>
|
||||
@@ -12770,6 +12845,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_file_is_a_CommonJS_module_whose_imports_will_produce_require_calls_however_the_reference_1479" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current file is a CommonJS module whose imports will produce 'require' calls; however, the referenced file is an ECMAScript module and cannot be imported with 'require'. Consider writing a dynamic 'import("{0}")' call instead.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Geçerli dosya, içe aktarma işlemlerinin 'require' çağrıları üreteceği bir CommonJS modülüdür; ancak başvurulan dosya bir ECMAScript modülüdür ve 'require' ile içe aktarılamaz. Bunun yerine dinamik bir 'import("{0}")' çağrısı yazmayı deneyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";The_current_host_does_not_support_the_0_option_5001" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[The current host does not support the '{0}' option.]]></Val>
|
||||
@@ -13742,11 +13826,11 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";This_module_is_declared_with_using_export_and_can_only_be_used_with_a_default_import_when_using_the__2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Item ItemId=";This_module_is_declared_with_export_and_can_only_be_used_with_a_default_import_when_using_the_0_flag_2594" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[This module is declared with using 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Val><![CDATA[This module is declared with 'export =', and can only be used with a default import when using the '{0}' flag.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu modül, 'export =' kullanılarak bildirildi ve yalnızca '{0}' bayrağı kullanılırken varsayılan bir içeri aktarma ile kullanılabilir.]]></Val>
|
||||
<Val><![CDATA[Bu modül, 'export =' ile bildirildi ve yalnızca '{0}' bayrağı kullanılırken varsayılan bir içeri aktarmayla kullanılabilir.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
@@ -13859,6 +13943,42 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_add_the_field_type_Colon_module_to_0_1482" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, add the field `"type": "module"` to '{0}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu dosyayı bir ECMAScript modülüne dönüştürmek için, '{0}' dizinine `"type": "module"` alanı ekleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_add_the_field_type_Co_1481" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}', or add the field `"type": "module"` to '{1}'.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu dosyayı bir ECMAScript modülüne dönüştürmek için dosya uzantısını '{0}' olarak değiştirin veya '{1}' dizinine ''type': 'module'' alanı ekleyin.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_change_its_file_extension_to_0_or_create_a_local_packag_1480" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, change its file extension to '{0}' or create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu dosyayı bir ECMAScript modülüne dönüştürmek için dosya uzantısını '{0}' olarak değiştirin veya `{ "type": "module" }` ile yerel bir package.json dosyası oluşturun.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";To_convert_this_file_to_an_ECMAScript_module_create_a_local_package_json_file_with_type_Colon_module_1483" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[To convert this file to an ECMAScript module, create a local package.json file with `{ "type": "module" }`.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA[Bu dosyayı bir ECMAScript modülüne dönüştürmek için, `{ "type": "module" }` ile yerel bir package.json dosyası oluşturun.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Top_level_await_expressions_are_only_allowed_when_the_module_option_is_set_to_es2022_esnext_system_n_1378" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Top-level 'await' expressions are only allowed when the 'module' option is set to 'es2022', 'esnext', 'system', 'node16', or 'nodenext', and the 'target' option is set to 'es2017' or higher.]]></Val>
|
||||
@@ -14444,6 +14564,15 @@
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_instance_member_variable_0_cannot_reference_identifier_1_declared_in_the_constructor_2844" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of instance member variable '{0}' cannot reference identifier '{1}' declared in the constructor.]]></Val>
|
||||
<Tgt Cat="Text" Stat="Loc" Orig="New">
|
||||
<Val><![CDATA['{0}' örnek üyesi değişkeninin türü, oluşturucuda bildirilen '{1}' tanımlayıcısına başvuramaz.]]></Val>
|
||||
</Tgt>
|
||||
</Str>
|
||||
<Disp Icon="Str" />
|
||||
</Item>
|
||||
<Item ItemId=";Type_of_iterated_elements_of_a_yield_Asterisk_operand_must_either_be_a_valid_promise_or_must_not_con_1322" ItemType="0" PsrId="306" Leaf="true">
|
||||
<Str Cat="Text">
|
||||
<Val><![CDATA[Type of iterated elements of a 'yield*' operand must either be a valid promise or must not contain a callable 'then' member.]]></Val>
|
||||
|
||||
@@ -892,13 +892,13 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
setDocument(key: DocumentRegistryBucketKey, path: Path, sourceFile: SourceFile) {
|
||||
setDocument(key: DocumentRegistryBucketKeyWithMode, path: Path, sourceFile: SourceFile) {
|
||||
const info = Debug.checkDefined(this.getScriptInfoForPath(path));
|
||||
info.cacheSourceFile = { key, sourceFile };
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
getDocument(key: DocumentRegistryBucketKey, path: Path): SourceFile | undefined {
|
||||
getDocument(key: DocumentRegistryBucketKeyWithMode, path: Path): SourceFile | undefined {
|
||||
const info = this.getScriptInfoForPath(path);
|
||||
return info && info.cacheSourceFile && info.cacheSourceFile.key === key ? info.cacheSourceFile.sourceFile : undefined;
|
||||
}
|
||||
@@ -1709,7 +1709,7 @@ namespace ts.server {
|
||||
// created when any of the script infos are added as root of inferred project
|
||||
if (this.configFileExistenceImpactsRootOfInferredProject(configFileExistenceInfo)) {
|
||||
// If we cannot watch config file existence without configured project, close the configured file watcher
|
||||
if (!canWatchDirectory(getDirectoryPath(canonicalConfigFilePath) as Path)) {
|
||||
if (!canWatchDirectoryOrFile(getDirectoryPath(canonicalConfigFilePath) as Path)) {
|
||||
configFileExistenceInfo.watcher!.close();
|
||||
configFileExistenceInfo.watcher = noopConfigFileWatcher;
|
||||
}
|
||||
@@ -1794,7 +1794,7 @@ namespace ts.server {
|
||||
(configFileExistenceInfo.openFilesImpactedByConfigFile ||= new Map()).set(info.path, true);
|
||||
|
||||
// If there is no configured project for this config file, add the file watcher
|
||||
configFileExistenceInfo.watcher ||= canWatchDirectory(getDirectoryPath(canonicalConfigFilePath) as Path) ?
|
||||
configFileExistenceInfo.watcher ||= canWatchDirectoryOrFile(getDirectoryPath(canonicalConfigFilePath) as Path) ?
|
||||
this.watchFactory.watchFile(
|
||||
configFileName,
|
||||
(_filename, eventKind) => this.onConfigFileChanged(canonicalConfigFilePath, eventKind),
|
||||
@@ -4185,11 +4185,11 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
getPackageJsonsVisibleToFile(fileName: string, rootDir?: string): readonly PackageJsonInfo[] {
|
||||
getPackageJsonsVisibleToFile(fileName: string, rootDir?: string): readonly ProjectPackageJsonInfo[] {
|
||||
const packageJsonCache = this.packageJsonCache;
|
||||
const rootPath = rootDir && this.toPath(rootDir);
|
||||
const filePath = this.toPath(fileName);
|
||||
const result: PackageJsonInfo[] = [];
|
||||
const result: ProjectPackageJsonInfo[] = [];
|
||||
const processDirectory = (directory: Path): boolean | undefined => {
|
||||
switch (packageJsonCache.directoryHasPackageJson(directory)) {
|
||||
// Sync and check same directory again
|
||||
|
||||
@@ -2,16 +2,16 @@
|
||||
namespace ts.server {
|
||||
export interface PackageJsonCache {
|
||||
addOrUpdate(fileName: Path): void;
|
||||
forEach(action: (info: PackageJsonInfo, fileName: Path) => void): void;
|
||||
forEach(action: (info: ProjectPackageJsonInfo, fileName: Path) => void): void;
|
||||
delete(fileName: Path): void;
|
||||
get(fileName: Path): PackageJsonInfo | false | undefined;
|
||||
getInDirectory(directory: Path): PackageJsonInfo | undefined;
|
||||
get(fileName: Path): ProjectPackageJsonInfo | false | undefined;
|
||||
getInDirectory(directory: Path): ProjectPackageJsonInfo | undefined;
|
||||
directoryHasPackageJson(directory: Path): Ternary;
|
||||
searchDirectoryAndAncestors(directory: Path): void;
|
||||
}
|
||||
|
||||
export function createPackageJsonCache(host: ProjectService): PackageJsonCache {
|
||||
const packageJsons = new Map<string, PackageJsonInfo>();
|
||||
const packageJsons = new Map<string, ProjectPackageJsonInfo>();
|
||||
const directoriesWithoutPackageJson = new Map<string, true>();
|
||||
return {
|
||||
addOrUpdate,
|
||||
|
||||
@@ -558,7 +558,7 @@ namespace ts.server {
|
||||
cb,
|
||||
PollingInterval.High,
|
||||
this.projectService.getWatchOptions(this),
|
||||
WatchType.PackageJson,
|
||||
WatchType.AffectingFileLocation,
|
||||
this
|
||||
);
|
||||
}
|
||||
@@ -1172,7 +1172,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
private updateGraphWorker() {
|
||||
const oldProgram = this.program;
|
||||
const oldProgram = this.languageService.getCurrentProgram();
|
||||
Debug.assert(!this.isClosed(), "Called update graph worker of closed project");
|
||||
this.writeLog(`Starting updateGraphWorker: Project: ${this.getProjectName()}`);
|
||||
const start = timestamp();
|
||||
@@ -1181,7 +1181,7 @@ namespace ts.server {
|
||||
this.program = this.languageService.getProgram(); // TODO: GH#18217
|
||||
this.dirty = false;
|
||||
tracing?.push(tracing.Phase.Session, "finishCachingPerDirectoryResolution");
|
||||
this.resolutionCache.finishCachingPerDirectoryResolution();
|
||||
this.resolutionCache.finishCachingPerDirectoryResolution(this.program, oldProgram);
|
||||
tracing?.pop();
|
||||
|
||||
Debug.assert(oldProgram === undefined || this.program !== undefined);
|
||||
@@ -1751,7 +1751,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
getPackageJsonsVisibleToFile(fileName: string, rootDir?: string): readonly PackageJsonInfo[] {
|
||||
getPackageJsonsVisibleToFile(fileName: string, rootDir?: string): readonly ProjectPackageJsonInfo[] {
|
||||
if (this.projectService.serverMode !== LanguageServiceMode.Semantic) return emptyArray;
|
||||
return this.projectService.getPackageJsonsVisibleToFile(fileName, rootDir);
|
||||
}
|
||||
@@ -1762,7 +1762,7 @@ namespace ts.server {
|
||||
}
|
||||
|
||||
/*@internal*/
|
||||
getPackageJsonsForAutoImport(rootDir?: string): readonly PackageJsonInfo[] {
|
||||
getPackageJsonsForAutoImport(rootDir?: string): readonly ProjectPackageJsonInfo[] {
|
||||
const packageJsons = this.getPackageJsonsVisibleToFile(combinePaths(this.currentDirectory, inferredTypesContainingFile), rootDir);
|
||||
this.packageJsonsForAutoImport = new Set(packageJsons.map(p => p.fileName));
|
||||
return packageJsons;
|
||||
@@ -2177,7 +2177,6 @@ namespace ts.server {
|
||||
}
|
||||
}
|
||||
|
||||
type PackageJsonInfo = NonNullable<ReturnType<typeof resolvePackageNameToPackageJson>>;
|
||||
function getRootNamesFromPackageJson(packageJson: PackageJsonInfo, program: Program, symlinkCache: SymlinkCache, resolveJs?: boolean) {
|
||||
const entrypoints = getEntrypointsFromPackageJsonInfo(
|
||||
packageJson,
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace ts.server {
|
||||
|
||||
/*@internal*/
|
||||
export interface DocumentRegistrySourceFileCache {
|
||||
key: DocumentRegistryBucketKey;
|
||||
key: DocumentRegistryBucketKeyWithMode;
|
||||
sourceFile: SourceFile;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user